More moves implemented
This commit is contained in:
@@ -7,7 +7,7 @@ using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Dynamic.Models.BattleFlow;
|
||||
|
||||
internal static class MoveTurnExecutor
|
||||
public static class MoveTurnExecutor
|
||||
{
|
||||
internal static void ExecuteMoveChoice(IBattle battle, IMoveChoice moveChoice)
|
||||
{
|
||||
@@ -30,6 +30,7 @@ internal static class MoveTurnExecutor
|
||||
secondaryEffect.Parameters, out var script))
|
||||
{
|
||||
moveChoice.Script.Set(script);
|
||||
script.OnAddedToParent(moveChoice);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -77,16 +78,20 @@ internal static class MoveTurnExecutor
|
||||
// TODO: fail handling
|
||||
return;
|
||||
}
|
||||
ExecuteMove(executingMove);
|
||||
}
|
||||
|
||||
public static void ExecuteMove(IExecutingMove executingMove)
|
||||
{
|
||||
var stopped = false;
|
||||
executingMove.RunScriptHook(x => x.StopBeforeMove(executingMove, ref stopped));
|
||||
if (stopped)
|
||||
return;
|
||||
|
||||
executingMove.RunScriptHook(x => x.OnBeforeMove(executingMove));
|
||||
foreach (var target in targets.WhereNotNull())
|
||||
foreach (var target in executingMove.Targets.WhereNotNull())
|
||||
{
|
||||
ExecuteMoveChoiceForTarget(battle, executingMove, target);
|
||||
ExecuteMoveChoiceForTarget(executingMove.Battle, executingMove, target);
|
||||
}
|
||||
executingMove.RunScriptHook(x => x.OnAfterMove(executingMove));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user