lost at sea enc.: add outro. add fainted msgs

This commit is contained in:
Felix Staud 2024-07-17 08:52:43 -07:00
parent beb13c8361
commit cd1bed3ab1
2 changed files with 23 additions and 18 deletions

View File

@ -12,7 +12,7 @@ const OPTION_2_REQUIRED_MOVE = Moves.FLY;
* Can be a number between `0` - `100`. * Can be a number between `0` - `100`.
* The higher the more damage taken (100% = instant KO). * The higher the more damage taken (100% = instant KO).
*/ */
const DAMAGE_PERCENTAGE: number = 25; // 0 - 100 const DAMAGE_PERCENTAGE: number = 25;
/** The i18n namespace for the encounter */ /** The i18n namespace for the encounter */
const namepsace = "mysteryEncounter:lostAtSea"; const namepsace = "mysteryEncounter:lostAtSea";
@ -47,10 +47,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
.withDescription(`${namepsace}:description`) .withDescription(`${namepsace}:description`)
.withQuery(`${namepsace}:query`) .withQuery(`${namepsace}: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.
* Receives EXP similar to defeating a Lapras
*/
new MysteryEncounterOptionBuilder() new MysteryEncounterOptionBuilder()
.withPokemonCanLearnMoveRequirement(OPTION_1_REQUIRED_MOVE) .withPokemonCanLearnMoveRequirement(OPTION_1_REQUIRED_MOVE)
.withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT) .withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT)
@ -69,10 +66,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
.build() .build()
) )
.withOption( .withOption(
/** //Option 2: Use a (non fainted) pokemon that can learn fly to guide you back.
* Option 2: Use a (non fainted) pokemon that can learn fly to guide you back.
* Receives EXP similar to defeating a Lapras
*/
new MysteryEncounterOptionBuilder() new MysteryEncounterOptionBuilder()
.withPokemonCanLearnMoveRequirement(OPTION_2_REQUIRED_MOVE) .withPokemonCanLearnMoveRequirement(OPTION_2_REQUIRED_MOVE)
.withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT) .withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT)
@ -91,9 +85,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
.build() .build()
) )
.withSimpleOption( .withSimpleOption(
/** // Option 3: Wander aimlessly
* Option 3: Wander aimlessly. All pokemons lose {@linkcode DAMAGE_PERCENTAGE}}% of their HP (or KO on 0 HP).
*/
{ {
buttonLabel: `${namepsace}:option:3:label`, buttonLabel: `${namepsace}:option:3:label`,
buttonTooltip: `${namepsace}:option:3:tooltip`, buttonTooltip: `${namepsace}:option:3:tooltip`,
@ -109,13 +101,23 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
allowedPokemon.forEach((pkm) => { allowedPokemon.forEach((pkm) => {
const percentage = DAMAGE_PERCENTAGE / 100; const percentage = DAMAGE_PERCENTAGE / 100;
const damage = Math.floor(pkm.getMaxHp() * percentage); const damage = Math.floor(pkm.getMaxHp() * percentage);
return applyDamageToPokemon(pkm, damage); applyDamageToPokemon(pkm, damage);
if (pkm.isFainted()) {
scene.currentBattle.mysteryEncounter.dialogue.outro.push({
text: `${pkm.name} fainted!`,
});
}
}); });
leaveEncounterWithoutBattle(scene); leaveEncounterWithoutBattle(scene);
return true; return true;
} }
) )
.withOutroDialogue([
{
text: `${namepsace}:outro`,
},
])
.build(); .build();
/** /**

View File

@ -1,8 +1,7 @@
export const lostAtSea = { export const lostAtSea = {
intro: "Wandering aimlessly, you effectively get nowhere.", intro: "Wandering aimlessly, you effectively get nowhere.",
title: "Lost at sea", title: "Lost at sea",
description: description: "The sea is turbulent in this area and you seem to be running out of fuel as well.\nThis is bad. Is there a way out of the situation?",
"The sea is turbulent in this area and you seem to be running out of fuel as well.\nThis is bad. Is there a way out of the situation?",
query: "What will you do?", query: "What will you do?",
option: { option: {
1: { 1: {
@ -10,19 +9,23 @@ export const lostAtSea = {
label_disabled: "Can't {{option1RequiredMove}}", label_disabled: "Can't {{option1RequiredMove}}",
tooltip: "{{option1PrimaryName}} saves you.\n{{option1PrimaryName}} gains some EXP.", tooltip: "{{option1PrimaryName}} saves you.\n{{option1PrimaryName}} gains some EXP.",
tooltip_disabled: "You have no Pokémon to {{option1RequiredMove}} on", tooltip_disabled: "You have no Pokémon to {{option1RequiredMove}} on",
selected: "{{option1PrimaryName}} swims ahead, guiding you back on track.\n{{option1PrimaryName}} seems to also have gotten stronger in this time of need.", selected:
"{{option1PrimaryName}} swims ahead, guiding you back on track.\n{{option1PrimaryName}} seems to also have gotten stronger in this time of need.",
}, },
2: { 2: {
label: "{{option2PrimaryName}} can help", label: "{{option2PrimaryName}} can help",
label_disabled: "Can't {{option2RequiredMove}}", label_disabled: "Can't {{option2RequiredMove}}",
tooltip: "{{option2PrimaryName}} saves you.\n{{option2PrimaryName}} gains some EXP.", tooltip: "{{option2PrimaryName}} saves you.\n{{option2PrimaryName}} gains some EXP.",
tooltip_disabled: "You have no Pokémon to {{option2RequiredMove}} with", tooltip_disabled: "You have no Pokémon to {{option2RequiredMove}} with",
selected: "{{option2PrimaryName}} flies ahead of your boat, guiding you back on track.\n{{option2PrimaryName}} seems to also have gotten stronger in this time of need.", selected:
"{{option2PrimaryName}} flies ahead of your boat, guiding you back on track.\n{{option2PrimaryName}} seems to also have gotten stronger in this time of need.",
}, },
3: { 3: {
label: "Wander aimlessly", label: "Wander aimlessly",
tooltip: "(-) Each of your Pokémon lose {{damagePercentage}}% of their total HP.", tooltip: "(-) Each of your Pokémon lose {{damagePercentage}}% of their total HP.",
selected: "You float about in the boat, steering it aimlessly until you finally get back on track. You and your Pokémon get very fatigued during the whole ordeal", selected: `You float about in the boat, steering it aimlessly until you finally get back on track.
$You and your Pokémon get very fatigued during the whole ordeal`,
}, },
}, },
outro: "You are back on track."
}; };