So I've been editing the battle fomulas, and have set up a series of if statements to determine the strength of skills.
the problem is, no matter what i do, as long as it's not the default, i always get a syntax error on the first else, elsif, or end of my if statements.
I know it's not he battle system or anything because it does the same thing in a blank project.
the part i'm having trouble with starts where it says "# Calculate basic skill damage #"
and ignore the fact that the stats are rearranged. that's not the problem.
class Game_Battler
include N01
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Clear critical flag
self.critical = false
# If skill scope is for ally with 1 or more HP, and your own HP = 0,
# or skill scope is for ally with 0, and your own HP = 1 or more
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# End Method
return false
end
# Clear effective flag
effective = false
# Set effective flag if common ID is effective
effective |= skill.common_event_id > 0
# First hit detection
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
# If hit occurs
if hit_result == true
#==============================================================================#
# Calculate basic skill damage #
#==============================#
if skill.str_f > 0 and skill.power > 0 # if skill uses STR (ATK)
attack = (((user.str * 4) + (skill.power * ((user.atk / 2) / 100))
self.damage = attack - (self.dex / 2)
end
if skill.int_f > 0 and skill.power > 0 # skill uses INT
attack = (((user.int * 4) + (skill.power * ((user.atk / 2) / 100))
self.damage = attack - (self.mdef / 2)
end
if skill.pdef_f > 0 and skill.power > 0 # skill uses PDEF (HIT)
attack = (((user.pdef * 4) + (skill.power * ((user.atk / 2) / 100))
self.damage = attack - (self.agi / 2)
end
if skill.power < 0 # if skill is a healing spell
attack = (((user.int * 4) + ((skill.power * -1) * ((user.atk / 2) / 100))
self.damage = (attack * -1)
end
if skill.power == 0
self.damage = 0
end
#==============================================================================#
# Element correction
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / user.pdef + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
end
# If hit occurs
if hit_result == true
# If physical attack has power other than 0
if skill.power != 0 and skill.atk_f > 0
# State Removed by Shock
remove_states_shock
# Set to effective flag
effective = true
end
# Substract damage from HP
last_hp = self.hp
self.hp -= self.damage
effective |= self.hp != last_hp
# State change
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
# If power is 0
if skill.power == 0
# Set damage to an empty string
self.damage = ""
# If state is unchanged
unless @state_changed
# Set damage to "Miss"
self.damage = "Miss"
end
end
# If miss occurs
else
# Set damage to "Miss"
self.damage = "Miss"
end
# If not in battle
unless $game_temp.in_battle
# Set damage to nil
self.damage = nil
end
# End Method
return effective
end
end
So I've been editing the battle fomulas, and have set up a series of if statements to determine the strength of skills.
the problem is, no matter what i do, as long as it's not the default, i always get a syntax error on the first else, elsif, or end of my if statements.
I know it's not he battle system or anything because it does the same thing in a blank project.
the part i'm having trouble with starts where it says "# Calculate basic skill damage #"
and ignore the fact that the stats are rearranged. that's not the problem.
Edited by Bob423Share this post
Link to post
Share on other sites