add absolute avarice encounter
This commit is contained in:
parent
cf92c572c9
commit
b31a23e401
|
@ -2684,18 +2684,22 @@ export default class BattleScene extends SceneBase {
|
|||
while (availableEncounters.length === 0 && tier >= 0) {
|
||||
availableEncounters = biomeMysteryEncounters
|
||||
.filter((encounterType) => {
|
||||
if (allMysteryEncounters[encounterType].encounterTier !== tier) { // Encounter is in tier
|
||||
const encounterCandidate = allMysteryEncounters[encounterType];
|
||||
if (!encounterCandidate) {
|
||||
return false;
|
||||
}
|
||||
if (!allMysteryEncounters[encounterType]?.meetsRequirements(this)) { // Meets encounter requirements
|
||||
if (encounterCandidate.encounterTier !== tier) { // Encounter is in tier
|
||||
return false;
|
||||
}
|
||||
if (!encounterCandidate.meetsRequirements(this)) { // Meets encounter requirements
|
||||
return false;
|
||||
}
|
||||
if (!isNullOrUndefined(previousEncounter) && encounterType === previousEncounter) { // Previous encounter was not this one
|
||||
return false;
|
||||
}
|
||||
if (this.mysteryEncounterData.encounteredEvents?.length > 0 && // Encounter has not exceeded max allowed encounters
|
||||
allMysteryEncounters[encounterType].maxAllowedEncounters > 0
|
||||
&& this.mysteryEncounterData.encounteredEvents.filter(e => e[0] === encounterType).length >= allMysteryEncounters[encounterType].maxAllowedEncounters) {
|
||||
encounterCandidate.maxAllowedEncounters > 0
|
||||
&& this.mysteryEncounterData.encounteredEvents.filter(e => e[0] === encounterType).length >= encounterCandidate.maxAllowedEncounters) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -0,0 +1,394 @@
|
|||
import { EnemyPartyConfig, generateModifierTypeOption, leaveEncounterWithoutBattle, updatePlayerMoney, } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||
import Pokemon from "#app/field/pokemon";
|
||||
import { modifierTypes, PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { Species } from "#enums/species";
|
||||
import BattleScene from "#app/battle-scene";
|
||||
import IMysteryEncounter, { MysteryEncounterBuilder } from "../mystery-encounter";
|
||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||
import { MoneyRequirement, PersistentModifierRequirement } from "../mystery-encounter-requirements";
|
||||
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { BerryModifier } from "#app/modifier/modifier";
|
||||
import { ModifierRewardPhase, StatChangePhase } from "#app/phases";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
|
||||
/** the i18n namespace for this encounter */
|
||||
const namespace = "mysteryEncounter:absoluteAvarice";
|
||||
|
||||
/**
|
||||
* Delibird-y encounter.
|
||||
* @see {@link https://github.com/AsdarDevelops/PokeRogue-Events/issues/58 | GitHub Issue #58}
|
||||
* @see For biome requirements check {@linkcode mysteryEncountersByBiome}
|
||||
*/
|
||||
export const AbsoluteAvariceEncounter: IMysteryEncounter =
|
||||
MysteryEncounterBuilder.withEncounterType(MysteryEncounterType.ABSOLUTE_AVARICE)
|
||||
.withEncounterTier(MysteryEncounterTier.GREAT)
|
||||
.withSceneWaveRangeRequirement(10, 180)
|
||||
.withSceneRequirement(new PersistentModifierRequirement(BerryModifier.name, 4)) // Must have at least 4 berries to spawn
|
||||
.withIntroSpriteConfigs([
|
||||
{
|
||||
spriteKey: Species.GREEDENT.toString(),
|
||||
fileRoot: "pokemon",
|
||||
hasShadow: false,
|
||||
repeat: true,
|
||||
x: -5
|
||||
},
|
||||
{
|
||||
// This sprite has the shadow
|
||||
spriteKey: Species.GREEDENT.toString(),
|
||||
fileRoot: "pokemon",
|
||||
hasShadow: true,
|
||||
alpha: 0.001,
|
||||
repeat: true,
|
||||
x: -5
|
||||
},
|
||||
{
|
||||
spriteKey: "lum_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 7,
|
||||
y: -14,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "salac_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 2,
|
||||
y: 4,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "lansat_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 32,
|
||||
y: 5,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "liechi_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 6,
|
||||
y: -5,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "sitrus_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 7,
|
||||
y: 8,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "petaya_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 20,
|
||||
y: -17,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "enigma_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 26,
|
||||
y: -4,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "leppa_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 16,
|
||||
y: -27,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "ganlon_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 16,
|
||||
y: -11,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
{
|
||||
spriteKey: "apicot_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 14,
|
||||
y: -2,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
}, {
|
||||
spriteKey: "starf_berry",
|
||||
fileRoot: "items",
|
||||
isItem: true,
|
||||
x: 18,
|
||||
y: 9,
|
||||
hidden: true,
|
||||
disableAnimation: true
|
||||
},
|
||||
])
|
||||
.withOnVisualsStart((scene: BattleScene) => {
|
||||
const encounter = scene.currentBattle.mysteryEncounter;
|
||||
const greedentSprites = encounter.introVisuals.getSpriteAtIndex(0);
|
||||
|
||||
scene.playSound("Follow Me");
|
||||
|
||||
// scene.tweens.add({
|
||||
// targets: greedentSprites,
|
||||
// duration: 600,
|
||||
// ease: "Cubic.easeOut",
|
||||
// yoyo: true,
|
||||
// y: "+=50",
|
||||
// x: "-=60",
|
||||
// scale: 1.2,
|
||||
// onComplete: () => {
|
||||
// // Bounce the Greedent
|
||||
// scene.tweens.add({
|
||||
// targets: greedentSprites,
|
||||
// duration: 300,
|
||||
// ease: "Cubic.easeOut",
|
||||
// yoyo: true,
|
||||
// y: "-=20",
|
||||
// loop: 1,
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
// Slide left
|
||||
scene.tweens.add({
|
||||
targets: greedentSprites,
|
||||
duration: 500,
|
||||
ease: "Cubic.easeOut",
|
||||
x: "-=300",
|
||||
onComplete: () => {
|
||||
// Slide back right, lower
|
||||
greedentSprites[0].y += 80;
|
||||
greedentSprites[1].y += 80;
|
||||
scene.tweens.add({
|
||||
targets: greedentSprites,
|
||||
duration: 300,
|
||||
ease: "Cubic.easeOut",
|
||||
yoyo: true,
|
||||
x: "+=140",
|
||||
onComplete: () => {
|
||||
// Slide back right, higher
|
||||
greedentSprites[0].y -= 80;
|
||||
greedentSprites[1].y -= 80;
|
||||
scene.tweens.add({
|
||||
targets: greedentSprites,
|
||||
duration: 500,
|
||||
ease: "Cubic.easeOut",
|
||||
x: "+=300",
|
||||
onComplete: () => {
|
||||
// Bounce the Greedent
|
||||
scene.tweens.add({
|
||||
targets: greedentSprites,
|
||||
duration: 300,
|
||||
ease: "Cubic.easeOut",
|
||||
yoyo: true,
|
||||
y: "-=20",
|
||||
loop: 1,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const berryAddDelay = 200;
|
||||
|
||||
const animationOrder = ["starf", "sitrus", "lansat", "salac", "apicot", "enigma", "liechi", "ganlon", "lum", "petaya", "leppa"];
|
||||
|
||||
animationOrder.forEach((berry, i) => {
|
||||
const introVisualsIndex = encounter.spriteConfigs.findIndex(config => config.spriteKey.includes(berry));
|
||||
const [ sprite, tintSprite ] = encounter.introVisuals.getSpriteAtIndex(introVisualsIndex);
|
||||
// const [ sprite, tintSprite ] = [berrySprites[i * 2], berrySprites[i * 2 + 1]];
|
||||
scene.time.delayedCall(berryAddDelay * i + 300, () => {
|
||||
if (sprite) {
|
||||
sprite.setVisible(true);
|
||||
}
|
||||
if (tintSprite) {
|
||||
tintSprite.setVisible(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
})
|
||||
.withIntroDialogue([
|
||||
{
|
||||
text: `${namespace}:intro`,
|
||||
}
|
||||
])
|
||||
.withTitle(`${namespace}:title`)
|
||||
.withDescription(`${namespace}:description`)
|
||||
.withQuery(`${namespace}:query`)
|
||||
.withOutroDialogue([
|
||||
{
|
||||
text: `${namespace}:outro`,
|
||||
}
|
||||
])
|
||||
.withOnInit((scene: BattleScene) => {
|
||||
const encounter = scene.currentBattle.mysteryEncounter;
|
||||
|
||||
scene.loadSe("Follow Me", "battle_anims", "Follow Me.mp3");
|
||||
// scene.loadSe("Follow Me", "battle_anims");
|
||||
|
||||
// Get all player berry items, remove from party, and store reference
|
||||
const berryItems = scene.findModifiers(m => m instanceof BerryModifier) as BerryModifier[];
|
||||
|
||||
// Sort berries by party member ID to more easily re-add later if necessary
|
||||
const berryItemsMap = new Map<number, BerryModifier[]>();
|
||||
scene.getParty().forEach(pokemon => {
|
||||
const pokemonBerries = berryItems.filter(b => b.pokemonId === pokemon.id);
|
||||
if (pokemonBerries?.length > 0) {
|
||||
berryItemsMap.set(pokemon.id, pokemonBerries);
|
||||
}
|
||||
});
|
||||
|
||||
encounter.misc = { berryItemsMap };
|
||||
|
||||
// Generates copies of the stolen berries to put on the Greedent
|
||||
const bossModifierTypes: PokemonHeldItemModifierType[] = [];
|
||||
berryItems.forEach(berryMod => {
|
||||
// Can't define stack count on a ModifierType, have to just create separate instances for each stack
|
||||
// Overflow berries will be "lost" on the boss, but it's un-catchable anyway
|
||||
for (let i = 0; i < berryMod.stackCount; i++) {
|
||||
const modifierType = generateModifierTypeOption(scene, modifierTypes.BERRY, [berryMod.berryType]).type as PokemonHeldItemModifierType;
|
||||
bossModifierTypes.push(modifierType);
|
||||
}
|
||||
|
||||
scene.removeModifier(berryMod);
|
||||
});
|
||||
|
||||
// Calculate boss mon
|
||||
const config: EnemyPartyConfig = {
|
||||
levelAdditiveMultiplier: 1,
|
||||
pokemonConfigs: [
|
||||
{
|
||||
species: getPokemonSpecies(Species.GREEDENT),
|
||||
isBoss: true,
|
||||
bossSegments: 5,
|
||||
// nature: Nature.BOLD,
|
||||
moveSet: [Moves.THRASH, Moves.BODY_PRESS, Moves.STUFF_CHEEKS, Moves.SLACK_OFF],
|
||||
modifierTypes: bossModifierTypes,
|
||||
tags: [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON],
|
||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||
queueEncounterMessage(pokemon.scene, `${namespace}:option:2:stat_boost`);
|
||||
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD], 1));
|
||||
}
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
encounter.enemyPartyConfigs = [config];
|
||||
|
||||
return true;
|
||||
})
|
||||
.withOption(
|
||||
new MysteryEncounterOptionBuilder()
|
||||
.withOptionMode(MysteryEncounterOptionMode.DEFAULT)
|
||||
.withDialogue({
|
||||
buttonLabel: `${namespace}:option:1:label`,
|
||||
buttonTooltip: `${namespace}:option:1:tooltip`,
|
||||
selected: [
|
||||
{
|
||||
text: `${namespace}:option:1:selected`,
|
||||
},
|
||||
],
|
||||
})
|
||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||
const encounter = scene.currentBattle.mysteryEncounter;
|
||||
updatePlayerMoney(scene, -(encounter.options[0].requirements[0] as MoneyRequirement).requiredMoney, true, false);
|
||||
return true;
|
||||
})
|
||||
.withOptionPhase(async (scene: BattleScene) => {
|
||||
// Give the player an Ability Charm
|
||||
scene.unshiftPhase(new ModifierRewardPhase(scene, modifierTypes.ABILITY_CHARM));
|
||||
leaveEncounterWithoutBattle(scene, true);
|
||||
})
|
||||
.build()
|
||||
)
|
||||
.withOption(
|
||||
new MysteryEncounterOptionBuilder()
|
||||
.withOptionMode(MysteryEncounterOptionMode.DEFAULT)
|
||||
.withDialogue({
|
||||
buttonLabel: `${namespace}:option:2:label`,
|
||||
buttonTooltip: `${namespace}:option:2:tooltip`,
|
||||
secondOptionPrompt: `${namespace}:option:2:select_prompt`,
|
||||
selected: [
|
||||
{
|
||||
text: `${namespace}:option:2:selected`,
|
||||
},
|
||||
],
|
||||
})
|
||||
.withOptionPhase(async (scene: BattleScene) => {
|
||||
const encounter = scene.currentBattle.mysteryEncounter;
|
||||
const modifier = encounter.misc.chosenModifier;
|
||||
// Give the player a Candy Jar if they gave a Berry, and a Healing Charm for Reviver Seed
|
||||
if (modifier.type.name.includes("Berry")) {
|
||||
scene.unshiftPhase(new ModifierRewardPhase(scene, modifierTypes.CANDY_JAR));
|
||||
} else {
|
||||
scene.unshiftPhase(new ModifierRewardPhase(scene, modifierTypes.HEALING_CHARM));
|
||||
}
|
||||
|
||||
// Remove the modifier if its stacks go to 0
|
||||
modifier.stackCount -= 1;
|
||||
if (modifier.stackCount === 0) {
|
||||
scene.removeModifier(modifier);
|
||||
}
|
||||
|
||||
leaveEncounterWithoutBattle(scene, true);
|
||||
})
|
||||
.build()
|
||||
)
|
||||
.withOption(
|
||||
new MysteryEncounterOptionBuilder()
|
||||
.withOptionMode(MysteryEncounterOptionMode.DEFAULT)
|
||||
.withDialogue({
|
||||
buttonLabel: `${namespace}:option:3:label`,
|
||||
buttonTooltip: `${namespace}:option:3:tooltip`,
|
||||
secondOptionPrompt: `${namespace}:option:3:select_prompt`,
|
||||
selected: [
|
||||
{
|
||||
text: `${namespace}:option:3:selected`,
|
||||
},
|
||||
],
|
||||
})
|
||||
.withOptionPhase(async (scene: BattleScene) => {
|
||||
const encounter = scene.currentBattle.mysteryEncounter;
|
||||
const modifier = encounter.misc.chosenModifier;
|
||||
// Give the player a Berry Pouch
|
||||
scene.unshiftPhase(new ModifierRewardPhase(scene, modifierTypes.BERRY_POUCH));
|
||||
|
||||
// Remove the modifier if its stacks go to 0
|
||||
modifier.stackCount -= 1;
|
||||
if (modifier.stackCount === 0) {
|
||||
scene.removeModifier(modifier);
|
||||
}
|
||||
|
||||
leaveEncounterWithoutBattle(scene, true);
|
||||
})
|
||||
.build()
|
||||
)
|
||||
.build();
|
|
@ -160,7 +160,7 @@ export const FightOrFlightEncounter: IMysteryEncounter =
|
|||
config.pokemonConfigs[0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON];
|
||||
config.pokemonConfigs[0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => {
|
||||
pokemon.scene.currentBattle.mysteryEncounter.setDialogueToken("enemyPokemon", getPokemonNameWithAffix(pokemon));
|
||||
queueEncounterMessage(pokemon.scene, `${namespace}:boss_enraged`);
|
||||
queueEncounterMessage(pokemon.scene, `${namespace}option:2:boss_enraged`);
|
||||
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD], 1));
|
||||
};
|
||||
await showEncounterText(scene, `${namespace}:option:2:bad_result`);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { PlayerPokemon } from "#app/field/pokemon";
|
||||
import { ModifierType } from "#app/modifier/modifier-type";
|
||||
import BattleScene from "#app/battle-scene";
|
||||
import { isNullOrUndefined } from "#app/utils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
@ -235,28 +234,36 @@ export class PartySizeRequirement extends EncounterSceneRequirement {
|
|||
}
|
||||
|
||||
export class PersistentModifierRequirement extends EncounterSceneRequirement {
|
||||
requiredItems?: ModifierType[]; // TODO: not implemented
|
||||
constructor(item: ModifierType | ModifierType[]) {
|
||||
requiredHeldItemModifiers: string[];
|
||||
minNumberOfItems: number;
|
||||
|
||||
constructor(heldItem: string | string[], minNumberOfItems: number = 1) {
|
||||
super();
|
||||
this.requiredItems = Array.isArray(item) ? item : [item];
|
||||
this.minNumberOfItems = minNumberOfItems;
|
||||
this.requiredHeldItemModifiers = Array.isArray(heldItem) ? heldItem : [heldItem];
|
||||
}
|
||||
|
||||
meetsRequirement(scene: BattleScene): boolean {
|
||||
const items = scene.modifiers;
|
||||
|
||||
if (!isNullOrUndefined(items) && this?.requiredItems.length > 0 && this.requiredItems.filter((searchingMod) =>
|
||||
items.filter((itemInScene) => itemInScene.type.id === searchingMod.id).length > 0).length === 0) {
|
||||
const partyPokemon = scene.getParty();
|
||||
if (isNullOrUndefined(partyPokemon) || this?.requiredHeldItemModifiers?.length < 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
let modifierCount = 0;
|
||||
this.requiredHeldItemModifiers.forEach(modifier => {
|
||||
const matchingMods = scene.findModifiers(m => m.constructor.name === modifier);
|
||||
if (matchingMods?.length > 0) {
|
||||
matchingMods.forEach(matchingMod => {
|
||||
modifierCount += matchingMod.stackCount;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return modifierCount >= this.minNumberOfItems;
|
||||
}
|
||||
|
||||
getDialogueToken(scene: BattleScene, pokemon?: PlayerPokemon): [string, string] {
|
||||
const requiredItemsInInventory = this.requiredItems.filter((a) => {
|
||||
scene.modifiers.filter((itemInScene) => itemInScene.type.id === a.id).length > 0;
|
||||
});
|
||||
if (requiredItemsInInventory.length > 0) {
|
||||
return ["requiredItem", requiredItemsInInventory[0].name];
|
||||
if (this.requiredHeldItemModifiers.length > 0) {
|
||||
return ["requiredItem", this.requiredHeldItemModifiers[0]];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ export default class IMysteryEncounter implements IMysteryEncounter {
|
|||
if (!isNullOrUndefined(encounter)) {
|
||||
Object.assign(this, encounter);
|
||||
}
|
||||
this.encounterTier = this.encounterTier ? this.encounterTier : MysteryEncounterTier.COMMON;
|
||||
this.encounterTier = !isNullOrUndefined(this.encounterTier) ? this.encounterTier : MysteryEncounterTier.COMMON;
|
||||
this.dialogue = this.dialogue ?? {};
|
||||
// Default max is 1 for ROGUE encounters, 3 for others
|
||||
this.maxAllowedEncounters = this.maxAllowedEncounters ?? this.encounterTier === MysteryEncounterTier.ROGUE ? 1 : 3;
|
||||
|
|
|
@ -17,6 +17,7 @@ import { TheStrongStuffEncounter } from "#app/data/mystery-encounters/encounters
|
|||
import { PokemonSalesmanEncounter } from "#app/data/mystery-encounters/encounters/pokemon-salesman-encounter";
|
||||
import { OfferYouCantRefuseEncounter } from "#app/data/mystery-encounters/encounters/offer-you-cant-refuse-encounter";
|
||||
import { DelibirdyEncounter } from "#app/data/mystery-encounters/encounters/delibirdy-encounter";
|
||||
import { AbsoluteAvariceEncounter } from "#app/data/mystery-encounters/encounters/absolute-avarice-encounter";
|
||||
|
||||
// Spawn chance: (BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT + WIGHT_INCREMENT_ON_SPAWN_MISS * <number of missed spawns>) / 256
|
||||
export const BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT = 1;
|
||||
|
@ -238,7 +239,7 @@ export function initMysteryEncounters() {
|
|||
allMysteryEncounters[MysteryEncounterType.POKEMON_SALESMAN] = PokemonSalesmanEncounter;
|
||||
allMysteryEncounters[MysteryEncounterType.OFFER_YOU_CANT_REFUSE] = OfferYouCantRefuseEncounter;
|
||||
allMysteryEncounters[MysteryEncounterType.DELIBIRDY] = DelibirdyEncounter;
|
||||
// allMysteryEncounters[MysteryEncounterType.ABSOLUTE_AVARICE] = Abs;
|
||||
allMysteryEncounters[MysteryEncounterType.ABSOLUTE_AVARICE] = AbsoluteAvariceEncounter;
|
||||
|
||||
// Add extreme encounters to biome map
|
||||
extremeBiomeEncounters.forEach(encounter => {
|
||||
|
|
|
@ -54,7 +54,7 @@ export function doTrainerExclamation(scene: BattleScene) {
|
|||
}
|
||||
});
|
||||
|
||||
scene.playSound("GEN8- Exclaim.wav", { volume: 0.7 });
|
||||
scene.playSound("GEN8- Exclaim", { volume: 0.7 });
|
||||
}
|
||||
|
||||
export interface EnemyPokemonConfig {
|
||||
|
|
|
@ -149,7 +149,7 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con
|
|||
}
|
||||
}
|
||||
|
||||
if (alpha) {
|
||||
if (!isNaN(alpha)) {
|
||||
sprite.setAlpha(alpha);
|
||||
tintSprite.setAlpha(alpha);
|
||||
}
|
||||
|
@ -289,6 +289,22 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Sprite/TintSprite pair
|
||||
* @param index
|
||||
*/
|
||||
getSpriteAtIndex(index: number): Phaser.GameObjects.Sprite[] {
|
||||
if (!this.spriteConfigs) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ret: Phaser.GameObjects.Sprite[] = [];
|
||||
ret.push(this.getAt(index * 2)); // Sprite
|
||||
ret.push(this.getAt(index * 2 + 1)); // Tint Sprite
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
getSprites(): Phaser.GameObjects.Sprite[] {
|
||||
if (!this.spriteConfigs) {
|
||||
return;
|
||||
|
|
|
@ -14,6 +14,7 @@ import { theStrongStuffDialogue } from "#app/locales/en/mystery-encounters/the-s
|
|||
import { pokemonSalesmanDialogue } from "#app/locales/en/mystery-encounters/pokemon-salesman-dialogue";
|
||||
import { offerYouCantRefuseDialogue } from "#app/locales/en/mystery-encounters/offer-you-cant-refuse-dialogue";
|
||||
import { delibirdyDialogue } from "#app/locales/en/mystery-encounters/delibirdy-dialogue";
|
||||
import { absoluteAvariceDialogue } from "#app/locales/en/mystery-encounters/absolute-avarice-dialogue";
|
||||
|
||||
/**
|
||||
* Patterns that can be used:
|
||||
|
@ -53,4 +54,5 @@ export const mysteryEncounter = {
|
|||
pokemonSalesman: pokemonSalesmanDialogue,
|
||||
offerYouCantRefuse: offerYouCantRefuseDialogue,
|
||||
delibirdy: delibirdyDialogue,
|
||||
absoluteAvarice: absoluteAvariceDialogue,
|
||||
} as const;
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
export const absoluteAvariceDialogue = {
|
||||
intro: "A Greedent ambushed you\nand stole your party's berries!",
|
||||
title: "Absolute Avarice",
|
||||
description: "The Greedent has caught you totally off guard now all your berries are gone!\n\nThe Greedent looks like it's about to eat them when it pauses to look at you, interested.",
|
||||
query: "What will you do?",
|
||||
option: {
|
||||
1: {
|
||||
label: "Battle It",
|
||||
tooltip: "(-) Tough Battle\n(+) Rewards from its Berry Hoard",
|
||||
selected: "You'll show this Greedent what\nhappens to those who steal from you!",
|
||||
},
|
||||
2: {
|
||||
label: "Reason with It",
|
||||
tooltip: "(+) Regain Some Lost Berries",
|
||||
selected: `Your pleading strikes a chord with the Greedent.
|
||||
$It doesn't give all your berries back, but still tosses a few in your direction.`,
|
||||
},
|
||||
3: {
|
||||
label: "Let It Have the Food",
|
||||
tooltip: "(-) Lose All Berries\n(?) The Greedent Will Like You",
|
||||
selected: `The Greedent devours the entire stash of berries in a flash!
|
||||
$Patting its stomach, it looks at you appreciatively.
|
||||
$Perhaps you could feed it more berries on your adventure...
|
||||
$The Greedent wants to join your party!`,
|
||||
},
|
||||
}
|
||||
};
|
|
@ -5,20 +5,20 @@ export const fieryFalloutDialogue = {
|
|||
query: "What will you do?",
|
||||
option: {
|
||||
1: {
|
||||
label: "Find the source",
|
||||
label: "Find the Source",
|
||||
tooltip: "(?) Discover the source\n(-) Hard Battle",
|
||||
selected: `You push through the storm, and find two Volcarona in the middle of a mating dance!
|
||||
$They don't take kindly to the interruption and attack!`
|
||||
},
|
||||
2: {
|
||||
label: "Hunker down",
|
||||
label: "Hunker Down",
|
||||
tooltip: "(-) Suffer the effects of the weather",
|
||||
selected: `The weather effects cause significant\nharm as you struggle to find shelter!
|
||||
$Your party takes 20% Max HP damage!`,
|
||||
target_burned: "Your {{burnedPokemon}} also became burned!"
|
||||
},
|
||||
3: {
|
||||
label: "Your Fire types help",
|
||||
label: "Your Fire Types Help",
|
||||
tooltip: "(+) End the conditions\n(+) Gain a Charcoal",
|
||||
disabled_tooltip: "You need at least 2 Fire Type Pokémon to choose this",
|
||||
selected: `Your {{option3PrimaryName}} and {{option3SecondaryName}} guide you to where two Volcarona are in the middle of a mating dance!
|
||||
|
|
|
@ -5,7 +5,7 @@ export const lostAtSeaDialogue = {
|
|||
query: "What will you do?",
|
||||
option: {
|
||||
1: {
|
||||
label: "{{option1PrimaryName}} can help",
|
||||
label: "{{option1PrimaryName}} Might Help",
|
||||
label_disabled: "Can't {{option1RequiredMove}}",
|
||||
tooltip: "(+) {{option1PrimaryName}} saves you\n(+) {{option1PrimaryName}} gains some EXP",
|
||||
tooltip_disabled: "You have no Pokémon to {{option1RequiredMove}} on",
|
||||
|
@ -13,7 +13,7 @@ export const lostAtSeaDialogue = {
|
|||
\${{option1PrimaryName}} seems to also have gotten stronger in this time of need!`,
|
||||
},
|
||||
2: {
|
||||
label: "{{option2PrimaryName}} can help",
|
||||
label: "{{option2PrimaryName}} Might Help",
|
||||
label_disabled: "Can't {{option2RequiredMove}}",
|
||||
tooltip: "(+) {{option2PrimaryName}} saves you\n(+) {{option2PrimaryName}} gains some EXP",
|
||||
tooltip_disabled: "You have no Pokémon to {{option2RequiredMove}} with",
|
||||
|
@ -21,7 +21,7 @@ export const lostAtSeaDialogue = {
|
|||
\${{option2PrimaryName}} seems to also have gotten stronger in this time of need!`,
|
||||
},
|
||||
3: {
|
||||
label: "Wander aimlessly",
|
||||
label: "Wander Aimlessly",
|
||||
tooltip: "(-) Each of your Pokémon lose {{damagePercentage}}% of their total HP",
|
||||
selected: `You float about in the boat, steering without direction until you finally spot a landmark you remember.
|
||||
$You and your Pokémon are fatigued from the whole ordeal.`,
|
||||
|
|
|
@ -5,15 +5,15 @@ export const mysteriousChallengersDialogue = {
|
|||
query: "Who will you battle?",
|
||||
option: {
|
||||
1: {
|
||||
label: "A clever, mindful foe",
|
||||
label: "A Clever, Mindful Foe",
|
||||
tooltip: "(-) Standard Battle\n(+) Move Item Rewards",
|
||||
},
|
||||
2: {
|
||||
label: "A strong foe",
|
||||
label: "A Strong Foe",
|
||||
tooltip: "(-) Hard Battle\n(+) Good Rewards",
|
||||
},
|
||||
3: {
|
||||
label: "The mightiest foe",
|
||||
label: "The Mightiest Foe",
|
||||
tooltip: "(-) Brutal Battle\n(+) Great Rewards",
|
||||
},
|
||||
selected: "The trainer steps forward...",
|
||||
|
|
|
@ -5,7 +5,7 @@ export const mysteriousChestDialogue = {
|
|||
query: "Will you open it?",
|
||||
option: {
|
||||
1: {
|
||||
label: "Open it",
|
||||
label: "Open It",
|
||||
tooltip: "@[SUMMARY_BLUE]{(35%) Something terrible}\n@[SUMMARY_GREEN]{(40%) Okay Rewards}\n@[SUMMARY_GREEN]{(20%) Good Rewards}\n@[SUMMARY_GREEN]{(4%) Great Rewards}\n@[SUMMARY_GREEN]{(1%) Amazing Rewards}",
|
||||
selected: "You open the chest to find...",
|
||||
normal: "Just some normal tools and items.",
|
||||
|
@ -16,7 +16,7 @@ export const mysteriousChestDialogue = {
|
|||
$Your {{pokeName}} jumps in front of you\nbut is KOed in the process.`,
|
||||
},
|
||||
2: {
|
||||
label: "It's too risky, leave",
|
||||
label: "Too Risky, Leave",
|
||||
tooltip: "(-) No Rewards",
|
||||
selected: "You hurry along your way,\nwith a slight feeling of regret.",
|
||||
},
|
||||
|
|
|
@ -22,12 +22,12 @@ export const safariZoneDialogue = {
|
|||
selected: "You throw a Pokéball!",
|
||||
},
|
||||
2: {
|
||||
label: "Throw bait",
|
||||
label: "Throw Bait",
|
||||
tooltip: "(+) Increases Capture Rate\n(-) Chance to Increase Flee Rate",
|
||||
selected: "You throw some bait!",
|
||||
},
|
||||
3: {
|
||||
label: "Throw mud",
|
||||
label: "Throw Mud",
|
||||
tooltip: "(+) Decreases Flee Rate\n(-) Chance to Decrease Capture Rate",
|
||||
selected: "You throw some mud!",
|
||||
},
|
||||
|
|
|
@ -6,19 +6,19 @@ export const slumberingSnorlaxDialogue = {
|
|||
query: "What will you do?",
|
||||
option: {
|
||||
1: {
|
||||
label: "Battle it",
|
||||
label: "Battle It",
|
||||
tooltip: "(-) Fight Sleeping Snorlax\n(+) Special Reward",
|
||||
selected: "You approach the\nPokémon without fear.",
|
||||
},
|
||||
2: {
|
||||
label: "Wait for it to move",
|
||||
label: "Wait for It to Move",
|
||||
tooltip: "(-) Wait a Long Time\n(+) Recover Party",
|
||||
selected: `.@d{32}.@d{32}.@d{32}
|
||||
$You wait for a time, but the Snorlax's yawns make your party sleepy...`,
|
||||
rest_result: "When you all awaken, the Snorlax is no where to be found -\nbut your Pokémon are all healed!",
|
||||
},
|
||||
3: {
|
||||
label: "Steal its item",
|
||||
label: "Steal Its Item",
|
||||
tooltip: "(+) {{option3PrimaryName}} uses {{option3PrimaryMove}}\n(+) Special Reward",
|
||||
disabled_tooltip: "Your Pokémon need to know certain moves to choose this",
|
||||
selected: `Your {{option3PrimaryName}} uses {{option3PrimaryMove}}!
|
||||
|
|
|
@ -5,7 +5,7 @@ export const theStrongStuffDialogue = {
|
|||
query: "What will you do?",
|
||||
option: {
|
||||
1: {
|
||||
label: "Let it touch you",
|
||||
label: "Let It Touch You",
|
||||
tooltip: "(?) Something awful or amazing might happen",
|
||||
selected: "You black out.",
|
||||
selected_2: `@f{150}When you awaken, the Shuckle is gone\nand juice stash completely drained.
|
||||
|
|
|
@ -903,7 +903,7 @@ export class EncounterPhase extends BattlePhase {
|
|||
loadEnemyAssets.push(battle.mysteryEncounter.introVisuals.loadAssets().then(() => battle.mysteryEncounter.introVisuals.initSprite()));
|
||||
// Load Mystery Encounter Exclamation bubble and sfx
|
||||
loadEnemyAssets.push(new Promise<void>(resolve => {
|
||||
this.scene.loadSe("GEN8- Exclaim.wav", "battle_anims", "GEN8- Exclaim.wav");
|
||||
this.scene.loadSe("GEN8- Exclaim", "battle_anims", "GEN8- Exclaim.wav");
|
||||
this.scene.loadAtlas("exclaim", "mystery-encounters");
|
||||
this.scene.load.once(Phaser.Loader.Events.COMPLETE, () => resolve());
|
||||
if (!this.scene.load.isLoading()) {
|
||||
|
|
Loading…
Reference in New Issue