EDIT:
when you have Atoa ATB and Scan at the same time this happens:
i Use scan.
then the windows pops up.
but when it's the enemy's turn it goes away and the enemy attacks.
wich means the time bar isn't stopping when you scan.
I have Atoa ATB
Skill BLitz.
Skill overdrive.
Since the legal version skill
overdrive works fine.
BUT When i put a blitz on skill 7 (fire) and i use it in battle.
it does the casting time ,then they use tha attack.
but no blitz. The game acts like i didn't put the script there.
EDIT:
i used equipment with skills and the same thing happens.
What the fuck?
does this mean most of these scripts won't work?
EDIT:
oops wait ill put mys cripts here in a second
Atoa ATB:
[rgss]#==============================================================================
# Atoa's Active Time Battle Version
# By Atoa
#==============================================================================
# This Script adds a time bar system to the game
# The configurations are explained below
#==============================================================================
module Atoa
# Do not remove or change these lines
Cast_Time = {}
Cast_Cancel = {}
ATB_Freeze = {}
ATB_Delay = {}
# Do not remove or change these lines
# Waiting Mode
Wait_Mode = 0
# 0 = On Hold Battle: the bar stops to select actions, skills and itens
# 1 = Semi On Hold Battle: the bar stop to select itens and skills.
# 2 = 100% Active Battle: the bar will never stop.
# Pause the bar when a battler is executing an action?
Wait_Act_End = true
# Stop time bar during damage animation?
Pause_if_Damaged = true
# Show individual time bars for the battlers?
Meters = true
# Hide individual meters toghter with the status screen?
Hide_Meters = true
# Show a single bar that indicates the battler's action order?
Bars = true
# Hide singe bar toghter with the status screen?
Hide_Bars = false
# Battle Speed
Atb_Speed = 10.0
# Initial bar value modifier
Atb_Initial_Value = 0
# Multiplication rate of the initial bar value
Atb_Initial_Rate = 1.0
# ATB's maximum value, only change if you know what you doing.
Max_Atb = 500
# Agility Modifier, The higher this value, the lower is the diference between
# battlers with different agility
Atb_Agi_Modifier = 50
# Makes the bar gorws faster if no actor is active
Faster_if_inactive = false
# Definition of turn shifting.
# This definition must be used for the duration of effects and
# battle event conditions
# This value does not count to enemies actions conditions
Custom_Turn_Count = 0
# 0 = By number of fighters
# 1 = By number of executed actions
# 2 = By time (in frames)
# If 'Custom_Turn_Count = 1', define how many actions are equal to 1 turn
Action_Turn_Count = 10
# If 'Custom_Turn_Count = 2', define how much time (in frames) are equal to 1 turn
Time_Tunr_Count = 1200 # 20 frames is about 1 second
# Activate a timer for the casting of magical skills?
Magic_Skill_Cast = true
# Activate a timer for the casting of physical skills?
Physical_Skill_Cast = true
# Activate a timer for the casting of itens?
Item_Cast = true
# Set the escape style
Escape_Type = 0
# 0 = Escape options is shown on the character's action menu
# 1 = Keep pressed the key set in Escape_Input to escape
# shows a message on the screen
# 2 = Keep pressed the key set in Escape_Input to escape
# shows an escape bar
# Key that must be pressed to escape
Escape_Input = Input::X
# Key that must be pressed to change the input battler
Next_Input = Input::B
# Key that must be pressed to end battler turn
Cancel_Input = Input::A
# Remember to not leave any equal input
# Input::A = Keyborard:Z
# Input::B = Keyborard:X
# Input::C = Keyborard:C
# Input::X = Keyborard:A
# Input::Y = Keyborard:S
# Input::Z = Keyborard:D
# Input::L = Keyborard:Q
# Input::R = Keyborard:W
# Show the name for the escape option when Escape_Type = 0
Escape_Name = 'Escape'
# Escape message when Escape_Type = 1
Escape_Message = 'Escaping...'
Cant_Escape_Message = "Can't Escape!"
# Time (in frames) needed to escape when Escape_Type > 0
# it is affected by the agility of characters and enemies
Escape_Time = 600
# Name of the graphic file when Escape_Type = 2
Escape_Skin = 'ESCAPEMeter'
# Position of the Fleeing Bar
Escape_Meter_Pos_Type = 0
# 0 = Above the characters
# 1 = Upper-Mid of the screen
# 2 = Custom position
# Custom position of the Fleeing Bar when Escape_Meter_Pos_Type = 2
Escape_Meter_Position = [240,64]
# Time Bar configurations
Meter_Skin = 'ATBMeter' # Graphic file name that represents the bars
# must be on the Graphic/Windowskins folder
# Position of the character's Time Bars
Meter_Pos_Style = 0
# 0 = Horizontal Pattern, not centralized
# 1 = Horizontal Pattern, centralized
# 2 = Vertical Bars
# 3 = Under the characters
# 4 = Custom
# Readjust the Time Bar's position on the battle screen
X_Meter = 12 # X position of the Bars
Y_Meter = 360 # Y position of the Bars
# Custom Time Bar position, only valid when Meter_Pos_Style = 4
Meter_Position = [[460,180],[480,210],[500,240],[520,270]]
# Coordinate 'Z' (height) of the Meter image if Meter_Pos_Style = 4
Meter_Height = 500
# Position of the enemie's Time Bars
Enemy_Meter = 0
# 0 = No time bars for the enemies
# 1 = Under the enemy
# 2 = Vertical list on the Side
# Configuration of the Action Bars.
Bar_Skin = 'ATBBar' # Name of the graphic file that represents the bar, must be
# on the Graphics/Windowskins folder
X_Bar = 128 # X position of the Bars
Y_Bar = 80 # Y position of the Bars
# Name of the default graphic Icon for characters
Default_Party_Icon = '050-Skill07'
# Individual character's Icons
# Must be configured on the following way: 'Battler file name' => 'Icon file name'
Party_Icon = {
'Leon' => 'Atoa-Icon',
'Zelos' => 'Kahh-Icon',
'Nanaly' => 'DarkLuar-Icon',
'Klarth' => 'Tunicoelp-Icon',
'Max' => 'Maranguape-Icon',
}
# Name of the default graphic Icon for enemies
Default_Enemy_Icon = '046-Skill03'
# Individual icons for enemies
# must be configured on the following way: 'Battler file name' => 'Icon file name'
Enemy_Icon = {}
# Sound effect played when teh character's turn comes. nil for no sound
Command_Up_SE = '046-Book01'
#¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
# CAST SETTINGS
#¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
# Chanting default pose, if nil, no pose is used.
Chanting_Pose = nil
# To add an pose to an skill or item, add this effect to the setting of the
# skill or the item.
# 'Chanting/**'
# ** must be the Pose ID.
# To set an chanting pose for an specific graphic, add this to the graphic setting:
# 'Chanting' => Pose ID.
# Set here the cast time for each item and skill
# By default all items have the cast speed = 0 (that means, no cast).
#
# Cast_Time[Action_Type] = {Action_ID => [Speed, status]}
# Action_Type = 'Skill' for skills, 'Item' for items
# Action_ID = ID of the skill or item
# Speed = cast speed, higher value = faster cast
# recomended values between 500-100
# Status = The status that the cast speed is based
# if nil, the cast will have fixed speed
# the status can be:
# 'hp', 'sp', 'level', 'str', 'dex', 'int', 'agi'
Cast_Time['Skill'] = {1 => [500,'int'], 2 => [400,'int'], 3 => [300,'int'],
7 => [500,'int'], 8 => [400,'int'], 9 => [300,'int'], 10 => [500,'int'],
11 => [400,'int'], 12 => [300,'int'], 13 => [500,'int'], 14 => [400,'int'],
15 => [300,'int'], 16 => [500,'int'], 17 => [400,'int'], 18 => [300,'int'],
19 => [500,'int'], 20 => [400,'int'], 21 => [300,'int'], 22 => [500,'int'],
23 => [400,'int'], 24 => [300,'int'], 25 => [500,'int'], 26 => [400,'int'],
27 => [300,'int'], 28 => [500,'int'], 29 => [400,'int'], 30 => [300,'int']}
Cast_Time['Item'] = {1 => [500,'int'], 2 => [500,'int'], 3 => [500,'int'],
7 => [500,'int'], 8 => [500,'int'], 9 => [500,'int'], 10 => [500,'int'],
11 => [500,'int'], 12 => [500,'int']}
#¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
# SETTINGS OF ACTIONS THAT CHANGE THE ATB
#¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
# Actions that may cause changes on the target ATB
# Chance that all actions have to cancel skill cast of the target.
# This value is used for all actions that don't have individual definition.
Base_Cast_Cancel = 0
# Set here the chance that each action have of canceling the cast of target
#
# Cast_Cancel[Action_Type] = {Action_ID => Rate}
# Action_Type = 'Skill' for skills, 'Item' for items, 'Weapon' for weapons
# Action_ID = ID of the skill, item or weapon
# Rate = chance of calceling cast, increases with damage caused.
#
# Important: if tha action is an physical skill, the weapon cancel chance is
# also applied (the values aren't added, each one are calculated separatedely)
#--------------------------------------------------------------------------
# Pause on the ATB bar when recive damage
# This value is used for all actions that don't have individual definition.
# Time in frames that the ATB bar will be stoped, increases with damage caused.
Base_ATB_Freeze = 0
# Set here the actions that will cause ATB pause
#
# Cast_Cancel[Action_Type] = {Action_ID => Pause}
# Action_Type = 'Skill' for skills, 'Item' for items, 'Weapon' for weapons
# Action_ID = ID of the skill, item or weapon
# Pause = ATB pause time, increases with damage caused.
#
# Important: if tha action is an physical skill, the weapon pause is also calculated
#--------------------------------------------------------------------------
# Delay on the ATB bar when recive damage
# This value is used for all actions that don't have individual definition.
Base_ATB_Delay = 0
# Set here the actions that will cause ATB delay
#
# Cast_Cancel[Action_Type] = {Action_ID => Delay}
# Action_Type = 'Skill' for skills, 'Item' for items, 'Weapon' for weapons
# Action_ID = ID of the skill, item or weapon
# Delay = ATB delay value, increases with damage caused.
#
# Important: if tha action is an physical skill, the weapon delay is also calculated
end
#==============================================================================
# ■ Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa ATB'] = true
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill
#----------------------------------------------------------------------------
include Atoa
#----------------------------------------------------------------------------
def cast_speed(battler)
if Cast_Time != nil and Cast_Time['Skill'] != nil and Cast_Time['Skill'][@id] != nil
cast1 = Cast_Time['Skill'][@id][0]
if Cast_Time['Skill'][@id][1].nil?
cast2 = 200
else
if Cast_Time['Skill'][@id][1] == 'level'
cast2 = (eval("battler.#{Cast_Time['Skill'][@id][1]}") * 2) + 100
elsif Cast_Time['Skill'][@id][1] == 'hp' or Cast_Time['Skill'][@id][1] == 'sp'
cast2 = (eval("battler.#{Cast_Time['Skill'][@id][1]}") / 50) + 100
else
cast2 = (eval("battler.#{Cast_Time['Skill'][@id][1]}") / 5) + 100
end
end
return (cast1 * cast2).to_i
end
return 0
end
end
#==============================================================================
# ■ RPG::Item
#==============================================================================
class RPG::Item
#----------------------------------------------------------------------------
include Atoa
#----------------------------------------------------------------------------
def cast_speed(battler)
if Cast_Time != nil and Cast_Time['Item'] != nil and Cast_Time['Item'][@id] != nil
cast1 = Cast_Time['Item'][@id][0]
if Cast_Time['Item'][@id][1].nil?
cast2 = 200
else
if Cast_Time['Item'][@id][1] == 'level'
cast2 = (eval("battler.#{Cast_Time['Item'][@id][1]}") * 2) + 100
elsif Cast_Time['Item'][@id][1] == 'hp' or Cast_Time['Item'][@id][1] == 'sp'
cast2 = (eval("battler.#{Cast_Time['Item'][@id][1]}") / 50) + 100
else
cast2 = (eval("battler.#{Cast_Time['Item'][@id][1]}") / 5) + 100
end
end
return cast1 * cast2
end
return 0
end
end
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
attr_accessor :max_escape_count
attr_accessor :escape_count
attr_accessor :hide_meters
attr_accessor :no_active_battler
#--------------------------------------------------------------------------
def escape_atb_linetype
return 2 unless @battle_can_escape
return 1 if @battle_can_escape
end
#--------------------------------------------------------------------------
def escape_atb_lineamount
return 100 * @escape_count / @max_escape_count if @battle_can_escape
return 100 unless @battle_can_escape
end
#--------------------------------------------------------------------------
def max_escape_count
return @max_escape_count.nil? ? @max_escape_count = 0 : @max_escape_count
end
#--------------------------------------------------------------------------
def escape_count
return @escape_count.nil? ? @escape_count = 0 : @escape_count
end
#--------------------------------------------------------------------------
def max_escape_count=

