- 6
- Posts
- 1
- Years
- Seen Dec 23, 2024
Hello everyone!
I have a bit of a question about the conversion of Palafin's ability 'Zero to Hero' from Essentials v21 to Essentials v19. Now I did actually manage to get it to work, but there are a few things that seem to be not working correctly which also bug me. So, here is the code that is in v21:
And here is the code that I 'altered' for v19:
Now, I am not entirely sure if this is even correct, but here are the things that are bothering me one the ability is procced.
First of all, once Palafin is withdrawn, for a split second you will see his Hero form on the screen. I'm not sure if that can be avoided or if it's just the way it is in Essentials, but if there is a solution to this, I would gladly hear it! Also, and this is probably something I did wrong, once the hero version is sent out, the ability doesn't get shown and the message 'Palafin underwent a heroic transformation!' doesn't proc. They are not really big problems, but they can get annoying.
In any case, thank you for the help in advance!
I have a bit of a question about the conversion of Palafin's ability 'Zero to Hero' from Essentials v21 to Essentials v19. Now I did actually manage to get it to work, but there are a few things that seem to be not working correctly which also bug me. So, here is the code that is in v21:
Code:
Battle::AbilityEffects::OnSwitchIn.add(:ZEROTOHERO,
proc { |ability, battler, battle, switch_in|
next if !battler.isSpecies?(:PALAFIN)
next if battler.form == 0 || battler.ability_triggered?
battle.pbShowAbilitySplash(battler)
battle.pbDisplay(_INTL("{1} underwent a heroic transformation!", battler.pbThis))
battle.pbHideAbilitySplash(battler)
battle.pbSetAbilityTrigger(battler)
}
)
Battle::AbilityEffects::OnSwitchOut.add(:ZEROTOHERO,
proc { |ability, battler, endOfBattle|
next if !battler.isSpecies?(:PALAFIN)
next if battler.form == 1 || endOfBattle
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}")
battler.pbChangeForm(1, "")
}
And here is the code that I 'altered' for v19:
Code:
BattleHandlers::AbilityOnSwitchIn.add(:ZEROTOHERO,
proc { |ability, battler, battle, switch_in|
next if !battler.isSpecies?(:PALAFIN)
next if battler.form == 0 || battler.abilityActive?
battle.pbShowAbilitySplash(battler)
battle.pbDisplay(_INTL("{1} underwent a heroic transformation!", battler.pbThis))
battle.pbHideAbilitySplash(battler)
battle.pbSetAbilityTrigger(battler)
}
)
BattleHandlers::AbilityOnSwitchOut.add(:ZEROTOHERO,
proc { |ability, battler, endOfBattle|
next if !battler.isSpecies?(:PALAFIN)
next if battler.form == 1 || endOfBattle
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}")
battler.pbChangeForm(1, "")
}
)
Now, I am not entirely sure if this is even correct, but here are the things that are bothering me one the ability is procced.
First of all, once Palafin is withdrawn, for a split second you will see his Hero form on the screen. I'm not sure if that can be avoided or if it's just the way it is in Essentials, but if there is a solution to this, I would gladly hear it! Also, and this is probably something I did wrong, once the hero version is sent out, the ability doesn't get shown and the message 'Palafin underwent a heroic transformation!' doesn't proc. They are not really big problems, but they can get annoying.
In any case, thank you for the help in advance!