Compare commits

..

No commits in common. "a286dc37fad530c2b68b926df900f2f13416ea92" and "36b60c2e93406d5121f79e7a488ac653520c6bda" have entirely different histories.

16 changed files with 198 additions and 375 deletions

View File

@ -1,5 +1 @@
/** The maximum size of the player's party */ export const PLAYER_PARTY_MAX_SIZE = 6;
export const PLAYER_PARTY_MAX_SIZE: number = 6;
/** Whether to use seasonal splash messages in general */
export const USE_SEASONAL_SPLASH_MESSAGES: boolean = false;

View File

@ -1,136 +1,46 @@
import { USE_SEASONAL_SPLASH_MESSAGES } from "#app/constants"; import i18next from "i18next";
//#region Interfaces/Types export function getBattleCountSplashMessage(): string {
return `{COUNT} ${i18next.t("splashMessages:battlesWon")}`;
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[] { export function getSplashMessages(): string[] {
const splashMessages: string[] = [...commonSplashMessages]; const splashMessages = Array(10).fill(getBattleCountSplashMessage());
console.log("use seasonal splash messages", USE_SEASONAL_SPLASH_MESSAGES); splashMessages.push(
if (USE_SEASONAL_SPLASH_MESSAGES) { i18next.t("splashMessages:joinTheDiscord"),
// add seasonal splash messages if the season is active i18next.t("splashMessages:infiniteLevels"),
for (const { name, start, end, messages } of seasonalSplashMessages) { i18next.t("splashMessages:everythingStacks"),
const now = new Date(); i18next.t("splashMessages:optionalSaveScumming"),
const startDate = new Date(`${start}-${now.getFullYear()}`); i18next.t("splashMessages:biomes"),
const endDate = new Date(`${end}-${now.getFullYear()}`); 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"),
);
if (now >= startDate && now <= endDate) { return splashMessages;
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}`);
} }

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} Kämpfe gewonnen!", "battlesWon": "Kämpfe gewonnen!",
"joinTheDiscord": "Tritt dem Discord bei!", "joinTheDiscord": "Tritt dem Discord bei!",
"infiniteLevels": "Unendliche Level!", "infiniteLevels": "Unendliche Level!",
"everythingStacks": "Alles stapelt sich!", "everythingStacks": "Alles stapelt sich!",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} Battles Won!", "battlesWon": "Battles Won!",
"joinTheDiscord": "Join the Discord!", "joinTheDiscord": "Join the Discord!",
"infiniteLevels": "Infinite Levels!", "infiniteLevels": "Infinite Levels!",
"everythingStacks": "Everything Stacks!", "everythingStacks": "Everything Stacks!",
@ -32,17 +32,5 @@
"alsoTryRadicalRed": "Also Try Radical Red!", "alsoTryRadicalRed": "Also Try Radical Red!",
"eeveeExpo": "Eevee Expo!", "eeveeExpo": "Eevee Expo!",
"ynoproject": "YNOproject!", "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!"
}
} }

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": {{count, number}} Batallas ganadas!", "battlesWon": Batallas ganadas!",
"joinTheDiscord": "¡Únete al Discord!", "joinTheDiscord": "¡Únete al Discord!",
"infiniteLevels": "¡Niveles infinitos!", "infiniteLevels": "¡Niveles infinitos!",
"everythingStacks": "¡Todo se acumula!", "everythingStacks": "¡Todo se acumula!",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} combats gagnés !", "battlesWon": "combats gagnés !",
"joinTheDiscord": "Rejoins le Discord !", "joinTheDiscord": "Rejoins le Discord !",
"infiniteLevels": "Niveaux infinis !", "infiniteLevels": "Niveaux infinis !",
"everythingStacks": "Tout se cumule !", "everythingStacks": "Tout se cumule !",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} Battaglie Vinte!", "battlesWon": "Battaglie Vinte!",
"joinTheDiscord": "Entra nel Discord!", "joinTheDiscord": "Entra nel Discord!",
"infiniteLevels": "Livelli Infiniti!", "infiniteLevels": "Livelli Infiniti!",
"everythingStacks": "Tutto si impila!", "everythingStacks": "Tutto si impila!",

View File

@ -1,5 +1,5 @@
{ {
"pikachu": "一般", "pikachu": "Normal",
"pikachuCosplay": "コスプレ", "pikachuCosplay": "コスプレ",
"pikachuCoolCosplay": "クールなコスプレ", "pikachuCoolCosplay": "クールなコスプレ",
"pikachuBeautyCosplay": "きれいなコスプレ", "pikachuBeautyCosplay": "きれいなコスプレ",
@ -7,9 +7,9 @@
"pikachuSmartCosplay": "かしこいコスプレ", "pikachuSmartCosplay": "かしこいコスプレ",
"pikachuToughCosplay": "パワフルなコスプレ", "pikachuToughCosplay": "パワフルなコスプレ",
"pikachuPartner": "パートナー", "pikachuPartner": "パートナー",
"eevee": "一般", "eevee": "Normal",
"eeveePartner": "パートナー", "eeveePartner": "パートナー",
"pichu": "一般", "pichu": "Normal",
"pichuSpiky": "ギザみみ", "pichuSpiky": "ギザみみ",
"unownA": "A", "unownA": "A",
"unownB": "B", "unownB": "B",
@ -39,65 +39,65 @@
"unownZ": "Z", "unownZ": "Z",
"unownExclamation": "!", "unownExclamation": "!",
"unownQuestion": "?", "unownQuestion": "?",
"castform": "ポワルンのすがた", "castform": "Normal Form",
"castformSunny": "たいようのすがた", "castformSunny": "たいよう",
"castformRainy": "あまみずのすがた", "castformRainy": "あまみず",
"castformSnowy": "ゆきぐものすがた", "castformSnowy": "ゆきぐも",
"deoxysNormal": "ノーマルフォルム", "deoxysNormal": "ノーマル",
"deoxysAttack": "アタックフォルム", "deoxysAttack": "Attack",
"deoxysDefense": "ディフェンスフォルム", "deoxysDefense": "Defense",
"deoxysSpeed": "スピードフォルム", "deoxysSpeed": "Speed",
"burmyPlant": "くさき", "burmyPlant": "くさき",
"burmySandy": "すなち", "burmySandy": "すなち",
"burmyTrash": "ゴミ", "burmyTrash": "ゴミ",
"cherubiOvercast": "ネガフォルム", "cherubiOvercast": "Overcast",
"cherubiSunshine": "ポジフォルム", "cherubiSunshine": "Sunshine",
"shellosEast": "ひがし", "shellosEast": "ひがし",
"shellosWest": "にし", "shellosWest": "にし",
"rotom": "ロトムのすがた", "rotom": "Normal",
"rotomHeat": "ヒートロトム", "rotomHeat": "ヒート",
"rotomWash": "ウォッシュロトム", "rotomWash": "ウォッシュ",
"rotomFrost": "フロストロトム", "rotomFrost": "フロスト",
"rotomFan": "スピンロトム", "rotomFan": "スピン",
"rotomMow": "カットロトム", "rotomMow": "カット",
"dialga": "アナザーフォルム", "dialga": "Normal",
"dialgaOrigin": "オリジンフォルム", "dialgaOrigin": "Origin",
"palkia": "アナザーフォルム", "palkia": "Normal",
"palkiaOrigin": "オリジンフォルム", "palkiaOrigin": "Origin",
"giratinaAltered": "アナザーフォルム", "giratinaAltered": "アナザー",
"giratinaOrigin": "オリジンフォルム", "giratinaOrigin": "Origin",
"shayminLand": "ランドフォルム", "shayminLand": "ランド",
"shayminSky": "スカイフォルム", "shayminSky": "Sky",
"basculinRedStriped": "赤筋", "basculinRedStriped": "赤筋",
"basculinBlueStriped": "青筋", "basculinBlueStriped": "青筋",
"basculinWhiteStriped": "白筋", "basculinWhiteStriped": "白筋",
"darumaka": "ノーマルモード", "darumaka": "Standard Mode",
"darumakaZen": "ダルマモード", "darumakaZen": "Zen",
"deerlingSpring": "春", "deerlingSpring": "春",
"deerlingSummer": "夏", "deerlingSummer": "夏",
"deerlingAutumn": "秋", "deerlingAutumn": "秋",
"deerlingWinter": "冬", "deerlingWinter": "冬",
"tornadusIncarnate": "けしんフォルム", "tornadusIncarnate": "けしん",
"tornadusTherian": "れいじゅうフォルム", "tornadusTherian": "Therian",
"thundurusIncarnate": "けしんフォルム", "thundurusIncarnate": "けしん",
"thundurusTherian": "れいじゅうフォルム", "thundurusTherian": "Therian",
"landorusIncarnate": "けしんフォルム", "landorusIncarnate": "けしん",
"landorusTherian": "れいじゅうフォルム", "landorusTherian": "Therian",
"kyurem": "通常", "kyurem": "Normal",
"kyuremBlack": "ブラックキュレム", "kyuremBlack": "Black",
"kyuremWhite": "ホワイトキュレム", "kyuremWhite": "White",
"keldeoOrdinary": "いつものすがた", "keldeoOrdinary": "いつも",
"keldeoResolute": "かくごのすがた", "keldeoResolute": "Resolute",
"meloettaAria": "ボイス", "meloettaAria": "ボイス",
"meloettaPirouette": "ステップ", "meloettaPirouette": "ステップ",
"genesect": "一般", "genesect": "Normal",
"genesectShock": "ライトニング", "genesectShock": "Shock Drive",
"genesectBurn": "ブレイズ", "genesectBurn": "Burn Drive",
"genesectChill": "フリーズ", "genesectChill": "Chill Drive",
"genesectDouse": "アクア", "genesectDouse": "Douse Drive",
"froakie": "通常", "froakie": "Normal",
"froakieBattleBond": "きずなへんげ", "froakieBattleBond": "きずなへんげ",
"froakieAsh": "サトシゲッコウガ", "froakieAsh": "Ash",
"scatterbugMeadow": "はなぞの", "scatterbugMeadow": "はなぞの",
"scatterbugIcySnow": "ひょうせつ", "scatterbugIcySnow": "ひょうせつ",
"scatterbugPolar": "ゆきぐに", "scatterbugPolar": "ゆきぐに",
@ -123,7 +123,7 @@
"flabebeOrange": "オレンジ", "flabebeOrange": "オレンジ",
"flabebeBlue": "青", "flabebeBlue": "青",
"flabebeWhite": "白", "flabebeWhite": "白",
"furfrou": "やせいのすがた", "furfrou": "Natural Form",
"furfrouHeart": "ハート", "furfrouHeart": "ハート",
"furfrouStar": "スター", "furfrouStar": "スター",
"furfrouDiamond": "ダイア", "furfrouDiamond": "ダイア",
@ -133,14 +133,14 @@
"furfrouLaReine": "クイーン", "furfrouLaReine": "クイーン",
"furfrouKabuki": "カブキ", "furfrouKabuki": "カブキ",
"furfrouPharaoh": "キングダム", "furfrouPharaoh": "キングダム",
"espurrMale": "オス", "espurrMale": "Male",
"espurrFemale": "メス", "espurrFemale": "Female",
"honedgeShiled": "シールドフォルム", "honedgeShiled": "Shield",
"honedgeBlade": "ブレードフォルム", "honedgeBlade": "Blade",
"pumpkaboo": "ふつうのサイズ", "pumpkaboo": "Average Size",
"pumpkabooSmall": "ちいさいサイズ", "pumpkabooSmall": "ちいさい",
"pumpkabooLarge": "おおきいサイズ", "pumpkabooLarge": "おおきい",
"pumpkabooSuper": "とくだいサイズ", "pumpkabooSuper": "とくだい",
"xerneasNeutral": "リラックス", "xerneasNeutral": "リラックス",
"xerneasActive": "アクティブ", "xerneasActive": "アクティブ",
"zygarde50": "50%フォルム", "zygarde50": "50%フォルム",
@ -148,37 +148,37 @@
"zygarde50Pc": "50%フォルム スワームチェンジ", "zygarde50Pc": "50%フォルム スワームチェンジ",
"zygarde10Pc": "10%フォルム スワームチェンジ", "zygarde10Pc": "10%フォルム スワームチェンジ",
"zygardeComplete": "パーフェクトフォルム", "zygardeComplete": "パーフェクトフォルム",
"hoopa": "いましめられしフーパ", "hoopa": "Confined",
"hoopaUnbound": "ときはなたれしフーパ", "hoopaUnbound": "Unbound",
"oricorioBaile": "めらめら", "oricorioBaile": "めらめら",
"oricorioPompom": "ぱちぱち", "oricorioPompom": "ぱちぱち",
"oricorioPau": "ふらふら", "oricorioPau": "ふらふら",
"oricorioSensu": "まいまい", "oricorioSensu": "まいまい",
"rockruff": "一般", "rockruff": "Normal",
"rockruffOwnTempo": "マイペース", "rockruffOwnTempo": "マイペース",
"rockruffMidday": "まひるのすがた", "rockruffMidday": "Midday",
"rockruffMidnight": "まよなかのすがた", "rockruffMidnight": "Midnight",
"rockruffDusk": "たそがれのすがた", "rockruffDusk": "Dusk",
"wishiwashi": "たんどくのすがた", "wishiwashi": "Solo Form",
"wishiwashiSchool": "むれたすがた", "wishiwashiSchool": "School",
"typeNullNormal": "タイプ:ノーマル", "typeNullNormal": "Type: Normal",
"typeNullFighting": "タイプ:かくとう", "typeNullFighting": "Type: Fighting",
"typeNullFlying": "タイプ:ひこう", "typeNullFlying": "Type: Flying",
"typeNullPoison": "タイプ:どく", "typeNullPoison": "Type: Poison",
"typeNullGround": "タイプ:じめん", "typeNullGround": "Type: Ground",
"typeNullRock": "タイプ:いわ", "typeNullRock": "Type: Rock",
"typeNullBug": "タイプ:むし", "typeNullBug": "Type: Bug",
"typeNullGhost": "タイプ:ゴースト", "typeNullGhost": "Type: Ghost",
"typeNullSteel": "タイプ:はがね", "typeNullSteel": "Type: Steel",
"typeNullFire": "タイプ:ほのお", "typeNullFire": "Type: Fire",
"typeNullWater": "タイプ:みず", "typeNullWater": "Type: Water",
"typeNullGrass": "タイプ:くさ", "typeNullGrass": "Type: Grass",
"typeNullElectric": "タイプ:でんき", "typeNullElectric": "Type: Electric",
"typeNullPsychic": "タイプ:エスパー", "typeNullPsychic": "Type: Psychic",
"typeNullIce": "タイプ:こおり", "typeNullIce": "Type: Ice",
"typeNullDragon": "タイプ:ドラゴン", "typeNullDragon": "Type: Dragon",
"typeNullDark": "タイプ:あく", "typeNullDark": "Type: Dark",
"typeNullFairy": "タイプ:フェアリー", "typeNullFairy": "Type: Fairy",
"miniorRedMeteor": "赤 りゅうせい", "miniorRedMeteor": "赤 りゅうせい",
"miniorOrangeMeteor": "オレンジ りゅうせい", "miniorOrangeMeteor": "オレンジ りゅうせい",
"miniorYellowMeteor": "黄 りゅうせい", "miniorYellowMeteor": "黄 りゅうせい",
@ -195,63 +195,63 @@
"miniorViolet": "紫", "miniorViolet": "紫",
"mimikyuDisguised": "ばけたすがた", "mimikyuDisguised": "ばけたすがた",
"mimikyuBusted": "ばれたすがた", "mimikyuBusted": "ばれたすがた",
"necrozma": "ネクロズマ", "necrozma": "Normal",
"necrozmaDuskMane": "たそがれのたてがみ", "necrozmaDuskMane": "Dusk Mane",
"necrozmaDawnWings": "あかつきのつばさ", "necrozmaDawnWings": "Dawn Wings",
"necrozmaUltra": "ウルトラネクロズマ", "necrozmaUltra": "Ultra",
"magearna": "通常", "magearna": "Normal",
"magearnaOriginal": "500ねんまえのいろ", "magearnaOriginal": "500ねんまえ",
"marshadow": "通常", "marshadow": "Normal",
"marshadowZenith": "Zパワー", "marshadowZenith": "Zパワー",
"cramorant": "通常", "cramorant": "Normal",
"cramorantGulping": "うのみのすがた", "cramorantGulping": "Gulping Form",
"cramorantGorging": "まるのみのすがた", "cramorantGorging": "Gorging Form",
"toxelAmped": "ハイなすがた", "toxelAmped": "Amped Form",
"toxelLowkey": "ローなすがた", "toxelLowkey": "Low-Key Form",
"sinisteaPhony": "がんさく", "sinisteaPhony": "がんさく",
"sinisteaAntique": "しんさく", "sinisteaAntique": "しんさく",
"milceryVanillaCream": "ミルキィバニラ", "milceryVanillaCream": "Vanilla Cream",
"milceryRubyCream": "ミルキィルビー", "milceryRubyCream": "Ruby Cream",
"milceryMatchaCream": "ミルキィまっちゃ", "milceryMatchaCream": "Matcha Cream",
"milceryMintCream": "ミルキィミント", "milceryMintCream": "Mint Cream",
"milceryLemonCream": "ミルキィレモン", "milceryLemonCream": "Lemon Cream",
"milcerySaltedCream": "ミルキィソルト", "milcerySaltedCream": "Salted Cream",
"milceryRubySwirl": "ルビーミックス", "milceryRubySwirl": "Ruby Swirl",
"milceryCaramelSwirl": "キャラメルミックス", "milceryCaramelSwirl": "Caramel Swirl",
"milceryRainbowSwirl": "トリプルミックス", "milceryRainbowSwirl": "Rainbow Swirl",
"eiscue": "アイスフェイス", "eiscue": "Ice Face",
"eiscueNoIce": "ナイスフェイス", "eiscueNoIce": "ナイスなし",
"indeedeeMale": "オス", "indeedeeMale": "オス",
"indeedeeFemale": "メス", "indeedeeFemale": "メス",
"morpekoFullBelly": "まんぷくもよう", "morpekoFullBelly": "まんぷく",
"morpekoHangry": "はらぺこもよう", "morpekoHangry": "Hangry",
"zacianHeroOfManyBattles": "れきせんのゆうしゃ", "zacianHeroOfManyBattles": "れきせんのゆうしゃ",
"zacianCrowned": "けんのおう", "zacianCrowned": "Crowned",
"zamazentaHeroOfManyBattles": "れきせんのゆうしゃ", "zamazentaHeroOfManyBattles": "れきせんのゆうしゃ",
"zamazentaCrowned": "けんのおう", "zamazentaCrowned": "Crowned",
"kubfuSingleStrike": "いちげきのかた", "kubfuSingleStrike": "Single Strike",
"kubfuRapidStrike": "れんげきのかた", "kubfuRapidStrike": "Rapid Strike",
"zarude": "一般", "zarude": "Normal",
"zarudeDada": "とうちゃん", "zarudeDada": "とうちゃん",
"calyrex": "通常", "calyrex": "Normal",
"calyrexIce": "はくばじょうのすがた", "calyrexIce": "Ice Rider",
"calyrexShadow": "こくばじょうのすがた", "calyrexShadow": "Shadow Rider",
"basculinMale": "オス", "basculinMale": "Male",
"basculinFemale": "メス", "basculinFemale": "Female",
"enamorusIncarnate": "けしんフォルム", "enamorusIncarnate": "けしん",
"enamorusTherian": "れいじゅうフォルム", "enamorusTherian": "Therian",
"lechonkMale": "オス", "lechonkMale": "Male",
"lechonkFemale": "メス", "lechonkFemale": "Female",
"tandemausFour": "4ひきかぞく", "tandemausFour": "Family of Four",
"tandemausThree": "3びきかぞく", "tandemausThree": "Family of Three",
"squawkabillyGreenPlumage": "グリーンフェザー", "squawkabillyGreenPlumage": "グリーンフェザー",
"squawkabillyBluePlumage": "ブルーフェザー", "squawkabillyBluePlumage": "ブルーフェザー",
"squawkabillyYellowPlumage": "イエローフェザー", "squawkabillyYellowPlumage": "イエローフェザー",
"squawkabillyWhitePlumage": "ホワイトフェザー", "squawkabillyWhitePlumage": "ホワイトフェザー",
"dunsparceTwo": "ふたふしフォルム", "dunsparceTwo": "Two-Segment",
"dunsparceThree": "みつふしフォルム", "dunsparceThree": "Three-Segment",
"finizenZero": "ナイーブフォルム", "finizenZero": "Zero",
"finizenHero": "マイティフォルム", "finizenHero": "Hero",
"tatsugiriCurly": "そったすがた", "tatsugiriCurly": "そったすがた",
"tatsugiriDroopy": "たれたすがた", "tatsugiriDroopy": "たれたすがた",
"tatsugiriStretchy": "のびたすがた", "tatsugiriStretchy": "のびたすがた",
@ -269,21 +269,21 @@
"miraidonGlideMode":"グライドモード", "miraidonGlideMode":"グライドモード",
"poltchageistCounterfeit": "マガイモノ", "poltchageistCounterfeit": "マガイモノ",
"poltchageistArtisan": "タカイモノ", "poltchageistArtisan": "タカイモノ",
"poltchageistUnremarkable": "ボンサクのすがた", "poltchageistUnremarkable": "Unremarkable",
"poltchageistMasterpiece": "ケッサクのすがた", "poltchageistMasterpiece": "Masterpiece",
"ogerponTealMask": "みどりのめん", "ogerponTealMask": "Teal Mask",
"ogerponTealMaskTera": "みどりのめん テラスタル", "ogerponTealMaskTera": "Teal Mask Terastallized",
"ogerponWellspringMask": "いどのめん", "ogerponWellspringMask": "Wellspring Mask",
"ogerponWellspringMaskTera": "いどのめん テラスタル", "ogerponWellspringMaskTera": "Wellspring Mask Terastallized",
"ogerponHearthflameMask": "かまどのめん", "ogerponHearthflameMask": "Hearthflame Mask",
"ogerponHearthflameMaskTera": "かまどのめん テラスタル", "ogerponHearthflameMaskTera": "Hearthflame Mask Terastallized",
"ogerponCornerstoneMask": "いしずえのめん", "ogerponCornerstoneMask": "Cornerstone Mask",
"ogerponCornerstoneMaskTera": "いしずえのめん テラスタル", "ogerponCornerstoneMaskTera": "Cornerstone Mask Terastallized",
"terpagos": "ノーマルフォルム", "terpagos": "Normal Form",
"terpagosTerastal": "テラスタルフォルム", "terpagosTerastal": "Terastal",
"terpagosStellar": "ステラフォルム", "terpagosStellar": "Stellar",
"galarDarumaka": "ノーマルモード", "galarDarumaka": "Standard Mode",
"galarDarumakaZen": "ダルマモード", "galarDarumakaZen": "Zen",
"paldeaTaurosCombat": "コンバット", "paldeaTaurosCombat": "コンバット",
"paldeaTaurosBlaze": "ブレイズ", "paldeaTaurosBlaze": "ブレイズ",
"paldeaTaurosAqua": "ウォーター" "paldeaTaurosAqua": "ウォーター"

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "勝ったバトル:{{count, number}}回!", "battlesWon": "Battles Won!",
"joinTheDiscord": "Join the Discord!", "joinTheDiscord": "Join the Discord!",
"infiniteLevels": "Infinite Levels!", "infiniteLevels": "Infinite Levels!",
"everythingStacks": "Everything Stacks!", "everythingStacks": "Everything Stacks!",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} 전투에서 승리하세요!", "battlesWon": "전투에서 승리하세요!",
"joinTheDiscord": "디스코드에 가입하세요!", "joinTheDiscord": "디스코드에 가입하세요!",
"infiniteLevels": "무한한 레벨!", "infiniteLevels": "무한한 레벨!",
"everythingStacks": "모든 것이 누적됩니다!", "everythingStacks": "모든 것이 누적됩니다!",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} Batalhas Ganhas!", "battlesWon": "Batalhas Ganhas!",
"joinTheDiscord": "Junte-se ao Discord!", "joinTheDiscord": "Junte-se ao Discord!",
"infiniteLevels": "Níveis Infinitos!", "infiniteLevels": "Níveis Infinitos!",
"everythingStacks": "Tudo Acumula!", "everythingStacks": "Tudo Acumula!",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} 场胜利!", "battlesWon": "场胜利!",
"joinTheDiscord": "加入Discord", "joinTheDiscord": "加入Discord",
"infiniteLevels": "等级无限!", "infiniteLevels": "等级无限!",
"everythingStacks": "道具全部叠加!", "everythingStacks": "道具全部叠加!",

View File

@ -1,5 +1,5 @@
{ {
"battlesWon": "{{count, number}} 勝利場數!", "battlesWon": "勝利場數!",
"joinTheDiscord": "加入Discord", "joinTheDiscord": "加入Discord",
"infiniteLevels": "無限等級!", "infiniteLevels": "無限等級!",
"everythingStacks": "所有效果都能疊加!", "everythingStacks": "所有效果都能疊加!",

View File

@ -1,66 +0,0 @@
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);
}

View File

@ -14,8 +14,6 @@ import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters"; import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
import { beforeAll, vi } from "vitest"; import { beforeAll, vi } from "vitest";
process.env.TZ = "UTC";
/** Mock the override import to always return default values, ignoring any custom overrides. */ /** Mock the override import to always return default values, ignoring any custom overrides. */
vi.mock("#app/overrides", async (importOriginal) => { vi.mock("#app/overrides", async (importOriginal) => {
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>(); const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();

View File

@ -3,14 +3,11 @@ import OptionSelectUiHandler from "./settings/option-select-ui-handler";
import { Mode } from "./ui"; import { Mode } from "./ui";
import * as Utils from "../utils"; import * as Utils from "../utils";
import { TextStyle, addTextObject, getTextStyleOptions } from "./text"; import { TextStyle, addTextObject, getTextStyleOptions } from "./text";
import { getSplashMessages } from "../data/splash-messages"; import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages";
import i18next from "i18next"; import i18next from "i18next";
import { TimedEventDisplay } from "#app/timed-event-manager"; import { TimedEventDisplay } from "#app/timed-event-manager";
export default class TitleUiHandler extends OptionSelectUiHandler { 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 titleContainer: Phaser.GameObjects.Container;
private playerCountLabel: Phaser.GameObjects.Text; private playerCountLabel: Phaser.GameObjects.Text;
private splashMessage: string; private splashMessage: string;
@ -75,8 +72,8 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
.then(request => request.json()) .then(request => request.json())
.then(stats => { .then(stats => {
this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`); this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`);
if (this.splashMessage === "splashMessages:battlesWon") { if (this.splashMessage === getBattleCountSplashMessage()) {
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: stats.battlesWon })); this.splashMessageText.setText(getBattleCountSplashMessage().replace("{COUNT}", stats.battleCount.toLocaleString("en-US")));
} }
}) })
.catch(err => { .catch(err => {
@ -89,7 +86,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
if (ret) { if (ret) {
this.splashMessage = Utils.randItem(getSplashMessages()); this.splashMessage = Utils.randItem(getSplashMessages());
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: TitleUiHandler.BATTLES_WON_FALLBACK })); this.splashMessageText.setText(this.splashMessage.replace("{COUNT}", "?"));
const ui = this.getUi(); const ui = this.getUi();