@max_escape_count = n
end
#--------------------------------------------------------------------------
def escape_count=

@escape_count = n
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
attr_accessor :cast_action
attr_accessor :casting
attr_accessor :cast_target
attr_accessor :turn_count
attr_accessor :guarding
attr_accessor :passed
attr_accessor :atb_delay
#--------------------------------------------------------------------------
alias atoa_initialize_atb initialize
def initialize
atoa_initialize_atb
@cast_skill = @turn_count = @atb_delay = 0
@guarding = @passed = @casting = false
end
#--------------------------------------------------------------------------
def atb_linetype
return 4 if self.cast_action != nil and self.atb_full?
return 3 if self.cast_action != nil
return 2 if self.atb_full?
return 1
end
#--------------------------------------------------------------------------
def atb_lineamount
return 0 if self.dead?
return 100 * self.atb / self.max_atb
end
#--------------------------------------------------------------------------
def casting
return false if self.dead?
return @casting
end
#--------------------------------------------------------------------------
def max_atb
return Max_Atb
end
#--------------------------------------------------------------------------
def atb
return @atb.nil? ? @atb = 0 : @atb
end
#--------------------------------------------------------------------------
def atb=

@atb = [[n.to_i, 0].max, self.max_atb].min
end
#--------------------------------------------------------------------------
def atb_preset
percent = self.max_atb * Atb_Initial_Rate * (rand(64) + 16) * (self.agi + Atb_Agi_Modifier) / total_agi / 1000
self.atb = Atb_Initial_Value + percent
end
#--------------------------------------------------------------------------
def total_agi
total = 0
for battler in $game_party.actors + $game_troop.enemies
total += battler.agi
end
return total
end
#--------------------------------------------------------------------------
def atb_full?
return @atb == self.max_atb
end
#--------------------------------------------------------------------------
def atb_update
if self.cast_action.nil?
self.atb += speed_adjust * 200 * (self.agi + Atb_Agi_Modifier) / total_agi / 100.0
else
cast = cast_action.cast_speed(self)
self.atb += speed_adjust * (cast + Atb_Agi_Modifier) / total_agi / 100.0
end
end
#--------------------------------------------------------------------------
def speed_adjust
return $game_temp.no_active_battler ? Atb_Speed + 10.0 : Atb_Speed
end
#--------------------------------------------------------------------------
alias atoa_apply_damage_atb apply_damage
def apply_damage(user, skill = nil)
effective = atoa_apply_damage_atb(user, skill)
action = user.now_action
if action != nil and Cast_Cancel[action.type_name] != nil and
Cast_Cancel[action.type_name][action.id] != nil
cancel_cast(Cast_Cancel[action.type_name][action.id], skill)
if action.type_name == 'Skill' and not action.magic?
for weapon in weapons
cancel_cast(Cast_Cancel['Weapon'][weapon.id], skill)
end
end
else
cancel_cast(Base_Cast_Cancel, skill)
end
if action != nil and ATB_Freeze[action.type_name] != nil and
ATB_Freeze[action.type_name][action.id] != nil
freeze_action(ATB_Freeze[action.type_name][action.id], skill)
if action.type_name == 'Skill' and not action.magic?
for weapon in weapons
freeze_action(ATB_Freeze['Weapon'][weapon.id], skill)
end
end
else
freeze_action(Base_ATB_Freeze, skill)
end
if action != nil and ATB_Delay[action.type_name] != nil and
ATB_Delay[action.type_name][action.id] != nil
delay_action(ATB_Delay[action.type_name][action.id], skill)
if action.type_name == 'Skill' and not action.magic?
for weapon in weapons
delay_action(ATB_Delay['Weapon'][weapon.id], skill)
end
end
else
delay_action(Base_ATB_Delay, skill)
end
return effective
end
#--------------------------------------------------------------------------
def cant_cancel(skill)
return true if check_include(skill, "NODAMAGE")
return true if not self.damage.is_a?(Numeric)
return true if self.damage < 0
return false
end
#--------------------------------------------------------------------------
def cancel_cast(cast, skill)
return if cant_cancel(skill)
rate = cast + (cast * (self.damage * 50.0 / self.maxhp) / 100.0)
if rate > rand(100) and self.cast_action != nil
self.cast_action = nil
self.atb = 0
end
end
#--------------------------------------------------------------------------
def delay_action(delay, skill)
return if cant_cancel(skill)
rate = delay + (delay * (self.damage * 50.0 / self.maxhp) / 100.0)
self.atb -= rate.to_i
end
#--------------------------------------------------------------------------
def freeze_action(delay, skill)
return if cant_cancel(skill)
rate = delay + (delay * (self.damage * 50.0 / self.maxhp) / 100.0)
self.atb_delay += rate.to_i
end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
def inputable?
return (self.atb_full? and super)
end
end
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
def movable?
return (self.atb_full? and super)
end
#--------------------------------------------------------------------------
def make_action
self.current_action.clear
return unless self.movable?
available_actions = []
rating_max = 0
for action in self.actions
n = @turn_count
a = action.condition_turn_a
b = action.condition_turn_b
next if (b == 0 and n != a) or (b > 0 and (n < 1 or n < a or n % b != a % b))
next if self.hp * 100.0 / self.maxhp > action.condition_hp
next if $game_party.max_level < action.condition_level
switch_id = action.condition_switch_id
next if switch_id > 0 and $game_switches[switch_id] == false
next if @sp < calc_sp_cost($data_skills[action.skill_id]) if action.kind == 1
available_actions << action
rating_max = action.rating if action.rating > rating_max
end
ratings_total = 0
for action in available_actions
ratings_total += action.rating - (rating_max - 3) if action.rating > rating_max - 3
end
if ratings_total > 0
value = rand(ratings_total)
for action in available_actions
if action.rating > rating_max - 3
if value < action.rating - (rating_max - 3)
self.current_action.kind = action.kind
self.current_action.basic = action.basic
self.current_action.skill_id = action.skill_id
self.current_action.decide_random_target_for_enemy
return
else
value -= action.rating - (rating_max - 3)
end
end
end
end
end
end
#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
attr_accessor :wait_mode
attr_accessor :action_wait
#--------------------------------------------------------------------------
alias atoa_initialize_atb initialize
def initialize
atoa_initialize_atb
@wait_mode = Wait_Mode
@action_wait = Wait_Act_End
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
attr_accessor :no_active_battler
#--------------------------------------------------------------------------
alias atoa_main_atb main
def main
turn_count_speed
$game_temp.escape_count = 0
$game_temp.hide_meters = false
$game_temp.no_active_battler = true
@escape_type, @escape_name = Escape_Type, Escape_Name
@input_battlers, @action_battlers = [], []
@input_battler, @action_battler = nil, nil
@escaped = @update_turn_end = @action_phase = @freeze_atb = false
atoa_main_atb
end
#--------------------------------------------------------------------------
alias atoa_start_atb start
def start
atoa_start_atb
for battler in $game_party.actors + $game_troop.enemies
battler.turn_count = 0
battler.atb = 0
battler.atb_preset
battler.cast_action = nil
battler.cast_target = nil
battler.defense_pose = false
end
end
#--------------------------------------------------------------------------
alias atoa_show_transition_atb show_transition
def show_transition
reset_bars
atoa_show_transition_atb
end
#--------------------------------------------------------------------------
def reset_bars
@status_window.reset_bars
end
#--------------------------------------------------------------------------
alias atoa_update_atb update
def update
if @phase == 1
$game_temp.battle_main_phase = true
@actor_command_window.opacity = 0
@phase = 0
elsif @phase != 5
@phase = 0
end
check_active_battler
return $scene = Scene_Gameover.new if $game_temp.gameover
atoa_update_atb
return update_phase5 if @phase == 5
return if $game_system.battle_interpreter.running? and $game_temp.forcing_battler.nil?
if @update_turn_end
turn_ending
@update_turn_end = false
end
update_escape
return if @escaped
atb_update
input_battler_update
action_battler_update
end
#--------------------------------------------------------------------------
def action_battler_update
if @action_battlers[0] != nil
@action_battlers.flatten!
battler = @action_battlers[0]
battler.atb = 0 if battler.dead?
end
update_phase4 unless @spriteset.effect?
end
#--------------------------------------------------------------------------
def check_active_battler
no_active = (@action_battlers.empty? and @active_battlers.empty? and @input_battlers.empty?)
$game_temp.no_active_battler = Faster_if_inactive ? no_active : false
end
#--------------------------------------------------------------------------
def input_battler_update
for battler in $game_party.actors + $game_troop.enemies
if (battler.atb_full? or $game_temp.forcing_battler == battler) and not
@action_battlers.include?(battler) and not
@active_battlers.include?(battler) and not
@input_battlers.include?(battler)
battler_turn(battler)
end
end
if @input_battlers[0] != nil and @input_battler.nil? and !wait_on and
(($game_system.wait_mode == 0 and @active_battlers.empty?) or $game_system.wait_mode > 0)
@input_battlers.flatten!
@input_battler = @input_battlers[0]
if @input_battler.current_action.forcing or @input_battler.confused?
if @input_battler.confused?
@input_battler.current_action.kind = 0
@input_battler.current_action.basic = 0
end
battler.defense_pose = false
@action_battlers << @input_battlers.shift
@action_battlers.compact!
@input_battler = nil
elsif @input_battler.inputable?
@actor_index = $game_party.actors.index(@input_battler)
@input_battler.current_action.clear
else
@input_battler.atb_update
@input_battlers.shift
@input_battler = nil
end
end
if @input_battler != nil
battler.defense_pose = false
@input_battler.blink = true
@active_battler = @input_battler
if @actor_command_window.opacity == 0
Audio.se_play('Audio/SE/' + Command_Up_SE) if @active_battler.cast_action.nil? and Command_Up_SE != nil
phase3_setup_command_window
end
update_phase3
end
for battler in $game_party.actors + $game_troop.enemies
next if battler.exist?
@input_battlers.delete(battler)
@action_battlers.delete(battler)
end
end
#--------------------------------------------------------------------------
def update_escape
if Input.press?(Escape_Input) and @escape_type > 0
if $game_temp.battle_can_escape
$game_temp.max_escape_count = update_phase2_escape_rate
$game_temp.escape_count += 2 unless wait_on
@escaping = true
if !@help_window.visible and @escape_type == 1
@help_window.set_text('')
@help_window.set_text(Escape_Message, 1)
end
if @escape_type == 2
if @escape_atb_meters.nil?
@escape_atb_meters = Escape_Meters.new
@escape_meter_opacity = 0
@escape_atb_meters.visible = true
else @escape_atb_meters != nil
@escape_atb_meters.opacity = 15 * @escape_meter_opacity
@escape_meter_opacity = [@escape_meter_opacity + 1, 17].min
@escape_atb_meters.refresh
end
end
if $game_temp.escape_count >= $game_temp.max_escape_count
$game_temp.escape_count = 0
update_phase2_escape unless $game_party.all_dead?
end
else
@help_window.set_text(Cant_Escape_Message, 1) if @escape_type == 1
if @escape_type == 2
if @escape_atb_meters.nil?
@escape_atb_meters = Escape_Meters.new
@escape_meter_opacity = 0
@escape_atb_meters.visible = true
else @escape_atb_meters != nil
@escape_atb_meters.opacity = 15 * @escape_meter_opacity
@escape_meter_opacity = [@escape_meter_opacity + 1, 17].min
@escape_atb_meters.refresh
end
end
end
elsif @escape_type > 0
if @escaping
@escaping = false
@help_window.visible = false
end
$game_temp.escape_count = [$game_temp.escape_count - 1, 0].max unless wait_on
if @escape_atb_meters != nil and $game_temp.escape_count == 0
@escape_atb_meters.opacity = 15 * @escape_meter_opacity
@escape_meter_opacity = [@escape_meter_opacity - 1, 0].max
if @escape_meter_opacity == 0
@escape_atb_meters.dispose
@escape_atb_meters = nil
end
end
@escape_atb_meters.refresh if @escape_atb_meters != nil
end
end
#--------------------------------------------------------------------------
def battler_turn(battler)
battler.turn_count += 1
if battler.is_a?(Game_Actor)
if battler.inputable? and battler.cast_action.nil?
@input_battlers << battler
@input_battlers.compact!
else
if battler.confused?
battler.current_action.kind = 0
battler.current_action.basic = 0
end
battler.defense_pose = false
@action_battlers << battler
@action_battlers.compact!
end
else
if battler.current_action.forcing or $game_temp.forcing_battler
battler.current_action.forcing = false
$game_temp.forcing_battler = nil
else
battler.make_action
end
@action_battlers << battler
@action_battlers.compact!
end
end
#--------------------------------------------------------------------------
def atb_update
update_meters
return if wait_on
@atb_turn_count += 1 if Custom_Turn_Count == 2
if @atb_turn_count >= @abt_turn_speed
@update_turn_end = true if Slip_Damage_Pop_Time >= 2
for index in 0...$data_troops[@troop_id].pages.size
page = $data_troops[@troop_id].pages[index]
$game_temp.battle_event_flags[index] = false
end
$game_temp.battle_turn += 1
turn_count_speed
for battler in $game_party.actors + $game_troop.enemies
battler.remove_states_auto if battler.exist?
end
setup_battle_event
end
for battler in $game_party.actors + $game_troop.enemies
unless battler.exist?
battler.cast_action = nil
battler.atb = 0
end
next if (@escaping and battler.actor? and @escape_type > 0)
next if battler.restriction == 4 or @active_battlers.include?(battler)
next unless battler.exist?
next if Pause_if_Damaged and battler.damaged
if battler.atb_delay > 0
battler.atb_delay -= 1
next
end
battler.atb_update
end
end
#--------------------------------------------------------------------------
def wait_on
return true if $game_system.wait_mode == 1 and (@skill_window != nil or @item_window != nil)
return true if $game_system.wait_mode == 0 and @input_battler != nil
return true if ($game_system.action_wait or @freeze_atb) and not allow_next_action
return true if @battle_start or @battle_ending or @phase == 5
return false
end
#--------------------------------------------------------------------------
def start_phase2
end
#--------------------------------------------------------------------------
def update_meters
@status_window.active_time_update
end
#--------------------------------------------------------------------------
def turn_count_speed
@atb_turn_count = @abt_turn_speed = 0
case Custom_Turn_Count
when 0
for battler in $game_party.actors + $game_troop.enemies
@abt_turn_speed += 1 if battler.exist?
end
when 1
@abt_turn_speed = Action_Turn_Count
when 2
@abt_turn_speed = Time_Tunr_Count
end
end
#--------------------------------------------------------------------------
def update_phase2_escape
windows_dispose
update_phase2_escape_type1 if @escape_type == 0
update_phase2_escape_type2 if @escape_type > 0
end
#--------------------------------------------------------------------------
def update_phase2_escape_type1
if rand(100) < set_escape_rate
command_input_cancel
@battle_ending = true
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
else
@escape_ratio += 3
phase3_next_actor
end
end
#--------------------------------------------------------------------------
def update_phase2_escape_type2
@escaped = true
command_input_cancel
@battle_ending = true
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
if @escape_atb_meters != nil
@escape_atb_meters.dispose
@escape_atb_meters = nil
end
battle_end(1)
end
#--------------------------------------------------------------------------
def update_phase2_escape_rate
enemies_agi = enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
enemies_agi /= [enemies_number, 1].max
actors_agi = actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
actors_agi /= [actors_number, 1].max
escape_rate = Escape_Time * enemies_agi / (actors_agi * Speed)
return escape_rate
end
#--------------------------------------------------------------------------
alias atoa_set_guard_action_atb set_guard_action
def set_guard_action(battler)
atoa_set_guard_action_atb(battler)
battler.atb = 0
end
#--------------------------------------------------------------------------
alias atoa_set_escape_action_atb set_escape_action
def set_escape_action(battler)
atoa_set_escape_action_atb(battler)
battler.atb = 0
end
#--------------------------------------------------------------------------
alias atoa_set_action_none_atb set_action_none
def set_action_none(battler)
atoa_set_action_none_atb(battler)
battler.atb = 0
battler.current_phase = 'Phase 6-1'
end
#--------------------------------------------------------------------------
alias atoa_start_phase5_atb start_phase5
def start_phase5
@help_window.visible = false if @help_window != nil
@input_battler.blink = false if @input_battler != nil
windows_dispose
@battle_ending = true
update_meters
atoa_start_phase5_atb
end
#--------------------------------------------------------------------------
alias atoa_update_phase5_atb update_phase5
def update_phase5
windows_dispose
atoa_update_phase5_atb
end
#--------------------------------------------------------------------------
alias atoa_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
return if @escaped
if @active_battler != nil && @active_battler.cast_action != nil
@active_battler.blink = false
return
end
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.dispose if @actor_command_window != nil
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.item
s4 = $data_system.words.guard
s5 = @escape_name
if @escape_type == 0
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
else
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
end
command_window_position
@actor_command_window.back_opacity = Base_Opacity
@actor_command_window.back_opacity = Base_Opacity
@actor_command_window.z = 4500
@active_battler_window.refresh(@active_battler)
@active_battler_window.visible = Battle_Name_Window
@active_battler_window.x = Command_Window_Custom_Position[0]
@active_battler_window.y = Command_Window_Custom_Position[1] - 64
@active_battler_window.z = 4500
end
#--------------------------------------------------------------------------
def phase3_next_actor
action_battler = @input_battlers.shift
@action_battlers << action_battler
@action_battlers.compact!
command_input_cancel
@input_battler = nil
@actor_index = nil
@active_battler = nil
end
#--------------------------------------------------------------------------
def phase3_switch_actor
@input_battler.current_action.clear
@input_battler.atb = 0 unless @input_battler.passed
@input_battler.passed = false
@input_battlers.delete(@input_battler)
@action_battlers.delete(@input_battler)
command_input_cancel
@input_battler = nil
@actor_index = nil
end
#--------------------------------------------------------------------------
alias atoa_update_phase3_atb update_phase3
def update_phase3
if cancel_command?
if can_act?
if [2, 3].include?(@input_battler.restriction)
@input_battler.current_action.kind = 0
@input_battler.current_action.basic = 0
end
@action_battlers << @input_battler
@action_battlers.compact!
end
command_input_cancel
return
end
atoa_update_phase3_atb
end
#--------------------------------------------------------------------------
def cancel_command?
return false if @input_battler.nil?
return true if @input_battler.current_action.forcing
return true if @input_battler.confused?
return true if @input_battler.restriction == 4
return true if not $game_party.actors.include?(@input_battler)
return false
end
#--------------------------------------------------------------------------
def can_act?
return true if @input_battler.current_action.forcing
return true if @input_battler.confused?
return false
end
#--------------------------------------------------------------------------
alias atoa_update_phase3_basic_command_atb update_phase3_basic_command
def update_phase3_basic_command
if Input.trigger?(Input::C)
case @actor_command_window.commands[@actor_command_window.index]
when @escape_name
if $game_temp.battle_can_escape == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
update_phase2_escape
return
end
end
if Input.trigger?(Input::UP) and @input_action
$game_system.se_play($data_system.cursor_se)
@actor_command_window.index -= 1
if @actor_command_window.index <= -1
@actor_command_window.index = @actor_command_window.commands_size - 1
end
return
end
if Input.trigger?(Input::DOWN) and @input_action
$game_system.se_play($data_system.cursor_se)
@actor_command_window.index += 1
if @actor_command_window.index >= @actor_command_window.commands_size - 1
@actor_command_window.index = 0
end
return
end
if Input.trigger?(Next_Input)
$game_system.se_play($data_system.decision_se)
@input_battler.passed = true
phase3_switch_actor
return
end
if Input.trigger?(Cancel_Input)
$game_system.se_play($data_system.decision_se)
phase3_switch_actor
return
end
return if Input.trigger?(Next_Input) or Input.trigger?(Cancel_Input)
atoa_update_phase3_basic_command_atb
end
#--------------------------------------------------------------------------
def command_input_cancel
windows_dispose
@input_battler.blink = false
@input_battlers.delete(@input_battler)
@input_battler = nil
end
#--------------------------------------------------------------------------
def windows_dispose
@help_window.visible = false if !@escaping
if @enemy_arrow != nil
@enemy_arrow.dispose
@enemy_arrow = nil
end
if @actor_arrow != nil
@actor_arrow.dispose
@actor_arrow = nil
end
if @actor_arrow != nil
@actor_arrow.dispose
@actor_arrow = nil
end
if @skill_window != nil
@skill_window.dispose
@skill_window = nil
end
if @item_window != nil
@item_window.dispose
@item_window = nil
end
if @enemy_arrow_all != nil
@enemy_arrow_all.dispose_multi_arrow
@enemy_arrow_all = nil
end
if @actor_arrow_all != nil
@actor_arrow_all.dispose_multi_arrow
@actor_arrow_all = nil
end
if @battler_arrow_all != nil
@battler_arrow_all.dispose_multi_arrow
@battler_arrow_all = nil
end
if @actor_command_window != nil
@actor_command_window.active = false
@actor_command_window.visible = false
@active_battler_window.visible = false
@actor_command_window.opacity = 0
end
@status_window.visible = true
end
#--------------------------------------------------------------------------
alias atoa_step2_part1_atb step2_part1
def step2_part1(battler)
battler.defense_pose = false
if battler.cast_action != nil
active_cast = battler.cast_action
if active_cast.scope == 1 or active_cast.scope == 3 or active_cast.scope == 5
battler.current_action.target_index = battler.cast_target
end
if active_cast.is_a?(RPG::Skill)
battler.current_action.kind = 1
battler.current_action.skill_id = battler.cast_action.id
elsif active_cast.is_a?(RPG::Item)
battler.current_action.kind = 2
battler.current_action.item_id = battler.cast_action.id
end
end
atoa_step2_part1_atb(battler)
if (battler.now_action.is_a?(RPG::Skill) or battler.now_action.is_a?(RPG::Item)) and
battler.cast_action.nil?
battler.cast_action = battler.now_action
battler.cast_target = battler.current_action.target_index
cast_speed = battler.now_action.cast_speed(battler)
battler.cast_action = nil if cast_speed == 0
unless cast_speed == 0
battler.movement = false
battler.current_phase = 'Phase 6-1'
end
end
if cant_use_action(battler) and battler.cast_action != nil
battler.cast_action = nil
battler.moviment = false
battler.current_phase = 'Phase 6-1'
end
battler.atb = 0 unless battler.passed
battler.passed = false
end
#--------------------------------------------------------------------------
alias atoa_step3_part1_atb step3_part1
def step3_part1(battler)
atoa_step3_part1_atb(battler)
battler.cast_action = nil
@freeze_atb = check_include(battler_action(battler), 'FREEZEATB')
end
#--------------------------------------------------------------------------
alias atoa_step6_part5_atb step6_part5
def step6_part5(battler)
atoa_step6_part5_atb(battler)
@atb_turn_count += 1 unless Custom_Turn_Count == 2
@input_battlers.delete(battler)
@action_battlers.delete(battler)
@action_battler = nil
@freeze_atb = false
update_meters
judge
end
end
#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
alias atoa_set_pose_atb set_pose
def set_pose
pose = atoa_set_pose_atb
unless pose == Dead_Pose or pose == Victory_Pose
if battler.cast_action != nil
action = @battler.cast_action
cast_pose = set_pose_id('Chanting')
ext = check_extension(action, 'CHANTING/')
if ext != nil
ext.slice!('CHANTING/')
cast_pose = ext.to_i
end
end
end
return cast_pose.nil? ? pose : cast_pose
end
end
#==============================================================================
# ■ Window_Command
#==============================================================================
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
attr_accessor :commands
#--------------------------------------------------------------------------
def commands_size
return @item_max
end
end
#==============================================================================
# Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
alias atb_battle_status_initialize initialize
def initialize
@atb_meters = ATB_Meters.new if Meters
@enm_meters = Enemy_Meters.new if Enemy_Meter > 0
@atb_bars = ATB_Bars.new if Bars
@alive_enemies = enemies_alive
@old_party = $game_party.actors
atb_battle_status_initialize
end
#--------------------------------------------------------------------------
alias atb_battle_status_refresh refresh
def refresh
atb_battle_status_refresh
active_time_update
end
#--------------------------------------------------------------------------
alias face_anim_visible visible=
def visible=

