Deukhoofd a17cb92c5a
Some checks failed
continuous-integration/drone/push Build is failing
Implements a bunch more moves
2025-05-17 17:44:15 +02:00

18 lines
625 B
C#

using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "synchronoise")]
public class Synchronoise : Script
{
/// <inheritdoc />
public override void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
{
var battleData = moveChoice.User.BattleData;
if (battleData == null)
throw new InvalidOperationException("Battle data is null.");
targets = battleData.Battle.Sides.SelectMany(x => x.Pokemon).WhereNotNull()
.Where(x => x.Types.Any(y => moveChoice.User.Types.Contains(y))).ToList();
}
}