class Game_Party
# ---------------------
attr_accessor :reserve_actors
[...]
@reserve_actors = []
[...]
# ---------------------
def add_actor(actor_id) # replace this method
actor = $game_actors[actor_id]
if @actors.size < 4 and not @actors.include?(actor)
@actors.push(actor)
$game_player.refresh
else
if not @reserve_actors.include?(actor)
@reserve_actors.push(actor)
end
end
end
# ---------------------
def remove_actor(actor_id) # replace this method
@actors.delete($game_actors[actor_id])
@reserve_actors.delete($game_actors[actor_id])
$game_player.refresh
end
# ---------------------
def swap(actor1, actor2) # new method
error = false
if not @actors.include?(actor1)
error = true
end
if not @reserve_actors.include?(actor2)
error = true
end
if error
print("Cannot swap members. One or both are not in the porper position.")
end
temp = actor1
@actors.delete(actor1)
@reserve_actors.push(temp)
add_actor(actor2.id)
@reserve_actors.delete(actor2)
end
# ---------------------
def transfer_to_party(reserve_actor) # new method
if not @reserve_actors.include?(reserve_actor)
print("Warning: Requested character is not in the reserve party.")
return
end
if @actors.size == 4
print("Warning: Main party is full.")
return
end
add_actor(reserve_actor.id)
@reserve_actors.delete(reserve_actor)
end
# ---------------------
def transfer_to_reserve(main_party_actor) # new method
if not @actors.include?(main_party_actor)
print("Warning: Requested character is not in the main party.")
return
end
remove_actor(main_party_actor.id)
@reserve_actors.push(main_party_actor)
end