From d6ee340c5911796ffc8032d0c9609029126a8239 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 28 Oct 2023 00:18:44 -0400 Subject: [PATCH] Minor changes and fixes --- src/arena.ts | 13 ++++++++++++- src/battle-scene.ts | 4 +--- src/data/trainer-type.ts | 2 +- src/modifier/modifier-type.ts | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/arena.ts b/src/arena.ts index c2aaa648f4c..8cf9c736deb 100644 --- a/src/arena.ts +++ b/src/arena.ts @@ -119,7 +119,18 @@ export class Arena { getFormIndex(species: PokemonSpecies) { if (!species.canChangeForm && species.forms?.length) - return Utils.randSeedInt(species.forms.length); // TODO: Base on biome + return Utils.randSeedInt(species.forms.length); + switch (species.speciesId) { + case Species.BURMY: + case Species.WORMADAM: + switch (this.biomeType) { + case Biome.BEACH: + return 1; + case Biome.CITY: + return 2; + } + break; + } return 0; } diff --git a/src/battle-scene.ts b/src/battle-scene.ts index cf594568b22..b070ad303cf 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1233,12 +1233,10 @@ export default class BattleScene extends Phaser.Scene { for (let c = 0; c < chances; c++) { if (!Utils.randSeedInt(modifierChance)) count++; - if (count === 12) - break; } if (isBoss) count = Math.max(count, Math.floor(chances / 2)); - getEnemyModifierTypesForWave(waveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD) + getEnemyModifierTypesForWave(waveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD, this.gameMode) .map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false)); }); diff --git a/src/data/trainer-type.ts b/src/data/trainer-type.ts index 953e4788c1b..8eebf9cf768 100644 --- a/src/data/trainer-type.ts +++ b/src/data/trainer-type.ts @@ -735,7 +735,7 @@ export const trainerConfigs: TrainerConfigs = { .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ])) .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)) .setSpeciesFilter(species => species.baseTotal >= 540) - .setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.RAYQUAZA ])), + .setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.RAYQUAZA ], p => p.formIndex = 0)), [TrainerType.RIVAL_6]: new TrainerConfig(++t).setBoss().setStaticParty().setEncounterBgm('final').setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_6) .setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VENUSAUR, Species.CHARIZARD, Species.BLASTOISE, Species.MEGANIUM, Species.TYPHLOSION, Species.FERALIGATR, Species.SCEPTILE, Species.BLAZIKEN, Species.SWAMPERT, Species.TORTERRA, Species.INFERNAPE, Species.EMPOLEON, Species.SERPERIOR, Species.EMBOAR, Species.SAMUROTT ])) .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ])) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 017fd90a7b2..a31d6e8f6b1 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -858,9 +858,9 @@ export function getPlayerModifierTypeOptionsForWave(waveIndex: integer, count: i return options; } -export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER): PokemonHeldItemModifierType[] { +export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER, gameMode: GameMode): PokemonHeldItemModifierType[] { const ret = new Array(count).fill(0).map(() => getNewModifierTypeOption(party, poolType).type as PokemonHeldItemModifierType); - if (waveIndex === 200) { + if ((gameMode === GameMode.CLASSIC && waveIndex === 200) || !(waveIndex % 1000)) { const miniBlackHole = modifierTypes.MINI_BLACK_HOLE(); miniBlackHole.id = 'MINI_BLACK_HOLE'; ret.push(miniBlackHole);