Particularly, I want it so if the string Slip DMG = is in the note it uses the value after Slip DMG =. This isn't mentioned in dah0rst's tutorial, so I came here to ask how I'd do it. How would I go about something like this?
I want it to be used in Game_Battler class, since that contains this:
CODE
def slip_damage_effect
if slip_damage? and @hp > 0
@hp_damage = apply_variance(maxhp / 10, 10)
@hp_damage = @hp - 1 if @hp_damage >= @hp
self.hp -= @hp_damage
end
end
if slip_damage? and @hp > 0
@hp_damage = apply_variance(maxhp / 10, 10)
@hp_damage = @hp - 1 if @hp_damage >= @hp
self.hp -= @hp_damage
end
end
I constructed this snippet from reference and for the most part understand it:
CODE
$data_states[].note.each_line { |line|
slip_amount = line.gsub('Slip DMG = ', '').chomp.to_i if line.include?('Slip DMG = ')
}
slip_amount = line.gsub('Slip DMG = ', '').chomp.to_i if line.include?('Slip DMG = ')
}
Unfortunately I don't know how to get the number of the state causing the slip damage.
