More moves, allow for typeless moves
This commit is contained in:
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Rototiller.cs
Normal file
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Rototiller.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Linq;
|
||||
using PkmnLib.Static;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "rototiller")]
|
||||
public class Rototiller : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var pokemon = move.Battle.Sides.SelectMany(x => x.Pokemon).WhereNotNull()
|
||||
.Where(x => x.Types.Any(y => y.Name == "grass"));
|
||||
EventBatchId batchId = new();
|
||||
foreach (var pkmn in pokemon)
|
||||
{
|
||||
pkmn.ChangeStatBoost(Statistic.Attack, 1, pkmn == move.User, batchId);
|
||||
pkmn.ChangeStatBoost(Statistic.SpecialAttack, 1, pkmn == move.User, batchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user