This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user