Make another pass through moves file
All checks were successful
Build / Build (push) Successful in 47s
All checks were successful
Build / Build (push) Successful in 47s
This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/MagneticFlux.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/MagneticFlux.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "magnetic_flux")]
|
||||
public class MagneticFlux : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData is null)
|
||||
return;
|
||||
|
||||
foreach (var pokemon in battleData.BattleSide.Pokemon.WhereNotNull())
|
||||
{
|
||||
if (pokemon.ActiveAbility?.Name != "plus" && pokemon.ActiveAbility?.Name != "minus")
|
||||
continue;
|
||||
|
||||
EventBatchId batch = new();
|
||||
pokemon.ChangeStatBoost(Statistic.Defense, 1, pokemon == move.User, batch);
|
||||
pokemon.ChangeStatBoost(Statistic.SpecialDefense, 1, pokemon == move.User, batch);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user