This repository was archived by the owner on Aug 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
996 lines (764 loc) · 23.3 KB
/
main.lua
File metadata and controls
996 lines (764 loc) · 23.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
-- Mod Icon
SMODS.Atlas{
key = 'modicon',
path = 'icon.png',
px = 26,
py = 26
}
----------------------------------------------
--------------CUSTOM JOKERS-------------------
SMODS.Atlas{
key = "7DD_Jokers",
path = "7DD_Jokers.png",
px = 71,
py = 95
}
-- Greed Joker
SMODS.Joker{
key = 'greed',
loc_txt = {
name = 'Greed',
text = {
'Multiplies {C:mult}Mult{} based on how',
'much {C:money}Money{} you have.',
'{C:inactive}(Currently{} {X:mult,C:white}X#1#{}{C:inactive}){}'
},
unlock = {
'Play with the',
'{C:money}Deck of Greed{}',
'at least once.'
}
},
atlas = '7DD_Jokers',
pos = {x = 0, y = 0},
rarity = 3,
blueprint_compat = false,
brainstorm_compat = false,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
config = { extra = {
Xmult = 1
}},
loc_vars = function(self, info_queue, center)
return {vars = {center.ability.extra.Xmult}}
end,
update = function(self, card, dt)
-- Calculate the multiplier
card.ability.extra.Xmult = G.GAME.dollars / 100
end,
calculate = function(self, card, context)
-- Prevent Blueprint from triggering the Joker
if context.joker_main and not context.blueprint then
-- $100 = 1x mult. $80 = 0.8x mult.
local mult = (G.GAME.dollars + (G.GAME.dollar_buffer or 0)) / 100
return {
card = card,
Xmult_mod = mult,
message = 'X' .. tostring(mult),
colour = G.C.MULT
}
end
end
}
-- Lust Joker
SMODS.Joker{
key = 'lust',
loc_txt = {
name = 'Lust',
text = {
'This Joker gains {C:mult}+#1#{} Mult',
'per {C:hearts}Heart{} card played.',
'All non-{C:hearts}Heart{} cards',
'are {C:red}debuffed{}.',
'{s:0.8}Stone Card excluded.{}',
'{C:inactive}(Currently{} {C:mult}+#2#{} {C:inactive}Mult){}'
},
unlock = {
'Play with the',
'{C:hearts}Deck of Lust{}',
'at least once.'
}
},
atlas = '7DD_Jokers',
pos = {x = 1, y = 0},
rarity = 3,
blueprint_compat = true,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
config = { extra = {
multAdd = 3,
mult = 0
}},
loc_vars = function(self, info_queue, center)
return {vars = {center.ability.extra.multAdd, center.ability.extra.mult}}
end,
calculate = function(self, card, context)
if context.before and not context.blueprint then
for _, pCard in ipairs(G.playing_cards) do
-- Debuff all non-Heart cards, except for Stone Cards
if pCard.base.suit ~= 'Hearts' and pCard.ability.effect ~= 'Stone Card' then
SMODS.debuff_card(pCard, true, 'lust')
end
end
end
if context.joker_main then
-- Increment mult for each played Heart card
for _, pCard in ipairs(context.scoring_hand) do
if pCard.base.suit == 'Hearts' then
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.multAdd
end
end
-- Add mult
return {
card = card,
mult_mod = card.ability.extra.mult,
message = '+' .. tostring(card.ability.extra.mult),
colour = G.C.MULT
}
end
end,
}
-- Gluttony Joker
SMODS.Joker{
key = 'gluttony',
loc_txt = {
name = 'Gluttony',
text = {
'Before every other {C:attention}played hand{},',
'{C:red}Destroy{} one random card',
'held in hand and gain',
'{C:mult}+#1#{} Mult per card',
'{C:inactive,s:0.8}Does not consume when no cards in hand.{}',
'{C:inactive}(Currently{} {C:mult}+#2#{} {C:inactive}Mult){}'
},
unlock = {
'Play with the',
'{C:attention}Deck of Gluttony{}',
'at least once.'
}
},
config = { extra = {
multAdd = 3,
mult = 0,
extra = {
consume = false
}
}},
loc_vars = function(self, info_queue, center)
return {vars = {center.ability.extra.multAdd, center.ability.extra.mult}}
end,
atlas = '7DD_Jokers',
pos = {x = 2, y = 0},
rarity = 3,
blueprint_compat = false,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
calculate = function(self, card, context)
-- Consume card if flag is set
if card.ability.extra.consume and context.before then
-- Only consume if more than 1 card in deck and in hand
if #G.playing_cards > 1 and #G.hand.cards > 0 then
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function ()
-- Get random card from hand
local dCard = pseudorandom_element(G.hand.cards, pseudoseed('gluttony'))
-- Destroy card
dCard:start_dissolve()
return true
end
}))
-- Increase mult
card.ability.extra.mult = card.ability.extra.mult + card.ability.extra.multAdd
-- Display message
return {
message = 'Consumed Card',
colour = G.C.RED
}
end
end
-- Inverse flag
card.ability.extra.consume = not card.ability.extra.consume
if context.joker_main and not context.blueprint then
return {
card = card,
mult_mod = card.ability.extra.mult,
message = '+' .. tostring(card.ability.extra.mult),
colour = G.C.MULT
}
end
end
}
-- Envy Joker
SMODS.Joker{
key = 'envy',
loc_txt = {
name = 'Envy',
text = {
'After each {C:attention}played hand{},',
'replace the {C:attention}lowest rank card{}',
'in your hand with the',
'{C:attention}highest rank card{}',
},
unlock = {
'Play with the',
'{C:green}Deck of Envy{}',
'at least once.'
}
},
atlas = '7DD_Jokers',
pos = {x = 3, y = 0},
rarity = 3,
blueprint_compat = false,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
calculate = function(self, card, context)
if context.after and not context.blueprint then
-- Get lowest and highest cards
local lCard = nil
local hCard = nil
local highest = 0
local lowest = 14
for _, pCard in ipairs(G.hand.cards) do
-- Get highest
if pCard:get_id() >= highest then
hCard = pCard
highest = pCard:get_id()
end
-- Get lowest
if pCard:get_id() <= lowest then
lCard = pCard
lowest = pCard:get_id()
end
end
-- Convert the lowest card into the highest card
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.1,
func = function ()
lCard:juice_up()
copy_card(hCard, lCard)
return true
end
}))
return {
message = 'Converted',
colour = G.C.GREEN
}
end
end
}
-- Wrath Joker
SMODS.Joker{
key = 'wrath',
loc_txt = {
name = 'Wrath',
text = {
'Adds or subtracts',
'between {C:attention}1{} and {C:attention}#1#{}',
'{C:chips}Chips{} or {C:mult}Mult{}',
'{C:inactive}Does not go negative or zero{}'
},
unlock = {
'Play with the',
'{C:red}Deck of Wrath{}',
'at least once.'
}
},
config = { extra = {
aMax = 30
}},
loc_vars = function(self, info_queue, center)
return {vars = {center.ability.extra.aMax}}
end,
atlas = '7DD_Jokers',
pos = {x = 4, y = 0},
rarity = 3,
blueprint_compat = false,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
calculate = function(self, card, context)
if context.joker_main and not context.blueprint then
-- Get which value to change
local value = pseudorandom_element({'C', 'M'}, pseudoseed('wrath'))
if value == 'C' then
-- Chips
-- Get the amount to change. Stay within bounds
local lBound = math.max(-1 * (hand_chips - 1), -card.ability.extra.aMax)
local uBound = card.ability.extra.aMax
local amount = math.random(lBound, uBound)
local sign = ''
if amount < 0 then
sign = '-'
else
sign = '+'
end
return {
message = sign .. tostring(math.abs(amount)) .. ' Chips',
colour = G.C.CHIPS,
chip_mod = amount
}
elseif value == 'M' then
-- Mult
-- Get the amount to change. Stay within bounds
local lBound = math.max(-1 * (mult - 1), -card.ability.extra.aMax)
local uBound = card.ability.extra.aMax
local amount = math.random(lBound, uBound)
local sign = ''
if amount < 0 then
sign = '-'
else
sign = '+'
end
return {
message = sign .. tostring(math.abs(amount)) .. ' Mult',
colour = G.C.MULT,
mult_mod = amount
}
end
end
end
}
-- Sloth Joker
SMODS.Joker{
key = 'sloth',
loc_txt = {
name = 'Sloth',
text = {
'When a hand is played,',
'{C:green}#1# in #2#{} chance for',
'the hand to {C:attention}not score{},',
'and gain {X:mult,C:white}X#3#{} Mult.',
'Chance increases by {C:attention}#5#{}',
'every {C:attention}scored hand{}.',
'{X:mult,C:white}Xmult{} decreases over time.',
'{C:inactive}(Currently{} {X:mult,C:white}X#4#{} {C:inactive}Mult){}'
},
unlock = {
'Play with the',
'{C:blue}Deck of Sloth{}',
'at least once.'
}
},
config = { extra = {
MaxOdds = 100,
odds = 2,
XmultGain = 2,
Xmult = 1,
XmultDec = 0.1,
oddsInc = 5,
}},
loc_vars = function(self, info_queue, center)
return {vars = {
G.GAME and G.GAME.probabilities.normal or 1,
center.ability.extra.odds,
center.ability.extra.XmultGain,
center.ability.extra.Xmult,
center.ability.extra.oddsInc,
}}
end,
atlas = '7DD_Jokers',
pos = {x = 5, y = 0},
rarity = 3,
blueprint_compat = false,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
calculate = function(self, card, context)
if context.joker_main and not context.blueprint then
-- Run probabilities
local roll = pseudorandom('sloth')
if roll < G.GAME.probabilities.normal/card.ability.extra.odds then
-- Hand does not score
hand_chips = 0
mult = 0
-- Reset odds
card.ability.extra.odds = card.ability.extra.MaxOdds
-- Increase mult
card.ability.extra.Xmult = card.ability.extra.Xmult + card.ability.extra.XmultGain
return {
message = 'Zzz...',
colour = G.C.FILTER,
card = card,
}
else
-- Hand scores. Increase odds. Dont go pass 1/1
if card.ability.extra.odds > card.ability.extra.oddsInc then
card.ability.extra.odds = card.ability.extra.odds - card.ability.extra.oddsInc
end
-- Get mult to score before decrease
local Xmult = card.ability.extra.Xmult
-- Decrease mult. Dont go pass X1
if card.ability.extra.Xmult > 1 then
card.ability.extra.Xmult = card.ability.extra.Xmult - card.ability.extra.XmultDec
end
return {
message = 'X' .. tostring(Xmult),
colour = G.C.MULT,
card = card,
Xmult_mod = Xmult
}
end
end
end
}
-- Pride Joker
SMODS.Joker{
key = 'pride',
loc_txt = {
name = 'Pride',
text = {
'{C:green}#1# in #2#{} chance for',
'{X:chips,C:white}X#3#{} Chips,',
'{X:mult,C:white}X#4#{} Mult,',
'or {X:dark_edition,C:white}X#5#{} Chips and Mult',
},
unlock = {
'Play with the',
'{C:gold}Deck of Pride{}',
'at least once.'
}
},
config = { extra = {
odds = 4,
Xchips = 0.75,
Xmult = 0.75,
Xboth = 2,
}},
loc_vars = function(self, info_queue, center)
return {vars = {
G.GAME and G.GAME.probabilities.normal or 1,
center.ability.extra.odds,
center.ability.extra.Xchips,
center.ability.extra.Xmult,
center.ability.extra.Xboth
}}
end,
atlas = '7DD_Jokers',
pos = {x = 6, y = 0},
rarity = 3,
blueprint_compat = false,
unlocked = false,
discovered = false,
in_pool = function(self)
return false
end,
calculate = function(self, card, context)
if context.joker_main and not context.blueprint then
-- Run probabilities
local roll = pseudorandom('pride')
if roll < G.GAME.probabilities.normal/card.ability.extra.odds then
-- Choose a random effect
local effect = math.random(1, 3)
if effect == 1 then
-- Chips
local Xchips_mod = (hand_chips * card.ability.extra.Xchips) - hand_chips
return {
message = 'I don\'t need those chips!',
colour = G.C.CHIPS,
card = card,
chip_mod = Xchips_mod
}
elseif effect == 2 then
-- Mult
return {
message = 'Who needs mult? I don\'t!',
colour = G.C.MULT,
card = card,
Xmult_mod = card.ability.extra.Xmult
}
elseif effect == 3 then
-- Both
local Xchips_mod = (hand_chips * card.ability.extra.Xboth) - hand_chips
return {
message = 'I\'m the best!',
colour = G.C.DARK_EDITION,
card = card,
chip_mod = Xchips_mod,
Xmult_mod = card.ability.extra.Xboth
}
end
else
-- No effects
end
end
end
}
----------------------------------------------
-----------------DECKS-------------------------
SMODS.Atlas{
key = '7DD_Decks',
path = '7DD_Decks.png',
px = 71,
py = 95
}
--- Greed Deck
GREED_DECK = SMODS.Back{
name = 'Deck of Greed',
key = 'greed',
atlas = '7DD_Decks',
pos = {x = 0, y = 0},
loc_txt = {
name = 'Deck of Greed',
text = {
'Start with {C:money}$100{},',
'All cards are {C:gold,T:m_gold}Gold{}',
'Start with a',
'{C:money}greedy Joker{}.'
},
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Set starting money to $100
G.GAME.dollars = 100
-- Add Greedy Joker and Midas Mask
greed = {
key = 'j_7dd_greed',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(greed)
for _, card in ipairs(G.playing_cards) do
-- Set every card to Gold with Gold seal
card:set_ability(G.P_CENTERS.m_gold, nil, true)
card:set_seal('Gold', true, true)
end
local money_mult_ref = money_mult
function money_mult(context)
context = context or {}
-- $100 = 1x mult. $800 = 0.8x mult.
local mult = G.GAME.dollars / 100
-- Multiply mult at end of round
if context.end_of_round then
G.GAME.mult = G.GAME.mult * mult
end
return money_mult_ref(context)
end
return true
end
}))
end
}
-- Lust Deck
LUST_DECK = SMODS.Back{
name = 'Deck of Lust',
key = 'lust',
atlas = '7DD_Decks',
pos = {x = 1, y = 0},
loc_txt = {
name = 'Deck of Lust',
text = {
'Deck has {C:attention}52{} {C:hearts}Hearts{}',
'Start with a',
'{C:red}lustful Joker{}.'
},
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Set all cards to Hearts
for _, card in ipairs(G.playing_cards) do
if card.base.suit ~= 'Hearts' then
assert(SMODS.change_base(card, 'Hearts'))
end
end
-- Add eternal Lust Joker
lust = {
key = 'j_7dd_lust',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(lust)
return true
end
}))
end,
}
-- Gluttony Deck
GLUTTONY_DECK = SMODS.Back{
name = 'Deck of Gluttony',
key = 'gluttony',
atlas = '7DD_Decks',
pos = {x = 2, y = 0},
loc_txt = {
name = 'Deck of Gluttony',
text = {
'{C:attention}+2{} hand size',
'Start with a',
'{C:attention}very hungry Joker{}.',
},
},
config = {
hand_size = 2
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Add eternal Gluttony Joker
gluttony = {
key = 'j_7dd_gluttony',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(gluttony)
return true
end
}))
end,
}
-- Envy Deck
ENVY_DECK = SMODS.Back{
name = 'Deck of Envy',
key = 'envy',
atlas = '7DD_Decks',
pos = {x = 3, y = 0},
loc_txt = {
name = 'Deck of Envy',
text = {
'{C:red}+2{} discards',
'Start with an',
'{C:green}envious Joker{}.',
},
},
config = {
discards = 2
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Add eternal Envy Joker
envy = {
key = 'j_7dd_envy',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(envy)
return true
end
}))
end,
}
-- Wrath Deck
WRATH_DECK = SMODS.Back{
name = 'Deck of Wrath',
key = 'wrath',
atlas = '7DD_Decks',
pos = {x = 4, y = 0},
loc_txt = {
name = 'Deck of Wrath',
text = {
'{C:blue}+2{} hands',
'Start with a',
'{C:red}wrathful Joker{}.',
},
},
config = {
hands = 2
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Add eternal Wrath Joker
wrath = {
key = 'j_7dd_wrath',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(wrath)
return true
end
}))
end,
}
-- Sloth Deck
SLOTH_DECK = SMODS.Back{
name = 'Deck of Sloth',
key = 'sloth',
atlas = '7DD_Decks',
pos = {x = 5, y = 0},
loc_txt = {
name = 'Deck of Sloth',
text = {
'{C:blue}+1{} hands,',
'Start with a',
'{C:blue}sleepy Joker{}'
},
},
config = {
hands = 1,
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Add eternal Sloth Joker
sloth = {
key = 'j_7dd_sloth',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(sloth)
return true
end
}))
end,
}
-- Pride Deck
PRIDE_DECK = SMODS.Back{
name = 'Deck of Pride',
key = 'pride',
atlas = '7DD_Decks',
pos = {x = 6, y = 0},
loc_txt = {
name = 'Deck of Pride',
text = {
'Start with {C:attention}Money Seed{},',
'{C:attention}Director\'s Cut{}, and a',
'{C:gold}prideful Joker{}.',
},
},
config = {
vouchers = {
'v_seed_money',
'v_directors_cut',
}
},
apply = function ()
G.E_MANAGER:add_event(Event({
func = function ()
-- Add eternal Pride Joker
pride = {
key = 'j_7dd_pride',
set = 'Joker',
stickers = {'eternal'},
}
SMODS.add_card(pride)
return true
end
}))
end,
}
----------------------------------------------
--------------CARD SLEEVES--------------------
-- Load Card Sleeves if mod is installed
if CardSleeves then
SMODS.load_file('cardsleeves.lua')()
end