Initial setup for testing AI performance, random fixes
All checks were successful
Build / Build (push) Successful in 54s

This commit is contained in:
2025-07-05 13:56:33 +02:00
parent 4499927551
commit 32aaa5150a
33 changed files with 511 additions and 26 deletions

View File

@@ -904,7 +904,7 @@ public class PokemonImpl : ScriptSource, IPokemon
changed = change switch
{
> 0 => StatBoost.IncreaseStatistic(stat, change),
< 0 => StatBoost.DecreaseStatistic(stat, change),
< 0 => StatBoost.DecreaseStatistic(stat, (sbyte)-change),
_ => changed,
};
if (!changed)
@@ -1003,7 +1003,21 @@ public class PokemonImpl : ScriptSource, IPokemon
Form = form;
Types = form.Types.ToList();
HeightInMeters = form.Height;
var newAbility = Form.GetAbility(AbilityIndex);
var abilityIndex = AbilityIndex;
abilityIndex = AbilityIndex.IsHidden switch
{
true when form.HiddenAbilities.Count <= abilityIndex.Index => new AbilityIndex
{
IsHidden = true, Index = (byte)(form.HiddenAbilities.Count - 1),
},
false when form.Abilities.Count <= abilityIndex.Index => new AbilityIndex
{
IsHidden = false, Index = (byte)(form.Abilities.Count - 1),
},
_ => abilityIndex,
};
var newAbility = Form.GetAbility(abilityIndex);
if (OverrideAbility == null && oldAbility != newAbility)
{
@@ -1122,6 +1136,7 @@ public class PokemonImpl : ScriptSource, IPokemon
BattleData.Battle.Sides[BattleData.SideIndex].MarkPositionAsUnfillable(BattleData.Position);
}
BattleData.BattleSide.MarkFaint(BattleData.Position);
BattleData.BattleSide.ForceClearPokemonFromField(BattleData.Position);
// Validate the battle state to see if the battle is over.
BattleData.Battle.ValidateBattleState();