Skip to content

Commit 9ca8a6b

Browse files
committed
consumables forcetriggering api
1 parent eb146d0 commit 9ca8a6b

File tree

8 files changed

+604
-550
lines changed

8 files changed

+604
-550
lines changed

items/code.lua

Lines changed: 381 additions & 295 deletions
Large diffs are not rendered by default.

items/exotic.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ local gateway = {
5656
}))
5757
delay(0.6)
5858
end,
59+
demicoloncompat = true,
60+
force_use = function(self, card, area)
61+
self:use(card, area)
62+
end,
5963
}
6064
local iterum = {
6165
dependencies = {

items/misc.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ local eclipse = {
7979

8080
return { vars = { card and card.ability.max_highlighted or self.config.max_highlighted } }
8181
end,
82+
demicoloncompat = true,
83+
force_use = function(self, card, area)
84+
card:use_consumeable(area)
85+
end,
8286
}
8387
-- Light (Enhancement)
8488
-- When triggered with 5 other cards, gain 0.2 Xmult
@@ -169,6 +173,10 @@ local seraph = {
169173

170174
return { vars = { card and card.ability.max_highlighted or self.config.max_highlighted } }
171175
end,
176+
demicoloncompat = true,
177+
force_use = function(self, card, area)
178+
card:use_consumeable(area)
179+
end,
172180
}
173181
-- Abstract (Enhancement)
174182
-- Has its own rank/suit
@@ -300,6 +308,10 @@ local instability = {
300308

301309
return { vars = { card and card.ability.max_highlighted or self.config.max_highlighted } }
302310
end,
311+
demicoloncompat = true,
312+
force_use = function(self, card, area)
313+
card:use_consumeable(area)
314+
end,
303315
}
304316

305317
-- Blessing
@@ -335,11 +347,12 @@ local blessing = {
335347
can_bulk_use = true,
336348
use = function(self, card, area, copier)
337349
local used_consumable = copier or card
350+
local forceuse = G.cry_force_use
338351
G.E_MANAGER:add_event(Event({
339352
trigger = "after",
340353
delay = 0.4,
341354
func = function()
342-
if G.consumeables.config.card_limit > #G.consumeables.cards then
355+
if G.consumeables.config.card_limit > #G.consumeables.cards or forceuse then
343356
play_sound("timpani")
344357
local forced_key = Cryptid.random_consumable("blessing", nil, "c_cry_blessing")
345358
local _card = create_card(
@@ -361,6 +374,10 @@ local blessing = {
361374
}))
362375
delay(0.6)
363376
end,
377+
demicoloncompat = true,
378+
force_use = function(self, card, area)
379+
self:use(card, area)
380+
end,
364381
}
365382

366383
-- insert typhoon here (why is it in spectral.lua)

items/planet.lua

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ local abelt = {
4646
}
4747
end,
4848
generate_ui = 0,
49+
demicoloncompat = true,
50+
force_use = function(self, card, area)
51+
card:use_consumeable(area)
52+
end,
4953
}
5054
-- Void
5155
-- Upgrades Clusterfuck (+40/+4)
@@ -95,6 +99,10 @@ local void = {
9599
}
96100
end,
97101
generate_ui = 0,
102+
demicoloncompat = true,
103+
force_use = function(self, card, area)
104+
card:use_consumeable(area)
105+
end,
98106
}
99107
-- Phobos & Deimos
100108
-- Upgrades Ultimate Pair (+40/+4)
@@ -149,6 +157,10 @@ local marsmoons = {
149157
}
150158
end,
151159
generate_ui = 0,
160+
demicoloncompat = true,
161+
force_use = function(self, card, area)
162+
card:use_consumeable(area)
163+
end,
152164
}
153165

154166
-- Order 4 reserved for possible None planet
@@ -207,6 +219,14 @@ local nibiru = {
207219
}
208220
end,
209221
generate_ui = 0,
222+
demicoloncompat = true,
223+
force_use = function(self, card, area)
224+
card:use_consumeable(area)
225+
end,
226+
cry_credits = {
227+
art = { "cassknows" },
228+
code = { "lord-ruby" },
229+
},
210230
}
211231

212232
-- The Universe In Its Fucking Entirety
@@ -257,10 +277,10 @@ local universe = {
257277
}
258278
end,
259279
generate_ui = 0,
260-
cry_credits = {
261-
art = { "cassknows" },
262-
code = { "lord-ruby" },
263-
},
280+
demicoloncompat = true,
281+
force_use = function(self, card, area)
282+
card:use_consumeable(area)
283+
end,
264284
}
265285

266286
-- Planet.lua
@@ -572,6 +592,10 @@ local planetlua = {
572592
}
573593
end
574594
end,
595+
demicoloncompat = true,
596+
force_use = function(self, card, area)
597+
card:use_consumeable(area)
598+
end,
575599
}
576600
-- Neutron Star
577601
-- Upgrades a random hand by 1 per Neutron Star used this run
@@ -713,6 +737,10 @@ local nstar = {
713737
return chosen_hand
714738
end
715739
end,
740+
demicoloncompat = true,
741+
force_use = function(self, card, area)
742+
card:use_consumeable(area)
743+
end,
716744
}
717745

718746
-- Sol
@@ -878,6 +906,10 @@ local sunplanet = {
878906
end
879907
return false
880908
end,
909+
demicoloncompat = true,
910+
force_use = function(self, card, area)
911+
card:use_consumeable(area)
912+
end,
881913
}
882914
-- Ruutu
883915
-- Upgrades High Card, Pair and Two Pair
@@ -963,6 +995,10 @@ local ruutu = {
963995
}
964996
end
965997
end,
998+
demicoloncompat = true,
999+
force_use = function(self, card, area)
1000+
card:use_consumeable(area)
1001+
end,
9661002
}
9671003
-- Risti
9681004
-- Upgrades Three Of A Kind, Straight and Flush
@@ -1048,6 +1084,10 @@ local risti = {
10481084
}
10491085
end
10501086
end,
1087+
demicoloncompat = true,
1088+
force_use = function(self, card, area)
1089+
card:use_consumeable(area)
1090+
end,
10511091
}
10521092
-- Hertta
10531093
-- Upgrades Full House, Four Of A Kind and Straight Flush
@@ -1133,6 +1173,10 @@ local hertta = {
11331173
}
11341174
end
11351175
end,
1176+
demicoloncompat = true,
1177+
force_use = function(self, card, area)
1178+
card:use_consumeable(area)
1179+
end,
11361180
}
11371181
-- Pata
11381182
-- Upgrades Five Of A Kind, Flush House and Flush Five
@@ -1218,6 +1262,10 @@ local pata = {
12181262
}
12191263
end
12201264
end,
1265+
demicoloncompat = true,
1266+
force_use = function(self, card, area)
1267+
card:use_consumeable(area)
1268+
end,
12211269
}
12221270
-- Kaikki
12231271
-- Upgrades Bulwark, Clusterfuck and Ultimate Pair
@@ -1311,6 +1359,10 @@ local kaikki = {
13111359
}
13121360
end
13131361
end,
1362+
demicoloncompat = true,
1363+
force_use = function(self, card, area)
1364+
card:use_consumeable(area)
1365+
end,
13141366
}
13151367
-- order 166 reserved for suit planet of TEFD, None and Sol
13161368

0 commit comments

Comments
 (0)