赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 2690 |
最后登录 | 2020-7-23 |
在线时间 | 49 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 110
- 在线时间
- 49 小时
- 注册时间
- 2013-8-9
- 帖子
- 75
|
3楼
楼主 |
发表于 2013-8-9 10:19:29
|
只看该作者
因为我的问题太多,又不想一个一个开贴去问,所以就这个标题了······
脚本:
①这个是在Window_Skill前插入的l- #==============================================================================
- # ■ 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
- 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
复制代码 ②然后是Window_Skill(带★的为修改项)- #==============================================================================
- # ■ Window_Skill
- #------------------------------------------------------------------------------
- # 特技画面、战斗画面、显示可以使用的特技浏览的窗口。
- #==============================================================================
- class Window_Skill < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)#改变大小和位置★★★★★
- super(0, 0, 320-50, 416)
- @actor = actor
- @column_max = 1#改变列数,原版是1..........★★★★★
- refresh
- self.index = 0
- # 战斗中的情况下将窗口移至中央并将其半透明化
- if $game_temp.in_battle
- self.y = 0
- self.height = 256+64
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取特技
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- if skill != nil
- @data.push(skill)
- end
- end
- # 如果项目数不是 0 就生成位图、重新描绘全部项目
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- skill = @data[index]
- if @actor.skill_can_use?(skill.id)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- # x = 4 + index % 2 * (288 + 32)
- # y = index / 2 * 32
- x=0########33
- y=index*32###########改变xy的计算方法★★★★★
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(skill.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
- self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
- if skill.sp_cost !=0
- self.contents.draw_text(x + 232-50, y, 48, 32, skill.sp_cost.to_s, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(skill)#★★★★★
- end
- end
复制代码 ③Window_SkillStatus- #==============================================================================
- # ■ Window_SkillStatus
- #------------------------------------------------------------------------------
- # 显示特技画面、特技使用者的窗口。
- #==============================================================================
- class Window_SkillStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)#改变大小和位置★★★★★
- super(0, 416, 640, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_actor_state(@actor, 140, 0)
- draw_actor_hp(@actor, 284, 0)
- draw_actor_sp(@actor, 460, 0)
- end
- end
复制代码 ④Scene_Skill⑤Scene_Battle3好了就这么多······
|
|