I have a skill which has a basic and an upgrade form.
The basic version is the user attacks an enemy and also revives any dead allies with 20% HP
The upgrade version attacks 2 enemies and also revives any dead allies with 40% HP
As the damage formula is too long for the formula box, I use snippets in the script editor which I then call up from the damage formula.
The basic version looks like this:
The damage formula has
a.energy_rebirth();
followed by the damage formula itself.
The upgrade version has:
The damage formula calls it up with
a.energy_rebirthup(b);
I have been trying to test the upgrade version and it simply does not work.
I saw that it lacked the lines:
so tried it with those lines and an extra 'end' where needed, but still the dead ally did not revive.
I also tried it calling it up from the damage formula with
a.energy_rebirthup()
but that made no difference.
Can anyone see what the problem might be?
Thank you.
The basic version is the user attacks an enemy and also revives any dead allies with 20% HP
The upgrade version attacks 2 enemies and also revives any dead allies with 40% HP
As the damage formula is too long for the formula box, I use snippets in the script editor which I then call up from the damage formula.
The basic version looks like this:
Code:
class Game_Battler < Game_BattlerBase
def energy_rebirth()
$game_party.members.each do |m|
if (m.state?(1))
m.remove_state(1)
m.hp += (m.mhp * 20 / 100) # You can replace 20 with a variable heal rate, e.g. $game_variables[43]
end
end
end
end
a.energy_rebirth();
followed by the damage formula itself.
The upgrade version has:
Code:
class Game_Battler < Game_BattlerBase
def energy_rebirthup(b)
$game_party.members.each do |m|
m.hp += (m.mhp * 40 / 100) if (m.hp == 40) # change percentage here to be the variable you use to store the actual percentage
end
end
end
a.energy_rebirthup(b);
I have been trying to test the upgrade version and it simply does not work.
I saw that it lacked the lines:
Code:
if (m.state?(1))
m.remove_state(1)
I also tried it calling it up from the damage formula with
a.energy_rebirthup()
but that made no difference.
Can anyone see what the problem might be?
Thank you.

