#==============================================================================
# ** OldSchool Menu v1.0
#------------------------------------------------------------------------------
# The menu is displayed in a similar way as the message window.
# Modifies the main menu and its internal scenes.
# Author: Wecoc (no credits needed)
#------------------------------------------------------------------------------
# As the message box, it has a few options;
# * Position
# $game_system.menu_position = n
# ( n -> 0 (up), 1 (middle), 2 (down) )
# * Visibility
# $game_system.menu_frame = n
# ( n -> 0 (visible), 1 (invisible) )
# * Back opacity
# $game_system.menu_back_opacity = n
# (n = 160 if you want it like the Message box)
# * Commands
# $game_system.menu_commands = [commands]
#==============================================================================
class Game_System
attr_accessor :menu_position
attr_accessor :menu_frame
attr_accessor :menu_back_opacity
attr_accessor :menu_commands
alias menu_oldschool initialize unless $@
def initialize
menu_oldschool
@menu_position = 2
@menu_frame = 0
@menu_back_opacity = 255
@menu_commands = ["Item", "Skill", "Equip", "Status", "Save", "End Game"]
end
def mes_to_menu
@menu_position = @message_position
@menu_frame = @message_frame
end
end
module OLDSCHOOL
# Menu Globals
ONLY_ITEMS = true # In Window_Item only Items are shown (no Weapons or Armors)
BATTLE_SKILLS = true # Battle skills are also shown in the Menu Window_Skill
ALL_EQUIP = false # All the equip is displayed in the Window_Equip, not only
# the equippable by the actual actor
SHOW_ICONS = true # Items are drawn with their icon
PARENTHESIS = true # The item's number is displayed "(n)", no ": n"
SPHELP_ITEM = true # When you use an item, SPHelp is activated
SPHELP_SKILL = true # When you use a skill, SPHelp is activated
SPHELP_EQUIP = true # When you change your equip, SPHelp is activated
ACTOR_SEL = true # You select Skill, Equip o Status by actor (as always)
GOLD = true # When you are in Window_Item the Gold window is displayed
end
class Window_Item < Window_Selectable
def initialize
super(82 + 32, 64, 248, 192)
@column_max = 1
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
unless OLDSCHOOL::ONLY_ITEMS
# Also add weapons and items if outside of battle
unless $game_temp.in_battle
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if OLDSCHOOL::SHOW_ICONS
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
else
self.contents.draw_text(x, y, 212, 32, item.name, 0)
end
if OLDSCHOOL::PARENTHESIS
self.contents.draw_text(x + 156, y, 48, 32, "(#{number.to_s})", 2)
else
self.contents.draw_text(x + 156, y, 48, 32, ": #{number.to_s}", 2)
end
end
end
class Window_Skill < Window_Selectable
attr_accessor :actor
def initialize
super(82 + 32, 64, 306, 192)
@column_max = 1
@actor = 0
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add skill
for i in 0...$game_party.actors[@actor].skills.size
skill = $data_skills[$game_party.actors[@actor].skills[i]]
if skill != nil
if OLDSCHOOL::BATTLE_SKILLS and skill.occasion == 1
next
end
@data.push(skill)
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
skill = @data[index]
if $game_party.actors[@actor].skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if OLDSCHOOL::SHOW_ICONS
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, skill.name, 0)
else
self.contents.draw_text(x, y, 212, 32, skill.name, 0)
end
self.contents.draw_text(x + 212, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
class Window_Equip < Window_Selectable
attr_accessor :choice_window
attr_accessor :actor
def initialize(actor)
super(82 + 64, 64, 248, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
return if @choice_window.nil?
@data = []
actor = $game_party.actors[@actor]
case @choice_window.index
when 0 # Weapon
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
if OLDSCHOOL::ALL_EQUIP == false and not
actor.equippable?($data_weapons[i])
next
end
@data.push($data_weapons[i])
end
end
if actor.weapon_id != 0
@data.push($data_weapons[actor.weapon_id])
end
when 1 # Shield
for i in 1...$data_armors.size
next if $data_armors[i].kind != 0
if $game_party.armor_number(i) > 0
if OLDSCHOOL::ALL_EQUIP == false and not
actor.equippable?($data_armors[i])
next
end
@data.push($data_armors[i])
end
end
if actor.armor1_id != 0
@data.push($data_armors[actor.armor1_id])
end
when 2 # Helmet
for i in 1...$data_armors.size
next if $data_armors[i].kind != 1
if $game_party.armor_number(i) > 0
if OLDSCHOOL::ALL_EQUIP == false and not
actor.equippable?($data_armors[i])
next
end
@data.push($data_armors[i])
end
end
if actor.armor2_id != 0
@data.push($data_armors[actor.armor2_id])
end
when 3 # Body
for i in 1...$data_armors.size
next if $data_armors[i].kind != 2
if $game_party.armor_number(i) > 0
if OLDSCHOOL::ALL_EQUIP == false and not
actor.equippable?($data_armors[i])
next
end
@data.push($data_armors[i])
end
end
if actor.armor3_id != 0
@data.push($data_armors[actor.armor3_id])
end
when 4 # Accessor
for i in 1...$data_armors.size
next if $data_armors[i].kind != 3
if $game_party.armor_number(i) > 0
if OLDSCHOOL::ALL_EQUIP == false and not
actor.equippable?($data_armors[i])
next
end
@data.push($data_armors[i])
end
end
if actor.armor4_id != 0
@data.push($data_armors[actor.armor4_id])
end
end
@data.sort!{|x,y| x.id <=> y.id }
@data.uniq!
@data.push(nil)
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
actor = $game_party.actors[@actor]
return if item.nil?
self.contents.font.color = normal_color
unless actor.equippable?(item)
self.contents.font.color = disabled_color
end
if item.is_a?(RPG::Weapon)
if actor.weapon_id == item.id
self.contents.font.color = system_color
end
end
if item.is_a?(RPG::Armor)
if actor.armor1_id == item.id or actor.armor2_id == item.id or
actor.armor3_id == item.id or actor.armor4_id == item.id
self.contents.font.color = system_color
end
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if OLDSCHOOL::SHOW_ICONS
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
else
self.contents.draw_text(x, y, 212, 32, item.name, 0)
end
end
end
class Window_SHelp < Window_Base
attr_reader :line0
attr_reader :line1
attr_reader :line2
attr_reader :line3
def initialize
super(80, 0, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@line0 = ""
@line1 = ""
@line2 = ""
@line3 = ""
end
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 480, 32, @line0, 0)
self.contents.draw_text(4, 32, 480, 32, @line1, 0)
self.contents.draw_text(4, 64, 480, 32, @line2, 0)
self.contents.draw_text(4, 96, 480, 32, @line3, 0)
end
def draw_line(line, text)
case line
when 0 then @line0 = text
when 1 then @line1 = text
when 2 then @line2 = text
when 3 then @line3 = text
end
refresh
end
def draw_next_line(text)
if @line0 == ""
draw_line(0, text)
elsif @line1 == ""
draw_line(1, text)
elsif @line2 == ""
draw_line(2, text)
elsif @line3 == ""
draw_line(3, text)
end
end
def clear
@line0 = ""
@line1 = ""
@line2 = ""
@line3 = ""
refresh
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
# Make command window
@command_window = Window_Command.new(480, $game_system.menu_commands)
@command_window.index = @menu_index
@command_window.x = 80
@command_window.height = 160
@command_window.z = 100
@command_window.back_opacity = $game_system.menu_back_opacity
# Make command window
actors_array = []
for i in 0...$game_party.actors.size
actors_array.push($game_party.actors[i].name)
end
@actors_window = Window_Command.new(160, actors_array)
@actors_window.index = 0
@actors_window.x = 80 + 16
@actors_window.height = 160
@actors_window.z = 120
@actors_window.back_opacity = $game_system.menu_back_opacity
@actors_window.visible = false
@actors_window.active = false
# Make Item window
@item_window = Window_Item.new
@item_window.back_opacity = $game_system.menu_back_opacity
@item_window.z = 150
@item_window.visible = false
@item_window.active = false
# Make Gold window
@gold_window = Window_Gold.new
@gold_window.back_opacity = $game_system.menu_back_opacity
@gold_window.x = 380
@gold_window.z = 120
@gold_window.visible = false
@gold_window.active = false
# Make Skill window
@skill_window = Window_Skill.new
@skill_window.back_opacity = $game_system.menu_back_opacity
@skill_window.z = 150
@skill_window.visible = false
@skill_window.active = false
# Make Equip choice window
equipch_array = ["Weapon", "Shield", "Helmet", "Body", "Accessor"]
@equipch_window = Window_Command.new(160, equipch_array)
@equipch_window.x = 80 + 32
@equipch_window.z = 150
@equipch_window.back_opacity = $game_system.menu_back_opacity
@equipch_window.visible = false
@equipch_window.active = false
# Make Equip window
@equip_window = Window_Equip.new(0)
@equip_window.choice_window = @equipch_window
@equip_window.z = 200
@equip_window.back_opacity = $game_system.menu_back_opacity
@equip_window.visible = false
@equip_window.active = false
# Make Special Help window
@sphelp_window = Window_SHelp.new
@sphelp_window.z = 100
@sphelp_window.back_opacity = $game_system.menu_back_opacity
@sphelp_window.visible = false
@sphelp_window.active = false
# Make End window
end_array = ["To Title", "Shutdown", "Cancel"]
@end_window = Window_Command.new(192, end_array)
@end_window.x = 320 - @end_window.width / 2
@end_window.y = 240 - @end_window.height / 2
@end_window.z = 300
@end_window.back_opacity = $game_system.menu_back_opacity
@end_window.visible = false
@end_window.active = false
# Game System Features
case $game_system.menu_position
when 0 # up
@command_window.y = 16
@gold_window.y = 16 + 8
@actors_window.y = 16 + 4
@item_window.y = 16 + 8
@skill_window.y = 16 + 8
@equipch_window.y = 16 + 8
@equip_window.y = 16 + 24
@sphelp_window.y = 16
when 1 # middle
@command_window.y = 160
@gold_window.y = 160 + 8
@actors_window.y = 160 + 4
@item_window.y = 160 + 8
@skill_window.y = 160 + 8
@equipch_window.y = 160 + 8
@equip_window.y = 160 + 24
@sphelp_window.y = 160
when 2 # down
@command_window.y = 304
@gold_window.y = 304 - 24
@actors_window.y = 304 - 16
@item_window.y = 304 - 24
@skill_window.y = 304 - 24
@equipch_window.y = 304 - 24
@equip_window.y = 304 - 48
@sphelp_window.y = 304
end
if $game_system.menu_frame == 0
@command_window.opacity = 255
@actors_window.opacity = 255
@item_window.opacity = 255
@gold_window.opacity = 255
@skill_window.opacity = 255
@equipch_window.opacity = 255
@equip_window.opacity = 255
@sphelp_window.opacity = 255
@end_window.opacity = 255
else
@command_window.opacity = 0
@actors_window.opacity = 0
@item_window.opacity = 0
@gold_window.opacity = 0
@skill_window.opacity = 0
@equipch_window.opacity = 0
@equip_window.opacity = 0
@sphelp_window.opacity = 0
@end_window.opacity = 0
end
# If number of party members is 0
if $game_party.actors.size == 0
# Disable Item, Skill, Equip and Status
for i in 0...$game_system.menu_commands.size
if $game_system.menu_commands[i] == "Item" or
$game_system.menu_commands[i] == "Skill" or
$game_system.menu_commands[i] == "Equip" or
$game_system.menu_commands[i] == "Status"
@command_window.disable_item(i)
end
end
end
# If save is forbidden
if $game_system.save_disabled
# Disable Save
for i in 0...$game_system.menu_commands.size
if $game_system.menu_commands[i] == "Save"
@command_window.disable_item(i)
end
end
end
# Execute transition
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@command_window.dispose
@actors_window.dispose
@gold_window.dispose
@item_window.dispose
@skill_window.dispose
@equipch_window.dispose
@equip_window.dispose
@end_window.dispose
@sphelp_window.dispose
@spriteset.dispose
end
def update
@command_window.update
@actors_window.update
@item_window.update
@skill_window.update
@equipch_window.update
@equip_window.update
@end_window.update
@sphelp_window.update
@gold_window.update
$game_map.update
$game_system.map_interpreter.update
$game_system.update
$game_screen.update
@spriteset.update
if @command_window.active
update_command
return
end
if @actors_window.active
update_actors
return
end
if @item_window.active
update_item
return
end
if @skill_window.active
update_skill
return
end
if @equipch_window.active
update_equipch
return
end
if @equip_window.active
update_equip
return
end
if @sphelp_window.active
update_sphelp
return
end
if @end_window.active
update_end
return
end
end
def disable_equipch
@equipch_window.draw_item(0, @equipch_window.normal_color)
@equipch_window.draw_item(1, @equipch_window.normal_color)
@equipch_window.draw_item(2, @equipch_window.normal_color)
@equipch_window.draw_item(3, @equipch_window.normal_color)
@equipch_window.draw_item(4, @equipch_window.normal_color)
actor = $data_actors[$game_party.actors[@actors_window.index].id]
@equipch_window.disable_item(0) if actor.weapon_fix
@equipch_window.disable_item(1) if actor.armor1_fix
@equipch_window.disable_item(2) if actor.armor2_fix
@equipch_window.disable_item(3) if actor.armor3_fix
@equipch_window.disable_item(4) if actor.armor4_fix
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.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case $game_system.menu_commands[@command_window.index]
when "Item"
$game_system.se_play($data_system.decision_se)
@item_window.index = 0
if OLDSCHOOL::GOLD
@gold_window.visible = true
end
@item_window.visible = true
@item_window.active = true
@command_window.active = false
when "Skill"
$game_system.se_play($data_system.decision_se)
if OLDSCHOOL::ACTOR_SEL
@actors_window.index = 0
@actors_window.visible = true
@actors_window.active = true
else
@skill_window.index = 0
@skill_window.visible = true
@skill_window.active = true
end
@command_window.active = false
when "Equip"
$game_system.se_play($data_system.decision_se)
if OLDSCHOOL::ACTOR_SEL
@actors_window.index = 0
@actors_window.visible = true
@actors_window.active = true
else
@equipch_window.index = 0
disable_equipch
@equipch_window.visible = true
@equipch_window.active = true
end
@command_window.active = false
when "Status"
$game_system.se_play($data_system.decision_se)
if OLDSCHOOL::ACTOR_SEL
@actors_window.index = 0
@actors_window.visible = true
@actors_window.active = true
@command_window.active = false
else
$scene = Scene_Status.new(0)
end
when "Save"
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 "End Game"
$game_system.se_play($data_system.decision_se)
@end_window.visible = true
@end_window.active = true
@command_window.active = false
end
return
end
end
def update_actors
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@actors_window.visible = false
@actors_window.active = false
return
end
if Input.trigger?(Input::C)
case $game_system.menu_commands[@command_window.index]
when "Skill"
$game_system.se_play($data_system.decision_se)
@skill_window.actor = @actors_window.index
@skill_window.refresh
@skill_window.index = 0
@skill_window.visible = true
@skill_window.active = true
@actors_window.active = false
when "Equip"
$game_system.se_play($data_system.decision_se)
@equipch_window.refresh
@equipch_window.index = 0
disable_equipch
@equipch_window.visible = true
@equipch_window.active = true
@actors_window.active = false
when "Status"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@actors_window.index)
end
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@item_window.visible = false
@item_window.active = false
@gold_window.visible = false
return
end
if Input.trigger?(Input::C)
item = @item_window.item
unless item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if item.scope >= 3
if item.scope == 4 || item.scope == 6
used = false
for i in $game_party.actors
used |= i.item_effect(item)
end
else
used = $game_party.actors[0].item_effect(item)
end
if used
$game_system.se_play(item.menu_se)
if item.consumable
$game_party.lose_item(item.id, 1)
@item_window.refresh
end
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
$scene = Scene_Map.new
return
end
if OLDSCHOOL::SPHELP_ITEM
@command_window.visible = false
@gold_window.visible = false
@item_window.visible = false
@item_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_item_help(item)
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
else
if item.common_event_id > 0
$game_temp.common_event_id = item.common_event_id
$game_system.se_play(item.menu_se)
if item.consumable
$game_party.lose_item(item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_skill
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if OLDSCHOOL::ACTOR_SEL
@actors_window.active = true
else
@command_window.active = true
end
@skill_window.visible = false
@skill_window.active = false
return
end
if Input.trigger?(Input::C)
skill = @skill_window.skill
actor = @skill_window.actor
if skill == nil or not actor.skill_can_use?(skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if skill.scope >= 3
if skill.scope == 4 || skill.scope == 6
used = false
for i in $game_party.actors
used |= i.skill_effect(actor, skill)
end
else
used = actor.skill_effect(actor, skill)
end
# If skill was used
if used
$game_system.se_play(skill.menu_se)
actor.sp -= skill.sp_cost
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if skill.common_event_id > 0
$game_temp.common_event_id = skill.common_event_id
$scene = Scene_Map.new
return
end
if OLDSCHOOL::SPHELP_SKILL
@command_window.visible = false
@actors_window.visible = false
@skill_window.visible = false
@skill_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_skill_help(skill)
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
else
if skill.common_event_id > 0
$game_temp.common_event_id = skill.common_event_id
$game_system.se_play(skill.menu_se)
actor.sp -= skill.sp_cost
$scene = Scene_Map.new
return
end
end
end
end
def update_equipch
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if OLDSCHOOL::ACTOR_SEL
@actors_window.active = true
else
@command_window.active = true
end
@equipch_window.visible = false
@equipch_window.active = false
return
end
if Input.trigger?(Input::C)
actor = $data_actors[$game_party.actors[@actors_window.index].id]
case @equipch_window.index
when 0 # Weapon
if actor.weapon_fix
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@equip_window.actor = @actors_window.index
@equip_window.refresh
@equip_window.index = 0
@equip_window.active = true
@equip_window.visible = true
@equipch_window.active = false
end
when 1 # Shield
if actor.armor1_fix
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@equip_window.actor = @actors_window.index
@equip_window.refresh
@equip_window.index = 0
@equip_window.active = true
@equip_window.visible = true
@equipch_window.active = false
end
when 2 # Helmet
if actor.armor2_fix
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@equip_window.actor = @actors_window.index
@equip_window.refresh
@equip_window.index = 0
@equip_window.active = true
@equip_window.visible = true
@equipch_window.active = false
end
when 3 # Body
if actor.armor3_fix
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@equip_window.actor = @actors_window.index
@equip_window.refresh
@equip_window.index = 0
@equip_window.active = true
@equip_window.visible = true
@equipch_window.active = false
end
when 4 # Accessor
if actor.armor4_fix
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@equip_window.actor = @actors_window.index
@equip_window.refresh
@equip_window.index = 0
@equip_window.active = true
@equip_window.visible = true
@equipch_window.active = false
end
end
end
end
def update_equip
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@equipch_window.active = true
@equip_window.visible = false
@equip_window.active = false
return
end
if Input.trigger?(Input::C)
item = @equip_window.item
actor = $game_party.actors[@actors_window.index]
if item != nil and not actor.equippable?(item)
$game_system.se_play($data_system.buzzer_se)
return
end
case @equipch_window.index
when 0 # Weapon
if item == nil and actor.weapon_id == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if item != nil and item.id == actor.weapon_id
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
old_equip = $data_weapons[actor.weapon_id]
actor.equip(0, item == nil ? 0 : item.id)
new_equip = $data_weapons[actor.weapon_id]
@equip_window.refresh
if OLDSCHOOL::SPHELP_EQUIP
@command_window.visible = false
@actors_window.visible = false
@equipch_window.visible = false
@equip_window.visible = false
@equip_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_weapon_help(old_equip, new_equip)
end
when 1 # Shield
if item == nil and actor.armor1_id == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if item != nil and item.id == actor.armor1_id
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
old_equip = $data_armors[actor.armor1_id]
actor.equip(1, item == nil ? 0 : item.id)
new_equip = $data_armors[actor.armor1_id]
@equip_window.refresh
if OLDSCHOOL::SPHELP_EQUIP
@command_window.visible = false
@actors_window.visible = false
@equipch_window.visible = false
@equip_window.visible = false
@equip_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_armor_help(old_equip, new_equip)
end
when 2 # Helmet
if item == nil and actor.armor2_id == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if item != nil and item.id == actor.armor2_id
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
old_equip = $data_armors[actor.armor2_id]
actor.equip(2, item == nil ? 0 : item.id)
new_equip = $data_armors[actor.armor2_id]
@equip_window.refresh
if OLDSCHOOL::SPHELP_EQUIP
@command_window.visible = false
@actors_window.visible = false
@equipch_window.visible = false
@equip_window.visible = false
@equip_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_armor_help(old_equip, new_equip)
end
when 3 # Body
if item == nil and actor.armor3_id == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if item != nil and item.id == actor.armor3_id
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
old_equip = $data_armors[actor.armor3_id]
actor.equip(3, item == nil ? 0 : item.id)
new_equip = $data_armors[actor.armor3_id]
@equip_window.refresh
if OLDSCHOOL::SPHELP_EQUIP
@command_window.visible = false
@actors_window.visible = false
@equipch_window.visible = false
@equip_window.visible = false
@equip_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_armor_help(old_equip, new_equip)
end
when 4 # Accessor
if item == nil and actor.armor4_id == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if item != nil and item.id == actor.armor4_id
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.equip_se)
old_equip = $data_armors[actor.armor4_id]
actor.equip(4, item == nil ? 0 : item.id)
new_equip = $data_armors[actor.armor4_id]
@equip_window.refresh
if OLDSCHOOL::SPHELP_EQUIP
@command_window.visible = false
@actors_window.visible = false
@equipch_window.visible = false
@equip_window.visible = false
@equip_window.active = false
@sphelp_window.visible = true
@sphelp_window.active = true
check_armor_help(old_equip, new_equip)
end
end
end
end
def update_sphelp
if Input.trigger?(Input::B) or Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
command = $game_system.menu_commands[@command_window.index]
if OLDSCHOOL::ACTOR_SEL and command != "Item"
@actors_window.visible = true
@actors_window.active = true
else
@command_window.active = true
end
@command_window.visible = true
@sphelp_window.active = false
@sphelp_window.visible = false
return
end
end
def check_item_help(item)
@sphelp_window.clear
actor_name = $game_party.actors[0].name
if item.recover_hp != 0
if item.recover_hp > 0
text1 = "¡#{actor_name} has recovered "
else
text1 = "¡#{actor_name} has lost "
end
text2 = $data_system.words.hp + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
if item.recover_hp_rate != 0
if item.recover_hp_rate > 0
text1 = "¡#{actor_name} has recovered "
else
text1 = "¡#{actor_name} has lost "
end
text2 = $data_system.words.hp + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
if item.recover_sp != 0
if item.recover_sp > 0
text1 = "¡#{actor_name} has recovered "
else
text1 = "¡#{actor_name} has lost "
end
text2 = $data_system.words.sp + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
if item.recover_sp_rate != 0
if item.recover_sp_rate > 0
text1 = "¡#{actor_name} has recovered "
else
text1 = "¡#{actor_name} has lost "
end
text2 = $data_system.words.sp + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
if item.parameter_type != 0
text1 = "¡#{actor_name}'s "
case item.parameter_type
when 0 then text2 = "Max " + $data_system.words.hp
when 1 then text2 = "Max " + $data_system.words.sp
when 2 then text2 = $data_system.words.str
when 3 then text2 = $data_system.words.dex
when 4 then text2 = $data_system.words.agi
when 5 then text2 = $data_system.words.int
end
if item.parameter_points != 0
if item.parameter_points > 0
text3 = " increased!"
else
text3 = " decreased!"
end
@sphelp_window.draw_next_line(text1 + text2 + text3)
end
end
if item.plus_state_set.size > 0
plus_state_array = []
for i in 0...item.plus_state_set.size
plus_state_array.push($data_states[item.plus_state_set[i]].name)
end
text1 = "¡#{actor_name} gained status: "
text2 = plus_state_array.join(", ") + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
if item.minus_state_set.size > 0
minus_state_array = []
for i in 0...item.minus_state_set.size
minus_state_array.push($data_states[item.minus_state_set[i]].name)
end
text1 = "¡#{actor_name} lost status: "
text2 = minus_state_array.join(", ") + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
end
def check_skill_help(skill)
@sphelp_window.clear
actor_name = $game_party.actors[@actors_window.index].name
if skill.power != 0
if skill.power < 0
text1 = "¡#{actor_name} has recovered "
else
text1 = "¡#{actor_name} has lost "
end
text2 = $data_system.words.hp + "!"
@sphelp_window.draw_next_line(text1 + text2)
end
# ...
end
def check_weapon_help(old_item, new_item)
@sphelp_window.clear
actor_name = $game_party.actors[@actors_window.index].name
if old_item != nil and new_item != nil
atk = new_item.atk - old_item.atk
pdef = new_item.pdef - old_item.pdef
mdef = new_item.mdef - old_item.mdef
str_plus = new_item.str_plus - old_item.str_plus
dex_plus = new_item.dex_plus - old_item.dex_plus
agi_plus = new_item.agi_plus - old_item.agi_plus
int_plus = new_item.int_plus - old_item.int_plus
# plus_state_set
# minus_state_set
elsif old_item == nil
atk = new_item.atk
pdef = new_item.pdef
mdef = new_item.mdef
str_plus = new_item.str_plus
dex_plus = new_item.dex_plus
agi_plus = new_item.agi_plus
int_plus = new_item.int_plus
# plus_state_set
# minus_state_set
else
atk = 0 - old_item.atk
pdef = 0 - old_item.pdef
mdef = 0 - old_item.mdef
str_plus = 0 - old_item.str_plus
dex_plus = 0 - old_item.dex_plus
agi_plus = 0 - old_item.agi_plus
int_plus = 0 - old_item.int_plus
# plus_state_set
# minus_state_set
end
if atk != 0
text1 = "¡#{actor_name}'s #{$data_system.words.atk}"
text2 = atk > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if pdef != 0
text1 = "¡#{actor_name}'s #{$data_system.words.pdef}"
text2 = pdef > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if mdef != 0
text1 = "¡#{actor_name}'s #{$data_system.words.mdef}"
text2 = mdef > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if str_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.str}"
text2 = str_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if dex_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.dex}"
text2 = dex_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if agi_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.agi}"
text2 = agi_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if int_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.int}"
text2 = int_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
end
def check_armor_help(old_item, new_item)
@sphelp_window.clear
actor_name = $game_party.actors[@actors_window.index].name
if old_item != nil and new_item != nil
# auto_state_id
pdef = new_item.pdef - old_item.pdef
mdef = new_item.mdef - old_item.mdef
str_plus = new_item.str_plus - old_item.str_plus
dex_plus = new_item.dex_plus - old_item.dex_plus
agi_plus = new_item.agi_plus - old_item.agi_plus
int_plus = new_item.int_plus - old_item.int_plus
# guard_state_set
elsif old_item == nil
# auto_state_id
pdef = new_item.pdef
mdef = new_item.mdef
str_plus = new_item.str_plus
dex_plus = new_item.dex_plus
agi_plus = new_item.agi_plus
int_plus = new_item.int_plus
# guard_state_set
else
# auto_state_id
pdef = 0 - old_item.pdef
mdef = 0 - old_item.mdef
str_plus = 0 - old_item.str_plus
dex_plus = 0 - old_item.dex_plus
agi_plus = 0 - old_item.agi_plus
int_plus = 0 - old_item.int_plus
# guard_state_set
end
if pdef != 0
text1 = "¡#{actor_name}'s #{$data_system.words.pdef}"
text2 = pdef > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if mdef != 0
text1 = "¡#{actor_name}'s #{$data_system.words.mdef}"
text2 = mdef > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if str_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.str}"
text2 = str_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if dex_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.dex}"
text2 = dex_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if agi_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.agi}"
text2 = agi_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
if int_plus != 0
text1 = "¡#{actor_name}'s #{$data_system.words.int}"
text2 = int_plus > 0 ? " increased!" : " decreased!"
@sphelp_window.draw_next_line(text1 + text2)
end
end
def update_end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.decision_se)
@end_window.active = false
@end_window.visible = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
case @end_window.index
when 0 # to title
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = Scene_Title.new
when 1 # shutdown
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
when 2 # quit
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(5)
return
end
return
end
end
end