Adds more move scripts
This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GearUp.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GearUp.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PkmnLib.Static;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "gear_up")]
|
||||
public class GearUp : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var side = battleData.Battle.Sides[battleData.SideIndex];
|
||||
EventBatchId evtBatchId = new();
|
||||
foreach (var pokemon in side.Pokemon.WhereNotNull())
|
||||
{
|
||||
var ability = pokemon.ActiveAbility?.Name;
|
||||
if (ability != "plus" && ability != "minus")
|
||||
continue;
|
||||
pokemon.ChangeStatBoost(Statistic.Attack, 1, pokemon == move.User, evtBatchId);
|
||||
pokemon.ChangeStatBoost(Statistic.SpecialAttack, 1, pokemon == move.User, evtBatchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user