| 赞 | 664 |
| VIP | |
| 好人卡 | |
| 积分 | 345 |
| 经验 | |
| 最后登录 | 2024-7-10 |
| 在线时间 | 5096 小时 |
- 梦石
- 0
- 星屑
- 34463
- 在线时间
- 5096 小时
- 注册时间
- 2012-11-19
- 回帖
- 4715

|
发表于 2015-1-24 23:04:08
|
显示全部楼层
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 特技及物品的说明、角色的状态显示的窗口。
- #==============================================================================
-
- class Window_SkillHelp < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(320-50, 0, 320+50,416)
- self.contents = Bitmap.new(width - 32, height - 32)
- if $game_temp.in_battle
- self.height = 256+64
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置文本
- # text : 窗口显示的字符串
- # align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
- #--------------------------------------------------------------------------
- def set_text(skill)
- if skill !=nil
- fontsize=18 #定义文字大小
- infx=140 #定义说明文字左边内容的宽度
- y=20 #定义行距
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.font.size = fontsize
- xx=0;yy=0
- if skill.description != ""
- s=[];s=skill.description.scan(/./)
- space = self.contents.text_size(" ").width
- #一行显示21个字
- for i in s
- sss = self.contents.text_size(i)
- if (xx+sss.width)>(width - 32)#超过屏幕就换行
- yy+=y;xx=4
- end
- self.contents.draw_text(xx, yy, sss.width, sss.height, i)
- xx+=sss.width
- end
- yy+=y
- end
- self.contents.font.size = fontsize
- xx=0
- self.contents.font.color=system_color
- sss = self.contents.text_size("效果范围")
- self.contents.draw_text(xx, yy, infx, sss.height, "效果范围")
- xx=infx
- self.contents.font.color=normal_color
- case skill.scope
- when 0;i="无"
- when 1;i="敌方单体";when 2;i="敌方全体"
- when 3;i="我方单体";when 4;i="我方全体"
- when 5;i="我方濒死单体";when 6;i="我方濒死全体"
- when 7;i="自身"
- end
- self.contents.draw_text(xx, yy, infx, sss.height, i)
-
- xx=0;yy+=y
- self.contents.font.color=system_color
- self.contents.draw_text(xx, yy, infx, sss.height, "总伤害")
- $skill_power=($actor.int * skill.int_f * (100 + skill.power) / 100 + $actor.str * skill.str_f + $actor.dex * skill.dex_f* (100 + skill.power) / 100 + $actor.atk * skill.atk_f) / 100
- xx=infx
- self.contents.font.color=normal_color
- self.contents.draw_text(xx, yy, infx*2, sss.height, $skill_power.to_s)
-
- xx=0;yy+=y
- self.contents.font.color=system_color
- self.contents.draw_text(xx, yy, infx, sss.height, "伤害波动")
- xx=infx
- self.contents.font.color=normal_color
- self.contents.draw_text(xx, yy, infx*2, sss.height, ($skill_power*(100-skill.variance)*0.01).to_s+"~"+($skill_power*(100+skill.variance)*0.01).to_s)
-
- xx=0;yy+=y
- self.contents.font.color=system_color
- self.contents.draw_text(xx, yy, infx, sss.height, "伤害组成")
- xx=infx
- self.contents.font.color=normal_color
- self.contents.draw_text(xx, yy, infx*2, sss.height, skill.atk_f.to_s+"% 攻击力 ("+($actor.atk * skill.atk_f*0.01).to_s+")")
- yy+=y
- self.contents.font.color=text_color(1)
- self.contents.draw_text(xx, yy, infx*2, sss.height, skill.str_f.to_s+"% 力量 ("+($actor.str * skill.str_f*0.01).to_s+")")
- yy+=y
- self.contents.font.color=text_color(2)
- self.contents.draw_text(xx, yy, infx*2, sss.height, (skill.int_f* (100 + skill.power) / 100).to_s+"% 魔力 ("+($actor.int * skill.int_f* (100 + skill.power)*0.0001).to_s+")")
- yy+=y
- self.contents.font.color=text_color(6)
- self.contents.draw_text(xx, yy, infx*2, sss.height, (skill.dex_f* (100 + skill.power) / 100).to_s+"% 灵巧 ("+($actor.dex * skill.dex_f* (100 + skill.power)*0.0001).to_s+")")
-
-
- xx=0;yy+=y
- self.contents.font.color=system_color
- self.contents.draw_text(xx, yy, infx, sss.height, "伤害类型")
- xx=infx
- self.contents.font.color=normal_color
- self.contents.draw_text(xx, yy, infx*2, sss.height, "物理攻击"+(skill.pdef_f*101/(skill.pdef_f+skill.mdef_f+1)).to_s+"%")
- yy+=y
- self.contents.font.color=normal_color
- self.contents.draw_text(xx, yy, infx*2, sss.height, "魔法攻击"+(skill.mdef_f*101/(skill.pdef_f+skill.mdef_f+1)).to_s+"%")
-
- xx=0;yy+=y;element="";race=""
- self.contents.font.color=system_color
- self.contents.draw_text(xx, yy, infx, sss.height, "攻击属性")
- xx=infx-space;self.contents.font.color=normal_color
- s=[];s=element.scan(/./)
- #一行显示21个字
- for i in s
- sss = self.contents.text_size(i)
- if (xx+sss.width)>(width - 32)#超过屏幕就换行
- yy+=y;xx=infx
- end
- self.contents.draw_text(xx, yy, sss.width, sss.height, i)
- xx+=sss.width
- end
- xx=0;yy+=y;race=""
- for i in skill.plus_state_set
- race=race+"["+$data_states[i].name+"]"
- end
- self.contents.font.color=system_color
- self.contents.draw_text(xx, yy, infx, sss.height, "附加状态")
- xx=infx;self.contents.font.color=normal_color
- s=[];s=race.scan(/./)
- #一行显示21个字
- for i in s
- sss = self.contents.text_size(i)
- if (xx+sss.width)>(width - 32)#超过屏幕就换行
- yy+=y;xx=infx
- end
- self.contents.draw_text(xx, yy, sss.width, sss.height, i)
- xx+=sss.width
- end
- @actor = nil
- end
- self.visible = true
- end
-
- end
复制代码 |
|