mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
Fixed Slumbering Snorlax encounter, overrideItems of heldItemConfiguration can deal with items with 0 stack
This commit is contained in:
parent
558d06cdaa
commit
ad7f2d133c
@ -1,5 +1,4 @@
|
||||
import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups";
|
||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
@ -11,7 +10,6 @@ import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/myst
|
||||
import { MoveRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
||||
import type { EnemyPartyConfig, EnemyPokemonConfig } from "../utils/encounter-phase-utils";
|
||||
import {
|
||||
generateModifierType,
|
||||
initBattleWithEnemyConfig,
|
||||
leaveEncounterWithoutBattle,
|
||||
loadCustomMovesForEncounter,
|
||||
@ -27,10 +25,9 @@ import { AiType } from "#enums/ai-type";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
||||
import { randSeedInt } from "#app/utils/common";
|
||||
import { HeldItemId } from "#enums/held-item-id";
|
||||
|
||||
/** i18n namespace for the encounter */
|
||||
const namespace = "mysteryEncounters/slumberingSnorlax";
|
||||
@ -77,25 +74,13 @@ export const SlumberingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuil
|
||||
status: [StatusEffect.SLEEP, 6], // Extra turns on timer for Snorlax's start of fight moves
|
||||
nature: Nature.DOCILE,
|
||||
moveSet: [MoveId.BODY_SLAM, MoveId.CRUNCH, MoveId.SLEEP_TALK, MoveId.REST],
|
||||
modifierConfigs: [
|
||||
{
|
||||
modifier: generateModifierType(modifierTypes.BERRY, [BerryType.SITRUS]) as PokemonHeldItemModifierType,
|
||||
},
|
||||
{
|
||||
modifier: generateModifierType(modifierTypes.BERRY, [BerryType.ENIGMA]) as PokemonHeldItemModifierType,
|
||||
},
|
||||
{
|
||||
modifier: generateModifierType(modifierTypes.BASE_STAT_BOOSTER, [Stat.HP]) as PokemonHeldItemModifierType,
|
||||
},
|
||||
{
|
||||
modifier: generateModifierType(modifierTypes.SOOTHE_BELL) as PokemonHeldItemModifierType,
|
||||
stackCount: randSeedInt(2, 0),
|
||||
},
|
||||
{
|
||||
modifier: generateModifierType(modifierTypes.LUCKY_EGG) as PokemonHeldItemModifierType,
|
||||
stackCount: randSeedInt(2, 0),
|
||||
},
|
||||
],
|
||||
heldItemConfig: {
|
||||
[HeldItemId.SITRUS_BERRY]: { stack: 1 },
|
||||
[HeldItemId.ENIGMA_BERRY]: { stack: 1 },
|
||||
[HeldItemId.HP_UP]: { stack: 1 },
|
||||
[HeldItemId.SOOTHE_BELL]: { stack: randSeedInt(2, 0) },
|
||||
[HeldItemId.LUCKY_EGG]: { stack: randSeedInt(2, 0) },
|
||||
},
|
||||
customPokemonData: new CustomPokemonData({ spriteScale: 1.25 }),
|
||||
aiType: AiType.SMART, // Required to ensure Snorlax uses Sleep Talk while it is asleep
|
||||
};
|
||||
|
@ -80,6 +80,12 @@ export class PokemonItemManager {
|
||||
|
||||
overrideItems(newItems: HeldItemPropertyMap) {
|
||||
this.heldItems = newItems;
|
||||
// The following is to allow randomly generated item configs to have stack 0
|
||||
for (const [item, properties] of Object.entries(this.heldItems)) {
|
||||
if (!properties || properties.stack <= 0) {
|
||||
delete this.heldItems[item];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add(itemType: HeldItemId, addStack = 1, data?: HELD_ITEM_DATA): boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user