migrate department-store-sale encounter

This commit is contained in:
Felix Staud 2024-07-11 13:35:46 -07:00
parent c589689a6c
commit d9e0957d40
4 changed files with 168 additions and 147 deletions

View File

@ -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"
}
]
}
};

View File

@ -21,6 +21,9 @@ import {
leaveEncounterWithoutBattle, leaveEncounterWithoutBattle,
} from "../mystery-encounter-utils"; } from "../mystery-encounter-utils";
/** i18n namespace for encounter */
const namespace = "mysteryEncounter:dark_deal";
// Exclude Ultra Beasts, Paradox, Necrozma, Eternatus, and egg-locked mythicals // Exclude Ultra Beasts, Paradox, Necrozma, Eternatus, and egg-locked mythicals
const excludedBosses = [ const excludedBosses = [
Species.NECROZMA, Species.NECROZMA,
@ -88,31 +91,31 @@ export const DarkDealEncounter: MysteryEncounter =
]) ])
.withIntroDialogue([ .withIntroDialogue([
{ {
text: "mysteryEncounter:dark_deal_intro_message", text: `${namespace}_intro_message`,
}, },
{ {
speaker: "mysteryEncounter:dark_deal_speaker", speaker: `${namespace}_speaker`,
text: "mysteryEncounter:dark_deal_intro_dialogue", text: `${namespace}_intro_dialogue`,
}, },
]) ])
.withSceneWaveRangeRequirement(30, 180) // waves 30 to 180 .withSceneWaveRangeRequirement(30, 180) // waves 30 to 180
.withScenePartySizeRequirement(2, 6) // Must have at least 2 pokemon in party .withScenePartySizeRequirement(2, 6) // Must have at least 2 pokemon in party
.withCatchAllowed(true) .withCatchAllowed(true)
.withTitle("mysteryEncounter:dark_deal_title") .withTitle(`${namespace}_title`)
.withDescription("mysteryEncounter:dark_deal_description") .withDescription(`${namespace}_description`)
.withQuery("mysteryEncounter:dark_deal_query") .withQuery(`${namespace}_query`)
.withOption( .withOption(
new MysteryEncounterOptionBuilder() new MysteryEncounterOptionBuilder()
.withDialogue({ .withDialogue({
buttonLabel: "mysteryEncounter:dark_deal_option_1_label", buttonLabel: `${namespace}_option_1_label`,
buttonTooltip: "mysteryEncounter:dark_deal_option_1_tooltip", buttonTooltip: `${namespace}_option_1_tooltip`,
selected: [ selected: [
{ {
speaker: "mysteryEncounter:dark_deal_speaker", speaker: `${namespace}_speaker`,
text: "mysteryEncounter:dark_deal_option_1_selected", 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( .withSimpleOption(
{ {
buttonLabel: "mysteryEncounter:dark_deal_option_2_label", buttonLabel: `${namespace}_option_2_label`,
buttonTooltip: "mysteryEncounter:dark_deal_option_2_tooltip", buttonTooltip: `${namespace}_option_2_tooltip`,
selected: [ selected: [
{ {
speaker: "mysteryEncounter:dark_deal_speaker", speaker: `${namespace}_speaker`,
text: "mysteryEncounter:dark_deal_option_2_selected", text: `${namespace}_option_2_selected`,
}, },
], ],
}, },
@ -198,7 +201,7 @@ export const DarkDealEncounter: MysteryEncounter =
) )
.withOutroDialogue([ .withOutroDialogue([
{ {
text: "mysteryEncounter:dark_deal_outro" text: `${namespace}_outro`
} }
]) ])
.build(); .build();

View File

@ -7,104 +7,160 @@ import { randSeedInt } from "#app/utils";
import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import BattleScene from "../../../battle-scene"; import BattleScene from "../../../battle-scene";
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter"; import MysteryEncounter, {
MysteryEncounterBuilder,
MysteryEncounterTier,
} from "../mystery-encounter";
export const DepartmentStoreSaleEncounter: MysteryEncounter = MysteryEncounterBuilder /** i18n namespace for encounter */
.withEncounterType(MysteryEncounterType.DEPARTMENT_STORE_SALE) const namespace = "mysteryEncounter:department_store_sale";
.withEncounterTier(MysteryEncounterTier.COMMON)
.withIntroSpriteConfigs([ export const DepartmentStoreSaleEncounter: MysteryEncounter =
{ MysteryEncounterBuilder.withEncounterType(
spriteKey: "b2w2_lady", MysteryEncounterType.DEPARTMENT_STORE_SALE
fileRoot: "mystery-encounters", )
hasShadow: true, .withEncounterTier(MysteryEncounterTier.COMMON)
x: -20 .withSceneWaveRangeRequirement(10, 100)
}, .withIntroSpriteConfigs([
{ {
spriteKey: Species.FURFROU.toString(), spriteKey: "b2w2_lady",
fileRoot: "pokemon", fileRoot: "mystery-encounters",
hasShadow: true, hasShadow: true,
repeat: true, x: -20,
x: 30 },
} {
]) spriteKey: Species.FURFROU.toString(),
// .withHideIntroVisuals(false) fileRoot: "pokemon",
.withSceneWaveRangeRequirement(10, 100) hasShadow: true,
.withSimpleOption(async (scene: BattleScene) => { repeat: true,
// Choose TMs x: 30,
const modifiers = []; },
let i = 0; ])
while (i < 4) { .withIntroDialogue([
// 2/2/1 weight on TM rarity {
const roll = randSeedInt(5); text: `${namespace}_intro_message`,
if (roll < 2) { },
modifiers.push(modifierTypes.TM_COMMON); {
} else if (roll < 4) { text: `${namespace}_intro_dialogue`,
modifiers.push(modifierTypes.TM_GREAT); speaker: `${namespace}_speaker`,
} else { },
modifiers.push(modifierTypes.TM_ULTRA); ])
// .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 }); setEncounterRewards(scene, {
leaveEncounterWithoutBattle(scene); guaranteedModifierTypeFuncs: modifiers,
}) fillRemaining: false,
.withSimpleOption(async (scene: BattleScene) => { });
// Choose Vitamins leaveEncounterWithoutBattle(scene);
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++; )
} .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 }); setEncounterRewards(scene, {
leaveEncounterWithoutBattle(scene); guaranteedModifierTypeFuncs: modifiers,
}) fillRemaining: false,
.withSimpleOption(async (scene: BattleScene) => { });
// Choose X Items leaveEncounterWithoutBattle(scene);
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++; )
} .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 }); setEncounterRewards(scene, {
leaveEncounterWithoutBattle(scene); guaranteedModifierTypeFuncs: modifiers,
}) fillRemaining: false,
.withSimpleOption(async (scene: BattleScene) => { });
// Choose Pokeballs leaveEncounterWithoutBattle(scene);
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++; )
} .build();
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: modifiers, fillRemaining: false });
leaveEncounterWithoutBattle(scene);
})
.build();

