# Rewritten by giver (without author permission),
# with some wisecracks from Vincent Law
# datecode 20171027-20171104
#
# This version (18.0, "4 Lame Wannabe Grown Ups Explicit Party") CHANGELOG
# * Messed up with the original script (v. 2.0) code goal(s)
# * Added a Configuration Section (see module OtherConstance)
# * Made explicit the Status and USE of the 3rd and 4th party members
# (toggle the pair shown using Buttons L/R, like in similar Scenes)
# * Trimmed most of original and useless duplicate code
# * Cloned some original and useful duplicate code
# * Moved almost all "conflictual" methods to 'new' derived classes
module OtherConstance
XYOK = true
V_MIDDLE_TEXT = true
H_CENTER_CMDS = true
# The words associated to the commands . . .
COMMANDS_LIST = ["Item", "Skill", "Equip",
"Load", "Save", "Exit"]
# . . . and the Icons related to them
CMD_ICONS_LIST = ["034-Item03", "050-Skill07", "013-Body01",
"033-Item02", "037-Item06", "039-Item08"]
PLAYTIME_LABEL = "Playtime:"
GOLD_ICON = "032-Item01"
LOCATION_LABEL = "Place:"
CLASS_LABEL = "Class:"
NAME_LABEL = ""
NAME_COLOR = Color.new(204, 153, 0)
STATE_LABEL = "State:"
# DO NOT CHANGE THE HASH KEYS, only the Color.new values!!
BARZ_COLORS = {
'hp' => [Color.new(102, 200, 160, 0), Color.new(0, 0, 0, 0)], # Used for HPs
'sp' => [Color.new(0, 0, 0, 0), Color.new(-102, 160, -200, 0)], # Used for SPs
0 => [Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255)], # Used for ATK
1 => [Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255)], # Used for PDEF
2 => [Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255)], # Used for MDEF
3 => [Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255)], # Used for STR
4 => [Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255)], # Used for DEX
5 => [Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255)], # Used for AGI
6 => [Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255)], # Used for INT
'xp' => [Color.new(-255, 200, -86, 255), Color.new(-168, -157, 184, 255)] # Used for EXP
}
# For parameter Labels a bit longer than allowed in the DataBase
# If left EMPTY (""), the script will use the name in the DataBase
# Configured to resemble the Original v 2.0 parameter names
ALT_PARAMS_NAMING = [
"", # for "atk"
"", # for "pdef"
"Magic Defense", # for "mdef"
"", # for "str"
"", # for "dex"
"", # for "agi"
"" # for "int"
]
EXP_LABEL = "Experience"
# Base font name and text size
FONT_NAME = "Tahoma"
BASE_FONT_SIZE = 22
# Actor and Graphics NAME when there is no actor in a party position
# NOBODY graphic files must be added in the appropriate folders using
# the name set below (Characters and Battlers OR Pictures, see below)
# e.g. Default NOBODY graphics MUST be named [NOBODY].png
NOBODY = "[NOBODY]"
# If the Battler Graphic is in the Picture folder, set this to true
# Primarly for those who use a character-based (animated) Battle View
BATTLER_IS_PICTURE = false
end
class Game_Party
def family
return @actors
end
def friends
return @actors
end
def team
return @actors
end
end
# ORIGINAL VERSION CREDITS
#============================================================
# Custom Menu System
# created by: Constance
# created on: Dec. 26, 2005
# version: 2.0
# credits: Acedent Prone, Diego, Dubealex
# special thanks credits goes to: SephirothSpawn,
# couldn't have done it without you
# RMXP - Underground - The Underground Gaming Zone
#============================================================
class Window_Base < Window
# Used in class Window_PCAnimation
def draw_sprite(x, y, name, hue, pose, frame)
bitmap = RPG::Cache.character(name, hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
case pose
when 0
a = 0
when 1
a = ch
when 2
a = ch * 3
when 3
a = ch * 2
end
case frame
when 0
b = 0
when 1
b = cw
when 2
b = cw * 2
when 3
b = cw * 3
end
src_rect = Rect.new(b, a, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
# Used in Window_PCCard and Window_PCStatus
def draw_actor_barz(actor, x, y, show, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
self.contents.fill_rect(x-1, y - 1, length + 1, thick + 3, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y, length + 1, thick + 1, Color.new(0, 0, 0, 255))
w = length * e1.to_f / e2.to_f
for i in 0..thick
r = c1.red + (c2.red - c1.red) * (thick -i)/thick
g = c1.green + (c2.green - c1.green) * (thick -i)/thick
b = c1.blue + (c2.blue - c1.blue) * (thick -i)/thick
a = c1.alpha + (c2.alpha - c1.alpha) * (thick -i)/thick + 255 * i/thick
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
end
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
class Scene_Title
map_infos = load_data("Data/MapInfos.rxdata")
$map_infos = []
for key in map_infos.keys
$map_infos[key] = map_infos[key].name
end
end
class Game_Map
def name
$map_infos[@map_id]
end
end
class Window_Command2 < Window_Selectable
def initialize(commands)
super(0, 0, 270, 101)
@item_max = 6
@column_max = 3
self.opacity = 0
self.index = 0
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / 3
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 % 3 * (self.width / 3)
y = @index / 3 * 32 - self.oy
self.cursor_rect.set(x, y, 65, 32)
end
end
class Dummy_Window_Command < Window_Base
def initialize
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = OtherConstance::FONT_NAME
self.contents.font.size = OtherConstance::BASE_FONT_SIZE
self.opacity = 0
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(
-35, 0, 124, 32, OtherConstance::COMMANDS_LIST[0], 1)
self.contents.draw_text(
50, 0, 124, 32, OtherConstance::COMMANDS_LIST[1], 1)
self.contents.draw_text(
145, 0, 124, 32, OtherConstance::COMMANDS_LIST[2], 1)
self.contents.draw_text(
-35, 35, 124, 32, OtherConstance::COMMANDS_LIST[3], 1)
self.contents.draw_text(
50, 35, 124, 32, OtherConstance::COMMANDS_LIST[4], 1)
self.contents.draw_text(
140, 35, 124, 32, OtherConstance::COMMANDS_LIST[5], 1)
end
def disable_command(cindex)
self.contents.font.color = Color.new(128, 128, 128)
case cindex
when 0
self.contents.draw_text(
-35, 0, 124, 32, OtherConstance::COMMANDS_LIST[0], 1)
when 1
self.contents.draw_text(
50, 0, 124, 32, OtherConstance::COMMANDS_LIST[1], 1)
when 2
self.contents.draw_text(
145, 0, 124, 32, OtherConstance::COMMANDS_LIST[2], 1)
when 3
self.contents.draw_text(
-35, 35, 124, 32, OtherConstance::COMMANDS_LIST[3], 1)
when 4
self.contents.draw_text(
50, 35, 124, 32, OtherConstance::COMMANDS_LIST[4], 1)
when 5
self.contents.draw_text(
140, 35, 124, 32, OtherConstance::COMMANDS_LIST[5], 1)
end
self.contents.font.color = normal_color
end
end
class Dummy_Window_Command2 < Window_Base
def initialize
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents_opacity = 176
self.z = 99
refresh
end
def refresh
self.contents.clear
bitmap = RPG::Cache.icon(OtherConstance::CMD_ICONS_LIST[0])
self.contents.blt(35, 4, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon(OtherConstance::CMD_ICONS_LIST[1])
self.contents.blt(115, 4, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon(OtherConstance::CMD_ICONS_LIST[2])
self.contents.blt(205, 4, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon(OtherConstance::CMD_ICONS_LIST[3])
self.contents.blt(35, 39, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon(OtherConstance::CMD_ICONS_LIST[4])
self.contents.blt(115, 39, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon(OtherConstance::CMD_ICONS_LIST[5])
self.contents.blt(205, 39, bitmap, Rect.new(0, 0, 24, 24))
end
end
class Window_PCSelection1 < Window_Selectable
def initialize
super(-8, 50, 656, 50)
self.contents = Bitmap.new(width - 32, height - 32)
@pair = 0
get_commands
@column_max = 2
self.visible = false
self.active = false
self.z = 200
refresh
end
def get_commands
izero = @pair * 2
@commands = []
@commands.push($game_party.friends[izero])
@commands.push($game_party.friends[izero + 1])
@item_max = 0 @item_max += 1 unless @commands[1].nil? @item_max += 1 unless @commands[0].nil? self.index = @item_max == 0 ? -1 : 0 end def refresh self.contents.clear self.contents.font.color = system_color pair_s = @pair == 0 ? "[1st Pair]" : "[2nd Pair]" self.contents.draw_text(4, -6, 112, 32, pair_s) self.contents.font.color = OtherConstance::NAME_COLOR case @item_max when 0 name1 = OtherConstance::NOBODY name2 = OtherConstance::NOBODY when 1 name1 = @commands[0].name name2 = OtherConstance::NOBODY when 2 name1 = @commands[0].name name2 = @commands[1].name end self.contents.draw_text(120, -6, 144, 32, name1, 1) self.contents.draw_text(276, -6, 144, 32, name2, 1) end def pair=(current_pair) @pair = current_pair get_commands refresh end def pc_index return @pair * 2 + self.index end def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = 0 self.cursor_rect.set(116 + @index * 156, 0, 156, 20) end end class Window_PCSelection2 < Window_Base def initialize super(-8, 0, 656, 51) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false self.z = 200 refresh end def refresh self.contents.clear self.contents.font.color = system_color cx = contents.text_size("Which PC would You like to select?").width self.contents.draw_text(4, -6, cx + 4, 32, "Which PC would You like to select?") self.contents.font.color = crisis_color self.contents.draw_text(cx + 12, -6, 612 - cx, 32, "[Buttons L/R to toggle pair]", 2) end end class Window_PlayTime < Window_Base def initialize super(0, 0, 150, 101) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear self.contents.font.color = system_color self.contents.font.name = OtherConstance::FONT_NAME self.contents.font.size = OtherConstance::BASE_FONT_SIZE - 2 self.contents.draw_text(4, 0, 120, 32, OtherConstance::PLAYTIME_LABEL) @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(-15, 32, 120, 32, text, 2) end def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end class Window_LocationAndGold < Window_Base def initialize super(0, 0, 220, 101) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = OtherConstance::FONT_NAME self.contents.font.size = OtherConstance::BASE_FONT_SIZE - 2 refresh end def refresh bitmap = RPG::Cache.icon(OtherConstance::GOLD_ICON) self.contents.blt(165, y + 40, bitmap, Rect.new(0, 0, 24, 24)) cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(44, 40, 118-cx, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(164-cx, 40, cx, 32, $data_system.words.gold, 2) lx = contents.text_size(OtherConstance::LOCATION_LABEL).width self.contents.draw_text(4, -55, lx, 144, OtherConstance::LOCATION_LABEL) self.contents.font.color = normal_color self.contents.draw_text(10 + lx, 1, width - 48 - lx, 32, $game_map.name, 2) end end class Window_PCCard < Window_Base def initialize(pc_index) h = (pc_index % 2) == 1 ? 200 : 180 super(0, 0, 200, h) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = OtherConstance::FONT_NAME self.contents.font.size = OtherConstance::BASE_FONT_SIZE @pc = $game_party.friends[pc_index] refresh end def refresh self.contents.clear e1 = (@pc.nil?) ? 0 : @pc.hp e2 = (@pc.nil?) ? 1 : @pc.maxhp draw_actor_barz(@pc, x + 4, y + 81, true, 160, 4, e1, e2, OtherConstance::BARZ_COLORS['hp'][0],OtherConstance::BARZ_COLORS['hp'][1]) draw_actor_hp(@pc, x + 4, y + 55, 144) e1 = (@pc.nil?) ? 0 : @pc.sp e2 = (@pc.nil?) ? 1 : @pc.maxsp draw_actor_barz(@pc, x + 4, y + 136, true, 160, 4, e1, e2, OtherConstance::BARZ_COLORS['sp'][0], OtherConstance::BARZ_COLORS['sp'][1]) draw_actor_sp(@pc, x + 4, y + 110, 144) self.contents.font.size = OtherConstance::BASE_FONT_SIZE - 2 self.contents.draw_text(x + 50, y - 55, 144, 144, OtherConstance::CLASS_LABEL) unless @pc.nil? draw_actor_class(@pc, x + 100, y + 1) else self.contents.draw_text(x + 100, y + 1, 236, 32, " N/A") end self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________") self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:") self.contents.font.color = normal_color level_s = (@pc.nil?) ? "N/A" : @pc.level.to_s self.contents.draw_text(x + 99, y + 26, 24, 32, level_s, 2) end def draw_actor_hp(actor, x, y, width = 144) self.contents.font.name = OtherConstance::FONT_NAME self.contents.font.size = OtherConstance::BASE_FONT_SIZE - 2 self.contents.draw_text(x, y, 32, 32, $data_system.words.hp) if width - 32 >= 108 hp_x = x + width - 108 flag = true elsif width - 32 >= 48 hp_x = x + width - 48 flag = false end if actor.nil? self.contents.font.color = system_color self.contents.draw_text(hp_x + 30, y, 48, 32, "N/A") return end self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(hp_x + 30, y, 48, 32, actor.hp.to_s, 2) if flag self.contents.draw_text(hp_x + 78, y, 12, 32, "/", 1) self.contents.draw_text(hp_x + 90, y, 48, 32, actor.maxhp.to_s) end end def draw_actor_sp(actor, x, y, width = 144) self.contents.font.name = OtherConstance::FONT_NAME self.contents.font.size = OtherConstance::BASE_FONT_SIZE - 2 self.contents.draw_text(x, y, 32, 32, $data_system.words.sp) self.contents.font.color = Color.new(74, 230, 51, 225) if width - 32 >= 108 sp_x = x + width - 108 flag = true elsif width - 32 >= 48 sp_x = x + width - 48 flag = false end if actor.nil? self.contents.font.color = system_color self.contents.draw_text(sp_x + 30, y, 48, 32, "N/A") return end self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(sp_x + 30, y, 48, 32, actor.sp.to_s, 2) if flag self.contents.draw_text(sp_x + 78, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + 90, y, 48, 32, actor.maxsp.to_s) end end end class Window_PCAnimation < Window_Base def initialize(pc_index) h = (pc_index % 2) == 1 ? 200 : 180 super(0, 0, 200, h) self.contents = Bitmap.new(width - 32, height - 32) @pc = $game_party.friends[pc_index] @pose, @frame = 0, 0 self.opacity = 0 refresh end def refresh self.contents.clear unless @pc.nil? draw_sprite(25, 55, @pc.character_name, @pc.character_hue, @pose, @frame) else draw_sprite(25, 55, OtherConstance::NOBODY, 0, @pose, @frame) end end def frame_update return if (@pc.nil? or @pc.dead?) @frame == 3 ? @frame = 0 : @frame += 1 refresh end end class Window_PCStatus < Window_Base def initialize(pc_index) h = (pc_index % 2) == 1 ? 200 : 180 super(0, 0, 440, h) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = OtherConstance::FONT_NAME self.contents.font.size = OtherConstance::BASE_FONT_SIZE - 2 @pc = $game_party.friends[pc_index] refresh end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(215, -63, 144, 144, OtherConstance::STATE_LABEL) self.contents.draw_text(0, -7, 120, 32, OtherConstance::NAME_LABEL) draw_actor_name(@pc, x + 55, y - 8) unless @pc.nil? draw_actor_state(@pc, 325, -7, 144) else draw_actor_name(@pc, 325, -7, true) end e1 = (@pc.nil?) ? 0 : @pc.atk draw_actor_barz(@pc, 0, 52, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[0][0], OtherConstance::BARZ_COLORS[0][1]) draw_actor_parameter(@pc, 0, 25, 0) e1 = (@pc.nil?) ? 0 : @pc.pdef draw_actor_barz(@pc, 0, 82, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[1][0], OtherConstance::BARZ_COLORS[1][1]) draw_actor_parameter(@pc, 0, 55, 1) e1 = (@pc.nil?) ? 0 : @pc.mdef draw_actor_barz(@pc, 0, 112, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[2][0], OtherConstance::BARZ_COLORS[2][1]) draw_actor_parameter(@pc, 0, 85, 2) e1 = (@pc.nil?) ? 0 : @pc.str draw_actor_barz(@pc, 0, 142, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[3][0], OtherConstance::BARZ_COLORS[3][1]) draw_actor_parameter(@pc, 0, 115, 3) e1 = (@pc.nil?) ? 0 : @pc.dex draw_actor_barz(@pc, 190, 52, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[4][0], OtherConstance::BARZ_COLORS[4][1]) draw_actor_parameter(@pc, 190, 25, 4) e1 = (@pc.nil?) ? 0 : @pc.agi draw_actor_barz(@pc, 190, 82, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[5][0], OtherConstance::BARZ_COLORS[5][1]) draw_actor_parameter(@pc, 190, 55, 5) e1 = (@pc.nil?) ? 0 : @pc.int draw_actor_barz(@pc, 190, 112, true, 168, 1, e1, 999, OtherConstance::BARZ_COLORS[6][0], OtherConstance::BARZ_COLORS[6][1]) draw_actor_parameter(@pc, 190, 85, 6) e1 = (@pc.nil?) ? 0 : @pc.now_exp.to_f e2 = (@pc.nil?) ? 1 : @pc.next_exp == 0 ? 1 : @pc.next_exp draw_actor_barz(@pc, 190, 142, true, 168, 1, e1, e2, OtherConstance::BARZ_COLORS['xp'][0], OtherConstance::BARZ_COLORS['xp'][1]) self.contents.draw_text(190, 114, 120, 32, OtherConstance::EXP_LABEL) end def draw_actor_name(actor, x, y, state = false) unless state self.contents.font.color = OtherConstance::NAME_COLOR self.contents.font.bold = true else self.contents.font.color = normal_color end pcname = (actor.nil?) ? OtherConstance::NOBODY : actor.name self.contents.draw_text(x, y, 144, 32, pcname) self.contents.font.bold = false end def draw_actor_parameter(actor, x, y, type) case type when 0 if OtherConstance::ALT_PARAMS_NAMING[0] == "" parameter_name = $data_system.words.atk else parameter_name = OtherConstance::ALT_PARAMS_NAMING[0] end parameter_value = (actor.nil?) ? "N/A" : actor.atk when 1 if OtherConstance::ALT_PARAMS_NAMING[1] == "" parameter_name = $data_system.words.pdef else parameter_name = OtherConstance::ALT_PARAMS_NAMING[1] end parameter_value = (actor.nil?) ? "N/A" : actor.pdef when 2 if OtherConstance::ALT_PARAMS_NAMING[2] == "" parameter_name = $data_system.words.mdef else parameter_name = OtherConstance::ALT_PARAMS_NAMING[2] end parameter_value = (actor.nil?) ? "N/A" : actor.mdef when 3 if OtherConstance::ALT_PARAMS_NAMING[3] == "" parameter_name = $data_system.words.str else parameter_name = OtherConstance::ALT_PARAMS_NAMING[3] end parameter_value = (actor.nil?) ? "N/A" : actor.str when 4 if OtherConstance::ALT_PARAMS_NAMING[4] == "" parameter_name = $data_system.words.dex else parameter_name = OtherConstance::ALT_PARAMS_NAMING[4] end parameter_value = (actor.nil?) ? "N/A" : actor.dex when 5 if OtherConstance::ALT_PARAMS_NAMING[5] == "" parameter_name = $data_system.words.agi else parameter_name = OtherConstance::ALT_PARAMS_NAMING[5] end parameter_value = (actor.nil?) ? "N/A" : actor.agi when 6 if OtherConstance::ALT_PARAMS_NAMING[6] == "" parameter_name = $data_system.words.int else parameter_name = OtherConstance::ALT_PARAMS_NAMING[6] end parameter_value = (actor.nil?) ? "N/A" : actor.int end self.contents.font.color = system_color self.contents.font.size = 20 self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end end class Window_Battler < Window_Base def initialize(pc_index) h = (pc_index % 2) == 1 ? 220 : 200 super(0, 0, 280, h) self.contents = Bitmap.new(width - 32, height - 32) @pc = $game_party.friends[pc_index] self.z = 99 self.opacity = 0 self.contents_opacity = 128 refresh end def refresh self.contents.clear draw_actor_battler(@pc, x + 130, y + 200) end def draw_actor_battler(actor, x, y) unless actor.nil? unless OtherConstance::BATTLER_IS_PICTURE bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) else bitmap = RPG::Cache.picture(actor.battler_name) end else unless OtherConstance::BATTLER_IS_PICTURE bitmap = RPG::Cache.battler(OtherConstance::NOBODY, 0) else bitmap = RPG::Cache.picture(OtherConstance::NOBODY) end end cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end end class Scene_Load2 < Scene_Load def on_cancel $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(3) end end class Window_EquipLeft < Window_Base def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 144, 32, actor.name) end end class Window_SkillStatus < Window_Base def refresh self.contents.clear draw_actor_name(@actor, 0, 0, 144) draw_actor_state(@actor, 150, 0) draw_actor_hp(@actor, 270, 0) draw_actor_sp(@actor, 440, 0) end def draw_actor_name(actor, x, y, w) self.contents.font.color = OtherConstance::NAME_COLOR self.contents.draw_text(x, y, w, 32, actor.name) end end class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main @pair = 1 @update_frame = 0 @location_and_gold_window = Window_LocationAndGold.new @location_and_gold_window.x = 420 @pc_selection_window1 = Window_PCSelection1.new @pc_selection_window1.y = 50 @pc_selection_window2 = Window_PCSelection2.new @pc1_animation = Window_PCAnimation.new(0) @pc3_animation = Window_PCAnimation.new(2) @pc1_animation.y = @pc3_animation.y = 100 @pc1_animation.frame_update @pc3_animation.frame_update @pc2_animation = Window_PCAnimation.new(1) @pc4_animation = Window_PCAnimation.new(3) @pc2_animation.y = @pc4_animation.y = 280 @pc2_animation.frame_update @pc4_animation.frame_update @pc1 = Window_PCCard.new(0) @pc3 = Window_PCCard.new(2) @pc1.y = @pc3.y = 100 @pc2 = Window_PCCard.new(1) @pc4 = Window_PCCard.new(3) @pc2.y = @pc4.y = 280 @pc_status1 = Window_PCStatus.new(0) @pc_status3 = Window_PCStatus.new(2) @pc_status1.x = @pc_status3.x = 200 @pc_status1.y = @pc_status3.y = 100 @pc_status2 = Window_PCStatus.new(1) @pc_status4 = Window_PCStatus.new(3) @pc_status2.x = @pc_status4.x = 200 @pc_status2.y = @pc_status4.y = 280 @playtime_window = Window_PlayTime.new @playtime_window.x = 270 @battler1 = Window_Battler.new(0) @battler3 = Window_Battler.new(2) @battler1.x = @battler3.x = 240 @battler1.y = @battler3.y = 92 @battler2 = Window_Battler.new(1) @battler4 = Window_Battler.new(3) @battler2.x = @battler4.x = 240 @battler2.y = @battler4.y = 272 update_toggle @cursor_window = Window_Command2.new(["", "", "", "", "", ""]) @cursor_window.index = @menu_index @commands_window = Dummy_Window_Command.new if $game_party.friends.size == 0 @commands_window.disable_command(0) @commands_window.disable_command(1) @commands_window.disable_command(2) end for i in 0...4 if FileTest.exist?("Save#{i+1}.rxdata") @load_enabled = true end end unless @load_enabled @commands_window.disable_command(3) end if $game_system.save_disabled @commands_window.disable_command(4) end @icons_window = Dummy_Window_Command2.new Graphics.transition loop do Graphics.update Input.update @update_frame += 1 if @update_frame == 7 and $game_party.friends.size > 0 @update_frame = 0 @pc1_animation.frame_update @pc2_animation.frame_update @pc3_animation.frame_update @pc4_animation.frame_update end update if $scene != self break end end Graphics.freeze @location_and_gold_window.dispose @pc1.dispose @pc_status1.dispose @pc2.dispose @pc_status2.dispose @pc3.dispose @pc_status3.dispose @pc4.dispose @pc_status4.dispose @playtime_window.dispose @cursor_window.dispose @battler1.dispose @battler2.dispose @battler3.dispose @battler4.dispose @commands_window.dispose @icons_window.dispose @pc1_animation.dispose @pc2_animation.dispose @pc3_animation.dispose @pc4_animation.dispose @pc_selection_window1.dispose @pc_selection_window2.dispose end def update if Input.trigger?(Input::L) or Input.trigger?(Input::R) update_toggle return end @playtime_window.update @cursor_window.update @pc_selection_window1.update if @cursor_window.active update_command return end if @pc_selection_window1.active update_selection return end end def update_toggle @pair = (@pair + 1) % 2 @pc_selection_window1.pair = @pair if @pair == 0 @pc1.visible = true @pc_status1.visible = true @pc2.visible = true @pc_status2.visible = true @battler1.visible = true @battler2.visible = true @pc1_animation.visible = true @pc2_animation.visible = true @pc3.visible = false @pc_status3.visible = false @pc4.visible = false @pc_status4.visible = false @battler3.visible = false @battler4.visible = false @pc3_animation.visible = false @pc4_animation.visible = false else @pc1.visible = false @pc_status1.visible = false @pc2.visible = false @pc_status2.visible = false @battler1.visible = false @battler2.visible = false @pc1_animation.visible = false @pc2_animation.visible = false @pc3.visible = true @pc_status3.visible = true @pc4.visible = true @pc_status4.visible = true @battler3.visible = true @battler4.visible = true @pc3_animation.visible = true @pc4_animation.visible = true 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) if $game_party.friends.size == 0 and @cursor_window.index < 3 $game_system.se_play($data_system.buzzer_se) return end case @cursor_window.index when 0 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1, 2 $game_system.se_play($data_system.decision_se) @pc_selection_window1.visible = true @pc_selection_window2.visible = true @pc_selection_window1.active = true @pc_selection_window1.index = @pc_selection_window1.index @cursor_window.active = false when 3 unless @load_enabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Load2.new when 4 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 5 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end end def update_selection if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @cursor_window.active = true @pc_selection_window1.visible = false @pc_selection_window1.active = false @pc_selection_window2.visible = false @pc_selection_window1.index = @pc_selection_window1.index return end if Input.trigger?(Input::C) case @cursor_window.index when 1 $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@pc_selection_window1.pc_index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@pc_selection_window1.pc_index) end return end end end