This commit is contained in:
18
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Synchronoise.cs
Normal file
18
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Synchronoise.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user