本帖最后由 chen12311 于 2025-2-25 20:28 编辑
class Game_BattlerBase attr_accessor :equip_switch def switch @equip_switch end def switch_open if dual_wield? change_equip(1, nil) @equip_switch=true end end def switch_closs if dual_wield? change_equip(1, nil) @equip_switch=false end end end class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 获取装备栏的数组 #-------------------------------------------------------------------------- alias equip_slots_change equip_slots def equip_slots if switch return [0,1,2,3,4,4,4,4] if dual_wield? end equip_slots_change end end class Window_Selectable < Window_Base alias process_handling_change process_handling def process_handling process_handling_change return process_change if handle?(:change) && Input.trigger?(:CTRL) end def process_change Audio.se_play("Audio/SE/Equip1", 90, 100) Input.update activate call_handler(:change) end end class Scene_Equip < Scene_MenuBase alias create_slot_window_equip_change create_slot_window def create_slot_window create_slot_window_equip_change @slot_window.set_handler(:change, method(:on_item_change)) end def on_item_change if !@actor.switch @actor.switch_open elsif @actor.switch @actor.switch_closs end @slot_window.refresh @item_window.refresh end end
class Game_BattlerBase
attr_accessor :equip_switch
def switch
@equip_switch
end
def switch_open
if dual_wield?
change_equip(1, nil)
@equip_switch=true
end
end
def switch_closs
if dual_wield?
change_equip(1, nil)
@equip_switch=false
end
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 获取装备栏的数组
#--------------------------------------------------------------------------
alias equip_slots_change equip_slots
def equip_slots
if switch
return [0,1,2,3,4,4,4,4] if dual_wield?
end
equip_slots_change
end
end
class Window_Selectable < Window_Base
alias process_handling_change process_handling
def process_handling
process_handling_change
return process_change if handle?(:change) && Input.trigger?(:CTRL)
end
def process_change
Audio.se_play("Audio/SE/Equip1", 90, 100)
Input.update
activate
call_handler(:change)
end
end
class Scene_Equip < Scene_MenuBase
alias create_slot_window_equip_change create_slot_window
def create_slot_window
create_slot_window_equip_change
@slot_window.set_handler(:change, method(:on_item_change))
end
def on_item_change
if !@actor.switch
@actor.switch_open
elsif @actor.switch
@actor.switch_closs
end
@slot_window.refresh
@item_window.refresh
end
end
现已经更改 |