Change how rival event rewards are generated

This commit is contained in:
AJ Fontaine 2025-04-07 17:20:46 -04:00
parent 0479b9dfcc
commit a4d59449e0
3 changed files with 19 additions and 31 deletions

View File

@ -116,7 +116,6 @@ export class TrainerConfig {
public modifierRewardFuncs: ModifierTypeFunc[] = [];
public partyTemplates: TrainerPartyTemplate[];
public partyTemplateFunc: PartyTemplateFunc;
public eventRewardFuncs: ModifierTypeFunc[] = [];
public partyMemberFuncs: PartyMemberFuncs = {};
public speciesPools: TrainerTierPools;
public speciesFilter: PokemonSpeciesFilter;
@ -517,16 +516,6 @@ export class TrainerConfig {
// return ret;
// }
/**
* Sets eventRewardFuncs to the active event rewards for the specified wave
* @param wave Associated with {@linkcode getFixedBattleEventRewards}
* @returns this
*/
setEventModifierRewardFuncs(wave: number): TrainerConfig {
this.eventRewardFuncs = timedEventManager.getFixedBattleEventRewards(wave).map(r => modifierTypes[r]);
return this;
}
setModifierRewardFuncs(...modifierTypeFuncs: (() => ModifierTypeFunc)[]): TrainerConfig {
this.modifierRewardFuncs = modifierTypeFuncs.map(func => () => {
const modifierTypeFunc = func();
@ -2236,12 +2225,7 @@ export const trainerConfigs: TrainerConfigs = {
Species.PHANTUMP,
Species.PUMPKABOO,
],
[TrainerPoolTier.RARE]: [
Species.SNEASEL,
Species.LITWICK,
Species.PAWNIARD,
Species.NOIBAT,
],
[TrainerPoolTier.RARE]: [Species.SNEASEL, Species.LITWICK, Species.PAWNIARD, Species.NOIBAT],
[TrainerPoolTier.SUPER_RARE]: [Species.SLIGGOO, Species.HISUI_SLIGGOO, Species.HISUI_AVALUGG],
}),
[TrainerType.BRYONY]: new TrainerConfig(++t)
@ -3697,7 +3681,6 @@ export const trainerConfigs: TrainerConfigs = {
() => modifierTypes.SUPER_EXP_CHARM,
() => modifierTypes.EXP_SHARE,
)
.setEventModifierRewardFuncs(8)
.setPartyMemberFunc(
0,
getRandomPartyMemberFunc(
@ -3765,7 +3748,6 @@ export const trainerConfigs: TrainerConfigs = {
.setMixedBattleBgm("battle_rival")
.setPartyTemplates(trainerPartyTemplates.RIVAL_2)
.setModifierRewardFuncs(() => modifierTypes.EXP_SHARE)
.setEventModifierRewardFuncs(25)
.setPartyMemberFunc(
0,
getRandomPartyMemberFunc(

View File

@ -26,12 +26,6 @@ export class TrainerVictoryPhase extends BattlePhase {
globalScene.unshiftPhase(new ModifierRewardPhase(modifierRewardFunc));
}
if (timedEventManager.isEventActive()) {
for (const rewardFunc of globalScene.currentBattle.trainer?.config.eventRewardFuncs!) {
globalScene.unshiftPhase(new ModifierRewardPhase(rewardFunc));
}
}
const trainerType = globalScene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct?
// Validate Voucher for boss trainers
if (vouchers.hasOwnProperty(TrainerType[trainerType])) {

View File

@ -13,6 +13,7 @@ import { SelectModifierPhase } from "./select-modifier-phase";
import { TrainerVictoryPhase } from "./trainer-victory-phase";
import { handleMysteryEncounterVictory } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
import { globalScene } from "#app/global-scene";
import { timedEventManager } from "#app/global-event-manager";
export class VictoryPhase extends PokemonPhase {
/** If true, indicates that the phase is intended for EXP purposes only, and not to continue a battle to next phase */
@ -53,12 +54,23 @@ export class VictoryPhase extends PokemonPhase {
}
if (globalScene.gameMode.isEndless || !globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) {
globalScene.pushPhase(new EggLapsePhase());
if (
globalScene.gameMode.isClassic &&
globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.EVIL_BOSS_2
) {
// Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop
globalScene.pushPhase(new ModifierRewardPhase(modifierTypes.LOCK_CAPSULE));
if (globalScene.gameMode.isClassic) {
if (globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.RIVAL_1) {
// Get event modifiers for this wave
timedEventManager
.getFixedBattleEventRewards(ClassicFixedBossWaves.RIVAL_1)
.map(r => globalScene.pushPhase(new ModifierRewardPhase(modifierTypes[r])));
}
if (globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.RIVAL_2) {
// Get event modifiers for this wave
timedEventManager
.getFixedBattleEventRewards(ClassicFixedBossWaves.RIVAL_2)
.map(r => globalScene.pushPhase(new ModifierRewardPhase(modifierTypes[r])));
}
if (globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.EVIL_BOSS_2) {
// Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop
globalScene.pushPhase(new ModifierRewardPhase(modifierTypes.LOCK_CAPSULE));
}
}
if (globalScene.currentBattle.waveIndex % 10) {
globalScene.pushPhase(new SelectModifierPhase(undefined, undefined, this.getFixedBattleCustomModifiers()));