Adds a lot more move effects
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
|
||||
public static class TurnChoiceHelper
|
||||
{
|
||||
public static IMoveChoice CreateMoveChoice(IPokemon owner, string moveName, byte targetSide, byte targetPosition)
|
||||
{
|
||||
var move = owner.Moves.FirstOrDefault(x => x?.MoveData.Name == moveName);
|
||||
if (move == null)
|
||||
{
|
||||
if (!owner.Library.StaticLibrary.Moves.TryGet(moveName, out var moveData))
|
||||
throw new Exception($"Move '{moveName}' not found in move library.");
|
||||
|
||||
move = new LearnedMoveImpl(moveData, MoveLearnMethod.Unknown);
|
||||
}
|
||||
return new MoveChoice(owner, move, targetSide, targetPosition);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user