mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 13:59:27 +02:00
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into damo-holly
This commit is contained in:
commit
eb79dd541a
98
CREDITS.md
98
CREDITS.md
@ -372,63 +372,67 @@ In addition to the lists below, please check [the PokéRogue wiki](https://wiki.
|
|||||||
- Lily
|
- Lily
|
||||||
- PigeonBar
|
- PigeonBar
|
||||||
|
|
||||||
## Past Contributors
|
## Other Code Contributors
|
||||||
- Fontbane
|
- Admiral-Billy
|
||||||
- sodaMelon
|
- allen925
|
||||||
- schmidtc1
|
- arColm
|
||||||
- shayebeadling
|
- Arxalc
|
||||||
|
- AsdarDevelops
|
||||||
|
- bennybroseph
|
||||||
|
- Brain Frog
|
||||||
|
- Corrade
|
||||||
|
- Dakurei
|
||||||
- DustinLin
|
- DustinLin
|
||||||
- lucfd
|
- ElizaAlex
|
||||||
- madibye
|
|
||||||
- EmberCM
|
- EmberCM
|
||||||
- Mewtwo2387
|
- EmoUsedHM01
|
||||||
|
- EvasiveAce
|
||||||
|
- Fontbane
|
||||||
|
- francktrouillez
|
||||||
|
- FredeX
|
||||||
|
- geeilhan
|
||||||
|
- Greenlamp
|
||||||
|
- happinyz
|
||||||
- hayuna
|
- hayuna
|
||||||
- sirzento
|
- InfernoVulpix
|
||||||
- ReneGV
|
|
||||||
- mattrossdev
|
|
||||||
- zacharied
|
|
||||||
- NxKarim
|
|
||||||
- td76099
|
|
||||||
- Xiaphear
|
|
||||||
- j-diefenbach
|
- j-diefenbach
|
||||||
- jaimefd
|
- jaimefd
|
||||||
- EvasiveAce
|
|
||||||
- EmoUsedHM01
|
|
||||||
- francktrouillez
|
|
||||||
- JakubHanko
|
- JakubHanko
|
||||||
- FredeX
|
|
||||||
- PigeonBar
|
|
||||||
- prime-dialga
|
|
||||||
- rnicar245
|
|
||||||
- rationality6
|
|
||||||
- Neverblade
|
|
||||||
- Corrade
|
|
||||||
- Admiral-Billy
|
|
||||||
- okimin
|
|
||||||
- Arxalc
|
|
||||||
- PrabbyDD
|
|
||||||
- JonStudders
|
- JonStudders
|
||||||
- karl-police
|
- karl-police
|
||||||
- prateau
|
- lucfd
|
||||||
- meepen
|
- Lugiadrien
|
||||||
- arColm
|
- madibye
|
||||||
- allen925
|
- mattrossdev
|
||||||
- InfernoVulpix
|
|
||||||
- snoozbuster
|
|
||||||
- zaccie
|
|
||||||
- happinyz
|
|
||||||
- PyGaVS
|
|
||||||
- mcmontag
|
- mcmontag
|
||||||
- ElizaAlex
|
- meepen
|
||||||
- AsdarDevelops
|
- Mewtwo2387
|
||||||
- Vassiat
|
- muscode
|
||||||
- RedstonewolfX
|
- Neverblade
|
||||||
- Sam/Flashfyre (initial developer, started PokéRogue)
|
- NxKarim
|
||||||
- Greenlamp
|
- okimin
|
||||||
- bennybroseph
|
|
||||||
- OrangeRed
|
- OrangeRed
|
||||||
- Dakurei
|
- PigeonBar
|
||||||
- Brain Frog
|
- PrabbyDD
|
||||||
|
- prateau
|
||||||
|
- prime-dialga
|
||||||
|
- PyGaVS
|
||||||
|
- rationality6
|
||||||
|
- RedstonewolfX
|
||||||
|
- ReneGV
|
||||||
|
- rnicar245
|
||||||
|
- Sam aka Flashfyre (initial developer, started PokéRogue)
|
||||||
|
- schmidtc1
|
||||||
|
- shayebeadling
|
||||||
|
- sirzento
|
||||||
|
- snoozbuster
|
||||||
|
- sodaMelon
|
||||||
|
- td76099
|
||||||
|
- Vassiat
|
||||||
|
- Xiaphear
|
||||||
|
- zaccie
|
||||||
|
- zacharied
|
||||||
|
- Zé Ricardo
|
||||||
|
|
||||||
|
|
||||||
# 🌎 Translation
|
# 🌎 Translation
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 1dc4d5dd238db8bbf64535c3274056abd199d404
|
Subproject commit 6592ec05fce7035ee93aad253279e97ab6cdc1ab
|
@ -2,7 +2,7 @@
|
|||||||
export const PLAYER_PARTY_MAX_SIZE: number = 6;
|
export const PLAYER_PARTY_MAX_SIZE: number = 6;
|
||||||
|
|
||||||
/** Whether to use seasonal splash messages in general */
|
/** Whether to use seasonal splash messages in general */
|
||||||
export const USE_SEASONAL_SPLASH_MESSAGES: boolean = false;
|
export const USE_SEASONAL_SPLASH_MESSAGES: boolean = true;
|
||||||
|
|
||||||
/** Name of the session ID cookie */
|
/** Name of the session ID cookie */
|
||||||
export const SESSION_ID_COOKIE_NAME: string = "pokerogue_sessionId";
|
export const SESSION_ID_COOKIE_NAME: string = "pokerogue_sessionId";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { USE_SEASONAL_SPLASH_MESSAGES } from "#app/constants";
|
import { USE_SEASONAL_SPLASH_MESSAGES } from "#app/constants";
|
||||||
|
import i18next from "i18next";
|
||||||
|
|
||||||
//#region Interfaces/Types
|
//#region Interfaces/Types
|
||||||
|
|
||||||
@ -37,8 +38,6 @@ interface Season {
|
|||||||
start: `${Month}-${Day}`;
|
start: `${Month}-${Day}`;
|
||||||
/** The end day and month of the season. Format `MM-DD` */
|
/** The end day and month of the season. Format `MM-DD` */
|
||||||
end: `${Month}-${Day}`;
|
end: `${Month}-${Day}`;
|
||||||
/** Collection of the messages to display (without the `i18next.t()` call!) */
|
|
||||||
messages: string[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//#region Constants
|
//#region Constants
|
||||||
@ -46,176 +45,57 @@ interface Season {
|
|||||||
/** The weight multiplier for the battles-won splash message */
|
/** The weight multiplier for the battles-won splash message */
|
||||||
const BATTLES_WON_WEIGHT_MULTIPLIER = 10;
|
const BATTLES_WON_WEIGHT_MULTIPLIER = 10;
|
||||||
/** The weight multiplier for the seasonal splash messages */
|
/** The weight multiplier for the seasonal splash messages */
|
||||||
const SEASONAL_WEIGHT_MULTIPLIER = 10;
|
const SEASONAL_WEIGHT_MULTIPLIER = 20;
|
||||||
|
|
||||||
//#region Common Messages
|
|
||||||
|
|
||||||
const commonSplashMessages = [
|
|
||||||
...Array(BATTLES_WON_WEIGHT_MULTIPLIER).fill("battlesWon"),
|
|
||||||
"joinTheDiscord",
|
|
||||||
"infiniteLevels",
|
|
||||||
"everythingIsStackable",
|
|
||||||
"optionalSaveScumming",
|
|
||||||
"biomes",
|
|
||||||
"openSource",
|
|
||||||
"playWithSpeed",
|
|
||||||
"liveBugTesting",
|
|
||||||
"heavyInfluence",
|
|
||||||
"pokemonRiskAndPokemonRain",
|
|
||||||
"nowWithMoreSalt",
|
|
||||||
"infiniteFusionAtHome",
|
|
||||||
"brokenEggMoves",
|
|
||||||
"magnificent",
|
|
||||||
"doPeopleReadThis",
|
|
||||||
"thatsCrazy",
|
|
||||||
"gottaCatchEmAll",
|
|
||||||
"questionableBalancing",
|
|
||||||
"coolShaders",
|
|
||||||
"aiFree",
|
|
||||||
"suddenDifficultySpikes",
|
|
||||||
"basedOnAnUnfinishedFlashGame",
|
|
||||||
"moreAddictiveThanIntended",
|
|
||||||
"mostlyConsistentSeeds",
|
|
||||||
"achievementPointsDontDoAnything",
|
|
||||||
"nothingBeatsAJellyFilledDonut",
|
|
||||||
"dontTalkAboutTheTinkatonIncident",
|
|
||||||
"alsoTryPokengine",
|
|
||||||
"alsoTryEmeraldRogue",
|
|
||||||
"alsoTryRadicalRed",
|
|
||||||
"eeveeExpo",
|
|
||||||
"checkOutYnoproject",
|
|
||||||
"breedersInSpace",
|
|
||||||
"alsoTryPokemonUnbound",
|
|
||||||
"tryTheJohtoDragonChallenge",
|
|
||||||
"basicReadingAbilityRecommended",
|
|
||||||
"shoutoutsToTheArtists",
|
|
||||||
"gamblingNotEncouraged",
|
|
||||||
"dontForgetToTakeABreak",
|
|
||||||
"wEvent",
|
|
||||||
"ifItsNotAccurateItsAccurate",
|
|
||||||
"everyLossIsProgressMade",
|
|
||||||
"liveWoChienReaction",
|
|
||||||
"itsAFeatureNotABug",
|
|
||||||
"theEggsAreNotForEating",
|
|
||||||
"7.8outOf10TooManyWaterBiomes",
|
|
||||||
"butNothingHappened",
|
|
||||||
"thePowerOfScienceIsAmazing",
|
|
||||||
"freeToPlay",
|
|
||||||
"theresATimeAndPlaceForEverything",
|
|
||||||
"nowWithShinierShinies",
|
|
||||||
"smilesGoForMiles",
|
|
||||||
"certainlyNotDragonFree",
|
|
||||||
"haveANiceDay",
|
|
||||||
"redacted",
|
|
||||||
"hi",
|
|
||||||
"transRights",
|
|
||||||
"shinyOddsHigherThanYouThink",
|
|
||||||
"noFalseTrades",
|
|
||||||
"notForProfit",
|
|
||||||
"timeForYourDailyRun",
|
|
||||||
"moreEggsThanADaycare",
|
|
||||||
"disclaimerHarshSunDoesNotGiveVitaminD",
|
|
||||||
"whoNeedsAMap",
|
|
||||||
"luxrayIsNotADarkType",
|
|
||||||
"selfDestructiveEncounters",
|
|
||||||
"mostOptionsAreViable",
|
|
||||||
"pokerogueMorse",
|
|
||||||
"smiley",
|
|
||||||
"beAwareOfPassives",
|
|
||||||
"asSeenOnTheWorldWideWeb",
|
|
||||||
"vaultinVeluzas",
|
|
||||||
"tooManyStarters",
|
|
||||||
"checkTheWiki",
|
|
||||||
"winWithYourFavorites",
|
|
||||||
"alsoTryPokerogueWait",
|
|
||||||
"theWayISeeItKyogreIsSurrounded",
|
|
||||||
"tryOutHoneyGather",
|
|
||||||
"notForTheFaintOfHeart",
|
|
||||||
"p",
|
|
||||||
"flipYourDeviceToEvolveInkay",
|
|
||||||
"inArceusWeTrust",
|
|
||||||
"whyDidTheTorchicCrossTheRoad",
|
|
||||||
"goodLuck",
|
|
||||||
"fuseWisely",
|
|
||||||
"compensation",
|
|
||||||
"prepareForTroubleAndMakeItDouble",
|
|
||||||
"anEggForYourTroubles",
|
|
||||||
"regirock",
|
|
||||||
"hereForAGoodTime",
|
|
||||||
"getGoodOrDont",
|
|
||||||
"checkTheSubreddit",
|
|
||||||
"betterNerfGreninja",
|
|
||||||
"inCaseOfUpdateClearYourCache",
|
|
||||||
"insertTextHere",
|
|
||||||
"endingEndlessNotFound",
|
|
||||||
"iLikeMyEggsVouchered",
|
|
||||||
"YOU",
|
|
||||||
"noAddedSugar",
|
|
||||||
"notSponsored",
|
|
||||||
"notRated",
|
|
||||||
"justOneMoreWaveMom",
|
|
||||||
"saltCured",
|
|
||||||
"onlyOnPokerogueNet",
|
|
||||||
"pixelPerfection",
|
|
||||||
"openSource",
|
|
||||||
"probablyGood",
|
|
||||||
"itsAMonsterHouse",
|
|
||||||
"dontForgetYourPassword",
|
|
||||||
"tripleTripleTripleAxel",
|
|
||||||
"questionExclamation",
|
|
||||||
"clownEncounters",
|
|
||||||
"fullOfBerries",
|
|
||||||
"limitsAreMeantToBeBrokenSometimes",
|
|
||||||
"keepItCasual",
|
|
||||||
"serversProbablyWorking",
|
|
||||||
"mew",
|
|
||||||
"makeItRainAndYourProblemsGoAway",
|
|
||||||
"customMusicTracks",
|
|
||||||
"youAreValid",
|
|
||||||
"number591IsLookingOff",
|
|
||||||
"timeForYourDeliDelivery",
|
|
||||||
"goodFirstImpression",
|
|
||||||
"iPreferRarerCandies",
|
|
||||||
];
|
|
||||||
|
|
||||||
//#region Seasonal Messages
|
//#region Seasonal Messages
|
||||||
|
|
||||||
const seasonalSplashMessages: Season[] = [
|
const seasonalSplashMessages: Season[] = [
|
||||||
{
|
{
|
||||||
name: "Halloween",
|
name: "halloween",
|
||||||
start: "09-15",
|
start: "10-15",
|
||||||
end: "10-31",
|
end: "10-31"
|
||||||
messages: [ "halloween.pumpkabooAbout", "halloween.mayContainSpiders", "halloween.spookyScarySkeledirge", "halloween.gourgeistUsedTrickOrTreat", "halloween.letsSnuggleForever" ],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "XMAS",
|
name: "xmas",
|
||||||
start: "12-01",
|
start: "12-16",
|
||||||
end: "12-26",
|
end: "12-31"
|
||||||
messages: [ "xmas.happyHolidays", "xmas.unaffilicatedWithDelibirdServices", "xmas.delibirdSeason", "xmas.diamondsFromTheSky", "xmas.holidayStylePikachuNotIncluded" ],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "New Year's",
|
name: "newYears",
|
||||||
start: "01-01",
|
start: "12-31",
|
||||||
end: "01-31",
|
end: "01-14"
|
||||||
messages: [ "newYears.happyNewYear" ],
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
export function getSplashMessages(): string[] {
|
export function getSplashMessages(): string[] {
|
||||||
const splashMessages: string[] = [ ...commonSplashMessages ];
|
const existingKeys = i18next.getResourceBundle(i18next.language, "splashMessages");
|
||||||
|
const splashMessages: string[] = [ ...Object.keys(existingKeys["common"]) ].map((message) => `common.${message}`);
|
||||||
|
if (splashMessages.includes("common.battlesWon")) {
|
||||||
|
splashMessages.push(...Array(Math.max(BATTLES_WON_WEIGHT_MULTIPLIER - 1, 1)).fill("common.battlesWon"));
|
||||||
|
}
|
||||||
|
|
||||||
console.log("use seasonal splash messages", USE_SEASONAL_SPLASH_MESSAGES);
|
console.log("use seasonal splash messages", USE_SEASONAL_SPLASH_MESSAGES);
|
||||||
if (USE_SEASONAL_SPLASH_MESSAGES) {
|
if (USE_SEASONAL_SPLASH_MESSAGES) {
|
||||||
// add seasonal splash messages if the season is active
|
// add seasonal splash messages if the season is active
|
||||||
for (const { name, start, end, messages } of seasonalSplashMessages) {
|
for (const { name, start, end } of seasonalSplashMessages) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const startDate = new Date(`${start}-${now.getFullYear()}`);
|
const startDate = new Date(`${start}-${now.getFullYear()}`);
|
||||||
const endDate = new Date(`${end}-${now.getFullYear()}`);
|
const endDate = new Date(`${end}-${now.getFullYear()}`);
|
||||||
|
if (endDate < startDate) { // If the end date is earlier in the year, that means it's next year
|
||||||
|
if (now >= startDate) {
|
||||||
|
endDate.setFullYear(endDate.getFullYear() + 1); //Ends next year
|
||||||
|
} else if (now <= endDate) {
|
||||||
|
startDate.setFullYear(startDate.getFullYear() - 1); //Started last year
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(`${name} event starts ${startDate} and ends ${endDate}`);
|
||||||
|
|
||||||
if (now >= startDate && now <= endDate) {
|
if (existingKeys.hasOwnProperty(name) && now >= startDate && now <= endDate) {
|
||||||
console.log(`Adding ${messages.length} ${name} splash messages (weight: x${SEASONAL_WEIGHT_MULTIPLIER})`);
|
const existingMessages: string[] = [ ...Object.keys(existingKeys[name]) ].map(m=>`${name}.${m}`);
|
||||||
messages.forEach((message) => {
|
console.log(`Adding ${existingMessages.length} ${name} splash messages from ${i18next.language} (weight: x${SEASONAL_WEIGHT_MULTIPLIER})`);
|
||||||
|
existingMessages.forEach((message) => {
|
||||||
const weightedMessage = Array(SEASONAL_WEIGHT_MULTIPLIER).fill(message);
|
const weightedMessage = Array(SEASONAL_WEIGHT_MULTIPLIER).fill(message);
|
||||||
splashMessages.push(...weightedMessage);
|
splashMessages.push(...weightedMessage);
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@ describe("Data - Splash Messages", () => {
|
|||||||
|
|
||||||
// make sure to adjust this test if the weight it changed!
|
// make sure to adjust this test if the weight it changed!
|
||||||
it("should add contain 10 `battlesWon` splash messages", () => {
|
it("should add contain 10 `battlesWon` splash messages", () => {
|
||||||
const battlesWonMessages = getSplashMessages().filter((message) => message === "splashMessages:battlesWon");
|
const battlesWonMessages = getSplashMessages().filter((message) => message === "splashMessages:common.battlesWon");
|
||||||
expect(battlesWonMessages).toHaveLength(10);
|
expect(battlesWonMessages).toHaveLength(10);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -22,16 +22,16 @@ describe("Data - Splash Messages", () => {
|
|||||||
vi.useRealTimers(); // reset system time
|
vi.useRealTimers(); // reset system time
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should contain halloween messages from Sep 15 to Oct 31", () => {
|
it("should contain halloween messages from Oct 15 to Oct 31", () => {
|
||||||
testSeason(new Date("2024-09-15"), new Date("2024-10-31"), "halloween");
|
testSeason(new Date("2024-10-15"), new Date("2024-10-31"), "halloween");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should contain xmas messages from Dec 1 to Dec 26", () => {
|
it("should contain xmas messages from Dec 16 to Dec 31", () => {
|
||||||
testSeason(new Date("2024-12-01"), new Date("2024-12-26"), "xmas");
|
testSeason(new Date("2024-12-16"), new Date("2024-12-31"), "xmas");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should contain new years messages frm Jan 1 to Jan 31", () => {
|
it("should contain new years messages from Dec 31 '24 to Jan 14 '25", () => {
|
||||||
testSeason(new Date("2024-01-01"), new Date("2024-01-31"), "newYears");
|
testSeason(new Date("2024-12-31"), new Date("2025-01-14"), "newYears");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -60,7 +60,7 @@ function testSeason(startDate: Date, endDate: Date, prefix: string) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(before).toBe(0);
|
expect(before).toBe(0);
|
||||||
expect(start).toBeGreaterThanOrEqual(10); // make sure to adjust if weight is changed!
|
expect(start).toBeGreaterThanOrEqual(20); // make sure to adjust if weight is changed!
|
||||||
expect(end).toBeGreaterThanOrEqual(10); // make sure to adjust if weight is changed!
|
expect(end).toBeGreaterThanOrEqual(20); // make sure to adjust if weight is changed!
|
||||||
expect(after).toBe(0);
|
expect(after).toBe(0);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
.then(stats => {
|
.then(stats => {
|
||||||
if (stats) {
|
if (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 === "splashMessages:common.battlesWon") {
|
||||||
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: stats.battleCount }));
|
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: stats.battleCount }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,6 +98,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
this.splashMessage = Utils.randItem(getSplashMessages());
|
this.splashMessage = Utils.randItem(getSplashMessages());
|
||||||
|
console.log(this.splashMessage);
|
||||||
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: TitleUiHandler.BATTLES_WON_FALLBACK }));
|
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: TitleUiHandler.BATTLES_WON_FALLBACK }));
|
||||||
|
|
||||||
this.appVersionText.setText("v" + version);
|
this.appVersionText.setText("v" + version);
|
||||||
|
Loading…
Reference in New Issue
Block a user