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,19 +1,20 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "lock_on")]
public class LockOnEffect : Script, IScriptOnEndTurn, IScriptChangeAccuracy
public class LockOnEffect : Script, IScriptOnEndTurn, IScriptChangeIncomingAccuracy
{
private readonly IPokemon _placer;
private bool _hasHadEndTurn;
public LockOnEffect(IPokemon placer)
{
_placer = placer;
}
/// <inheritdoc />
public void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy)
public void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
ref int modifiedAccuracy)
{
if (_placer != target)
if (_placer != executingMove.User)
return;
modifiedAccuracy = 255;
}
@@ -21,6 +22,9 @@ public class LockOnEffect : Script, IScriptOnEndTurn, IScriptChangeAccuracy
/// <inheritdoc />
public void OnEndTurn(IScriptSource owner, IBattle battle)
{
RemoveSelf();
if (_hasHadEndTurn)
RemoveSelf();
else
_hasHadEndTurn = true;
}
}