16 lines
609 B
C#
16 lines
609 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "synchronoise")]
|
|
public class Synchronoise : Script, IScriptChangeTargets
|
|
{
|
|
/// <inheritdoc />
|
|
public 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();
|
|
}
|
|
} |