This is for the ATB battle system script
#==============================================================================
#?
???ver. 2.56???
#??Script by
#??http://para.j-mx.com/
#------------------------------------------------------------------------------
# CT?
?
#
#
#
#------------------------------------------------------------------------------
#?
?
#
??Scene_Debug?
?
#------------------------------------------------------------------------------
#?
#???
#?
??
#?
??
#?
??
#?
?
#
#?
??
#?
?
#?R????PageDown?
#?L????PageUp?
?
#==============================================================================
module PARA_CTB
#
??CT?
?true:
/ false:
??
COMMAND_WAIT = false
#
???CT?
?true:
/ false:
??
SELECT_WAIT = true
#
??CT?
?true:
/ false:
??
ANIMATION_WAIT = false
#
?CT?
BATTLE_SPEED = 3
#
???PT?
?
PARTY_SIZE = 4
#
???CT?
??
ACT_ATTACK_CT = 100 #
?
ACT_GUARD_CT = 100 # ??
ACT_ESCAPE_CT = 100 #
?
ACT_SKILL_CT = 100 #
ACT_ITEM_CT = 100 #
?
#
??
UNESCAPE_MES = "
?"
# CT?
??""
#
??Audio/SE?
??
FULL_CT_SE = "015-Jump01"
#
FULL_CT_SE_VOL = 80
# CT?
(0,0,0)
FULL_CT_COLOR = Tone.new(32,0,0)
# HP?
HP_COLOR_LEFT = Color.new(128, 0, 0, 255)
# HP?
HP_COLOR_RIGHT= Color.new(255, 0, 0, 255)
# SP?
SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
# SP?
SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
# CT?
COLOR_LEFT = Color.new(128, 128, 64, 255)
# CT?
COLOR_RIGHT= Color.new(255, 255, 128, 255)
# CT?
COLOR_FULL = Color.new(255, 225, 128, 255)
#
FRAME_COLOR = Color.new(192, 192, 192, 255)
#
?
FRAME_BORDER = 1
#
?
BACK_COLOR = Color.new(128, 128, 128, 128)
#
?
NAME_FONT_SIZE = 16
# HP/SP?
?
HPSP_FONT_SIZE = 18
#
?
ENEMY_FONT_SIZE = 16
# ??HP/SP?
true / false ?
MAX_DRAW = false
#
true / false ?
# ?true?
?? 2?
??
ENEMY_GROUPING = false
#
0:?? / 1:HP / 2:CT ?
#
?
ENEMY_DRAWING_MATER = 0
#
??HP/SP?
true / false ?
HELP_DRAWING_MATER_ACTOR = false
#
??HP/SP?
true / false ?
HELP_DRAWING_MATER_ENEMY = false
#
true / false ?
#?
?
#
??true??
# ?true?
??
#
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X??
WINDOWPOS_Y = 320 # Y??
#
??
WINDOW_OPACITY = 160
# CT?
(
?0)
#
?
CT_SKIP = 2
end
# ?
??
#------------------------------------------------------------------------------
#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? CT?
?
#--------------------------------------------------------------------------
def update_ct
#
??
if @countup
for actor in $game_party.actors
#
if actor.movable? == false and actor.ct_visible and @phase4_step != 5
#
?
actor.ct_visible = false
actor.countup = true
actor.full_ct = false
elsif actor.movable? and actor.ct_visible == false
#
?
clear_ct(actor)
actor.ct_visible = true
end
#
if actor.max_ct == 0
actor.max_ct = @max_ct
end
#
if actor.countup
# CT?max?
if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
#
@pre_action_battlers.push(actor)
@action_count += 1
#
?
if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
end
#
??
actor.countup = false
actor.full_ct = true
else
#
?
actor.make_action_speed
ct_skip = PARA_CTB::CT_SKIP != 0 ? PARA_CTB::CT_SKIP : 1
actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
end
end
end
for enemy in $game_troop.enemies
#
if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
#
?
enemy.ct_visible = false
enemy.countup = true
enemy.full_ct = false
elsif enemy.movable? and enemy.ct_visible == false
#
?
clear_ct(enemy)
enemy.ct_visible = true
end
#
if enemy.countup
# CT?max?
??
if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
#
??
@pre_action_battlers.push(enemy)
@action_count += 1
#
??
enemy.countup = false
enemy.full_ct = true
else
#
?
enemy.make_action_speed
enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
end
end
end
# CT?
@status_window.refresh_ct
@status_window2.refresh_ct
end
end
#--------------------------------------------------------------------------
# ?
??CT?0?
#--------------------------------------------------------------------------
def clear_ct(battler)
battler.countup = true
battler.now_ct = 0
battler.full_ct = false
end
#--------------------------------------------------------------------------
# ?
??CT?
??
#--------------------------------------------------------------------------
def declease_ct(battler,percent)
battler.countup = true
battler.now_ct = battler.now_ct * percent / 100
battler.full_ct = false
end
#--------------------------------------------------------------------------
# ? CT?
#--------------------------------------------------------------------------
def initialize_ct
# CT?
max_ct
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
n = $game_party.actors.size + $game_troop.enemies.size
#
??CT?
??
battler.now_ct = battler.agi * 60 * n
battler.ct_visible = true
else
clear_ct(battler)
battler.ct_visible = false
end
battler.countup = true
battler.full_ct = false
battler.max_ct = @max_ct
end
end
#--------------------------------------------------------------------------
# ?
???CT?
#--------------------------------------------------------------------------
def max_ct
for battler in $game_party.actors + $game_troop.enemies
@max_ct += battler.agi
end
@max_ct *= 100
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
def shift_activer(shift)
#
??2???
if @pre_action_battlers != nil
if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
#
?
act = @pre_action_battlers[@actor_array_index]
#
@pre_action_battlers.insert(@actor_array_index+2, act)
#
?
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
else
act = @pre_action_battlers[@actor_array_index]
#
@pre_action_battlers.push(act)
#
?
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
alias main_ctb main
def main
#
?
@status_window2 = Window_BattleStatus_enemy.new
@action_battlers = []
@pre_action_battlers = []
@max_ct = 0
@countup = false
@ct_wait = 0
@action_count = 0
main_ctb
#
?
@status_window2.dispose
end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
alias ctb_update update
def update
#
?
if $game_system.battle_interpreter.running?
#
$game_system.battle_interpreter.update
#
?
if $game_temp.forcing_battler == nil
#
??
unless $game_system.battle_interpreter.running?
#
??
unless judge
setup_battle_event
end
end
#
?
if @phase != 5
#
??
@status_window.refresh
#
??
@status_window2.refresh
end
end
else
if PARA_CTB::CT_SKIP == 0
update_ct
else
if @ct_wait > 0
@ct_wait -= 1
else
update_ct
@ct_wait = PARA_CTB::CT_SKIP
end
end
end
ctb_update
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
alias ctb_start_phase1 start_phase1
def start_phase1
# CT?
initialize_ct
#
@countup = true
ctb_start_phase1
end
#--------------------------------------------------------------------------
# ?
(
)
#--------------------------------------------------------------------------
def update_phase1
#
??
@status_window2.refresh
#
?
if judge
#
? :
return
end
#
??
start_phase3
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
def start_phase2
#
? 2
@phase = 2
#
?
@actor_index = -1
@active_battler = nil
#
??
@party_command_window.active = true
@party_command_window.visible = true
#
??
@actor_command_window.active = false
@actor_command_window.visible = false
#
??
$game_temp.battle_main_phase = false
#
unless $game_party.inputable?
#
start_phase4
end
end
#--------------------------------------------------------------------------
# ?
(
:
)
#--------------------------------------------------------------------------
def update_phase2_escape
#
?
enemies_agi = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
end
end
#
??
actors_agi = 0
for actor in @pre_action_battlers
if actor.is_a?(Game_Actor) and actor.exist?
actors_agi += actor.agi
end
end
#
success = rand(100) < 50 * actors_agi / enemies_agi
#
?
if success
# ?? SE
$game_system.se_play($data_system.escape_se)
#
? BGM
$game_system.bgm_play($game_temp.map_bgm)
# CT?
for battler in $game_party.actors
clear_ct(battler)
end
#
??
battle_end(1)
#
?
else
#
"
?"
?
@help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
#
??CT?
pre_action_battlers = @pre_action_battlers.clone
for act in pre_action_battlers
if act.is_a?(Game_Actor)
declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
act.current_action.clear
@pre_action_battlers.delete(act)
end
end
@party_command_window.visible = false
#
??
@help_window.visible = true
@wait_count = 20
#
start_phase4
end
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
def start_phase3
#
? 3
@phase = 3
#
?
@actor_index = -1
@active_battler = nil
@actor_array_index = -1
#
??
if @pre_action_battlers != []
phase3_next_actor
else
start_phase4
end
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
def phase3_next_actor
#
begin
#
OFF
if @active_battler != nil
@active_battler.blink = false
end
#
?
if @actor_array_index + 1 == @pre_action_battlers.size
#
start_phase4
return
#?
??
elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
#
start_phase4
return
end
#
@actor_array_index += 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
#
??
end until @active_battler.inputable?
#
??
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
def phase3_prior_actor
#
begin
#
OFF
if @active_battler != nil
@active_battler.blink = false
end
#
?
if @actor_array_index <= 0
#
??
start_phase2
return
end
#
??
@actor_array_index -= 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
#
??
end until @active_battler.inputable?
#
??
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ?
??
#--------------------------------------------------------------------------
alias phase3_setup_command_window_ctb phase3_setup_command_window
def phase3_setup_command_window
@actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
phase3_setup_command_window_ctb
if PARA_CTB::WINDOWPOS_CHANGE
#
?
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
#
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ?
(
)
#--------------------------------------------------------------------------
def update_phase3
#
?
if @enemy_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_enemy_select
#
?
elsif @actor_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_actor_select
#
??
elsif @skill_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_skill_select
#
elsif @item_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_item_select
#
?
elsif @actor_command_window.active
@countup = PARA_CTB::COMMAND_WAIT ? false : true
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# ?
(
:
)
#--------------------------------------------------------------------------
alias ctb_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
ctb_update_phase3_basic_command
# LR?
if Input.trigger?(Input::R)
shift_activer(1)
end
if Input.trigger?(Input::L)
shift_activer(-1)
end
end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def start_phase4
#
? 4
@phase = 4
battler_count = $game_party.actors.size + $game_troop.enemies.size
if @action_count >= battler_count or $game_temp.battle_turn == 0
#
for index in 0...$data_troops[@troop_id].pages.size
#
?
page = $data_troops[@troop_id].pages[index]
#
? [
]
if page.span == 1
#
??
$game_temp.battle_event_flags[index] = false
end
end
#
??
$game_temp.battle_turn += 1
@action_count = 0
end
#
?
@actor_index = -1
@active_battler = nil
#
??
@party_command_window.active = false
@party_command_window.visible = false
#
??
@actor_command_window.active = false
@actor_command_window.visible = false
#
??
$game_temp.battle_main_phase = true
#
??
for enemy in $game_troop.enemies
enemy.make_action
end
#
make_action_orders
#
? 1
@phase4_step = 1
end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def make_action_orders
# ?? @action_battlers
?
@action_battlers = []
if @pre_action_battlers != []
for i in 0..@actor_array_index
#
? @action_battlers
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
end
if @pre_action_battlers.size != 0
loop do
if $game_troop.enemies.include?(@pre_action_battlers[0])
#
? @action_battlers
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
else
break
end
end
end
end
end
#--------------------------------------------------------------------------
# ?
(
?
? 1 :
?)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step1 update_phase4_step1
def update_phase4_step1
@countup = true
#
??
@help_window.visible = false
#
?
if judge
#
? :
return
end
#
(
)
if @action_battlers.size == 0
#
??
start_phase3
return
end
ctb_update_phase4_step1
end
#--------------------------------------------------------------------------
# ?
(
?
? 2 :
?)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step2 update_phase4_step2
def update_phase4_step2
#
unless @active_battler.current_action.forcing
#
[
]
if @active_battler.restriction == 4
# CT?
clear_ct(@active_battler)
#
$game_temp.forcing_battler = nil
#
? 1
@phase4_step = 1
return
end
end
#
??CT?
?
@countup = PARA_CTB::ANIMATION_WAIT ? false : true
ctb_update_phase4_step2
end
#--------------------------------------------------------------------------
# ?
?
?
#--------------------------------------------------------------------------
alias make_basic_action_result_ctb make_basic_action_result
def make_basic_action_result
#
??
if @active_battler.current_action.basic == 3
# CT?
clear_ct(@active_battler)
#
$game_temp.forcing_battler = nil
#
? 1
@phase4_step = 1
return
end
make_basic_action_result_ctb
end
#--------------------------------------------------------------------------
# ?
??
?
#--------------------------------------------------------------------------
def make_skill_action_result
#
@skill = $data_skills[@active_battler.current_action.skill_id]
#
unless @active_battler.current_action.forcing
# SP
?
unless @active_battler.skill_can_use?(@skill.id)
#
$game_temp.forcing_battler = nil
# CT?
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
#
? 1
@phase4_step = 1
return
end
end
# SP ??
@active_battler.sp -= @skill.sp_cost
#
??
@status_window.refresh
#
?
@help_window.set_text(@skill.name, 1)
#
? ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
#
? ID
@common_event_id = @skill.common_event_id
#
?
set_target_battlers(@skill.scope)
#
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# ?
?
#--------------------------------------------------------------------------
alias ctb_make_item_action_result make_item_action_result
def make_item_action_result
#
?
@item = $data_items[@active_battler.current_action.item_id]
#
??
unless $game_party.item_can_use?(@item.id)
# CT?
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
#
? 1
@phase4_step = 1
return
end
ctb_make_item_action_result
end
#--------------------------------------------------------------------------
# ?
(
?
? 5 :
)
#--------------------------------------------------------------------------
alias update_phase4_step5_ctb update_phase4_step5
def update_phase4_step5
#
?
for target in @target_battlers
if target.damage != nil
target.damage_backup = target.damage
end
end
update_phase4_step5_ctb
end
#--------------------------------------------------------------------------
# ?
(
?
? 6 :
)
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
@active_battler.countup = true
if @active_battler.current_action.basic == 1
# ??
declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
else
case @active_battler.current_action.kind
# ??
when 0
declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
#
when 1
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
#
?
when 2
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
else
clear_ct(@active_battler)
end
end
#
???CT?0?
for target in @target_battlers
if target.movable? == false and target.damage_backup != "Miss"
clear_ct(target)
@status_window.refresh_ct
end
end
#
??
@status_window2.refresh
update_phase4_step6_ctb
end
#--------------------------------------------------------------------------
# ?
?
#--------------------------------------------------------------------------
alias ctb_start_phase5 start_phase5
def start_phase5
@countup = false
ctb_start_phase5
end
end
#==============================================================================
# ? Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def initialize
super(160, 320, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
@before_hp = []
@before_sp = []
@before_states = []
@now_hp = []
@now_sp = []
@now_states = []
refresh
end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
#
@now_hp = actor.hp
@now_sp = actor.sp
@now_states = actor.states
#
if @level_up_flags
self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
# ??
#
if @before_hp == nil or @before_sp == nil or @before_states == nil or
@before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
self.contents.clear
for i2 in 0...$game_party.actors.size
actor = $game_party.actors[i2]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i2 * line_height + 4
self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
# ??
draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
# HP???
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# SP???
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# ?
@before_hp[i2] = actor.hp
@before_sp[i2] = actor.sp
@before_states[i2] = actor.states
#
if @level_up_flags[i2]
self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# ? CT?
#--------------------------------------------------------------------------
def refresh_ct
for i in 0...$game_party.actors.size
actor = $game_party.actors
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# CT?
ct_color_full = PARA_CTB::COLOR_FULL
# CT???
ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# CT???
ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if @level_up_flags != true and actor.ct_visible
draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
elsif @level_up_flags != true
draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
end
end
end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# ? HP
# actor : ?
# x : X ??
# y : Y ??
# width : ??
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# "HP"
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# MaxHP
self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
text_size = self.contents.text_size(actor.maxhp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2)
else
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ? SP
# actor : ?
# x : X ??
# y : Y ??
# width : ??
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# "SP"
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# MaxSP
self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
text_size = self.contents.text_size(actor.maxsp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2)
else
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2)
end
end
end
#==============================================================================
# ? ??
#==============================================================================
class Window_BattleStatus_enemy < Window_Base
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def initialize
super(0, 320, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
@exist_enemies = []
if $game_troop.enemies != nil
if PARA_CTB::ENEMY_GROUPING
ememy_list = []
ememy_list_index = []
# ?
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies
if enemy.exist?
if ememy_list.include?(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] += 1
else
# ??
ememy_list.push(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] = 1
end
end
end
#
enemy_index = 0
for enemy_name in ememy_list
enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
if ememy_list_index[enemy_index] > 1
enemy_name = enemy_name + "?" + ememy_list_index[enemy_index].to_s
end
self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
enemy_index += 1
end
else
# ?
enemy_index = 0
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies
if enemy.exist?
@exist_enemies.push(enemy)
line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
if PARA_CTB::ENEMY_DRAWING_MATER != 0
line_height += 10
end
enemy_y = enemy_index * line_height + 4
self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
enemy_index += 1
if PARA_CTB::ENEMY_DRAWING_MATER == 1
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_col