Revert egg additive/multiplicative change and change endless biome rotation for every 5 waves. (#3415)

Co-authored-by: snoozbuster <snoozbuster@outlook.com>
This commit is contained in:
Frederico Santos 2024-08-07 21:29:41 +01:00 committed by GitHub
parent 94c1c923e4
commit 8783fd81c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 31 deletions

View File

@ -1115,27 +1115,11 @@ export default class BattleScene extends SceneBase {
//this.pushPhase(new TrainerMessageTestPhase(this, TrainerType.RIVAL, TrainerType.RIVAL_2, TrainerType.RIVAL_3, TrainerType.RIVAL_4, TrainerType.RIVAL_5, TrainerType.RIVAL_6));
if (!waveIndex && lastBattle) {
let isNewBiome = !(lastBattle.waveIndex % 10) || ((this.gameMode.hasShortBiomes || this.gameMode.isDaily) && (lastBattle.waveIndex % 50) === 49);
if (!isNewBiome && this.gameMode.hasShortBiomes && (lastBattle.waveIndex % 10) < 9) {
let w = lastBattle.waveIndex - ((lastBattle.waveIndex % 10) - 1);
let biomeWaves = 1;
while (w < lastBattle.waveIndex) {
let wasNewBiome = false;
this.executeWithSeedOffset(() => {
wasNewBiome = !Utils.randSeedInt(6 - biomeWaves);
}, w << 4);
if (wasNewBiome) {
biomeWaves = 1;
} else {
biomeWaves++;
}
w++;
}
this.executeWithSeedOffset(() => {
isNewBiome = !Utils.randSeedInt(6 - biomeWaves);
}, lastBattle.waveIndex << 4);
}
const isWaveIndexMultipleOfTen = !(lastBattle.waveIndex % 10);
const isEndlessOrDaily = this.gameMode.hasShortBiomes || this.gameMode.isDaily;
const isEndlessFifthWave = this.gameMode.hasShortBiomes && (lastBattle.waveIndex % 5) === 0;
const isWaveIndexMultipleOfFiftyMinusOne = (lastBattle.waveIndex % 50) === 49;
const isNewBiome = isWaveIndexMultipleOfTen || isEndlessFifthWave || (isEndlessOrDaily && isWaveIndexMultipleOfFiftyMinusOne);
const resetArenaState = isNewBiome || this.currentBattle.battleType === BattleType.TRAINER || this.currentBattle.battleSpec === BattleSpec.FINAL_BOSS;
this.getEnemyParty().forEach(enemyPokemon => enemyPokemon.destroy());
this.trySpreadPokerus();

View File

@ -1818,7 +1818,7 @@ export class PokemonExpBoosterModifier extends PokemonHeldItemModifier {
}
apply(args: any[]): boolean {
(args[1] as Utils.NumberHolder).value += (this.getStackCount() * this.boostMultiplier);
(args[1] as Utils.NumberHolder).value = Math.floor((args[1] as Utils.NumberHolder).value * (1 + (this.getStackCount() * this.boostMultiplier)));
return true;
}

View File

@ -3988,9 +3988,7 @@ export class VictoryPhase extends PokemonPhase {
expMultiplier = Overrides.XP_MULTIPLIER_OVERRIDE;
}
const pokemonExp = new Utils.NumberHolder(expValue * expMultiplier);
const modifierBonusExp = new Utils.NumberHolder(1);
this.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, modifierBonusExp);
pokemonExp.value *= modifierBonusExp.value;
this.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, pokemonExp);
partyMemberExp.push(Math.floor(pokemonExp.value));
}

View File

@ -27,13 +27,14 @@ describe("EXP Modifier Items", () => {
game.override.battleType("single");
});
it("EXP booster items stack additively", async() => {
game.override.startingHeldItems([{name: "LUCKY_EGG"}, {name: "GOLDEN_EGG"}]);
it("EXP booster items stack multiplicatively", async() => {
game.override.startingHeldItems([{name: "LUCKY_EGG", count: 3}, {name: "GOLDEN_EGG"}]);
await game.startBattle();
const partyMember = game.scene.getPlayerPokemon()!;
const modifierBonusExp = new Utils.NumberHolder(1);
partyMember.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, modifierBonusExp);
expect(modifierBonusExp.value).toBe(2.4);
partyMember.exp = 100;
const expHolder = new Utils.NumberHolder(partyMember.exp);
partyMember.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, expHolder);
expect(expHolder.value).toBe(440);
}, 20000);
});

View File

@ -20,7 +20,8 @@ export const defaultConfig = {
}
warn(warning);
},
}
},
appType: "mpa",
};