class Game_Actor < Game_Battler
# ---------------------
attr_accessor :required
[...]
@required = false
[...]
OK, add the attr_accessor under the attr_readers in the first section of Game_actor. Then add in the @required somewhere in def setup(actor_id).
class Game_Party
# ---------------------
attr_accessor :reserve_actors
[...]
@reserve_actors = []
[...]
ok, in game_party, add in the attr_accessor with the others, and then add the @reserve_actors in def initialize, under @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
ok, there are two blocks here that say replace this method... that means you find the original method, still in Game_Party, and replace them with the ones shown above. Then at the very bottom, above the last end, add in the three new methods.
class Scene_Skill
# ---------------------
def main
if @actor_index < $game_party.actors.size
@actor = $game_party.actors[@actor_index]
else
@actor = $game_party.reserve_actors[@actor_index - $game_party.actors.size]
end
@help_window = Window_Help.new
@status_window = Window_SkillStatus.new(@actor)
ok, highlight everyline between def main and @status_window, and replace it with this piece of code.
class Scene_Equip
# ---------------------
def main
if @actor_index < $game_party.actors.size
@actor = $game_party.actors[@actor_index]
else
@actor = $game_party.reserve_actors[@actor_index - $game_party.actors.size]
end
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
Same as above, but in scene_equip. highlight the lines from def main to @left_window, and replace with this method.
class Window_Base < Window
#---------------------------------------
# *Gets Required Text Color
#---------------------------------------
def required_color
return Color.new(216, 150, 20, 255)
end
ok, in window_base, find the method def knockout color and add this in underneath it.
class Scene_Battle
# ---------------------
class Scene_Battle
RESERVE_EXP_PERCENT = 100 #the percentage of exp reserve actors get
[...]
ok, in scene_battle 1 right under the class signifier, put RESERVE_EXP_PERCENT = 100 #the persentage of exp reserve actors get
that pretty much explains itself... i hope.
# ---------------------
def start_phase5
[...]
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
for i in 0...$game_party.reserve_actors.size
actor = $game_party.reserve_actors[i]
if actor.cant_get_exp? == false
actor.exp += exp * RESERVE_EXP_PERCENT / 100
end
end
$game_party.gain_gold(gold)
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
ok, in Scene_battle 2, find the method def start_phase5. if Scene_battle 2 is relatively unedited, you should see around line 168 the first line of the code block above. replace lines 168-196 with the lines of code above.
class Window_MenuStatus < Window_Selectable # replace this class
MANAGE_RESERVE_CHARACTERS = false
# ---------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
# ---------------------------
def refresh
self.contents.dispose
if MANAGE_RESERVE_CHARACTERS
@item_max = $game_party.actors.size + $game_party.reserve_actors.size
slots = $game_party.actors.size + $game_party.reserve_actors.size
else
@item_max = $game_party.actors.size
slots = $game_party.actors.size
end
self.contents = Bitmap.new(width - 32, @item_max * 120 - 32)
self.contents.clear
actor_array = []
for actor in $game_party.actors
actor_array.push(actor)
end
if MANAGE_RESERVE_CHARACTERS
for actor in $game_party.reserve_actors
actor_array.push(actor)
end
end
for i in 0...slots
x = 64
y = i * 116
actor = actor_array[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
# ---------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116 - self.oy, self.width - 32, 96)
end
if self.cursor_rect.y < 0
self.oy -= 116
refresh
update_cursor_rect
end
if self.cursor_rect.y > 348
self.oy += 116
refresh
update_cursor_rect
end
end
# ---------------------------
end
OK, replace your entire Window_MenuStatus with the code block above.
For now, leave MANAGE_RESERVE_CHARACTERS at false. i'll have that fixed once my buddy gets a look at it.
class Window_ChangeMain < Window_Selectable
# ---------------------
def initialize
super(0, 0, 320, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
# ---------------------
def refresh
self.contents.clear
self.contents.font.name = "Arial"
self.contents.font.size = 24
@item_max = 4
for i in 0..3
x = 64
y = i * 116
if $game_party.actors[i] != nil
actor = $game_party.actors[i]
else
self.contents.draw_text(0, y + 32, 288, 32, "-Empty-", 1)
next
end
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_level(actor, x + 160, y)
draw_actor_hp(actor, x, y + 32)
draw_actor_sp(actor, x, y + 64)
end
end
# ---------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
# ---------------------
end
class Window_ChangeReserve < Window_Selectable
# ---------------------
def initialize
super(320, 0, 320, 360)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
# ---------------------
def refresh
@item_max = $game_party.reserve_actors.size + 1
size = 96 + @item_max * 96 - 32
if size < 328
size = 328
end
self.contents.dispose
self.contents = Bitmap.new(width - 32, size)
self.contents.clear
self.contents.font.name = "Arial"
self.contents.font.size = 24
for i in 0...$game_party.reserve_actors.size
x = 64
y = i * 116
actor = $game_party.reserve_actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_level(actor, x + 160, y)
draw_actor_hp(actor, x, y + 32)
draw_actor_sp(actor, x, y + 64)
end
end
# ---------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116 - self.oy, self.width - 32, 96)
end
if self.cursor_rect.y < 0
self.oy -= 116
refresh
update_cursor_rect
end
if self.cursor_rect.y > 232
self.oy += 116
refresh
update_cursor_rect
end
end
# ---------------------
end
class Window_PartyChangeInfo < Window_Base
# ------------------
attr_reader :max_size
# ------------------
def initialize(max_size)
super(320, 360, 320, 120)
self.contents = Bitmap.new(width - 32, height - 32)
@max_size = max_size
refresh
end
# ------------------
def refresh
self.contents.clear
self.contents.font.name = "Arial"
self.contents.font.size = 24
text1 = "Please form a party."
text2 = "Please form a party"
text3 = "of up to " + @max_size.to_s + " members."
if @max_size < 0
print("Warning: Invalid max size for party.")
exit
end
if @max_size == 0
self.contents.draw_text(4, 0, 240, 32, text1)
end
if @max_size > 0
self.contents.draw_text(4, 0, 240, 32, text2)
self.contents.draw_text(4, 32, 240, 32, text3)
end
end
# ------------------
end
class Scene_ChangeParty
# ------------------
def initialize(max_size)
@max_size = max_size
end
# ------------------
def main
@left_window = Window_ChangeMain.new
@right_window = Window_ChangeReserve.new
@info_window = Window_PartyChangeInfo.new(@max_size)
@left_window.index = 0
@right_window.index = -1
@left_window.active = true
@right_window.active = false
@actor1 = nil
@actor2 = nil
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
$game_map.refresh
Graphics.freeze
@left_window.dispose
@right_window.dispose
@info_window.dispose
end
# ------------------
def update
@left_window.update
@right_window.update
@info_window.update
if @left_window.active
update_left
return
end
if @right_window.active
update_right
return
end
end
# ------------------
def update_left
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
place = @left_window.index
if @max_size > 0
if place >= @max_size
$game_system.se_play($data_system.buzzer_se)
return
end
end
if $game_party.actors[place] != nil
if $game_party.actors[place].required
$game_system.se_play($data_system.buzzer_se)
return
end
end
if $game_party.reserve_actors.size == 0
$game_system.se_play($data_system.decision_se)
$game_party.transfer_to_reserve($game_party.actors[place])
@left_window.refresh
@right_window.refresh
return
end
if $game_party.reserve_actors.size > 0
$game_system.se_play($data_system.decision_se)
@left_window.active = false
@right_window.index = 0
@right_window.active = true
@actor1 = $game_party.actors[place]
return
end
end
end
# ------------------
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.index = -1
@right_window.active = false
@left_window.active = true
return
end
if Input.trigger?(Input::C)
place = @right_window.index
if place == $game_party.reserve_actors.size
if @actor1 == nil
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$game_party.transfer_to_reserve(@actor1)
@right_window.index = -1
@right_window.active = false
@left_window.active = true
@left_window.refresh
@right_window.refresh
return
end
if @actor1 == nil
$game_system.se_play($data_system.decision_se)
@actor2 = $game_party.reserve_actors[place]
$game_party.transfer_to_party(@actor2)
@right_window.index = -1
@right_window.active = false
@left_window.active = true
@left_window.refresh
@right_window.refresh
return
else
@actor2 = $game_party.reserve_actors[place]
$game_system.se_play($data_system.decision_se)
$game_party.swap(@actor1, @actor2)
@right_window.index = -1
@right_window.active = false
@left_window.active = true
@left_window.refresh
@right_window.refresh
end
end
end
# ------------------
end
ok... add in the four code blocks in their own scripts above main.