PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/DestinyBondEffect.cs

22 lines
649 B
C#
Raw Normal View History

2025-02-01 14:00:22 +00:00
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);
}
}
/// <inheritdoc />
public override void OnBeforeMove(IExecutingMove move)
{
RemoveSelf();
}
}