-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathlootData.ts
More file actions
1072 lines (1041 loc) · 37.3 KB
/
lootData.ts
File metadata and controls
1072 lines (1041 loc) · 37.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import type { LootAttributeTemplate, LootTemplate } from "#/storage/loot.ts";
import * as lootDropService from "#/service/lootDrop.ts";
import * as lootService from "#/service/loot.ts";
import * as emoteService from "#/service/emote.ts";
import * as bahnCardService from "#/service/bahncard.ts";
import { GuildMember, type Guild } from "discord.js";
import type { Loot, LootAttribute } from "#/storage/db/model.ts";
import { randomEntry } from "./random.ts";
import log from "#log";
const ACHTUNG_NICHT_DROPBAR_WEIGHT_KG = 0;
export const LootKind = Object.freeze({
NICHTS: 0,
KADSE: 1,
MESSERBLOCK: 2,
KUEHLSCHRANK: 3,
DOENER: 4,
KINN: 5,
KRANKSCHREIBUNG: 6,
WUERFELWURF: 7,
GESCHENK: 8,
AYRAN: 9,
PKV: 10,
TRICHTER: 11,
GRAFIKKARTE: 12,
HAENDEDRUCK: 13,
ERLEUCHTUNG: 14,
BAN: 15,
OETTINGER: 16,
ACHIEVEMENT: 17,
GME_AKTIE: 18,
FERRIS: 19,
HOMEPOD: 20,
RADIOACTIVE_WASTE: 21,
SAHNE: 22,
AEHRE: 23,
CROWDSTRIKE: 24,
POWERADE_BLAU: 25,
GAULOISES_BLAU: 26,
MAXWELL: 27,
SCHICHTBEGINN_ASSE_2: 28,
DRECK: 29,
EI: 30,
BRAVO: 31,
VERSCHIMMELTER_DOENER: 32,
THUNFISCHSHAKE: 33,
KAFFEEMUEHLE: 34,
AWS_RECHNUNG: 35,
BIBER: 36,
BLEI: 37,
USV: 38,
BAHNCARD_25: 39,
BAHNCARD_50: 40,
BAHNCARD_100: 41,
LABUBU: 42,
BABYBEL_ORIGINAL: 43,
BABYBEL_LIGHT: 44,
BABYBEL_CHEDDAR: 45,
BABYBEL_EMMENTALER: 46,
BABYBEL_PROTEIN: 47,
BABYBEL_GOUDA: 48,
BABYBEL_VEGAN: 49,
BABYBEL_EXODIA: 50,
GIROKONTO: 51,
STROMTARIF: 52,
MAGERQUARK: 53,
NAS: 54,
USB_KABEL: 55,
GESCHENKPAPIER: 56,
} as const);
export type LootKindId = (typeof LootKind)[keyof typeof LootKind];
export const LootAttributeClass = Object.freeze({
OTHER: 0,
RARITY: 1,
NUTRI_SCORE: 2,
} as const);
export type LootAttributeClassId = (typeof LootAttributeClass)[keyof typeof LootAttributeClass];
export const LootAttributeKind = Object.freeze({
RARITY_NORMAL: 0,
RARITY_RARE: 1,
RARITY_VERY_RARE: 2,
RADIOACTIVE: 3,
SWEET: 4,
NUTRI_SCORE_A: 5,
NUTRI_SCORE_B: 6,
NUTRI_SCORE_C: 7,
NUTRI_SCORE_D: 8,
NUTRI_SCORE_E: 9,
} as const);
export type LootAttributeKindId = (typeof LootAttributeKind)[keyof typeof LootAttributeKind];
export const lootTemplateMap: Record<LootKindId, LootTemplate> = {
[LootKind.NICHTS]: {
id: LootKind.NICHTS,
weight: 24,
displayName: "Nichts",
titleText: "✨Nichts✨",
dropDescription: "¯\\_(ツ)_/¯",
asset: null,
// biome-ignore lint/style/noNonNullAssertion: Won't be shown anywhere else
emote: null!,
excludeFromInventory: true,
excludeFromDoubleDrops: true,
},
[LootKind.KADSE]: {
id: LootKind.KADSE,
weight: 4,
displayName: "Niedliche Kadse",
titleText: "Eine niedliche Kadse",
dropDescription: "Awww",
emote: "🐈",
asset: "assets/loot/01-kadse.jpg",
initialAttributes: [LootAttributeKind.SWEET],
attributeAsset: {
[LootAttributeKind.RADIOACTIVE]: "assets/loot/attributes/01-kadse-verstrahlt.jpg",
},
wrapable: true,
},
[LootKind.MESSERBLOCK]: {
id: LootKind.MESSERBLOCK,
weight: 1,
displayName: "Messerblock",
titleText: "Einen Messerblock",
dropDescription: "🔪",
emote: "🔪",
asset: "assets/loot/02-messerblock.jpg",
wrapable: true,
},
[LootKind.KUEHLSCHRANK]: {
id: LootKind.KUEHLSCHRANK,
weight: 1,
displayName: "Sehr teurer Kühlschrank",
titleText: "Ein sehr teurer Kühlschrank",
dropDescription:
"Dafür haben wir keine Kosten und Mühen gescheut und extra einen Kredit aufgenommen.",
emote: "🧊",
asset: "assets/loot/03-kuehlschrank.jpg",
effects: ["Lässt Essen nicht schimmeln"],
wrapable: true,
},
[LootKind.DOENER]: {
id: LootKind.DOENER,
weight: 5,
timeBasedWeight: {
evening: 10,
},
displayName: "Döner",
titleText: "Einen Döner",
dropDescription: "Bewahre ihn gut als Geldanlage auf!",
emote: "🥙",
asset: "assets/loot/04-doener.jpg",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_C],
wrapable: true,
},
[LootKind.KINN]: {
id: LootKind.KINN,
weight: 0.5,
displayName: "Kinn",
titleText: "Ein Kinn",
dropDescription: "Pass gut drauf auf, sonst flieht es!",
emote: "👶",
asset: "assets/loot/05-kinn.jpg",
wrapable: true,
},
[LootKind.KRANKSCHREIBUNG]: {
id: LootKind.KRANKSCHREIBUNG,
weight: 0.5,
timeBasedWeight: {
morning: 1,
},
displayName: "Arbeitsunfähigkeitsbescheinigung",
titleText: "Einen gelben Urlaubsschein",
dropDescription: "Benutze ihn weise!",
infoDescription:
"Mit der Krankschreibung kannst du deine Wärterschicht abbrechen und dich ausruhen.",
emote: "🩺",
asset: "assets/loot/06-krankschreibung.jpg",
onUse: async (interaction, context, _loot) => {
const lootRoles = await import("./lootRoles.ts");
const member = interaction.member;
if (!member || !(member instanceof GuildMember)) {
return false;
}
const isOnDuty = await lootRoles.isInAsseGuardShift(context, member);
if (!isOnDuty) {
await interaction.reply(
"Du bist gar nicht im Dienst, aber hast dir deinen Urlaub trotzdem wohl verdient.",
);
return false;
}
await lootRoles.endAsseGuardShift(context, member);
await interaction.reply(
"Du hast kränkelnd beim Werksleiter angerufen und dich krankgemeldet. Genieße deinen Tag zu Hause!",
);
return false;
},
wrapable: true,
},
[LootKind.WUERFELWURF]: {
id: LootKind.WUERFELWURF,
weight: 4,
displayName: "Würfelwurf",
titleText: "Einen Wurf mit einem Würfel",
dropDescription: "🎲",
emote: "🎲",
asset: "assets/loot/07-wuerfelwurf.png",
excludeFromInventory: true,
excludeFromDoubleDrops: true,
onDrop: async (_content, winner, channel, _loot) => {
const rollService = await import("./roll.ts");
await rollService.rollInChannel(winner.user, channel, 1, 6);
},
},
[LootKind.GESCHENK]: {
id: LootKind.GESCHENK,
weight: 2,
displayName: "Geschenk",
titleText: "Ein Geschenk",
dropDescription: "Du kannst jemand anderem eine Freude machen :feelsamazingman:",
emote: "🎁",
asset: null,
onUse: async (interaction, context, loot) => {
await lootDropService.postLootDrop(
context,
interaction.channel,
interaction.user,
lootDropService.randomizedLootClaim(loot.id),
);
return false;
},
},
[LootKind.AYRAN]: {
id: LootKind.AYRAN,
weight: 1,
timeBasedWeight: {
evening: 2,
},
displayName: "Ayran",
titleText: "Einen Ayran",
dropDescription: "Der gute von Müller",
emote: "🥛",
asset: "assets/loot/09-ayran.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_D], // Ref: https://de.openfoodfacts.org/produkt/4388860730685/ayran-ja
wrapable: true,
},
[LootKind.PKV]: {
id: LootKind.PKV,
weight: 1,
displayName: "Private Krankenversicherung",
titleText: "Eine private Krankenversicherung",
dropDescription: "Fehlt dir nur noch das Geld zum Vorstrecken",
emote: "💉",
asset: "assets/loot/10-pkv.jpg",
effects: ["` +100% ` Chance auf AU 🟢"],
wrapable: true,
},
[LootKind.TRICHTER]: {
id: LootKind.TRICHTER,
weight: 1,
timeBasedWeight: {
evening: 2,
},
displayName: "Trichter",
titleText: "Einen Trichter",
dropDescription: "Für die ganz großen Schlücke",
emote: ":trichter:",
asset: "assets/loot/11-trichter.png",
wrapable: true,
},
[LootKind.GRAFIKKARTE]: {
id: LootKind.GRAFIKKARTE,
weight: 1,
displayName: "Grafikkarte aus der Zukunft",
titleText: "Eine Grafikkarte aus der Zukunft",
dropDescription: "Leider ohne Treiber, die gibt es erst in 3 Monaten",
emote: "🖥️",
asset: "assets/loot/12-grafikkarte.png",
wrapable: true,
},
[LootKind.HAENDEDRUCK]: {
id: LootKind.HAENDEDRUCK,
weight: 1,
displayName: "Feuchter Händedruck",
titleText: "Einen feuchten Händedruck",
dropDescription: "Glückwunsch!",
emote: "🤝",
asset: "assets/loot/13-haendedruck.jpg",
excludeFromInventory: true,
},
[LootKind.ERLEUCHTUNG]: {
id: LootKind.ERLEUCHTUNG,
weight: 1,
displayName: "Erleuchtung",
titleText: "Eine Erleuchtung",
dropDescription: "💡",
emote: "💡",
asset: null,
excludeFromInventory: true,
onDrop: async (_context, winner, channel, _loot) => {
const erleuchtungService = await import("./erleuchtung.ts");
const { setTimeout } = await import("node:timers/promises");
await setTimeout(3000);
const embed = await erleuchtungService.getInspirationsEmbed(winner);
await channel.send({
embeds: [embed],
});
},
},
[LootKind.BAN]: {
id: LootKind.BAN,
weight: 1,
displayName: "Willkürban",
titleText: "Einen Ban aus reiner Willkür",
dropDescription: "Tschüsseldorf!",
emote: "🔨",
asset: "assets/loot/15-ban.jpg",
excludeFromInventory: true,
excludeFromDoubleDrops: true,
onDrop: async (context, winner, _channel, _loot) => {
const banService = await import("./ban.ts");
await banService.banUser(
context,
winner,
context.client.user,
"Willkürban aus der Lotterie",
false,
0.08,
);
},
},
[LootKind.OETTINGER]: {
id: LootKind.OETTINGER,
weight: 1,
timeBasedWeight: {
morning: 2,
},
displayName: "Oettinger",
titleText: "Ein warmes Oettinger",
dropDescription: "Ja dann Prost ne!",
emote: "🍺",
asset: "assets/loot/16-oettinger.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_B], // Ref: https://archive.is/aonnZ
wrapable: true,
},
[LootKind.ACHIEVEMENT]: {
id: LootKind.ACHIEVEMENT,
weight: 1,
displayName: "Achievement",
titleText: "Ein Achievement",
dropDescription: "Das erreichen echt nicht viele",
emote: "🏆",
asset: "assets/loot/17-achievement.png",
wrapable: true,
},
[LootKind.GME_AKTIE]: {
id: LootKind.GME_AKTIE,
weight: 5,
displayName: "Wertlose GME-Aktie",
titleText: "Eine wertlose GME-Aktie",
dropDescription: "Der squeeze kommt bald!",
emote: "📉",
asset: "assets/loot/18-gme.jpg",
wrapable: true,
},
[LootKind.FERRIS]: {
id: LootKind.FERRIS,
weight: 3,
displayName: "Ferris",
titleText: "Einen Ferris - Die Krabbe",
dropDescription: "Damit kann man ja endlich den Bot in Rust neuschreiben",
emote: "🦀",
asset: "assets/loot/19-ferris.png",
wrapable: true,
},
[LootKind.HOMEPOD]: {
id: LootKind.HOMEPOD,
weight: 3,
displayName: "HomePod",
titleText: "Einen Apple:registered: HomePod:copyright:",
dropDescription: 'Damit dein "Smart Home" nicht mehr ganz so smart ist',
emote: "🍎",
asset: "assets/loot/20-homepod.jpg",
wrapable: true,
},
[LootKind.RADIOACTIVE_WASTE]: {
id: LootKind.RADIOACTIVE_WASTE,
weight: 25,
displayName: "Radioaktiver Müll",
titleText: "Radioaktiver Müll",
dropDescription:
"Sollte dir ja nichts mehr anhaben, du bist ja durch den Server schon genug verstrahlt 🤷♂️",
emote: "☢️",
asset: "assets/loot/21-radioaktiver-muell.jpg",
effects: ["` +5% ` Chance auf leeres Geschenk 🔴"],
},
[LootKind.SAHNE]: {
id: LootKind.SAHNE,
weight: 1,
timeBasedWeight: {
evening: 2,
},
displayName: "Sprühsahne",
titleText: "Sprühsahne",
dropDescription: "Fürs Frühstück oder so",
emote: ":sahne:",
asset: "assets/loot/22-sahne.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_D], // Ref: https://de.openfoodfacts.org/produkt/4311501745663/spr%C3%BChsahne-gut-g%C3%BCnstig
wrapable: true,
},
[LootKind.AEHRE]: {
id: LootKind.AEHRE,
weight: 1,
displayName: "Ehre",
titleText: "Ehre aus Mitleid",
dropDescription:
"Irgendjemand muss ja den Server am laufen halten, kriegst dafür wertlose Internetpunkte",
emote: ":aehre:",
asset: "assets/loot/23-ehre.jpg",
excludeFromInventory: true,
onDrop: async (_context, winner, _channel, _loot) => {
const ehre = await import("#/storage/ehre.ts");
await ehre.addPoints(winner.id, 1);
},
},
[LootKind.CROWDSTRIKE]: {
id: LootKind.CROWDSTRIKE,
weight: 1,
displayName: "Crowdstrike Falcon",
titleText: "Crowdstrike Falcon Installation",
dropDescription: "Bitti nicht rebooti und Bitlocki nutzi",
emote: "🦅",
asset: "assets/loot/24-crowdstrike.jpg",
wrapable: true,
},
[LootKind.POWERADE_BLAU]: {
id: LootKind.POWERADE_BLAU,
weight: 1,
displayName: "Blaue Powerade",
titleText: "Blaue Powerade",
dropDescription: "Erfrischend erquickend. Besonders mit Vodka. Oder Korn.",
asset: "assets/loot/25-powerade-blau.jpg",
emote: ":powerade:",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_D], // Ref: https://de.openfoodfacts.org/produkt/90357350/powerrade-mountain-blast-blue-coca-cola
wrapable: true,
},
[LootKind.GAULOISES_BLAU]: {
id: LootKind.GAULOISES_BLAU,
weight: 1,
timeBasedWeight: {
evening: 2,
},
displayName: "Gauloises Blau",
titleText: "Eine Schachtel Gauloises Blau",
dropDescription:
"Rauchig, kräftig, französisch. Wie du in deinen Träumen.\n\nVerursacht Herzanfälle, genau wie dieser Server",
emote: "🚬",
asset: "assets/loot/26-gauloises-blau.png",
wrapable: true,
},
[LootKind.MAXWELL]: {
id: LootKind.MAXWELL,
weight: 1,
displayName: "Maxwell",
titleText: "Einen Maxwell",
dropDescription: "Der ist doch tot, oder?",
emote: "😸",
asset: "assets/loot/27-maxwell.gif",
wrapable: true,
},
[LootKind.SCHICHTBEGINN_ASSE_2]: {
id: LootKind.SCHICHTBEGINN_ASSE_2,
weight: 4,
displayName: "Wärter Asse II",
titleText: "Den Schichtbeginn in der Asse II",
dropDescription: "Deine Wärterschicht bei der Asse II beginnt!",
emote: "🔒",
asset: "assets/loot/28-asse-2.jpg",
excludeFromInventory: true,
excludeFromDoubleDrops: true,
onDrop: async (context, winner, channel, _loot) => {
const lootRoles = await import("./lootRoles.ts");
await lootRoles.startAsseGuardShift(context, winner, channel);
},
},
[LootKind.DRECK]: {
id: LootKind.DRECK,
weight: 2,
displayName: "Ein Glas Dreck",
titleText: "Ein Glas Dreck",
dropDescription: "Ich hab ein Glas voll Dreck",
emote: "🫙",
asset: "assets/loot/29-dreck.jpg",
wrapable: true,
},
[LootKind.EI]: {
id: LootKind.EI,
weight: 3,
displayName: "Ei",
titleText: "Ein Ei",
dropDescription:
"Jetzt wär geklärt, was zu erst da war, Ei oder ... (Ja was schlüpft daraus eigentlich?)",
emote: "🥚",
asset: "assets/loot/30-ei.png",
wrapable: true,
},
[LootKind.BRAVO]: {
id: LootKind.BRAVO,
weight: 2,
displayName: "Bravo",
titleText: "Eine Bravo vom Dachboden",
dropDescription: "Die Seiten kleben noch ein bisschen",
emote: "🗞️",
asset: "assets/loot/31-bravo.jpg",
wrapable: true,
},
[LootKind.VERSCHIMMELTER_DOENER]: {
id: LootKind.VERSCHIMMELTER_DOENER,
weight: ACHTUNG_NICHT_DROPBAR_WEIGHT_KG,
displayName: "Verschimmelter Döner",
titleText: "Einen verschimmelten Döner",
dropDescription: "Du hättest ihn früher essen sollen",
emote: "🥙",
asset: null,
initialAttributes: [LootAttributeKind.NUTRI_SCORE_E],
wrapable: true,
},
[LootKind.THUNFISCHSHAKE]: {
id: LootKind.THUNFISCHSHAKE,
weight: 2,
displayName: "Thunfischshake",
titleText: "Ein Thunfischshake, serviert von Markus Rühl persönlich",
dropDescription: "Nach Rezept zubereitet, bestehend aus Thunfisch und Reiswaffeln",
emote: "🍼",
asset: "assets/loot/33-thunfischshake.jpg",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_A],
wrapable: true,
},
[LootKind.KAFFEEMUEHLE]: {
id: LootKind.KAFFEEMUEHLE,
weight: 1,
timeBasedWeight: {
morning: 2,
},
displayName: "Kaffeemühle",
titleText: "Eine Kaffeemühle für 400€",
dropDescription: "Kann Kaffee mühlen. Und das gut. Mit Gold.",
emote: "☕",
asset: "assets/loot/34-kaffeemuehle.png",
wrapable: true,
},
[LootKind.AWS_RECHNUNG]: {
id: LootKind.AWS_RECHNUNG,
weight: 1,
displayName: "AWS-Rechnung",
titleText: "Ne dicke AWS-Rechnung",
dropDescription: "Hast du schon versucht, in die Cloud zu gehen?",
emote: "📦",
asset: "assets/loot/35-aws-rechnung.png",
wrapable: true,
},
[LootKind.BIBER]: {
id: LootKind.BIBER,
weight: 2,
displayName: "Süßer Biber",
titleText: "Bóbr",
dropDescription: "Bóbr kurwa! Ja pierdolę! Jakie bydlę!",
emote: "🦫",
asset: "assets/loot/36-biber.jpg",
initialAttributes: [LootAttributeKind.SWEET],
wrapable: true,
},
[LootKind.BLEI]: {
id: LootKind.BLEI,
weight: ACHTUNG_NICHT_DROPBAR_WEIGHT_KG,
displayName: "Blei",
titleText: "Einen Block Blei",
dropDescription: "Ganz schön schwer.",
emote: "🪨",
asset: "assets/loot/37-blei.png",
initialAttributes: [],
wrapable: true,
},
[LootKind.USV]: {
id: LootKind.USV,
weight: 2,
displayName: "USV",
titleText: "Eine kaputte USV",
dropDescription: "Damit dir nie wieder der Strom ausgeht.",
emote: "🔋",
asset: "assets/loot/38-usv.png",
initialAttributes: [],
wrapable: true,
},
[LootKind.BAHNCARD_25]: {
id: LootKind.BAHNCARD_25,
weight: 6,
displayName: "BahnCard 25",
titleText: "Eine BahnCard 25",
dropDescription: "Fahr damit überall hin, sogar in die Arbeit!",
emote: "🚆",
asset: "assets/loot/39-bahncard-25.png",
initialAttributes: [],
wrapable: true,
drawCustomAsset: (context, owner, template, loot) =>
bahnCardService.drawBahncardImage(
context,
owner,
template,
loot,
false,
// oxlint-disable-next-line typescript/no-misused-spread
[...owner.id].map(n => (Number(n) * 7) % 10).join(""),
),
onDuplicateDrop: async (context, winner, loot, dropMessage) => {
// biome-ignore lint/style/noNonNullAssertion: :shrug:
const newBc = resolveLootTemplate(LootKind.BAHNCARD_50)!;
const newLoot = await lootService.replaceLoot(
loot.id,
{
displayName: newBc.displayName,
lootKindId: newBc.id,
winnerId: loot.winnerId,
claimedAt: loot.claimedAt,
guildId: loot.guildId,
channelId: loot.channelId,
messageId: loot.messageId,
origin: "double-or-nothing",
},
true,
);
const newContent = await lootDropService.createDropTakenContent(
context,
lootTemplateMap[LootKind.BAHNCARD_50],
newLoot,
winner.user,
[
`DOPPELT ODER NIX, ${winner}! Du hast aus deiner BahnCard 25 eine BahnCard 50 gemacht! 🎉`,
],
);
await dropMessage.edit(newContent);
return false;
},
},
[LootKind.BAHNCARD_50]: {
id: LootKind.BAHNCARD_50,
weight: 3,
displayName: "BahnCard 50",
titleText: "Eine BahnCard 50",
dropDescription: "Fahr damit überall hin, sogar in die Arbeit!",
emote: "🚆",
asset: "assets/loot/40-bahncard-50.png",
initialAttributes: [],
wrapable: true,
drawCustomAsset: (context, owner, template, loot) =>
bahnCardService.drawBahncardImage(
context,
owner,
template,
loot,
false,
// oxlint-disable-next-line typescript/no-misused-spread
[...owner.id].map(n => (Number(n) * 13) % 10).join(""),
),
onDuplicateDrop: async (context, winner, loot, dropMessage) => {
// biome-ignore lint/style/noNonNullAssertion: :shrug:
const newBc = resolveLootTemplate(LootKind.BAHNCARD_100)!;
const newLoot = await lootService.replaceLoot(
loot.id,
{
displayName: newBc.displayName,
lootKindId: newBc.id,
winnerId: loot.winnerId,
claimedAt: loot.claimedAt,
guildId: loot.guildId,
channelId: loot.channelId,
messageId: loot.messageId,
origin: "double-or-nothing",
},
true,
);
const newContent = await lootDropService.createDropTakenContent(
context,
lootTemplateMap[LootKind.BAHNCARD_100],
newLoot,
winner.user,
[
`DOPPELT ODER NIX, ${winner}! Du hast aus deiner BahnCard 50 eine BahnCard 100 gemacht! 🎉`,
],
);
await dropMessage.edit(newContent);
return false;
},
},
[LootKind.BAHNCARD_100]: {
// Not droppable, only via duplicate BahnCard 50
id: LootKind.BAHNCARD_100,
weight: ACHTUNG_NICHT_DROPBAR_WEIGHT_KG,
displayName: "BahnCard 100",
titleText: "Eine BahnCard 100",
dropDescription: "Fahr damit überall hin, sogar in die Arbeit!",
emote: "🚆",
asset: "assets/loot/41-bahncard-100.png",
initialAttributes: [],
wrapable: true,
drawCustomAsset: (context, owner, template, loot) =>
bahnCardService.drawBahncardImage(context, owner, template, loot, true, owner.id),
},
[LootKind.LABUBU]: {
id: LootKind.LABUBU,
weight: 1,
displayName: "Labubu",
titleText: "Einen Labubu",
dropDescription: "Das Labubu, dein ~~Freund und Helfer in der Not~~ Plastikmüll",
emote: "🦦",
asset: "assets/loot/42-labubu.jpg",
wrapable: true,
},
[LootKind.BABYBEL_ORIGINAL]: {
id: LootKind.BABYBEL_ORIGINAL,
weight: 3,
displayName: "Mini Babybel® Original",
titleText: "Ein Babybel® Original",
dropDescription:
"Schon seit 1977 erobert unser roter Superstar die Herzen aller Snack-Liebhaber. Er ist nicht nur praktisch, lecker und immer für eine gute Portion Spaß zu haben, sondern auch ohne Gentechnik und ohne Zusatz von Konservierungsstoffen. Dank der natürlichen Reifung in seiner Wachshülle ist er außerdem laktosefrei sowie reich an Protein und Kalzium.",
emote: "🧀",
asset: "assets/loot/43-bb-original.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_C],
wrapable: true,
},
[LootKind.BABYBEL_LIGHT]: {
id: LootKind.BABYBEL_LIGHT,
weight: 2,
displayName: "Mini Babybel® Light",
titleText: "Ein Babybel® Light",
dropDescription: "Der kleine Käse mit der roten Wachsverpackung, mit weniger Fett!",
emote: "🧀",
asset: "assets/loot/44-bb-light.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_C],
wrapable: true,
},
[LootKind.BABYBEL_CHEDDAR]: {
id: LootKind.BABYBEL_CHEDDAR,
weight: 1,
displayName: "Mini Babybel® Cheddar-Geschmack",
titleText: "Ein Babybel® Cheddar-Geschmack",
dropDescription:
"Mini Babybel® mit Cheddar-Geschmack erfreut Groß und Klein und bringt Abwechslung in die Lunch-Box.\n\nFür Vegetarier geeignet.",
emote: "🧀",
asset: "assets/loot/45-bb-cheddar.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_D],
wrapable: true,
},
[LootKind.BABYBEL_EMMENTALER]: {
id: LootKind.BABYBEL_EMMENTALER,
weight: 1,
displayName: "Mini Babybel® Emmentaler-Geschmack",
titleText: "Ein Babybel® Emmentaler-Geschmack",
dropDescription:
"Mini Babybel® mit feinem Emmentaler-Geschmack sorgt für herzhafte Snack-Momente und bereitet viel Vergnügen bei Groß und Klein.",
emote: "🧀",
asset: "assets/loot/46-bb-emmentaler.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_D],
wrapable: true,
},
[LootKind.BABYBEL_PROTEIN]: {
id: LootKind.BABYBEL_PROTEIN,
weight: 1,
displayName: "Mini Babybel® High Protein",
titleText: "Ein Babybel® High Protein",
dropDescription:
"Lecker Käse in rotem Wachs. Genau der gleiche wie der blaue, aber für echte Männer.",
emote: "🧀",
asset: "assets/loot/47-bb-protein.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_C],
wrapable: true,
},
[LootKind.BABYBEL_GOUDA]: {
id: LootKind.BABYBEL_GOUDA,
weight: 1,
displayName: "Mini Babybel® Unser Würziger",
titleText: "Ein Babybel® Unser Würziger",
dropDescription:
"Babybel® Unser Würziger ist eine Varietät des klassischen Babybel® Original. Er vereint alle Vorteile eines leckeren Käse-Snacks mit einem würzig-nussigen Geschmack (wir wollten es nicht einfach nur Gouda nennen) und sorgt auf diese Weise für ein etwas intensiveres Babybel®-Erlebnis.\n\nDurch seinen intensiv-herzhaften Geschmack eignet sich der würzig-leckere Snack sehr gut für den kleinen Hunger zwischendurch und bietet damit auch Käseliebhabern mit einem intensiveren Käsegeschmack eine optimale Ergänzung zur klassischen Variante.",
emote: "🧀",
asset: "assets/loot/48-bb-gouda.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_D],
wrapable: true,
},
[LootKind.BABYBEL_VEGAN]: {
id: LootKind.BABYBEL_VEGAN,
weight: 1,
displayName: "Mini Babybel® Vegan",
titleText: "Ein Babybel® Vegan",
dropDescription:
"Den beliebten Babybel® gibt es jetzt auch als vegane Käsealternative, ganz ohne Milch und schnell erkennbar dank seiner grünen Wachshülle. Mit seinem milden Geschmack und der cremigen Textur ist der vegane Babybel® eine leckere und praktische Alternative als Snack für zuhause oder unterwegs.\n\nDer vegane Babybel® ist erhältlich im praktischen, recyclebaren Papierbeutel und ist eigentlich nur ein Block Kokosfett mit Salz.",
emote: "🧀",
asset: "assets/loot/49-bb-vegan.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_E],
wrapable: true,
},
[LootKind.BABYBEL_EXODIA]: {
id: LootKind.BABYBEL_EXODIA,
weight: ACHTUNG_NICHT_DROPBAR_WEIGHT_KG,
displayName: "Mini Babybel® Exodia",
titleText: "Mini Babybel® Exodia",
dropDescription: "Du hast das Spiel gewonnen.",
emote: "🧀",
asset: "assets/loot/50-bb-exodia.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_E],
wrapable: true,
},
[LootKind.GIROKONTO]: {
id: LootKind.GIROKONTO,
weight: 1,
displayName: "Girokonto mit Metallkarte",
titleText: "Ein Girokonto mit Metallkarte",
dropDescription: "Werbe andere User und erhalte eine Prämie von 75€!",
emote: "💳",
asset: "assets/loot/51-girokonto.jpg",
wrapable: true,
},
[LootKind.STROMTARIF]: {
id: LootKind.STROMTARIF,
weight: 1,
displayName: "Dynamischer Stromtarif",
titleText: "Ein dynamischer Stromtarif",
dropDescription: "So bezahlst du immer den günstigsten Strompreis.",
emote: "🔌",
asset: "assets/loot/52-stromtarif.jpg",
wrapable: true,
},
[LootKind.MAGERQUARK]: {
id: LootKind.MAGERQUARK,
weight: 2,
displayName: "Magerquark",
titleText: "Einen Becher Magerquark",
dropDescription: "Viel Protein, wenig Fett.",
emote: "🍶",
asset: "assets/loot/53-magerquark.png",
initialAttributes: [LootAttributeKind.NUTRI_SCORE_A],
wrapable: true,
},
[LootKind.NAS]: {
id: LootKind.NAS,
weight: 2,
displayName: "Funktionierendes Unraid-NAS",
titleText: "Ein funktionierendes Unraid-NAS",
dropDescription: "Viel Speicherplatz, wenig Stromverbrauch, manchmal funktionstüchtig.",
emote: "🗄️",
asset: "assets/loot/54-nas.png",
wrapable: true,
},
[LootKind.USB_KABEL]: {
id: LootKind.USB_KABEL,
weight: 2,
displayName: "USB-Kabel",
titleText: "Ein USB-Kabel von LTT",
dropDescription: "Jetzt auch in deinem Land verfügbar!",
emote: "🛜",
asset: "assets/loot/55-usb-kabel.png",
wrapable: true,
},
[LootKind.GESCHENKPAPIER]: {
id: LootKind.GESCHENKPAPIER,
weight: 12,
displayName: "Geschenkpapier",
titleText: "Das sieht ja super cringe aus, wer würde sich denn darüber freuen wollen?",
dropDescription:
"Mit diesem Geschenkpapier sollte man Geschenke einpacken können, aber irgendwie sieht es auch nicht so aus, als wäre das jemals jemandem gelungen.",
emote: "🎁",
asset: "assets/loot/56-geschenkpapier.png",
onUse: async (interaction, context, _wrappingPaper) => {
const inventory = await lootService.getInventoryContents(interaction.user);
const wrapables = inventory.filter(
l => resolveLootTemplate(l.lootKindId)?.wrapable ?? false,
);
if (wrapables.length === 0) {
await interaction.reply({
content: "Du hast nichts, was du einpacken könntest! 😢",
});
return false;
}
const randomItem = randomEntry(wrapables);
const rarity =
randomItem.attributes.find(a => a.attributeClassId === LootAttributeClass.RARITY) ??
undefined;
const rarityAttributeTemplate = rarity
? resolveLootAttributeTemplate(rarity.attributeKindId)
: undefined;
const lootTemplate = resolveLootTemplate(randomItem.lootKindId);
if (!lootTemplate) {
log.error(
"Failed to resolve loot template for wrapped item: " + randomItem.lootKindId,
);
await interaction.reply({
content: "Ein Fehler ist aufgetreten, versuch es später nochmal! 😢",
});
return false;
}
const transferWrappedItemLoot: lootDropService.LootClaimCallback = async winner => {
const claimedLoot = await lootService.transferLootToUser(
randomItem.id,
winner,
true,
);
return {
loot: claimedLoot,
template: lootTemplate,
rarity: rarityAttributeTemplate,
messages: [],
};
};
const claimed = await lootDropService.postLootDrop(
context,
interaction.channel,
interaction.user,
transferWrappedItemLoot,
);
if (!claimed) {
await lootService.deleteLoot(randomItem.id);
}
return false;
},
},
} as const;
export const lootTemplates: LootTemplate[] = Object.values(lootTemplateMap);
/*
Ideas:
- Pfeffi
- eine Heiligsprechung von Jesus höchstpersönlich
- Vogerlsalat
- Einlass in den Berghain, am Eingang steht ein Golem, der einen verschimmelten Superdöner (besteht aus 3 verschimmelten Dönern) frisst
Special Loots mit besonderer Aktion?
- Timeout?
- Sonderrolle, die man nur mit Geschenk gewinnen kann und jedes Mal weitergereicht wird (Wächter des Pfeffi?)? Wärter bei Asse II?
*/
/**
* @remarks The index of an item must be equal to the `LootAttributeKindId` enum value.
*/
export const lootAttributeTemplates: LootAttributeTemplate[] = [
{
id: LootAttributeKind.RARITY_NORMAL,
classId: LootAttributeClass.RARITY,
displayName: "Normal",
shortDisplay: "",
initialDropWeight: 90,
},
{
id: LootAttributeKind.RARITY_RARE,
classId: LootAttributeClass.RARITY,
displayName: "Selten",
shortDisplay: "⭐",
initialDropWeight: 10,
},
{
id: LootAttributeKind.RARITY_VERY_RARE,
classId: LootAttributeClass.RARITY,
displayName: "Sehr Selten",
shortDisplay: "🌟",
initialDropWeight: 1,
},
{
id: LootAttributeKind.RADIOACTIVE,
classId: LootAttributeClass.OTHER,
displayName: "Verstrahlt",
shortDisplay: "☢️",
color: 0xff_ff_ff,
},
{
id: LootAttributeKind.SWEET,
classId: LootAttributeClass.OTHER,
displayName: "Süß",
shortDisplay: "🍬",
},
{
id: LootAttributeKind.NUTRI_SCORE_A,
classId: LootAttributeClass.NUTRI_SCORE,
displayName: "Nutri-Score A",