View File

@ -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 { FightOrFlightDialogue } from "#app/data/mystery-encounters/dialogue/fight-or-flight-dialogue";
import { TrainingSessionDialogue } from "#app/data/mystery-encounters/dialogue/training-session-dialogue"; import { TrainingSessionDialogue } from "#app/data/mystery-encounters/dialogue/training-session-dialogue";
import { SleepingSnorlaxDialogue } from "./dialogue/sleeping-snorlax-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 { ShadyVitaminDealerDialogue } from "#app/data/mystery-encounters/dialogue/shady-vitamin-dealer";
import { TextStyle } from "#app/ui/text"; import { TextStyle } from "#app/ui/text";
import { FieldTripDialogue } from "#app/data/mystery-encounters/dialogue/field-trip-dialogue"; 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.FIGHT_OR_FLIGHT] = FightOrFlightDialogue;
allMysteryEncounterDialogue[MysteryEncounterType.TRAINING_SESSION] = TrainingSessionDialogue; allMysteryEncounterDialogue[MysteryEncounterType.TRAINING_SESSION] = TrainingSessionDialogue;
allMysteryEncounterDialogue[MysteryEncounterType.SLEEPING_SNORLAX] = SleepingSnorlaxDialogue; allMysteryEncounterDialogue[MysteryEncounterType.SLEEPING_SNORLAX] = SleepingSnorlaxDialogue;
allMysteryEncounterDialogue[MysteryEncounterType.DEPARTMENT_STORE_SALE] = DepartmentStoreSaleDialogue;
allMysteryEncounterDialogue[MysteryEncounterType.SHADY_VITAMIN_DEALER] = ShadyVitaminDealerDialogue; allMysteryEncounterDialogue[MysteryEncounterType.SHADY_VITAMIN_DEALER] = ShadyVitaminDealerDialogue;
allMysteryEncounterDialogue[MysteryEncounterType.FIELD_TRIP] = FieldTripDialogue; allMysteryEncounterDialogue[MysteryEncounterType.FIELD_TRIP] = FieldTripDialogue;
} }