2025-06-28 12:02:24 +02:00

22 lines
680 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "destiny_bond")]
public class DestinyBondEffect : Script, IScriptOnBeforeMove
{
/// <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 void OnBeforeMove(IExecutingMove move)
{
RemoveSelf();
}
}