diff --git a/src/data/mystery-encounters/dialogue/department-store-sale-dialogue.ts b/src/data/mystery-encounters/dialogue/department-store-sale-dialogue.ts deleted file mode 100644 index 87cd8dbda55..00000000000 --- a/src/data/mystery-encounters/dialogue/department-store-sale-dialogue.ts +++ /dev/null @@ -1,36 +0,0 @@ -import MysteryEncounterDialogue from "#app/data/mystery-encounters/mystery-encounter-dialogue"; - -export const DepartmentStoreSaleDialogue: MysteryEncounterDialogue = { - intro: [ - { - text: "mysteryEncounter:department_store_sale_intro_message" - }, - { - text: "mysteryEncounter:department_store_sale_intro_dialogue", - speaker: "mysteryEncounter:department_store_sale_speaker" - } - ], - encounterOptionsDialogue: { - title: "mysteryEncounter:department_store_sale_title", - description: "mysteryEncounter:department_store_sale_description", - query: "mysteryEncounter:department_store_sale_query", - options: [ - { - buttonLabel: "mysteryEncounter:department_store_sale_option_1_label", - buttonTooltip: "mysteryEncounter:department_store_sale_option_1_tooltip" - }, - { - buttonLabel: "mysteryEncounter:department_store_sale_option_2_label", - buttonTooltip: "mysteryEncounter:department_store_sale_option_2_tooltip" - }, - { - buttonLabel: "mysteryEncounter:department_store_sale_option_3_label", - buttonTooltip: "mysteryEncounter:department_store_sale_option_3_tooltip" - }, - { - buttonLabel: "mysteryEncounter:department_store_sale_option_4_label", - buttonTooltip: "mysteryEncounter:department_store_sale_option_4_tooltip" - } - ] - } -}; diff --git a/src/data/mystery-encounters/encounters/dark-deal.ts b/src/data/mystery-encounters/encounters/dark-deal.ts index 740c4e86c28..8f13e373e9a 100644 --- a/src/data/mystery-encounters/encounters/dark-deal.ts +++ b/src/data/mystery-encounters/encounters/dark-deal.ts @@ -21,6 +21,9 @@ import { leaveEncounterWithoutBattle, } from "../mystery-encounter-utils"; +/** i18n namespace for encounter */ +const namespace = "mysteryEncounter:dark_deal"; + // Exclude Ultra Beasts, Paradox, Necrozma, Eternatus, and egg-locked mythicals const excludedBosses = [ Species.NECROZMA, @@ -88,31 +91,31 @@ export const DarkDealEncounter: MysteryEncounter = ]) .withIntroDialogue([ { - text: "mysteryEncounter:dark_deal_intro_message", + text: `${namespace}_intro_message`, }, { - speaker: "mysteryEncounter:dark_deal_speaker", - text: "mysteryEncounter:dark_deal_intro_dialogue", + speaker: `${namespace}_speaker`, + text: `${namespace}_intro_dialogue`, }, ]) .withSceneWaveRangeRequirement(30, 180) // waves 30 to 180 .withScenePartySizeRequirement(2, 6) // Must have at least 2 pokemon in party .withCatchAllowed(true) - .withTitle("mysteryEncounter:dark_deal_title") - .withDescription("mysteryEncounter:dark_deal_description") - .withQuery("mysteryEncounter:dark_deal_query") + .withTitle(`${namespace}_title`) + .withDescription(`${namespace}_description`) + .withQuery(`${namespace}_query`) .withOption( new MysteryEncounterOptionBuilder() .withDialogue({ - buttonLabel: "mysteryEncounter:dark_deal_option_1_label", - buttonTooltip: "mysteryEncounter:dark_deal_option_1_tooltip", + buttonLabel: `${namespace}_option_1_label`, + buttonTooltip: `${namespace}_option_1_tooltip`, selected: [ { - speaker: "mysteryEncounter:dark_deal_speaker", - text: "mysteryEncounter:dark_deal_option_1_selected", + speaker: `${namespace}_speaker`, + text: `${namespace}_option_1_selected`, }, { - text: "mysteryEncounter:dark_deal_option_1_selected_message", + text: `${namespace}_option_1_selected_message`, }, ], }) @@ -180,12 +183,12 @@ export const DarkDealEncounter: MysteryEncounter = ) .withSimpleOption( { - buttonLabel: "mysteryEncounter:dark_deal_option_2_label", - buttonTooltip: "mysteryEncounter:dark_deal_option_2_tooltip", + buttonLabel: `${namespace}_option_2_label`, + buttonTooltip: `${namespace}_option_2_tooltip`, selected: [ { - speaker: "mysteryEncounter:dark_deal_speaker", - text: "mysteryEncounter:dark_deal_option_2_selected", + speaker: `${namespace}_speaker`, + text: `${namespace}_option_2_selected`, }, ], }, @@ -198,7 +201,7 @@ export const DarkDealEncounter: MysteryEncounter = ) .withOutroDialogue([ { - text: "mysteryEncounter:dark_deal_outro" + text: `${namespace}_outro` } ]) .build(); diff --git a/src/data/mystery-encounters/encounters/department-store-sale.ts b/src/data/mystery-encounters/encounters/department-store-sale.ts index 4323fc15434..2dcee4455df 100644 --- a/src/data/mystery-encounters/encounters/department-store-sale.ts +++ b/src/data/mystery-encounters/encounters/department-store-sale.ts @@ -7,104 +7,160 @@ import { randSeedInt } from "#app/utils"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { Species } from "#enums/species"; import BattleScene from "../../../battle-scene"; -import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter"; +import MysteryEncounter, { + MysteryEncounterBuilder, + MysteryEncounterTier, +} from "../mystery-encounter"; -export const DepartmentStoreSaleEncounter: MysteryEncounter = MysteryEncounterBuilder - .withEncounterType(MysteryEncounterType.DEPARTMENT_STORE_SALE) - .withEncounterTier(MysteryEncounterTier.COMMON) - .withIntroSpriteConfigs([ - { - spriteKey: "b2w2_lady", - fileRoot: "mystery-encounters", - hasShadow: true, - x: -20 - }, - { - spriteKey: Species.FURFROU.toString(), - fileRoot: "pokemon", - hasShadow: true, - repeat: true, - x: 30 - } - ]) - // .withHideIntroVisuals(false) - .withSceneWaveRangeRequirement(10, 100) - .withSimpleOption(async (scene: BattleScene) => { - // Choose TMs - const modifiers = []; - let i = 0; - while (i < 4) { - // 2/2/1 weight on TM rarity - const roll = randSeedInt(5); - if (roll < 2) { - modifiers.push(modifierTypes.TM_COMMON); - } else if (roll < 4) { - modifiers.push(modifierTypes.TM_GREAT); - } else { - modifiers.push(modifierTypes.TM_ULTRA); +/** i18n namespace for encounter */ +const namespace = "mysteryEncounter:department_store_sale"; + +export const DepartmentStoreSaleEncounter: MysteryEncounter = + MysteryEncounterBuilder.withEncounterType( + MysteryEncounterType.DEPARTMENT_STORE_SALE + ) + .withEncounterTier(MysteryEncounterTier.COMMON) + .withSceneWaveRangeRequirement(10, 100) + .withIntroSpriteConfigs([ + { + spriteKey: "b2w2_lady", + fileRoot: "mystery-encounters", + hasShadow: true, + x: -20, + }, + { + spriteKey: Species.FURFROU.toString(), + fileRoot: "pokemon", + hasShadow: true, + repeat: true, + x: 30, + }, + ]) + .withIntroDialogue([ + { + text: `${namespace}_intro_message`, + }, + { + text: `${namespace}_intro_dialogue`, + speaker: `${namespace}_speaker`, + }, + ]) + // .withHideIntroVisuals(false) + .withTitle(`${namespace}_title`) + .withDescription(`${namespace}_description`) + .withQuery(`${namespace}_query`) + .withSimpleOption( + { + buttonLabel: `${namespace}_option_1_label`, + buttonTooltip: `${namespace}_option_1_tooltip`, + }, + async (scene: BattleScene) => { + // Choose TMs + const modifiers = []; + let i = 0; + while (i < 4) { + // 2/2/1 weight on TM rarity + const roll = randSeedInt(5); + if (roll < 2) { + modifiers.push(modifierTypes.TM_COMMON); + } else if (roll < 4) { + modifiers.push(modifierTypes.TM_GREAT); + } else { + modifiers.push(modifierTypes.TM_ULTRA); + } + i++; + } + + setEncounterRewards(scene, { + guaranteedModifierTypeFuncs: modifiers, + fillRemaining: false, + }); + leaveEncounterWithoutBattle(scene); } - i++; - } + ) + .withSimpleOption( + { + buttonLabel: `${namespace}_option_2_label`, + buttonTooltip: `${namespace}_option_2_tooltip`, + }, + async (scene: BattleScene) => { + // Choose Vitamins + const modifiers = []; + let i = 0; + while (i < 3) { + // 2/1 weight on base stat booster vs PP Up + const roll = randSeedInt(3); + if (roll === 0) { + modifiers.push(modifierTypes.PP_UP); + } else { + modifiers.push(modifierTypes.BASE_STAT_BOOSTER); + } + i++; + } - setEncounterRewards(scene, { guaranteedModifierTypeFuncs: modifiers, fillRemaining: false }); - leaveEncounterWithoutBattle(scene); - }) - .withSimpleOption(async (scene: BattleScene) => { - // Choose Vitamins - const modifiers = []; - let i = 0; - while (i < 3) { - // 2/1 weight on base stat booster vs PP Up - const roll = randSeedInt(3); - if (roll === 0) { - modifiers.push(modifierTypes.PP_UP); - } else { - modifiers.push(modifierTypes.BASE_STAT_BOOSTER); + setEncounterRewards(scene, { + guaranteedModifierTypeFuncs: modifiers, + fillRemaining: false, + }); + leaveEncounterWithoutBattle(scene); } - i++; - } + ) + .withSimpleOption( + { + buttonLabel: `${namespace}_option_3_label`, + buttonTooltip: `${namespace}_option_3_tooltip`, + }, + async (scene: BattleScene) => { + // Choose X Items + const modifiers = []; + let i = 0; + while (i < 5) { + // 4/1 weight on base stat booster vs Dire Hit + const roll = randSeedInt(5); + if (roll === 0) { + modifiers.push(modifierTypes.DIRE_HIT); + } else { + modifiers.push(modifierTypes.TEMP_STAT_BOOSTER); + } + i++; + } - setEncounterRewards(scene, { guaranteedModifierTypeFuncs: modifiers, fillRemaining: false }); - leaveEncounterWithoutBattle(scene); - }) - .withSimpleOption(async (scene: BattleScene) => { - // Choose X Items - const modifiers = []; - let i = 0; - while (i < 5) { - // 4/1 weight on base stat booster vs Dire Hit - const roll = randSeedInt(5); - if (roll === 0) { - modifiers.push(modifierTypes.DIRE_HIT); - } else { - modifiers.push(modifierTypes.TEMP_STAT_BOOSTER); + setEncounterRewards(scene, { + guaranteedModifierTypeFuncs: modifiers, + fillRemaining: false, + }); + leaveEncounterWithoutBattle(scene); } - i++; - } + ) + .withSimpleOption( + { + buttonLabel: `${namespace}_option_4_label`, + buttonTooltip: `${namespace}_option_4_tooltip`, + }, + async (scene: BattleScene) => { + // Choose Pokeballs + const modifiers = []; + let i = 0; + while (i < 4) { + // 10/30/20/5 weight on pokeballs + const roll = randSeedInt(65); + if (roll < 10) { + modifiers.push(modifierTypes.POKEBALL); + } else if (roll < 40) { + modifiers.push(modifierTypes.GREAT_BALL); + } else if (roll < 60) { + modifiers.push(modifierTypes.ULTRA_BALL); + } else { + modifiers.push(modifierTypes.ROGUE_BALL); + } + i++; + } - setEncounterRewards(scene, { guaranteedModifierTypeFuncs: modifiers, fillRemaining: false }); - leaveEncounterWithoutBattle(scene); - }) - .withSimpleOption(async (scene: BattleScene) => { - // Choose Pokeballs - const modifiers = []; - let i = 0; - while (i < 4) { - // 10/30/20/5 weight on pokeballs - const roll = randSeedInt(65); - if (roll < 10) { - modifiers.push(modifierTypes.POKEBALL); - } else if (roll < 40) { - modifiers.push(modifierTypes.GREAT_BALL); - } else if (roll < 60) { - modifiers.push(modifierTypes.ULTRA_BALL); - } else { - modifiers.push(modifierTypes.ROGUE_BALL); + setEncounterRewards(scene, { + guaranteedModifierTypeFuncs: modifiers, + fillRemaining: false, + }); + leaveEncounterWithoutBattle(scene); } - i++; - } - - setEncounterRewards(scene, { guaranteedModifierTypeFuncs: modifiers, fillRemaining: false }); - leaveEncounterWithoutBattle(scene); - }) - .build(); + ) + .build(); diff --git a/src/data/mystery-encounters/mystery-encounter-dialogue.ts b/src/data/mystery-encounters/mystery-encounter-dialogue.ts index 11135a58085..d6938f49607 100644 --- a/src/data/mystery-encounters/mystery-encounter-dialogue.ts +++ b/src/data/mystery-encounters/mystery-encounter-dialogue.ts @@ -4,7 +4,6 @@ import { MysteriousChestDialogue } from "#app/data/mystery-encounters/dialogue/m import { FightOrFlightDialogue } from "#app/data/mystery-encounters/dialogue/fight-or-flight-dialogue"; import { TrainingSessionDialogue } from "#app/data/mystery-encounters/dialogue/training-session-dialogue"; import { SleepingSnorlaxDialogue } from "./dialogue/sleeping-snorlax-dialogue"; -import { DepartmentStoreSaleDialogue } from "#app/data/mystery-encounters/dialogue/department-store-sale-dialogue"; import { ShadyVitaminDealerDialogue } from "#app/data/mystery-encounters/dialogue/shady-vitamin-dealer"; import { TextStyle } from "#app/ui/text"; import { FieldTripDialogue } from "#app/data/mystery-encounters/dialogue/field-trip-dialogue"; @@ -89,7 +88,6 @@ export function initMysteryEncounterDialogue() { allMysteryEncounterDialogue[MysteryEncounterType.FIGHT_OR_FLIGHT] = FightOrFlightDialogue; allMysteryEncounterDialogue[MysteryEncounterType.TRAINING_SESSION] = TrainingSessionDialogue; allMysteryEncounterDialogue[MysteryEncounterType.SLEEPING_SNORLAX] = SleepingSnorlaxDialogue; - allMysteryEncounterDialogue[MysteryEncounterType.DEPARTMENT_STORE_SALE] = DepartmentStoreSaleDialogue; allMysteryEncounterDialogue[MysteryEncounterType.SHADY_VITAMIN_DEALER] = ShadyVitaminDealerDialogue; allMysteryEncounterDialogue[MysteryEncounterType.FIELD_TRIP] = FieldTripDialogue; }