Skip to content

Commit

Permalink
chore: add moomin season data (#94)
Browse files Browse the repository at this point in the history
* chore: add moomin data

* fix: naming

* chore: add moomin spirits

* chore: add seasonal prices for spirits data

* chore: some fixes and improvements
  • Loading branch information
imnaiyar authored Oct 14, 2024
1 parent 3af506a commit 038ef9b
Show file tree
Hide file tree
Showing 10 changed files with 518 additions and 58 deletions.
9 changes: 6 additions & 3 deletions src/bot/libs/classes/SeasonCalculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,12 @@ export default class {
});
}
public async buildCard(): Promise<Buffer> {
const emojiURL = this.author.client.emojis.cache
.get(parseEmoji(this.seasonIcon)?.id as unknown as string)
?.imageURL({ extension: "png" });
const { id } = parseEmoji(this.seasonIcon)!;
const emojiURL = id
? this.author.client.emojis.cache.get(id)?.imageURL() ||
(await this.author.client.application.emojis.fetch(id).catch(() => null))?.imageURL()
: null;

const card = new SeasonProgressCard()
.setName(this.author instanceof GuildMember ? this.author.nickname ?? this.author.displayName : this.author.displayName)
.setProgress(parseInt(this.progressLevel.toFixed()))
Expand Down
7 changes: 6 additions & 1 deletion src/bot/libs/classes/Spirits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ export class Spirits {
.replaceAll(":RegularHeart:", "<:regularHeart:1207793247792013474>")
.replaceAll(":AC:", "<:AscendedCandle:1207793254301433926>"),
});
embed.setImage(`${config.CDN_URL}/${data.tree!.image}`);

// Allow usage of both cdn link and direct link
// TODO: Consider removing cdn as it is getting very expensive lol
let url = data.tree?.image;
if (!url?.startsWith("https://")) url = config.CDN_URL + "/" + url;
embed.setImage(url);
}
return embed;
}
Expand Down
73 changes: 34 additions & 39 deletions src/bot/libs/constants/seasonPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,55 @@ import type { SeasonPrice } from "#libs/types";
* Spirit prices of the current season (For calculator)
*/
export const SeasonPrices: { [key: string]: SeasonPrice } = {
"The Cellist's Beginnings": {
icon: "<:CellistB:1262326135216406559>",
"Comfort of Kindness": {
icon: "<:ComfortofKindnessCape:1295293399406084147>",
collectibles: [
{ item: "Hair", icon: "<:CellitBHair:1262322324963852308>", price: 20 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 26 },
{ item: "Outfit", icon: "<:CellitBOutfit:1262322298145341581>", price: 32 },
{ item: "Heart", icon: "<:DuetHeart:1262318647376871424>", price: 3, pass: true },
],
},
"The Pianist's Beginnings": {
icon: "<:PianistB:1262326115024769107>",
collectibles: [
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 14 },
{ item: "Hair", icon: "<:PianistBHair:1262322985134461029>", price: 20 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 24 },
{ item: "Small Blue Rug", icon: "<:SmallBlueRug:1262322964062277666>", price: 30 },
{ item: "Heart", icon: "<:DuetHeart:1262318647376871424>", price: 3, pass: true },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 6 },
{ item: "Hair", icon: "<:ComfortofKindnessHair:1295319528678490132>", price: 16 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 20 },
{ item: "Bow tie", icon: "<:ComfortofKindnessNeckAccessory:1295319558441140244>", price: 24 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 32 },
{ item: "Heart", icon: "<:MoominHeart:1295299241756852234>", price: 3, pass: true },
],
},
"The Musicians' Legacy": {
icon: "<:MusicianL:1262326097341714514>",
"Sense of Self": {
icon: "<:SenseofSelfNeckAccessory:1295294042258673718>",
collectibles: [
{ item: "Music Sheet #40", icon: "<:MusicIcon:1262323496852131882>", price: 14 },
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 24 },
{ item: "Instrument", icon: "<:MusiciansLInstrument:1262323472760049724>", price: 34 },
{ item: "Heart", icon: "<:DuetHeart:1262318647376871424>", price: 3, pass: true },
{ item: "Music Sheet #41", icon: "<:MusicIcon:1262323496852131882>", price: 12 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 18 },
{ item: "Neck Accessory", icon: "<:SenseofSelfNeckAccessory:1295294042258673718>", price: 24 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 28 },
{ item: "Heart", icon: "<:MoominHeart:1295299241756852234>", price: 3, pass: true },
],
},
"The Cellist's Flourishing": {
icon: "<:CellistF:1262326155508318380>",
"Spirit of Adventure": {
icon: "<:SpiritofAdventureCape:1295294188375511082>",
collectibles: [
{ item: "Small Pink Rug", icon: "<:SmallPinkRug:1262323794715082824>", price: 16 },
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 18 },
{ item: "Cape", icon: "<:CellistFCape:1262323774997659673>", price: 22 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 24 },
{ item: "Heart", icon: "<:DuetHeart:1262318647376871424>", price: 3, pass: true },
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 8 },
{ item: "Harmonica", icon: "<:SpiritofAdventureHarmonica:1295314878956830741>", price: 20 },
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 26 },
{ item: "Cape", icon: "<:SpiritofAdventureCape:1295294188375511082>", price: 38 },
{ item: "Heart", icon: "<:MoominHeart:1295299241756852234>", price: 3, pass: true },
],
},
"The Pianist's Flourishing": {
icon: "<:PianistF:1262326075380334623>",
"Inspiration of Inclusion": {
icon: "<:InspirationofInclusionNeckAccess:1295294371876573325>",
collectibles: [
{ item: "Blessing Nodes", icon: "<:BlessingNode:1238570665267691602>", price: 12 },
{ item: "Shoes", icon: "<:PianistFShoes:1262324120532549692>", price: 22 },
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 26 },
{ item: "Heart", icon: "<:DuetHeart:1262318647376871424>", price: 3, pass: true },
{ item: "Grandfather Clock", icon: "<:InspirationofInclusionClockPropi:1295301238304538695>", price: 12 },
{ item: "Blessing Node", icon: "<:BlessingNode:1238570665267691602>", price: 16 },
{ item: "Painting", icon: "<:InspirationofInclusionPainting:1295301282659045447>", price: 20 },
{ item: "Blessings Node", icon: "<:BlessingNode:1238570665267691602>", price: 26 },
{ item: "Outfit", icon: "<:InspirationofInclusionOutfit:1295300513868419148>", price: 36 },
{ item: "Heart", icon: "<:MoominHeart:1295299241756852234>", price: 3, pass: true },
],
},
} as const;

