Implements switching Pokemon and fleeing from battle

This commit is contained in:
2024-12-30 11:43:04 +01:00
parent 9bdd584b54
commit 1f5a320090
5 changed files with 123 additions and 2 deletions

View File

@@ -110,6 +110,16 @@ public interface IBattleSide : IScriptSource, IDeepCloneable
/// Checks whether the side has been defeated.
/// </summary>
bool IsDefeated();
/// <summary>
/// The number of times this side has attempted to flee.
/// </summary>
uint FleeAttempts { get; }
/// <summary>
/// Registers a flee attempt for this side.
/// </summary>
void RegisterFleeAttempt();
/// <summary>
/// Mark the side as fled.
@@ -267,6 +277,15 @@ public class BattleSideImpl : ScriptSource, IBattleSide
return _fillablePositions.All(fillable => !fillable);
}
/// <inheritdoc />
public uint FleeAttempts { get; private set; }
/// <inheritdoc />
public void RegisterFleeAttempt()
{
FleeAttempts++;
}
/// <inheritdoc />
public void MarkAsFled() => HasFledBattle = true;