From dbb8f4c217a3b46c0d04ca3627f44fdebcb61bc2 Mon Sep 17 00:00:00 2001 From: Lugiad Date: Sun, 12 May 2024 20:42:56 +0200 Subject: [PATCH 01/45] French translation of growth.ts (#763) --- src/locales/fr/growth.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/locales/fr/growth.ts b/src/locales/fr/growth.ts index a0d1cb5ee..71623987b 100644 --- a/src/locales/fr/growth.ts +++ b/src/locales/fr/growth.ts @@ -1,10 +1,10 @@ import { SimpleTranslationEntries } from "#app/plugins/i18n"; export const growth: SimpleTranslationEntries = { - "Erratic": "Erratic", - "Fast": "Fast", - "Medium_Fast": "Medium Fast", - "Medium_Slow": "Medium Slow", - "Slow": "Slow", - "Fluctuating": "Fluctuating" -} as const; \ No newline at end of file + "Erratic": "Erratique", + "Fast": "Rapide", + "Medium_Fast": "Moyenne-Rapide", + "Medium_Slow": "Moyenne-Lente", + "Slow": "Lente", + "Fluctuating": "Fluctuante" +} as const; From 2176d5854d9cd158c302281e1c27f7c7f8443bda Mon Sep 17 00:00:00 2001 From: phynor <166416835+phynor@users.noreply.github.com> Date: Sun, 12 May 2024 20:55:57 +0200 Subject: [PATCH 02/45] fixed typo in german pokemon names (#794) --- src/locales/de/pokemon.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/de/pokemon.ts b/src/locales/de/pokemon.ts index a31d9e01f..69644ff83 100644 --- a/src/locales/de/pokemon.ts +++ b/src/locales/de/pokemon.ts @@ -898,14 +898,14 @@ export const pokemon: SimpleTranslationEntries = { "regidrago": "Regidrago", "glastrier": "Polaross", "spectrier": "Phantoross", - "calyrex": "Calyrex", + "calyrex": "Coronospa", "wyrdeer": "Damythir", "kleavor": "Axantor", "ursaluna": "Ursaluna", "basculegion": "Salmagnis", "sneasler": "Snieboss", "overqwil": "Myriador", - "enamorus": "Enamorus", + "enamorus": "Cupidos", "sprigatito": "Felori", "floragato": "Feliospa", "meowscarada": "Maskagato", @@ -1059,7 +1059,7 @@ export const pokemon: SimpleTranslationEntries = { "galar_slowking": "Laschoking", "galar_corsola": "Corasonn", "galar_zigzagoon": "Zigzachs", - "galar_linoone": "Geradachs", + "galar_linoone": "Geradaks", "galar_darumaka": "Flampion", "galar_darmanitan": "Flampivian", "galar_yamask": "Makabaja", From 512cc5b965cba4b60474f6b67ec78eb58af85b09 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Sun, 12 May 2024 13:56:37 -0500 Subject: [PATCH 03/45] Fix Duplicate Egg Moves (#736) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes an issue where egg moves could get duplicated onto a starter Pokémon's moveset. --- src/ui/starter-select-ui-handler.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index b341cf947..81f081e4c 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1575,6 +1575,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler { // Consolidate move data if it contains an incompatible move if (this.starterMoveset.length < 4 && this.starterMoveset.length < availableStarterMoves.length) this.starterMoveset.push(...availableStarterMoves.filter(sm => this.starterMoveset.indexOf(sm) === -1).slice(0, 4 - this.starterMoveset.length)); + + // Remove duplicate moves + this.starterMoveset = this.starterMoveset.filter( + (move, i) => { + return this.starterMoveset.indexOf(move) === i; + }) as StarterMoveset; const speciesForm = getPokemonSpeciesForm(species.speciesId, formIndex); From 9e453c5b0f6b8808c7ec43d148730ca3cf3a394c Mon Sep 17 00:00:00 2001 From: Douglas Marchione de Souza <42784723+Tiduzz@users.noreply.github.com> Date: Sun, 12 May 2024 16:53:54 -0300 Subject: [PATCH 04/45] Fix sturdy (#604) * Fixes sturdy to stop popping up even if not used * Made changes to better the code, also added a check for wonder_guard 1hp * Refined code, as requested by bennybroseph * Made a small fix and added better comments in relation to interaction with Wonder_guard ability --- src/data/ability.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 90335a85d..cad625715 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -249,10 +249,13 @@ export class PreDefendFormChangeAbAttr extends PreDefendAbAttr { } export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (pokemon.getMaxHp() <= 1 && (pokemon.getHpRatio() < 1 || (args[0] as Utils.NumberHolder).value < pokemon.hp)) - return false; - - return pokemon.addTag(BattlerTagType.STURDY, 1); + if (pokemon.hp === pokemon.getMaxHp() && + pokemon.getMaxHp() > 1 && //Checks if pokemon has wonder_guard (which forces 1hp) + (args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Damage >= hp + return pokemon.addTag(BattlerTagType.STURDY, 1); + } + + return false } } From e195c6d799587186c14d24480c7de888191af06f Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 12 May 2024 16:41:02 -0400 Subject: [PATCH 05/45] Show Default Pokemon icon for missing shiny icon (#802) --- src/battle-scene.ts | 11 ++++++++++- src/field/pokemon.ts | 7 +++++++ src/overrides.ts | 2 ++ src/ui/starter-select-ui-handler.ts | 7 ++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index b986baaa9..47de99401 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -646,7 +646,16 @@ export default class BattleScene extends SceneBase { const container = this.add.container(x, y); const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride)); - icon.setFrame(pokemon.getIconId(true)); + icon.setFrame(pokemon.getIconId(true)); + // Temporary fix to show pokemon's default icon if variant icon doesn't exist + if (icon.frame.name != pokemon.getIconId(true)) { + console.log(`${pokemon.name}'s variant icon does not exist. Replacing with default.`) + const temp = pokemon.shiny; + pokemon.shiny = false; + icon.setTexture(pokemon.getIconAtlasKey(ignoreOverride)); + icon.setFrame(pokemon.getIconId(true)); + pokemon.shiny = temp; + } icon.setOrigin(0.5, 0); container.add(icon); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a73f14586..0713df99f 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2492,6 +2492,13 @@ export class PlayerPokemon extends Pokemon { constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, variant: Variant, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) { super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); + if (Overrides.SHINY_OVERRIDE) { + this.shiny = true; + this.initShinySparkle(); + if (Overrides.VARIANT_OVERRIDE) + this.variant = Overrides.VARIANT_OVERRIDE; + } + if (!dataSource) this.generateAndPopulateMoveset(); this.generateCompatibleTms(); diff --git a/src/overrides.ts b/src/overrides.ts index 2b6106a74..7b7b24635 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -39,6 +39,8 @@ export const STARTING_LEVEL_OVERRIDE: integer = 0; export const ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const MOVESET_OVERRIDE: Array = []; +export const SHINY_OVERRIDE: boolean = false; +export const VARIANT_OVERRIDE: Variant = 0; /** * OPPONENT / ENEMY OVERRIDES diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 81f081e4c..2daec8c70 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1518,7 +1518,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler { (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite) .setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant)); - + // Temporary fix to show pokemon's default icon if variant icon doesn't exist + if ((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).frame.name != species.getIconId(female, formIndex, shiny, variant)) { + console.log(`${species.name}'s variant icon does not exist. Replacing with default.`); + (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setTexture(species.getIconAtlasKey(formIndex, false, variant)); + (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, false, variant)); + } this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY); this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE); this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1; From e61c63f6c8e4ec68ed4d01c340bf613ca78e8a2a Mon Sep 17 00:00:00 2001 From: Tempoanon <163687446+TempsRay@users.noreply.github.com> Date: Sun, 12 May 2024 17:07:31 -0400 Subject: [PATCH 06/45] Implement innards out (#569) * Implement innards out * remove log statement * Some cleanup * Added comment --- src/data/ability.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index cad625715..fa5f8ec75 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2347,6 +2347,26 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr { } } +/** + * Attribute used for abilities (Innards Out) that damage the opponent based on how much HP the last attack used to knock out the owner of the ability. + */ +export class PostFaintHPDamageAbAttr extends PostFaintAbAttr { + constructor() { + super (); + } + + applyPostFaint(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { + const damage = pokemon.turnData.attacksReceived[0].damage; + attacker.damageAndUpdate((damage), HitResult.OTHER); + attacker.turnData.damageTaken += damage; + return true; + } + + getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { + return getPokemonMessage(pokemon, `'s ${abilityName} hurt\nits attacker!`); + } +} + export class RedirectMoveAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (this.canRedirect(args[0] as Moves)) { @@ -3398,7 +3418,8 @@ export function initAbilities() { .attr(FieldPriorityMoveImmunityAbAttr) .ignorable(), new Ability(Abilities.INNARDS_OUT, 7) - .unimplemented(), + .attr(PostFaintHPDamageAbAttr) + .bypassFaint(), new Ability(Abilities.DANCER, 7) .unimplemented(), new Ability(Abilities.BATTERY, 7) From 347972d103c5acae788f8b879723c2f182f612e4 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 12 May 2024 20:45:41 -0400 Subject: [PATCH 07/45] Remove boosted shiny rate --- src/field/pokemon.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 0713df99f..807be3f8d 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1096,11 +1096,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { let shinyThreshold = new Utils.IntegerHolder(32); if (thresholdOverride === undefined) { - if (!this.hasTrainer()) { - if (new Date() < new Date('2024-05-13')) - shinyThreshold.value *= 3; + if (!this.hasTrainer()) this.scene.applyModifiers(ShinyRateBoosterModifier, true, shinyThreshold); - } } else shinyThreshold.value = thresholdOverride; From 22097a0c956270a2fe8d510c5ae457d574fd1e5e Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Mon, 13 May 2024 11:16:50 +1000 Subject: [PATCH 08/45] Fix getSunday function --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 7ec4256e2..ad0673e90 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -117,9 +117,9 @@ export function randSeedEasedWeightedItem(items: T[], easingFunction: string } export function getSunday(date: Date): Date { - const day = date.getDay(); - const diff = date.getDate() - day; - const newDate = new Date(date.setDate(diff)); + const day = date.getUTCDay(); + const diff = date.getUTCDate() - day; + const newDate = new Date(date.setUTCDate(diff)); return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate())); } From 9a09d790f0cb45e29094a3ec48726ecb4a85aa97 Mon Sep 17 00:00:00 2001 From: James Diefenbach <105332964+j-diefenbach@users.noreply.github.com> Date: Mon, 13 May 2024 13:00:46 +1000 Subject: [PATCH 09/45] Rockruff dusk form not evolving (#700) * changed nonfunctioning rockruff form check to ability check for own tempo for dusk form evos * testing changes * rockruff OT uses formIndex for dusk form evolution, removed temporary debug rockruff getFormIndex changes * reverted overrides * fixed spacing issue * evolution times revised * revised dawn and dusk evos for rockruff * reordering evo times for consistency * removed unused imports (abilities, attackTypeBoosterModifierType) --------- Co-authored-by: James Diefenbach --- src/data/pokemon-evolutions.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 0d09277ad..23495b54e 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -1,6 +1,5 @@ import { Gender } from "./gender"; import { AttackTypeBoosterModifier, FlinchChanceModifier } from "../modifier/modifier"; -import { AttackTypeBoosterModifierType } from "../modifier/modifier-type"; import { Moves } from "./enums/moves"; import { PokeballType } from "./pokeball"; import Pokemon from "../field/pokemon"; @@ -1392,9 +1391,9 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.CRABOMINABLE, 1, EvolutionItem.ICE_STONE, null) ], [Species.ROCKRUFF]: [ - new SpeciesFormEvolution(Species.LYCANROC, '', 'midday', 25, null, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.DAY), null), - new SpeciesFormEvolution(Species.LYCANROC, '', 'dusk', 25, null, new SpeciesEvolutionCondition(p => p.scene.getSpeciesFormIndex(p.species) === 1), null), - new SpeciesFormEvolution(Species.LYCANROC, '', 'midnight', 25, null, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.NIGHT), null) + new SpeciesFormEvolution(Species.LYCANROC, '', 'midday', 25, null, new SpeciesEvolutionCondition(p => (p.scene.arena.getTimeOfDay() === TimeOfDay.DAWN || p.scene.arena.getTimeOfDay() === TimeOfDay.DAY) && (p.formIndex === 0)), null), + new SpeciesFormEvolution(Species.LYCANROC, '', 'dusk', 25, null, new SpeciesEvolutionCondition(p => p.formIndex === 1), null), + new SpeciesFormEvolution(Species.LYCANROC, '', 'midnight', 25, null, new SpeciesEvolutionCondition(p => (p.scene.arena.getTimeOfDay() === TimeOfDay.DUSK || p.scene.arena.getTimeOfDay() === TimeOfDay.NIGHT) && (p.formIndex === 0)), null) ], [Species.STEENEE]: [ new SpeciesEvolution(Species.TSAREENA, 28, null, new SpeciesEvolutionCondition(p => p.moveset.filter(m => m.moveId === Moves.STOMP).length > 0), SpeciesWildEvolutionDelay.LONG) From 2b9b63e3f36047168a80cf0c4ca62aa737f15ba8 Mon Sep 17 00:00:00 2001 From: Samuel H Date: Sun, 12 May 2024 23:01:05 -0400 Subject: [PATCH 10/45] Add combined save between waves (#777) --- src/phases.ts | 4 +- src/system/game-data.ts | 87 ++++++++++++++++++++++++++++++++++------- 2 files changed, 74 insertions(+), 17 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index d8ce55e95..271e5350c 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -775,11 +775,11 @@ export class EncounterPhase extends BattlePhase { this.scene.ui.setMode(Mode.MESSAGE).then(() => { if (!this.loaded) { - this.scene.gameData.saveSystem().then(success => { + this.scene.gameData.saveAll(this.scene, true).then(success => { this.scene.disableMenu = false; if (!success) return this.scene.reset(true); - this.scene.gameData.saveSession(this.scene, true).then(() => this.doEncounter()); + this.doEncounter(); }); } else this.doEncounter(); diff --git a/src/system/game-data.ts b/src/system/game-data.ts index a213a3549..5fc564626 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -250,24 +250,28 @@ export class GameData { this.initStarterData(); } + public getSystemSaveData(): SystemSaveData { + return { + trainerId: this.trainerId, + secretId: this.secretId, + gender: this.gender, + dexData: this.dexData, + starterData: this.starterData, + gameStats: this.gameStats, + unlocks: this.unlocks, + achvUnlocks: this.achvUnlocks, + voucherUnlocks: this.voucherUnlocks, + voucherCounts: this.voucherCounts, + eggs: this.eggs.map(e => new EggData(e)), + gameVersion: this.scene.game.config.gameVersion, + timestamp: new Date().getTime() + }; + } + public saveSystem(): Promise { return new Promise(resolve => { this.scene.ui.savingIcon.show(); - const data: SystemSaveData = { - trainerId: this.trainerId, - secretId: this.secretId, - gender: this.gender, - dexData: this.dexData, - starterData: this.starterData, - gameStats: this.gameStats, - unlocks: this.unlocks, - achvUnlocks: this.achvUnlocks, - voucherUnlocks: this.voucherUnlocks, - voucherCounts: this.voucherCounts, - eggs: this.eggs.map(e => new EggData(e)), - gameVersion: this.scene.game.config.gameVersion, - timestamp: new Date().getTime() - }; + const data = this.getSystemSaveData(); const maxIntAttrValue = Math.pow(2, 31); const systemData = JSON.stringify(data, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v); @@ -817,6 +821,59 @@ export class GameData { }) as SessionSaveData; } + saveAll(scene: BattleScene, skipVerification?: boolean): Promise { + return new Promise(resolve => { + Utils.executeIf(!skipVerification, updateUserInfo).then(success => { + if (success !== null && !success) + return resolve(false); + this.scene.ui.savingIcon.show(); + const data = this.getSystemSaveData(); + const sessionData = this.getSessionSaveData(scene); + + const maxIntAttrValue = Math.pow(2, 31); + const systemData = this.getSystemSaveData(); + + const request = { + system: systemData, + session: sessionData, + sessionSlotId: scene.sessionSlotId + }; + + if (!bypassLogin) { + Utils.apiPost('savedata/updateall', JSON.stringify(request, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v), undefined, true) + .then(response => response.text()) + .then(error => { + this.scene.ui.savingIcon.hide(); + if (error) { + if (error.startsWith('client version out of date')) { + this.scene.clearPhaseQueue(); + this.scene.unshiftPhase(new OutdatedPhase(this.scene)); + } else if (error.startsWith('session out of date')) { + this.scene.clearPhaseQueue(); + this.scene.unshiftPhase(new ReloadSessionPhase(this.scene)); + } + console.error(error); + return resolve(false); + } + resolve(true); + }); + } else { + localStorage.setItem('data_bak', localStorage.getItem('data')); + + localStorage.setItem('data', btoa(JSON.stringify(systemData, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v))); + + localStorage.setItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`, btoa(JSON.stringify(sessionData))); + + console.debug('Session data saved'); + + this.scene.ui.savingIcon.hide(); + + resolve(true); + } + }); + }); + } + public tryExportData(dataType: GameDataType, slotId: integer = 0): Promise { return new Promise(resolve => { const dataKey: string = getDataTypeKey(dataType, slotId); From 9ee5fec41d2b84a24d30eae2e89a847c10b2edbd Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Sun, 12 May 2024 22:38:28 -0500 Subject: [PATCH 11/45] Added Passives to the Summary Screen (#703) * Added passives to the Summary Screen Adds the ability to view passives on the Summary screen. Just like in the starter select, you can only see the passive once it is unlocked. There is a small pixel button prompt which helps indicate you are able to press the button to view the passive. This buttons shows an A when gamepad support is enabled and a Z otherwise. * Update summary-ui-handler.ts * Updated for Legacy Support --- public/images/ui/legacy/summary_profile.png | Bin 1507 -> 1562 bytes .../ui/legacy/summary_profile_ability.png | Bin 0 -> 295 bytes .../ui/legacy/summary_profile_passive.png | Bin 0 -> 310 bytes .../ui/legacy/summary_profile_prompt_a.png | Bin 0 -> 182 bytes .../ui/legacy/summary_profile_prompt_z.png | Bin 0 -> 191 bytes public/images/ui/summary_profile.png | Bin 1820 -> 1673 bytes public/images/ui/summary_profile_ability.png | Bin 0 -> 295 bytes public/images/ui/summary_profile_passive.png | Bin 0 -> 310 bytes public/images/ui/summary_profile_prompt_a.png | Bin 0 -> 182 bytes public/images/ui/summary_profile_prompt_z.png | Bin 0 -> 191 bytes src/loading-scene.ts | 4 + src/ui/summary-ui-handler.ts | 127 +++++++++++++----- 12 files changed, 100 insertions(+), 31 deletions(-) create mode 100644 public/images/ui/legacy/summary_profile_ability.png create mode 100644 public/images/ui/legacy/summary_profile_passive.png create mode 100644 public/images/ui/legacy/summary_profile_prompt_a.png create mode 100644 public/images/ui/legacy/summary_profile_prompt_z.png create mode 100644 public/images/ui/summary_profile_ability.png create mode 100644 public/images/ui/summary_profile_passive.png create mode 100644 public/images/ui/summary_profile_prompt_a.png create mode 100644 public/images/ui/summary_profile_prompt_z.png diff --git a/public/images/ui/legacy/summary_profile.png b/public/images/ui/legacy/summary_profile.png index 25fc3ca70d01422ba4d2fa11b7764ff4b20b7cdb..1d184023ca8f77c937883b6ca5453140635bee2c 100644 GIT binary patch literal 1562 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 diff --git a/public/images/ui/legacy/summary_profile_ability.png b/public/images/ui/legacy/summary_profile_ability.png new file mode 100644 index 0000000000000000000000000000000000000000..84c41556ab0241d9a27f3f214b8dac684e344cf5 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^T0qRf!3HGzm*=JdDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheoCO|{#S9F5he4R}c>anMpx_=)7sn6_|D!>Ue1{cyyqDWfN$#&c)o1(Z zh-~%i6p_VOSk?Hh>bNExH&Hy=aDJbB&y-6GZ+WEmY1;_CTAIJ)`1=X=8!OkYKArYH z_i#{;?p&#gGv6^WJ??5C8IMRkDAt_M?YC)e53#2<|97SNZWut^@Ct zuE}j-QoX!WdzjtWY(73KSK@2=eJLZygE86WhxrFti?wrv(>|^Tl(U3l6e&e;v`^&DK-IqAC`tW|a&6YraFnGH9xvX literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/summary_profile_passive.png b/public/images/ui/legacy/summary_profile_passive.png new file mode 100644 index 0000000000000000000000000000000000000000..8d70a54b2a4361ae2dc99a0cf6e817535de69be1 GIT binary patch literal 310 zcmV-60m=S}P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0Lw{4K~y+Tt&*`0 z!ypVqX_XIU%-B!qn2}HHn2mDChc3jFsLDx}<9Eh^knq{}tPx|(!E^^#rXF)$SfsoU z@C8k;b*;_Nd)tsQ@*SM4_kYRlS2^#G_WJ!g%; zGlOizm8plB^x4bz^Z{>iKXXyfS@%~A$@O~tz*OpUhQFT>zKyceJ~lZ{LjV8(07*qo IM6N<$g4>FQ;s5{u literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/summary_profile_prompt_a.png b/public/images/ui/legacy/summary_profile_prompt_a.png new file mode 100644 index 0000000000000000000000000000000000000000..146f1a862e5d5e38b1cee9699c1df7df31fa6d06 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL2pkN#}JL+(mqEn1_ch5wbQGe>|M-vUwg5=l{B)Lg7=H%9oCrYkM-7 YYLY^H%T7L=2Q-$!)78&qol`;+06^$Fwg3PC literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/summary_profile_prompt_z.png b/public/images/ui/legacy/summary_profile_prompt_z.png new file mode 100644 index 0000000000000000000000000000000000000000..ed842718914c4719d2628329b61ce9ce546d0fa2 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!4OXu#}JL++%f22WQ%mvv4FO#tLsKgIw6 literal 0 HcmV?d00001 diff --git a/public/images/ui/summary_profile.png b/public/images/ui/summary_profile.png index 5fff26d5a9cfacb8228c739c90efe33e1c8d0e7a..38bb5e84dfda3cb13df2bc1cddd8a532e5a4bad2 100644 GIT binary patch delta 1303 zcmV+y1?c*m4v7trFn<69XF*Lt006O%3;baP00009a7bBm000id000id0mpBsWB>pL z9!W$&RCr$P-Jx$ANfgI%`%q|M*}+rLfsjc43ydnO;G~!(Ah58ou&}@&Ac3KUDJ-#6 zVsP-_{Rg3DIX!3J=4G<8-i`f>?YZwq8hK|jevah*S&CU10uU~hq?+x}__RX8kW@|%b zrWY5h6W93(?~ktUdMfw4larHbIC+^G5<9b`2 zeI10VEYCVtpHAiMo`!)zwnN}U^HJ!?>>wg@!ZkJ=RBgJkO*K&1IwlCIj zZR`8kwFp(YhF!n=m$O(bR*%*hqI5mZ{n*8|T%Ap&b$89a`-gH3$K%Pv{r$^JGU%P3 zPpTu7rVbWwGO#^$uzvjHdLP)97eB`WusMPS2oNklfMB7wzdn4Z$G`vl{bDVyr_ztL z?LA}!3xB&!4{(8JMmJ7JB>rk3XxU=f}q8>00Xl5ITYd2oNm1x!k2< zmwU8BL9nnFEKDWcqY*6Zgoh{93xvR zJp^4s6T6mQ8uoeqKI6CB(OcR%EFewYr0H_c_Y(QX;=HM@iR(=@_YuJY1h^CglW+t# zf9iihe0==AT6%JNdRiUfE!iLaZhAj(IO<@f&d$cw5#ADi^t%j=!Q$@`?}l|Ml;K6N z=v2Ewrz*>{V9}{|gHBbRI#_h7-JnyIX%(!=gi!4QovK{J*=+Vu9peqrsmj*)T|vAJ z?rFCdY zQQpVtv^sk7>GE>$?dqzUJ+igYXtX+x&++xPI_Yzp>YJwZ_*~~T`qXUNpMKtP&n9ke zzBj%fI2?7bQfFu5>Zsjfu~(zOuKS$Ljjf%WoD8NH7mamXuAV*DSq*j9VzBu=j*h3uozPR6{^Y}TN zreL^O&uetq@8WCq8HB1FFM?&AYPnqY9&X*-t=pH*{lt!JZkJ*<=JR={dU35OByBaD z_M5b>&-)C!{6jgO1*=b|N{5ScJ4x-b%P-$te_VHMb&Pd{^u)Hg57YL#UN5Z~JB`WJ zG)?|ow;;{LR*iJd9kpT4d?Ki245Gu`j? zPJOS3+4rp*bgFU2u@jv>{Yw%YM5Z zdUmCNGS$K2O$N574%UyK+(ZN0()a^n0GlC`p#&?FU<79xfUO%0{sX@!Y9ZW;KAHdk N002ovPDHLkV1nFB!K?rP delta 1469 zcmV;u1w#6X4V(^;Fn9}rvTH!vcf8;U`ZtZ1x8U6P$_0H zSSiF(Nnl}Nfk8kGLj!a0NTd>jL(#!wg`s9SP|bEcJF~y+r(W-UKT_4~?Ck7X-pB9G z%E^wb!nbeVUaQudnO)9iTg!_)x5;FZY!A0d^>^#O-rXhJ{eLl2#}n@R7_3$g_Wk?g z=+MW3?oLuGmdoYqX0vHD$Rf{+pWO+6Ih#e>-T!s{!?DBdoY*lo?bk>5_mB4G&Df^X zi`ox0^j9=kO)6C=RT1{po?1U1k2{UiN2}F?nVG%39LI+M(n`TlEZZQ8W^mwk&o zw=BzQx9d7i-+$cSKOXuJut!_L>Qbr9$|rJNyIH)_H0cwzbseWqT&2Qr6v66Rsm#hJ zva1mO{K#)NOINbGK20iC(|z>;m1>wy%(_=9U)7w+ziF{vuUl0z|1O`~Zjt9Uo6k#k z46EAvIOn2L4cBP7T<#RA^?Ge)R+`6z?f$a++40*_7~I)ViV5G?$5sY}Hs zbF^cT{C^E%;CK3Xe!ewlyS@E6SF5|M>??wWgK$+VbgV%NaVdy{7)pRr2o??|yj`Di zjPouo1<~5a^K&yR&x8C+yC$LWt5$ev*fex~Rs25IpMUY&tY{{z9Pi$Lh*p!><(}*3 z*7?h^al`!`%Oxbi0tA?20RjXI5Fl890KozT2$TE+7Lzar6@SIwy!do;Q(Ad;cGhSR z|Dkp6LE7Pi>{9J+oqPCq_z>=@{!PZYoXvXsaPO4W>cLJ=-yZrfu!AC4&(A-$R$N_8 zZL_I=Ht}pew?&>8%kIQ>Cv@2U^z^i~918d8`h@*c?Wu8^yp}$25B(0`4;+{1Uuo*{ zJmOSE2;1wH$A9B-tNvlTU$y+uh2!?oYQ^6j8H!S{npUb%Y#aY_ZIS1eWm#<{soQsI zy=%|1tQ4x)e*4B%Dh$I`u)0(#GmFl5%q)5-SXZIyDobj;-|p|@80J<~s^KYu)wNQY zl>_9PS1MnuGK80cW}$ZGKX6=5VvX0=7mWu9KcVZEyKLtNayFlL8h<<TB%aPZBt{_^$V9{C$zsDR*ELa5vxvBW2UNE)7Mh-27U)Sneg-SI{CuaMpR8Cc;@#je4r@udUa)I#s$ErZ=#)Ch8 z?2ca5vDS^5ny2~8sc~bdRKqn|E|;(S7-+p-o7t~V`_!_NYERjanMpx_=)7sn6_|D!>Ue1{cyyqDWfN$#&c)o1(Z zh-~%i6p_VOSk?Hh>bNExH&Hy=aDJbB&y-6GZ+WEmY1;_CTAIJ)`1=X=8!OkYKArYH z_i#{;?p&#gGv6^WJ??5C8IMRkDAt_M?YC)e53#2<|97SNZWut^@Ct zuE}j-QoX!WdzjtWY(73KSK@2=eJLZygE86WhxrFti?wrv(>|^Tl(U3l6e&e;v`^&DK-IqAC`tW|a&6YraFnGH9xvX literal 0 HcmV?d00001 diff --git a/public/images/ui/summary_profile_passive.png b/public/images/ui/summary_profile_passive.png new file mode 100644 index 0000000000000000000000000000000000000000..8d70a54b2a4361ae2dc99a0cf6e817535de69be1 GIT binary patch literal 310 zcmV-60m=S}P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0Lw{4K~y+Tt&*`0 z!ypVqX_XIU%-B!qn2}HHn2mDChc3jFsLDx}<9Eh^knq{}tPx|(!E^^#rXF)$SfsoU z@C8k;b*;_Nd)tsQ@*SM4_kYRlS2^#G_WJ!g%; zGlOizm8plB^x4bz^Z{>iKXXyfS@%~A$@O~tz*OpUhQFT>zKyceJ~lZ{LjV8(07*qo IM6N<$g4>FQ;s5{u literal 0 HcmV?d00001 diff --git a/public/images/ui/summary_profile_prompt_a.png b/public/images/ui/summary_profile_prompt_a.png new file mode 100644 index 0000000000000000000000000000000000000000..146f1a862e5d5e38b1cee9699c1df7df31fa6d06 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL2pkN#}JL+(mqEn1_ch5wbQGe>|M-vUwg5=l{B)Lg7=H%9oCrYkM-7 YYLY^H%T7L=2Q-$!)78&qol`;+06^$Fwg3PC literal 0 HcmV?d00001 diff --git a/public/images/ui/summary_profile_prompt_z.png b/public/images/ui/summary_profile_prompt_z.png new file mode 100644 index 0000000000000000000000000000000000000000..ed842718914c4719d2628329b61ce9ce546d0fa2 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!4OXu#}JL++%f22WQ%mvv4FO#tLsKgIw6 literal 0 HcmV?d00001 diff --git a/src/loading-scene.ts b/src/loading-scene.ts index a7d68ef98..a49fed480 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -100,6 +100,10 @@ export class LoadingScene extends SceneBase { this.loadImage('summary_bg', 'ui'); this.loadImage('summary_overlay_shiny', 'ui'); this.loadImage('summary_profile', 'ui'); + this.loadImage('summary_profile_prompt_z', 'ui') // The pixel Z button prompt + this.loadImage('summary_profile_prompt_a', 'ui'); // The pixel A button prompt + this.loadImage('summary_profile_ability', 'ui'); // Pixel text 'ABILITY' + this.loadImage('summary_profile_passive', 'ui'); // Pixel text 'PASSIVE' this.loadImage('summary_status', 'ui'); this.loadImage('summary_stats', 'ui'); this.loadImage('summary_stats_overlay_exp', 'ui'); diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index e6c90887b..35f3e34ad 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -20,6 +20,7 @@ import { loggedInUser } from "../account"; import { PlayerGender } from "../system/game-data"; import { Variant, getVariantTint } from "#app/data/variant"; import {Button} from "../enums/buttons"; +import { Ability } from "../data/ability.js"; enum Page { PROFILE, @@ -32,6 +33,18 @@ export enum SummaryUiMode { LEARN_MOVE } +/** Holds all objects related to an ability for each iteration */ +interface abilityContainer { + /** An image displaying the summary label */ + labelImage: Phaser.GameObjects.Image, + /** The ability object */ + ability: Ability, + /** The text object displaying the name of the ability */ + nameText: Phaser.GameObjects.Text, + /** The text object displaying the description of the ability */ + descriptionText: Phaser.GameObjects.Text, +} + export default class SummaryUiHandler extends UiHandler { private summaryUiMode: SummaryUiMode; @@ -54,6 +67,12 @@ export default class SummaryUiHandler extends UiHandler { private championRibbon: Phaser.GameObjects.Image; private statusContainer: Phaser.GameObjects.Container; private status: Phaser.GameObjects.Image; + /** The pixel button prompt indicating a passive is unlocked */ + private abilityPrompt: Phaser.GameObjects.Image; + /** Object holding everything needed to display an ability */ + private abilityContainer: abilityContainer; + /** Object holding everything needed to display a passive */ + private passiveContainer: abilityContainer; private summaryPageContainer: Phaser.GameObjects.Container; private movesContainer: Phaser.GameObjects.Container; private moveDescriptionText: Phaser.GameObjects.Text; @@ -441,6 +460,17 @@ export default class SummaryUiHandler extends UiHandler { this.showMoveSelect(); success = true; } + // if we're on the PROFILE page and this pokemon has a passive unlocked.. + else if (this.cursor === Page.PROFILE && this.pokemon.hasPassive()) { + // Since abilities are displayed by default, all we need to do is toggle visibility on all elements to show passives + this.abilityContainer.nameText.setVisible(!this.abilityContainer.descriptionText.visible); + this.abilityContainer.descriptionText.setVisible(!this.abilityContainer.descriptionText.visible); + this.abilityContainer.labelImage.setVisible(!this.abilityContainer.labelImage.visible); + + this.passiveContainer.nameText.setVisible(!this.passiveContainer.descriptionText.visible); + this.passiveContainer.descriptionText.setVisible(!this.passiveContainer.descriptionText.visible); + this.passiveContainer.labelImage.setVisible(!this.passiveContainer.labelImage.visible); + } } else if (button === Button.CANCEL) { if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) this.hideMoveSelect(); @@ -686,40 +716,75 @@ export default class SummaryUiHandler extends UiHandler { profileContainer.add(luckText); } - const ability = this.pokemon.getAbility(true); + this.abilityContainer = { + labelImage: this.scene.add.image(0, 0, 'summary_profile_ability'), + ability: this.pokemon.getAbility(true), + nameText: null, + descriptionText: null}; + + const allAbilityInfo = [this.abilityContainer]; // Creates an array to iterate through + // Only add to the array and set up displaying a passive if it's unlocked + if (this.pokemon.hasPassive()) { + this.passiveContainer = { + labelImage: this.scene.add.image(0, 0, 'summary_profile_passive'), + ability: this.pokemon.getPassiveAbility(), + nameText: null, + descriptionText: null}; + allAbilityInfo.push(this.passiveContainer); - const abilityNameText = addTextObject(this.scene, 7, 66, ability.name, TextStyle.SUMMARY_ALT); - abilityNameText.setOrigin(0, 1); - profileContainer.add(abilityNameText); - - const abilityDescriptionText = addTextObject(this.scene, 7, 69, ability.description, TextStyle.WINDOW_ALT, { wordWrap: { width: 1224 } }); - abilityDescriptionText.setOrigin(0, 0); - profileContainer.add(abilityDescriptionText); - - const abilityDescriptionTextMaskRect = this.scene.make.graphics({}); - abilityDescriptionTextMaskRect.setScale(6); - abilityDescriptionTextMaskRect.fillStyle(0xFFFFFF); - abilityDescriptionTextMaskRect.beginPath(); - abilityDescriptionTextMaskRect.fillRect(110, 90.5, 206, 31); - - const abilityDescriptionTextMask = abilityDescriptionTextMaskRect.createGeometryMask(); - - abilityDescriptionText.setMask(abilityDescriptionTextMask); - - const abilityDescriptionLineCount = Math.floor(abilityDescriptionText.displayHeight / 14.83); - - if (abilityDescriptionLineCount > 2) { - abilityDescriptionText.setY(69); - this.descriptionScrollTween = this.scene.tweens.add({ - targets: abilityDescriptionText, - delay: Utils.fixedInt(2000), - loop: -1, - hold: Utils.fixedInt(2000), - duration: Utils.fixedInt((abilityDescriptionLineCount - 2) * 2000), - y: `-=${14.83 * (abilityDescriptionLineCount - 2)}` - }); + // Sets up the pixel button prompt image + this.abilityPrompt = this.scene.add.image(0, 0, !this.scene.gamepadSupport ? 'summary_profile_prompt_z' : 'summary_profile_prompt_a'); + this.abilityPrompt.setPosition(8, 43); + this.abilityPrompt.setVisible(true); + this.abilityPrompt.setOrigin(0, 0); + profileContainer.add(this.abilityPrompt); } + allAbilityInfo.forEach(abilityInfo => { + abilityInfo.labelImage.setPosition(17, 43); + abilityInfo.labelImage.setVisible(true); + abilityInfo.labelImage.setOrigin(0, 0); + profileContainer.add(abilityInfo.labelImage); + + abilityInfo.nameText = addTextObject(this.scene, 7, 66, abilityInfo.ability.name, TextStyle.SUMMARY_ALT); + abilityInfo.nameText.setOrigin(0, 1); + profileContainer.add(abilityInfo.nameText); + + abilityInfo.descriptionText = addTextObject(this.scene, 7, 69, abilityInfo.ability.description, TextStyle.WINDOW_ALT, { wordWrap: { width: 1224 } }); + abilityInfo.descriptionText.setOrigin(0, 0); + profileContainer.add(abilityInfo.descriptionText); + + // Sets up the mask that hides the description text to give an illusion of scrolling + const descriptionTextMaskRect = this.scene.make.graphics({}); + descriptionTextMaskRect.setScale(6); + descriptionTextMaskRect.fillStyle(0xFFFFFF); + descriptionTextMaskRect.beginPath(); + descriptionTextMaskRect.fillRect(110, 90.5, 206, 31); + + const abilityDescriptionTextMask = descriptionTextMaskRect.createGeometryMask(); + + abilityInfo.descriptionText.setMask(abilityDescriptionTextMask); + + const abilityDescriptionLineCount = Math.floor(abilityInfo.descriptionText.displayHeight / 14.83); + + // Animates the description text moving upwards + if (abilityDescriptionLineCount > 2) { + abilityInfo.descriptionText.setY(69); + this.descriptionScrollTween = this.scene.tweens.add({ + targets: abilityInfo.descriptionText, + delay: Utils.fixedInt(2000), + loop: -1, + hold: Utils.fixedInt(2000), + duration: Utils.fixedInt((abilityDescriptionLineCount - 2) * 2000), + y: `-=${14.83 * (abilityDescriptionLineCount - 2)}` + }); + } + }); + // Turn off visibility of passive info by default + this.passiveContainer?.labelImage.setVisible(false); + this.passiveContainer?.nameText.setVisible(false); + this.passiveContainer?.descriptionText.setVisible(false); + let memoString = `${getBBCodeFrag(Utils.toReadableString(Nature[this.pokemon.getNature()]), TextStyle.SUMMARY_RED)}${getBBCodeFrag(' nature,', TextStyle.WINDOW_ALT)}\n${getBBCodeFrag(`${this.pokemon.metBiome === -1 ? 'apparently ' : ''}met at Lv`, TextStyle.WINDOW_ALT)}${getBBCodeFrag(this.pokemon.metLevel.toString(), TextStyle.SUMMARY_RED)}${getBBCodeFrag(',', TextStyle.WINDOW_ALT)}\n${getBBCodeFrag(getBiomeName(this.pokemon.metBiome), TextStyle.SUMMARY_RED)}${getBBCodeFrag('.', TextStyle.WINDOW_ALT)}`; const memoText = addBBCodeTextObject(this.scene, 7, 113, memoString, TextStyle.WINDOW_ALT); From e9c09070df4ab3132aa9ec8c22b4858368cf7b55 Mon Sep 17 00:00:00 2001 From: Tempoanon <163687446+TempsRay@users.noreply.github.com> Date: Mon, 13 May 2024 01:24:07 -0400 Subject: [PATCH 12/45] Stench should not trigger on status moves (#800) --- src/data/ability.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index fa5f8ec75..70c59b700 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2783,7 +2783,7 @@ export const allAbilities = [ new Ability(Abilities.NONE, 3) ]; export function initAbilities() { allAbilities.push( new Ability(Abilities.STENCH, 3) - .attr(PostAttackApplyBattlerTagAbAttr, false, (user, target, move) => !move.getMove().findAttr(attr => attr instanceof FlinchAttr) ? 10 : 0, BattlerTagType.FLINCHED), + .attr(PostAttackApplyBattlerTagAbAttr, false, (user, target, move) => (move.getMove().category !== MoveCategory.STATUS && !move.getMove().findAttr(attr => attr instanceof FlinchAttr)) ? 10 : 0, BattlerTagType.FLINCHED), new Ability(Abilities.DRIZZLE, 3) .attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN), From 8d96ec7666480e9c01d4df5470214911b6dba0b5 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 13 May 2024 01:43:04 -0400 Subject: [PATCH 13/45] Add canonical link --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 177a92efc..5090192a4 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@ +