Implements move execution for battle

This commit is contained in:
Deukhoofd committed 2024-08-10 11:18:10 +02:00
1 parent a049dda240
commit 488c717c5a
17 files changed
+433 -14

No files matched your search

+2 -2
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;
}