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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user