Compare commits

..

No commits in common. "200cca9e8c5bef499cb89ac385a1f43e62634a7f" and "580ce6f0462795c7a8f10ce920e47a7ab89e277e" have entirely different histories.

2 changed files with 137 additions and 56 deletions

View File

@ -13,74 +13,55 @@ export class RibbonData {
//#region Ribbons
//#region Monotype challenge ribbons
/** Ribbon for winning the normal monotype challenge */
/** Flag for winning the normal monotype challenge */
public static readonly MONO_NORMAL = 0x1 as RibbonFlag;
/** Ribbon for winning the fighting monotype challenge */
/** Flag for winning the fighting monotype challenge */
public static readonly MONO_FIGHTING = 0x2 as RibbonFlag;
/** Ribbon for winning the flying monotype challenge */
/** Flag for winning the flying monotype challenge */
public static readonly MONO_FLYING = 0x4 as RibbonFlag;
/** Ribbon for winning the poision monotype challenge */
/** Flag for winning the poision monotype challenge */
public static readonly MONO_POISON = 0x8 as RibbonFlag;
/** Ribbon for winning the ground monotype challenge */
/** Flag for winning the ground monotype challenge */
public static readonly MONO_GROUND = 0x10 as RibbonFlag;
/** Ribbon for winning the rock monotype challenge */
/** Flag for winning the rock monotype challenge */
public static readonly MONO_ROCK = 0x20 as RibbonFlag;
/** Ribbon for winning the bug monotype challenge */
/** Flag for winning the bug monotype challenge */
public static readonly MONO_BUG = 0x40 as RibbonFlag;
/** Ribbon for winning the ghost monotype challenge */
/** Flag for winning the ghost monotype challenge */
public static readonly MONO_GHOST = 0x80 as RibbonFlag;
/** Ribbon for winning the steel monotype challenge */
/** Flag for winning the steel monotype challenge */
public static readonly MONO_STEEL = 0x100 as RibbonFlag;
/** Ribbon for winning the fire monotype challenge */
/** Flag for winning the fire monotype challenge */
public static readonly MONO_FIRE = 0x200 as RibbonFlag;
/** Ribbon for winning the water monotype challenge */
/** Flag for winning the water monotype challenge */
public static readonly MONO_WATER = 0x400 as RibbonFlag;
/** Ribbon for winning the grass monotype challenge */
/** Flag for winning the grass monotype challenge */
public static readonly MONO_GRASS = 0x800 as RibbonFlag;
/** Ribbon for winning the electric monotype challenge */
/** Flag for winning the electric monotype challenge */
public static readonly MONO_ELECTRIC = 0x1000 as RibbonFlag;
/** Ribbon for winning the psychic monotype challenge */
/** Flag for winning the psychic monotype challenge */
public static readonly MONO_PSYCHIC = 0x2000 as RibbonFlag;
/** Ribbon for winning the ice monotype challenge */
/** Flag for winning the ice monotype challenge */
public static readonly MONO_ICE = 0x4000 as RibbonFlag;
/** Ribbon for winning the dragon monotype challenge */
/** Flag for winning the dragon monotype challenge */
public static readonly MONO_DRAGON = 0x8000 as RibbonFlag;
/** Ribbon for winning the dark monotype challenge */
/** Flag for winning the dark monotype challenge */
public static readonly MONO_DARK = 0x10000 as RibbonFlag;
/** Ribbon for winning the fairy monotype challenge */
/** Flag for winning the fairy monotype challenge */
public static readonly MONO_FAIRY = 0x20000 as RibbonFlag;
//#endregion Monotype ribbons
//#region Monogen ribbons
/** Ribbon for winning the the mono gen 1 challenge */
public static readonly MONO_GEN_1 = 0x40000 as RibbonFlag;
/** Ribbon for winning the the mono gen 2 challenge */
public static readonly MONO_GEN_2 = 0x80000 as RibbonFlag;
/** Ribbon for winning the mono gen 3 challenge */
public static readonly MONO_GEN_3 = 0x100000 as RibbonFlag;
/** Ribbon for winning the mono gen 4 challenge */
public static readonly MONO_GEN_4 = 0x200000 as RibbonFlag;
/** Ribbon for winning the mono gen 5 challenge */
public static readonly MONO_GEN_5 = 0x400000 as RibbonFlag;
/** Ribbon for winning the mono gen 6 challenge */
public static readonly MONO_GEN_6 = 0x800000 as RibbonFlag;
/** Ribbon for winning the mono gen 7 challenge */
public static readonly MONO_GEN_7 = 0x1000000 as RibbonFlag;
/** Ribbon for winning the mono gen 8 challenge */
public static readonly MONO_GEN_8 = 0x2000000 as RibbonFlag;
/** Ribbon for winning the mono gen 9 challenge */
public static readonly MONO_GEN_9 = 0x4000000 as RibbonFlag;
//#endregion Monogen ribbons
/** Flag for winning a mono generation challenge */
public static readonly MONO_GEN = 0x40000 as RibbonFlag;
/** Ribbon for winning classic */
public static readonly CLASSIC = 0x8000000 as RibbonFlag;
/** Ribbon for winning the nuzzlocke challenge */
public static readonly NUZLOCKE = 0x10000000 as RibbonFlag;
/** Ribbon for reaching max friendship */
public static readonly FRIENDSHIP = 0x20000000 as RibbonFlag;
/** Flag for winning classic */
public static readonly CLASSIC = 0x80000 as RibbonFlag;
/** Flag for winning the nuzzlocke challenge */
public static readonly NUZLOCKE = 0x80000 as RibbonFlag;
/** Flag for reaching max friendship */
public static readonly FRIENDSHIP = 0x100000 as RibbonFlag;
//#endregion Ribbons
/** Create a new instance of RibbonData. Generally, {@linkcode fromJSON} is used instead. */
constructor(value: number) {
this.payload = value;
}
@ -115,12 +96,115 @@ export class RibbonData {
}
}
/**
* Check if a specific ribbon has been awarded
* @param flag - The ribbon to check
* @returns Whether the specified flag has been awarded
*/
public has(flag: RibbonFlag): boolean {
return !!(this.payload & flag);
//#region getters
/** Ribbon for completing the game in classic mode */
public get classic(): boolean {
return !!(this.payload & RibbonData.CLASSIC);
}
/** Ribbon for completing a Nuzlocke challenge */
public get nuzlocke(): boolean {
return !!(this.payload & RibbonData.NUZLOCKE);
}
/** Ribbon for reaching max friendship with a Pokémon */
public get maxFriendship(): boolean {
return !!(this.payload & RibbonData.FRIENDSHIP);
}
/** Ribbon for completing the normal monotype challenge */
public get monoNormal(): boolean {
return !!(this.payload & RibbonData.MONO_NORMAL);
}
/** Ribbon for completing the flying monotype challenge */
public get monoFlying(): boolean {
return !!(this.payload & RibbonData.MONO_FLYING);
}
/** Ribbon for completing the poison monotype challenge */
public get monoPoison(): boolean {
return !!(this.payload & RibbonData.MONO_POISON);
}
/** Ribbon for completing the ground monotype challenge */
public get monoGround(): boolean {
return !!(this.payload & RibbonData.MONO_GROUND);
}
/** Ribbon for completing the rock monotype challenge */
public get monoRock(): boolean {
return !!(this.payload & RibbonData.MONO_ROCK);
}
/** Ribbon for completing the bug monotype challenge */
public get monoBug(): boolean {
return !!(this.payload & RibbonData.MONO_BUG);
}
/** Ribbon for completing the ghost monotype challenge */
public get monoGhost(): boolean {
return !!(this.payload & RibbonData.MONO_GHOST);
}
/** Ribbon for completing the steel monotype challenge */
public get monoSteel(): boolean {
return !!(this.payload & RibbonData.MONO_STEEL);
}
/** Ribbon for completing the fire monotype challenge */
public get monoFire(): boolean {
return !!(this.payload & RibbonData.MONO_FIRE);
}
/** Ribbon for completing the water monotype challenge */
public get monoWater(): boolean {
return !!(this.payload & RibbonData.MONO_WATER);
}
/** Ribbon for completing the grass monotype challenge */
public get monoGrass(): boolean {
return !!(this.payload & RibbonData.MONO_GRASS);
}
/** Ribbon for completing the electric monotype challenge */
public get monoElectric(): boolean {
return !!(this.payload & RibbonData.MONO_ELECTRIC);
}
/** Ribbon for completing the psychic monotype challenge */
public get monoPsychic(): boolean {
return !!(this.payload & RibbonData.MONO_PSYCHIC);
}
/** Ribbon for completing the ice monotype challenge */
public get monoIce(): boolean {
return !!(this.payload & RibbonData.MONO_ICE);
}
/** Ribbon for completing the dragon monotype challenge */
public get monoDragon(): boolean {
return !!(this.payload & RibbonData.MONO_DRAGON);
}
/** Ribbon for completing the dark monotype challenge */
public get monoDark(): boolean {
return !!(this.payload & RibbonData.MONO_DARK);
}
/** Ribbon for completing the fairy monotype challenge */
public get monoFairy(): boolean {
return !!(this.payload & RibbonData.MONO_FAIRY);
}
/** Ribbon for completing fighting the monotype challenge */
public get monoFighting(): boolean {
return !!(this.payload & RibbonData.MONO_FIGHTING);
}
/** Ribbon for completing any monogen challenge */
public get monoGen(): boolean {
return !!(this.payload & RibbonData.MONO_GEN);
}
//#endregion getters
}

View File

@ -45,7 +45,6 @@ import type { Variant } from "#sprites/variant";
import { getVariantIcon, getVariantTint } from "#sprites/variant";
import { achvs } from "#system/achv";
import type { DexAttrProps, StarterAttributes, StarterMoveset } from "#system/game-data";
import { RibbonData } from "#system/ribbons/ribbon-data";
import { SettingKeyboard } from "#system/settings-keyboard";
import type { DexEntry } from "#types/dex-data";
import type { OptionSelectItem } from "#ui/abstract-option-select-ui-handler";
@ -3291,9 +3290,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
);
container.classicWinIcon
.setVisible(gameData.starterData[speciesId].classicWinCount > 0)
.setTexture(
gameData.dexData[speciesId].ribbons.has(RibbonData.NUZLOCKE) ? "champion_ribbon_emerald" : "champion_ribbon",
);
.setTexture(gameData.dexData[speciesId].ribbons.nuzlocke ? "champion_ribbon_emerald" : "champion_ribbon");
container.favoriteIcon.setVisible(this.starterPreferences[speciesId]?.favorite ?? false);
// 'Candy Icon' mode