Merge branch 'beta' into betaBanner

This commit is contained in:
Mumble 2024-08-30 19:46:35 -07:00 committed by GitHub
commit e1bdeaf195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 74630 additions and 34 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,886 @@
{
"id": 216,
"graphic": "PRAS- Love",
"frames": [
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": 0.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 3,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -6.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 3,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": 18.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 3,
"opacity": 135,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -3,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -10,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": 14.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 3,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -7,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -13.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": 10.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -10.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -17,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": 6.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -14.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -21,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": 2.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -18,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -24.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": -1,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -22,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -28,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": -5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -25.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -31.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": -9,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -29,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -35,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 255,
"priority": 1,
"focus": 2
},
{
"x": -0.5,
"y": -13,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -33,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 130,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -39,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 130,
"priority": 1,
"focus": 2
},
{
"x": 0,
"y": -16.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 255,
"priority": 1,
"focus": 2
}
],
[
{
"x": 8,
"y": -2,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 27,
"y": -37,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 70,
"priority": 1,
"focus": 2
},
{
"x": -30,
"y": -43.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 5,
"opacity": 70,
"priority": 1,
"focus": 2
},
{
"x": 0,
"y": -20.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 130,
"priority": 1,
"focus": 2
}
],
[
{
"x": 16,
"y": -6,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 0,
"y": -24.5,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 4,
"opacity": 70,
"priority": 1,
"focus": 2
}
],
[
{
"x": 24,
"y": -8,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 124,
"y": -58,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 6,
"opacity": 255,
"priority": 1,
"focus": 3
}
],
[
{
"x": 12,
"y": -4,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 124,
"y": -58,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 6,
"opacity": 255,
"priority": 1,
"focus": 3
}
],
[
{
"x": 0,
"y": 0,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 0,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 128,
"y": -64,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 1,
"graphicFrame": 0,
"opacity": 255,
"locked": true,
"priority": 1,
"focus": 3
},
{
"x": 124,
"y": -58,
"zoomX": 100,
"zoomY": 100,
"visible": true,
"target": 2,
"graphicFrame": 6,
"opacity": 130,
"priority": 1,
"focus": 3
}
]
],
"frameTimedEvents": {
"0": [
{
"frameIndex": 0,
"resourceName": "PRSFX- Return1.wav",
"volume": 100,
"pitch": 100,
"eventType": "AnimTimedSoundEvent"
}
],
"11": [
{
"frameIndex": 11,
"resourceName": "PRSFX- Return2.wav",
"volume": 100,
"pitch": 100,
"eventType": "AnimTimedSoundEvent"
}
]
},
"position": 3,
"hue": 0
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4498,7 +4498,7 @@ async function applyAbAttrsInternal<TAttr extends AbAttr>(
applyFunc: AbAttrApplyFunc<TAttr>, applyFunc: AbAttrApplyFunc<TAttr>,
args: any[], args: any[],
showAbilityInstant: boolean = false, showAbilityInstant: boolean = false,
quiet: boolean = false, simulated: boolean = false,
messages: string[] = [], messages: string[] = [],
) { ) {
for (const passive of [false, true]) { for (const passive of [false, true]) {
@ -4520,33 +4520,29 @@ async function applyAbAttrsInternal<TAttr extends AbAttr>(
if (result instanceof Promise) { if (result instanceof Promise) {
result = await result; result = await result;
} }
if (result) { if (result) {
if (pokemon.summonData && !pokemon.summonData.abilitiesApplied.includes(ability.id)) { if (pokemon.summonData && !pokemon.summonData.abilitiesApplied.includes(ability.id)) {
pokemon.summonData.abilitiesApplied.push(ability.id); pokemon.summonData.abilitiesApplied.push(ability.id);
} }
if (pokemon.battleData && !quiet && !pokemon.battleData.abilitiesApplied.includes(ability.id)) { if (pokemon.battleData && !simulated && !pokemon.battleData.abilitiesApplied.includes(ability.id)) {
pokemon.battleData.abilitiesApplied.push(ability.id); pokemon.battleData.abilitiesApplied.push(ability.id);
} }
if (attr.showAbility && !simulated) {
if (attr.showAbility && !quiet) {
if (showAbilityInstant) { if (showAbilityInstant) {
pokemon.scene.abilityBar.showAbility(pokemon, passive); pokemon.scene.abilityBar.showAbility(pokemon, passive);
} else { } else {
queueShowAbility(pokemon, passive); queueShowAbility(pokemon, passive);
} }
} }
if (!quiet) {
const message = attr.getTriggerMessage(pokemon, ability.name, args); const message = attr.getTriggerMessage(pokemon, ability.name, args);
if (message) { if (message) {
if (!simulated) {
pokemon.scene.queueMessage(message); pokemon.scene.queueMessage(message);
messages.push(message);
} }
} }
messages.push(message!);
} }
} }
pokemon.scene.clearPhaseQueueSplice(); pokemon.scene.clearPhaseQueueSplice();
} }
} }

