- Joined
- Jun 2, 2019
- Posts
- 28
Hi!
I'm trying to give Cosplay Pikachu in my game a custom Zero To Hero ability, so it would become Pikachu Libre when you switch it out.
I've gotten it to change when I switch it out and send it back in again, but despite having copied the code from Zero To Hero, the new ability, "Secret Identity", won't return Pikachu to its Cosplay Form.
Since you wrote the original code for Zero To Hero in this Gen 9 Resource Pack, I hoped you could help?
I'm trying to give Cosplay Pikachu in my game a custom Zero To Hero ability, so it would become Pikachu Libre when you switch it out.
I've gotten it to change when I switch it out and send it back in again, but despite having copied the code from Zero To Hero, the new ability, "Secret Identity", won't return Pikachu to its Cosplay Form.
Since you wrote the original code for Zero To Hero in this Gen 9 Resource Pack, I hoped you could help?
Ruby:
#===============================================================================
# Zero To Hero
#===============================================================================
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, "")
}
)
#===============================================================================
# Secret Identity
#===============================================================================
Battle::AbilityEffects::OnSwitchIn.add(:SECRETIDENTITY,
proc { |ability, battler, battle, switch_in|
next if !battler.isSpecies?(:PIKACHU)
next if battler.form == 2 || 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(:SECRETIDENTITY,
proc { |ability, battler, endOfBattle|
next if !battler.isSpecies?(:PIKACHU)
next if battler.form == 3 || endOfBattle
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}")
battler.pbChangeForm(3, "")
}
)