Implements more move effects
This commit is contained in:
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/GrudgeEffect.cs
Normal file
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/GrudgeEffect.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "grudge")]
|
||||
public class GrudgeEffect : Script
|
||||
{
|
||||
private ILearnedMove? _lastMove;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
_lastMove = move.ChosenMove;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnFaint(IPokemon pokemon, DamageSource source)
|
||||
{
|
||||
if (_lastMove != null && source == DamageSource.MoveDamage)
|
||||
{
|
||||
_lastMove.SetCurrentPP(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user