Project1
标题: 如何修改装备界面 [打印本页]
作者: muyumuyulnny 时间: 2012-10-19 22:09
标题: 如何修改装备界面
本帖最后由 muyumuyulnny 于 2012-10-19 22:23 编辑
要求:1. 取消窗口 Window_EquipCommand ,打开装备窗口后直接进行装备更换,因为我不想保留最强装备和全部卸下的功能。我Scene_Equip在中把和这个窗口有关的东西都删除后,窗口是不见了,可是也无法进行装备更改的操作了。
2.希望在Window_EquipStatus窗口中加入最大HP,最大MP,命中属性,必杀属性,物理回避属性,魔法回避属性,必杀回避属性,魔力值消耗比例的改变。
求详细脚本修改方法或者范例也行,话说VA的脚本和VX真是差距巨大... ...在VX中实现这样的功能只要照着原有属性加几个东西就行了。
作者: feizhaodan 时间: 2012-10-19 22:09
- #==============================================================================
- # ■ Scene_Equip
- #------------------------------------------------------------------------------
- # 装備画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Equip < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● スロットウィンドウの作成
- #--------------------------------------------------------------------------
- alias command_window_dead!!!!_create_slot_window create_slot_window
- def create_slot_window
- command_window_dead!!!!_create_slot_window
- @slot_window.activate
- @slot_window.set_handler(:cancel, method(:return_scene))
- @slot_window.set_handler(:pagedown, method(:next_actor))
- @slot_window.set_handler(:pageup, method(:prev_actor))
- end
- end
复制代码 在你之前改的基础上添加这个因该就没问题了。
作者: feizhaodan 时间: 2012-10-19 22:18
1. 取消窗口 Window_EquipCommand 我Scene_Equip在中把和这个窗口有关的东西都删除后,窗口是不见了,可是也无法进行装备更改的操作了。
这个删了之后本来就没法再更换装备了啊囧
作者: 咕噜 时间: 2012-10-20 12:45
本帖最后由 delv25 于 2012-10-20 12:57 编辑
= =废楼。
作者: q854240045 时间: 2012-10-20 12:50
delv25 发表于 2012-10-20 12:45 
这样您满意吗?插入即可,无需修改原脚本。
这是VA超级正合理的吧,但是不是装备哎……是状态……我也求装备duojige属性改变,但是我该脚本废了几个课件,没信心了!
作者: muyumuyulnny 时间: 2012-10-20 15:53
本帖最后由 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
复制代码
作者: lqtdvhtw123 时间: 2013-4-9 01:24
muyumuyulnny 发表于 2012-10-20 15:53 
关于第二个问题自己找到解决办法了,继续求第一个问题的答案。
顺便把解决办法放上来方便其他人。
效果图
请教一下,装备选择如何改成像你一样这种上下形式的。
作者: lqtdvhtw123 时间: 2013-4-9 01:50
muyumuyulnny 发表于 2012-10-20 15:53 
关于第二个问题自己找到解决办法了,继续求第一个问题的答案。
顺便把解决办法放上来方便其他人。
效果图
我用完这个脚本以后就。。。。
作者: muyumuyulnny 时间: 2013-4-9 21:18
lqtdvhtw123 发表于 2013-4-9 01:50 
我用完这个脚本以后就。。。。
全局查找
会有好几个符合选择,选择Scene_Equip中的那一个,
将def create_item_window
wx = 0
wy = @slot_window.y + @slot_window.height
ww = Graphics.width
wh = Graphics.height - wy
@item_window = Window_EquipItem.new(wx, wy, ww, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.actor = @actor
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@slot_window.item_window = @item_window
end
def create_item_window
wx = 0
wy = @slot_window.y + @slot_window.height
ww = Graphics.width
wh = Graphics.height - wy
@item_window = Window_EquipItem.new(wx, wy, ww, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.actor = @actor
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@slot_window.item_window = @item_window
end
替换为
def create_item_window
wx = @status_window.width
wy = @slot_window.y + @slot_window.height
ww = Graphics.width - @status_window.width
wh = Graphics.height - wy
@item_window = Window_EquipItem.new(wx, wy, ww, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.actor = @actor
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@slot_window.item_window = @item_window
end
def create_item_window
wx = @status_window.width
wy = @slot_window.y + @slot_window.height
ww = Graphics.width - @status_window.width
wh = Graphics.height - wy
@item_window = Window_EquipItem.new(wx, wy, ww, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.actor = @actor
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@slot_window.item_window = @item_window
end
即可,不过此时变窄的可更换装备窗口仍是两列的,如果想变成和我图上一样一列的话,把窗口的最大列数重定义为1就可以了。
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |