forsaken2k5
Member
does anyone have the old pc script from .net ?
thanks in advance
thanks in advance
#==============================================================================#
#===================â– ===Party Changing Script by Xk8===â– =====================#
#==============================================================================#
#=====Special Thanks to Minkoff and Prexus for helping out with coding and=====#
#============teaching me more knowledge to complete this script.===============#
#==============================================================================#
#â—installation instructions: #
# 1.paste script above Main #
# 2.paste this in Scene_Save, in it's appropiate place: #
# Marshal.dump($party_variables, file) <- above line 83, #
# below Marshal.dump($game_player, file) #
# 3.paste this in Scene_Load, in it's appropiate place: #
# $party_variables = Marshal.load(file) <- above line 83, #
# below $game_player = Marshal.load(file) #
#4.add this definition in Game_Actors, above the last 'end': #
# def size #
# return @data.size #
# end #
#==============================================================================#
#â—hero 1 is automaticallly mandatory, meaning, you can't remove him/her from #
#the party. to change this, enter this line somewhere in the scene or a map: #
# $party_variables.mandatory[0] = false #
#or, change this line : #
#@mandatory = [true, false, false, false, false, false, false, false] #
#into this line: #
#@mandatory = [false, false, false, false, false, false, false, false] #
#same goes for other heroes. #
#==============================================================================#
#â—heroes 1-5 are automatically available, because in a 4 member party, member #
#5 should trigger the party switching event. #
#to make other actors available, enter this line in a Call Script, whenever you#
#want the hero to be available: #
# $party_variables.available[actor_id] = true #
#where actor_id is the id of the hero, starting at 0, where 0 is hero 1. #
#to remove a hero from the reserves, enter this line, like the above: #
# $party_variables.available[actor_id] = false #
#==============================================================================#
#â—the script contains all the heroes in the database, lining them up from hero#
#1 to the last hero, in the same order as the database, so there is no need to #
#modify the script when you add heroes to the game #
#==============================================================================#
#â—The script can be called using this line: #
# $scene = Scene_Change.new #
#this line must be pasted in either a 'Call Script' command of in another #
#Scene_ (e.g. Scene_Menu) #
#IMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANT======#
#ooh ooh something important....at the very BOTTOM of the script, you'll see
#the variables @mandatory and @available...
#each value represents an actor, so you understand that, when you have 12 #
#heroes in your party, those variables should also have 12 true/false values. #
#IMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANTIMPORTANT======#
#==============================================================================#
#â—I hope you enjoy this script.. #
# -Xk8 #
#==============================================================================#
#==============================================================================#
class Window_Change < Window_Base
def initialize(actor)
super(0, 0, 480, 264)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
refresh
end
def refresh
# Minkoff Label
@actor = $game_party.actors[0] if !@actor.is_a?(Game_Actor)
# /Minkoff Label
self.contents.clear
self.contents.font.size = $fontsize
draw_actor_graphicx(@actor, 420, 50)
draw_actor_namex(@actor, 2, 0)
draw_actor_level(@actor, 152 - 64, 0)
draw_actor_class(@actor, 222 - 64, 0)
draw_actor_hp(@actor, 0, 32, 172)
draw_actor_sp(@actor, 0, 64, 172)
self.contents.font.color = system_color
self.contents.draw_text(240, 0, 80, 32, "EXP")
self.contents.draw_text(240, 32, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(240 + 80, 0, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(240 + 80, 32, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.draw_text(240, 34, 180, 32, "______________")
self.contents.draw_text(0, 66, 180, 32, "______________")
draw_actor_parameter(@actor, 0, 96, 0)
draw_actor_parameter(@actor, 0, 128, 1)
draw_actor_parameter(@actor, 0, 160, 2)
draw_actor_parameter(@actor, 240, 64, 3)
draw_actor_parameter(@actor, 240, 96, 4)
draw_actor_parameter(@actor, 240, 128, 5)
draw_actor_parameter(@actor, 240, 160, 6)
draw_item_namex($data_weapons[@actor.weapon_id], 0, 192)
draw_item_namex($data_armors[@actor.armor1_id], 0, 210)
draw_item_namex($data_armors[@actor.armor2_id], 128, 192)
draw_item_namex($data_armors[@actor.armor3_id], 128, 210)
draw_item_namex($data_armors[@actor.armor4_id], 256, 192)
if $game_party.actors.include?(@actor)
status = "In party"
statuscolor = Color.new(255, 0, 0, 255)
$addable = 0
else
status = "Not in party"
statuscolor = Color.new(0, 255, 0, 255)
$addable = 1
end
self.contents.font.color = normal_color
self.contents.draw_text(256 + 50, 194, 120, 32, "____________")
self.contents.draw_text(256 + 50, 208, 120, 32, "Status:")
self.contents.font.color = statuscolor
self.contents.draw_text(300 + 50, 208, 120, 32, status)
end
def draw_actor_namex(actor, x, y)
self.contents.font.color = Color.new(255, 0, 0, 255)
self.contents.draw_text(x + 2, y, 120, 32, actor.name)
self.contents.draw_text(x - 2, y, 120, 32, actor.name)
self.contents.draw_text(x, y + 2, 120, 32, actor.name)
self.contents.draw_text(x, y - 2, 120, 32, actor.name)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
def draw_item_namex(item, x, y)
if item == nil
return
end
self.contents.font.size = 16
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 212, 32, item.name)
end
def draw_actor_graphicx(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, 180)
end
end
class Window_Unlocked < Window_Base
def initialize
super(0, 0, 480, 264)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
self.contents.font.size = 72
self.contents.font.color = Color.new(255, 0, 0, 255)
self.contents.draw_text(2, 71, 480, 80, "Character Locked")
self.contents.draw_text(-2, 71, 480, 80, "Character Locked")
self.contents.draw_text(0, 73, 480, 80, "Character Locked")
self.contents.draw_text(0, 69, 480, 80, "Character Locked")
self.contents.draw_text(2, 69, 480, 80, "___________________")
self.contents.draw_text(-2, 69, 480, 80, "___________________")
self.contents.draw_text(0, 71, 480, 80, "___________________")
self.contents.draw_text(0, 67, 480, 80, "___________________")
self.contents.draw_text(2, 10, 480, 80, "___________________")
self.contents.draw_text(-2, 10, 480, 80, "___________________")
self.contents.draw_text(0, 12, 480, 80, "___________________")
self.contents.draw_text(0, 8, 480, 80, "___________________")
self.contents.font.color = normal_color
self.contents.draw_text(0, 71, 480, 80, "Character Locked")
self.contents.draw_text(0, 69, 480, 80, "___________________")
self.contents.draw_text(0, 10, 480, 80, "___________________")
self.contents.font.size = 16
self.contents.font.color = normal_color
self.contents.draw_text(256 + 50, 194, 120, 32, "_________________")
self.contents.draw_text(256 + 50, 208, 120, 32, "Status:")
self.contents.font.color = system_color
self.contents.draw_text(300 + 50, 208, 120, 32, "Not Available")
end
end
class Window_Reserve < Window_Selectable
def initialize(width, commands)
super(0, 0, width, 296)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 18 + 64)
self.contents.font.name = $fontface
self.contents.font.size = 16
refresh
self.index = -1
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 22 * index, self.contents.width - 8, 18)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 22 - self.oy
self.cursor_rect.set(x, y, cursor_width, 18)
end
def disable_item(index)
draw_item(index, disabled_color)
end
end
class Window_Prompt < Window_Selectable
def initialize(width, commands)
super(0, 0, width, 96)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32 + 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
self.contents.font.color = Color.new(255, 0, 0, 255)
if $prompt_text == 0
text = " Party is full.."
elsif $prompt_text == 1
text = " Can't Empty party.."
elsif $prompt_text == 2
text = " Member is mandatory.."
else
text = ""
end
self.contents.draw_text(2, 0, 320, 32, text)
self.contents.draw_text(-2, 0, 320, 32, text)
self.contents.draw_text(0, 2, 320, 32, text)
self.contents.draw_text(0, -2, 320, 32, text)
self.contents.font.color = color
self.contents.draw_text(0, 0, 320, 32, text)
rect = Rect.new(134, 32 * index + 32, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(130, @index * 32 + 32, 36, 32)
end
end
end
class Window_Prompt2 < Window_Selectable
def initialize(width, commands)
super(0, 0, width, 128)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32 + 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
self.contents.font.color = Color.new(255, 0, 0, 255)
text = " Add Partymember?"
self.contents.draw_text(2, 0, 320, 32, text)
self.contents.draw_text(-2, 0, 320, 32, text)
self.contents.draw_text(0, 2, 320, 32, text)
self.contents.draw_text(0, -2, 320, 32, text)
self.contents.font.color = color
self.contents.draw_text(0, 0, 320, 32, text)
rect = Rect.new(134, 32 * index + 32, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 32 + 32, self.width - 32, 32)
end
end
end
class Window_Title < Window_Base
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 36
self.opacity = 0
refresh
end
def refresh
self.contents.clear
self.contents.font.color = Color.new(255, 0, 0, 255)
self.contents.draw_text(4, 0, 180, 50, "Change Party")
self.contents.draw_text(0, 0, 180, 50, "Change Party")
self.contents.draw_text(2, 2, 180, 50, "Change Party")
self.contents.draw_text(2, -2, 180, 50, "Change Party")
self.contents.font.color = normal_color
self.contents.draw_text(2, 0, 180, 50, "Change Party")
self.contents.font.size = $fontsize
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(17, 51, 120, 32, "Options")
self.contents.draw_text(15, 51, 120, 32, "Options")
self.contents.draw_text(16, 52, 120, 32, "Options")
self.contents.draw_text(16, 50, 120, 32, "Options")
self.contents.draw_text(17, 203, 120, 32, "Reserves")
self.contents.draw_text(15, 203, 120, 32, "Reserves")
self.contents.draw_text(16, 204, 120, 32, "Reserves")
self.contents.draw_text(16, 202, 120, 32, "Reserves")
self.contents.draw_text(176, 203, 130, 32, "Reserve Status")
self.contents.draw_text(174, 203, 130, 32, "Reserve Status")
self.contents.draw_text(175, 204, 130, 32, "Reserve Status")
self.contents.draw_text(175, 202, 130, 32, "Reserve Status")
self.contents.font.color = normal_color
self.contents.draw_text(16, 51, 120, 32, "Options")
self.contents.draw_text(16, 203, 120, 32, "Reserves")
self.contents.draw_text(175, 203, 130, 32, "Reserve Status")
end
end
class Window_CurrentParty < Window_Selectable
def initialize
super(0, 0, 480, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.opacity = 0
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = i * 116 + 2
y = 32
actor = $game_party.actors[i]
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(2 + 15, 0, 120, 32, "Current Party")
self.contents.draw_text(-2 + 15, 0, 120, 32, "Current Party")
self.contents.draw_text(15, 2, 120, 32, "Current Party")
self.contents.draw_text(15, -2, 120, 32, "Current Party")
self.contents.font.color = normal_color
self.contents.draw_text(15, 0, 120, 32, "Current Party")
draw_actor_graphicx(actor, x + 20, y + 82)
draw_actor_namex(actor, x, y)
draw_actor_hpx(actor, x - 40, y + 32)
draw_actor_spx(actor, x - 40, y + 64)
end
end
def draw_actor_hpx(actor, x, y, width = 144)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(hp_x + 2, y, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x - 2, y, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x, y + 2, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x, y - 2, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(hp_x + 50, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 62, y, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 46, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 58, y, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 48, y + 2, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y + 2, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 48, y - 2, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y - 2, 48, 32, actor.maxhp.to_s)
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
def draw_actor_spx(actor, x, y, width = 144)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(sp_x + 2, y, 48, 32, actor.sp.to_s, 2)
self.contents.draw_text(sp_x - 2, y, 48, 32, actor.sp.to_s, 2)
self.contents.draw_text(sp_x, y + 2, 48, 32, actor.sp.to_s, 2)
self.contents.draw_text(sp_x, y - 2, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(sp_x + 50, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 62, y, 48, 32, actor.maxsp.to_s)
self.contents.draw_text(sp_x + 46, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 58, y, 48, 32, actor.maxsp.to_s)
self.contents.draw_text(sp_x + 48, y + 2, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y - 2, 48, 32, actor.maxsp.to_s)
self.contents.draw_text(sp_x + 48, y - 2, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y + 2, 48, 32, actor.maxsp.to_s)
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
self.contents.font.size = $fontsize
end
end
def draw_actor_graphicx(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, 180)
end
def draw_actor_namex(actor, x, y)
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(x + 2, y, 120, 32, actor.name)
self.contents.draw_text(x - 2, y, 120, 32, actor.name)
self.contents.draw_text(x, y + 2, 120, 32, actor.name)
self.contents.draw_text(x, y - 2, 120, 32, actor.name)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(@index * 116 - 2, 33, 100, 32)
end
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::RIGHT)
if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::LEFT)
if (@column_max == 1 and Input.trigger?(Input::LEFT)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
end
end
end
class Scene_Change
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
s1 = "add member"
s2 = "remove member"
s3 = "cancel"
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.index = @menu_index
@command_window.opacity = 0
@command_window.y = 64
@command_window.back_opacity = 180
@prompt_window = Window_Prompt.new(320, ["Ok"])
@prompt_window.active = false
@prompt_window.visible = false
@prompt_window.x = 320 - @prompt_window.width / 2
@prompt_window.y = 240 - @prompt_window.height / 2
@prompt_window.z = 9999
@prompt_window2 = Window_Prompt2.new(320, ["Yes", "No"])
@prompt_window2.active = false
@prompt_window2.index = -1
@prompt_window2.visible = false
@prompt_window2.x = 320 - @prompt_window.width / 2
@prompt_window2.y = 240 - @prompt_window.height / 2
@prompt_window2.z = 9999
array = []
for i in 1..100
actor = $game_actors[i]
if actor != nil
name = actor.name
if $party_variables.available[i - 1] == true
array.push(i.to_s + ". " + name.to_s)
else
array.push("Character Locked")
end
end
end
@reserve_window = Window_Reserve.new(160, array)
@reserve_window.y = 184 + 32
@reserve_window.height = 264
@reserve_window.active = false
@reserve_window.back_opacity = 180
@current_party_window = Window_CurrentParty.new
@current_party_window.x = 160
@current_party_window.y = 32
@current_party_window.active = false
@current_party_window.back_opacity = 180
@actor = $game_actors[@reserve_window.index + 1]
@change_window = Window_Change.new(@actor)
@change_window.x = 160
@change_window.y = 216
@change_window.back_opacity = 180
@dummy_party_window1 = Window_Base.new(160, 64, 480, 120)
@dummy_party_window2 = Window_Base.new(180, 32 + 16, 130, 32)
@dummy_party_window3 = Window_Base.new(0, 64, 160, 120)
@dummy_party_window4 = Window_Base.new(20, 48, 120, 32)
@dummy_party_window5 = Window_Base.new(20, 200, 120, 32)
@dummy_party_window6 = Window_Base.new(180, 200, 144, 32)
@dummy_party_window1.back_opacity = 180
@dummy_party_window3.back_opacity = 180
@title_window = Window_Title.new
@title_window.x = 0
@title_window.y = -20
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@dummy_party_window1.dispose
@dummy_party_window2.dispose
@dummy_party_window3.dispose
@dummy_party_window4.dispose
@dummy_party_window5.dispose
@dummy_party_window6.dispose
@change_window.dispose
@reserve_window.dispose
@prompt_window.dispose
@title_window.dispose
@current_party_window.dispose
@command_window.dispose
end
def update
@change_window.update
@reserve_window.update
@current_party_window.update
@prompt_window2.update
@prompt_window.update
@command_window.update
if @current_party_window.active
update_party
return
end
if @command_window.active
update_command
return
end
if @reserve_window.active
update_reserve
return
end
if @prompt_window.active
update_prompt
return
end
if @prompt_window2.active
update_prompt2
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
if $game_party.actors.size == 4
$game_system.se_play($data_system.buzzer_se)
@prompt_window.visible = true
@prompt_window.active = true
$prompt_text = 0
@prompt_window.refresh
@command_window.active = false
else
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@reserve_window.active = true
@reserve_window.index = 0
end
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@current_party_window.active = true
@current_party_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
end
end
return
end
def update_party
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@current_party_window.active = false
@current_party_window.index = -1
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
@current_party_window.active = false
@current_party_window.index = -1
@prompt_window.visible = true
@prompt_window.active = true
$prompt_text = 1
@prompt_window.refresh
else
if $party_variables.mandatory[@current_party_window.index] == true
$game_system.se_play($data_system.buzzer_se)
@current_party_window.active = false
@current_party_window.index = -1
@prompt_window.visible = true
@prompt_window.active = true
$prompt_text = 2
@prompt_window.refresh
else
$game_system.se_play($data_system.decision_se)
$game_party.remove_actor($game_party.actors[@current_party_window.index].id)
end
@current_party_window.refresh
@change_window.refresh
end
return
end
end
def update_prompt
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@command_window.active = true
@prompt_window.active = false
@prompt_window.visible = false
return
end
end
def update_prompt2
if Input.trigger?(Input::C)
case @prompt_window2.index
when 0
$game_system.se_play($data_system.decision_se)
$game_party.add_actor(@reserve_window.index + 1)
@change_window.refresh
@current_party_window.refresh
if $game_party.actors.size == 4
@prompt_window2.visible = false
@prompt_window2.active = false
@prompt_window2.index = -1
@command_window.active = true
else
@prompt_window2.active = false
@prompt_window2.visible = false
@prompt_window2.index = -1
@reserve_window.active = true
end
when 1
$game_system.se_play($data_system.buzzer_se)
@prompt_window2.active = false
@prompt_window2.visible = false
@prompt_window2.index = -1
@reserve_window.active = true
return
end
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.buzzer_se)
@prompt_window2.active = false
@prompt_window2.visible = false
@reserve_window.active = true
@prompt_window2.index = -1
end
end
def update_reserve
@change_window.dispose
if $party_variables.available[@reserve_window.index] == true
changewindow = Window_Change.new($game_actors[@reserve_window.index + 1])
else
changewindow = Window_Unlocked.new
end
@change_window = changewindow
@change_window.back_opacity = 180
@change_window.x = 160
@change_window.y = 216
@old_reserve_window_index = @reserve_window.index
@change_window.refresh if @old_reserve_window_index != @reserve_window.index
@dummy_party_window6.z = 999
@title_window.z = 9990
@prompt_window.z = 9999
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@reserve_window.active = false
@reserve_window.index = -1
end
if Input.trigger?(Input::C)
if changewindow.is_a?(Window_Unlocked)
$game_system.se_play($data_system.buzzer_se)
else
if $addable == 1
$game_system.se_play($data_system.decision_se)
@reserve_window.active = false
@prompt_window2.visible = true
@prompt_window2.active = true
@prompt_window2.index = 0
$prompt_text = 3
@prompt_window2.z = 9999
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
end
end
class Scene_Title
alias xk8_s_title_main main
def main
xk8_s_title_main
$party_variables = Party_Variables.new
end
end
class Party_Variables
attr_accessor :mandatory
attr_accessor :available
def initialize
@mandatory = [true, false, false, false, false, false, false, false]
@available = [true, true, true, true, true, false, false, false]
end
end
#==============================================================================
# Easy Party Switcher by Blizzard
# Version 1.2b
# Date: 21.05.2006
# Date v1.1: 25.05.2006
# Date v1.2b: 27.05.2006
#
# NOTES: This script can add more than 4 players to battle, just scroll down to $party_max_size and make it
# a number above 4 and you will see what i mean in battle. The fifth person+ will still be active
# you just cant see them.
# So, the battle system just needs an edit to show 15 people instead of four.
#
#
# This is the official Party Switcher of:
# Chaos Project - The Three Moonsâ„¢
#
#
# Special Thanks to:
# Zeriab for pointing out a few glitches and shortening the code. =D
#
#
# IMPORTANT NOTE:
#
# Be sure to set the $party_max_size to the maximum size of your party.
# There is already a preconfiguration of 4.
#
#
# Compatibility:
#
# 99% chance of full compatibility with SDK, not tested altough. Can cause
# incompatibility with Party Change Systems. WILL corrupt your old savegames.
#
#
# Features:
#
# - Set party members for "not _available" (shown transparent in the reserve)
# - Remove party members from the reserve list ("disabled_for_party")
# - Set party members, who MUST be in the party (shown transparent in the
# current party, "must_be_in_party")
# - option either to wipe the party (for multi-party use) or only remove every
# member (except 1) from the party.
# - Easy to use and easy to switch party members
# - also supports small parties (2 or 3 members) and large parties (5 or more)
#
#
# How to use:
#
# To call this script, make a "Call script" command in an event. The syntax is:
#
# $scene = Scene_PartySwitcher.new
# or
# $scene = Scene_PartySwitcher.new(XXX)
# or
# $scene = Scene_PartySwitcher.new(XXX, 1)
# or
# $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ)
#
# - If you use the first syntax, no extra feature will be applied and you can
# switch the party as you wish.
# - If you use the second syntax, you can replace XXX for 1 to remove all party
# members except one (either one, who must be in the party or a random one), or
# replace XXX with 2, to cause a wipe party. Wiping a party will disable the
# of the current members and a NEW party of the remaining members must be
# formed. If you replace it with 3, the current party configuration will be
# stored for a later fast switch-back.
# - If you use the third sytnax, you can use the XXX as described above or just
# set it to 0 to disable it. Also the "1" in the syntax will reset any
# disabled_for_party and is made to be used after multi-party use.
# - If you use the fourth syntax you can replace ZZZ with 1 to replace the
# party with a stored one AND store the current or replace it with 2 to replace
# the party with a stored one, but without storing the current. USE THIS ONLY
# IF YOU ASSUME TO HAVE A STORED PARTY READY! This syntax will not open the
# Party Switcher and it will override the commands XXX and YYY, so you can
# replace these with any number.
#
# - Character faces go into a "Faces" folder in "Characters" and they have the
# same name as the character spritesets have.
#
# NOTE THESE ARE CALL SCRIPTS:
# Other syntaxes:
# $game_actors[XXX].not_available = true/false
# $game_actors[XXX].disabled_for_party = true/false
# $game_actors[XXX].must_be_in_party = true/false
#
# - not_available will disable the possibility of an already unlocked character
# to be in th current party.
# - disabled for party will cause the character NOT to appear in the party
# switch screen.
# - must_be_in_party will cause the character to be automatically moved into
# the current party, while switching parties and also he cannot be put in the
# reserve.
#
#
# Additional note:
#
# For your own sake, do not apply the attribute "must_be_in_party" to a
# character at the same time with "not_available" or "disabled_for_party" as
# this WILL disrupt your party and party switch system.
#
#==============================================================================
$party_max_size = 8 # change to add more players to battle
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :must_be_in_party
attr_accessor :disabled_for_party
attr_accessor :not_available
alias setup_eps_later setup
def setup(actor_id)
@must_be_in_party = false
@disabled_for_party = false
@not_available = false
setup_eps_later(actor_id)
end
end
#==============================================================================
# Game_Party
#==============================================================================
class Game_Party
def actors=(actors)
@actors = actors
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base
def draw_actor_face(actor, x, y)
if actor != nil
bitmap = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
cw = 80
ch = 80
src_rect = Rect.new(0, 0, cw, ch)
if actor.not_available or actor.must_be_in_party
self.contents.blt(x, y, bitmap, src_rect, 128)
else
self.contents.blt(x, y, bitmap, src_rect)
end
end
end
end
#==============================================================================
# Window_Current
#==============================================================================
class Window_Current < Window_Selectable
def initialize
if $party_max_size > 4
super(0, 0, 240 + 32, 480)
else
super(0, 0, 240 + 32, $party_max_size * 120)
end
@item_max = $party_max_size
self.contents = Bitmap.new(width - 32, 480 - 32 + (@item_max - 4) * 120)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 0
y = i * 120 - 4
actor = $game_party.actors[i]
self.contents.font.color = normal_color
if actor != nil
draw_actor_face(actor, x, y + 8)
draw_actor_name(actor, x + 160, y)
draw_actor_level(actor, x + 96, y)
draw_actor_hp(actor, x + 96, y + 32)
draw_actor_sp(actor, x + 96, y + 64)
end
end
end
def setactor(index_1, index_2)
temp = $game_party.actors[index_1]
$game_party.actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end
def getactor(index)
return $game_actors[$game_party.actors[index].id]
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = 0
y = (@index / @column_max) * 120 - self.oy
self.cursor_rect.set(x, y, self.width - 32, 88)
end
def clone_cursor
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = 0
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, self.width, 88)
bitmap = RPG::Cache.windowskin("Cursor_Current")
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 116
end
def top_row=(row)
row = row % row_max
self.oy = row * 120
end
def page_row_max
return (self.height / 120)
end
end
#==============================================================================
# Window_Reserve
#==============================================================================
class Window_Reserve < Window_Selectable
def initialize
super(0, 0, 400 - 32, 320)
setup
@column_max = 3
if (@item_max / @column_max) >= 3
self.contents = Bitmap.new(width - 32, @item_max / @column_max * 96)
else
self.contents = Bitmap.new(width - 32, height - 32)
end
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.active = false
self.index = -1
refresh
end
def setup
@actors = []
for i in 0...$data_actors.size
flag = false
for j in 0...$game_party.actors.size
if $game_actors[i] == $game_party.actors[j]
flag = true
end
end
if flag == false
unless $game_actors[i] == nil or $game_actors[i].disabled_for_party
@actors.push($game_actors[i])
end
end
end
@item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3
end
def refresh
self.contents.clear
for i in 0... @actors.size
drawing(@actors[i], i)
end
end
def drawing(actor, i)
x = (i % 3) * 112 + 16
y = (i / 3) * 96 - 8
self.contents.font.color = normal_color
draw_actor_face(actor, x, y + 18)
end
def getactor(index)
return @actors[index]
end
def setactor(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = @actors[index_2]
@actors[index_2] = temp
refresh
end
def setparty(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = (@index % @column_max) * 112 + 8
y = (@index / @column_max) * 96 - self.oy
self.cursor_rect.set(x, y, 96, 96)
end
def clone_cursor
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = (@index % @column_max) * 112 + 8
y = (@index / @column_max) * 96
src_rect = Rect.new(0, 0, 96, 96)
bitmap = RPG::Cache.windowskin("Cursor_Reserve")
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 96
end
def top_row=(row)
row = row % row_max
self.oy = row * 96
end
def page_row_max
return (self.height - 32) / 96
end
end
#==============================================================================
# Window_HelpStatus
#==============================================================================
class Window_HelpStatus < Window_Base
def initialize(gotactor)
super(0, 0, 400 - 32, 160)
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh(gotactor)
self.active = false
end
def refresh(actor)
self.contents.clear
if actor != nil
x = 0
y = 0
self.contents.font.color = normal_color
if actor.not_available
self.contents.draw_text(x + 8, y, 160, 32, "not available", 0)
end
draw_actor_face(actor, x, y + 40)
draw_actor_name(actor, x + 160, y + 32)
draw_actor_level(actor, x + 96, y + 32)
draw_actor_hp(actor, x + 96, y + 64)
draw_actor_sp(actor, x + 96, y + 96)
end
end
end
#==============================================================================
# Window_Warning
#==============================================================================
class Window_Warning < Window_Base
def initialize
super(0, 0, 320, 96)
self.visible = false
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.x = 320 - (width / 2)
self.y = 240 - (height / 2)
self.z = 9999
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 288, 32, "You cannot remove", 1)
self.contents.draw_text(0, 32, 288, 32, "the last party member!", 1)
end
end
#==============================================================================
# Scene_PartySwitcher
#==============================================================================
class Scene_PartySwitcher
def initialize(wipe_party = 0, reset = 0, store = 0)
@wipe_party = wipe_party
@store = store
@reset = reset
@current_window_temp = 0
@reserve_window_temp = 0
@canceler = false
@temp_window = ""
end
def main
if @store == 0
if @wipe_party == 1
setup_forced_party
elsif @wipe_party == 2
wipe_party
elsif @wipe_party == 3
store_party
wipe_party
end
@current_window = Window_Current.new
@current_window.index = 0
@current_window.active = true
@reserve_window = Window_Reserve.new
@reserve_window.x = 240 + 32
@reserve_window.y = 160
@warning_window = Window_Warning.new
actor = @reserve_window.getactor(0)
@help_window = Window_HelpStatus.new(actor)
@help_window.x = 240 + 32
if @reset == 1
actor.not_available = false
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@current_window.dispose
@reserve_window.dispose
@help_window.dispose
else
swap_parties(@store)
$scene = Scene_Map.new
end
sort_party
$game_player.refresh
Graphics.transition
end
def update
check = @reserve_window.index
if @reserve_window.active
reserve_update
@reserve_window.update
end
if check != @reserve_window.index
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
end
if @current_window.active
current_update
@current_window.update
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @canceler == false
$scene = Scene_Map.new
elsif @canceler == true
@temp_window = ""
@canceler = false
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
@current_window.refresh
@reserve_window.refresh
end
return
end
if Input.trigger?(Input::A)
sort_party
@current_window.refresh
end
end
def current_update
if Input.trigger?(Input::C)
if @canceler == false
$game_system.se_play($data_system.decision_se)
@canceler = true
@temp_actor_index = @current_window.index
@temp_window = "Current"
@current_window.clone_cursor
elsif @canceler == true
switch_members
end
return
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@current_window.active = false
@reserve_window.active = true
@current_window_temp = @current_window.index
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.index = -1
@reserve_window.index = @reserve_window_temp
if @canceler == false
@help_window.refresh(actor)
end
return
end
end
def reserve_update
if Input.trigger?(Input::C)
if @canceler == false
$game_system.se_play($data_system.decision_se)
@canceler = true
@temp_actor_index = @reserve_window.index
@temp_window = "Reserve"
@reserve_window.clone_cursor
elsif @canceler == true
switch_members
end
return
end
if (@reserve_window.index % 3) == 0
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@reserve_window.active = false
@current_window.active = true
@reserve_window_temp = @reserve_window.index
@reserve_window.index = -1
@current_window.index = @current_window_temp
end
return
end
end
def switch_members
if @temp_window == "Reserve" and @reserve_window.active
@reserve_window.setactor(@temp_actor_index, @reserve_window.index)
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
end
if @temp_window == "Current" and @current_window.active
@current_window.setactor(@temp_actor_index, @current_window.index)
end
if @temp_window == "Reserve" and @current_window.active
actor1 = @current_window.getactor(@current_window.index)
actor2 = @reserve_window.getactor(@temp_actor_index)
if call_warning(@current_window.index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@temp_actor_index, @current_window.index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window_temp)
@help_window.refresh(actor)
else
warning
end
end
if @temp_window == "Current" and @reserve_window.active
actor1 = @current_window.getactor(@temp_actor_index)
actor2 = @reserve_window.getactor(@reserve_window.index)
if call_warning(@temp_actor_index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@reserve_window.index, @temp_actor_index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
else
warning
end
end
$game_system.se_play($data_system.decision_se)
@canceler = false
@temp_window = ""
return
end
def sort_party
actors = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor != nil
actors.push($game_actors[actor.id])
end
end
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors[i]
if actor != nil
actor.must_be_in_party = false
end
end
end
def wipe_party
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor != nil
actor.not_available = true
end
end
actors = []
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors[i]
if actor != nil and actor.must_be_in_party and not actor.not_available
$game_party.add_actor(actor.id)
end
end
if $game_party.actors.size == 0
for i in 0...$data_actors.size
actor = $game_actors[i]
unless actor == nil or actor.not_available or actor.disabled_for_party
$game_party.add_actor(actor.id)
return
end
end
end
end
def setup_forced_party
actors = []
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors[i]
if actor != nil and actor.must_be_in_party and
not actor.disabled_for_party and not actor.not_available
$game_party.add_actor(actor.id)
end
end
end
def store_party
$stored_party = $game_party.actors
end
def swap_parties(swap)
temp = $game_party.actors
for i in 0...temp.size
if temp[i] != nil
temp[i].not_available = true
end
end
for i in 0...$stored_party.size
if $stored_party[i] != nil
$stored_party[i].not_available = false
end
end
$game_party.actors = $stored_party
if swap == 1
$stored_party = temp
else
$stored_party = nil
end
end
def call_warning(index, actor2)
actor1 = $game_party.actors[index]
if actor1 != nil and actor2 == nil
count = 0
for i in $game_party.actors
if i != nil
count += 1
end
end
if count <= 1
return false
end
end
return true
end
def warning
$game_system.se_play($data_system.buzzer_se)
@warning_window.visible = true
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
@warning_window.visible = false
@current_window.refresh
@reserve_window.refresh
break
end
end
return
end
end