22 lines
649 B
C#
22 lines
649 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);
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void OnBeforeMove(IExecutingMove move)
|
|
{
|
|
RemoveSelf();
|
|
}
|
|
} |