To use the following script call in the overdrive system below, use this in the events... $game_actors[1].gain_overdrive(50)
This next part deactivates overdrive... (Also in events)
$game_actors[1].deactivate_overdrive
Example Formula:
a.atk * (a.overdrive_active? ? 2.0 : 1.0)
The script is here ..
This next part deactivates overdrive... (Also in events)
$game_actors[1].deactivate_overdrive
Example Formula:
a.atk * (a.overdrive_active? ? 2.0 : 1.0)
The script is here ..
Code:
#==============================================================================
# ■ Dynamic Overdrive System
# Author: UndeadGamez
# Engine: RPG Maker VX Ace (RGSS3)
#------------------------------------------------------------------------------
# Adds an Overdrive gauge to actors that fills through combat.
# When full, the actor enters Overdrive Mode with boosted stats.
#==============================================================================
module Overdrive
MAX_GAUGE = 100
DAMAGE_GAIN = 0.15 # % of damage taken converted to gauge
ATTACK_GAIN = 0.10 # % of damage dealt converted to gauge
TURN_DRAIN = 20 # Gauge lost per turn while overdrive is active
PARAM_BOOST = {
:atk => 1.30,
:def => 1.20,
:agi => 1.25,
:mat => 1.30,
:mdf => 1.20
}
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
attr_reader verdrive
alias od_initialize initialize
def initialize(actor_id)
od_initialize(actor_id)
@overdrive = 0
@overdrive_active = false
end
def gain_overdrive(amount)
return if @overdrive_active
@overdrive= [[@overdrive + amount, 0].max, Overdrive::MAX_GAUGE].min
activate_overdrive if @overdrive >= Overdrive::MAX_GAUGE
end
def activate_overdrive
@overdrive_active = true
end
def deactivate_overdrive
@overdrive_active = false
@overdrive = 0
end
def overdrive_active?
@overdrive_active
end
alias od_on_turn_end on_turn_end
def on_turn_end
od_on_turn_end
if @overdrive_active
@overdrive -= Overdrive::TURN_DRAIN
deactivate_overdrive if @overdrive <= 0
end
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
alias od_execute_damage execute_damage
def execute_damage(user)
damage = @result.hp_damage
od_execute_damage(user)
if self.is_a?(Game_Actor) && damage > 0
gain = (damage * Overdrive:AMAGE_GAIN).to_i
self.gain_overdrive(gain)
end
if user.is_a?(Game_Actor) && damage > 0
gain = (damage * Overdrive::ATTACK_GAIN).to_i
user.gain_overdrive(gain)
end
end
end
#==============================================================================
# ■ Game_BattlerBase (Stat Boosts)
#==============================================================================
class Game_BattlerBase
alias od_param param
def param(param_id)
value = od_param(param_id)
return value unless actor? && overdrive_active?
case param_id
when 2 then value * Overdrive:ARAM_BOOST[:atk]
when 3 then value * Overdrive:ARAM_BOOST[:def]
when 4 then value * Overdrive:ARAM_BOOST[:mat]
when 5 then value * Overdrive:ARAM_BOOST[:mdf]
when 6 then value * Overdrive:ARAM_BOOST[:agi]
else value
end.to_i
end
end