Implements move execution for battle

This commit is contained in:
2024-08-10 11:18:10 +02:00
parent a049dda240
commit 488c717c5a
17 changed files with 433 additions and 14 deletions

View File

@@ -221,7 +221,7 @@ public class BattleImpl : ScriptSource, IBattle
if (choice is IMoveChoice moveChoice)
{
// TODO: Hook to change number of PP needed.
if (moveChoice.UsedMove.CurrentPp < 1)
if (moveChoice.ChosenMove.CurrentPp < 1)
return false;
// TODO: Validate target
}
@@ -263,7 +263,7 @@ public class BattleImpl : ScriptSource, IBattle
throw new InvalidOperationException("Choice is null.");
if (choice is IMoveChoice moveChoice)
{
var priority = moveChoice.UsedMove.MoveData.Priority;
var priority = moveChoice.ChosenMove.MoveData.Priority;
choice.RunScriptHook(script => script.ChangePriority(moveChoice, ref priority));
moveChoice.Priority = priority;
}