Support for changing turn choice when executing
All checks were successful
Build / Build (push) Successful in 50s
All checks were successful
Build / Build (push) Successful in 50s
This commit is contained in:
@@ -77,6 +77,7 @@ public static class TurnRunner
|
||||
/// </summary>
|
||||
public static void ExecuteChoice(IBattle battle, ITurnChoice choice)
|
||||
{
|
||||
choice.RunScriptHook(x => x.ChangeTurnChoice(ref choice));
|
||||
if (choice is IPassChoice)
|
||||
return;
|
||||
if (battle.HasEnded)
|
||||
|
||||
@@ -296,7 +296,7 @@ public class BattleImpl : ScriptSource, IBattle
|
||||
|
||||
ITurnChoice? forcedChoice = null;
|
||||
pokemon.RunScriptHook(script =>
|
||||
script.ForceTurnSelection(battleData.SideIndex, battleData.Position, ref forcedChoice));
|
||||
script.ForceTurnSelection(this, battleData.SideIndex, battleData.Position, ref forcedChoice));
|
||||
choice = forcedChoice;
|
||||
return choice != null;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public abstract class Script : IDeepCloneable
|
||||
/// Force a certain move choice to be selected. If the choice is set, the Pokemon will be forced
|
||||
/// to use it, and will not be able to select any other choice.
|
||||
/// </summary>
|
||||
public virtual void ForceTurnSelection(byte sideIndex, byte position, ref ITurnChoice? choice)
|
||||
public virtual void ForceTurnSelection(IBattle battle, byte sideIndex, byte position, ref ITurnChoice? choice)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ public abstract class Script : IDeepCloneable
|
||||
/// This function allows a script to change the damage modifier of a Same Type Attack Bonus, which
|
||||
/// occurs when the user has the move type as one of its own types.
|
||||
/// </summary>
|
||||
public virtual void ChangeStabModifier(IExecutingMove executingMove, IPokemon target, byte hitNumber,
|
||||
public virtual void ChangeStabModifier(IExecutingMove executingMove, IPokemon target, byte hitNumber, bool isStab,
|
||||
ref float modifier)
|
||||
{
|
||||
}
|
||||
@@ -851,4 +851,8 @@ public abstract class Script : IDeepCloneable
|
||||
public virtual void OnAfterMoveChoice(IMoveChoice moveChoice)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void ChangeTurnChoice(ref ITurnChoice choice)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user