export const SeasonData = {
name: "Season of Duets",
icon: "<:SODuet:1262310944332189768>",
start: "15-07-2024",
end: "29-09-2024",
name: "Season of Moomin",
icon: "<:SeasonofMoominIcon:1295323276612206602>",
start: "14-10-2024",
end: "29-12-2024",
duration: 77,
spiritsUpdated: true,
} as const;
8 changes: 7 additions & 1 deletion src/bot/libs/constants/seasonsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ export interface SeasonData {
}

export default {
moomin: {
name: "Moomin",
icon: "<:SeasonofMoominIcon:1295323276612206602>",
active: true,
from: ["14-10-2024", "29-12-2024"],
quests: [],
},
duet: {
name: "Duets",
icon: "<:SODuet:1262310944332189768>",
active: true,
from: ["15-07-2024", "29-09-2024"],
quests: [
{
Expand Down
8 changes: 4 additions & 4 deletions src/bot/libs/constants/spirits-datas/seasonal/21-nesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const data: Record<string, SpiritsData> = {
realm: "Aviary Village",
season: "Nesting",
ts: {
eligible: false,
eligible: true,
returned: false,
dates: [],
},
Expand Down Expand Up @@ -111,7 +111,7 @@ const data: Record<string, SpiritsData> = {
realm: "Aviary Village",
season: "Nesting",
ts: {
eligible: false,
eligible: true,
returned: false,
dates: [],
},
Expand Down Expand Up @@ -229,7 +229,7 @@ const data: Record<string, SpiritsData> = {
realm: "Aviary Village",
season: "Nesting",
ts: {
eligible: false,
eligible: true,
returned: false,
dates: [],
},
Expand Down Expand Up @@ -333,7 +333,7 @@ const data: Record<string, SpiritsData> = {
realm: "Aviary Village",
season: "Nesting",
ts: {
eligible: false,
eligible: true,
returned: false,
dates: [],
},
Expand Down
10 changes: 5 additions & 5 deletions src/bot/libs/constants/spirits-datas/seasonal/22-duet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const data: Record<string, SpiritsData> = {
image: "https://static.wikia.nocookie.net/sky-children-of-the-light/images/b/b7/The-Cellists-Beginnings-Shop.png",
icon: "<:CellistB:1262326135216406559>",
type: "Seasonal Spirit",
season: "Duet",
season: "Duets",
ts: {
eligible: false,
returned: false,
Expand Down Expand Up @@ -88,7 +88,7 @@ const data: Record<string, SpiritsData> = {
image: "https://static.wikia.nocookie.net/sky-children-of-the-light/images/3/3a/The-Pianists-Beginnings-Shop.png",
icon: "<:PianistB:1262326115024769107>",
type: "Seasonal Spirit",
season: "Duet",
season: "Duets",
ts: {
eligible: false,
returned: false,
Expand Down Expand Up @@ -190,7 +190,7 @@ const data: Record<string, SpiritsData> = {
icon: "<:MusicianL:1262326097341714514>",
image: "https://static.wikia.nocookie.net/sky-children-of-the-light/images/e/ed/The-Musicians-Legacy-Shop.png",
type: "Seasonal Spirit",
season: "Duet",
season: "Duets",
ts: {
eligible: false,
returned: false,
Expand Down Expand Up @@ -265,7 +265,7 @@ const data: Record<string, SpiritsData> = {
image: "https://static.wikia.nocookie.net/sky-children-of-the-light/images/e/ea/The-Cellists-Flourishing-Shop.png",
icon: "<:CellistF:1262326155508318380>",
type: "Seasonal Spirit",
season: "Duet",
season: "Duets",
ts: {
eligible: false,
returned: false,
Expand Down Expand Up @@ -372,7 +372,7 @@ const data: Record<string, SpiritsData> = {
image: "https://static.wikia.nocookie.net/sky-children-of-the-light/images/9/9b/The-Pianists-Flourishing-Shop.png",
icon: "<:PianistF:1262326075380334623>",
type: "Seasonal Spirit",
season: "Duet",
season: "Duets",
ts: {
eligible: false,
returned: false,
Expand Down
Loading

0 comments on commit 038ef9b

Please sign in to comment.