From 7f77507d2b0d10869ebe0f28c6a5e8701c5085b6 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 25 Feb 2024 01:03:06 -0500 Subject: [PATCH] Tweak trainer party member level logic --- src/data/trainer-config.ts | 5 +---- src/trainer.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 66b2d0c19..5ccab7914 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -128,17 +128,14 @@ export const trainerPartyTemplates = { THREE_AVG: new TrainerPartyTemplate(3, TrainerPartyMemberStrength.AVERAGE), THREE_AVG_SAME: new TrainerPartyTemplate(3, TrainerPartyMemberStrength.AVERAGE, true), THREE_WEAK_BALANCED: new TrainerPartyTemplate(3, TrainerPartyMemberStrength.WEAK, false, true), - FOUR_WEAKEST: new TrainerPartyTemplate(4, TrainerPartyMemberStrength.WEAKEST), FOUR_WEAKER: new TrainerPartyTemplate(4, TrainerPartyMemberStrength.WEAKER), FOUR_WEAKER_SAME: new TrainerPartyTemplate(4, TrainerPartyMemberStrength.WEAKER, true), FOUR_WEAK: new TrainerPartyTemplate(4, TrainerPartyMemberStrength.WEAK), FOUR_WEAK_SAME: new TrainerPartyTemplate(4, TrainerPartyMemberStrength.WEAK, true), FOUR_WEAK_BALANCED: new TrainerPartyTemplate(4, TrainerPartyMemberStrength.WEAK, false, true), - FIVE_WEAKEST: new TrainerPartyTemplate(5, TrainerPartyMemberStrength.WEAKEST), FIVE_WEAKER: new TrainerPartyTemplate(5, TrainerPartyMemberStrength.WEAKER), FIVE_WEAK: new TrainerPartyTemplate(5, TrainerPartyMemberStrength.WEAK), FIVE_WEAK_BALANCED: new TrainerPartyTemplate(5, TrainerPartyMemberStrength.WEAK, false, true), - SIX_WEAKEST: new TrainerPartyTemplate(6, TrainerPartyMemberStrength.WEAKEST), SIX_WEAKER: new TrainerPartyTemplate(6, TrainerPartyMemberStrength.WEAKER), SIX_WEAKER_SAME: new TrainerPartyTemplate(6, TrainerPartyMemberStrength.WEAKER, true), SIX_WEAK_SAME: new TrainerPartyTemplate(6, TrainerPartyMemberStrength.WEAKER, true), @@ -520,7 +517,7 @@ export const trainerConfigs: TrainerConfigs = { [TrainerPoolTier.ULTRA_RARE]: [ Species.KUBFU ] }), [TrainerType.BREEDER]: new TrainerConfig(++t).setMoneyMultiplier(1.325).setEncounterBgm(TrainerType.POKEFAN).setHasGenders().setDouble() - .setPartyTemplateFunc(scene => getWavePartyTemplate(scene, trainerPartyTemplates.FOUR_WEAKEST, trainerPartyTemplates.FIVE_WEAKEST, trainerPartyTemplates.SIX_WEAKEST)), + .setPartyTemplateFunc(scene => getWavePartyTemplate(scene, trainerPartyTemplates.FOUR_WEAKER, trainerPartyTemplates.FIVE_WEAKER, trainerPartyTemplates.SIX_WEAKER)), [TrainerType.CLERK]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CLERK) .setPartyTemplates(trainerPartyTemplates.TWO_WEAK, trainerPartyTemplates.THREE_WEAK, trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_ONE_AVG) .setSpeciesPools({ diff --git a/src/trainer.ts b/src/trainer.ts index b1e091702..398a5a46f 100644 --- a/src/trainer.ts +++ b/src/trainer.ts @@ -87,12 +87,9 @@ export default class Trainer extends Phaser.GameObjects.Container { for (let i = 0; i < partyTemplate.size; i++) { let multiplier = 1; - const strength = partyTemplate.getStrength(i) + const strength = partyTemplate.getStrength(i); switch (strength) { - case TrainerPartyMemberStrength.WEAKEST: - multiplier = 0.9; - break; case TrainerPartyMemberStrength.WEAKER: multiplier = 0.95; break; @@ -110,7 +107,14 @@ export default class Trainer extends Phaser.GameObjects.Container { break; } - const level = Math.ceil(baseLevel * multiplier); + let levelOffset = 0; + + if (strength < TrainerPartyMemberStrength.STRONG) { + multiplier = Math.min(multiplier + 0.025 * Math.floor(waveIndex / 25), 1.2); + levelOffset = -Math.floor((waveIndex / 50) * (TrainerPartyMemberStrength.STRONG - strength)); + } + + const level = Math.ceil(baseLevel * multiplier) + levelOffset; ret.push(level); }