DerVVulfman
Sponsor
ParaDog's ATB
Version: 2.58
September 16, 2006
http://hometown.aol.com/Der%20VVulfman/ ... /TRANS.PNG[/img]
Originally designed by ParaDog, posted at http://2d6.parasite.jp/
Not by DerVVulfman
Posted before, but now completely translated into English.
Also contains the original Japanese version.
Introduction
Translated from the original Japanese code, Paradog's Front-View Battlesystem simulates an Active Timer Battle system so closely that this CTB (Conditional Timer Battle) system deserves ATB in it's name.
Complete with CT gauges that show who's going to be next to attack, a redesigned Battlestatus window system that lists the enemies you're facing and an altered 'Fight/Escape' system so action stays fast and furious, this system is one of the better battlesystems available.
Features
Screenshots
http://hometown.aol.com/Der%20VVulfman/ ... araDog.png[/IMG]
Demo
ParaDog's ATB v 2.58
Script
Version: 2.58
September 16, 2006
http://hometown.aol.com/Der%20VVulfman/ ... /TRANS.PNG[/img]
Originally designed by ParaDog, posted at http://2d6.parasite.jp/
Not by DerVVulfman
Posted before, but now completely translated into English.
Also contains the original Japanese version.
Introduction
Translated from the original Japanese code, Paradog's Front-View Battlesystem simulates an Active Timer Battle system so closely that this CTB (Conditional Timer Battle) system deserves ATB in it's name.
Complete with CT gauges that show who's going to be next to attack, a redesigned Battlestatus window system that lists the enemies you're facing and an altered 'Fight/Escape' system so action stays fast and furious, this system is one of the better battlesystems available.
Features
- CT Gauges... 'nuff said?
- Editable fill rates for the Gauges, based on game actions.
- Displays enemies encountered in it's own window.
- Adjustable Actor Command Window (he added for sideview system scripts)
Screenshots
http://hometown.aol.com/Der%20VVulfman/ ... araDog.png[/IMG]
Demo
ParaDog's ATB v 2.58
Script
I took a few liberties with the comments, using the syntax of the official English version of RMXP whenever possible.
Code:
#=============================================================================
# Active Time Battle v.2.58
# Script by ParaDog
# http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# When the CT Gauge becomes filled, the battler which it controls will then be
# able to perform his/her battle action.
# The system can also adjust the positioning of the BattleStatus window which
# works well with Sideview System scripts.
#------------------------------------------------------------------------------
# INSTALLING:
# When using this system, it is recommended that this script be placed above
# all other 'Custom' scripts... directly below Scene_Debug if possible.
#------------------------------------------------------------------------------
# ESCAPE:
# While a battler's command window is active, pressing the [ESC] button will
# activate the 'Fight / Escape' window at the top of the screen. The more
# actors you have with full CT, the better your chances are of a successful
# escape, while fewer actors results in a lower chance to flee.
#
# NEXT/PREVIOUS BATTLER:
# When two or more actors can act, you can toggle between the actors with full
# CT gauges with the [R] button or the [PageDown] key, or in reverse order with
# the [L] button or the [PageUp] key.
#==============================================================================
module PARA_CTB
# CT gauge pauses while command window is open
COMMAND_WAIT = false
# CT gauge pauses when Skill and Item windows are open, and while targeting
SELECT_WAIT = false
# CT gauge pauses when battlers perform actions
ANIMATION_WAIT = false
# CT Gauge fill / Battle system speed
BATTLE_SPEED = 3
# Maximum size in your Battle Party
PARTY_SIZE = 4
# CT Cost in percentages for each action
ACT_ATTACK_CT = 100 # Normal attack
ACT_GUARD_CT = 100 # Defense
ACT_ESCAPE_CT = 100 # Escape
ACT_SKILL_CT = 100 # Skill
ACT_ITEM_CT = 100 # Item
# Message when failed to escape
UNESCAPE_MES = "Escape failed"
# Sound effect played when the CT Gauge is full (if "", plays no sound)
# Sound effect stored in the project's "Audio/SE" folder
FULL_CT_SE = "015-Jump01"
# Sound Volume
FULL_CT_SE_VOL = 80
# Tone effect of the battler when the CT Gauge is full
# A value of (0,0,0) performs no tone change
FULL_CT_COLOR = Tone.new(32,0,0)
# Color of HP gauge (gradation left edge)
HP_COLOR_LEFT = Color.new(128, 0, 0, 255)
# Color of HP gauge (gradation right edge)
HP_COLOR_RIGHT= Color.new(255, 0, 0, 255)
# Color of SP gauge (gradation left edge)
SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
# Color of SP gauge (gradation right edge)
SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
# Color of CT gauge (gradation left edge)
COLOR_LEFT = Color.new(128, 128, 64, 255)
# Color of CT gauge (gradation left edge)
COLOR_RIGHT= Color.new(255, 255, 128, 255)
# Color of CT gauge (filled gauge)
COLOR_FULL = Color.new(255, 225, 128, 255)
# Gauge Frame Color
FRAME_COLOR = Color.new(192, 192, 192, 255)
# Gauge Frame Width
FRAME_BORDER = 1
# Gauge Frame Background Color
BACK_COLOR = Color.new(128, 128, 128, 128)
# Font Size of Actor Names
NAME_FONT_SIZE = 16
# Font Size of Actor HP/SP
HPSP_FONT_SIZE = 18
# Font Size of Enemy Names
ENEMY_FONT_SIZE = 16
# Draw maximum values for HP/SP
MAX_DRAW = false
# Group Enemy Names
# Ex: Instead of "Ghost Ghost" it will say "Ghost2"
ENEMY_GROUPING = true
# Draw Bars for Enemies (0: None / 1: HP / 2: CT)
# If ENEMY_GROUPING is used, then this setting is ignored
ENEMY_DRAWING_MATER = 0
# Draw Actor HP/SP bars in the help window
HELP_DRAWING_MATER_ACTOR = false
# Draw Enemy HP/SP bars in the help window
HELP_DRAWING_MATER_ENEMY = false
# Command Window Position System (true/false)
# (Useful with side-view scripts if the position of the Actor Command Window
# appears unnatural). The default setting is false, while true allows you to
# adjust the x/y position of the window.
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X coordinates of the Actor Command Window
WINDOWPOS_Y = 320 # Y coordinates of the Actor Command Window
# Opacity of the Actor Command Window
WINDOW_OPACITY = 160
# Sets the intervals of the CT bar updates
# The lower a setting, the smoother the CT Bar fill will appear (0 Minimum).
# The higher a setting, the faster the CT Bar refreshes (Useful if lagging).
CT_SKIP = 2
# End of the config section
#------------------------------------------------------------------------------
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * CT Update
#--------------------------------------------------------------------------
def update_ct
# When count rise is permitted
if @countup
for actor in $game_party.actors
# If you can act?
if actor.movable? == false and actor.ct_visible and @phase4_step != 5
# In invisibility state count rise
actor.ct_visible = false
actor.countup = true
actor.full_ct = false
elsif actor.movable? and actor.ct_visible == false
# Cancelling invisibility count rise
clear_ct(actor)
actor.ct_visible = true
end
# It corresponds to the replacement of the actor
if actor.max_ct == 0
actor.max_ct = @max_ct
end
# Count rise of actor
if actor.countup
# If the CT Gauge is filled and the actor is not in action
if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
# Adds the actor to the command input list
@pre_action_battlers.push(actor)
@action_count += 1
# Play the CG Gauge SE
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
# Stop filling the CT Gauge
actor.countup = false
actor.full_ct = true
else
# Count rise
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 you can act
if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
# In invisibility state count rise
enemy.ct_visible = false
enemy.countup = true
enemy.full_ct = false
elsif enemy.movable? and enemy.ct_visible == false
# Clear the invisible CT
clear_ct(enemy)
enemy.ct_visible = true
end
# Count rise of enemy
if enemy.countup
# if the enemy CT Gauge is full and the enemy is not in action
if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
# Adds the enemy to the command input list
@pre_action_battlers.push(enemy)
@action_count += 1
# Stop filling the CT Gauge
enemy.countup = false
enemy.full_ct = true
else
# Count rise
enemy.make_action_speed
enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
end
end
end
# Redrawing CT gauge
@status_window.refresh_ct
@status_window2.refresh_ct
end
end
#--------------------------------------------------------------------------
# * Clear the battler CT
#--------------------------------------------------------------------------
def clear_ct(battler)
battler.countup = true
battler.now_ct = 0
battler.full_ct = false
end
#--------------------------------------------------------------------------
# * Percentage of battler CT
#--------------------------------------------------------------------------
def declease_ct(battler,percent)
battler.countup = true
battler.now_ct = battler.now_ct * percent / 100
battler.full_ct = false
end
#--------------------------------------------------------------------------
# * CT Initialization
#--------------------------------------------------------------------------
def initialize_ct
# Deciding the reference level of CT
max_ct
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
n = $game_party.actors.size + $game_troop.enemies.size
# Set the CT starting level
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
#--------------------------------------------------------------------------
# * Set the reference level of empty CT based on the Battler's speed
#--------------------------------------------------------------------------
def max_ct
for battler in $game_party.actors + $game_troop.enemies
@max_ct += battler.agi
end
@max_ct *= 100
end
#--------------------------------------------------------------------------
# * Modify the Battler's order of performance
#--------------------------------------------------------------------------
def shift_activer(shift)
# When one shifting, the actor of rear 2 or more
if @pre_action_battlers != nil
if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
# Acquiring the present actor
act = @pre_action_battlers[@actor_array_index]
# Inserting the present actor in two rear
@pre_action_battlers.insert(@actor_array_index+2, act)
# Presently eliminating position
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
else
act = @pre_action_battlers[@actor_array_index]
# Most adding the present actor to rear
@pre_action_battlers.push(act)
# Presently eliminating position
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# * Main processing
#--------------------------------------------------------------------------
alias main_ctb main
def main
# Drawing up the enemy name window
@status_window2 = Window_BattleStatus_enemy.new
@action_battlers = []
@pre_action_battlers = []
@max_ct = 0
@countup = false
@ct_wait = 0
@action_count = 0
main_ctb
# Dispose the enemy name window
@status_window2.dispose
end
#--------------------------------------------------------------------------
# * Frame renewal
#--------------------------------------------------------------------------
alias ctb_update update
def update
# If battle event is running
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
# If not after battle phase
if @phase != 5
# Refresh status window
@status_window.refresh
# Refresh enemy status window
@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
#--------------------------------------------------------------------------
# * Start Pre-Battle Phase
#--------------------------------------------------------------------------
alias ctb_start_phase1 start_phase1
def start_phase1
# CT Initialization
initialize_ct
# Start of Count Rise
@countup = true
# Run original call
ctb_start_phase1
end
#--------------------------------------------------------------------------
# * Frame Update (pre-battle phase)
#--------------------------------------------------------------------------
def update_phase1
# Renew the enemy name list
@status_window2.refresh
# Determine win/loss situation
if judge
# If won or lost: end method
return
end
# Start actor command phase
start_phase3
end
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
def start_phase2
# Shift to phase 2
@phase = 2
# Set actor to non-selecting
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = true
@party_command_window.visible = true
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
# Clear main phase flag
$game_temp.battle_main_phase = false
# If impossible to input command
unless $game_party.inputable?
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Frame Update (party command phase: escape)
#--------------------------------------------------------------------------
def update_phase2_escape
# Calculate enemy agility average
enemies_agi = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
end
end
# Calculate actor agility average
actors_agi = 0
for actor in @pre_action_battlers
if actor.is_a?(Game_Actor) and actor.exist?
actors_agi += actor.agi
end
end
# Determine if escape is successful
success = rand(100) < 50 * actors_agi / enemies_agi
# If escape is successful
if success
# Play escape SE
$game_system.se_play($data_system.escape_se)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Clear the Battlers' CT
for battler in $game_party.actors
clear_ct(battler)
end
# Battle ends
battle_end(1)
# If escape is failure
else
# Set the "Escape Failure" message to the help window
@help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
# Clearing action and CT of the actor
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
# Hide the help window
@help_window.visible = true
@wait_count = 20
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Start Actor Command Phase
#--------------------------------------------------------------------------
def start_phase3
# Shift to phase 3
@phase = 3
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
@actor_array_index = -1
# To command input of the following actor
if @pre_action_battlers != []
phase3_next_actor
else
start_phase4
end
end
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor
#--------------------------------------------------------------------------
def phase3_next_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
end
# If last actor
if @actor_array_index + 1 == @pre_action_battlers.size
# Start main phase
start_phase4
return
# The next in case of enemy
elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
# Start main phase
start_phase4
return
end
# Advance actor index
@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
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Go to Command Input of Previous Actor
#--------------------------------------------------------------------------
def phase3_prior_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
end
# If first actor
if @actor_array_index <= 0
# Start party command phase
start_phase2
return
end
# Return to actor index
@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
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
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
# Set actor command window position
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
# Way it does not hide in the status window
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase)
#--------------------------------------------------------------------------
def update_phase3
# If enemy arrow is enabled
if @enemy_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_enemy_select
# If actor arrow is enabled
elsif @actor_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_actor_select
# If skill window is enabled
elsif @skill_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_skill_select
# If item window is enabled
elsif @item_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_item_select
# If actor command window is enabled
elsif @actor_command_window.active
@countup = PARA_CTB::COMMAND_WAIT ? false : true
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : basic command)
#--------------------------------------------------------------------------
alias ctb_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
ctb_update_phase3_basic_command
# If left or right buttons are pressed
if Input.trigger?(Input::R)
shift_activer(1)
end
if Input.trigger?(Input::L)
shift_activer(-1)
end
end
#--------------------------------------------------------------------------
# * Start Main Phase
#--------------------------------------------------------------------------
def start_phase4
# Shift to phase 4
@phase = 4
battler_count = $game_party.actors.size + $game_troop.enemies.size
if @action_count >= battler_count or $game_temp.battle_turn == 0
# Search all battle event pages
for index in 0...$data_troops[@troop_id].pages.size
# Get event page
page = $data_troops[@troop_id].pages[index]
# If this page span is [turn]
if page.span == 1
# Clear action completed flags
$game_temp.battle_event_flags[index] = false
end
end
# Turn count
$game_temp.battle_turn += 1
@action_count = 0
end
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
# Set main phase flag
$game_temp.battle_main_phase = true
# Make enemy action
for enemy in $game_troop.enemies
enemy.make_action
end
# Make action orders
make_action_orders
# Shift to step 1
@phase4_step = 1
end
#--------------------------------------------------------------------------
# * Make Action Orders
#--------------------------------------------------------------------------
def make_action_orders
# Initialize @action_battlers array
@action_battlers = []
if @pre_action_battlers != []
for i in 0..@actor_array_index
# Add the actors to the @action_battle array
@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])
# Add the enemies to the @action_battle array
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
else
break
end
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 1 : action preparation)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step1 update_phase4_step1
def update_phase4_step1
@countup = true
# Hide the help window
@help_window.visible = false
# Determine win/loss situation
if judge
# If won or lost: end method
return
end
# If no actionless battlers exist (all have performed an action)
if @action_battlers.size == 0
# Start actor command phase
start_phase3
return
end
ctb_update_phase4_step1
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# If not a forcing action
unless @active_battler.current_action.forcing
# If restriction is [cannot perform action]
if @active_battler.restriction == 4
# Clear the CT
clear_ct(@active_battler)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
# Determines if CT Gauge is filled during animation
@countup = PARA_CTB::ANIMATION_WAIT ? false : true
ctb_update_phase4_step2
end
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
alias make_basic_action_result_ctb make_basic_action_result
def make_basic_action_result
# If doing nothing
if @active_battler.current_action.basic == 3
# Clear the battler's CT
clear_ct(@active_battler)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
make_basic_action_result_ctb
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
def make_skill_action_result
# Get skill
@skill = $data_skills[@active_battler.current_action.skill_id]
# If not a forcing action
unless @active_battler.current_action.forcing
# If unable to use due to SP running out
unless @active_battler.skill_can_use?(@skill.id)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Clear the CT
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# Shift to step 1
@phase4_step = 1
return
end
end
# Use up SP
@active_battler.sp -= @skill.sp_cost
# Refresh status window
@status_window.refresh
# Show skill name on help window
@help_window.set_text(@skill.name, 1)
# Set animation ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# Set command event ID
@common_event_id = @skill.common_event_id
# Set target battlers
set_target_battlers(@skill.scope)
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
alias ctb_make_item_action_result make_item_action_result
def make_item_action_result
# Get item
@item = $data_items[@active_battler.current_action.item_id]
# If unable to use due to items running out
unless $game_party.item_can_use?(@item.id)
# Clear the CT
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
# Shift to step 1
@phase4_step = 1
return
end
ctb_make_item_action_result
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
alias update_phase4_step5_ctb update_phase4_step5
def update_phase4_step5
# Display damage
for target in @target_battlers
if target.damage != nil
target.movable_backup = target.movable?
end
end
update_phase4_step5_ctb
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 6 : refresh)
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
@active_battler.countup = true
if @active_battler.current_action.basic == 1
# Defense
declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
else
case @active_battler.current_action.kind
# Attack
when 0
declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
# Skill
when 1
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# Item
when 2
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
else
clear_ct(@active_battler)
end
end
# Clear the CT if the battler is incapacitated
for target in @target_battlers
if target.movable? == false and target.movable_backup == true
clear_ct(target)
@status_window.refresh_ct
end
end
# Renew the Enemy Name List
@status_window2.refresh
update_phase4_step6_ctb
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
alias ctb_start_phase5 start_phase5
def start_phase5
@countup = false
ctb_start_phase5
end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# Present status in arrangement
@now_hp[i] = actor.hp
@now_sp[i] = actor.sp
@now_states[i] = actor.states
# If leveling up
if @level_up_flags[i]
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
# Light weight conversion processing of battle status
# When arrangement of status changes only, drawing processing
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
draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
# Draw 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)
# Draw 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)
# Status after the changing in arrangement
@before_hp[i2] = actor.hp
@before_sp[i2] = actor.sp
@before_states[i2] = actor.states
# If Leveling up
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
#--------------------------------------------------------------------------
# * Refresh the CT Gauge
#--------------------------------------------------------------------------
def refresh_ct
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# When the CT gauge is full, color of gauge
ct_color_full = PARA_CTB::COLOR_FULL
# Color of CT gauge (left hand edge)
ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# Color of CT gauge (right hand edge)
ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if @level_up_flags[i] != 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[i] != true
draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
end
end
end
#--------------------------------------------------------------------------
# * Frame Renewal
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw the "HP" text
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
# Draw the 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)
# Draw the 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
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Draw the "SP" text
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
# Draw the 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)
# Draw the 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
#==============================================================================
# ** Window_BattleStatus_enemy
#------------------------------------------------------------------------------
# This window displays the status of all enemy troops on the battle screen.
#==============================================================================
class Window_BattleStatus_enemy < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 320, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
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 = []
# Loop through the Enemy Troop
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
if ememy_list.include?(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] += 1
else
# Store the enemy name
ememy_list.push(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] = 1
end
end
end
# Draw the name and number of the enemy
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
# Draw the enemy name
enemy_index = 0
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
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_color2)
end
end
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# * Refresh the CT gauge
#--------------------------------------------------------------------------
def refresh_ct
if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil
enemy_index = 0
for enemy in @exist_enemies
line_height = PARA_CTB::ENEMY_FONT_SIZE + 16
enemy_y = enemy_index * line_height + 4
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
# When the CT gauge is full, color of gauge
ct_color_full = PARA_CTB::COLOR_FULL
# Color of CT gauge (the left edge)
ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# Color of CT gauge (the right edge)
ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if enemy.ct_visible
draw_meter(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
else
draw_meter(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
end
enemy_index += 1
end
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw the meter
#--------------------------------------------------------------------------
def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width -
PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
now = now > max ? max : now
percentage = max != 0 ? (width-2) * now / max.to_f : 0
if start_color == end_color
self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
else
for i in 1..percentage
r = start_color.red + (end_color.red - start_color.red) / percentage * i
g = start_color.green + (end_color.green - start_color.green) / percentage * i
b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :max_ct
attr_accessor :now_ct
attr_accessor :full_ct
attr_accessor :countup
attr_accessor :ct_visible
attr_accessor :movable_backup
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias ctb_initialize initialize
def initialize
ctb_initialize
@max_ct = 0
@now_ct = 0
@full_ct = false
@countup = true
@ct_visible = true
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias ctb_update update
def update
ctb_update
if @battler != nil
if @battler.full_ct and @battler.ct_visible
# Change the color tone of the battler when the CT Gauge is full
fullct_color = PARA_CTB::FULL_CT_COLOR
self.tone = fullct_color
else
fullct_color = Tone.new(0,0,0)
self.tone = fullct_color
end
end
end
end
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
alias set_actor_ctb set_actor
def set_actor(actor)
if PARA_CTB::HELP_DRAWING_MATER_ACTOR
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
else
set_actor_ctb(actor)
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
alias set_enemy_ctb set_enemy
def set_enemy(enemy)
if PARA_CTB::HELP_DRAWING_MATER_ENEMY
self.contents.clear
draw_actor_name(enemy, 4, 0)
draw_actor_state(enemy, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(enemy, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(enemy, 460, 0)
self.visible = true
else
set_enemy_ctb(enemy)
end
end
end
Code:
#==============================================================================
# ++ アクティブタイムãƒãƒˆãƒ«ã€€ver. 2.58 ++
#  Script by パラ犬
#  http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# 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
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®ඡ