Skip to content

Commit

Permalink
Backport map refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
holzmaster committed Jan 23, 2025
1 parent fc67742 commit cd20bf1
Showing 1 changed file with 41 additions and 42 deletions.
83 changes: 41 additions & 42 deletions src/service/lootData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ export enum LootAttributeKindId {
SWEET = 4,
}

/**
* @remarks The index of an item must be equal to the `LootTypeId` enum value.
*/
export const lootTemplates: LootTemplate[] = [
{
export const lootTemplateMap: Record<LootKindId, LootTemplate> = {
[LootKindId.NICHTS]: {
id: LootKindId.NICHTS,
weight: 24,
displayName: "Nichts",
Expand All @@ -77,7 +74,7 @@ export const lootTemplates: LootTemplate[] = [
emote: null!,
excludeFromInventory: true,
},
{
[LootKindId.KADSE]: {
id: LootKindId.KADSE,
weight: 4,
displayName: "Niedliche Kadse",
Expand All @@ -90,7 +87,7 @@ export const lootTemplates: LootTemplate[] = [
[LootAttributeKindId.RADIOACTIVE]: "assets/loot/attributes/01-kadse-verstrahlt.jpg",
},
},
{
[LootKindId.MESSERBLOCK]: {
id: LootKindId.MESSERBLOCK,
weight: 1,
displayName: "Messerblock",
Expand All @@ -99,7 +96,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🔪",
asset: "assets/loot/02-messerblock.jpg",
},
{
[LootKindId.KUEHLSCHRANK]: {
id: LootKindId.KUEHLSCHRANK,
weight: 1,
displayName: "Sehr teurer Kühlschrank",
Expand All @@ -110,7 +107,7 @@ export const lootTemplates: LootTemplate[] = [
asset: "assets/loot/03-kuehlschrank.jpg",
effects: ["Lässt Essen nicht schimmeln"],
},
{
[LootKindId.DOENER]: {
id: LootKindId.DOENER,
weight: 5,
displayName: "Döner",
Expand All @@ -119,7 +116,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🥙",
asset: "assets/loot/04-doener.jpg",
},
{
[LootKindId.KINN]: {
id: LootKindId.KINN,
weight: 0.5,
displayName: "Kinn",
Expand All @@ -128,7 +125,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "👶",
asset: "assets/loot/05-kinn.jpg",
},
{
[LootKindId.KRANKSCHREIBUNG]: {
id: LootKindId.KRANKSCHREIBUNG,
weight: 0.5,
displayName: "Arbeitsunfähigkeitsbescheinigung",
Expand Down Expand Up @@ -161,7 +158,7 @@ export const lootTemplates: LootTemplate[] = [
return false;
},
},
{
[LootKindId.WUERFELWURF]: {
id: LootKindId.WUERFELWURF,
weight: 5,
displayName: "Würfelwurf",
Expand All @@ -175,7 +172,7 @@ export const lootTemplates: LootTemplate[] = [
await rollService.rollInChannel(winner.user, channel, 1, 6);
},
},
{
[LootKindId.GESCHENK]: {
id: LootKindId.GESCHENK,
weight: 2,
displayName: "Geschenk",
Expand All @@ -193,7 +190,7 @@ export const lootTemplates: LootTemplate[] = [
return false;
},
},
{
[LootKindId.AYRAN]: {
id: LootKindId.AYRAN,
weight: 1,
displayName: "Ayran",
Expand All @@ -202,7 +199,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🥛",
asset: "assets/loot/09-ayran.jpg",
},
{
[LootKindId.PKV]: {
id: LootKindId.PKV,
weight: 1,
displayName: "Private Krankenversicherung",
Expand All @@ -212,7 +209,7 @@ export const lootTemplates: LootTemplate[] = [
asset: "assets/loot/10-pkv.jpg",
effects: ["` +100% ` Chance auf AU 🟢"],
},
{
[LootKindId.TRICHTER]: {
id: LootKindId.TRICHTER,
weight: 1,
displayName: "Trichter",
Expand All @@ -221,7 +218,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":trichter:",
asset: "assets/loot/11-trichter.jpg",
},
{
[LootKindId.GRAFIKKARTE]: {
id: LootKindId.GRAFIKKARTE,
weight: 1,
displayName: "Grafikkarte aus der Zukunft",
Expand All @@ -230,7 +227,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🖥️",
asset: "assets/loot/12-grafikkarte.png",
},
{
[LootKindId.HAENDEDRUCK]: {
id: LootKindId.HAENDEDRUCK,
weight: 1,
displayName: "Feuchter Händedruck",
Expand All @@ -240,7 +237,7 @@ export const lootTemplates: LootTemplate[] = [
asset: "assets/loot/13-haendedruck.jpg",
excludeFromInventory: true,
},
{
[LootKindId.ERLEUCHTUNG]: {
id: LootKindId.ERLEUCHTUNG,
weight: 1,
displayName: "Erleuchtung",
Expand All @@ -261,7 +258,7 @@ export const lootTemplates: LootTemplate[] = [
});
},
},
{
[LootKindId.BAN]: {
id: LootKindId.BAN,
weight: 1,
displayName: "Willkürban",
Expand All @@ -282,7 +279,7 @@ export const lootTemplates: LootTemplate[] = [
);
},
},
{
[LootKindId.OETTINGER]: {
id: LootKindId.OETTINGER,
weight: 1,
displayName: "Oettinger",
Expand All @@ -291,7 +288,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🍺",
asset: "assets/loot/16-oettinger.jpg",
},
{
[LootKindId.ACHIEVEMENT]: {
id: LootKindId.ACHIEVEMENT,
weight: 1,
displayName: "Achievement",
Expand All @@ -300,7 +297,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🏆",
asset: "assets/loot/17-achievement.png",
},
{
[LootKindId.GME_AKTIE]: {
id: LootKindId.GME_AKTIE,
weight: 5,
displayName: "Wertlose GME-Aktie",
Expand All @@ -309,7 +306,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "📉",
asset: "assets/loot/18-gme.jpg",
},
{
[LootKindId.FERRIS]: {
id: LootKindId.FERRIS,
weight: 3,
displayName: "Ferris",
Expand All @@ -318,7 +315,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🦀",
asset: "assets/loot/19-ferris.png",
},
{
[LootKindId.HOMEPOD]: {
id: LootKindId.HOMEPOD,
weight: 5,
displayName: "HomePod",
Expand All @@ -327,7 +324,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🍎",
asset: "assets/loot/20-homepod.jpg",
},
{
[LootKindId.RADIOACTIVE_WASTE]: {
id: LootKindId.RADIOACTIVE_WASTE,
weight: 1,
displayName: "Radioaktiver Müll",
Expand All @@ -338,7 +335,7 @@ export const lootTemplates: LootTemplate[] = [
asset: "assets/loot/21-radioaktiver-muell.jpg",
effects: ["` +5% ` Chance auf leeres Geschenk 🔴"],
},
{
[LootKindId.SAHNE]: {
id: LootKindId.SAHNE,
weight: 1,
displayName: "Sprühsahne",
Expand All @@ -347,7 +344,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":sahne:",
asset: "assets/loot/22-sahne.jpg",
},
{
[LootKindId.AEHRE]: {
id: LootKindId.AEHRE,
weight: 1,
displayName: "Ehre",
Expand All @@ -362,7 +359,7 @@ export const lootTemplates: LootTemplate[] = [
await ehre.addPoints(winner.id, 1);
},
},
{
[LootKindId.CROWDSTRIKE]: {
id: LootKindId.CROWDSTRIKE,
weight: 1,
displayName: "Crowdstrike Falcon",
Expand All @@ -371,7 +368,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":eagle:",
asset: "assets/loot/24-crowdstrike.jpg",
},
{
[LootKindId.POWERADE_BLAU]: {
id: LootKindId.POWERADE_BLAU,
weight: 1,
displayName: "Blaue Powerade",
Expand All @@ -380,7 +377,7 @@ export const lootTemplates: LootTemplate[] = [
asset: "assets/loot/25-powerade-blau.jpg",
emote: ":powerade:",
},
{
[LootKindId.GAULOISES_BLAU]: {
id: LootKindId.GAULOISES_BLAU,
weight: 1,
displayName: "Gauloises Blau",
Expand All @@ -390,7 +387,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🚬",
asset: "assets/loot/26-gauloises-blau.png",
},
{
[LootKindId.MAXWELL]: {
id: LootKindId.MAXWELL,
weight: 1,
displayName: "Maxwell",
Expand All @@ -399,7 +396,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "😸",
asset: "assets/loot/27-maxwell.gif",
},
{
[LootKindId.SCHICHTBEGINN_ASSE_2]: {
id: LootKindId.SCHICHTBEGINN_ASSE_2,
weight: 8,
displayName: "Wärter Asse II",
Expand All @@ -413,7 +410,7 @@ export const lootTemplates: LootTemplate[] = [
await lootRoles.startAsseGuardShift(context, winner, channel);
},
},
{
[LootKindId.DRECK]: {
id: LootKindId.DRECK,
weight: 7,
displayName: "Ein Glas Dreck",
Expand All @@ -422,7 +419,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":jar:",
asset: "assets/loot/29-dirt.jpg",
},
{
[LootKindId.EI]: {
id: LootKindId.EI,
weight: 3,
displayName: "Ei",
Expand All @@ -432,7 +429,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":egg:",
asset: "assets/loot/30-egg.jpg",
},
{
[LootKindId.BRAVO]: {
id: LootKindId.BRAVO,
weight: 2,
displayName: "Bravo",
Expand All @@ -441,7 +438,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":newspaper2:",
asset: "assets/loot/31-bravo.jpg",
},
{
[LootKindId.VERSCHIMMELTER_DOENER]: {
id: LootKindId.VERSCHIMMELTER_DOENER,
weight: ACHTUNG_NICHT_DROPBAR_WEIGHT_KG,
displayName: "Verschimmelter Döner",
Expand All @@ -450,7 +447,7 @@ export const lootTemplates: LootTemplate[] = [
emote: "🥙",
asset: null,
},
{
[LootKindId.THUNFISCHSHAKE]: {
id: LootKindId.THUNFISCHSHAKE,
weight: 2,
displayName: "Thunfischshake",
Expand All @@ -459,7 +456,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":baby_bottle:",
asset: "assets/loot/33-thunfischshake.jpg",
},
{
[LootKindId.KAFFEEMUEHLE]: {
id: LootKindId.KAFFEEMUEHLE,
weight: 2,
displayName: "Kaffeemühle",
Expand All @@ -468,7 +465,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":coffee:",
asset: "assets/loot/34-kaffeemuehle.jpg",
},
{
[LootKindId.AWS_RECHNUNG]: {
id: LootKindId.AWS_RECHNUNG,
weight: 2,
displayName: "AWS-Rechnung",
Expand All @@ -477,7 +474,7 @@ export const lootTemplates: LootTemplate[] = [
emote: ":package:",
asset: "assets/loot/35-aws-rechnung.png",
},
{
[LootKindId.BIBER]: {
id: LootKindId.BIBER,
weight: 2,
displayName: "Süßer Biber",
Expand All @@ -487,7 +484,9 @@ export const lootTemplates: LootTemplate[] = [
asset: "assets/loot/36-biber.jpg",
initialAttributes: [LootAttributeKindId.SWEET],
},
] as const;
} as const;

export const lootTemplates: LootTemplate[] = Object.values(lootTemplateMap);

/*
Ideas:
Expand Down

0 comments on commit cd20bf1

Please sign in to comment.