face_anim_visible

need_reset
@atb_meters.visible = n if Hide_Meters and @atb_meters != nil
@enm_meters.visible = n if Hide_Meters and @enm_meters != nil
@atb_bars.visible = n if Hide_Bars and @atb_bars != nil
end
#--------------------------------------------------------------------------
alias atb_battle_status_dispose dispose
def dispose
atb_battle_status_dispose
@atb_meters.dispose if @atb_meters != nil
@enm_meters.dispose if @enm_meters != nil
@atb_bars.dispose if @atb_bars != nil
end
#--------------------------------------------------------------------------
def active_time_update
need_reset
@atb_meters.refresh if @atb_meters != nil
@enm_meters.refresh if @enm_meters != nil
@atb_bars.refresh if @atb_bars != nil
end
#--------------------------------------------------------------------------
def need_reset
if (@alive_enemies != enemies_alive) or (@old_party != $game_party.actors)
@alive_enemies = enemies_alive
@old_party = $game_party.actors
reset_bars
end
end
#--------------------------------------------------------------------------
def enemies_alive
alive = 0
for i in 0...$game_troop.enemies.size
alive += 1 unless $game_troop.enemies
.dead?
end
return alive
end
#--------------------------------------------------------------------------
def reset_bars
@atb_meters.dispose if @atb_meters != nil
@enm_meters.dispose if @enm_meters != nil
@atb_bars.dispose if @atb_bars != nil
@atb_meters = ATB_Meters.new if Meters
@enm_meters = Enemy_Meters.new if Enemy_Meter > 0
@atb_bars = ATB_Bars.new if Bars
end
end
#==============================================================================
# ■ ATB_Meters
#==============================================================================
class ATB_Meters
#--------------------------------------------------------------------------
attr_accessor :meters
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def initialize
@meters = []
@skin = RPG::Cache.windowskin(Meter_Skin)
i = 0
for actor in $game_party.actors
@meter = MeterSprite.new(@skin, 5)
refresh_meter(i)
i += 1
end
refresh
end
#--------------------------------------------------------------------------
def refresh
i = 0
for actor in $game_party.actors
@meters.line = actor.atb_linetype
@meters.amount = actor.atb_lineamount
@meters.atb_visible = true
i += 1
end
end
#--------------------------------------------------------------------------
def refresh_meter(i)
actor = $game_party.actors
case Meter_Pos_Style
when 0
@meter.x = i * (624 / Max_Party) + 4 + X_Meter
@meter.y = Y_Meter
@meter.z = 1000
when 1
@meter.x = X_Meter + ((624 / Max_Party) * ((4 - $game_party.actors.size)/2.0 + i)).floor
@meter.y = Y_Meter
@meter.z = 1000
when 2
@meter.x = X_Meter
@meter.y = i * 32 + Y_Meter
@meter.z = 1000
when 3
@meter.x = actor.base_x - @skin.width / 2
@meter.y = actor.base_y - @skin.height / 5
@meter.z = @meter.y
when 4
@meter.x = actor.base_x - @skin.width / 2
@meter.y = actor.base_y - @skin.height / 5 - 64
@meter.z = 2500
when 5
base = Meter_Position
@meter.x = base[0]
@meter.y = base[1]
@meter.z = 2500
end
@meters = @meter
end
#--------------------------------------------------------------------------
def visible=(b)
@meters.each{|sprite| sprite.visible = b }
end
#--------------------------------------------------------------------------
def opacity=(b)
@meters.each{|sprite| sprite.opacity = b }
end
#--------------------------------------------------------------------------
def dispose
@meters.each{|sprite| sprite.dispose }
end
end
#==============================================================================
# ■ Enemy_Meters
#==============================================================================
class Enemy_Meters
#--------------------------------------------------------------------------
attr_accessor :meters
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def initialize
@meters = {}
@skin = RPG::Cache.windowskin(Meter_Skin)
for enemy in $game_troop.enemies
next if enemy.dead?
@meter = MeterSprite.new(@skin, 5)
refresh_meter(enemy)
end
refresh
end
#--------------------------------------------------------------------------
def refresh
for enemy in $game_troop.enemies
next if enemy.dead?
@meters[enemy].line = enemy.atb_linetype
@meters[enemy].amount = enemy.atb_lineamount
@meters[enemy].atb_visible = true
end
end
#--------------------------------------------------------------------------
def refresh_meter(enemy)
case Enemy_Meter
when 1
@meter.x = enemy.base_x - @skin.width / 2
@meter.y = enemy.base_y - @skin.height / 5
@meter.z = @meter.y
when 2
@meter.x = enemy.base_x - @skin.width / 2
@meter.y = enemy.base_y - @skin.height / 5 - 64
@meter.z = 1000
when 3
@meter.x = 32
@meter.y = 80 + enemy.index * 32
@meter.z = 3000
end
@meters[enemy] = @meter
end
#--------------------------------------------------------------------------
def visible=(b)
@meters.keys.each{|sprite| @meters[sprite].visible = b }
end
#--------------------------------------------------------------------------
def opacity=(b)
@meters.keys.each{|sprite| @meters[sprite].opacity = b }
end
#--------------------------------------------------------------------------
def dispose
@meters.keys.each{|sprite| @meters[sprite].dispose }
end
end
#==============================================================================
# ■ ATB_Bars
#==============================================================================
class ATB_Bars
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def initialize
@base = Sprite.new
@base.bitmap = RPG::Cache.windowskin(Bar_Skin).dup
@base.x = X_Bar
@base.y = Y_Bar
@base.z = 3000
@width = @base.bitmap.width
@height = @base.bitmap.height
@iconset = []
@base.opacity = self.opacity = 255
refresh
end
#--------------------------------------------------------------------------
def refresh
return @base.opacity = self.opacity = 0 unless Bars
need_refresh = []
for battler in $game_party.actors + $game_troop.enemies
exist = false
for set in @iconset
exist |= (set[1] == battler)
end
need_refresh << battler unless exist
end
for battler in need_refresh
iconname = nil
if battler.is_a?(Game_Actor)
iconname = Party_Icon[battler.battler_name]
else
iconname = Enemy_Icon[battler.battler_name]
end
if iconname.nil?
if battler.is_a?(Game_Actor)
iconname = Default_Party_Icon
else
iconname = Default_Enemy_Icon
end
end
icon = Sprite.new
icon.bitmap = RPG::Cache.icon(iconname).dup
icon.y = Y_Bar + @height / 2 - 12
@iconset << [icon, battler] unless @iconset.include?([icon, battler])
end
for icon in @iconset
icon[0].x = X_Bar + @width * icon[1].atb / icon[1].max_atb - 12
icon[0].z = 3001
icon[0].visible = icon[1].exist?
icon[0].opacity = icon[1].exist? ? 255 : 0
end
self.visible = $game_temp.hide_windows ? false : true
end
#--------------------------------------------------------------------------
def visible=
@base.visible = n
for icon in @iconset
icon[0].visible = n
end
end
#--------------------------------------------------------------------------
def opacity=
@base.opacity = n
for icon in @iconset
icon[0].opacity = n
end
end
#--------------------------------------------------------------------------
def dispose
@base.dispose
for icon in @iconset
icon[0].dispose
end
end
end
#==============================================================================
# ■ Escape_Meters
#==============================================================================
class Escape_Meters
#--------------------------------------------------------------------------
attr_accessor :meters
attr_reader :meters
attr_accessor :enemy_meters
attr_reader :enemy_meters
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def initialize
@skin = RPG::Cache.windowskin(Escape_Skin)
@escape_meter = MeterSprite.new(@skin, 3)
refresh_meter
refresh
end
#--------------------------------------------------------------------------
def refresh
@escape_meter.line = $game_temp.escape_atb_linetype
@escape_meter.amount = $game_temp.escape_atb_lineamount
@escape_meter.z = 5000
end
#--------------------------------------------------------------------------
def refresh_meter
case Escape_Meter_Pos_Type
when 0
@escape_meter.x = 608 - @skin.width
@escape_meter.y = 80
when 1
@escape_meter.x = 320 - skin.width
@escape_meter.y = 64
when 2
@escape_meter.x = Escape_Meter_Position[0]
@escape_meter.y = Escape_Meter_Position[1]
end
@escape_meter.z = 5000
end
#--------------------------------------------------------------------------
def visible=
@escape_meter.visible = n
end
#--------------------------------------------------------------------------
def opacity=
@escape_meter.opacity = n
end
#--------------------------------------------------------------------------
def dispose
@escape_meter.dispose
end
end
#==============================================================================
# ■ MeterSprite
#==============================================================================
class MeterSprite < Sprite
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def initialize(skin, line_height)
@line_height = line_height
@skin = skin
@width = @skin.width
@height = @skin.height / @line_height
@line = 1
@amount = 0
@atb_visible = false
@base_sprite.dispose if @base_sprite != nil
viewport = [3,4].include?(Meter_Pos_Style) ? $game_temp.battlers_viweport : nil
@base_sprite = Sprite.new(viewport)
@base_sprite.bitmap = @skin
@base_sprite.src_rect.set(0, 0, @width, @height)
super(viewport)
self.bitmap = @skin
self.line = 1
self.opacity = 0 if @line_height == 3
end
#--------------------------------------------------------------------------
def line=
@line = n
refresh
end
#--------------------------------------------------------------------------
def amount=
@amount = n
refresh
end
#--------------------------------------------------------------------------
def visible=
@base_sprite.visible = n
super
end
#--------------------------------------------------------------------------
def opacity=
@base_sprite.opacity = n
super
end
#--------------------------------------------------------------------------
def atb_visible=
@atb_visible = n
refresh
end
#--------------------------------------------------------------------------
def refresh
self.src_rect.set(0, @line * @height, @width * @amount / 100, @height)
end
#--------------------------------------------------------------------------
def x=
super
@base_sprite.x = n
end
#--------------------------------------------------------------------------
def y=
super
@base_sprite.y = n
end
#--------------------------------------------------------------------------
def z=
super
@base_sprite.z = z - 1
end
#--------------------------------------------------------------------------
def dispose
@base_sprite.dispose
super
end
end
[/rgss]
skill blitz:
[rgss]#==============================================================================
# Skill Blitz
# By Atoa
# Based on Claimh Blitz Script
#==============================================================================
# With this script, you must make an command input before the skills
#
# When the input fail, the skill may fail or have the damage reduce.
# (it can be set individually for each skill)
#==============================================================================
module Atoa
# Keyborard setting (don't change unless you know what you doing)
A = Input::A # Keyborard:Z
B = Input::B # Keyborard:X
C = Input::C # Keyborard:C
X = Input::X # Keyborard:A
Y = Input::Y # Keyborard:S
Z = Input::Z # Keyborard:D
L = Input::L # Keyborard:Q
R = Input::R # Keyborard:W
UP = Input::UP
DOWN = Input::DOWN
LEFT = Input::LEFT
RIGHT = Input::RIGHT
# Time for each input
Key_Sec = 1.0
# Blitz_Window_Settings = [Width, Height, Opacity, Trasparent Edge]
Blitz_Window_Settings = [280, 128, 160, false]
# Image filename for window backgeound, must be on the Windowskin folder
Blitz_Window_Bg = ''
# Position of the backgroun image
# Blitz_Window_Bg_Postion = [Position X, Position Y]
Blitz_Window_Bg_Postion = [0 , 0]
# Configuration of the input exhibition.
Keyboard_Type = true
# true = keyboard exhibition (Ex.: X = keyboard X)
# false = input exhibition (Ex.: X = keyboard A)
# Show input entry with images
Input_Images = true
# Settings for comand entry images
# The images must be on the windowsing folder.
# Besides the images with names set here, you will need images with
# *the same file name* + 'in' to show the commands already inputed
A_Image = 'ButonA' # Keyboard:Z
B_Image = 'ButonB' # Keyboard:X
C_Image = 'ButonC' # Keyboard:C
X_Image = 'ButonX' # Keyboard:A
Y_Image = 'ButonY' # Keyboard:S
Z_Image = 'ButonZ' # Keyboard:D
L_Image = 'ButonL' # Keyboard:Q
R_Image = 'ButonR' # Keyboard:W
UP_Image = 'ButonUP'
DOWN_Image = 'ButonDOWN'
LEFT_Image = 'ButonLEFT'
RIGHT_Image = 'ButonRIGHT'
# Settings for command input for skill with cast time
# Works only with the scripts Atoa ATB our Atoa CTB
Blitz_Aftercast = false
# true = Command Input is made after cast time
# false = Command Input is made before cast time
# Graphic file name of the Blitz Bar, must be on the Graphic/Windowskins folder
Blitz_Bar_Name = 'BLITZMeter'
# Postion of the commands exhibition on the window
Input_Display_Position = [0, 48]
# Type of Bar advance.
Bar_Advance_Type = 0
# 0 = the bar increase
# 1 = the bar decrease
# Input display position
Input_Display_Position = 2
# 0 = Default, not centralized
# 1 = Default, centralized
# 2 = Customized
# Postion of the input display if Input_Display_Position = 2
Custom_Diplay_Postion = [[320,180],[320,180],[320,180],[320,180]]
# Show Success/Fail message?
Show_Success_Fail = false
Success_Fail_Position = [0, 48]
# Show actor name on the window?
Show_Actor_Name = true
Actor_Name_Position = [0, 0]
# Show skill name on the window?
Show_Skill_Name = true
Skill_Name_Position = [0, 24]
# Sound file used when the input fails
Input_Fail_Sound = '003-System03'
# Sound file used when the input succeceds
Input_Success_Sound = '007-System07'
# Message shown when the input fails
Input_Fail_Message = 'Failed'
# Message shown when the input succeceds
Input_Success_Message = 'Success!'
# Skill setting
Blitz_Skill = {
# Skill ID => [[Key 1, Key 2,...], Cancel, Power, Fail Anim)]
# Skill_ID: ID of the Skill
# Key 1, Key 2,...: Input order.
# Cancel: set if the skill will canceled
# true = the skill isn't used if the input fail
# false = the skill is used even if the input fail
# Power: Power rate if the input fail, only valid if Cancel = false
# Fail Anim: ID of the animation used when the input fails, nil or 0 for no anim
7 => [[UP,DOWN,LEFT], true, 50, 4],
8 => [[X,C,Z], true, 50, 4],
9 => [[DOWN,X,A,B], true, 50, 4],
10 => [[LEFT,UP], true, 50, 4],
11 => [[L,X,R], true, 50, 4],
12 => [[X,C,RIGHT,R], true, 50, 4],
13 => [[UP,RIGHT], true, 50, 4],
14 => [[L,Z,A], true, 50, 4],
15 => [[R,X,X,DOWN], true, 50, 4],
16 => [[DOWN, RIGHT], true, 50, 4],
17 => [[A,B,C], true, 50, 4],
18 => [[Y,X,DOWN,B], true, 50, 4],
19 => [[LEFT,DOWN], true, 50, 4],
20 => [[Z,Y,A], true, 50, 4],
21 => [[B,C,X,L], true, 50, 4],
22 => [[RIGHT,DOWN], true, 50, 4],
23 => [[A,B,R], true, 50, 4],
24 => [[X,Y,LEFT,R], true, 50, 4],
25 => [[LEFT,RIGHT], true, 50, 4],
26 => [[X,L,B], true, 50, 4],
27 => [[LEFT,X,C,Z], true, 50, 4],
28 => [[LEFT,DOWN], true, 50, 4],
29 => [[C,X,A], true, 50, 4],
30 => [[X,Z,C,UP], true, 50, 4],
31 => [[UP,DOWN,X], true, 50, 4],
32 => [[LEFT,RIGHT,L,R], true, 50, 4],
57 => [[A, C], true, 50, 4],
58 => [[C, X, UP], true, 50, 4],
59 => [[A, UP, RIGHT, A], true, 50, 4],
60 => [[Z, C, A, B], true, 50, 4],
61 => [[X, C], true, 50, 4],
62 => [[UP, X, DOWN], true, 50, 4],
63 => [[LEFT, C, Y, A], true, 50, 4],
64 => [[X, C, Y, A], true, 50, 4],
65 => [[Y, A], true, 50, 4],
66 => [[RIGHT, B, A], true, 50, 4],
67 => [[LEFT, UP, Z, A], true, 50, 4],
68 => [[Y, B, Y, A], true, 50, 4],
69 => [[LEFT, A], true, 50, 4],
70 => [[A, C, A], true, 50, 4],
71 => [[B, B, A, A], true, 50, 4],
72 => [[A, B, X, Y], true, 50, 4],
73 => [[X, A], true, 50, 4],
74 => [[Y, A, B], true, 50, 4],
75 => [[LEFT, RIGHT, Y, A], true, 50, 4],
76 => [[A, C, L, A], true, 50, 4],
77 => [[R, X], true, 50, 4],
78 => [[L, C, R], true, 50, 4],
79 => [[LEFT, L, RIGHT, R], true, 50, 4],
80 => [[C, C, Z, RIGHT], true, 50, 4],
}
end
#==============================================================================
# ■ Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Blitz'] = true
#==============================================================================
# ■ Input
#==============================================================================
module Input
#--------------------------------------------------------------------------
module_function
#--------------------------------------------------------------------------
def n_trigger?(num)
if trigger?(num)
return false
elsif trigger?(A) or trigger?(B) or trigger?(C) or
trigger?(X) or trigger?(Y) or trigger?(Z) or
trigger?(L) or trigger?(R) or
trigger?(UP) or trigger?(DOWN) or trigger?(RIGHT) or trigger?(LEFT)
return true
end
return false
end
#--------------------------------------------------------------------------
def key_converter(key)
if Atoa::Keyboard_Type
case key
when A then return 'Z'
when B then return 'X'
when C then return 'C'
when X then return 'A'
when Y then return 'S'
when Z then return 'D'
when L then return 'Q'
when R then return 'W'
end
else
case key
when A then return 'A'
when B then return 'B'
when C then return 'C'
when X then return 'X'
when Y then return 'Y'
when Z then return 'Z'
when L then return 'R'
when R then return 'L'
end
end
case key
when UP then return '↑'
when DOWN then return '↓'
when LEFT then return '←'
when RIGHT then return '→'
end
end
#--------------------------------------------------------------------------
def key_image(key)
case key
when A then return Atoa::A_Image
when B then return Atoa::B_Image
when C then return Atoa::C_Image
when X then return Atoa::X_Image
when Y then return Atoa::Y_Image
when Z then return Atoa::Z_Image
when L then return Atoa::L_Image
when R then return Atoa::R_Image
when UP then return Atoa::UP_Image
when DOWN then return Atoa::DOWN_Image
when LEFT then return Atoa::LEFT_Image
when RIGHT then return Atoa::RIGHT_Image
end
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
attr_accessor :blitz_flag
#--------------------------------------------------------------------------
alias atoa_initialize_blitz initialize
def initialize
atoa_initialize_blitz
@blitz_flag = false
end
#--------------------------------------------------------------------------
alias atoa_skill_effect_blitz skill_effect
def skill_effect(user, skill)
set_tatic_hp(user)
result = atoa_skill_effect_blitz(user, skill)
set_blitz_damage(user, skill)
return result
end
#--------------------------------------------------------------------------
def set_tatic_hp(user)
if $scene.is_a?(Scene_Battle) and user.blitz_flag
@hp_blitz = self.hp
@sp_blitz = self.sp
end
end
#--------------------------------------------------------------------------
def set_blitz_damage(user, skill)
if $scene.is_a?(Scene_Battle) and user.blitz_flag
self.damage = (self.damage * Blitz_Skill[skill.id][2]) / 100
self.hp = @hp_blitz - self.damage unless self.sp_damage
self.sp = @sp_blitz - self.damage if self.sp_damage
end
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
alias atoa_step2_part1_blitz step2_part1
def step2_part1(battler)
atoa_step2_part1_blitz(battler)
battler.blitz_flag = false
if battler.actor? and battler.skill? and
Blitz_Skill[battler.current_action.skill_id] != nil
if ($atoa_script['Atoa ATB'] or $atoa_script['Atoa CTB'])
return if Blitz_Aftercast and battler.casting
return if !Blitz_Aftercast and !battler.casting
end
result = make_blitz_result(battler)
if result and Blitz_Skill[battler.current_action.skill_id][1]
blitz_fail_anime(battler, battler.current_action.skill_id)
battler.current_phase = 'Phase 6-1'
if $atoa_script['Atoa ATB']
battler.cast_action = nil
elsif $atoa_script['Atoa CTB']
battler.cast_action = nil
battler.current_cost = No_Action_Cost
end
end
end
end
#--------------------------------------------------------------------------
def blitz_fail_anime(battler, skill_id)
unless Blitz_Skill[battler.current_action.skill_id][3].nil? or
Blitz_Skill[battler.current_action.skill_id][3] == 0
battler.animation_id = Blitz_Skill[battler.current_action.skill_id][3]
battler.animation_hit = true
battler.wait_time = $data_animations[battler.animation_id].frame_max * 2
end
end
#--------------------------------------------------------------------------
def make_blitz_result(battler)
blitz_skill = Blitz_Skill[battler.current_action.skill_id][0]
time = Key_Sec * blitz_skill.size * Graphics.frame_rate
key_count = 0
battler.blitz_flag = true
case Window_Display_Position
when 0
actor_x = (battler.index * 156) - (battler.index * 38)
actor_y = 192
when 1
actor_x = (((640 / Max_Party) * ((4 - $game_party.actors.size) / 2.0 + battler.index)).floor) - (battler.index * 40)
actor_y = 192
when 2
actor_x = battler.base_x - 160
actor_y = battler.base_y - 64
when 3
actor_x = Custom_Diplay_Postion[battler.index][0]
actor_y = Custom_Diplay_Postion[battler.index][0]
end
img = RPG::Cache.windowskin(Blitz_Bar_Name)
imgw = img.width
img.dispose
skill_name = $data_skills[battler.current_action.skill_id].name
window_keycount = Window_KeyCount.new(blitz_skill, battler.name, skill_name, actor_x, actor_y)
window_counter = Window_KeyCounter.new(actor_x, actor_y + 80, imgw + 32, 64)
for i in 0...time
if battler.dead?
window_keycount.dispose
window_counter.dispose
break
end
if Input.trigger?(blitz_skill[key_count])
key_count += 1
window_keycount.key_in(battler.name, skill_name)
elsif Input.n_trigger?(blitz_skill[key_count])
break
end
if key_count >= blitz_skill.size
if Show_Success_Fail
window_keycount.text_in(Input_Success_Message, battler.name, skill_name)
end
Audio.se_play('Audio/SE/' + Input_Success_Sound)
battler.blitz_flag = false
break
end
window_counter.refresh((i * imgw / time), imgw)
update_graphics
end
if battler.blitz_flag
if Show_Success_Fail
window_keycount.text_in(Input_Fail_Message, battler.name, skill_name)
end
Audio.se_play('Audio/SE/' + Input_Fail_Sound)
end
window_keycount.dispose
window_counter.dispose
return battler.blitz_flag
end
end
#==============================================================================
# ■ Window_KeyCounter
#==============================================================================
class Window_KeyCounter < Window_Base
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 4000
refresh(0, width - 32)
end
#--------------------------------------------------------------------------
def refresh(current, w)
self.contents.clear
draw_counter_bar(0, 0, current) if Bar_Advance_Type == 0
draw_counter_bar(0, 0, w - current) if Bar_Advance_Type == 1
end
#--------------------------------------------------------------------------
def draw_counter_bar(x, y, current)
bitmap = RPG::Cache.windowskin(Blitz_Bar_Name)
cw = bitmap.width
ch = bitmap.height / 2
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
cw = bitmap.width * current / bitmap.width
src_rect = Rect.new(0, ch, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
end
#==============================================================================
# ■ Window_KeyCount
#==============================================================================
class Window_KeyCount < Window_Base
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def initialize(key, battler_name, skill_name, actor_x, actor_y)
super(actor_x, actor_y, Blitz_Window_Settings[0], Blitz_Window_Settings[1])
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = Blitz_Window_Settings[2]
self.opacity = Blitz_Window_Settings[2] if Blitz_Window_Settings[3]
self.z = 4000
if Blitz_Window_Bg != nil
@background_image = Sprite.new
@background_image.bitmap = RPG::Cache.windowskin(Blitz_Window_Bg)
@background_image.x = self.x + Blitz_Window_Bg_Postion[0]
@background_image.y = self.y + Blitz_Window_Bg_Postion[1]
@background_image.z = self.z - 1
@background_image.visible = self.visible
end
@key = key
@key_count = 0
create_input_images if Input_Images
refresh(battler_name, skill_name)
end
#--------------------------------------------------------------------------
def create_input_images
images = [A_Image, B_Image, C_Image, X_Image, Y_Image, Z_Image, L_Image,
R_Image, UP_Image, DOWN_Image, LEFT_Image, RIGHT_Image]
@images_bitmaps = {}
for img in images
@images_bitmaps = RPG::Cache.windowskin(img)
@images_bitmaps[img + "in"] = RPG::Cache.windowskin(img + "in")
end
end
#--------------------------------------------------------------------------
def refresh(battler_name, skill_name)
self.contents.clear
draw_info(battler_name, skill_name)
for i in 0...@key.size
if Input_Images
inputed = i < @key_count ? 'in' : ''
bitmap = @images_bitmaps[Input.key_image(@key[i]) + inputed]
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
x = i * bitmap.width
self.contents.blt(Input_Display_Position[0] + x, Input_Display_Position[1], bitmap, rect)
else
x = i * 32
self.contents.font.color = i < @key_count ? knockout_color : normal_color
self.contents.draw_text(x, 48, 100, 32, Input.key_converter(@key[i]))
end
end
end
#--------------------------------------------------------------------------
def key_in(battler_name, skill_name)
@key_count += 1
refresh(battler_name, skill_name)
end
#--------------------------------------------------------------------------
def draw_info(battler_name, skill_name)
if Show_Actor_Name
self.contents.font.color = normal_color
self.contents.draw_text(Actor_Name_Position[0], Actor_Name_Position[1], 240, 32, battler_name)
end
if Show_Skill_Name
self.contents.font.color = system_color
self.contents.draw_text(Skill_Name_Position[0], Skill_Name_Position[1], 240, 32, skill_name)
end
end
#--------------------------------------------------------------------------
def text_in(text, battler_name, skill_name)
self.contents.clear
draw_info(battler_name, skill_name)
self.contents.font.color = text == Input_Success_Message ? crisis_color : knockout_color
self.contents.draw_text(Success_Fail_Position[0], Success_Fail_Position[1], 240, 32, text)
end
#--------------------------------------------------------------------------
def dispose
super
@background_image.dispose if @background_image != nil
end
end
[/rgss]
Overdrive:
[rgss]#==============================================================================
# Skill Overdrive
# By Atoa
#==============================================================================
# This Add-On adds an Overdrive/Limit Break system to the game.
# It works like this:
# A new bar is created, and gets filled up by many different actions, easily
# defined by you. You can set actions that consume specifica ammounts of
# that bar.
#
# IMPORTANT:
#
# All actors starts with the overdrive DISABLES.
# to enable the overdrive of an actor, you must make an 'Script Call':
# $game_actors[ID].overdrive_unlock = true
#==============================================================================
module Atoa
# Do not remove these lines
Actor_Overdrive = {}
Overdrive_Skills = {}
Overdrive_Damage = {}
Overdrive_Modifier = {}
# Do not remove these lines
# Name of the Overdrive bar graphic file. Must be on the Windowskins folder.
Overdrive_Meter = 'ODMeter'
# Name of the Overdrive bar back graphic file. Must be on the Windowskins folder.
# Leave nil for no background
Overdrive_Back = 'ODMeterBack'
# Maximum value of the Overdrive Bar.
Max_Overdrive = 1000
# Add here the skills that consum overdritve to be activated
# Overdrive_Skills[ID] = Cost
# ID = Skill ID
# Custo = Overdrive value used, numeric vaule. Can't be higher than the value
# of 'Max_Overdrive', you can user the constante Max_Overdrive to set
# an value equal the max (so the action will consum all bar)
Overdrive_Skills[108] = Max_Overdrive
# Add here skill that changes the target overdrive when causing damage
# Overdrive_Damage[ID] = Damage
# ID = ID da skill.
# Damage = 'Damage' on the Overdrive bar. Changes with the damage caused.
# Add here skills and weapons that haves an different overdrive gain rate
# Overdrive_Modifier['Type'] = {ID => Modifier}
# 'Type' = 'Weapons' for weapons, 'Skills' for skills
# ID = ID of the skill/weapons
# Modifier = Rate of overdrive gain. 100 = no change.
Overdrive_Modifier['Skill'] = {92 => 20, 93 => 30, 126 => 10, 127 => 10, 128 => 150}
# Initial Overdrive value for each actor
# Actor_Overdrive[ID] = {Type => Value}
Actor_Overdrive[1] = {'Heal' => 100,'Atk' => 100, 'Miss' => 200, 'Win' => 300, 'Kill' => 300, 'Crt Atk' => 200}
Actor_Overdrive[2] = {'Mag' => 100,'Atk' => 100, 'Turn' => 50, 'Danger' => 150, 'Kill' => 300, 'Crt Dmg' => 250}
Actor_Overdrive[3] = {'Mag' => 100,'Dmg' => 200, 'Eva' => 200, 'Dead' => 100, 'Alive' => 30, 'Turn' => 50, 'Crt Atk' => 200}
Actor_Overdrive[4] = {'Heal' => 100, 'Dmg' => 200, 'Run' => 300, 'Alive' => 30, 'Danger' => 150, 'Crt Dmg' => 250}
# The values not liste here will be = 0.
# Values = 0 will represent no change on the overdrive.
# You can even set negative values, so it will mean lost on overdrive.
# You can change at any time the overdrive gain rate of an determined type of
# overdrive of an actor.
# just use this code: $game_actors[Actor ID].set_overdrive_gain(Type, Value}
# Overdrive increase types
# 'Atk' = Gain on attacking, varies depending on the damage dealt and level
# 'Mag' = Gain on attacking with magic, varies depending on the damage dealt and level
# 'Heal' = Gain on healing, varies depending on the heal and level
# 'Atk Dmg' = Gain when attacked physically, varies depending on the damage received and level
# 'Mag Dmg' = Gain when attacked with magic, varies depending on the damage received and level
# 'Eva' = Gain when attack is dodged
# 'Miss' = Gain when an attack misses
# 'Win' = Gain when a battle is won
# 'Run' = Gain after fleeing a battle
# 'Dead' = Gain on the beginning of the turn for each dead ally
# 'Alive' = Gain at the beginning of the turn for each alive ally
# 'Turn' = Gain at the beginning of the turn
# 'Danger' = Gain at the beginning of the turn if the character in danger
# 'Kill' = Gain if the character kills the target while attacking
# 'Crt Atk' = Gain when cause critical damage, varies depending on the damage dealt and level
# 'Crt Dmg' = Gain when recive critical damage, varies depending on the damage received and level
# 'Advantage' = Gain at the beginning of the turn if have more alive actors than enemies
# 'Disvantage' = Gain at the beginning of the turn if have less alive actors than enemies
# OD Meter position on the Battle Status Window
OD_Battle_Style = 0
# 0 = Horizontal Pattern, not centralized
# 1 = Horizontal Pattern, centralized
# 2 = Vertical bars
# 3 = Custom Position
# Readjustment of the OD Meter's position on the Battle Status Window.
OD_X_Position = 0 # X position of the Meters
OD_Y_Position = 112 # Y position of the Meters
# Custom OD Bar position, only valid when OD_Battle_Style = 3
OD_Custom_Position = [[460,180],[480,210],[500,240],[520,270]]
# Color of the overdrive skill on the menu (only when they're avaliable) in RGB
# Overdrive_Color = [Red, Green, Blue]
# Leave nil for no color.
Overdrive_Color = [255, 255, 0]
# Number of lines of the Overdrive bar graphic
Overdrive_Lines = 3
# Line of the overdrive bar graphic used based on the value on the bar
# Overdrive_Line_Value = { 'Condition' => Line}
# 'Condition' = String with an condition that sets wich line will be shown.
# Must be an valid script condition, where actor.overdrive is the overdrive value
# It's need some knowledge on RGSS, don't mess with it if you don't know
# Line = Line of the Overdrive bar graphic used.
#
Overdrive_Line_Value = {
'actor.overdrive <= Max_Overdrive / 4' => 1,
'actor.overdrive > Max_Overdrive / 4 and actor.overdrive < Max_Overdrive' => 2,
'actor.overdrive == Max_Overdrive' => 3
}
# OD Meter position in main menu
Menu_Style = 1
# 0 = Don't show
# 1 = Above HP
# 2 = Bellow name
# 3 = Bellow level
end
#==============================================================================
# ■ Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Overdrive'] = true
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill
#--------------------------------------------------------------------------
def overdrive_cost
return Overdrive_Skills[@id].nil? ? 0 : [Overdrive_Skills[@id], Max_Overdrive].min
end
#--------------------------------------------------------------------------
def overdrive_dmg
return Overdrive_Damage[@id].nil? ? 0 : Overdrive_Damage[@id]
end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
attr_accessor :overdrive_gain
attr_accessor :overdrive_unlock
attr_accessor :old_overdrive
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
alias atoa_initialize_od initialize
def initialize(actor_id)
atoa_initialize_od(actor_id)
set_initial_overdrive
@overdrive_unlock = false
@old_overdrive = overdrive
end
#--------------------------------------------------------------------------
def set_initial_overdrive
@overdrive_gain = {}
od_list = ['Atk', 'Mag', 'Heal', 'Atk Dmg', 'Mag Dmg', 'Eva', 'Miss', 'Win', 'Run',
'Dead', 'Alive', 'Turn', 'Danger', 'Kill', 'Crt Atk', 'Crt Dmg',
'Advantage', 'Disvantage']
for od in od_list
if Actor_Overdrive[@actor_id] != nil and Actor_Overdrive[@actor_id].include?(od)
@overdrive_gain[od] = Actor_Overdrive[@actor_id][od]
else
@overdrive_gain[od] = 0
end
end
end
#--------------------------------------------------------------------------
def set_overdrive_gain(type, value)
@overdrive_gain[type] = value
end
#--------------------------------------------------------------------------
def max_overdrive
return Max_Overdrive
end
#--------------------------------------------------------------------------
def overdrive
return (@overdrive == nil or @overdrive_unlock == false) ? @overdrive = 0 : @overdrive
end
#--------------------------------------------------------------------------
def overdrive=(n)
n = 0 if @overdrive_unlock == false
@overdrive = [[n.to_i, 0].max, self.max_overdrive].min
end
#--------------------------------------------------------------------------
def overdrive_full?
return @overdrive == self.max_overdrive
end
#--------------------------------------------------------------------------
def overdrive_update
@overdrive = 0 if self.dead? or @overdrive_unlock == false
end
#--------------------------------------------------------------------------
def consume_skill_cost(skill)
super(skill)
self.overdrive = [self.overdrive - skill.overdrive_cost, 0].max
end
#--------------------------------------------------------------------------
alias atoa_skill_can_use_od skill_can_use?
def skill_can_use?(skill_id)
return false unless self.overdrive >= $data_skills[skill_id].overdrive_cost
return atoa_skill_can_use_od(skill_id)
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
alias atoa_attack_effect_od attack_effect
def attack_effect(attacker)
effective = atoa_attack_effect_od(attacker)
attack_od(attacker, attacker.weapons[0]) if effective and self.damage.is_a?(Numeric)
miss_od(attacker) if self.damage == Miss_Message
return effective
end
#--------------------------------------------------------------------------
alias atoa_skill_effect_od skill_effect
def skill_effect(user, skill)
effective = atoa_skill_effect_od(user, skill)
if skill.overdrive_cost == 0 and not check_include(skill, 'SPDAMAGE')
attack_od(user, skill) if self.damage.is_a?(Numeric) and not skill.magic?
mag_od(user, skill) if self.damage.is_a?(Numeric) and skill.magic?
miss_od(user) if self.damage == Miss_Message
end
if skill.overdrive_dmg != 0 and not check_include(skill, 'SPDAMAGE')
user.overdrive -= calc_dmg_overdrive(self.damage, skill.overdrive_dmg).to_i
end
return effective
end
#--------------------------------------------------------------------------
def attack_od(user, skill = nil)
if user.actor? and not self.actor? and self.damage > 0
user.overdrive += calc_dmg_overdrive(self.damage, user.overdrive_gain['Atk'], skill).to_i
user.overdrive += calc_dmg_overdrive(self.damage, user.overdrive_gain['Crt Atk'], skill).to_i
user.overdrive += user.overdrive_gain['Kill'] if self.hp <= 0
elsif self.actor? and not user.actor? and self.damage > 0
self.overdrive += calc_dmg_overdrive(self.damage, self.overdrive_gain['Atk Dmg']).to_i
self.overdrive += calc_dmg_overdrive(self.damage, self.overdrive_gain['Crt Dmg']).to_i
end
end
#--------------------------------------------------------------------------
def mag_od(user, skill = nil)
if user.actor? and not self.actor? and self.damage > 0
user.overdrive += calc_dmg_overdrive(self.damage, user.overdrive_gain['Mag'], skill).to_i
elsif user.actor? and self.actor? and self.damage < 0
user.overdrive += calc_dmg_overdrive(self.damage.abs, user.overdrive_gain['Mag'], skill).to_i
elsif self.actor? and not user.actor? and self.damage > 0
self.overdrive += calc_dmg_overdrive(self.damage, self.overdrive_gain['Mag Dmg']).to_i
end
end
#--------------------------------------------------------------------------
def calc_dmg_overdrive(dmg, gain, action = nil)
if action != nil and Overdrive_Modifier[action.type_name] != nil and
Overdrive_Modifier[action.type_name][action.id] != nil
modifier = Overdrive_Modifier[action.type_name][action.id] / 100.0
else
modifier = 1.0
end
if dmg <= self.maxhp / 10
return (gain * modifier * (dmg * 100 / (self.maxhp / 10.0)) / 100).to_i
else
value = (dmg > self.maxhp / 5) ? self.maxhp / 5 : dmg
return (gain * modifier * (value * 100 / (self.maxhp / 10.0)) / 100).to_i
end
end
#--------------------------------------------------------------------------
def miss_od(user)
if user.actor? and !self.actor?
user.overdrive += user.overdrive_gain['Miss']
elsif self.actor? and not user.actor?
self.overdrive += self.overdrive_gain['Eva']
end
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
def draw_actor_overdrive(actor, x, y)
return unless actor.overdrive_unlock
if Overdrive_Back != nil
back = RPG::Cache.windowskin(Overdrive_Back)
w = back.width
h = back.height
src_rect = Rect.new(0, 0, w, h)
self.contents.blt(x, y, back, src_rect)
end
skin = RPG::Cache.windowskin(Overdrive_Meter)
w = skin.width
h = skin.height / Overdrive_Lines
line = set_line(actor)
amount = 100 * actor.overdrive / actor.max_overdrive
src_rect = Rect.new(0, line * h, w * amount / 100, h)
self.contents.blt(x , y, skin, src_rect)
end
#--------------------------------------------------------------------------
def set_line(actor)
for condition in Overdrive_Line_Value.keys
return [Overdrive_Line_Value[condition] - 1, 0].max if eval(condition)
end
return 0
end
end
#==============================================================================
# ■ Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
alias atoa_draw_item_od draw_item
def draw_item(index)
unless $atoa_script['Atoa Custom Windows']
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
if Overdrive_Color != nil and skill.overdrive_cost > 0
color = Overdrive_Color
self.contents.font.color = Color.new(color[0], color[1], color[2])
end
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
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, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
else
atoa_draw_item_od(index)
end
end
end
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
alias atoa_refresh_od refresh
def refresh
atoa_refresh_od
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
case OD_Battle_Style
when 0
meter_x = i * (624 / Max_Party) + OD_X_Position
meter_y = OD_Y_Position
when 1
meter_x = OD_X_Position + ((624 / Max_Party) * ((4 - $game_party.actors.size)/2.0 + i)).floor
meter_y = OD_Y_Position
when 2
meter_x = OD_X_Position
meter_y = i * 32 + OD_Y_Position
when 3
meter_x = OD_Custom_Position[i][0]
meter_y = OD_Custom_Position[i][1]
end
draw_actor_overdrive(actor, meter_x, meter_y)
end
end
end
#==============================================================================
# ■ Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
alias atoa_refresh_od refresh
def refresh
atoa_refresh_od
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
x = 64
y = i * 116
draw_actor_overdrive(actor, x + 236, y + 12) if Menu_Style == 1
draw_actor_overdrive(actor, x + 4, y + 24) if Menu_Style == 2
draw_actor_overdrive(actor, x + 4, y + 56) if Menu_Style == 3
end
end
end
#==============================================================================
# ■ Window_Status
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
alias refresh_atoa_od refresh
def refresh
refresh_atoa_od
draw_actor_overdrive(@actor, 96, 96) if Menu_Style != 0
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
alias atoa_battle_end_od battle_end
def battle_end(result)
case result
when 0
for actor in $game_party.actors
actor.overdrive += actor.overdrive_gain['Win']
end
when 1
for actor in $game_party.actors
actor.overdrive += actor.overdrive_gain['Run']
end
end
atoa_battle_end_od(result)
end
#--------------------------------------------------------------------------
alias atoa_step2_part1_od step2_part1
def step2_part1(battler)
if battler.actor?
for actor in $game_party.actors
battler.overdrive += battler.overdrive_gain['Dead'] if actor.dead?
battler.overdrive += battler.overdrive_gain['Alive'] if !actor.dead? and actor != battler
end
battler.overdrive += battler.overdrive_gain['Turn']
battler.overdrive += battler.overdrive_gain['Danger'] if battler.in_danger
battler.overdrive += battler.overdrive_gain['Advantage'] if party_diff > 0
battler.overdrive += battler.overdrive_gain['Disvantage'] if party_diff < 0
end
atoa_step2_part1_od(battler)
end
#--------------------------------------------------------------------------
def party_diff
party = enemies = 0
for actor in $game_party.actors
party += 1 unless actor.dead?
end
for enemy in $game_troop.enemies
enemies += 1 unless enemy.dead?
end
return party - enemies
end
#--------------------------------------------------------------------------
alias atoa_update_graphics_atoa_od update_graphics
def update_graphics
atoa_update_graphics_atoa_od
overdrive_update
end
#--------------------------------------------------------------------------
def overdrive_update
need_update = false
for actor in $game_party.actors
if actor.old_overdrive != actor.overdrive
actor.old_overdrive = actor.overdrive
need_update = true
actor.overdrive_update
if $atoa_script['Atoa ATB'] and @active_battler != nil and
@active_battler == actor and @active_battler.overdrive != @old_overdrive
@old_overdrive = @active_battler.overdrive
if @actor_command_window.active and @actor_command_window.visible
phase3_setup_command_window
elsif @skill_window != nil and @skill_window.active and @skill_window.visible
@skill_window.refresh
end
end
end
end
@status_window.refresh if need_update
end
end
[/rgss]