#==============================================================================
# â– Window_Base Add On
#------------------------------------------------------------------------------
class Window_Base
#-----------------------------------------
def draw_actor_parameter2(actor, x, y, type, first, second)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
when 7
parameter_name = "Evasion"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, first, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + first, y, second, 32, parameter_value.to_s, 2)
end
#-----------------------------------------
def draw_actor_level2(actor, x, y,width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
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.draw_text(hp_x, y, 48, 32, actor.level.to_s, 2)
end
#-----------------------------------------
def draw_item_name_24(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 24, item.name)
end
end
#==============================================================================
# â– Window_Status On Battle
#------------------------------------------------------------------------------
class Window_Status_On_Battle < Window_Base
#--------------------------------------------------------------------------
# actor
#--------------------------------------------------------------------------
attr_accessor :actor
attr_accessor :visible_memory
def initialize(actor=nil)
super(0, 0, 400, 152)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.back_opacity = 250
self.opacity = 250
@actor = actor
if(@actor!=nil)
refresh
end
@visible_memory=false
end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
offset1=8
for i in 0..6
draw_actor_parameter2(@actor, 92, 16*i-offset1, i, 60, 32)
end
draw_actor_name(@actor, 0, 32-offset1-32)
draw_actor_class(@actor, 0, 64-offset1-32-16)
draw_actor_hp(@actor, 0, 32-offset1, 80)
draw_actor_sp(@actor, 0, 48-offset1, 80)
draw_actor_level2(@actor, 0, 64-offset1,80)
self.contents.font.color = system_color
=begin
self.contents.draw_text(96, 96, 80, 32, "EXP")
self.contents.draw_text(96, 128, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(96 + 80, 96, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(96 + 80, 128, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
=end
itemsx=220
itemsy=32-offset1-20
#self.contents.draw_text(368, 160, 192, 32, "Equipment")
draw_item_name_24($data_weapons[@actor.weapon_id], itemsx, itemsy)
draw_item_name_24($data_armors[@actor.armor1_id], itemsx, itemsy+24*1)
draw_item_name_24($data_armors[@actor.armor2_id], itemsx , itemsy+24*2)
draw_item_name_24($data_armors[@actor.armor3_id], itemsx, itemsy+24*3)
draw_item_name_24($data_armors[@actor.armor4_id], itemsx , itemsy+24*4)
end
def dummy
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
end
end
class Scene_Battle
alias phase3_setup_command_window_sob phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sob
if @active_battler.is_a? Game_Enemy
@status_on_battle_window.visible=false
else
@status_on_battle_window.actor=@active_battler
@status_on_battle_window.refresh
@status_on_battle_window.visible=@status_on_battle_window.visible_memory unless ($reaction and !PLAYABLE_REACTION)
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : basic command)
#--------------------------------------------------------------------------
alias update_phase3_basic_command_sob update_phase3_basic_command
def update_phase3_basic_command
@status_on_battle_window.visible=@status_on_battle_window.visible_memory
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by actor command window cursor position
case @actor_command_window.index
when 4 # status
$game_system.se_play($data_system.decision_se)
@status_on_battle_window.actor=@active_battler
@status_on_battle_window.refresh
@status_on_battle_window.visible=!@status_on_battle_window.visible
@status_on_battle_window.visible_memory=@status_on_battle_window.visible
return
end
end
update_phase3_basic_command_sob
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Initialize each kind of temporary battle data
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# Initialize battle event interpreter
$game_system.battle_interpreter.setup(nil, 0)
# Prepare troop
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# Make actor command window
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, "Status"])
@actor_command_window.y = 160-32
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# Make other windows
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# Make sprite set
@spriteset = Spriteset_Battle.new
# Initialize wait count
@wait_count = 0
# Execute transition
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# Start pre-battle phase
start_phase1
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Refresh map
$game_map.refresh
# Prepare for transition
Graphics.freeze
# Dispose of windows
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# Dispose of sprite set
@spriteset.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
# If switching from battle test to any screen other than game over screen
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
alias main_sob main
def main
@status_on_battle_window = Window_Status_On_Battle.new
@status_on_battle_window.visible = false
main_sob
@status_on_battle_window.dispose
end
alias start_phase4_sob start_phase4
def start_phase4
@status_on_battle_window.visible = false
start_phase4_sob
end
alias start_skill_select_sob start_skill_select
def start_skill_select
@status_on_battle_window.visible = false
start_skill_select_sob
end
alias start_item_select_sob start_item_select
def start_item_select
@status_on_battle_window.visible = false
start_item_select_sob
end
alias start_enemy_select_sob start_enemy_select
def start_enemy_select
@status_on_battle_window.visible = false
start_enemy_select_sob
end
end