27 lines
913 B
C#
27 lines
913 B
C#
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|