Deukhoofd 6d71de375e
All checks were successful
Build / Build (push) Successful in 48s
More abilities, refactor custom triggers to be typed.
2025-06-13 11:15:48 +02:00

22 lines
668 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "destiny_bond")]
public class DestinyBondEffect : Script
{
/// <inheritdoc />
public override void OnFaint(IPokemon pokemon, DamageSource source)
{
if (source == DamageSource.MoveDamage)
{
if (pokemon.BattleData?.Battle.ChoiceQueue?.LastRanChoice is not IMoveChoice lastChoice)
return;
lastChoice.User.Damage(lastChoice.User.BoostedStats.Hp * 10, DamageSource.Misc, forceDamage: true);
}
}
/// <inheritdoc />
public override void OnBeforeMove(IExecutingMove move)
{
RemoveSelf();
}
}