mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-25 08:49:32 +02:00
fix: loading mystery-encounter translations
with lazy-load
This commit is contained in:
parent
701d894102
commit
335b70676d
@ -17,7 +17,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier";
|
|||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:aTrainersTest";
|
const namespace = "mysteryEncounters/aTrainersTest";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Trainer's Test encounter.
|
* A Trainer's Test encounter.
|
||||||
@ -31,7 +31,7 @@ export const ATrainersTestEncounter: MysteryEncounter =
|
|||||||
.withIntroSpriteConfigs([]) // These are set in onInit()
|
.withIntroSpriteConfigs([]) // These are set in onInit()
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
@ -75,24 +75,24 @@ export const ATrainersTestEncounter: MysteryEncounter =
|
|||||||
encounter.dialogue.intro = [
|
encounter.dialogue.intro = [
|
||||||
{
|
{
|
||||||
speaker: `trainerNames:${trainerNameKey}`,
|
speaker: `trainerNames:${trainerNameKey}`,
|
||||||
text: `${namespace}.${trainerNameKey}.intro_dialogue`
|
text: `${namespace}:${trainerNameKey}.intro_dialogue`
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
encounter.options[0].dialogue!.selected = [
|
encounter.options[0].dialogue!.selected = [
|
||||||
{
|
{
|
||||||
speaker: `trainerNames:${trainerNameKey}`,
|
speaker: `trainerNames:${trainerNameKey}`,
|
||||||
text: `${namespace}.${trainerNameKey}.accept`
|
text: `${namespace}:${trainerNameKey}.accept`
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
encounter.options[1].dialogue!.selected = [
|
encounter.options[1].dialogue!.selected = [
|
||||||
{
|
{
|
||||||
speaker: `trainerNames:${trainerNameKey}`,
|
speaker: `trainerNames:${trainerNameKey}`,
|
||||||
text: `${namespace}.${trainerNameKey}.decline`
|
text: `${namespace}:${trainerNameKey}.decline`
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
encounter.setDialogueToken("statTrainerName", i18next.t(`trainerNames:${trainerNameKey}`));
|
encounter.setDialogueToken("statTrainerName", i18next.t(`trainerNames:${trainerNameKey}`));
|
||||||
const eggDescription = i18next.t(`${namespace}.title`) + ":\n" + i18next.t(`trainerNames:${trainerNameKey}`);
|
const eggDescription = i18next.t(`${namespace}:title`) + ":\n" + i18next.t(`trainerNames:${trainerNameKey}`);
|
||||||
encounter.misc = { trainerType, trainerNameKey, trainerEggDescription: eggDescription };
|
encounter.misc = { trainerType, trainerNameKey, trainerEggDescription: eggDescription };
|
||||||
|
|
||||||
// Trainer config
|
// Trainer config
|
||||||
@ -127,14 +127,14 @@ export const ATrainersTestEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withIntroDialogue()
|
.withIntroDialogue()
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`
|
buttonTooltip: `${namespace}:option.1.tooltip`
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -150,15 +150,15 @@ export const ATrainersTestEncounter: MysteryEncounter =
|
|||||||
eggDescriptor: encounter.misc.trainerEggDescription,
|
eggDescriptor: encounter.misc.trainerEggDescription,
|
||||||
tier: EggTier.ULTRA
|
tier: EggTier.ULTRA
|
||||||
};
|
};
|
||||||
encounter.setDialogueToken("eggType", i18next.t(`${namespace}.eggTypes.epic`));
|
encounter.setDialogueToken("eggType", i18next.t(`${namespace}:eggTypes.epic`));
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.SACRED_ASH], guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ULTRA], fillRemaining: true }, [eggOptions]);
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.SACRED_ASH], guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ULTRA], fillRemaining: true }, [eggOptions]);
|
||||||
return initBattleWithEnemyConfig(scene, config);
|
return initBattleWithEnemyConfig(scene, config);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`
|
buttonTooltip: `${namespace}:option.2.tooltip`
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -172,14 +172,14 @@ export const ATrainersTestEncounter: MysteryEncounter =
|
|||||||
eggDescriptor: encounter.misc.trainerEggDescription,
|
eggDescriptor: encounter.misc.trainerEggDescription,
|
||||||
tier: EggTier.GREAT
|
tier: EggTier.GREAT
|
||||||
};
|
};
|
||||||
encounter.setDialogueToken("eggType", i18next.t(`${namespace}.eggTypes.rare`));
|
encounter.setDialogueToken("eggType", i18next.t(`${namespace}:eggTypes.rare`));
|
||||||
setEncounterRewards(scene, { fillRemaining: false, rerollMultiplier: -1 }, [eggOptions]);
|
setEncounterRewards(scene, { fillRemaining: false, rerollMultiplier: -1 }, [eggOptions]);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`
|
text: `${namespace}:outro`
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
@ -26,7 +26,7 @@ import { Stat } from "#enums/stat";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:absoluteAvarice";
|
const namespace = "mysteryEncounters/absoluteAvarice";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Absolute Avarice encounter.
|
* Absolute Avarice encounter.
|
||||||
@ -167,12 +167,12 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
})
|
})
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
modifierConfigs: bossModifierConfigs,
|
modifierConfigs: bossModifierConfigs,
|
||||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.option.1.boss_enraged`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:option.1.boss_enraged`);
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,11 +234,11 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -259,7 +259,7 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
scene.addModifier(seedModifier, false, false, false, true);
|
scene.addModifier(seedModifier, false, false, false, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
queueEncounterMessage(scene, `${namespace}.option.1.food_stash`);
|
queueEncounterMessage(scene, `${namespace}:option.1.food_stash`);
|
||||||
};
|
};
|
||||||
|
|
||||||
setEncounterRewards(scene, { fillRemaining: true }, undefined, givePartyPokemonReviverSeeds);
|
setEncounterRewards(scene, { fillRemaining: true }, undefined, givePartyPokemonReviverSeeds);
|
||||||
@ -279,11 +279,11 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -321,11 +321,11 @@ export const AbsoluteAvariceEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
@ -15,7 +15,7 @@ import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:offerYouCantRefuse";
|
const namespace = "mysteryEncounters/offerYouCantRefuse";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An Offer You Can't Refuse encounter.
|
* An Offer You Can't Refuse encounter.
|
||||||
@ -48,16 +48,16 @@ export const AnOfferYouCantRefuseEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
const pokemon = getHighestStatTotalPlayerPokemon(scene, false);
|
const pokemon = getHighestStatTotalPlayerPokemon(scene, false);
|
||||||
@ -92,12 +92,12 @@ export const AnOfferYouCantRefuseEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -123,13 +123,13 @@ export const AnOfferYouCantRefuseEncounter: MysteryEncounter =
|
|||||||
new AbilityRequirement(EXTORTION_ABILITIES))
|
new AbilityRequirement(EXTORTION_ABILITIES))
|
||||||
)
|
)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.2.tooltip_disabled`,
|
disabledButtonTooltip: `${namespace}:option.2.tooltip_disabled`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -147,12 +147,12 @@ export const AnOfferYouCantRefuseEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -33,7 +33,7 @@ import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:berriesAbound";
|
const namespace = "mysteryEncounters/berriesAbound";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Berries Abound encounter.
|
* Berries Abound encounter.
|
||||||
@ -49,7 +49,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
.withIntroSpriteConfigs([]) // Set in onInit()
|
.withIntroSpriteConfigs([]) // Set in onInit()
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -109,16 +109,16 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -128,7 +128,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
const numBerries = encounter.misc.numBerries;
|
const numBerries = encounter.misc.numBerries;
|
||||||
|
|
||||||
const doBerryRewards = async () => {
|
const doBerryRewards = async () => {
|
||||||
const berryText = numBerries + " " + i18next.t(`${namespace}.berries`);
|
const berryText = numBerries + " " + i18next.t(`${namespace}:berries`);
|
||||||
|
|
||||||
scene.playSound("item_fanfare");
|
scene.playSound("item_fanfare");
|
||||||
queueEncounterMessage(scene, i18next.t("battle:rewardGain", { modifierName: berryText }));
|
queueEncounterMessage(scene, i18next.t("battle:rewardGain", { modifierName: berryText }));
|
||||||
@ -156,8 +156,8 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`
|
buttonTooltip: `${namespace}:option.2.tooltip`
|
||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Pick race for berries
|
// Pick race for berries
|
||||||
@ -179,7 +179,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
if (speedDiff < 1) {
|
if (speedDiff < 1) {
|
||||||
// Caught and attacked by boss, gets +1 to all stats at start of fight
|
// Caught and attacked by boss, gets +1 to all stats at start of fight
|
||||||
const doBerryRewards = async () => {
|
const doBerryRewards = async () => {
|
||||||
const berryText = numBerries + " " + i18next.t(`${namespace}.berries`);
|
const berryText = numBerries + " " + i18next.t(`${namespace}:berries`);
|
||||||
|
|
||||||
scene.playSound("item_fanfare");
|
scene.playSound("item_fanfare");
|
||||||
queueEncounterMessage(scene, i18next.t("battle:rewardGain", { modifierName: berryText }));
|
queueEncounterMessage(scene, i18next.t("battle:rewardGain", { modifierName: berryText }));
|
||||||
@ -193,11 +193,11 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
const config = scene.currentBattle.mysteryEncounter!.enemyPartyConfigs[0];
|
const config = scene.currentBattle.mysteryEncounter!.enemyPartyConfigs[0];
|
||||||
config.pokemonConfigs![0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON];
|
config.pokemonConfigs![0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON];
|
||||||
config.pokemonConfigs![0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => {
|
config.pokemonConfigs![0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.option.2.boss_enraged`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:option.2.boss_enraged`);
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
||||||
};
|
};
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeOptions: shopOptions, fillRemaining: false }, undefined, doBerryRewards);
|
setEncounterRewards(scene, { guaranteedModifierTypeOptions: shopOptions, fillRemaining: false }, undefined, doBerryRewards);
|
||||||
await showEncounterText(scene, `${namespace}.option.2.selected_bad`);
|
await showEncounterText(scene, `${namespace}:option.2.selected_bad`);
|
||||||
await initBattleWithEnemyConfig(scene, config);
|
await initBattleWithEnemyConfig(scene, config);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -205,7 +205,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
const numBerriesGrabbed = Math.max(Math.min(Math.round((speedDiff - 1)/0.08), numBerries), 2);
|
const numBerriesGrabbed = Math.max(Math.min(Math.round((speedDiff - 1)/0.08), numBerries), 2);
|
||||||
encounter.setDialogueToken("numBerries", String(numBerriesGrabbed));
|
encounter.setDialogueToken("numBerries", String(numBerriesGrabbed));
|
||||||
const doFasterBerryRewards = async () => {
|
const doFasterBerryRewards = async () => {
|
||||||
const berryText = numBerriesGrabbed + " " + i18next.t(`${namespace}.berries`);
|
const berryText = numBerriesGrabbed + " " + i18next.t(`${namespace}:berries`);
|
||||||
|
|
||||||
scene.playSound("item_fanfare");
|
scene.playSound("item_fanfare");
|
||||||
queueEncounterMessage(scene, i18next.t("battle:rewardGain", { modifierName: berryText }));
|
queueEncounterMessage(scene, i18next.t("battle:rewardGain", { modifierName: berryText }));
|
||||||
@ -218,7 +218,7 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
setEncounterExp(scene, fastestPokemon.id, encounter.enemyPartyConfigs[0].pokemonConfigs![0].species.baseExp);
|
setEncounterExp(scene, fastestPokemon.id, encounter.enemyPartyConfigs[0].pokemonConfigs![0].species.baseExp);
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeOptions: shopOptions, fillRemaining: false }, undefined, doFasterBerryRewards);
|
setEncounterRewards(scene, { guaranteedModifierTypeOptions: shopOptions, fillRemaining: false }, undefined, doFasterBerryRewards);
|
||||||
await showEncounterText(scene, `${namespace}.option.2.selected`);
|
await showEncounterText(scene, `${namespace}:option.2.selected`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -226,11 +226,11 @@ export const BerriesAboundEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -52,7 +52,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:bugTypeSuperfan";
|
const namespace = "mysteryEncounters/bugTypeSuperfan";
|
||||||
|
|
||||||
const POOL_1_POKEMON = [
|
const POOL_1_POKEMON = [
|
||||||
Species.PARASECT,
|
Species.PARASECT,
|
||||||
@ -198,11 +198,11 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -236,17 +236,17 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -277,9 +277,9 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPrimaryPokemonRequirement(new TypeRequirement(Type.BUG, false, 1)) // Must have 1 Bug type on team
|
.withPrimaryPokemonRequirement(new TypeRequirement(Type.BUG, false, 1)) // Must have 1 Bug type on team
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.2.disabled_tooltip`
|
disabledButtonTooltip: `${namespace}:option.2.disabled_tooltip`
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene) => {
|
.withPreOptionPhase(async (scene: BattleScene) => {
|
||||||
// Player shows off their bug types
|
// Player shows off their bug types
|
||||||
@ -287,31 +287,31 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
// Player gets different rewards depending on the number of bug types they have
|
// Player gets different rewards depending on the number of bug types they have
|
||||||
const numBugTypes = scene.getParty().filter(p => p.isOfType(Type.BUG, true)).length;
|
const numBugTypes = scene.getParty().filter(p => p.isOfType(Type.BUG, true)).length;
|
||||||
const numBugTypesText = i18next.t(`${namespace}.numBugTypes`, { count: numBugTypes });
|
const numBugTypesText = i18next.t(`${namespace}:numBugTypes`, { count: numBugTypes });
|
||||||
encounter.setDialogueToken("numBugTypes", numBugTypesText);
|
encounter.setDialogueToken("numBugTypes", numBugTypesText);
|
||||||
|
|
||||||
if (numBugTypes < 2) {
|
if (numBugTypes < 2) {
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.SUPER_LURE, modifierTypes.GREAT_BALL], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.SUPER_LURE, modifierTypes.GREAT_BALL], fillRemaining: false });
|
||||||
encounter.selectedOption!.dialogue!.selected = [
|
encounter.selectedOption!.dialogue!.selected = [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected_0_to_1`,
|
text: `${namespace}:option.2.selected_0_to_1`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else if (numBugTypes < 4) {
|
} else if (numBugTypes < 4) {
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.QUICK_CLAW, modifierTypes.MAX_LURE, modifierTypes.ULTRA_BALL], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.QUICK_CLAW, modifierTypes.MAX_LURE, modifierTypes.ULTRA_BALL], fillRemaining: false });
|
||||||
encounter.selectedOption!.dialogue!.selected = [
|
encounter.selectedOption!.dialogue!.selected = [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected_2_to_3`,
|
text: `${namespace}:option.2.selected_2_to_3`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else if (numBugTypes < 6) {
|
} else if (numBugTypes < 6) {
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.GRIP_CLAW, modifierTypes.MAX_LURE, modifierTypes.ROGUE_BALL], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.GRIP_CLAW, modifierTypes.MAX_LURE, modifierTypes.ROGUE_BALL], fillRemaining: false });
|
||||||
encounter.selectedOption!.dialogue!.selected = [
|
encounter.selectedOption!.dialogue!.selected = [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected_4_to_5`,
|
text: `${namespace}:option.2.selected_4_to_5`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
@ -338,8 +338,8 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
setEncounterRewards(scene, { guaranteedModifierTypeOptions: modifierOptions, fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeOptions: modifierOptions, fillRemaining: false });
|
||||||
encounter.selectedOption!.dialogue!.selected = [
|
encounter.selectedOption!.dialogue!.selected = [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected_6`,
|
text: `${namespace}:option.2.selected_6`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -357,19 +357,19 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
new AttackTypeBoosterHeldItemTypeRequirement(Type.BUG, 1)
|
new AttackTypeBoosterHeldItemTypeRequirement(Type.BUG, 1)
|
||||||
))
|
))
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.3.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.3.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.3.selected_dialogue`,
|
text: `${namespace}:option.3.selected_dialogue`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
secondOptionPrompt: `${namespace}.option.3.select_prompt`,
|
secondOptionPrompt: `${namespace}:option.3.select_prompt`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -407,7 +407,7 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
(item instanceof AttackTypeBoosterModifier && (item.type as AttackTypeBoosterModifierType).moveType === Type.BUG);
|
(item instanceof AttackTypeBoosterModifier && (item.type as AttackTypeBoosterModifierType).moveType === Type.BUG);
|
||||||
});
|
});
|
||||||
if (!hasValidItem) {
|
if (!hasValidItem) {
|
||||||
return getEncounterText(scene, `${namespace}.option.3.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:option.3.invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -435,7 +435,7 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
.build())
|
.build())
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
@ -597,7 +597,7 @@ function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSl
|
|||||||
function doBugTypeMoveTutor(scene: BattleScene): Promise<void> {
|
function doBugTypeMoveTutor(scene: BattleScene): Promise<void> {
|
||||||
return new Promise<void>(async resolve => {
|
return new Promise<void>(async resolve => {
|
||||||
const moveOptions = scene.currentBattle.mysteryEncounter!.misc.moveTutorOptions;
|
const moveOptions = scene.currentBattle.mysteryEncounter!.misc.moveTutorOptions;
|
||||||
await showEncounterDialogue(scene, `${namespace}.battle_won`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:battle_won`, `${namespace}:speaker`);
|
||||||
|
|
||||||
const overlayScale = 1;
|
const overlayScale = 1;
|
||||||
const moveInfoOverlay = new MoveInfoOverlay(scene, {
|
const moveInfoOverlay = new MoveInfoOverlay(scene, {
|
||||||
@ -632,7 +632,7 @@ function doBugTypeMoveTutor(scene: BattleScene): Promise<void> {
|
|||||||
moveInfoOverlay.setVisible(false);
|
moveInfoOverlay.setVisible(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = await selectOptionThenPokemon(scene, optionSelectItems, `${namespace}.teach_move_prompt`, undefined, onHoverOverCancel);
|
const result = await selectOptionThenPokemon(scene, optionSelectItems, `${namespace}:teach_move_prompt`, undefined, onHoverOverCancel);
|
||||||
// let forceExit = !!result;
|
// let forceExit = !!result;
|
||||||
if (!result) {
|
if (!result) {
|
||||||
moveInfoOverlay.active = false;
|
moveInfoOverlay.active = false;
|
||||||
@ -642,7 +642,7 @@ function doBugTypeMoveTutor(scene: BattleScene): Promise<void> {
|
|||||||
// TODO: add menu to confirm player doesn't want to teach a move
|
// TODO: add menu to confirm player doesn't want to teach a move
|
||||||
// while (!result && !forceExit) {
|
// while (!result && !forceExit) {
|
||||||
// // Didn't teach a move, ask the player to confirm they don't want to teach a move
|
// // Didn't teach a move, ask the player to confirm they don't want to teach a move
|
||||||
// await showEncounterDialogue(scene, `${namespace}.confirm_no_teach`, `${namespace}.speaker`);
|
// await showEncounterDialogue(scene, `${namespace}:confirm_no_teach`, `${namespace}:speaker`);
|
||||||
// const confirm = await new Promise<boolean>(confirmResolve => {
|
// const confirm = await new Promise<boolean>(confirmResolve => {
|
||||||
// scene.ui.setMode(Mode.CONFIRM, () => confirmResolve(true), () => confirmResolve(false));
|
// scene.ui.setMode(Mode.CONFIRM, () => confirmResolve(true), () => confirmResolve(false));
|
||||||
// });
|
// });
|
||||||
@ -653,7 +653,7 @@ function doBugTypeMoveTutor(scene: BattleScene): Promise<void> {
|
|||||||
// forceExit = true;
|
// forceExit = true;
|
||||||
// } else {
|
// } else {
|
||||||
// // Re-show learn menu
|
// // Re-show learn menu
|
||||||
// result = await selectOptionThenPokemon(scene, optionSelectItems, `${namespace}.teach_move_prompt`, undefined, onHoverOverCancel);
|
// result = await selectOptionThenPokemon(scene, optionSelectItems, `${namespace}:teach_move_prompt`, undefined, onHoverOverCancel);
|
||||||
// if (!result) {
|
// if (!result) {
|
||||||
// moveInfoOverlay.active = false;
|
// moveInfoOverlay.active = false;
|
||||||
// moveInfoOverlay.setVisible(false);
|
// moveInfoOverlay.setVisible(false);
|
||||||
|
@ -33,7 +33,7 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES, GameModes } from "#app/game-mode"
|
|||||||
import { EncounterAnim } from "#enums/encounter-anims";
|
import { EncounterAnim } from "#enums/encounter-anims";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:clowningAround";
|
const namespace = "mysteryEncounters/clowningAround";
|
||||||
|
|
||||||
const RANDOM_ABILITY_POOL = [
|
const RANDOM_ABILITY_POOL = [
|
||||||
Abilities.STURDY,
|
Abilities.STURDY,
|
||||||
@ -97,11 +97,11 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -147,19 +147,19 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -198,7 +198,7 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
// After the battle, offer the player the opportunity to permanently swap ability
|
// After the battle, offer the player the opportunity to permanently swap ability
|
||||||
const abilityWasSwapped = await handleSwapAbility(scene);
|
const abilityWasSwapped = await handleSwapAbility(scene);
|
||||||
if (abilityWasSwapped) {
|
if (abilityWasSwapped) {
|
||||||
await showEncounterText(scene, `${namespace}.option.1.ability_gained`);
|
await showEncounterText(scene, `${namespace}:option.1.ability_gained`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Play animations once ability swap is complete
|
// Play animations once ability swap is complete
|
||||||
@ -221,19 +221,19 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected_2`,
|
text: `${namespace}:option.2.selected_2`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected_3`,
|
text: `${namespace}:option.2.selected_3`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -307,19 +307,19 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected_2`,
|
text: `${namespace}:option.3.selected_2`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected_3`,
|
text: `${namespace}:option.3.selected_3`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -368,15 +368,15 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
async function handleSwapAbility(scene: BattleScene) {
|
async function handleSwapAbility(scene: BattleScene) {
|
||||||
return new Promise<boolean>(async resolve => {
|
return new Promise<boolean>(async resolve => {
|
||||||
await showEncounterDialogue(scene, `${namespace}.option.1.apply_ability_dialogue`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:option.1.apply_ability_dialogue`, `${namespace}:speaker`);
|
||||||
await showEncounterText(scene, `${namespace}.option.1.apply_ability_message`);
|
await showEncounterText(scene, `${namespace}:option.1.apply_ability_message`);
|
||||||
|
|
||||||
scene.ui.setMode(Mode.MESSAGE).then(() => {
|
scene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
displayYesNoOptions(scene, resolve);
|
displayYesNoOptions(scene, resolve);
|
||||||
@ -385,7 +385,7 @@ async function handleSwapAbility(scene: BattleScene) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function displayYesNoOptions(scene: BattleScene, resolve) {
|
function displayYesNoOptions(scene: BattleScene, resolve) {
|
||||||
showEncounterText(scene, `${namespace}.option.1.ability_prompt`, null, 500, false);
|
showEncounterText(scene, `${namespace}:option.1.ability_prompt`, null, 500, false);
|
||||||
const fullOptions = [
|
const fullOptions = [
|
||||||
{
|
{
|
||||||
label: i18next.t("menu:yes"),
|
label: i18next.t("menu:yes"),
|
||||||
|
@ -29,7 +29,7 @@ import { EncounterAnim } from "#enums/encounter-anims";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:dancingLessons";
|
const namespace = "mysteryEncounters/dancingLessons";
|
||||||
|
|
||||||
// Fire form
|
// Fire form
|
||||||
const BAILE_STYLE_BIOMES = [
|
const BAILE_STYLE_BIOMES = [
|
||||||
@ -97,12 +97,12 @@ export const DancingLessonsEncounter: MysteryEncounter =
|
|||||||
})
|
})
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ export const DancingLessonsEncounter: MysteryEncounter =
|
|||||||
// Gets +1 to all stats except SPD on battle start
|
// Gets +1 to all stats except SPD on battle start
|
||||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.option.1.boss_enraged`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:option.1.boss_enraged`);
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF], 1));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF], 1));
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
@ -171,11 +171,11 @@ export const DancingLessonsEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -200,11 +200,11 @@ export const DancingLessonsEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -235,13 +235,13 @@ export const DancingLessonsEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withPrimaryPokemonRequirement(new MoveRequirement(DANCING_MOVES)) // Will set option3PrimaryName and option3PrimaryMove dialogue tokens automatically
|
.withPrimaryPokemonRequirement(new MoveRequirement(DANCING_MOVES)) // Will set option3PrimaryName and option3PrimaryMove dialogue tokens automatically
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.3.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.3.disabled_tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.3.select_prompt`,
|
secondOptionPrompt: `${namespace}:option.3.select_prompt`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -273,7 +273,7 @@ export const DancingLessonsEncounter: MysteryEncounter =
|
|||||||
// If pokemon meets primary pokemon reqs, it can be selected
|
// If pokemon meets primary pokemon reqs, it can be selected
|
||||||
const meetsReqs = encounter.options[2].pokemonMeetsPrimaryRequirements(scene, pokemon);
|
const meetsReqs = encounter.options[2].pokemonMeetsPrimaryRequirements(scene, pokemon);
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -16,7 +16,7 @@ import { PokemonFormChangeItemModifier, PokemonHeldItemModifier } from "#app/mod
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** i18n namespace for encounter */
|
/** i18n namespace for encounter */
|
||||||
const namespace = "mysteryEncounter:darkDeal";
|
const namespace = "mysteryEncounters/darkDeal";
|
||||||
|
|
||||||
/** Exclude Ultra Beasts (inludes Cosmog/Solgaleo/Lunala/Necrozma), Paradox (includes Miraidon/Koraidon), Eternatus, and Mythicals */
|
/** Exclude Ultra Beasts (inludes Cosmog/Solgaleo/Lunala/Necrozma), Paradox (includes Miraidon/Koraidon), Eternatus, and Mythicals */
|
||||||
const excludedBosses = [
|
const excludedBosses = [
|
||||||
@ -107,32 +107,32 @@ export const DarkDealEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withSceneWaveRangeRequirement(30, CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES[1])
|
.withSceneWaveRangeRequirement(30, CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES[1])
|
||||||
.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(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.1.selected_dialogue`,
|
text: `${namespace}:option.1.selected_dialogue`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected_message`,
|
text: `${namespace}:option.1.selected_message`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -187,12 +187,12 @@ export const DarkDealEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -204,7 +204,7 @@ export const DarkDealEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`
|
text: `${namespace}:outro`
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
@ -19,7 +19,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:delibirdy";
|
const namespace = "mysteryEncounters/delibirdy";
|
||||||
|
|
||||||
/** Berries only */
|
/** Berries only */
|
||||||
const OPTION_2_ALLOWED_MODIFIERS = ["BerryModifier", "PokemonInstantReviveModifier"];
|
const OPTION_2_ALLOWED_MODIFIERS = ["BerryModifier", "PokemonInstantReviveModifier"];
|
||||||
@ -81,15 +81,15 @@ export const DelibirdyEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -108,11 +108,11 @@ export const DelibirdyEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withSceneMoneyRequirement(0, DELIBIRDY_MONEY_PRICE_MULTIPLIER) // Must have money to spawn
|
.withSceneMoneyRequirement(0, DELIBIRDY_MONEY_PRICE_MULTIPLIER) // Must have money to spawn
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -145,12 +145,12 @@ export const DelibirdyEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPrimaryPokemonRequirement(new HeldItemRequirement(OPTION_2_ALLOWED_MODIFIERS))
|
.withPrimaryPokemonRequirement(new HeldItemRequirement(OPTION_2_ALLOWED_MODIFIERS))
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.2.select_prompt`,
|
secondOptionPrompt: `${namespace}:option.2.select_prompt`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -184,7 +184,7 @@ export const DelibirdyEncounter: MysteryEncounter =
|
|||||||
// If pokemon meets primary pokemon reqs, it can be selected
|
// If pokemon meets primary pokemon reqs, it can be selected
|
||||||
const meetsReqs = encounter.options[1].pokemonMeetsPrimaryRequirements(scene, pokemon);
|
const meetsReqs = encounter.options[1].pokemonMeetsPrimaryRequirements(scene, pokemon);
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -240,12 +240,12 @@ export const DelibirdyEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPrimaryPokemonRequirement(new HeldItemRequirement(OPTION_3_DISALLOWED_MODIFIERS, 1, true))
|
.withPrimaryPokemonRequirement(new HeldItemRequirement(OPTION_3_DISALLOWED_MODIFIERS, 1, true))
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.3.select_prompt`,
|
secondOptionPrompt: `${namespace}:option.3.select_prompt`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -279,7 +279,7 @@ export const DelibirdyEncounter: MysteryEncounter =
|
|||||||
// If pokemon meets primary pokemon reqs, it can be selected
|
// If pokemon meets primary pokemon reqs, it can be selected
|
||||||
const meetsReqs = encounter.options[2].pokemonMeetsPrimaryRequirements(scene, pokemon);
|
const meetsReqs = encounter.options[2].pokemonMeetsPrimaryRequirements(scene, pokemon);
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -14,7 +14,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** i18n namespace for encounter */
|
/** i18n namespace for encounter */
|
||||||
const namespace = "mysteryEncounter:departmentStoreSale";
|
const namespace = "mysteryEncounters/departmentStoreSale";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Department Store Sale encounter.
|
* Department Store Sale encounter.
|
||||||
@ -43,21 +43,21 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
// Choose TMs
|
// Choose TMs
|
||||||
@ -82,8 +82,8 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
// Choose Vitamins
|
// Choose Vitamins
|
||||||
@ -106,8 +106,8 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
// Choose X Items
|
// Choose X Items
|
||||||
@ -130,8 +130,8 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.4.label`,
|
buttonLabel: `${namespace}:option.4.label`,
|
||||||
buttonTooltip: `${namespace}.option.4.tooltip`,
|
buttonTooltip: `${namespace}:option.4.tooltip`,
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
// Choose Pokeballs
|
// Choose Pokeballs
|
||||||
@ -158,7 +158,7 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
@ -14,7 +14,7 @@ import i18next from "i18next";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** i18n namespace for the encounter */
|
/** i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:fieldTrip";
|
const namespace = "mysteryEncounters/fieldTrip";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field Trip encounter.
|
* Field Trip encounter.
|
||||||
@ -44,24 +44,24 @@ export const FieldTripEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.second_option_prompt`,
|
secondOptionPrompt: `${namespace}:second_option_prompt`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -72,7 +72,7 @@ export const FieldTripEncounter: MysteryEncounter =
|
|||||||
label: move.getName(),
|
label: move.getName(),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
// Pokemon and move selected
|
// Pokemon and move selected
|
||||||
encounter.setDialogueToken("moveCategory", i18next.t(`${namespace}.physical`));
|
encounter.setDialogueToken("moveCategory", i18next.t(`${namespace}:physical`));
|
||||||
pokemonAndMoveChosen(scene, pokemon, move, MoveCategory.PHYSICAL);
|
pokemonAndMoveChosen(scene, pokemon, move, MoveCategory.PHYSICAL);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -105,9 +105,9 @@ export const FieldTripEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.second_option_prompt`,
|
secondOptionPrompt: `${namespace}:second_option_prompt`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -118,7 +118,7 @@ export const FieldTripEncounter: MysteryEncounter =
|
|||||||
label: move.getName(),
|
label: move.getName(),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
// Pokemon and move selected
|
// Pokemon and move selected
|
||||||
encounter.setDialogueToken("moveCategory", i18next.t(`${namespace}.special`));
|
encounter.setDialogueToken("moveCategory", i18next.t(`${namespace}:special`));
|
||||||
pokemonAndMoveChosen(scene, pokemon, move, MoveCategory.SPECIAL);
|
pokemonAndMoveChosen(scene, pokemon, move, MoveCategory.SPECIAL);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -151,9 +151,9 @@ export const FieldTripEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.second_option_prompt`,
|
secondOptionPrompt: `${namespace}:second_option_prompt`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -164,7 +164,7 @@ export const FieldTripEncounter: MysteryEncounter =
|
|||||||
label: move.getName(),
|
label: move.getName(),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
// Pokemon and move selected
|
// Pokemon and move selected
|
||||||
encounter.setDialogueToken("moveCategory", i18next.t(`${namespace}.status`));
|
encounter.setDialogueToken("moveCategory", i18next.t(`${namespace}:status`));
|
||||||
pokemonAndMoveChosen(scene, pokemon, move, MoveCategory.STATUS);
|
pokemonAndMoveChosen(scene, pokemon, move, MoveCategory.STATUS);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -203,28 +203,28 @@ function pokemonAndMoveChosen(scene: BattleScene, pokemon: PlayerPokemon, move:
|
|||||||
if (!correctMove) {
|
if (!correctMove) {
|
||||||
encounter.selectedOption!.dialogue!.selected = [
|
encounter.selectedOption!.dialogue!.selected = [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.incorrect`,
|
text: `${namespace}:incorrect`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.incorrect_exp`,
|
text: `${namespace}:incorrect_exp`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
setEncounterExp(scene, scene.getParty().map((p) => p.id), 50);
|
setEncounterExp(scene, scene.getParty().map((p) => p.id), 50);
|
||||||
} else {
|
} else {
|
||||||
encounter.selectedOption!.dialogue!.selected = [
|
encounter.selectedOption!.dialogue!.selected = [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.correct`,
|
text: `${namespace}:correct`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.correct_exp`,
|
text: `${namespace}:correct_exp`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
setEncounterExp(scene, [pokemon.id], 100);
|
setEncounterExp(scene, [pokemon.id], 100);
|
||||||
|
@ -24,7 +24,7 @@ import { EncounterAnim } from "#enums/encounter-anims";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:fieryFallout";
|
const namespace = "mysteryEncounters/fieryFallout";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Damage percentage taken when suffering the heat.
|
* Damage percentage taken when suffering the heat.
|
||||||
@ -48,7 +48,7 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
|||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -121,16 +121,16 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -169,11 +169,11 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -196,7 +196,7 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
|||||||
if (chosenPokemon.trySetStatus(StatusEffect.BURN)) {
|
if (chosenPokemon.trySetStatus(StatusEffect.BURN)) {
|
||||||
// Burn applied
|
// Burn applied
|
||||||
encounter.setDialogueToken("burnedPokemon", chosenPokemon.getNameToRender());
|
encounter.setDialogueToken("burnedPokemon", chosenPokemon.getNameToRender());
|
||||||
queueEncounterMessage(scene, `${namespace}.option.2.target_burned`);
|
queueEncounterMessage(scene, `${namespace}:option.2.target_burned`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,12 +210,12 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
|||||||
.withPrimaryPokemonRequirement(new TypeRequirement(Type.FIRE, true, 1)) // Will set option3PrimaryName dialogue token automatically
|
.withPrimaryPokemonRequirement(new TypeRequirement(Type.FIRE, true, 1)) // Will set option3PrimaryName dialogue token automatically
|
||||||
.withSecondaryPokemonRequirement(new TypeRequirement(Type.FIRE, true, 1)) // Will set option3SecondaryName dialogue token automatically
|
.withSecondaryPokemonRequirement(new TypeRequirement(Type.FIRE, true, 1)) // Will set option3SecondaryName dialogue token automatically
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.3.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.3.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -250,6 +250,6 @@ function giveLeadPokemonCharcoal(scene: BattleScene) {
|
|||||||
const charcoal = generateModifierType(scene, modifierTypes.ATTACK_TYPE_BOOSTER, [Type.FIRE]) as AttackTypeBoosterModifierType;
|
const charcoal = generateModifierType(scene, modifierTypes.ATTACK_TYPE_BOOSTER, [Type.FIRE]) as AttackTypeBoosterModifierType;
|
||||||
applyModifierTypeToPlayerPokemon(scene, leadPokemon, charcoal);
|
applyModifierTypeToPlayerPokemon(scene, leadPokemon, charcoal);
|
||||||
scene.currentBattle.mysteryEncounter!.setDialogueToken("leadPokemon", leadPokemon.getNameToRender());
|
scene.currentBattle.mysteryEncounter!.setDialogueToken("leadPokemon", leadPokemon.getNameToRender());
|
||||||
queueEncounterMessage(scene, `${namespace}.found_charcoal`);
|
queueEncounterMessage(scene, `${namespace}:found_charcoal`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:fightOrFlight";
|
const namespace = "mysteryEncounters/fightOrFlight";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fight or Flight encounter.
|
* Fight or Flight encounter.
|
||||||
@ -47,7 +47,7 @@ export const FightOrFlightEncounter: MysteryEncounter =
|
|||||||
.withIntroSpriteConfigs([]) // Set in onInit()
|
.withIntroSpriteConfigs([]) // Set in onInit()
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -66,7 +66,7 @@ export const FightOrFlightEncounter: MysteryEncounter =
|
|||||||
isBoss: true,
|
isBoss: true,
|
||||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.option.1.stat_boost`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:option.1.stat_boost`);
|
||||||
// Randomly boost 1 stat 2 stages
|
// Randomly boost 1 stat 2 stages
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [randSeedInt(4, 1)], 2));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [randSeedInt(4, 1)], 2));
|
||||||
}
|
}
|
||||||
@ -118,16 +118,16 @@ export const FightOrFlightEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -144,12 +144,12 @@ export const FightOrFlightEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
.withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.2.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.2.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`
|
text: `${namespace}:option.2.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -168,11 +168,11 @@ export const FightOrFlightEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ import { Nature } from "#enums/nature";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:funAndGames";
|
const namespace = "mysteryEncounters/funAndGames";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fun and Games! encounter.
|
* Fun and Games! encounter.
|
||||||
@ -70,13 +70,13 @@ export const FunAndGamesEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
scene.loadBgm("mystery_encounter_fun_and_games", "mystery_encounter_fun_and_games.mp3");
|
scene.loadBgm("mystery_encounter_fun_and_games", "mystery_encounter_fun_and_games.mp3");
|
||||||
@ -91,11 +91,11 @@ export const FunAndGamesEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withSceneRequirement(new MoneyRequirement(0, 1.5)) // Cost equal to 1 Max Potion
|
.withSceneRequirement(new MoneyRequirement(0, 1.5)) // Cost equal to 1 Max Potion
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -112,7 +112,7 @@ export const FunAndGamesEncounter: MysteryEncounter =
|
|||||||
const selectableFilter = (pokemon: Pokemon) => {
|
const selectableFilter = (pokemon: Pokemon) => {
|
||||||
const meetsReqs = pokemon.isAllowedInBattle();
|
const meetsReqs = pokemon.isAllowedInBattle();
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -144,11 +144,11 @@ export const FunAndGamesEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -234,7 +234,7 @@ function handleLoseMinigame(scene: BattleScene) {
|
|||||||
scene.currentBattle.enemyParty = [];
|
scene.currentBattle.enemyParty = [];
|
||||||
scene.currentBattle.mysteryEncounter!.doContinueEncounter = undefined;
|
scene.currentBattle.mysteryEncounter!.doContinueEncounter = undefined;
|
||||||
leaveEncounterWithoutBattle(scene, true);
|
leaveEncounterWithoutBattle(scene, true);
|
||||||
await showEncounterText(scene, `${namespace}.ko`);
|
await showEncounterText(scene, `${namespace}:ko`);
|
||||||
const reviveCost = scene.getWaveMoneyAmount(1.5);
|
const reviveCost = scene.getWaveMoneyAmount(1.5);
|
||||||
updatePlayerMoney(scene, -reviveCost, true, false);
|
updatePlayerMoney(scene, -reviveCost, true, false);
|
||||||
}
|
}
|
||||||
@ -260,19 +260,19 @@ function handleNextTurn(scene: BattleScene) {
|
|||||||
if (healthRatio < 0.03) {
|
if (healthRatio < 0.03) {
|
||||||
// Grand prize
|
// Grand prize
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.MULTI_LENS], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.MULTI_LENS], fillRemaining: false });
|
||||||
resultMessageKey = `${namespace}.best_result`;
|
resultMessageKey = `${namespace}:best_result`;
|
||||||
} else if (healthRatio < 0.15) {
|
} else if (healthRatio < 0.15) {
|
||||||
// 2nd prize
|
// 2nd prize
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.SCOPE_LENS], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.SCOPE_LENS], fillRemaining: false });
|
||||||
resultMessageKey = `${namespace}.great_result`;
|
resultMessageKey = `${namespace}:great_result`;
|
||||||
} else if (healthRatio < 0.33) {
|
} else if (healthRatio < 0.33) {
|
||||||
// 3rd prize
|
// 3rd prize
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.WIDE_LENS], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.WIDE_LENS], fillRemaining: false });
|
||||||
resultMessageKey = `${namespace}.good_result`;
|
resultMessageKey = `${namespace}:good_result`;
|
||||||
} else {
|
} else {
|
||||||
// No prize
|
// No prize
|
||||||
isHealPhase = true;
|
isHealPhase = true;
|
||||||
resultMessageKey = `${namespace}.bad_result`;
|
resultMessageKey = `${namespace}:bad_result`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End the battle
|
// End the battle
|
||||||
@ -282,7 +282,7 @@ function handleNextTurn(scene: BattleScene) {
|
|||||||
scene.currentBattle.mysteryEncounter!.doContinueEncounter = undefined;
|
scene.currentBattle.mysteryEncounter!.doContinueEncounter = undefined;
|
||||||
leaveEncounterWithoutBattle(scene, isHealPhase);
|
leaveEncounterWithoutBattle(scene, isHealPhase);
|
||||||
// Must end the TurnInit phase prematurely so battle phases aren't added to queue
|
// Must end the TurnInit phase prematurely so battle phases aren't added to queue
|
||||||
queueEncounterMessage(scene, `${namespace}.end_game`);
|
queueEncounterMessage(scene, `${namespace}:end_game`);
|
||||||
queueEncounterMessage(scene, resultMessageKey);
|
queueEncounterMessage(scene, resultMessageKey);
|
||||||
|
|
||||||
// Skip remainder of TurnInitPhase
|
// Skip remainder of TurnInitPhase
|
||||||
@ -290,9 +290,9 @@ function handleNextTurn(scene: BattleScene) {
|
|||||||
} else {
|
} else {
|
||||||
if (encounter.misc.turnsRemaining < 3) {
|
if (encounter.misc.turnsRemaining < 3) {
|
||||||
// Display charging messages on turns that aren't the initial turn
|
// Display charging messages on turns that aren't the initial turn
|
||||||
queueEncounterMessage(scene, `${namespace}.charging_continue`);
|
queueEncounterMessage(scene, `${namespace}:charging_continue`);
|
||||||
}
|
}
|
||||||
queueEncounterMessage(scene, `${namespace}.turn_remaining_${encounter.misc.turnsRemaining}`);
|
queueEncounterMessage(scene, `${namespace}:turn_remaining_${encounter.misc.turnsRemaining}`);
|
||||||
encounter.misc.turnsRemaining--;
|
encounter.misc.turnsRemaining--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
|||||||
import { addPokemonDataToDexAndValidateAchievements } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { addPokemonDataToDexAndValidateAchievements } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:globalTradeSystem";
|
const namespace = "mysteryEncounters/globalTradeSystem";
|
||||||
|
|
||||||
const LEGENDARY_TRADE_POOLS = {
|
const LEGENDARY_TRADE_POOLS = {
|
||||||
1: [Species.RATTATA, Species.PIDGEY, Species.WEEDLE],
|
1: [Species.RATTATA, Species.PIDGEY, Species.WEEDLE],
|
||||||
@ -87,12 +87,12 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -127,9 +127,9 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.1.trade_options_prompt`,
|
secondOptionPrompt: `${namespace}:option.1.trade_options_prompt`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -195,7 +195,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
// Show the trade animation
|
// Show the trade animation
|
||||||
await showTradeBackground(scene);
|
await showTradeBackground(scene);
|
||||||
await doPokemonTradeSequence(scene, tradedPokemon, newPlayerPokemon);
|
await doPokemonTradeSequence(scene, tradedPokemon, newPlayerPokemon);
|
||||||
await showEncounterText(scene, `${namespace}.trade_received`, null, 0, true, 4000);
|
await showEncounterText(scene, `${namespace}:trade_received`, null, 0, true, 4000);
|
||||||
scene.playBgm(encounter.misc.bgmKey);
|
scene.playBgm(encounter.misc.bgmKey);
|
||||||
await addPokemonDataToDexAndValidateAchievements(scene, newPlayerPokemon);
|
await addPokemonDataToDexAndValidateAchievements(scene, newPlayerPokemon);
|
||||||
await hideTradeBackground(scene);
|
await hideTradeBackground(scene);
|
||||||
@ -210,8 +210,8 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -277,7 +277,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
// Show the trade animation
|
// Show the trade animation
|
||||||
await showTradeBackground(scene);
|
await showTradeBackground(scene);
|
||||||
await doPokemonTradeSequence(scene, tradedPokemon, newPlayerPokemon);
|
await doPokemonTradeSequence(scene, tradedPokemon, newPlayerPokemon);
|
||||||
await showEncounterText(scene, `${namespace}.trade_received`, null, 0, true, 4000);
|
await showEncounterText(scene, `${namespace}:trade_received`, null, 0, true, 4000);
|
||||||
scene.playBgm(encounter.misc.bgmKey);
|
scene.playBgm(encounter.misc.bgmKey);
|
||||||
await addPokemonDataToDexAndValidateAchievements(scene, newPlayerPokemon);
|
await addPokemonDataToDexAndValidateAchievements(scene, newPlayerPokemon);
|
||||||
await hideTradeBackground(scene);
|
await hideTradeBackground(scene);
|
||||||
@ -291,9 +291,9 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.3.trade_options_prompt`,
|
secondOptionPrompt: `${namespace}:option.3.trade_options_prompt`,
|
||||||
})
|
})
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
@ -324,7 +324,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
return it.isTransferable;
|
return it.isTransferable;
|
||||||
}).length > 0;
|
}).length > 0;
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.option.3.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:option.3.invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -372,18 +372,18 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
|
|||||||
// Generate a trainer name
|
// Generate a trainer name
|
||||||
const traderName = generateRandomTraderName();
|
const traderName = generateRandomTraderName();
|
||||||
encounter.setDialogueToken("tradeTrainerName", traderName.trim());
|
encounter.setDialogueToken("tradeTrainerName", traderName.trim());
|
||||||
await showEncounterText(scene, `${namespace}.item_trade_selected`);
|
await showEncounterText(scene, `${namespace}:item_trade_selected`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.4.label`,
|
buttonLabel: `${namespace}:option.4.label`,
|
||||||
buttonTooltip: `${namespace}.option.4.tooltip`,
|
buttonTooltip: `${namespace}:option.4.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.4.selected`,
|
text: `${namespace}:option.4.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -598,10 +598,10 @@ function doPokemonTradeSequence(scene: BattleScene, tradedPokemon: PlayerPokemon
|
|||||||
duration: 500,
|
duration: 500,
|
||||||
onComplete: async () => {
|
onComplete: async () => {
|
||||||
scene.fadeOutBgm(1000, false);
|
scene.fadeOutBgm(1000, false);
|
||||||
await showEncounterText(scene, `${namespace}.pokemon_trade_selected`);
|
await showEncounterText(scene, `${namespace}:pokemon_trade_selected`);
|
||||||
tradedPokemon.cry();
|
tradedPokemon.cry();
|
||||||
scene.playBgm("evolution");
|
scene.playBgm("evolution");
|
||||||
await showEncounterText(scene, `${namespace}.pokemon_trade_goodbye`);
|
await showEncounterText(scene, `${namespace}:pokemon_trade_goodbye`);
|
||||||
|
|
||||||
tradedPokeball.setAlpha(0);
|
tradedPokeball.setAlpha(0);
|
||||||
tradedPokeball.setVisible(true);
|
tradedPokeball.setVisible(true);
|
||||||
|
@ -21,7 +21,7 @@ const OPTION_2_REQUIRED_MOVE = Moves.FLY;
|
|||||||
*/
|
*/
|
||||||
const DAMAGE_PERCENTAGE: number = 25;
|
const DAMAGE_PERCENTAGE: number = 25;
|
||||||
/** The i18n namespace for the encounter */
|
/** The i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:lostAtSea";
|
const namespace = "mysteryEncounters/lostAtSea";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lost at sea encounter.
|
* Lost at sea encounter.
|
||||||
@ -40,7 +40,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
y: 3,
|
y: 3,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withIntroDialogue([{ text: `${namespace}.intro` }])
|
.withIntroDialogue([{ text: `${namespace}:intro` }])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -50,22 +50,22 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(
|
.withOption(
|
||||||
// Option 1: Use a (non fainted) pokemon that can learn Surf to guide you back/
|
// Option 1: Use a (non fainted) pokemon that can learn Surf to guide you back/
|
||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPokemonCanLearnMoveRequirement(OPTION_1_REQUIRED_MOVE)
|
.withPokemonCanLearnMoveRequirement(OPTION_1_REQUIRED_MOVE)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
disabledButtonLabel: `${namespace}.option.1.label_disabled`,
|
disabledButtonLabel: `${namespace}:option.1.label_disabled`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.1.tooltip_disabled`,
|
disabledButtonTooltip: `${namespace}:option.1.tooltip_disabled`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -78,13 +78,13 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withPokemonCanLearnMoveRequirement(OPTION_2_REQUIRED_MOVE)
|
.withPokemonCanLearnMoveRequirement(OPTION_2_REQUIRED_MOVE)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
disabledButtonLabel: `${namespace}.option.2.label_disabled`,
|
disabledButtonLabel: `${namespace}:option.2.label_disabled`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.2.tooltip_disabled`,
|
disabledButtonTooltip: `${namespace}:option.2.tooltip_disabled`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -94,11 +94,11 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
// Option 3: Wander aimlessly
|
// Option 3: Wander aimlessly
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -118,7 +118,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
@ -20,7 +20,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:mysteriousChallengers";
|
const namespace = "mysteryEncounters/mysteriousChallengers";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mysterious Challengers encounter.
|
* Mysterious Challengers encounter.
|
||||||
@ -34,7 +34,7 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
.withIntroSpriteConfigs([]) // These are set in onInit()
|
.withIntroSpriteConfigs([]) // These are set in onInit()
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -125,16 +125,16 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -155,11 +155,11 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -180,11 +180,11 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -208,7 +208,7 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
@ -16,7 +16,7 @@ import { GameOverPhase } from "#app/phases/game-over-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** i18n namespace for encounter */
|
/** i18n namespace for encounter */
|
||||||
const namespace = "mysteryEncounter:mysteriousChest";
|
const namespace = "mysteryEncounters/mysteriousChest";
|
||||||
|
|
||||||
const RAND_LENGTH = 100;
|
const RAND_LENGTH = 100;
|
||||||
const COMMON_REWARDS_WEIGHT = 20; // 20%
|
const COMMON_REWARDS_WEIGHT = 20; // 20%
|
||||||
@ -57,12 +57,12 @@ export const MysteriousChestEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -90,11 +90,11 @@ export const MysteriousChestEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -135,7 +135,7 @@ export const MysteriousChestEncounter: MysteryEncounter =
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
// Display result message then proceed to rewards
|
// Display result message then proceed to rewards
|
||||||
queueEncounterMessage(scene, `${namespace}.option.1.normal`);
|
queueEncounterMessage(scene, `${namespace}:option.1.normal`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
} else if (roll < ULTRA_REWARDS_WEIGHT) {
|
} else if (roll < ULTRA_REWARDS_WEIGHT) {
|
||||||
// Choose between 3 ULTRA tier items (30%)
|
// Choose between 3 ULTRA tier items (30%)
|
||||||
@ -147,19 +147,19 @@ export const MysteriousChestEncounter: MysteryEncounter =
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
// Display result message then proceed to rewards
|
// Display result message then proceed to rewards
|
||||||
queueEncounterMessage(scene, `${namespace}.option.1.good`);
|
queueEncounterMessage(scene, `${namespace}:option.1.good`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
} else if (roll < ROGUE_REWARDS_WEIGHT) {
|
} else if (roll < ROGUE_REWARDS_WEIGHT) {
|
||||||
// Choose between 2 ROGUE tier items (10%)
|
// Choose between 2 ROGUE tier items (10%)
|
||||||
setEncounterRewards(scene, { guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE] });
|
setEncounterRewards(scene, { guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE] });
|
||||||
// Display result message then proceed to rewards
|
// Display result message then proceed to rewards
|
||||||
queueEncounterMessage(scene, `${namespace}.option.1.great`);
|
queueEncounterMessage(scene, `${namespace}:option.1.great`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
} else if (roll < MASTER_REWARDS_WEIGHT) {
|
} else if (roll < MASTER_REWARDS_WEIGHT) {
|
||||||
// Choose 1 MASTER tier item (5%)
|
// Choose 1 MASTER tier item (5%)
|
||||||
setEncounterRewards(scene, { guaranteedModifierTiers: [ModifierTier.MASTER] });
|
setEncounterRewards(scene, { guaranteedModifierTiers: [ModifierTier.MASTER] });
|
||||||
// Display result message then proceed to rewards
|
// Display result message then proceed to rewards
|
||||||
queueEncounterMessage(scene, `${namespace}.option.1.amazing`);
|
queueEncounterMessage(scene, `${namespace}:option.1.amazing`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
} else {
|
} else {
|
||||||
// Your highest level unfainted Pokemon gets OHKO. Start battle against a Gimmighoul (35%)
|
// Your highest level unfainted Pokemon gets OHKO. Start battle against a Gimmighoul (35%)
|
||||||
@ -177,7 +177,7 @@ export const MysteriousChestEncounter: MysteryEncounter =
|
|||||||
} else {
|
} else {
|
||||||
// Show which Pokemon was KOed, then start battle against Gimmighoul
|
// Show which Pokemon was KOed, then start battle against Gimmighoul
|
||||||
encounter.setDialogueToken("pokeName", highestLevelPokemon.getNameToRender());
|
encounter.setDialogueToken("pokeName", highestLevelPokemon.getNameToRender());
|
||||||
await showEncounterText(scene, `${namespace}.option.1.bad`);
|
await showEncounterText(scene, `${namespace}:option.1.bad`);
|
||||||
transitionMysteryEncounterIntroVisuals(scene, true, true, 500);
|
transitionMysteryEncounterIntroVisuals(scene, true, true, 500);
|
||||||
setEncounterRewards(scene, { fillRemaining: true });
|
setEncounterRewards(scene, { fillRemaining: true });
|
||||||
await initBattleWithEnemyConfig(scene, encounter.enemyPartyConfigs[0]);
|
await initBattleWithEnemyConfig(scene, encounter.enemyPartyConfigs[0]);
|
||||||
@ -188,11 +188,11 @@ export const MysteriousChestEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,7 @@ import Pokemon, { PlayerPokemon } from "#app/field/pokemon";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:partTimer";
|
const namespace = "mysteryEncounters/partTimer";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part Timer encounter.
|
* Part Timer encounter.
|
||||||
@ -44,11 +44,11 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -68,17 +68,17 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(MysteryEncounterOptionBuilder
|
.withOption(MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`
|
text: `${namespace}:option.1.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -118,7 +118,7 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
// Only Pokemon non-KOd pokemon can be selected
|
// Only Pokemon non-KOd pokemon can be selected
|
||||||
const selectableFilter = (pokemon: Pokemon) => {
|
const selectableFilter = (pokemon: Pokemon) => {
|
||||||
if (!pokemon.isAllowedInBattle()) {
|
if (!pokemon.isAllowedInBattle()) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -135,14 +135,14 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
// Give money and do dialogue
|
// Give money and do dialogue
|
||||||
if (moneyMultiplier > 2.5) {
|
if (moneyMultiplier > 2.5) {
|
||||||
await showEncounterDialogue(scene, `${namespace}.job_complete_good`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:job_complete_good`, `${namespace}:speaker`);
|
||||||
} else {
|
} else {
|
||||||
await showEncounterDialogue(scene, `${namespace}.job_complete_bad`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
||||||
}
|
}
|
||||||
const moneyChange = scene.getWaveMoneyAmount(moneyMultiplier);
|
const moneyChange = scene.getWaveMoneyAmount(moneyMultiplier);
|
||||||
updatePlayerMoney(scene, moneyChange, true, false);
|
updatePlayerMoney(scene, moneyChange, true, false);
|
||||||
await showEncounterText(scene, i18next.t("mysteryEncounterMessages:receive_money", { amount: moneyChange }));
|
await showEncounterText(scene, i18next.t("mysteryEncounterMessages:receive_money", { amount: moneyChange }));
|
||||||
await showEncounterText(scene, `${namespace}.pokemon_tired`);
|
await showEncounterText(scene, `${namespace}:pokemon_tired`);
|
||||||
|
|
||||||
setEncounterRewards(scene, { fillRemaining: true });
|
setEncounterRewards(scene, { fillRemaining: true });
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
@ -152,11 +152,11 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
.withOption(MysteryEncounterOptionBuilder
|
.withOption(MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`
|
text: `${namespace}:option.2.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -199,7 +199,7 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
// Only Pokemon non-KOd pokemon can be selected
|
// Only Pokemon non-KOd pokemon can be selected
|
||||||
const selectableFilter = (pokemon: Pokemon) => {
|
const selectableFilter = (pokemon: Pokemon) => {
|
||||||
if (!pokemon.isAllowedInBattle()) {
|
if (!pokemon.isAllowedInBattle()) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -216,14 +216,14 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
// Give money and do dialogue
|
// Give money and do dialogue
|
||||||
if (moneyMultiplier > 2.5) {
|
if (moneyMultiplier > 2.5) {
|
||||||
await showEncounterDialogue(scene, `${namespace}.job_complete_good`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:job_complete_good`, `${namespace}:speaker`);
|
||||||
} else {
|
} else {
|
||||||
await showEncounterDialogue(scene, `${namespace}.job_complete_bad`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:job_complete_bad`, `${namespace}:speaker`);
|
||||||
}
|
}
|
||||||
const moneyChange = scene.getWaveMoneyAmount(moneyMultiplier);
|
const moneyChange = scene.getWaveMoneyAmount(moneyMultiplier);
|
||||||
updatePlayerMoney(scene, moneyChange, true, false);
|
updatePlayerMoney(scene, moneyChange, true, false);
|
||||||
await showEncounterText(scene, i18next.t("mysteryEncounterMessages:receive_money", { amount: moneyChange }));
|
await showEncounterText(scene, i18next.t("mysteryEncounterMessages:receive_money", { amount: moneyChange }));
|
||||||
await showEncounterText(scene, `${namespace}.pokemon_tired`);
|
await showEncounterText(scene, `${namespace}:pokemon_tired`);
|
||||||
|
|
||||||
setEncounterRewards(scene, { fillRemaining: true });
|
setEncounterRewards(scene, { fillRemaining: true });
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
@ -235,12 +235,12 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withPrimaryPokemonRequirement(new MoveRequirement(CHARMING_MOVES)) // Will set option3PrimaryName and option3PrimaryMove dialogue tokens automatically
|
.withPrimaryPokemonRequirement(new MoveRequirement(CHARMING_MOVES)) // Will set option3PrimaryName and option3PrimaryMove dialogue tokens automatically
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.3.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.3.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -271,11 +271,11 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
await transitionMysteryEncounterIntroVisuals(scene, false, false);
|
await transitionMysteryEncounterIntroVisuals(scene, false, false);
|
||||||
|
|
||||||
// Give money and do dialogue
|
// Give money and do dialogue
|
||||||
await showEncounterDialogue(scene, `${namespace}.job_complete_good`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:job_complete_good`, `${namespace}:speaker`);
|
||||||
const moneyChange = scene.getWaveMoneyAmount(2.5);
|
const moneyChange = scene.getWaveMoneyAmount(2.5);
|
||||||
updatePlayerMoney(scene, moneyChange, true, false);
|
updatePlayerMoney(scene, moneyChange, true, false);
|
||||||
await showEncounterText(scene, i18next.t("mysteryEncounterMessages:receive_money", { amount: moneyChange }));
|
await showEncounterText(scene, i18next.t("mysteryEncounterMessages:receive_money", { amount: moneyChange }));
|
||||||
await showEncounterText(scene, `${namespace}.pokemon_tired`);
|
await showEncounterText(scene, `${namespace}:pokemon_tired`);
|
||||||
|
|
||||||
setEncounterRewards(scene, { fillRemaining: true });
|
setEncounterRewards(scene, { fillRemaining: true });
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
@ -284,8 +284,8 @@ export const PartTimerEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withOutroDialogue([
|
.withOutroDialogue([
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.build();
|
.build();
|
||||||
|
@ -21,7 +21,7 @@ import { SummonPhase } from "#app/phases/summon-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:safariZone";
|
const namespace = "mysteryEncounters/safariZone";
|
||||||
|
|
||||||
const TRAINER_THROW_ANIMATION_TIMES = [512, 184, 768];
|
const TRAINER_THROW_ANIMATION_TIMES = [512, 184, 768];
|
||||||
|
|
||||||
@ -49,21 +49,21 @@ export const SafariZoneEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(MysteryEncounterOptionBuilder
|
.withOption(MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withSceneRequirement(new MoneyRequirement(0, SAFARI_MONEY_MULTIPLIER)) // Cost equal to 1 Max Revive
|
.withSceneRequirement(new MoneyRequirement(0, SAFARI_MONEY_MULTIPLIER)) // Cost equal to 1 Max Revive
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -92,11 +92,11 @@ export const SafariZoneEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -127,11 +127,11 @@ const safariZoneGameOptions: MysteryEncounterOption[] = [
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.safari.1.label`,
|
buttonLabel: `${namespace}:safari.1.label`,
|
||||||
buttonTooltip: `${namespace}.safari.1.tooltip`,
|
buttonTooltip: `${namespace}:safari.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.safari.1.selected`,
|
text: `${namespace}:safari.1.selected`,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -162,11 +162,11 @@ const safariZoneGameOptions: MysteryEncounterOption[] = [
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.safari.2.label`,
|
buttonLabel: `${namespace}:safari.2.label`,
|
||||||
buttonTooltip: `${namespace}.safari.2.tooltip`,
|
buttonTooltip: `${namespace}:safari.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.safari.2.selected`,
|
text: `${namespace}:safari.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -180,9 +180,9 @@ const safariZoneGameOptions: MysteryEncounterOption[] = [
|
|||||||
// 80% chance to increase flee stage +1
|
// 80% chance to increase flee stage +1
|
||||||
const fleeChangeResult = tryChangeFleeStage(scene, 1, 8);
|
const fleeChangeResult = tryChangeFleeStage(scene, 1, 8);
|
||||||
if (!fleeChangeResult) {
|
if (!fleeChangeResult) {
|
||||||
await showEncounterText(scene, getEncounterText(scene, `${namespace}.safari.busy_eating`) ?? "", null, 1000, false );
|
await showEncounterText(scene, getEncounterText(scene, `${namespace}:safari.busy_eating`) ?? "", null, 1000, false );
|
||||||
} else {
|
} else {
|
||||||
await showEncounterText(scene, getEncounterText(scene, `${namespace}.safari.eating`) ?? "", null, 1000, false);
|
await showEncounterText(scene, getEncounterText(scene, `${namespace}:safari.eating`) ?? "", null, 1000, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
await doEndTurn(scene, 1);
|
await doEndTurn(scene, 1);
|
||||||
@ -192,11 +192,11 @@ const safariZoneGameOptions: MysteryEncounterOption[] = [
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.safari.3.label`,
|
buttonLabel: `${namespace}:safari.3.label`,
|
||||||
buttonTooltip: `${namespace}.safari.3.tooltip`,
|
buttonTooltip: `${namespace}:safari.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.safari.3.selected`,
|
text: `${namespace}:safari.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -209,9 +209,9 @@ const safariZoneGameOptions: MysteryEncounterOption[] = [
|
|||||||
// 80% chance to decrease catch stage -1
|
// 80% chance to decrease catch stage -1
|
||||||
const catchChangeResult = tryChangeCatchStage(scene, -1, 8);
|
const catchChangeResult = tryChangeCatchStage(scene, -1, 8);
|
||||||
if (!catchChangeResult) {
|
if (!catchChangeResult) {
|
||||||
await showEncounterText(scene, getEncounterText(scene, `${namespace}.safari.beside_itself_angry`) ?? "", null, 1000, false );
|
await showEncounterText(scene, getEncounterText(scene, `${namespace}:safari.beside_itself_angry`) ?? "", null, 1000, false );
|
||||||
} else {
|
} else {
|
||||||
await showEncounterText(scene, getEncounterText(scene, `${namespace}.safari.angry`) ?? "", null, 1000, false );
|
await showEncounterText(scene, getEncounterText(scene, `${namespace}:safari.angry`) ?? "", null, 1000, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
await doEndTurn(scene, 2);
|
await doEndTurn(scene, 2);
|
||||||
@ -221,8 +221,8 @@ const safariZoneGameOptions: MysteryEncounterOption[] = [
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.safari.4.label`,
|
buttonLabel: `${namespace}:safari.4.label`,
|
||||||
buttonTooltip: `${namespace}.safari.4.tooltip`,
|
buttonTooltip: `${namespace}:safari.4.tooltip`,
|
||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Flee option
|
// Flee option
|
||||||
@ -247,7 +247,7 @@ async function summonSafariPokemon(scene: BattleScene) {
|
|||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
// Message pokemon remaining
|
// Message pokemon remaining
|
||||||
encounter.setDialogueToken("remainingCount", encounter.misc.safariPokemonRemaining);
|
encounter.setDialogueToken("remainingCount", encounter.misc.safariPokemonRemaining);
|
||||||
scene.queueMessage(getEncounterText(scene, `${namespace}.safari.remaining_count`) ?? "", null, true);
|
scene.queueMessage(getEncounterText(scene, `${namespace}:safari.remaining_count`) ?? "", null, true);
|
||||||
|
|
||||||
// Generate pokemon using safariPokemonRemaining so they are always the same pokemon no matter how many turns are taken
|
// Generate pokemon using safariPokemonRemaining so they are always the same pokemon no matter how many turns are taken
|
||||||
// Safari pokemon roll twice on shiny and HA chances, but are otherwise normal
|
// Safari pokemon roll twice on shiny and HA chances, but are otherwise normal
|
||||||
@ -512,7 +512,7 @@ async function doEndTurn(scene: BattleScene, cursorIndex: number) {
|
|||||||
leaveEncounterWithoutBattle(scene, true);
|
leaveEncounterWithoutBattle(scene, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scene.queueMessage(getEncounterText(scene, `${namespace}.safari.watching`) ?? "", 0, null, 1000);
|
scene.queueMessage(getEncounterText(scene, `${namespace}:safari.watching`) ?? "", 0, null, 1000);
|
||||||
initSubsequentOptionSelect(scene, { overrideOptions: safariZoneGameOptions, startingCursorIndex: cursorIndex, hideDescription: true });
|
initSubsequentOptionSelect(scene, { overrideOptions: safariZoneGameOptions, startingCursorIndex: cursorIndex, hideDescription: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ import { getNatureName } from "#app/data/nature";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:shadyVitaminDealer";
|
const namespace = "mysteryEncounters/shadyVitaminDealer";
|
||||||
|
|
||||||
const VITAMIN_DEALER_CHEAP_PRICE_MULTIPLIER = 1.5;
|
const VITAMIN_DEALER_CHEAP_PRICE_MULTIPLIER = 1.5;
|
||||||
const VITAMIN_DEALER_EXPENSIVE_PRICE_MULTIPLIER = 3.5;
|
const VITAMIN_DEALER_EXPENSIVE_PRICE_MULTIPLIER = 3.5;
|
||||||
@ -54,26 +54,26 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withSceneMoneyRequirement(0, VITAMIN_DEALER_CHEAP_PRICE_MULTIPLIER)
|
.withSceneMoneyRequirement(0, VITAMIN_DEALER_CHEAP_PRICE_MULTIPLIER)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -100,7 +100,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
// If pokemon meets primary pokemon reqs, it can be selected
|
// If pokemon meets primary pokemon reqs, it can be selected
|
||||||
const meetsReqs = encounter.pokemonMeetsPrimaryRequirements(scene, pokemon);
|
const meetsReqs = encounter.pokemonMeetsPrimaryRequirements(scene, pokemon);
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -136,7 +136,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
chosenPokemon.nature = newNature;
|
chosenPokemon.nature = newNature;
|
||||||
encounter.setDialogueToken("newNature", getNatureName(newNature));
|
encounter.setDialogueToken("newNature", getNatureName(newNature));
|
||||||
queueEncounterMessage(scene, `${namespace}.cheap_side_effects`);
|
queueEncounterMessage(scene, `${namespace}:cheap_side_effects`);
|
||||||
setEncounterExp(scene, [chosenPokemon.id], 100);
|
setEncounterExp(scene, [chosenPokemon.id], 100);
|
||||||
chosenPokemon.updateInfo();
|
chosenPokemon.updateInfo();
|
||||||
})
|
})
|
||||||
@ -147,11 +147,11 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withSceneMoneyRequirement(0, VITAMIN_DEALER_EXPENSIVE_PRICE_MULTIPLIER)
|
.withSceneMoneyRequirement(0, VITAMIN_DEALER_EXPENSIVE_PRICE_MULTIPLIER)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -178,7 +178,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
// If pokemon is unfainted it can be selected
|
// If pokemon is unfainted it can be selected
|
||||||
const meetsReqs = !pokemon.isFainted(true);
|
const meetsReqs = !pokemon.isFainted(true);
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -203,7 +203,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
const chosenPokemon = encounter.misc.chosenPokemon;
|
const chosenPokemon = encounter.misc.chosenPokemon;
|
||||||
|
|
||||||
queueEncounterMessage(scene, `${namespace}.no_bad_effects`);
|
queueEncounterMessage(scene, `${namespace}:no_bad_effects`);
|
||||||
setEncounterExp(scene, [chosenPokemon.id], 100);
|
setEncounterExp(scene, [chosenPokemon.id], 100);
|
||||||
|
|
||||||
chosenPokemon.updateInfo();
|
chosenPokemon.updateInfo();
|
||||||
@ -212,12 +212,12 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
speaker: `${namespace}.speaker`
|
speaker: `${namespace}:speaker`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@ import { BerryType } from "#enums/berry-type";
|
|||||||
import { MysteryEncounterPokemonData } from "#app/data/mystery-encounters/mystery-encounter-pokemon-data";
|
import { MysteryEncounterPokemonData } from "#app/data/mystery-encounters/mystery-encounter-pokemon-data";
|
||||||
|
|
||||||
/** i18n namespace for the encounter */
|
/** i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:slumberingSnorlax";
|
const namespace = "mysteryEncounters/slumberingSnorlax";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sleeping Snorlax encounter.
|
* Sleeping Snorlax encounter.
|
||||||
@ -47,7 +47,7 @@ export const SlumberingSnorlaxEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -87,16 +87,16 @@ export const SlumberingSnorlaxEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -122,11 +122,11 @@ export const SlumberingSnorlaxEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -134,7 +134,7 @@ export const SlumberingSnorlaxEncounter: MysteryEncounter =
|
|||||||
// Fall asleep waiting for Snorlax
|
// Fall asleep waiting for Snorlax
|
||||||
// Full heal party
|
// Full heal party
|
||||||
scene.unshiftPhase(new PartyHealPhase(scene, true));
|
scene.unshiftPhase(new PartyHealPhase(scene, true));
|
||||||
queueEncounterMessage(scene, `${namespace}.option.2.rest_result`);
|
queueEncounterMessage(scene, `${namespace}:option.2.rest_result`);
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -143,12 +143,12 @@ export const SlumberingSnorlaxEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES))
|
.withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES))
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.3.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.3.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`
|
text: `${namespace}:option.3.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -23,7 +23,7 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
|||||||
import { getEncounterPokemonLevelForWave, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { getEncounterPokemonLevelForWave, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:teleportingHijinks";
|
const namespace = "mysteryEncounters/teleportingHijinks";
|
||||||
|
|
||||||
const MONEY_COST_MULTIPLIER = 1.75;
|
const MONEY_COST_MULTIPLIER = 1.75;
|
||||||
const BIOME_CANDIDATES = [Biome.SPACE, Biome.FAIRY_CAVE, Biome.LABORATORY, Biome.ISLAND, Biome.WASTELAND, Biome.DOJO];
|
const BIOME_CANDIDATES = [Biome.SPACE, Biome.FAIRY_CAVE, Biome.LABORATORY, Biome.ISLAND, Biome.WASTELAND, Biome.DOJO];
|
||||||
@ -54,12 +54,12 @@ export const TeleportingHijinksEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
const price = scene.getWaveMoneyAmount(MONEY_COST_MULTIPLIER);
|
const price = scene.getWaveMoneyAmount(MONEY_COST_MULTIPLIER);
|
||||||
@ -75,11 +75,11 @@ export const TeleportingHijinksEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT)
|
||||||
.withSceneMoneyRequirement(undefined, MONEY_COST_MULTIPLIER) // Must be able to pay teleport cost
|
.withSceneMoneyRequirement(undefined, MONEY_COST_MULTIPLIER) // Must be able to pay teleport cost
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -99,12 +99,12 @@ export const TeleportingHijinksEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withPokemonTypeRequirement(MACHINE_INTERFACING_TYPES, true, 1) // Must have Steel or Electric type
|
.withPokemonTypeRequirement(MACHINE_INTERFACING_TYPES, true, 1) // Must have Steel or Electric type
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.2.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.2.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -118,11 +118,11 @@ export const TeleportingHijinksEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`,
|
text: `${namespace}:option.3.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -161,10 +161,10 @@ async function doBiomeTransitionDialogueAndBattleInit(scene: BattleScene) {
|
|||||||
const newBiome = filteredBiomes[randSeedInt(filteredBiomes.length)];
|
const newBiome = filteredBiomes[randSeedInt(filteredBiomes.length)];
|
||||||
|
|
||||||
// Show dialogue and transition biome
|
// Show dialogue and transition biome
|
||||||
await showEncounterText(scene, `${namespace}.transport`);
|
await showEncounterText(scene, `${namespace}:transport`);
|
||||||
await Promise.all([animateBiomeChange(scene, newBiome), transitionMysteryEncounterIntroVisuals(scene)]);
|
await Promise.all([animateBiomeChange(scene, newBiome), transitionMysteryEncounterIntroVisuals(scene)]);
|
||||||
scene.playBgm();
|
scene.playBgm();
|
||||||
await showEncounterText(scene, `${namespace}.attacked`);
|
await showEncounterText(scene, `${namespace}:attacked`);
|
||||||
|
|
||||||
// Init enemy
|
// Init enemy
|
||||||
const level = getEncounterPokemonLevelForWave(scene, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER);
|
const level = getEncounterPokemonLevelForWave(scene, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER);
|
||||||
@ -179,7 +179,7 @@ async function doBiomeTransitionDialogueAndBattleInit(scene: BattleScene) {
|
|||||||
isBoss: true,
|
isBoss: true,
|
||||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.boss_enraged`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:boss_enraged`);
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
@ -18,7 +18,7 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
|||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:pokemonSalesman";
|
const namespace = "mysteryEncounters/pokemonSalesman";
|
||||||
|
|
||||||
const MAX_POKEMON_PRICE_MULTIPLIER = 4;
|
const MAX_POKEMON_PRICE_MULTIPLIER = 4;
|
||||||
|
|
||||||
@ -45,16 +45,16 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -94,8 +94,8 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter =
|
|||||||
// Always max price for shiny (flip HA back to normal), and add special messaging
|
// Always max price for shiny (flip HA back to normal), and add special messaging
|
||||||
priceMultiplier = MAX_POKEMON_PRICE_MULTIPLIER;
|
priceMultiplier = MAX_POKEMON_PRICE_MULTIPLIER;
|
||||||
pokemon.abilityIndex = 0;
|
pokemon.abilityIndex = 0;
|
||||||
encounter.dialogue.encounterOptionsDialogue!.description = `${namespace}.description_shiny`;
|
encounter.dialogue.encounterOptionsDialogue!.description = `${namespace}:description_shiny`;
|
||||||
encounter.options[0].dialogue!.buttonTooltip = `${namespace}.option.1.tooltip_shiny`;
|
encounter.options[0].dialogue!.buttonTooltip = `${namespace}:option.1.tooltip_shiny`;
|
||||||
}
|
}
|
||||||
const price = scene.getWaveMoneyAmount(priceMultiplier);
|
const price = scene.getWaveMoneyAmount(priceMultiplier);
|
||||||
encounter.setDialogueToken("purchasePokemon", pokemon.getNameToRender());
|
encounter.setDialogueToken("purchasePokemon", pokemon.getNameToRender());
|
||||||
@ -115,11 +115,11 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter =
|
|||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withSceneMoneyRequirement(undefined, MAX_POKEMON_PRICE_MULTIPLIER) // Wave scaling money multiplier of 2
|
.withSceneMoneyRequirement(undefined, MAX_POKEMON_PRICE_MULTIPLIER) // Wave scaling money multiplier of 2
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected_message`,
|
text: `${namespace}:option.1.selected_message`,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -132,7 +132,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter =
|
|||||||
updatePlayerMoney(scene, -price, true, false);
|
updatePlayerMoney(scene, -price, true, false);
|
||||||
|
|
||||||
// Show dialogue
|
// Show dialogue
|
||||||
await showEncounterDialogue(scene, `${namespace}.option.1.selected_dialogue`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:option.1.selected_dialogue`, `${namespace}:speaker`);
|
||||||
await transitionMysteryEncounterIntroVisuals(scene);
|
await transitionMysteryEncounterIntroVisuals(scene);
|
||||||
|
|
||||||
// "Catch" purchased pokemon
|
// "Catch" purchased pokemon
|
||||||
@ -146,11 +146,11 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@ import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:theStrongStuff";
|
const namespace = "mysteryEncounters/theStrongStuff";
|
||||||
|
|
||||||
// Halved for HP stat
|
// Halved for HP stat
|
||||||
const HIGH_BST_REDUCTION_VALUE = 15;
|
const HIGH_BST_REDUCTION_VALUE = 15;
|
||||||
@ -63,7 +63,7 @@ export const TheStrongStuffEncounter: MysteryEncounter =
|
|||||||
]) // Set in onInit()
|
]) // Set in onInit()
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -101,7 +101,7 @@ export const TheStrongStuffEncounter: MysteryEncounter =
|
|||||||
],
|
],
|
||||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.option.2.stat_boost`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:option.2.stat_boost`);
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.DEF, Stat.SPDEF], 2));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.DEF, Stat.SPDEF], 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,16 +116,16 @@ export const TheStrongStuffEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`
|
text: `${namespace}:option.1.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -158,11 +158,11 @@ export const TheStrongStuffEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
encounter.setDialogueToken("reductionValue", HIGH_BST_REDUCTION_VALUE.toString());
|
encounter.setDialogueToken("reductionValue", HIGH_BST_REDUCTION_VALUE.toString());
|
||||||
encounter.setDialogueToken("increaseValue", BST_INCREASE_VALUE.toString());
|
encounter.setDialogueToken("increaseValue", BST_INCREASE_VALUE.toString());
|
||||||
await showEncounterText(scene, `${namespace}.option.1.selected_2`, null, undefined, true);
|
await showEncounterText(scene, `${namespace}:option.1.selected_2`, null, undefined, true);
|
||||||
|
|
||||||
encounter.dialogue.outro = [
|
encounter.dialogue.outro = [
|
||||||
{
|
{
|
||||||
text: `${namespace}.outro`,
|
text: `${namespace}:outro`,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
setEncounterRewards(scene, { fillRemaining: true });
|
setEncounterRewards(scene, { fillRemaining: true });
|
||||||
@ -172,11 +172,11 @@ export const TheStrongStuffEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:theWinstrateChallenge";
|
const namespace = "mysteryEncounters/theWinstrateChallenge";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Winstrate Challenge encounter.
|
* The Winstrate Challenge encounter.
|
||||||
@ -74,11 +74,11 @@ export const TheWinstrateChallengeEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
@ -94,17 +94,17 @@ export const TheWinstrateChallengeEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -119,12 +119,12 @@ export const TheWinstrateChallengeEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -142,7 +142,7 @@ async function spawnNextTrainerOrEndEncounter(scene: BattleScene) {
|
|||||||
const nextConfig = encounter.enemyPartyConfigs.pop();
|
const nextConfig = encounter.enemyPartyConfigs.pop();
|
||||||
if (!nextConfig) {
|
if (!nextConfig) {
|
||||||
await transitionMysteryEncounterIntroVisuals(scene, false, false);
|
await transitionMysteryEncounterIntroVisuals(scene, false, false);
|
||||||
await showEncounterDialogue(scene, `${namespace}.victory`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:victory`, `${namespace}:speaker`);
|
||||||
|
|
||||||
// Give 10x Voucher
|
// Give 10x Voucher
|
||||||
const newModifier = modifierTypes.VOUCHER_PREMIUM().newModifier();
|
const newModifier = modifierTypes.VOUCHER_PREMIUM().newModifier();
|
||||||
@ -150,7 +150,7 @@ async function spawnNextTrainerOrEndEncounter(scene: BattleScene) {
|
|||||||
scene.playSound("item_fanfare");
|
scene.playSound("item_fanfare");
|
||||||
await showEncounterText(scene, i18next.t("battle:rewardGain", { modifierName: newModifier?.type.name }));
|
await showEncounterText(scene, i18next.t("battle:rewardGain", { modifierName: newModifier?.type.name }));
|
||||||
|
|
||||||
await showEncounterDialogue(scene, `${namespace}.victory_2`, `${namespace}.speaker`);
|
await showEncounterDialogue(scene, `${namespace}:victory_2`, `${namespace}:speaker`);
|
||||||
scene.ui.clearText(); // Clears "Winstrate" title from screen as rewards get animated in
|
scene.ui.clearText(); // Clears "Winstrate" title from screen as rewards get animated in
|
||||||
const machoBrace = generateModifierTypeOption(scene, modifierTypes.MYSTERY_ENCOUNTER_MACHO_BRACE)!;
|
const machoBrace = generateModifierTypeOption(scene, modifierTypes.MYSTERY_ENCOUNTER_MACHO_BRACE)!;
|
||||||
machoBrace.type.tier = ModifierTier.MASTER;
|
machoBrace.type.tier = ModifierTier.MASTER;
|
||||||
|
@ -22,7 +22,7 @@ import { getStatKey } from "#enums/stat";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** The i18n namespace for the encounter */
|
/** The i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:trainingSession";
|
const namespace = "mysteryEncounters/trainingSession";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Training Session encounter.
|
* Training Session encounter.
|
||||||
@ -48,22 +48,22 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOption(
|
.withOption(
|
||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -79,7 +79,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
const selectableFilter = (pokemon: Pokemon) => {
|
const selectableFilter = (pokemon: Pokemon) => {
|
||||||
const meetsReqs = pokemon.isAllowedInBattle();
|
const meetsReqs = pokemon.isAllowedInBattle();
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -163,7 +163,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
scene.addModifier(mod, true, false, false, true);
|
scene.addModifier(mod, true, false, false, true);
|
||||||
}
|
}
|
||||||
scene.updateModifiers(true);
|
scene.updateModifiers(true);
|
||||||
queueEncounterMessage(scene, `${namespace}.option.1.finished`);
|
queueEncounterMessage(scene, `${namespace}:option.1.finished`);
|
||||||
};
|
};
|
||||||
|
|
||||||
setEncounterRewards(scene, { fillRemaining: true }, undefined, onBeforeRewardsPhase);
|
setEncounterRewards(scene, { fillRemaining: true }, undefined, onBeforeRewardsPhase);
|
||||||
@ -177,12 +177,12 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.2.select_prompt`,
|
secondOptionPrompt: `${namespace}:option.2.select_prompt`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -213,7 +213,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
const selectableFilter = (pokemon: Pokemon) => {
|
const selectableFilter = (pokemon: Pokemon) => {
|
||||||
const meetsReqs = pokemon.isAllowedInBattle();
|
const meetsReqs = pokemon.isAllowedInBattle();
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -233,7 +233,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
scene.removePokemonFromPlayerParty(playerPokemon, false);
|
scene.removePokemonFromPlayerParty(playerPokemon, false);
|
||||||
|
|
||||||
const onBeforeRewardsPhase = () => {
|
const onBeforeRewardsPhase = () => {
|
||||||
queueEncounterMessage(scene, `${namespace}.option.2.finished`);
|
queueEncounterMessage(scene, `${namespace}:option.2.finished`);
|
||||||
// Add the pokemon back to party with Nature change
|
// Add the pokemon back to party with Nature change
|
||||||
playerPokemon.setNature(encounter.misc.chosenNature);
|
playerPokemon.setNature(encounter.misc.chosenNature);
|
||||||
scene.gameData.setPokemonCaught(playerPokemon, false);
|
scene.gameData.setPokemonCaught(playerPokemon, false);
|
||||||
@ -258,12 +258,12 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
secondOptionPrompt: `${namespace}.option.3.select_prompt`,
|
secondOptionPrompt: `${namespace}:option.3.select_prompt`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -309,7 +309,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
const selectableFilter = (pokemon: Pokemon) => {
|
const selectableFilter = (pokemon: Pokemon) => {
|
||||||
const meetsReqs = pokemon.isAllowedInBattle();
|
const meetsReqs = pokemon.isAllowedInBattle();
|
||||||
if (!meetsReqs) {
|
if (!meetsReqs) {
|
||||||
return getEncounterText(scene, `${namespace}.invalid_selection`) ?? null;
|
return getEncounterText(scene, `${namespace}:invalid_selection`) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -333,7 +333,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
scene.removePokemonFromPlayerParty(playerPokemon, false);
|
scene.removePokemonFromPlayerParty(playerPokemon, false);
|
||||||
|
|
||||||
const onBeforeRewardsPhase = () => {
|
const onBeforeRewardsPhase = () => {
|
||||||
queueEncounterMessage(scene, `${namespace}.option.3.finished`);
|
queueEncounterMessage(scene, `${namespace}:option.3.finished`);
|
||||||
// Add the pokemon back to party with ability change
|
// Add the pokemon back to party with ability change
|
||||||
const abilityIndex = encounter.misc.abilityIndex;
|
const abilityIndex = encounter.misc.abilityIndex;
|
||||||
if (!!playerPokemon.getFusionSpeciesForm()) {
|
if (!!playerPokemon.getFusionSpeciesForm()) {
|
||||||
@ -380,11 +380,11 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.4.label`,
|
buttonLabel: `${namespace}:option.4.label`,
|
||||||
buttonTooltip: `${namespace}.option.4.tooltip`,
|
buttonTooltip: `${namespace}:option.4.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.4.selected`,
|
text: `${namespace}:option.4.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@ import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for this encounter */
|
/** the i18n namespace for this encounter */
|
||||||
const namespace = "mysteryEncounter:trashToTreasure";
|
const namespace = "mysteryEncounters/trashToTreasure";
|
||||||
|
|
||||||
const SOUND_EFFECT_WAIT_TIME = 700;
|
const SOUND_EFFECT_WAIT_TIME = 700;
|
||||||
|
|
||||||
@ -48,12 +48,12 @@ export const TrashToTreasureEncounter: MysteryEncounter =
|
|||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
@ -85,11 +85,11 @@ export const TrashToTreasureEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -112,18 +112,18 @@ export const TrashToTreasureEncounter: MysteryEncounter =
|
|||||||
MysteryEncounterOptionBuilder
|
MysteryEncounterOptionBuilder
|
||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Investigate garbage, battle Gmax Garbodor
|
// Investigate garbage, battle Gmax Garbodor
|
||||||
scene.setFieldScale(0.75);
|
scene.setFieldScale(0.75);
|
||||||
await showEncounterText(scene, `${namespace}.option.2.selected_2`);
|
await showEncounterText(scene, `${namespace}:option.2.selected_2`);
|
||||||
transitionMysteryEncounterIntroVisuals(scene);
|
transitionMysteryEncounterIntroVisuals(scene);
|
||||||
|
|
||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
@ -26,7 +26,7 @@ import { Stat } from "#enums/stat";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounter:uncommonBreed";
|
const namespace = "mysteryEncounters/uncommonBreed";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uncommon Breed encounter.
|
* Uncommon Breed encounter.
|
||||||
@ -42,7 +42,7 @@ export const UncommonBreedEncounter: MysteryEncounter =
|
|||||||
.withIntroSpriteConfigs([]) // Set in onInit()
|
.withIntroSpriteConfigs([]) // Set in onInit()
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
@ -80,7 +80,7 @@ export const UncommonBreedEncounter: MysteryEncounter =
|
|||||||
isBoss: false,
|
isBoss: false,
|
||||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||||
queueEncounterMessage(pokemon.scene, `${namespace}.option.1.stat_boost`);
|
queueEncounterMessage(pokemon.scene, `${namespace}:option.1.stat_boost`);
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD], 1));
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
@ -120,16 +120,16 @@ export const UncommonBreedEncounter: MysteryEncounter =
|
|||||||
scene.time.delayedCall(500, () => scene.playSound("battle_anims/PRSFX- Spotlight2"));
|
scene.time.delayedCall(500, () => scene.playSound("battle_anims/PRSFX- Spotlight2"));
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -162,12 +162,12 @@ export const UncommonBreedEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withSceneRequirement(new PersistentModifierRequirement("BerryModifier", 4)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
.withSceneRequirement(new PersistentModifierRequirement("BerryModifier", 4)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.2.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.2.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`
|
text: `${namespace}:option.2.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -219,12 +219,12 @@ export const UncommonBreedEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
.newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_SPECIAL)
|
||||||
.withPrimaryPokemonRequirement(new MoveRequirement(CHARMING_MOVES)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
.withPrimaryPokemonRequirement(new MoveRequirement(CHARMING_MOVES)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.3.label`,
|
buttonLabel: `${namespace}:option.3.label`,
|
||||||
buttonTooltip: `${namespace}.option.3.tooltip`,
|
buttonTooltip: `${namespace}:option.3.tooltip`,
|
||||||
disabledButtonTooltip: `${namespace}.option.3.disabled_tooltip`,
|
disabledButtonTooltip: `${namespace}:option.3.disabled_tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.3.selected`
|
text: `${namespace}:option.3.selected`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -23,7 +23,7 @@ import { Stat } from "#enums/stat";
|
|||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES, GameModes } from "#app/game-mode";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES, GameModes } from "#app/game-mode";
|
||||||
|
|
||||||
/** i18n namespace for encounter */
|
/** i18n namespace for encounter */
|
||||||
const namespace = "mysteryEncounter:weirdDream";
|
const namespace = "mysteryEncounters/weirdDream";
|
||||||
|
|
||||||
/** Exclude Ultra Beasts, Paradox, Eternatus, and all legendary/mythical/trio pokemon that are below 570 BST */
|
/** Exclude Ultra Beasts, Paradox, Eternatus, and all legendary/mythical/trio pokemon that are below 570 BST */
|
||||||
const EXCLUDED_TRANSFORMATION_SPECIES = [
|
const EXCLUDED_TRANSFORMATION_SPECIES = [
|
||||||
@ -115,16 +115,16 @@ export const WeirdDreamEncounter: MysteryEncounter =
|
|||||||
])
|
])
|
||||||
.withIntroDialogue([
|
.withIntroDialogue([
|
||||||
{
|
{
|
||||||
text: `${namespace}.intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: `${namespace}.speaker`,
|
speaker: `${namespace}:speaker`,
|
||||||
text: `${namespace}.intro_dialogue`,
|
text: `${namespace}:intro_dialogue`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.withTitle(`${namespace}.title`)
|
.withTitle(`${namespace}:title`)
|
||||||
.withDescription(`${namespace}.description`)
|
.withDescription(`${namespace}:description`)
|
||||||
.withQuery(`${namespace}.query`)
|
.withQuery(`${namespace}:query`)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
scene.loadBgm("mystery_encounter_weird_dream", "mystery_encounter_weird_dream.mp3");
|
scene.loadBgm("mystery_encounter_weird_dream", "mystery_encounter_weird_dream.mp3");
|
||||||
return true;
|
return true;
|
||||||
@ -138,11 +138,11 @@ export const WeirdDreamEncounter: MysteryEncounter =
|
|||||||
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
.newOptionWithMode(MysteryEncounterOptionMode.DEFAULT)
|
||||||
.withHasDexProgress(true)
|
.withHasDexProgress(true)
|
||||||
.withDialogue({
|
.withDialogue({
|
||||||
buttonLabel: `${namespace}.option.1.label`,
|
buttonLabel: `${namespace}:option.1.label`,
|
||||||
buttonTooltip: `${namespace}.option.1.tooltip`,
|
buttonTooltip: `${namespace}:option.1.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.1.selected`,
|
text: `${namespace}:option.1.selected`,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -162,7 +162,7 @@ export const WeirdDreamEncounter: MysteryEncounter =
|
|||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Starts cutscene dialogue, but does not await so that cutscene plays as player goes through dialogue
|
// Starts cutscene dialogue, but does not await so that cutscene plays as player goes through dialogue
|
||||||
const cutsceneDialoguePromise = showEncounterText(scene, `${namespace}.option.1.cutscene`);
|
const cutsceneDialoguePromise = showEncounterText(scene, `${namespace}:option.1.cutscene`);
|
||||||
|
|
||||||
// Change the entire player's party
|
// Change the entire player's party
|
||||||
// Wait for all new Pokemon assets to be loaded before showing transformation animations
|
// Wait for all new Pokemon assets to be loaded before showing transformation animations
|
||||||
@ -186,7 +186,7 @@ export const WeirdDreamEncounter: MysteryEncounter =
|
|||||||
await cutsceneDialoguePromise;
|
await cutsceneDialoguePromise;
|
||||||
|
|
||||||
doHideDreamBackground(scene);
|
doHideDreamBackground(scene);
|
||||||
await showEncounterText(scene, `${namespace}.option.1.dream_complete`);
|
await showEncounterText(scene, `${namespace}:option.1.dream_complete`);
|
||||||
|
|
||||||
await doNewTeamPostProcess(scene, transformations);
|
await doNewTeamPostProcess(scene, transformations);
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.MEMORY_MUSHROOM, modifierTypes.ROGUE_BALL, modifierTypes.MINT, modifierTypes.MINT]});
|
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.MEMORY_MUSHROOM, modifierTypes.ROGUE_BALL, modifierTypes.MINT, modifierTypes.MINT]});
|
||||||
@ -196,11 +196,11 @@ export const WeirdDreamEncounter: MysteryEncounter =
|
|||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
{
|
{
|
||||||
buttonLabel: `${namespace}.option.2.label`,
|
buttonLabel: `${namespace}:option.2.label`,
|
||||||
buttonTooltip: `${namespace}.option.2.tooltip`,
|
buttonTooltip: `${namespace}:option.2.tooltip`,
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
text: `${namespace}.option.2.selected`,
|
text: `${namespace}:option.2.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { camelCaseToKebabCase, } from "#app/utils";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import LanguageDetector from "i18next-browser-languagedetector";
|
import LanguageDetector from "i18next-browser-languagedetector";
|
||||||
import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor";
|
|
||||||
import HttpBackend from "i18next-http-backend";
|
import HttpBackend from "i18next-http-backend";
|
||||||
import { camelCaseToKebabCase } from "#app/utils";
|
import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor";
|
||||||
import pkg from "../../package.json";
|
import pkg from "../../package.json";
|
||||||
|
|
||||||
//#region Interfaces/Types
|
//#region Interfaces/Types
|
||||||
@ -143,11 +143,10 @@ export async function initI18n(): Promise<void> {
|
|||||||
let fileName: string;
|
let fileName: string;
|
||||||
if (namespaceMap[ns]) {
|
if (namespaceMap[ns]) {
|
||||||
fileName = namespaceMap[ns];
|
fileName = namespaceMap[ns];
|
||||||
|
} else if (ns.startsWith("mysteryEncounters/")) {
|
||||||
|
fileName = camelCaseToKebabCase(ns + "Dialogue");
|
||||||
} else {
|
} else {
|
||||||
fileName = camelCaseToKebabCase(ns);
|
fileName = camelCaseToKebabCase(ns);
|
||||||
if (fileName.startsWith("mystery-encounters/")) {
|
|
||||||
fileName += "-dialogue";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return `/locales/${lng}/${fileName}.json?v=${pkg.version}`;
|
return `/locales/${lng}/${fileName}.json?v=${pkg.version}`;
|
||||||
},
|
},
|
||||||
@ -209,8 +208,6 @@ export async function initI18n(): Promise<void> {
|
|||||||
"modifierSelectUiHandler",
|
"modifierSelectUiHandler",
|
||||||
"moveTriggers",
|
"moveTriggers",
|
||||||
"runHistory",
|
"runHistory",
|
||||||
// DO NOT REMOVE
|
|
||||||
// "mysteryEncounter/unit_test_dialogue": "{{test}}{{test}} {{test{{test}}}} {{test1}} {{test\}} {{test\\}} {{test\\\}} {test}}",
|
|
||||||
"mysteryEncounters/mysteriousChallengers",
|
"mysteryEncounters/mysteriousChallengers",
|
||||||
"mysteryEncounters/mysteriousChest",
|
"mysteryEncounters/mysteriousChest",
|
||||||
"mysteryEncounters/darkDeal",
|
"mysteryEncounters/darkDeal",
|
||||||
|
Loading…
Reference in New Issue
Block a user