View File

@ -341,8 +341,8 @@ export class LoadingScene extends SceneBase {
this.loadLoadingScreen(); this.loadLoadingScreen();
initVouchers();
initAchievements(); initAchievements();
initVouchers();
initStatsKeys(); initStatsKeys();
initPokemonPrevolutions(); initPokemonPrevolutions();
initBiomes(); initBiomes();

View File

@ -47,7 +47,7 @@ export class EnemyCommandPhase extends FieldPhase {
const trapTag = enemyPokemon.findTag(t => t instanceof TrappedTag) as TrappedTag; const trapTag = enemyPokemon.findTag(t => t instanceof TrappedTag) as TrappedTag;
const trapped = new Utils.BooleanHolder(false); const trapped = new Utils.BooleanHolder(false);
opponents.forEach(playerPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, playerPokemon, trapped, enemyPokemon, [], true)); opponents.forEach(playerPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, playerPokemon, trapped, enemyPokemon, [""], true));
if (!trapTag && !trapped.value) { if (!trapTag && !trapped.value) {
const partyMemberScores = trainer.getPartyMemberMatchupScores(enemyPokemon.trainerSlot, true); const partyMemberScores = trainer.getPartyMemberMatchupScores(enemyPokemon.trainerSlot, true);

View File

@ -1,7 +1,7 @@
import { clientSessionId } from "#app/account"; import { clientSessionId } from "#app/account";
import BattleScene from "#app/battle-scene"; import BattleScene from "#app/battle-scene";
import { BattleType } from "#app/battle"; import { BattleType } from "#app/battle";
import { miscDialogue, getCharVariantFromDialogue } from "#app/data/dialogue"; import { getCharVariantFromDialogue } from "#app/data/dialogue";
import { pokemonEvolutions } from "#app/data/pokemon-evolutions"; import { pokemonEvolutions } from "#app/data/pokemon-evolutions";
import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species"; import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species";
import { trainerConfigs } from "#app/data/trainer-config"; import { trainerConfigs } from "#app/data/trainer-config";
@ -136,12 +136,16 @@ export class GameOverPhase extends BattlePhase {
}; };
if (this.victory && this.scene.gameMode.isClassic) { if (this.victory && this.scene.gameMode.isClassic) {
const message = miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1]; const dialogueKey = "miscDialogue:ending";
if (!this.scene.ui.shouldSkipDialogue(message)) { if (!this.scene.ui.shouldSkipDialogue(dialogueKey)) {
this.scene.ui.fadeIn(500).then(() => { this.scene.ui.fadeIn(500).then(() => {
this.scene.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(miscDialogue.ending[this.scene.gameData.gender === PlayerGender.FEMALE ? 0 : 1])).then(() => { const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
this.scene.ui.showDialogue(message, this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => { const genderStr = PlayerGender[genderIndex].toLowerCase();
// Dialogue has to be retrieved so that the rival's expressions can be loaded and shown via getCharVariantFromDialogue
const dialogue = i18next.t(dialogueKey, { context: genderStr });
this.scene.charSprite.showCharacter(`rival_${this.scene.gameData.gender === PlayerGender.FEMALE ? "m" : "f"}`, getCharVariantFromDialogue(dialogue)).then(() => {
this.scene.ui.showDialogue(dialogueKey, this.scene.gameData.gender === PlayerGender.FEMALE ? trainerConfigs[TrainerType.RIVAL].name : trainerConfigs[TrainerType.RIVAL].nameFemale, null, () => {
this.scene.ui.fadeOut(500).then(() => { this.scene.ui.fadeOut(500).then(() => {
this.scene.charSprite.hide().then(() => { this.scene.charSprite.hide().then(() => {
const endCardPhase = new EndCardPhase(this.scene); const endCardPhase = new EndCardPhase(this.scene);

View File

@ -324,7 +324,7 @@ export const achvs = {
HATCH_SHINY: new Achv("HATCH_SHINY", "", "HATCH_SHINY.description", "golden_egg", 100).setSecret(), HATCH_SHINY: new Achv("HATCH_SHINY", "", "HATCH_SHINY.description", "golden_egg", 100).setSecret(),
HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY", "", "HIDDEN_ABILITY.description", "ability_charm", 75), HIDDEN_ABILITY: new Achv("HIDDEN_ABILITY", "", "HIDDEN_ABILITY.description", "ability_charm", 75),
PERFECT_IVS: new Achv("PERFECT_IVS", "", "PERFECT_IVS.description", "blunder_policy", 100), PERFECT_IVS: new Achv("PERFECT_IVS", "", "PERFECT_IVS.description", "blunder_policy", 100),
CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY", "", "CLASSIC_VICTORY.description", "relic_crown", 150), CLASSIC_VICTORY: new Achv("CLASSIC_VICTORY", "", "CLASSIC_VICTORY.description", "relic_crown", 150, c => c.gameData.gameStats.sessionsWon === 0),
UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getParty().some(p => p.getSpeciesForm(true).speciesId in pokemonEvolutions)), UNEVOLVED_CLASSIC_VICTORY: new Achv("UNEVOLVED_CLASSIC_VICTORY", "", "UNEVOLVED_CLASSIC_VICTORY.description", "eviolite", 175, c => c.getParty().some(p => p.getSpeciesForm(true).speciesId in pokemonEvolutions)),
MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE", "", "MONO_GEN_ONE.description", "ribbon_gen1", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), MONO_GEN_ONE_VICTORY: new ChallengeAchv("MONO_GEN_ONE", "", "MONO_GEN_ONE.description", "ribbon_gen1", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 1 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)),
MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)), MONO_GEN_TWO_VICTORY: new ChallengeAchv("MONO_GEN_TWO", "", "MONO_GEN_TWO.description", "ribbon_gen2", 100, (c, scene) => c instanceof SingleGenerationChallenge && c.value === 2 && !scene.gameMode.challenges.some(c => c.id === Challenges.INVERSE_BATTLE && c.value > 0)),

View File

@ -33,18 +33,18 @@ describe("Moves - Miracle Eye", () => {
}); });
it("should allow Psychic moves to hit Dark types", async () => { it("should allow Psychic moves to hit Dark types", async () => {
await game.startBattle(); await game.classicMode.startBattle();
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
game.move.select(Moves.CONFUSION); game.move.select(Moves.CONFUSION);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.toNextTurn(); await game.toNextTurn();
expect(enemy.hp).toBe(enemy.getMaxHp()); expect(enemy.hp).toBe(enemy.getMaxHp());
game.move.select(Moves.MIRACLE_EYE); game.move.select(Moves.MIRACLE_EYE);
await game.toNextTurn(); await game.toNextTurn();
game.move.select(Moves.CONFUSION); game.move.select(Moves.CONFUSION);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to(MoveEffectPhase); await game.phaseInterceptor.to(MoveEffectPhase);
expect(enemy.hp).toBeLessThan(enemy.getMaxHp()); expect(enemy.hp).toBeLessThan(enemy.getMaxHp());

View File

@ -106,7 +106,7 @@ export default class MenuUiHandler extends MessageUiHandler {
render() { render() {
const ui = this.getUi(); const ui = this.getUi();
this.excludedMenus = () => [ this.excludedMenus = () => [
{ condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain()[0]), options: [MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] }, { condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain().at(-1)!), options: [MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] },
{ condition: bypassLogin, options: [MenuOptions.LOG_OUT] } { condition: bypassLogin, options: [MenuOptions.LOG_OUT] }
]; ];

View File

@ -306,30 +306,32 @@ export default class UI extends Phaser.GameObjects.Container {
} }
} }
showDialogue(i18nKey: string, name: string | undefined, delay: integer | null = 0, callback: Function, callbackDelay?: integer, promptDelay?: integer): void { showDialogue(keyOrText: string, name: string | undefined, delay: integer | null = 0, callback: Function, callbackDelay?: integer, promptDelay?: integer): void {
const battleScene = this.scene as BattleScene; const battleScene = this.scene as BattleScene;
// Get localized dialogue (if available) // Get localized dialogue (if available)
let hasi18n = false; let hasi18n = false;
if (i18next.exists(i18nKey) ) { let text = keyOrText;
const genderIndex = battleScene.gameData.gender ?? PlayerGender.UNSET; const genderIndex = battleScene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase(); const genderStr = PlayerGender[genderIndex].toLowerCase();
i18nKey = i18next.t(i18nKey, { context: genderStr });
if (i18next.exists(keyOrText) ) {
const i18nKey = keyOrText;
hasi18n = true; hasi18n = true;
text = i18next.t(i18nKey, { context: genderStr }); // override text with translation
// Skip dialogue if the player has enabled the option and the dialogue has been already seen // Skip dialogue if the player has enabled the option and the dialogue has been already seen
if (battleScene.skipSeenDialogues &&battleScene.gameData.getSeenDialogues()[i18nKey] === true) { if (battleScene.skipSeenDialogues && battleScene.gameData.getSeenDialogues()[i18nKey] === true) {
console.log(`Dialogue ${i18nKey} skipped`); console.log(`Dialogue ${i18nKey} skipped`);
callback(); callback();
return; return;
} }
} }
let showMessageAndCallback = () => { let showMessageAndCallback = () => {
hasi18n && battleScene.gameData.saveSeenDialogue(i18nKey); hasi18n && battleScene.gameData.saveSeenDialogue(keyOrText);
callback(); callback();
}; };
if (i18nKey.indexOf("$") > -1) { if (text.indexOf("$") > -1) {
const messagePages = i18nKey.split(/\$/g).map(m => m.trim()); const messagePages = text.split(/\$/g).map(m => m.trim());
for (let p = messagePages.length - 1; p >= 0; p--) { for (let p = messagePages.length - 1; p >= 0; p--) {
const originalFunc = showMessageAndCallback; const originalFunc = showMessageAndCallback;
showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc); showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc);
@ -338,9 +340,9 @@ export default class UI extends Phaser.GameObjects.Container {
} else { } else {
const handler = this.getHandler(); const handler = this.getHandler();
if (handler instanceof MessageUiHandler) { if (handler instanceof MessageUiHandler) {
(handler as MessageUiHandler).showDialogue(i18nKey, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay); (handler as MessageUiHandler).showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
} else { } else {
this.getMessageHandler().showDialogue(i18nKey, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay); this.getMessageHandler().showDialogue(text, name, delay, showMessageAndCallback, callbackDelay, true, promptDelay);
} }
} }
} }