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,
} 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();

View File

@ -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();

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 { 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;
}