Slight cleanup, do some TODOs
All checks were successful
Build / Build (push) Successful in 51s

This commit is contained in:
2025-06-22 10:42:25 +02:00
parent e305cfaef6
commit 2533512eda
114 changed files with 218 additions and 168 deletions

View File

@@ -40,6 +40,13 @@ public interface IBattle : IScriptSource, IDeepCloneable, IDisposable
/// </summary>
byte PositionsPerSide { get; }
/// <summary>
/// The name of the environment the battle is taking place in, such as "grass", "cave", etc.
/// This is sometimes referred to as the "terrain" in the games, but is not the same as the
/// <see cref="TerrainName"/> which is a battle condition that can be set by scripts.
/// </summary>
StringKey EnvironmentName { get; }
/// <summary>
/// Whether this battle is a wild battle. In a wild battle, the player can catch the opposing Pokemon,
/// and moves like roar will end the battle instead of switching out the Pokemon.
@@ -173,9 +180,12 @@ public class BattleImpl : ScriptSource, IBattle
/// <param name="canFlee">Whether Pokémon are allowed to flee from the battle.</param>
/// <param name="numberOfSides">The number of sides in the battle. Generally 2.</param>
/// <param name="positionsPerSide">The number of spots there are on each side for Pokémon. 1 for singles, 2 for doubles, etc.</param>
/// <param name="isWildBattle">Whether this battle is a wild battle. In a wild battle, the player can catch the opposing Pokémon,
/// and moves like roar will end the battle instead of switching out the Pokémon.</param>
/// <param name="environmentName">The name of the environment the battle is taking place in, such as "grass", "cave", etc.</param>
/// <param name="randomSeed">The seed for the RNG. If null, this uses a time-dependent seed.</param>
public BattleImpl(IDynamicLibrary library, IReadOnlyList<IBattleParty> parties, bool canFlee, byte numberOfSides,
byte positionsPerSide, bool isWildBattle, int? randomSeed = null)
byte positionsPerSide, bool isWildBattle, StringKey environmentName, int? randomSeed = null)
{
Library = library;
Parties = parties;
@@ -183,6 +193,7 @@ public class BattleImpl : ScriptSource, IBattle
NumberOfSides = numberOfSides;
PositionsPerSide = positionsPerSide;
IsWildBattle = isWildBattle;
EnvironmentName = environmentName;
Volatile = new ScriptSet(this);
var sides = new IBattleSide[numberOfSides];
for (byte i = 0; i < numberOfSides; i++)
@@ -207,6 +218,9 @@ public class BattleImpl : ScriptSource, IBattle
/// <inheritdoc />
public byte PositionsPerSide { get; }
/// <inheritdoc />
public StringKey EnvironmentName { get; }
/// <inheritdoc />
public bool IsWildBattle { get; }