12-07-2008, 05:45 PM
This script basically allows you to alter the damage algorithms of skills with various effects.
Had to completely rewrite the script from the ground up since I noticed an issue with using multiple effects with the same name (Gravity:HP and Gravity:MP would only read gravity HP) So I rewrote each method with it's own name
Had to completely rewrite the script from the ground up since I noticed an issue with using multiple effects with the same name (Gravity:HP and Gravity:MP would only read gravity HP) So I rewrote each method with it's own name
Content Hidden
Code:
#===========================================================================
# ** Custom Skill Effects
#---------------------------------------------------------------------------
# By Lowell
# Also known as Twilight/Adalwulf
#---------------------------------------------------------------------------
# 03/11/09
# A much needed update that fixed issues with some skills reading from the same source.
# each effect has it's own note tag now so compatibility issues should be nonexistant.
# not heavily tested so post any bugs.
# 03/17/08
# Version 2.00
# Once again changed how a few skills were setup. If you prefer to original names
# you can change the name Initial Word Setup.
# New Effects include variable based damage which brings the grand total to 17!
# Version 1.08
# Fixes a nasty and unseen bug that made it ignore several things such as element rates and variance.
# Version 1.07
# Fixed a few issues and made the setup a little easier to read
# A few if the effects were removed as they didn't really do anything.
#===========================================================================
# Special Thanks goes to
# Diedrupo, For helping me with the script in it's initial stages
# Trickster, For teaching me the bits and pieces I needed to get started
# Space not Far, For creating such a simple method for using the notes field
#===========================================================================
=begin
NOTE FIELD
** Pre PARAM Modifier [HP & MP]
CUR: - Reads from Current HP|MP
MAX: - Reads from Maximum HP|MP
DIF: - Reads from Maximum HP|MP - Current HP|MP
RED: - Reduces HP|MP by defined amount.
SET: - Sets HP|MP to defined amount.
** Pre PARAM Modifier [STATS]
PER: - Reads from a percentage of the define stat. 100 is normal.
** PARAM Modifier
HP - Reads from the HP Stat
MP - Reads from the MP Stat
ATK - Reads from the attack parameter
DEF - Reads from the defense parameter
SPI - Reads from the spirit parameter
AGI - Reads from the agility parameter
HIT - Reads from the hit rate parameter
EVA - Reads from the evasion parameter
CRI - Reads from the critical parameter
VAR - Reads from the define variable
GP - Reads from the current gold value
SET - Deals the exact amount of damage
NONHP - Leaves the target with the HP Defined
NONMP - Leaves the target with the MP Defined
** Post PARAM Modifier [Actor & Enemy]
-ACT - Will use the actors parameter
-FOE - Will use the targets parameter
** EXAMPLES
<CUR:MP-ACT=125> - Deals Damage equal to your current MP x1.25
<MAX:HP-FOE=25> - Deals damage equal to 1/4 the targets Max HP
<PER:ATK-ACT=400> - Deals damage equal to your attack x4
<VAR=10> - Will deal damage equal to whatever Variable 10 is (Be sure to define it)
<SET:HP-FOE=1> - Sets the enemies HP to 1 (remove variance or it will most likely kill them)
<SET=1000> - Deals exactly 1000 Damage to the target (Obviously affected by resistances)
<RED:MP-FOE=100> Deals 100 Damage to the targets MP
=end
class Game_Battler
#----------------------------
# PARAM Modifiers HP
#----------------------------
LOW_CURHP_1 = "CUR:HP-ACT"
LOW_CURHP_2 = "CUR:HP-FOE"
LOW_MAXHP_1 = "MAX:HP-ACT"
LOW_MAXHP_2 = "MAX:HP-FOE"
LOW_DIFHP_1 = "DIF:HP-ACT"
LOW_DIFHP_2 = "DIF:HP-FOE"
LOW_REDHP_1 = "RED:HP-ACT"
LOW_REDHP_2 = "RED:HP-FOE"
LOW_SETHP_1 = "SET:HP-ACT"
LOW_SETHP_2 = "SET:HP-FOE"
#----------------------------
# PARAM Modifiers MP
#----------------------------
LOW_CURMP_1 = "CUR:MP-ACT"
LOW_CURMP_2 = "CUR:MP-FOE"
LOW_MAXMP_1 = "MAX:MP-ACT"
LOW_MAXMP_2 = "MAX:MP-FOE"
LOW_DIFMP_1 = "DIF:MP-ACT"
LOW_DIFMP_2 = "DIF:MP-FOE"
LOW_REDMP_1 = "RED:MP-ACT"
LOW_REDMP_2 = "RED:MP-FOE"
LOW_SETMP_1 = "SET:MP-ACT"
LOW_SETMP_2 = "SET:MP-FOE"
#----------------------------
# PARAM Modifiers STATS
#----------------------------
LOW_PERATK_1 = "PER:ATK-ACT"
LOW_PERATK_2 = "PER:ATK-FOE"
LOW_PERDEF_1 = "PER:DEF-ACT"
LOW_PERDEF_2 = "PER:DEF-FOE"
LOW_PERSPI_1 = "PER:SPI-ACT"
LOW_PERSPI_2 = "PER:SPI-FOE"
LOW_PERAGI_1 = "PER:AGI-ACT"
LOW_PERAGI_2 = "PER:AGI-FOE"
LOW_PERHIT_1 = "PER:HIT-ACT"
LOW_PERHIT_2 = "PER:HIT-FOE"
LOW_PEREVA_1 = "PER:EVA-ACT"
LOW_PEREVA_2 = "PER:EVA-FOE"
#----------------------------
# SPECIAL Modifiers
#----------------------------
LOW_VAR = "VAR"
LOW_GP = "GP"
LOW_SET = "SET"
LOW_NONHP = "NONHP"
LOW_NONMP = "NONMP"
#----------------------------
# HEAL Modifiers HP
#----------------------------
LOW_HEALCURHP_1 = "HEAL:CUR:HP-ACT"
LOW_HEALCURHP_2 = "HEAL:CUR:HP-FOE"
LOW_HEALMAXHP_1 = "HEAL:MAX:HP-ACT"
LOW_HEALMAXHP_2 = "HEAL:MAX:HP-FOE"
LOW_HEALDIFHP_1 = "HEAL:DIF:HP-ACT"
LOW_HEALDIFHP_2 = "HEAL:DIF:HP-FOE"
#----------------------------
# HEAL Modifiers MP
#----------------------------
LOW_HEALCURMP_1 = "HEAL:CUR:MP-ACT"
LOW_HEALCURMP_2 = "HEAL:CUR:MP-FOE"
LOW_HEALMAXMP_1 = "HEAL:MAX:MP-ACT"
LOW_HEALMAXMP_2 = "HEAL:MAX:MP-FOE"
LOW_HEALDIFMP_1 = "HEAL:DIF:MP-ACT"
LOW_HEALDIFMP_2 = "HEAL:DIF:MP-FOE"
#----------------------------
# HEAL Modifiers STATS
#----------------------------
LOW_HEALATK_1 = "HEAL:ATK-ACT"
LOW_HEALATK_2 = "HEAL:ATK-FOE"
LOW_HEALDEF_1 = "HEAL:DEF-ACT"
LOW_HEALDEF_2 = "HEAL:DEF-FOE"
LOW_HEALSPI_1 = "HEAL:SPI-ACT"
LOW_HEALSPI_2 = "HEAL:SPI-FOE"
LOW_HEALAGI_1 = "HEAL:AGI-ACT"
LOW_HEALAGI_2 = "HEAL:AGI-FOE"
LOW_HEALHIT_1 = "HEAL:HIT-ACT"
LOW_HEALHIT_2 = "HEAL:HIT-FOE"
LOW_HEALEVA_1 = "HEAL:EVA-ACT"
LOW_HEALEVA_2 = "HEAL:EVA-FOE"
#------------------------------------------------------------------
# Custom Skill Effects Start
#------------------------------------------------------------------
alias skill_damage_effects_make_obj_damage_value make_obj_damage_value
def make_obj_damage_value(user, obj)
skill_damage_effects_make_obj_damage_value(user, obj)
damage = obj.base_damage
if damage > 0
#----------------------------
# Current HP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_CURHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.hp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Current HP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_CURHP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.hp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Maximum HP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_MAXHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.maxhp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Maximum HP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_MAXHP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.maxhp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Difference HP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_DIFHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.maxhp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Difference HP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_DIFHP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.maxhp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Reduce HP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_REDHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += user.maxhp - memo[i].to_i
end
end
#----------------------------
# Reduce HP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_REDHP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += self.maxhp - memo[i].to_i
end
end
#----------------------------
# Set HP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_REDHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
user.hp = memo[i].to_i
end
end
#----------------------------
# Set HP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_REDHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
user.hp = memo[i].to_i
end
end
#=====================================================================
#----------------------------
# Current MP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_CURMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.mp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Current MP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_CURMP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.mp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Maximum MP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_MAXMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.maxmp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Maximum MP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_MAXMP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.maxmp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Difference MP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_DIFMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.maxmp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Difference MP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_DIFMP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.maxmp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Reduce MP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_REDMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += user.maxmp - memo[i].to_i
end
end
#----------------------------
# Reduce MP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_REDMP_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += self.maxmp - memo[i].to_i
end
end
#----------------------------
# Set MP - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_REDMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
user.mp = memo[i].to_i
end
end
#----------------------------
# Set MP - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_REDMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
user.mp = memo[i].to_i
end
end
#=====================================================================
#----------------------------
# Percentile ATK - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_PERATK_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.atk * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile DEF - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_PERDEF_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.def * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile SPI - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_PERSPI_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.spi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile AGI - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_PERAGI_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.agi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile HIT - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_PERHIT_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.hit * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile EVA - Actor
#----------------------------
memo = obj.note.scan(/<#{LOW_PEREVA_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (user.eva * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile ATK - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_PERATK_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.atk * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile DEF - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_PERDEF_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.def * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile SPI - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_PERSPI_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.spi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile AGI - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_PERAGI_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.agi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile HIT - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_PERHIT_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.hit * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Percentile EVA - Enemy
#----------------------------
memo = obj.note.scan(/<#{LOW_PEREVA_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += (self.eva * (memo[i].to_f / 100)).to_int
end
end
#--------------------------------------------------------------------
#----------------------------
# Special Modifier - Variable
#----------------------------
memo = obj.note.scan(/<#{LOW_VAR}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += $game_variables[memo[i].to_i]
end
end
#----------------------------
# Special Modifier - Gold
#----------------------------
memo = obj.note.scan(/<#{LOW_GP}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += ($game_party.gold * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Special Modifier - SET
#----------------------------
memo = obj.note.scan(/<#{LOW_SET}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage += memo[i+1].to_i
end
end
#----------------------------
# Special Modifier - Non Fatal HP
#----------------------------
memo = obj.note.scan(/<#{LOW_NONHP}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
self.hp += memo[i+1].to_i
end
end
#----------------------------
# Special Modifier - Non Fatal MP
#----------------------------
memo = obj.note.scan(/<#{LOW_NONHP}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
self.mp += memo[i+1].to_i
end
end
#---------------------------------------------------------------------
#----------------------------
# Heal Modifier - Current HP
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALCURHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.hp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Maximum HP
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALMAXHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.maxhp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Difference HP
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDIFHP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.maxhp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Current MP
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALCURMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.mp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Maximum MP
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALMAXMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.maxmp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Difference MP
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDIFMP_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.maxmp * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Attack
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALATK_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.atk * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Defense
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.def * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Spirit
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.spi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Agility
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.agi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Hit Rate
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.hit * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Evasion
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_1}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (user.eva * (memo[i].to_f / 100)).to_int
end
end
#--------------------------------------------------------------------
#----------------------------
# Heal Modifier - Attack
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALATK_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (self.atk * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Defense
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (self.def * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Spirit
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (self.spi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Agility
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (self.agi * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Hit Rate
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (self.hit * (memo[i].to_f / 100)).to_int
end
end
#----------------------------
# Heal Modifier - Evasion
#----------------------------
memo = obj.note.scan(/<#{LOW_HEALDEF_2}=(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
damage -= (self.eva * (memo[i].to_f / 100)).to_int
end
end
#-------------------------------------------
# Skill Damage Effects - Final Calculations
#-------------------------------------------
damage += user.atk * 4 * obj.atk_f / 100 # Attack F of the user
damage += user.spi * 2 * obj.spi_f / 100 # Spirit F of the user
unless obj.ignore_defense # Except for ignore defense
damage -= self.def * 2 * obj.atk_f / 100 # Attack F of the target
damage -= self.spi * 1 * obj.spi_f / 100 # Spirit F of the target
end
damage = 0 if damage < 0 # If negative, make 0
elsif damage < 0 # a negative number?
damage -= user.atk * 4 * obj.atk_f / 100 # Attack F of the user
damage -= user.spi * 2 * obj.spi_f / 100 # Spirit F of the user
end
damage *= elements_max_rate(obj.element_set) # elemental adjustment
damage /= 100
damage = apply_variance(damage, obj.variance) # variance
damage = apply_guard(damage) # guard adjustment
if obj.damage_to_mp
@mp_damage = damage # damage MP
else
@hp_damage = damage # damage HP
end
end
end