只是这样子的话使用者固定为队伍首位的角色了,如果你物品设定的目标是使用者的话就会直接对领队角色使用
class Window_PartyCommand alias mf240601mcl make_command_list def make_command_list add_command(Vocab::item, :item) mf240601mcl end end class Window_ActorCommand def add_item_command;end end class Scene_Battle alias mf240601cpcw create_party_command_window def create_party_command_window mf240601cpcw @party_command_window.set_handler(:item, method(:command_item)) end def on_item_ok @item = @item_window.item $game_party.leader.input.set_item(@item.id) if !@item.need_selection? @item_window.hide turn_start elsif @item.for_opponent? select_enemy_selection else select_actor_selection end $game_party.last_item.object = @item end def on_item_cancel @item_window.hide @party_command_window.activate end alias mf240601onacok on_actor_ok def on_actor_ok return mf240601onacok unless @item_window.visible $game_party.leader.input.target_index = @actor_window.index @actor_window.hide @item_window.hide turn_start end alias mf240601onenok on_enemy_ok def on_enemy_ok return mf240601onenok unless @item_window.visible $game_party.leader.input.target_index = @enemy_window.enemy.index @enemy_window.hide @item_window.hide turn_start end alias mf240601onaccancel on_actor_cancel def on_actor_cancel return mf240601onaccancel unless @item_window.visible @actor_window.hide @item_window.activate end alias mf240601onencancel on_enemy_cancel def on_enemy_cancel return mf240601onencancel unless @item_window.visible @enemy_window.hide @item_window.activate end end
class Window_PartyCommand
alias mf240601mcl make_command_list
def make_command_list
add_command(Vocab::item, :item)
mf240601mcl
end
end
class Window_ActorCommand
def add_item_command;end
end
class Scene_Battle
alias mf240601cpcw create_party_command_window
def create_party_command_window
mf240601cpcw
@party_command_window.set_handler(:item, method(:command_item))
end
def on_item_ok
@item = @item_window.item
$game_party.leader.input.set_item(@item.id)
if !@item.need_selection?
@item_window.hide
turn_start
elsif @item.for_opponent?
select_enemy_selection
else
select_actor_selection
end
$game_party.last_item.object = @item
end
def on_item_cancel
@item_window.hide
@party_command_window.activate
end
alias mf240601onacok on_actor_ok
def on_actor_ok
return mf240601onacok unless @item_window.visible
$game_party.leader.input.target_index = @actor_window.index
@actor_window.hide
@item_window.hide
turn_start
end
alias mf240601onenok on_enemy_ok
def on_enemy_ok
return mf240601onenok unless @item_window.visible
$game_party.leader.input.target_index = @enemy_window.enemy.index
@enemy_window.hide
@item_window.hide
turn_start
end
alias mf240601onaccancel on_actor_cancel
def on_actor_cancel
return mf240601onaccancel unless @item_window.visible
@actor_window.hide
@item_window.activate
end
alias mf240601onencancel on_enemy_cancel
def on_enemy_cancel
return mf240601onencancel unless @item_window.visible
@enemy_window.hide
@item_window.activate
end
end
|