More moves implemented

This commit is contained in:
2025-02-03 11:40:26 +01:00
parent 0c5ca487d7
commit 51dfc4d07e
40 changed files with 639 additions and 65 deletions

View File

@@ -0,0 +1,25 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "entrainment")]
public class Entrainment : Script
{
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var userAbility = move.User.ActiveAbility;
var targetAbility = target.ActiveAbility;
if (userAbility == targetAbility || userAbility == null)
{
move.GetHitData(target, hit).Fail();
return;
}
if (userAbility.HasFlag("cant_be_copied") || targetAbility?.HasFlag("cant_be_changed") != false)
{
move.GetHitData(target, hit).Fail();
return;
}
target.ChangeAbility(userAbility);
}
}