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,3 +1,5 @@
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "flower_shield")]
@@ -14,6 +16,7 @@ public class FlowerShield : Script, IScriptOnSecondaryEffect
var batchId = new EventBatchId();
var sides = battleData.Battle.Sides;
var anyFound = false;
foreach (var side in sides)
{
foreach (var pokemon in side.Pokemon)
@@ -22,8 +25,13 @@ public class FlowerShield : Script, IScriptOnSecondaryEffect
continue;
if (!pokemon.Types.Contains(grassType))
continue;
if (pokemon.Volatile.Any(x => x.Script?.IsSemiInvulnerableTurn == true))
continue;
pokemon.ChangeStatBoost(Statistic.Defense, 1, pokemon == move.User, false, batchId);
anyFound = true;
}
}
if (!anyFound)
move.GetHitData(target, hit).Fail();
}
}