Many more tests and fixes
All checks were successful
Build / Build (push) Successful in 3m12s

This commit is contained in:
2026-08-27 17:11:12 +02:00
parent 32b3ef9c4a
commit d2a82b5fe3
204 changed files with 20255 additions and 242 deletions

View File

@@ -1,20 +1,13 @@
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "follow_me")]
public class FollowMe : Script, IScriptChangeTargets
public class FollowMe : Script, IScriptOnSecondaryEffect
{
/// <inheritdoc />
public void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
if (targets.Count != 1)
return;
var target = targets[0];
if (target == null)
return;
if (target.BattleData?.SideIndex != moveChoice.User.BattleData?.SideIndex)
return;
targets = [moveChoice.User];
move.User.BattleData!.BattleSide.VolatileScripts.StackOrAdd(ScriptUtils.ResolveName<FollowMeEffect>(),
() => new FollowMeEffect(move.User));
}
}