赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 165 |
最后登录 | 2013-4-26 |
在线时间 | 1 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1 小时
- 注册时间
- 2011-5-27
- 帖子
- 6
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 hcm 于 2013-5-10 12:56 编辑
- #==============================================================================
- # ■ 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=100 #定义说明文字左边内容的宽度
- y=20 #定义行距
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.font.size = fontsize
- xx=0
- yy=0
- 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
- self.contents.font.size = fontsize
- 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
- 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, "基础威力")
- 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.atk_f.to_s+" 魔力 "+skill.int_f.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.str_f.to_s+" 灵巧 "+skill.dex_f.to_s+" 速度 "+skill.agi_f.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.to_s+" 魔法 "+skill.mdef_f.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.variance.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.hit.to_s+"/"+skill.eva_f.to_s)
- xx=0
- yy+=y
- element=""
- race=""
- for i in skill.element_set
- if i <=8
- element =element+" "+$data_system.elements[i]
- elsif i>8 and i<=18
- race=race+" "+$data_system.elements[i]
- end
- if i>18
- break
- end
- end
- 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=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
- yy+=y
- xx=0
- 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
- xx=0
- yy+=y
- race=""
- for i in skill.minus_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
-
-
-
-
-
- [url=home.php?mod=space&uid=95897]@actor[/url] = nil
- end
- self.visible = true
- end
-
- end
复制代码 显示技能信息的 |
|