赞 | 0 |
VIP | 11 |
好人卡 | 0 |
积分 | 1 |
经验 | 21393 |
最后登录 | 2016-5-11 |
在线时间 | 476 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 476 小时
- 注册时间
- 2011-3-22
- 帖子
- 46
|
5楼
楼主 |
发表于 2012-10-20 15:53:21
|
只看该作者
本帖最后由 muyumuyulnny 于 2012-10-20 15:56 编辑
关于第二个问题自己找到解决办法了,继续求第一个问题的答案。
顺便把解决办法放上来方便其他人。
效果图
脚本,可放置于原Window_EquipStatus之后后、main之前,或直接替换原Window_EquipStatus。可以自行继续添加其他属性,不过要一点点脚本基础。但是因为写很菜,所以太过繁琐,有人提供更简单的方法就好了。- #encoding:utf-8
- #==============================================================================
- # ■ Window_EquipStatus
- #------------------------------------------------------------------------------
- # 装备画面中,显示角色能力值变化的窗口。
- #==============================================================================
- class Window_EquipStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, window_width, window_height)
- @actor = nil
- @temp_actor = nil
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return 208
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的高度
- #--------------------------------------------------------------------------
- def window_height
- fitting_height(visible_line_number)
- end
- #--------------------------------------------------------------------------
- # ● 获取显示行数
- #--------------------------------------------------------------------------
- def visible_line_number
- return 12
- end
- #--------------------------------------------------------------------------
- # ● 设置角色
- #--------------------------------------------------------------------------
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_actor_name(@actor, 4, 0) if @actor
- 8.times {|i| draw_item(0, line_height * (1 + i), i) }
- draw_xparam_name(x + 4, y)
- draw_current_xparam(x + 94, y) if @actor
- draw_right_arrow_2(x + 126, y)
- draw_new_xparam(x + 150, y) if @temp_actor
- end
- #--------------------------------------------------------------------------
- # ● 设置更换装备后的临时角色
- #--------------------------------------------------------------------------
- def set_temp_actor(temp_actor)
- return if @temp_actor == temp_actor
- @temp_actor = temp_actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 绘制项目
- #--------------------------------------------------------------------------
- def draw_item(x, y, param_id)
- draw_param_name(x + 4, y, param_id)
- draw_current_param(x + 94, y, param_id) if @actor
- draw_right_arrow(x + 126, y)
- draw_new_param(x + 150, y, param_id) if @temp_actor
- end
- #--------------------------------------------------------------------------
- # ● 绘制能力值的名字
- #--------------------------------------------------------------------------
- def draw_param_name(x, y, param_id)
- change_color(system_color)
- draw_text(x, y, 80, line_height, Vocab::param(param_id))
- end
-
- #--------------------------------------------------------------------------
- # ● 绘制当前能力值
- #--------------------------------------------------------------------------
- def draw_current_param(x, y, param_id)
- change_color(normal_color)
- draw_text(x, y, 32, line_height, @actor.param(param_id), 2)
- end
-
- #--------------------------------------------------------------------------
- # ● 绘制右方向箭头
- #--------------------------------------------------------------------------
- def draw_right_arrow(x, y)
- change_color(system_color)
- draw_text(x, y, 22, line_height, "→", 1)
- end
- #--------------------------------------------------------------------------
- # ● 绘制更换装备后的能力值
- #--------------------------------------------------------------------------
- def draw_new_param(x, y, param_id)
- new_value = @temp_actor.param(param_id)
- change_color(param_change_color(new_value - @actor.param(param_id)))
- draw_text(x, y, 32, line_height, new_value, 2)
- end
- #--------------------------------------------------------------------------
- # ● 绘制额外能力值的名字
- #--------------------------------------------------------------------------
- def draw_xparam_name(x, y)
- change_color(system_color)
- draw_text(x, y + line_height * 6, 80, line_height, "命中率")
- draw_text(x, y + line_height * 7 , 80, line_height, "回避率")
- draw_text(x, y + line_height * 8 , 80, line_height, "必杀率")
- end
- #--------------------------------------------------------------------------
- # ● 绘制额外当前能力值
- #--------------------------------------------------------------------------
- def draw_current_xparam(x, y)
- change_color(normal_color)
- hit = @actor.xparam(0) * 100
- eva = @actor.xparam(1) * 100
- cri = @actor.xparam(2) * 100
- draw_text(x, y + line_height * 6, 32, line_height, hit.round)
- draw_text(x, y + line_height * 7, 32, line_height, eva.round)
- draw_text(x, y + line_height * 8, 32, line_height, cri.round)
- end
- #--------------------------------------------------------------------------
- # ● 绘制额外右方向箭头
- #--------------------------------------------------------------------------
- def draw_right_arrow_2(x, y)
- change_color(system_color)
- draw_text(x, y + line_height * 6, 22, line_height, "→", 1)
- draw_text(x, y + line_height * 7, 22, line_height, "→", 1)
- draw_text(x, y + line_height * 8, 22, line_height, "→", 1)
- end
- #--------------------------------------------------------------------------
- # ● 绘制更换装备后的额外能力值
- #--------------------------------------------------------------------------
- def draw_new_xparam(x, y)
- new_hit = @temp_actor.xparam(0) * 100
- change_color(param_change_color(new_hit - @actor.xparam(0)*100))
- draw_text(x, y+ line_height * 6, 32, line_height, new_hit.round, 2)
- new_eva = @temp_actor.xparam(1) * 100
- change_color(param_change_color(new_eva - @actor.xparam(1)*100))
- draw_text(x, y+ line_height * 7, 32, line_height, new_eva.round, 2)
- new_cri = @temp_actor.xparam(2) * 100
- change_color(param_change_color(new_cri - @actor.xparam(2)*100))
- draw_text(x, y+ line_height * 8, 32, line_height, new_cri.round, 2)
- end
- end
复制代码 |
|