Initial setup for testing AI performance, random fixes
All checks were successful
Build / Build (push) Successful in 54s
All checks were successful
Build / Build (push) Successful in 54s
This commit is contained in:
@@ -66,6 +66,7 @@ public interface IBattle : IScriptSource, IDeepCloneable, IDisposable
|
||||
/// <summary>
|
||||
/// Whether the battle has ended.
|
||||
/// </summary>
|
||||
[MemberNotNull(nameof(Result))]
|
||||
bool HasEnded { get; }
|
||||
|
||||
/// <summary>
|
||||
@@ -231,6 +232,7 @@ public class BattleImpl : ScriptSource, IBattle
|
||||
public IBattleRandom Random { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[MemberNotNull(nameof(Result))]
|
||||
public bool HasEnded { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -320,7 +322,10 @@ public class BattleImpl : ScriptSource, IBattle
|
||||
{
|
||||
if (!choice.User.IsUsable)
|
||||
return false;
|
||||
if (HasForcedTurn(choice.User, out var forcedChoice) && choice != forcedChoice)
|
||||
// Always allow moves such as Struggle. If we block this, we can run into an infinite loop
|
||||
if (Library.MiscLibrary.IsReplacementChoice(choice))
|
||||
return true;
|
||||
if (HasForcedTurn(choice.User, out var forcedChoice) && !Equals(choice, forcedChoice))
|
||||
return false;
|
||||
|
||||
if (choice is IMoveChoice moveChoice)
|
||||
|
||||
Reference in New Issue
Block a user