1
+ local patched = false
2
+ local roundsPlayed = 0
3
+
4
+ resetRoundsOnRestart = function ()
5
+ roundsPlayed = 0
6
+ end
7
+
8
+ advanceRound = function ()
9
+ roundsPlayed = roundsPlayed + 1
10
+ end
11
+
12
+ rollJoker = function ()
13
+ if roundsPlayed > 1 then
14
+ for i = 1 ,5 ,1
15
+ do
16
+ G .E_MANAGER :add_event (Event ({trigger = ' after' , delay = 0.4 , func = function ()
17
+ play_sound (' timpani' )
18
+ local card = create_card (' Joker' , G .jokers )
19
+ card :add_to_deck ()
20
+ G .jokers :emplace (card )
21
+ return true end }))
22
+ delay (0.6 )
23
+ end
24
+ end
25
+ end
26
+
27
+ destroyJokers = function ()
28
+ for _ , joker in ipairs (G .jokers .cards ) do
29
+ joker :start_dissolve (nil , (k ~= 1 ))
30
+ end
31
+ end
32
+
33
+ local randomJokersEveryAnte = {
34
+ mod_id = " randomJokersEveryAnte" ,
35
+ name = " Random Jokers Every Ante" ,
36
+ version = " 1.0" ,
37
+ author = " gdemerald" ,
38
+ description = {
39
+ " On each Ante, destroy all jokers and roll 5 new ones"
40
+ },
41
+ enabled = true ,
42
+ on_enable = function ()
43
+
44
+ local patch = [[
45
+ if not reset then
46
+ bossBlinds = {
47
+ 'The Hook',
48
+ 'The Ox',
49
+ 'The House',
50
+ 'The Wall',
51
+ 'The Wheel',
52
+ 'The Arm',
53
+ 'The Club',
54
+ 'The Fish',
55
+ 'The Psychic',
56
+ 'The Goad',
57
+ 'The Water',
58
+ 'The Window',
59
+ 'The Manacle',
60
+ 'The Eye',
61
+ 'The Mouth',
62
+ 'The Plant',
63
+ 'The Serpent',
64
+ 'The Pillar',
65
+ 'The Needle',
66
+ 'The Head',
67
+ 'The Tooth',
68
+ 'The Flint',
69
+ 'The Mark',
70
+ 'Amber Acorn',
71
+ 'Verdant Leaf',
72
+ 'Violet Vessel',
73
+ 'Crimson Heart',
74
+ 'Cerulean Bell'
75
+ }
76
+
77
+ for i, blindName in ipairs(bossBlinds) do
78
+ if self.name == blindName then
79
+ destroyJokers()
80
+ end
81
+ end
82
+ end
83
+ ]]
84
+ injectTail (" blind.lua" , " Blind:defeat" , patch )
85
+
86
+ local startPatch = [[
87
+ if not reset then
88
+ advanceBlinds = {
89
+ 'Small Blind',
90
+ 'Big Blind',
91
+ 'The Hook',
92
+ 'The Ox',
93
+ 'The House',
94
+ 'The Wall',
95
+ 'The Wheel',
96
+ 'The Arm',
97
+ 'The Club',
98
+ 'The Fish',
99
+ 'The Psychic',
100
+ 'The Goad',
101
+ 'The Water',
102
+ 'The Window',
103
+ 'The Manacle',
104
+ 'The Eye',
105
+ 'The Mouth',
106
+ 'The Plant',
107
+ 'The Serpent',
108
+ 'The Pillar',
109
+ 'The Needle',
110
+ 'The Head',
111
+ 'The Tooth',
112
+ 'The Flint',
113
+ 'The Mark',
114
+ 'Amber Acorn',
115
+ 'Verdant Leaf',
116
+ 'Violet Vessel',
117
+ 'Crimson Heart',
118
+ 'Cerulean Bell'
119
+ }
120
+ for i, blind in ipairs(advanceBlinds) do
121
+ if self.name == blind then
122
+ advanceRound()
123
+ end
124
+ end
125
+ if self.name == "Small Blind" then
126
+ destroyJokers()
127
+ rollJoker()
128
+ end
129
+ end
130
+ ]]
131
+ injectTail (' blind.lua' , " Blind:set_blind" , startPatch )
132
+
133
+ local patch = [[
134
+ resetRoundsOnRestart()
135
+ ]]
136
+ injectTail (' game.lua' , " Game:start_run" , patch )
137
+ end ,
138
+
139
+ on_post_update = function ()
140
+ if not patched then
141
+ init_localization ()
142
+ patched = true
143
+ end
144
+ end
145
+ }
146
+
147
+ table.insert (mods , randomJokersEveryAnte )
0 commit comments