# Setting goes here
ACTOR_EQUIPMENT =
{
1 =>
{
:weapon => [true, true], # [have slot?, accessible?]
:armor => [true, false]
},
2 =>
{
:weapon => [true, true],
:armor => [false, false]
},
3 =>
{
:weapon => [true, true],
:armor => [false, false]
},
4 =>
{
:weapon => [true, true],
:armor => [false, false]
},
5 =>
{
:weapon => [true, true],
:armor => [false, false]
},
6 =>
{
:weapon => [true, true],
:armor => [false, false]
},
7 =>
{
:weapon => [true, true],
:armor => [false, false]
},
8 =>
{
:weapon => [true, false],
:armor => [false, false]
}
}
class Window_Status < Window_Base
def refresh
self.contents.clear
draw_actor_graphic(@actor, 40, 112)
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
draw_actor_parameter(@actor, 96, 192, 0)
draw_actor_parameter(@actor, 96, 224, 3)
draw_actor_parameter(@actor, 96, 256, 4)
draw_actor_parameter(@actor, 96, 304, 5)
draw_actor_parameter(@actor, 96, 336, 6)
self.contents.font.color = system_color
self.contents.font.color = system_color
self.contents.draw_text(320, 160, 96, 32, "equipment")
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
# have armor slot?
if ACTOR_EQUIPMENT[@actor.id][:armor][0]
draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
end
end
end
class Window_BattleResult < Window_Base
def refresh
self.contents.clear
x = 4
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
end
# EDITS FOR EQUIPMENT FIX
class Window_Base
#--------------------------------------------------------------------------
# * Draw Item Name
# item : item
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# NEW color: text color (default: normal_color
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, color = normal_color)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = color
self.contents.draw_text(x + 28, y, 212, 32, item.name)
end
end
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
color = (ACTOR_EQUIPMENT[@actor.id][:weapon][1]) ? normal_color : disabled_color
draw_item_name(@data[0], 92, 32 * 0, color)
# have armor slots?
if ACTOR_EQUIPMENT[@actor.id][:armor][0]
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
# accessible?
color = (ACTOR_EQUIPMENT[@actor.id][:armor][1]) ? normal_color : disabled_color
draw_item_name(@data[1], 92, 32 * 1, color)
draw_item_name(@data[2], 92, 32 * 2, color)
draw_item_name(@data[3], 92, 32 * 3, color)
draw_item_name(@data[4], 92, 32 * 4, color)
end
@item_max = @data.size
end
end
class Scene_Equip
#--------------------------------------------------------------------------
# * Frame Update (when right window is active)
#--------------------------------------------------------------------------
def update_right
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(2)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# selecting which slot?
case @right_window.index
when 0 # weapon
# accessible?
unless ACTOR_EQUIPMENT[@actor.id][:weapon][1]
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
else # always armor
# accessible?
unless ACTOR_EQUIPMENT[@actor.id][:armor][1]
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
end
# If equipment is fixed
if @actor.equip_fix?(@right_window.index)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Activate item window
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Reset right window index to 0
@right_window.index = 0
# Switch to different equipment screen
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Reset right window index to 0
@right_window.index = 0
# Switch to different equipment screen
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
end