mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-13 21:28:39 +01:00
update encounter biome mapping and option coloring/disablement with requirements
This commit is contained in:
parent
810c50cda2
commit
f128b47db5
@ -4,8 +4,8 @@
|
|||||||
"image": "mad_scientist_m.png",
|
"image": "mad_scientist_m.png",
|
||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {
|
"size": {
|
||||||
"w": 44,
|
"w": 46,
|
||||||
"h": 74
|
"h": 76
|
||||||
},
|
},
|
||||||
"scale": 1,
|
"scale": 1,
|
||||||
"frames": [
|
"frames": [
|
||||||
@ -24,8 +24,8 @@
|
|||||||
"h": 74
|
"h": 74
|
||||||
},
|
},
|
||||||
"frame": {
|
"frame": {
|
||||||
"x": 0,
|
"x": 1,
|
||||||
"y": 0,
|
"y": 1,
|
||||||
"w": 44,
|
"w": 44,
|
||||||
"h": 74
|
"h": 74
|
||||||
}
|
}
|
||||||
@ -36,6 +36,6 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"app": "https://www.codeandweb.com/texturepacker",
|
"app": "https://www.codeandweb.com/texturepacker",
|
||||||
"version": "3.0",
|
"version": "3.0",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:895f0a79b89fa0fb44167f4584fd9a22:357b46953b7e17c6b2f43a62d52855d8:cc1ed0e4f90aaa9dcf1b39a0af1283b0$"
|
"smartupdate": "$TexturePacker:SmartUpdate:a7f8ff2bbb362868f51125c254eb6681:cf76e61ddd31a8f46af67ced168c44a2:4fc09abe16c0608828269e5da81d0744$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 920 B |
@ -10,7 +10,7 @@
|
|||||||
"scale": 1,
|
"scale": 1,
|
||||||
"frames": [
|
"frames": [
|
||||||
{
|
{
|
||||||
"filename": "Spr_HGSS_Teacher.png",
|
"filename": "0001.png",
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"trimmed": true,
|
"trimmed": true,
|
||||||
"sourceSize": {
|
"sourceSize": {
|
||||||
|
@ -2696,7 +2696,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
encounter = availableEncounters[Utils.randSeedInt(availableEncounters.length)];
|
encounter = availableEncounters[Utils.randSeedInt(availableEncounters.length)];
|
||||||
// New encounter object to not dirty flags
|
// New encounter object to not dirty flags
|
||||||
encounter = new MysteryEncounter(encounter);
|
encounter = new MysteryEncounter(encounter);
|
||||||
encounter.meetsRequirements(this);
|
encounter.populateDialogueTokensFromRequirements(this);
|
||||||
return encounter;
|
return encounter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,21 +19,12 @@ import { StatChangePhase } from "#app/phases";
|
|||||||
import { TextStyle } from "#app/ui/text";
|
import { TextStyle } from "#app/ui/text";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { Moves } from "#enums/moves";
|
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import BattleScene from "../../../battle-scene";
|
import BattleScene from "../../../battle-scene";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
import { MoveRequirement } from "../mystery-encounter-requirements";
|
import { MoveRequirement } from "../mystery-encounter-requirements";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||||
const validMovesForSteal = [
|
import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups";
|
||||||
Moves.PLUCK,
|
|
||||||
Moves.COVET,
|
|
||||||
Moves.FAKE_OUT,
|
|
||||||
Moves.THIEF,
|
|
||||||
Moves.TRICK,
|
|
||||||
Moves.SWITCHEROO,
|
|
||||||
Moves.GIGA_DRAIN
|
|
||||||
];
|
|
||||||
|
|
||||||
export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.FIGHT_OR_FLIGHT)
|
.withEncounterType(MysteryEncounterType.FIGHT_OR_FLIGHT)
|
||||||
@ -82,13 +73,10 @@ export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder
|
|||||||
];
|
];
|
||||||
|
|
||||||
// If player has a stealing move, they succeed automatically
|
// If player has a stealing move, they succeed automatically
|
||||||
const moveRequirement = new MoveRequirement(validMovesForSteal);
|
encounter.options[1].meetsRequirements(scene);
|
||||||
const validPokemon = moveRequirement.queryParty(scene.getParty());
|
const primaryPokemon = encounter.options[1].primaryPokemon;
|
||||||
if (validPokemon?.length > 0) {
|
if (primaryPokemon) {
|
||||||
// Use first valid pokemon to execute the theivery
|
// Use primaryPokemon to execute the thievery
|
||||||
const pokemon = validPokemon[0];
|
|
||||||
encounter.setDialogueToken("thiefPokemon", pokemon.name);
|
|
||||||
encounter.setDialogueToken(...moveRequirement.getDialogueToken(scene, pokemon));
|
|
||||||
encounter.dialogue.encounterOptionsDialogue.options[1].buttonTooltip = "mysteryEncounter:fight_or_flight_option_2_steal_tooltip";
|
encounter.dialogue.encounterOptionsDialogue.options[1].buttonTooltip = "mysteryEncounter:fight_or_flight_option_2_steal_tooltip";
|
||||||
encounter.dialogue.encounterOptionsDialogue.options[1].style = TextStyle.SUMMARY_GREEN;
|
encounter.dialogue.encounterOptionsDialogue.options[1].style = TextStyle.SUMMARY_GREEN;
|
||||||
} else {
|
} else {
|
||||||
@ -104,44 +92,44 @@ export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder
|
|||||||
setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false });
|
setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false });
|
||||||
await initBattleWithEnemyConfig(scene, scene.currentBattle.mysteryEncounter.enemyPartyConfigs[0]);
|
await initBattleWithEnemyConfig(scene, scene.currentBattle.mysteryEncounter.enemyPartyConfigs[0]);
|
||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
// Pick steal
|
.withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically
|
||||||
const encounter = scene.currentBattle.mysteryEncounter;
|
.withDisabledOnRequirementsNotMet(false)
|
||||||
const item = scene.currentBattle.mysteryEncounter.misc as ModifierTypeOption;
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false });
|
// Pick steal
|
||||||
|
const encounter = scene.currentBattle.mysteryEncounter;
|
||||||
|
const item = scene.currentBattle.mysteryEncounter.misc as ModifierTypeOption;
|
||||||
|
setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false });
|
||||||
|
|
||||||
// If player has a stealing move, they succeed automatically
|
// If player has a stealing move, they succeed automatically
|
||||||
const moveRequirement = new MoveRequirement(validMovesForSteal);
|
const primaryPokemon = encounter.options[1].primaryPokemon;
|
||||||
const validPokemon = moveRequirement.queryParty(scene.getParty());
|
if (primaryPokemon) {
|
||||||
if (validPokemon?.length > 0) {
|
// Use primaryPokemon to execute the thievery
|
||||||
// Use first valid pokemon to execute the theivery
|
await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_steal_result");
|
||||||
const pokemon = validPokemon[0];
|
leaveEncounterWithoutBattle(scene);
|
||||||
encounter.setDialogueToken("thiefPokemon", pokemon.name);
|
return;
|
||||||
encounter.setDialogueToken(...moveRequirement.getDialogueToken(scene, pokemon));
|
}
|
||||||
await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_steal_result");
|
|
||||||
leaveEncounterWithoutBattle(scene);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const roll = randSeedInt(16);
|
const roll = randSeedInt(16);
|
||||||
if (roll > 6) {
|
if (roll > 6) {
|
||||||
// Noticed and attacked by boss, gets +1 to all stats at start of fight (62.5%)
|
// Noticed and attacked by boss, gets +1 to all stats at start of fight (62.5%)
|
||||||
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) => {
|
||||||
pokemon.scene.currentBattle.mysteryEncounter.setDialogueToken("enemyPokemon", pokemon.name);
|
pokemon.scene.currentBattle.mysteryEncounter.setDialogueToken("enemyPokemon", pokemon.name);
|
||||||
queueEncounterMessage(pokemon.scene, "mysteryEncounter:fight_or_flight_boss_enraged");
|
queueEncounterMessage(pokemon.scene, "mysteryEncounter:fight_or_flight_boss_enraged");
|
||||||
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD], 1));
|
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD], 1));
|
||||||
};
|
};
|
||||||
await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_bad_result");
|
await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_bad_result");
|
||||||
await initBattleWithEnemyConfig(scene, config);
|
await initBattleWithEnemyConfig(scene, config);
|
||||||
} else {
|
} else {
|
||||||
// Steal item (37.5%)
|
// Steal item (37.5%)
|
||||||
// Display result message then proceed to rewards
|
// Display result message then proceed to rewards
|
||||||
await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_good_result");
|
await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_good_result");
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.build())
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Leave encounter with no rewards or exp
|
// Leave encounter with no rewards or exp
|
||||||
leaveEncounterWithoutBattle(scene, true);
|
leaveEncounterWithoutBattle(scene, true);
|
||||||
|
@ -2,7 +2,6 @@ import {
|
|||||||
modifierTypes
|
modifierTypes
|
||||||
} from "#app/modifier/modifier-type";
|
} from "#app/modifier/modifier-type";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
import { Moves } from "#enums/moves";
|
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import BattleScene from "../../../battle-scene";
|
import BattleScene from "../../../battle-scene";
|
||||||
@ -19,6 +18,7 @@ import {
|
|||||||
leaveEncounterWithoutBattle, queueEncounterMessage, setEncounterExp,
|
leaveEncounterWithoutBattle, queueEncounterMessage, setEncounterExp,
|
||||||
setEncounterRewards
|
setEncounterRewards
|
||||||
} from "../mystery-encounter-utils";
|
} from "../mystery-encounter-utils";
|
||||||
|
import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups";
|
||||||
|
|
||||||
export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX)
|
.withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX)
|
||||||
@ -98,7 +98,7 @@ export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilde
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.withOption(new MysteryEncounterOptionBuilder()
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
.withPrimaryPokemonRequirement(new MoveRequirement([Moves.PLUCK, Moves.COVET, Moves.KNOCK_OFF, Moves.THIEF, Moves.TRICK, Moves.SWITCHEROO]))
|
.withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES))
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Steal the Snorlax's Leftovers
|
// Steal the Snorlax's Leftovers
|
||||||
const instance = scene.currentBattle.mysteryEncounter;
|
const instance = scene.currentBattle.mysteryEncounter;
|
||||||
|
@ -16,36 +16,148 @@ export const BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT = 1;
|
|||||||
export const WIGHT_INCREMENT_ON_SPAWN_MISS = 5;
|
export const WIGHT_INCREMENT_ON_SPAWN_MISS = 5;
|
||||||
export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 15;
|
export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 15;
|
||||||
|
|
||||||
|
export const EXTREME_ENCOUNTER_BIOMES = [
|
||||||
|
Biome.SEA,
|
||||||
|
Biome.SEABED,
|
||||||
|
Biome.BADLANDS,
|
||||||
|
Biome.DESERT,
|
||||||
|
Biome.ICE_CAVE,
|
||||||
|
Biome.VOLCANO,
|
||||||
|
Biome.WASTELAND,
|
||||||
|
Biome.ABYSS,
|
||||||
|
Biome.SPACE,
|
||||||
|
Biome.END
|
||||||
|
];
|
||||||
|
|
||||||
|
export const NON_EXTREME_ENCOUNTER_BIOMES = [
|
||||||
|
Biome.TOWN,
|
||||||
|
Biome.PLAINS,
|
||||||
|
Biome.GRASS,
|
||||||
|
Biome.TALL_GRASS,
|
||||||
|
Biome.METROPOLIS,
|
||||||
|
Biome.FOREST,
|
||||||
|
Biome.SWAMP,
|
||||||
|
Biome.BEACH,
|
||||||
|
Biome.LAKE,
|
||||||
|
Biome.MOUNTAIN,
|
||||||
|
Biome.CAVE,
|
||||||
|
Biome.MEADOW,
|
||||||
|
Biome.POWER_PLANT,
|
||||||
|
Biome.GRAVEYARD,
|
||||||
|
Biome.DOJO,
|
||||||
|
Biome.FACTORY,
|
||||||
|
Biome.RUINS,
|
||||||
|
Biome.CONSTRUCTION_SITE,
|
||||||
|
Biome.JUNGLE,
|
||||||
|
Biome.FAIRY_CAVE,
|
||||||
|
Biome.TEMPLE,
|
||||||
|
Biome.SLUM,
|
||||||
|
Biome.SNOWY_FOREST,
|
||||||
|
Biome.ISLAND,
|
||||||
|
Biome.LABORATORY
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Places where you could very reasonably expect to encounter a single human
|
||||||
|
*
|
||||||
|
* Diff from NON_EXTREME_ENCOUNTER_BIOMES:
|
||||||
|
* + BADLANDS
|
||||||
|
* + DESERT
|
||||||
|
* + ICE_CAVE
|
||||||
|
*/
|
||||||
|
export const HUMAN_TRANSITABLE_BIOMES = [
|
||||||
|
Biome.TOWN,
|
||||||
|
Biome.PLAINS,
|
||||||
|
Biome.GRASS,
|
||||||
|
Biome.TALL_GRASS,
|
||||||
|
Biome.METROPOLIS,
|
||||||
|
Biome.FOREST,
|
||||||
|
Biome.SWAMP,
|
||||||
|
Biome.BEACH,
|
||||||
|
Biome.LAKE,
|
||||||
|
Biome.MOUNTAIN,
|
||||||
|
Biome.BADLANDS,
|
||||||
|
Biome.CAVE,
|
||||||
|
Biome.DESERT,
|
||||||
|
Biome.ICE_CAVE,
|
||||||
|
Biome.MEADOW,
|
||||||
|
Biome.POWER_PLANT,
|
||||||
|
Biome.GRAVEYARD,
|
||||||
|
Biome.DOJO,
|
||||||
|
Biome.FACTORY,
|
||||||
|
Biome.RUINS,
|
||||||
|
Biome.CONSTRUCTION_SITE,
|
||||||
|
Biome.JUNGLE,
|
||||||
|
Biome.FAIRY_CAVE,
|
||||||
|
Biome.TEMPLE,
|
||||||
|
Biome.SLUM,
|
||||||
|
Biome.SNOWY_FOREST,
|
||||||
|
Biome.ISLAND,
|
||||||
|
Biome.LABORATORY
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Places where you could expect a town or city, some form of large civilization
|
||||||
|
*/
|
||||||
|
export const CIVILIZATION_ENCOUNTER_BIOMES = [
|
||||||
|
Biome.TOWN,
|
||||||
|
Biome.PLAINS,
|
||||||
|
Biome.GRASS,
|
||||||
|
Biome.TALL_GRASS,
|
||||||
|
Biome.METROPOLIS,
|
||||||
|
Biome.BEACH,
|
||||||
|
Biome.LAKE,
|
||||||
|
Biome.MEADOW,
|
||||||
|
Biome.POWER_PLANT,
|
||||||
|
Biome.GRAVEYARD,
|
||||||
|
Biome.DOJO,
|
||||||
|
Biome.FACTORY,
|
||||||
|
Biome.CONSTRUCTION_SITE,
|
||||||
|
Biome.SLUM,
|
||||||
|
Biome.ISLAND
|
||||||
|
];
|
||||||
|
|
||||||
export const allMysteryEncounters: { [encounterType: number]: MysteryEncounter } = {};
|
export const allMysteryEncounters: { [encounterType: number]: MysteryEncounter } = {};
|
||||||
|
|
||||||
|
// TO ENABLE AN ENCOUNTER IN ALL BIOMES, DO NOT SPECIFY IN ANY OF THESE LISTS/MAPS
|
||||||
|
|
||||||
|
const extremeBiomeEncounters: MysteryEncounterType[] = [];
|
||||||
|
|
||||||
|
const nonExtremeBiomeEncounters: MysteryEncounterType[] = [
|
||||||
|
MysteryEncounterType.FIELD_TRIP
|
||||||
|
];
|
||||||
|
|
||||||
|
const humanTransitableBiomeEncounters: MysteryEncounterType[] = [
|
||||||
|
MysteryEncounterType.MYSTERIOUS_CHALLENGERS,
|
||||||
|
MysteryEncounterType.SHADY_VITAMIN_DEALER
|
||||||
|
];
|
||||||
|
|
||||||
|
const civilizationBiomeEncounters: MysteryEncounterType[] = [
|
||||||
|
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
||||||
|
];
|
||||||
|
|
||||||
|
const anyBiomeEncounters: MysteryEncounterType[] = [
|
||||||
|
MysteryEncounterType.FIGHT_OR_FLIGHT,
|
||||||
|
MysteryEncounterType.DARK_DEAL,
|
||||||
|
MysteryEncounterType.MYSTERIOUS_CHEST,
|
||||||
|
MysteryEncounterType.TRAINING_SESSION
|
||||||
|
];
|
||||||
|
|
||||||
// Add MysteryEncounterType to biomes to enable it exclusively for those biomes
|
// Add MysteryEncounterType to biomes to enable it exclusively for those biomes
|
||||||
// To enable an encounter in all biomes, do not add to this map
|
|
||||||
export const mysteryEncountersByBiome = new Map<Biome, MysteryEncounterType[]>([
|
export const mysteryEncountersByBiome = new Map<Biome, MysteryEncounterType[]>([
|
||||||
[Biome.TOWN, [
|
[Biome.TOWN, []],
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
[Biome.PLAINS, []],
|
||||||
]],
|
|
||||||
[Biome.PLAINS, [
|
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.GRASS, [
|
[Biome.GRASS, [
|
||||||
MysteryEncounterType.SLEEPING_SNORLAX,
|
MysteryEncounterType.SLEEPING_SNORLAX,
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.TALL_GRASS, [
|
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.METROPOLIS, [
|
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
]],
|
||||||
|
[Biome.TALL_GRASS, []],
|
||||||
|
[Biome.METROPOLIS, []],
|
||||||
[Biome.FOREST, [
|
[Biome.FOREST, [
|
||||||
MysteryEncounterType.SLEEPING_SNORLAX
|
MysteryEncounterType.SLEEPING_SNORLAX
|
||||||
]],
|
]],
|
||||||
|
|
||||||
[Biome.SEA, []],
|
[Biome.SEA, []],
|
||||||
[Biome.SWAMP, []],
|
[Biome.SWAMP, []],
|
||||||
[Biome.BEACH, [
|
[Biome.BEACH, []],
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.LAKE, []],
|
[Biome.LAKE, []],
|
||||||
[Biome.SEABED, []],
|
[Biome.SEABED, []],
|
||||||
[Biome.MOUNTAIN, [
|
[Biome.MOUNTAIN, [
|
||||||
@ -57,31 +169,21 @@ export const mysteryEncountersByBiome = new Map<Biome, MysteryEncounterType[]>([
|
|||||||
]],
|
]],
|
||||||
[Biome.DESERT, []],
|
[Biome.DESERT, []],
|
||||||
[Biome.ICE_CAVE, []],
|
[Biome.ICE_CAVE, []],
|
||||||
[Biome.MEADOW, [
|
[Biome.MEADOW, []],
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
[Biome.POWER_PLANT, []],
|
||||||
]],
|
|
||||||
[Biome.POWER_PLANT, [
|
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.VOLCANO, []],
|
[Biome.VOLCANO, []],
|
||||||
[Biome.GRAVEYARD, []],
|
[Biome.GRAVEYARD, []],
|
||||||
[Biome.DOJO, []],
|
[Biome.DOJO, []],
|
||||||
[Biome.FACTORY, [
|
[Biome.FACTORY, []],
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.RUINS, []],
|
[Biome.RUINS, []],
|
||||||
[Biome.WASTELAND, []],
|
[Biome.WASTELAND, []],
|
||||||
[Biome.ABYSS, []],
|
[Biome.ABYSS, []],
|
||||||
[Biome.SPACE, []],
|
[Biome.SPACE, []],
|
||||||
[Biome.CONSTRUCTION_SITE, [
|
[Biome.CONSTRUCTION_SITE, []],
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.JUNGLE, []],
|
[Biome.JUNGLE, []],
|
||||||
[Biome.FAIRY_CAVE, []],
|
[Biome.FAIRY_CAVE, []],
|
||||||
[Biome.TEMPLE, []],
|
[Biome.TEMPLE, []],
|
||||||
[Biome.SLUM, [
|
[Biome.SLUM, []],
|
||||||
MysteryEncounterType.DEPARTMENT_STORE_SALE
|
|
||||||
]],
|
|
||||||
[Biome.SNOWY_FOREST, []],
|
[Biome.SNOWY_FOREST, []],
|
||||||
[Biome.ISLAND, []],
|
[Biome.ISLAND, []],
|
||||||
[Biome.LABORATORY, []]
|
[Biome.LABORATORY, []]
|
||||||
@ -90,7 +192,7 @@ export const mysteryEncountersByBiome = new Map<Biome, MysteryEncounterType[]>([
|
|||||||
export function initMysteryEncounters() {
|
export function initMysteryEncounters() {
|
||||||
allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHALLENGERS] = MysteriousChallengersEncounter;
|
allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHALLENGERS] = MysteriousChallengersEncounter;
|
||||||
allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHEST] = MysteriousChestEncounter;
|
allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHEST] = MysteriousChestEncounter;
|
||||||
allMysteryEncounters[MysteryEncounterType.DARK_DEAL] = DarkDealEncounter;
|
allMysteryEncounters[MysteryEncounterType.DARK_DEAL] = DarkDealEncounter; // TODO: move to HUMAN if we add an ANY biome ROGUE tier encounter
|
||||||
allMysteryEncounters[MysteryEncounterType.FIGHT_OR_FLIGHT] = FightOrFlightEncounter;
|
allMysteryEncounters[MysteryEncounterType.FIGHT_OR_FLIGHT] = FightOrFlightEncounter;
|
||||||
allMysteryEncounters[MysteryEncounterType.TRAINING_SESSION] = TrainingSessionEncounter;
|
allMysteryEncounters[MysteryEncounterType.TRAINING_SESSION] = TrainingSessionEncounter;
|
||||||
allMysteryEncounters[MysteryEncounterType.SLEEPING_SNORLAX] = SleepingSnorlaxEncounter;
|
allMysteryEncounters[MysteryEncounterType.SLEEPING_SNORLAX] = SleepingSnorlaxEncounter;
|
||||||
@ -98,15 +200,49 @@ export function initMysteryEncounters() {
|
|||||||
allMysteryEncounters[MysteryEncounterType.SHADY_VITAMIN_DEALER] = ShadyVitaminDealerEncounter;
|
allMysteryEncounters[MysteryEncounterType.SHADY_VITAMIN_DEALER] = ShadyVitaminDealerEncounter;
|
||||||
allMysteryEncounters[MysteryEncounterType.FIELD_TRIP] = FieldTripEncounter;
|
allMysteryEncounters[MysteryEncounterType.FIELD_TRIP] = FieldTripEncounter;
|
||||||
|
|
||||||
// Append encounters that can occur in any biome to biome map
|
// Add extreme encounters to biome map
|
||||||
const anyBiomeEncounters: MysteryEncounterType[] = Object.keys(MysteryEncounterType).filter(e => !isNaN(Number(e))).map(k => Number(k) as MysteryEncounterType);
|
extremeBiomeEncounters.forEach(encounter => {
|
||||||
mysteryEncountersByBiome.forEach(biomeEncounters => {
|
EXTREME_ENCOUNTER_BIOMES.forEach(biome => {
|
||||||
biomeEncounters.forEach(e => {
|
const encountersForBiome = mysteryEncountersByBiome.get(biome);
|
||||||
if (anyBiomeEncounters.includes(e)) {
|
if (!encountersForBiome.includes(encounter)) {
|
||||||
anyBiomeEncounters.splice(anyBiomeEncounters.indexOf(e), 1);
|
encountersForBiome.push(encounter);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// Add non-extreme encounters to biome map
|
||||||
|
nonExtremeBiomeEncounters.forEach(encounter => {
|
||||||
|
NON_EXTREME_ENCOUNTER_BIOMES.forEach(biome => {
|
||||||
|
const encountersForBiome = mysteryEncountersByBiome.get(biome);
|
||||||
|
if (!encountersForBiome.includes(encounter)) {
|
||||||
|
encountersForBiome.push(encounter);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// Add human encounters to biome map
|
||||||
|
humanTransitableBiomeEncounters.forEach(encounter => {
|
||||||
|
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
|
||||||
|
const encountersForBiome = mysteryEncountersByBiome.get(biome);
|
||||||
|
if (!encountersForBiome.includes(encounter)) {
|
||||||
|
encountersForBiome.push(encounter);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// Add civilization encounters to biome map
|
||||||
|
civilizationBiomeEncounters.forEach(encounter => {
|
||||||
|
CIVILIZATION_ENCOUNTER_BIOMES.forEach(biome => {
|
||||||
|
const encountersForBiome = mysteryEncountersByBiome.get(biome);
|
||||||
|
if (!encountersForBiome.includes(encounter)) {
|
||||||
|
encountersForBiome.push(encounter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
mysteryEncountersByBiome.forEach(biomeEncounters => biomeEncounters.push(...anyBiomeEncounters));
|
// Add ANY biome encounters to biome map
|
||||||
|
mysteryEncountersByBiome.forEach(biomeEncounters => {
|
||||||
|
anyBiomeEncounters.forEach(encounter => {
|
||||||
|
if (!biomeEncounters.includes(encounter)) {
|
||||||
|
biomeEncounters.push(encounter);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
|
||||||
|
export const STEALING_MOVES = [
|
||||||
|
Moves.PLUCK,
|
||||||
|
Moves.COVET,
|
||||||
|
Moves.KNOCK_OFF,
|
||||||
|
Moves.FAKE_OUT,
|
||||||
|
Moves.THIEF,
|
||||||
|
Moves.TRICK,
|
||||||
|
Moves.SWITCHEROO
|
||||||
|
];
|
||||||
|
|
||||||
|
export const DISTRACTION_MOVES = [
|
||||||
|
Moves.FAKE_OUT,
|
||||||
|
Moves.FOLLOW_ME,
|
||||||
|
Moves.TAUNT,
|
||||||
|
Moves.ROAR,
|
||||||
|
Moves.TELEPORT,
|
||||||
|
Moves.CHARM,
|
||||||
|
Moves.FAKE_TEARS,
|
||||||
|
Moves.TICKLE,
|
||||||
|
Moves.CAPTIVATE,
|
||||||
|
Moves.RAGE_POWDER,
|
||||||
|
Moves.SUBSTITUTE,
|
||||||
|
Moves.SHED_TAIL
|
||||||
|
];
|
||||||
|
|
||||||
|
export const PROTECTING_MOVES = [
|
||||||
|
Moves.PROTECT,
|
||||||
|
Moves.WIDE_GUARD,
|
||||||
|
Moves.MAX_GUARD,
|
||||||
|
Moves.SAFEGUARD,
|
||||||
|
Moves.REFLECT,
|
||||||
|
Moves.BARRIER,
|
||||||
|
Moves.QUICK_GUARD,
|
||||||
|
Moves.FLOWER_SHIELD,
|
||||||
|
Moves.KINGS_SHIELD,
|
||||||
|
Moves.CRAFTY_SHIELD,
|
||||||
|
Moves.SPIKY_SHIELD,
|
||||||
|
Moves.OBSTRUCT,
|
||||||
|
Moves.DETECT
|
||||||
|
];
|
@ -43,14 +43,14 @@ export const mysteryEncounter: SimpleTranslationEntries = {
|
|||||||
"fight_or_flight_option_1_tooltip": "(-) Hard Battle\n(+) New Item",
|
"fight_or_flight_option_1_tooltip": "(-) Hard Battle\n(+) New Item",
|
||||||
"fight_or_flight_option_2_label": "Steal the item",
|
"fight_or_flight_option_2_label": "Steal the item",
|
||||||
"fight_or_flight_option_2_tooltip": "@[SUMMARY_GREEN]{(35%) Steal Item}\n@[SUMMARY_BLUE]{(65%) Harder Battle}",
|
"fight_or_flight_option_2_tooltip": "@[SUMMARY_GREEN]{(35%) Steal Item}\n@[SUMMARY_BLUE]{(65%) Harder Battle}",
|
||||||
"fight_or_flight_option_2_steal_tooltip": "@[SUMMARY_GREEN]{(?) Use a Pokémon Move}",
|
"fight_or_flight_option_2_steal_tooltip": "(+) @ec{option2PrimaryName} uses @ec{option2PrimaryMove}",
|
||||||
"fight_or_flight_option_3_label": "Leave",
|
"fight_or_flight_option_3_label": "Leave",
|
||||||
"fight_or_flight_option_3_tooltip": "(-) No Rewards",
|
"fight_or_flight_option_3_tooltip": "(-) No Rewards",
|
||||||
"fight_or_flight_option_1_selected_message": "You approach the\nPokémon without fear.",
|
"fight_or_flight_option_1_selected_message": "You approach the\nPokémon without fear.",
|
||||||
"fight_or_flight_option_2_good_result": `.@d{32}.@d{32}.@d{32}
|
"fight_or_flight_option_2_good_result": `.@d{32}.@d{32}.@d{32}
|
||||||
$You manage to sneak your way\npast and grab the item!`,
|
$You manage to sneak your way\npast and grab the item!`,
|
||||||
"fight_or_flight_option_2_steal_result": `.@d{32}.@d{32}.@d{32}
|
"fight_or_flight_option_2_steal_result": `.@d{32}.@d{32}.@d{32}
|
||||||
$Your @ec{thiefPokemon} helps you out and uses @ec{move}!
|
$Your @ec{option2PrimaryName} helps you out and uses @ec{option2PrimaryMove}!
|
||||||
$ You nabbed the item!`,
|
$ You nabbed the item!`,
|
||||||
"fight_or_flight_option_2_bad_result": `.@d{32}.@d{32}.@d{32}
|
"fight_or_flight_option_2_bad_result": `.@d{32}.@d{32}.@d{32}
|
||||||
$The Pokémon catches you\nas you try to sneak around!`,
|
$The Pokémon catches you\nas you try to sneak around!`,
|
||||||
|
@ -110,7 +110,7 @@ export default class MysteryEncounterUiHandler extends UiHandler {
|
|||||||
this.unblockInput();
|
this.unblockInput();
|
||||||
}, 300);
|
}, 300);
|
||||||
});
|
});
|
||||||
} else if (this.blockInput || !this.optionsMeetsReqs[cursor]) {
|
} else if (this.blockInput || (!this.optionsMeetsReqs[cursor] && this.filteredEncounterOptions[cursor].isDisabledOnRequirementsNotMet)) {
|
||||||
success = false;
|
success = false;
|
||||||
} else {
|
} else {
|
||||||
const selected = this.filteredEncounterOptions[cursor];
|
const selected = this.filteredEncounterOptions[cursor];
|
||||||
@ -253,7 +253,7 @@ export default class MysteryEncounterUiHandler extends UiHandler {
|
|||||||
if (this.blockInput) {
|
if (this.blockInput) {
|
||||||
this.blockInput = false;
|
this.blockInput = false;
|
||||||
for (let i = 0; i < this.optionsContainer.length - 1; i++) {
|
for (let i = 0; i < this.optionsContainer.length - 1; i++) {
|
||||||
if (!this.optionsMeetsReqs[i]) {
|
if (!this.optionsMeetsReqs[i] && this.filteredEncounterOptions[i].isDisabledOnRequirementsNotMet) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
(this.optionsContainer.getAt(i) as Phaser.GameObjects.Text).setAlpha(1);
|
(this.optionsContainer.getAt(i) as Phaser.GameObjects.Text).setAlpha(1);
|
||||||
@ -334,9 +334,7 @@ export default class MysteryEncounterUiHandler extends UiHandler {
|
|||||||
optionText.setText(text);
|
optionText.setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.optionsMeetsReqs[i] && this.filteredEncounterOptions[i].isDisabledOnRequirementsNotMet) {
|
||||||
|
|
||||||
if (!this.optionsMeetsReqs[i]) {
|
|
||||||
optionText.setAlpha(0.5);
|
optionText.setAlpha(0.5);
|
||||||
}
|
}
|
||||||
if (this.blockInput) {
|
if (this.blockInput) {
|
||||||
@ -424,7 +422,7 @@ export default class MysteryEncounterUiHandler extends UiHandler {
|
|||||||
const mysteryEncounter = this.scene.currentBattle.mysteryEncounter;
|
const mysteryEncounter = this.scene.currentBattle.mysteryEncounter;
|
||||||
let text;
|
let text;
|
||||||
const option = mysteryEncounter.dialogue.encounterOptionsDialogue.options[cursor];
|
const option = mysteryEncounter.dialogue.encounterOptionsDialogue.options[cursor];
|
||||||
if (!this.optionsMeetsReqs[cursor] && option.disabledTooltip) {
|
if (!this.optionsMeetsReqs[cursor] && this.filteredEncounterOptions[cursor].isDisabledOnRequirementsNotMet && option.disabledTooltip) {
|
||||||
text = getEncounterText(this.scene, option.disabledTooltip, TextStyle.TOOLTIP_CONTENT);
|
text = getEncounterText(this.scene, option.disabledTooltip, TextStyle.TOOLTIP_CONTENT);
|
||||||
} else {
|
} else {
|
||||||
text = getEncounterText(this.scene, option.buttonTooltip, TextStyle.TOOLTIP_CONTENT);
|
text = getEncounterText(this.scene, option.buttonTooltip, TextStyle.TOOLTIP_CONTENT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user