[Balance] Trainer pokemon now have minimum IVs of wave/10 (#5719)

This commit is contained in:
NightKev 2025-04-27 12:27:34 -07:00 committed by GitHub
parent 89a9d55d3c
commit a7479c8eb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 7 deletions

View File

@ -12,7 +12,6 @@ import BattleInfo, {
import type Move from "#app/data/moves/move"; import type Move from "#app/data/moves/move";
import { import {
HighCritAttr, HighCritAttr,
StatChangeBeforeDmgCalcAttr,
HitsTagAttr, HitsTagAttr,
applyMoveAttrs, applyMoveAttrs,
FixedDamageAttr, FixedDamageAttr,
@ -70,10 +69,8 @@ import {
EFFECTIVE_STATS, EFFECTIVE_STATS,
} from "#enums/stat"; } from "#enums/stat";
import { import {
DamageMoneyRewardModifier,
EnemyDamageBoosterModifier, EnemyDamageBoosterModifier,
EnemyDamageReducerModifier, EnemyDamageReducerModifier,
EnemyEndureChanceModifier,
EnemyFusionChanceModifier, EnemyFusionChanceModifier,
HiddenAbilityRateBoosterModifier, HiddenAbilityRateBoosterModifier,
BaseStatModifier, BaseStatModifier,
@ -119,7 +116,6 @@ import {
TypeImmuneTag, TypeImmuneTag,
getBattlerTag, getBattlerTag,
SemiInvulnerableTag, SemiInvulnerableTag,
TypeBoostTag,
MoveRestrictionBattlerTag, MoveRestrictionBattlerTag,
ExposedTag, ExposedTag,
DragonCheerTag, DragonCheerTag,
@ -188,7 +184,7 @@ import {
PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr, PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr,
applyAllyStatMultiplierAbAttrs, applyAllyStatMultiplierAbAttrs,
AllyStatMultiplierAbAttr, AllyStatMultiplierAbAttr,
MoveAbilityBypassAbAttr MoveAbilityBypassAbAttr,
} from "#app/data/abilities/ability"; } from "#app/data/abilities/ability";
import { allAbilities } from "#app/data/data-lists"; import { allAbilities } from "#app/data/data-lists";
import type PokemonData from "#app/system/pokemon-data"; import type PokemonData from "#app/system/pokemon-data";
@ -202,7 +198,7 @@ import {
EVOLVE_MOVE, EVOLVE_MOVE,
RELEARN_MOVE, RELEARN_MOVE,
} from "#app/data/balance/pokemon-level-moves"; } from "#app/data/balance/pokemon-level-moves";
import { DamageAchv, achvs } from "#app/system/achv"; import { achvs } from "#app/system/achv";
import type { StarterDataEntry, StarterMoveset } from "#app/system/game-data"; import type { StarterDataEntry, StarterMoveset } from "#app/system/game-data";
import { DexAttr } from "#app/system/game-data"; import { DexAttr } from "#app/system/game-data";
import { import {
@ -248,7 +244,7 @@ import { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
import { CustomPokemonData } from "#app/data/custom-pokemon-data"; import { CustomPokemonData } from "#app/data/custom-pokemon-data";
import { SwitchType } from "#enums/switch-type"; import { SwitchType } from "#enums/switch-type";
import { SpeciesFormKey } from "#enums/species-form-key"; import { SpeciesFormKey } from "#enums/species-form-key";
import {getStatusEffectOverlapText } from "#app/data/status-effect"; import { getStatusEffectOverlapText } from "#app/data/status-effect";
import { import {
BASE_HIDDEN_ABILITY_CHANCE, BASE_HIDDEN_ABILITY_CHANCE,
BASE_SHINY_CHANCE, BASE_SHINY_CHANCE,
@ -7030,6 +7026,15 @@ export class EnemyPokemon extends Pokemon {
} }
speciesId = prevolution; speciesId = prevolution;
} }
if (this.hasTrainer() && globalScene.currentBattle) {
const { waveIndex } = globalScene.currentBattle;
const ivs: number[] = [];
while (ivs.length < 6) {
ivs.push(this.randSeedIntRange(Math.floor(waveIndex / 10), 31));
}
this.ivs = ivs;
}
} }
this.aiType = this.aiType =

View File

@ -209,4 +209,19 @@ describe("Spec - Pokemon", () => {
expect(types[1]).toBe(PokemonType.DARK); expect(types[1]).toBe(PokemonType.DARK);
}); });
}); });
it.each([5, 25, 55, 95, 145, 195])(
"should set minimum IVs for enemy trainer pokemon based on wave (%i)",
async wave => {
game.override.startingWave(wave);
await game.classicMode.startBattle([Species.FEEBAS]);
const { waveIndex } = game.scene.currentBattle;
for (const pokemon of game.scene.getEnemyParty()) {
for (const index in pokemon.ivs) {
expect(pokemon.ivs[index]).toBeGreaterThanOrEqual(Math.floor(waveIndex / 10));
}
}
},
);
}); });