mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 02:32:21 +02:00
Compare commits
5 Commits
7490699bef
...
63fba0dcae
Author | SHA1 | Date | |
---|---|---|---|
|
63fba0dcae | ||
|
baf686f621 | ||
|
4bdaf93c72 | ||
|
a98ec39d00 | ||
|
48430c8feb |
@ -16,6 +16,14 @@ import { TrainerType } from "#enums/trainer-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||
import { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
|
||||
export enum ClassicFixedBossWaves {
|
||||
// TODO: other fixed wave battles should be added here
|
||||
EVIL_BOSS_1 = 115,
|
||||
EVIL_BOSS_2 = 165,
|
||||
}
|
||||
|
||||
export enum BattleType {
|
||||
WILD,
|
||||
@ -419,6 +427,7 @@ export class FixedBattleConfig {
|
||||
public getTrainer: GetTrainerFunc;
|
||||
public getEnemyParty: GetEnemyPartyFunc;
|
||||
public seedOffsetWaveIndex: number;
|
||||
public customModifierRewardSettings?: CustomModifierSettings;
|
||||
|
||||
setBattleType(battleType: BattleType): FixedBattleConfig {
|
||||
this.battleType = battleType;
|
||||
@ -444,6 +453,11 @@ export class FixedBattleConfig {
|
||||
this.seedOffsetWaveIndex = seedOffsetWaveIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
setCustomModifierRewards(customModifierRewardSettings: CustomModifierSettings) {
|
||||
this.customModifierRewardSettings = customModifierRewardSettings;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -503,11 +517,13 @@ export const classicFixedBattles: FixedBattleConfigs = {
|
||||
[8]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
||||
[25]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_2, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_2, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], allowLuckUpgrades: false }),
|
||||
[35]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
||||
[55]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_3, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_3, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], allowLuckUpgrades: false }),
|
||||
[62]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
||||
[64]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
@ -515,17 +531,21 @@ export const classicFixedBattles: FixedBattleConfigs = {
|
||||
[66]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true)),
|
||||
[95]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_4, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_4, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||
[112]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
||||
[114]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true, 1)),
|
||||
[115]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_1, TrainerType.MAXIE, TrainerType.ARCHIE, TrainerType.CYRUS, TrainerType.GHETSIS, TrainerType.LYSANDRE, TrainerType.LUSAMINE, TrainerType.GUZMA, TrainerType.ROSE ])),
|
||||
[ClassicFixedBossWaves.EVIL_BOSS_1]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_1, TrainerType.MAXIE, TrainerType.ARCHIE, TrainerType.CYRUS, TrainerType.GHETSIS, TrainerType.LYSANDRE, TrainerType.LUSAMINE, TrainerType.GUZMA, TrainerType.ROSE ]))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||
[145]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_5, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
||||
[165]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_2, TrainerType.MAXIE_2, TrainerType.ARCHIE_2, TrainerType.CYRUS_2, TrainerType.GHETSIS_2, TrainerType.LYSANDRE_2, TrainerType.LUSAMINE_2, TrainerType.GUZMA_2, TrainerType.ROSE_2 ])),
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_5, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||
[ClassicFixedBossWaves.EVIL_BOSS_2]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_2, TrainerType.MAXIE_2, TrainerType.ARCHIE_2, TrainerType.CYRUS_2, TrainerType.GHETSIS_2, TrainerType.LYSANDRE_2, TrainerType.LUSAMINE_2, TrainerType.GUZMA_2, TrainerType.ROSE_2 ]))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||
[182]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.LORELEI, TrainerType.WILL, TrainerType.SIDNEY, TrainerType.AARON, TrainerType.SHAUNTAL, TrainerType.MALVA, [ TrainerType.HALA, TrainerType.MOLAYNE ], TrainerType.MARNIE_ELITE, TrainerType.RIKA, TrainerType.CRISPIN ])),
|
||||
[184]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(182)
|
||||
@ -538,4 +558,5 @@ export const classicFixedBattles: FixedBattleConfigs = {
|
||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.BLUE, [ TrainerType.RED, TrainerType.LANCE_CHAMPION ], [ TrainerType.STEVEN, TrainerType.WALLACE ], TrainerType.CYNTHIA, [ TrainerType.ALDER, TrainerType.IRIS ], TrainerType.DIANTHA, TrainerType.HAU, TrainerType.LEON, [ TrainerType.GEETA, TrainerType.NEMONA ], TrainerType.KIERAN ])),
|
||||
[195]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_6, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], allowLuckUpgrades: false })
|
||||
};
|
||||
|
@ -1 +1,5 @@
|
||||
export const PLAYER_PARTY_MAX_SIZE = 6;
|
||||
/** The maximum size of the player's party */
|
||||
export const PLAYER_PARTY_MAX_SIZE: number = 6;
|
||||
|
||||
/** Whether to use seasonal splash messages in general */
|
||||
export const USE_SEASONAL_SPLASH_MESSAGES: boolean = false;
|
||||
|
@ -1,46 +1,136 @@
|
||||
import i18next from "i18next";
|
||||
import { USE_SEASONAL_SPLASH_MESSAGES } from "#app/constants";
|
||||
|
||||
export function getBattleCountSplashMessage(): string {
|
||||
return `{COUNT} ${i18next.t("splashMessages:battlesWon")}`;
|
||||
//#region Interfaces/Types
|
||||
|
||||
type Month = "01" | "02" | "03" | "04" | "05" | "06" | "07" | "08" | "09" | "10" | "11" | "12";
|
||||
type Day =
|
||||
| Month
|
||||
| "13"
|
||||
| "14"
|
||||
| "15"
|
||||
| "16"
|
||||
| "17"
|
||||
| "18"
|
||||
| "19"
|
||||
| "20"
|
||||
| "21"
|
||||
| "22"
|
||||
| "23"
|
||||
| "24"
|
||||
| "25"
|
||||
| "26"
|
||||
| "27"
|
||||
| "28"
|
||||
| "29"
|
||||
| "30"
|
||||
| "31";
|
||||
|
||||
/**
|
||||
* Represents a season with its {@linkcode name},
|
||||
* {@linkcode start} day+month, {@linkcode end} day+month
|
||||
* and {@linkcode messages}.
|
||||
*/
|
||||
interface Season {
|
||||
/** The name of the season (internal use only) */
|
||||
name: string;
|
||||
/** The start day and month of the season. Format `MM-DD` */
|
||||
start: `${Month}-${Day}`;
|
||||
/** The end day and month of the season. Format `MM-DD` */
|
||||
end: `${Month}-${Day}`;
|
||||
/** Collection of the messages to display (without the `i18next.t()` call!) */
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
//#region Constants
|
||||
|
||||
/** The weight multiplier for the battles-won splash message */
|
||||
const BATTLES_WON_WEIGHT_MULTIPLIER = 10;
|
||||
/** The weight multiplier for the seasonal splash messages */
|
||||
const SEASONAL_WEIGHT_MULTIPLIER = 10;
|
||||
|
||||
//#region Common Messages
|
||||
|
||||
const commonSplashMessages = [
|
||||
...Array(BATTLES_WON_WEIGHT_MULTIPLIER).fill("battlesWon"),
|
||||
"joinTheDiscord",
|
||||
"infiniteLevels",
|
||||
"everythingStacks",
|
||||
"optionalSaveScumming",
|
||||
"biomes",
|
||||
"openSource",
|
||||
"playWithSpeed",
|
||||
"liveBugTesting",
|
||||
"heavyInfluence",
|
||||
"pokemonRiskAndPokemonRain",
|
||||
"nowWithMoreSalt",
|
||||
"infiniteFusionAtHome",
|
||||
"brokenEggMoves",
|
||||
"magnificent",
|
||||
"mubstitute",
|
||||
"thatsCrazy",
|
||||
"oranceJuice",
|
||||
"questionableBalancing",
|
||||
"coolShaders",
|
||||
"aiFree",
|
||||
"suddenDifficultySpikes",
|
||||
"basedOnAnUnfinishedFlashGame",
|
||||
"moreAddictiveThanIntended",
|
||||
"mostlyConsistentSeeds",
|
||||
"achievementPointsDontDoAnything",
|
||||
"youDoNotStartAtLevel",
|
||||
"dontTalkAboutTheManaphyEggIncident",
|
||||
"alsoTryPokengine",
|
||||
"alsoTryEmeraldRogue",
|
||||
"alsoTryRadicalRed",
|
||||
"eeveeExpo",
|
||||
"ynoproject",
|
||||
"breedersInSpace",
|
||||
];
|
||||
|
||||
//#region Seasonal Messages
|
||||
|
||||
const seasonalSplashMessages: Season[] = [
|
||||
{
|
||||
name: "Halloween",
|
||||
start: "09-15",
|
||||
end: "10-31",
|
||||
messages: ["halloween.pumpkaboosAbout", "halloween.mayContainSpiders", "halloween.spookyScaryDuskulls"],
|
||||
},
|
||||
{
|
||||
name: "XMAS",
|
||||
start: "12-01",
|
||||
end: "12-26",
|
||||
messages: ["xmas.happyHolidays", "xmas.delibirdSeason"],
|
||||
},
|
||||
{
|
||||
name: "New Year's",
|
||||
start: "01-01",
|
||||
end: "01-31",
|
||||
messages: ["newYears.happyNewYear"],
|
||||
},
|
||||
];
|
||||
|
||||
//#endregion
|
||||
|
||||
export function getSplashMessages(): string[] {
|
||||
const splashMessages = Array(10).fill(getBattleCountSplashMessage());
|
||||
splashMessages.push(
|
||||
i18next.t("splashMessages:joinTheDiscord"),
|
||||
i18next.t("splashMessages:infiniteLevels"),
|
||||
i18next.t("splashMessages:everythingStacks"),
|
||||
i18next.t("splashMessages:optionalSaveScumming"),
|
||||
i18next.t("splashMessages:biomes"),
|
||||
i18next.t("splashMessages:openSource"),
|
||||
i18next.t("splashMessages:playWithSpeed"),
|
||||
i18next.t("splashMessages:liveBugTesting"),
|
||||
i18next.t("splashMessages:heavyInfluence"),
|
||||
i18next.t("splashMessages:pokemonRiskAndPokemonRain"),
|
||||
i18next.t("splashMessages:nowWithMoreSalt"),
|
||||
i18next.t("splashMessages:infiniteFusionAtHome"),
|
||||
i18next.t("splashMessages:brokenEggMoves"),
|
||||
i18next.t("splashMessages:magnificent"),
|
||||
i18next.t("splashMessages:mubstitute"),
|
||||
i18next.t("splashMessages:thatsCrazy"),
|
||||
i18next.t("splashMessages:oranceJuice"),
|
||||
i18next.t("splashMessages:questionableBalancing"),
|
||||
i18next.t("splashMessages:coolShaders"),
|
||||
i18next.t("splashMessages:aiFree"),
|
||||
i18next.t("splashMessages:suddenDifficultySpikes"),
|
||||
i18next.t("splashMessages:basedOnAnUnfinishedFlashGame"),
|
||||
i18next.t("splashMessages:moreAddictiveThanIntended"),
|
||||
i18next.t("splashMessages:mostlyConsistentSeeds"),
|
||||
i18next.t("splashMessages:achievementPointsDontDoAnything"),
|
||||
i18next.t("splashMessages:youDoNotStartAtLevel"),
|
||||
i18next.t("splashMessages:dontTalkAboutTheManaphyEggIncident"),
|
||||
i18next.t("splashMessages:alsoTryPokengine"),
|
||||
i18next.t("splashMessages:alsoTryEmeraldRogue"),
|
||||
i18next.t("splashMessages:alsoTryRadicalRed"),
|
||||
i18next.t("splashMessages:eeveeExpo"),
|
||||
i18next.t("splashMessages:ynoproject"),
|
||||
i18next.t("splashMessages:breedersInSpace"),
|
||||
);
|
||||
const splashMessages: string[] = [...commonSplashMessages];
|
||||
console.log("use seasonal splash messages", USE_SEASONAL_SPLASH_MESSAGES);
|
||||
if (USE_SEASONAL_SPLASH_MESSAGES) {
|
||||
// add seasonal splash messages if the season is active
|
||||
for (const { name, start, end, messages } of seasonalSplashMessages) {
|
||||
const now = new Date();
|
||||
const startDate = new Date(`${start}-${now.getFullYear()}`);
|
||||
const endDate = new Date(`${end}-${now.getFullYear()}`);
|
||||
|
||||
return splashMessages;
|
||||
if (now >= startDate && now <= endDate) {
|
||||
console.log(`Adding ${messages.length} ${name} splash messages (weight: x${SEASONAL_WEIGHT_MULTIPLIER})`);
|
||||
messages.forEach((message) => {
|
||||
const weightedMessage = Array(SEASONAL_WEIGHT_MULTIPLIER).fill(message);
|
||||
splashMessages.push(...weightedMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return splashMessages.map((message) => `splashMessages:${message}`);
|
||||
}
|
||||
|
@ -3812,6 +3812,25 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
const rootForm = getPokemonSpecies(this.species.getRootSpeciesId());
|
||||
return rootForm.getAbility(abilityIndex) === rootForm.getAbility(currentAbilityIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to check if the player already owns the starter data of the Pokemon's
|
||||
* current ability
|
||||
* @param ownedAbilityAttrs the owned abilityAttr of this Pokemon's root form
|
||||
* @returns true if the player already has it, false otherwise
|
||||
*/
|
||||
checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs: number): boolean {
|
||||
if ((ownedAbilityAttrs & 1) > 0 && this.hasSameAbilityInRootForm(0)) {
|
||||
return true;
|
||||
}
|
||||
if ((ownedAbilityAttrs & 2) > 0 && this.hasSameAbilityInRootForm(1)) {
|
||||
return true;
|
||||
}
|
||||
if ((ownedAbilityAttrs & 4) > 0 && this.hasSameAbilityInRootForm(2)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export default interface Pokemon {
|
||||
|
@ -268,7 +268,6 @@ export class GameMode implements GameModeConfig {
|
||||
isFixedBattle(waveIndex: integer): boolean {
|
||||
const dummyConfig = new FixedBattleConfig();
|
||||
return this.battleConfig.hasOwnProperty(waveIndex) || applyChallenges(this, ChallengeType.FIXED_BATTLES, waveIndex, dummyConfig);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "Kämpfe gewonnen!",
|
||||
"battlesWon": "{{count, number}} Kämpfe gewonnen!",
|
||||
"joinTheDiscord": "Tritt dem Discord bei!",
|
||||
"infiniteLevels": "Unendliche Level!",
|
||||
"everythingStacks": "Alles stapelt sich!",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "Battles Won!",
|
||||
"battlesWon": "{{count, number}} Battles Won!",
|
||||
"joinTheDiscord": "Join the Discord!",
|
||||
"infiniteLevels": "Infinite Levels!",
|
||||
"everythingStacks": "Everything Stacks!",
|
||||
@ -32,5 +32,17 @@
|
||||
"alsoTryRadicalRed": "Also Try Radical Red!",
|
||||
"eeveeExpo": "Eevee Expo!",
|
||||
"ynoproject": "YNOproject!",
|
||||
"breedersInSpace": "Breeders in space!"
|
||||
"breedersInSpace": "Breeders in space!",
|
||||
"halloween": {
|
||||
"pumpkaboosAbout": "Pumpkaboos about!",
|
||||
"mayContainSpiders": "May contain spiders!",
|
||||
"spookyScaryDuskulls": "Spooky, Scary Duskulls!"
|
||||
},
|
||||
"xmas": {
|
||||
"happyHolidays": "Happy Holidays!",
|
||||
"delibirdSeason": "Delibird Season!"
|
||||
},
|
||||
"newYears": {
|
||||
"happyNewYear": "Happy New Year!"
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "¡Batallas ganadas!",
|
||||
"battlesWon": "¡{{count, number}} Batallas ganadas!",
|
||||
"joinTheDiscord": "¡Únete al Discord!",
|
||||
"infiniteLevels": "¡Niveles infinitos!",
|
||||
"everythingStacks": "¡Todo se acumula!",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "combats gagnés !",
|
||||
"battlesWon": "{{count, number}} combats gagnés !",
|
||||
"joinTheDiscord": "Rejoins le Discord !",
|
||||
"infiniteLevels": "Niveaux infinis !",
|
||||
"everythingStacks": "Tout se cumule !",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "Battaglie Vinte!",
|
||||
"battlesWon": "{{count, number}} Battaglie Vinte!",
|
||||
"joinTheDiscord": "Entra nel Discord!",
|
||||
"infiniteLevels": "Livelli Infiniti!",
|
||||
"everythingStacks": "Tutto si impila!",
|
||||
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"encounter": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.",
|
||||
"encounter_female": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.",
|
||||
"firstStageWin": "I see. The presence I felt was indeed real.\nIt appears I no longer need to hold back.\n$Do not disappoint me.",
|
||||
"secondStageWin": "…Magnificent.",
|
||||
"key_ordinal_one": "st",
|
||||
"key_ordinal_two": "nd",
|
||||
"key_ordinal_few": "rd",
|
||||
"key_ordinal_other": "th"
|
||||
"encounter": "又しても 時が満ちた 様 である。\nこちらへ 至る 理由は 存知するな。\n$汝は この場所へ 引かれた……\nこの何度となく 至った場所。\n$けれども 数えられぬとも 限らぬ……\n正確に宣ふ(のたまう)と 現在の 循環は {{cycleCount}}回目 である。\n$各循環に 心… 意識… 両方も 元の有様に 戻る。\nなれども 故吾の 残影は 汝の 中に 存する。\n$未だに 成功せぬ ままでも\n異なる 存在を 感ずる。\n$御座在る者は 一人。\nなれども 感ずるは… もう 他人。\n$到頭 汝から いかめしい 挑戦は 我が目にかかるか?\n千歳 万歳 相まってた挑戦……\n$始もう。",
|
||||
"encounter_female": "又しても 時が満ちた 様 である。\nこちらへ 至る 理由は 存知するな。\n$汝は この場所へ 引かれた……\nこの何度となく 至った場所。\n$けれども 数えられぬとも 限らぬ……\n正確に宣ふ(のたまう)と 現在の 循環は {{cycleCount}}回目 である。\n$各循環に 心… 意識… 両方も 元の有様に 戻る。\nなれども 故吾の 残影は 汝の 中に 存する。\n$未だに 成功せぬ ままでも\n異なる 存在を 感ずる。\n$御座在る者は 一人。\nなれども 感ずるは… もう 他人。\n$到頭 汝から いかめしい 挑戦は 我が目にかかるか?\n千歳 万歳 相まってた挑戦……\n$始もう。",
|
||||
"firstStageWin": "成る程。 感じた 存在は 正身(むざね) であった。\n自分を括る 必要 有らぬ 様である。\n$失望させぬが良い。",
|
||||
"secondStageWin": "……お見事でございます。",
|
||||
"key_ordinal_one": "",
|
||||
"key_ordinal_two": "",
|
||||
"key_ordinal_few": "",
|
||||
"key_ordinal_other": ""
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"ending": "@c{shock}You're back?@d{32} Does that mean…@d{96} you won?!\n@c{smile_ehalf}I should have known you had it in you.\n$@c{smile_eclosed}Of course… I always had that feeling.\n@c{smile}It's over now, right? You ended the loop.\n$@c{smile_ehalf}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$I'll be the only one to remember what you did.\n@c{angry_mopen}I'll try not to forget!\n$@c{smile_wave_wink}Just kidding!@d{64} @c{smile}I'd never forget.@d{32}\nYour legend will live on in our hearts.\n$@c{smile_wave}Anyway,@d{64} it's getting late…@d{96} I think?\nIt's hard to tell in this place.\n$Let's go home. @c{smile_wave_wink}Maybe tomorrow, we can have another battle, for old time's sake?",
|
||||
"ending_female": "@c{smile}Oh? You won?@d{96} @c{smile_eclosed}I guess I should've known.\nBut, you're back now.\n$@c{smile}It's over.@d{64} You ended the loop.\n$@c{serious_smile_fists}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$@c{neutral}I'm the only one who'll remember what you did.@d{96}\nI guess that's okay, isn't it?\n$@c{serious_smile_fists}Your legend will always live on in our hearts.\n$@c{smile_eclosed}Anyway, I've had about enough of this place, haven't you? Let's head home.\n$@c{serious_smile_fists}Maybe when we get back, we can have another battle?\nIf you're up to it.",
|
||||
"ending_endless": "Congratulations on reaching the current end!\nMore content is coming soon.",
|
||||
"ending_name": "Devs"
|
||||
"ending": "@c{shock}帰ってきた?@d{32} それなら…@d{96} 勝った っていうこと だろう?!\n@c{smile_ehalf}絶対 やれると思う べきだったな。\n$@c{smile_eclosed}もちろん、ずっと そんな気 がしたんだな。\n@c{smile}ついに 終わった だろう? ループを 断ち切った。\n$@c{smile_ehalf}キミの夢も 叶ったよな?\n一回も 負けなかった。\n$キミの しつくした事を 覚えるのは おれだけだ。\n@c{angry_mopen}忘れない ように するが…\n$@c{smile_wave_wink}なんつって!@d{64} @c{smile}一生 忘れない。@d{32}\nキミの伝説は いつまでも みんなの 心の中に 残っているから。\n$@c{smile_wave}とにかく、@d{64} そろそろ 遅くなる……@d{96} かな?\nこの場所で よく 分からない。\n$さあ、帰ろう。\n@c{smile_wave_wink}明日、昔のよしみで バトルでも しないか?",
|
||||
"ending_female": "@c{smile}えぇ? 勝ちゃった?@d{96} @c{smile_eclosed}勝てるのが 分かる べきだったね。\nやっぱり 帰ってきた…\n$@c{smile}ついに終わった。@d{64} ループを 断ち切った。\n$@c{serious_smile_fists} アナタの夢も 叶ったよね?\n一回も 負けなかった!\n$@c{neutral}アタシだけが アナタが できた事 を覚えていく、ね。@d{96}\nでもね、たぶん 大丈夫なの かなぁ?\n$@c{serious_smile_fists}アナタの伝説は みんなの 心の中に\nずっと 残っているからね……\n$@c{smile_eclosed}じゃあ、こんなトコは もう飽きた だろう?\n帰ろうよ。\n$@c{serious_smile_fists}ふるさとに 着いたら、 また バトルしよう?\nやる気 あればね!",
|
||||
"ending_endless": "現在のエンドまで やって来て おめでとう!\n更に多くの コンテンツは 近日公開予定です。",
|
||||
"ending_name": "開発者"
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
||||
"newGame": "はじめから",
|
||||
"settings": "設定",
|
||||
"selectGameMode": "ゲームモードを 選んでください。",
|
||||
"logInOrCreateAccount": "始めるには、ログイン、または 登録して ください。\nメールアドレスは 必要が ありません!",
|
||||
"logInOrCreateAccount": "始めるには、ログイン、または 登録して ください。\nメールアドレスは 必要 ありません!",
|
||||
"username": "ユーザー名",
|
||||
"password": "パスワード",
|
||||
"login": "ログイン",
|
||||
@ -14,7 +14,7 @@
|
||||
"register": "登録",
|
||||
"emptyUsername": "ユーザー名を 空にする ことは できません",
|
||||
"invalidLoginUsername": "入力されたユーザー名は無効です",
|
||||
"invalidRegisterUsername": "ユーザー名には 英文字、 数字、 アンダースコアのみを 含くむ必要が あります",
|
||||
"invalidRegisterUsername": "ユーザー名には 英文字、 数字、 アンダースコアのみを 含くむことが 必要です",
|
||||
"invalidLoginPassword": "入力したパスワードは無効です",
|
||||
"invalidRegisterPassword": "パスワードは 6文字以上 でなければなりません",
|
||||
"usernameAlreadyUsed": "入力したユーザー名は すでに 使用されています",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "Battles Won!",
|
||||
"battlesWon": "勝ったバトル:{{count, number}}回!",
|
||||
"joinTheDiscord": "Join the Discord!",
|
||||
"infiniteLevels": "Infinite Levels!",
|
||||
"everythingStacks": "Everything Stacks!",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "전투에서 승리하세요!",
|
||||
"battlesWon": "{{count, number}} 전투에서 승리하세요!",
|
||||
"joinTheDiscord": "디스코드에 가입하세요!",
|
||||
"infiniteLevels": "무한한 레벨!",
|
||||
"everythingStacks": "모든 것이 누적됩니다!",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "Batalhas Ganhas!",
|
||||
"battlesWon": "{{count, number}} Batalhas Ganhas!",
|
||||
"joinTheDiscord": "Junte-se ao Discord!",
|
||||
"infiniteLevels": "Níveis Infinitos!",
|
||||
"everythingStacks": "Tudo Acumula!",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "场胜利!",
|
||||
"battlesWon": "{{count, number}} 场胜利!",
|
||||
"joinTheDiscord": "加入Discord!",
|
||||
"infiniteLevels": "等级无限!",
|
||||
"everythingStacks": "道具全部叠加!",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"battlesWon": "勝利場數!",
|
||||
"battlesWon": "{{count, number}} 勝利場數!",
|
||||
"joinTheDiscord": "加入Discord!",
|
||||
"infiniteLevels": "無限等級!",
|
||||
"everythingStacks": "所有效果都能疊加!",
|
||||
|
@ -1761,7 +1761,7 @@ const modifierPool: ModifierPool = {
|
||||
new WeightedModifierType(modifierTypes.ABILITY_CHARM, skipInClassicAfterWave(189, 6)),
|
||||
new WeightedModifierType(modifierTypes.FOCUS_BAND, 5),
|
||||
new WeightedModifierType(modifierTypes.KINGS_ROCK, 3),
|
||||
new WeightedModifierType(modifierTypes.LOCK_CAPSULE, skipInLastClassicWaveOrDefault(3)),
|
||||
new WeightedModifierType(modifierTypes.LOCK_CAPSULE, (party: Pokemon[]) => party[0].scene.gameMode.isClassic ? 0 : 3),
|
||||
new WeightedModifierType(modifierTypes.SUPER_EXP_CHARM, skipInLastClassicWaveOrDefault(8)),
|
||||
new WeightedModifierType(modifierTypes.RARE_FORM_CHANGE_ITEM, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 6, 24),
|
||||
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36),
|
||||
|
@ -1,6 +1,6 @@
|
||||
import BattleScene from "#app/battle-scene";
|
||||
import { BattlerIndex, BattleType } from "#app/battle";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { BattlerIndex, BattleType, ClassicFixedBossWaves } from "#app/battle";
|
||||
import { CustomModifierSettings, modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { BattleEndPhase } from "./battle-end-phase";
|
||||
import { NewBattlePhase } from "./new-battle-phase";
|
||||
import { PokemonPhase } from "./pokemon-phase";
|
||||
@ -42,8 +42,12 @@ export class VictoryPhase extends PokemonPhase {
|
||||
}
|
||||
if (this.scene.gameMode.isEndless || !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) {
|
||||
this.scene.pushPhase(new EggLapsePhase(this.scene));
|
||||
if (this.scene.gameMode.isClassic && this.scene.currentBattle.waveIndex === ClassicFixedBossWaves.EVIL_BOSS_2) {
|
||||
// Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop
|
||||
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.LOCK_CAPSULE));
|
||||
}
|
||||
if (this.scene.currentBattle.waveIndex % 10) {
|
||||
this.scene.pushPhase(new SelectModifierPhase(this.scene));
|
||||
this.scene.pushPhase(new SelectModifierPhase(this.scene, undefined, undefined, this.getFixedBattleCustomModifiers()));
|
||||
} else if (this.scene.gameMode.isDaily) {
|
||||
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.EXP_CHARM));
|
||||
if (this.scene.currentBattle.waveIndex > 10 && !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) {
|
||||
@ -76,4 +80,18 @@ export class VictoryPhase extends PokemonPhase {
|
||||
|
||||
this.end();
|
||||
}
|
||||
|
||||
/**
|
||||
* If this wave is a fixed battle with special custom modifier rewards,
|
||||
* will pass those settings to the upcoming {@linkcode SelectModifierPhase}`.
|
||||
*/
|
||||
getFixedBattleCustomModifiers(): CustomModifierSettings | undefined {
|
||||
const gameMode = this.scene.gameMode;
|
||||
const waveIndex = this.scene.currentBattle.waveIndex;
|
||||
if (gameMode.isFixedBattle(waveIndex)) {
|
||||
return gameMode.getFixedBattle(waveIndex).customModifierRewardSettings;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
66
src/test/data/splash_messages.test.ts
Normal file
66
src/test/data/splash_messages.test.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import { getSplashMessages } from "#app/data/splash-messages";
|
||||
import { describe, expect, it, vi, afterEach, beforeEach } from "vitest";
|
||||
import * as Constants from "#app/constants";
|
||||
|
||||
describe("Data - Splash Messages", () => {
|
||||
it("should contain at least 15 splash messages", () => {
|
||||
expect(getSplashMessages().length).toBeGreaterThanOrEqual(15);
|
||||
});
|
||||
|
||||
// make sure to adjust this test if the weight it changed!
|
||||
it("should add contain 10 `battlesWon` splash messages", () => {
|
||||
const battlesWonMessages = getSplashMessages().filter((message) => message === "splashMessages:battlesWon");
|
||||
expect(battlesWonMessages).toHaveLength(10);
|
||||
});
|
||||
|
||||
describe("Seasonal", () => {
|
||||
beforeEach(() => {
|
||||
vi.spyOn(Constants, "USE_SEASONAL_SPLASH_MESSAGES", "get").mockReturnValue(true);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers(); // reset system time
|
||||
});
|
||||
|
||||
it("should contain halloween messages from Sep 15 to Oct 31", () => {
|
||||
testSeason(new Date("2024-09-15"), new Date("2024-10-31"), "halloween");
|
||||
});
|
||||
|
||||
it("should contain xmas messages from Dec 1 to Dec 26", () => {
|
||||
testSeason(new Date("2024-12-01"), new Date("2024-12-26"), "xmas");
|
||||
});
|
||||
|
||||
it("should contain new years messages frm Jan 1 to Jan 31", () => {
|
||||
testSeason(new Date("2024-01-01"), new Date("2024-01-31"), "newYears");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Helpoer method to test seasonal messages
|
||||
* @param startDate The seasons start date
|
||||
* @param endDate The seasons end date
|
||||
* @param prefix the splash message prefix (e.g. `newYears` or `xmas`)
|
||||
*/
|
||||
function testSeason(startDate: Date, endDate: Date, prefix: string) {
|
||||
const filterFn = (message: string) => message.startsWith(`splashMessages:${prefix}.`);
|
||||
|
||||
const beforeDate = new Date(startDate);
|
||||
beforeDate.setDate(startDate.getDate() - 1);
|
||||
|
||||
const afterDate = new Date(endDate);
|
||||
afterDate.setDate(endDate.getDate() + 1);
|
||||
|
||||
const dates: Date[] = [beforeDate, startDate, endDate, afterDate];
|
||||
const [before, start, end, after] = dates.map((date) => {
|
||||
vi.setSystemTime(date);
|
||||
console.log("System time set to", date);
|
||||
const count = getSplashMessages().filter(filterFn).length;
|
||||
return count;
|
||||
});
|
||||
|
||||
expect(before).toBe(0);
|
||||
expect(start).toBeGreaterThanOrEqual(10); // make sure to adjust if weight is changed!
|
||||
expect(end).toBeGreaterThanOrEqual(10); // make sure to adjust if weight is changed!
|
||||
expect(after).toBe(0);
|
||||
}
|
@ -14,6 +14,8 @@ import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
|
||||
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { beforeAll, vi } from "vitest";
|
||||
|
||||
process.env.TZ = "UTC";
|
||||
|
||||
/** Mock the override import to always return default values, ignoring any custom overrides. */
|
||||
vi.mock("#app/overrides", async (importOriginal) => {
|
||||
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();
|
||||
|
@ -381,17 +381,8 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
|
||||
const ownedAbilityAttrs = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr;
|
||||
|
||||
let playerOwnsThisAbility = false;
|
||||
// Check if the player owns ability for the root form
|
||||
if ((ownedAbilityAttrs & 1) > 0 && pokemon.hasSameAbilityInRootForm(0)) {
|
||||
playerOwnsThisAbility = true;
|
||||
}
|
||||
if ((ownedAbilityAttrs & 2) > 0 && pokemon.hasSameAbilityInRootForm(1)) {
|
||||
playerOwnsThisAbility = true;
|
||||
}
|
||||
if ((ownedAbilityAttrs & 4) > 0 && pokemon.hasSameAbilityInRootForm(2)) {
|
||||
playerOwnsThisAbility = true;
|
||||
}
|
||||
const playerOwnsThisAbility = pokemon.checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs);
|
||||
|
||||
if (missingDexAttrs || !playerOwnsThisAbility) {
|
||||
this.ownedIcon.setTint(0x808080);
|
||||
|
@ -267,18 +267,13 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
this.pokemonAbilityText.setColor(getTextColor(abilityTextStyle, false, this.scene.uiTheme));
|
||||
this.pokemonAbilityText.setShadowColor(getTextColor(abilityTextStyle, true, this.scene.uiTheme));
|
||||
|
||||
/**
|
||||
* If the opposing Pokemon only has 1 normal ability and is using the hidden ability it should have the same behavior
|
||||
* if it had 2 normal abilities. This code checks if that is the case and uses the correct opponent Pokemon abilityIndex (2)
|
||||
* for calculations so it aligns with where the hidden ability is stored in the starter data's abilityAttr (4)
|
||||
*/
|
||||
const opponentPokemonOneNormalAbility = (pokemon.species.getAbilityCount() === 2);
|
||||
const opponentPokemonAbilityIndex = (opponentPokemonOneNormalAbility && pokemon.abilityIndex === 1) ? 2 : pokemon.abilityIndex;
|
||||
const opponentPokemonAbilityAttr = 1 << opponentPokemonAbilityIndex;
|
||||
|
||||
const rootFormHasHiddenAbility = starterEntry.abilityAttr & opponentPokemonAbilityAttr;
|
||||
const ownedAbilityAttrs = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr;
|
||||
|
||||
if (!rootFormHasHiddenAbility) {
|
||||
// Check if the player owns ability for the root form
|
||||
const playerOwnsThisAbility = pokemon.checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs);
|
||||
|
||||
if (!playerOwnsThisAbility) {
|
||||
this.pokemonAbilityLabelText.setColor(getTextColor(TextStyle.SUMMARY_BLUE, false, this.scene.uiTheme));
|
||||
this.pokemonAbilityLabelText.setShadowColor(getTextColor(TextStyle.SUMMARY_BLUE, true, this.scene.uiTheme));
|
||||
} else {
|
||||
|
@ -3,11 +3,14 @@ import OptionSelectUiHandler from "./settings/option-select-ui-handler";
|
||||
import { Mode } from "./ui";
|
||||
import * as Utils from "../utils";
|
||||
import { TextStyle, addTextObject, getTextStyleOptions } from "./text";
|
||||
import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages";
|
||||
import { getSplashMessages } from "../data/splash-messages";
|
||||
import i18next from "i18next";
|
||||
import { TimedEventDisplay } from "#app/timed-event-manager";
|
||||
|
||||
export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||
/** If the stats can not be retrieved, use this fallback value */
|
||||
private static readonly BATTLES_WON_FALLBACK: number = -99999999;
|
||||
|
||||
private titleContainer: Phaser.GameObjects.Container;
|
||||
private playerCountLabel: Phaser.GameObjects.Text;
|
||||
private splashMessage: string;
|
||||
@ -72,8 +75,8 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||
.then(request => request.json())
|
||||
.then(stats => {
|
||||
this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`);
|
||||
if (this.splashMessage === getBattleCountSplashMessage()) {
|
||||
this.splashMessageText.setText(getBattleCountSplashMessage().replace("{COUNT}", stats.battleCount.toLocaleString("en-US")));
|
||||
if (this.splashMessage === "splashMessages:battlesWon") {
|
||||
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: stats.battleCount }));
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
@ -86,7 +89,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||
|
||||
if (ret) {
|
||||
this.splashMessage = Utils.randItem(getSplashMessages());
|
||||
this.splashMessageText.setText(this.splashMessage.replace("{COUNT}", "?"));
|
||||
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: TitleUiHandler.BATTLES_WON_FALLBACK }));
|
||||
|
||||
const ui = this.getUi();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user