Skip to content

Commit ebd7b8c

Browse files
authored
Merge pull request #64 from f-raZ0R/main
Implement Crossmod Fraud cards with Bunco
2 parents 80de027 + 187bda2 commit ebd7b8c

File tree

5 files changed

+394
-1
lines changed

5 files changed

+394
-1
lines changed
4.23 KB
Loading
8.44 KB
Loading

compat/bunco.lua

Lines changed: 348 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,348 @@
1+
if (SMODS.Mods["Bunco"] or {}).can_load then
2+
3+
--TODO: commented out because banishing playing cards is a fuck. Somebody else's problem.
4+
--[[
5+
local disturbance = {
6+
dependencies = {
7+
items = {
8+
"set_entr_inversions",
9+
}
10+
},
11+
object_type = "Consumable",
12+
order = -900 + 34,
13+
key = "disturbance",
14+
set = "Fraud",
15+
16+
inversion = "c_bunc_adjustment",
17+
18+
atlas = "crossmod_consumables",
19+
config = {
20+
select = 3
21+
},
22+
pos = {x=8,y=0},
23+
use = function(self, card2)
24+
local cards = Entropy.GetHighlightedCards({G.hand}, card2, 1, card2.ability.select)
25+
for i, v in pairs(cards) do
26+
local card = cards[i]
27+
G.E_MANAGER:add_event(Event({
28+
func = function()
29+
G.GAME.banned_keys[card.config.center.key] = true
30+
return true
31+
end
32+
}))
33+
end
34+
35+
end,
36+
can_use = function(self, card)
37+
local num = #Entropy.GetHighlightedCards({G.hand}, card, 1, card.ability.select)
38+
return num > 0 and num <= card.ability.select
39+
end,
40+
loc_vars = function(self, q, card)
41+
return {
42+
vars = {
43+
card.ability.select
44+
}
45+
}
46+
end,
47+
entr_credits = {
48+
idea = {"Athebyne"}
49+
},
50+
51+
demicoloncompat = true,
52+
force_use = function(self, card)
53+
self:use(card)
54+
end
55+
}
56+
]]--
57+
58+
59+
--TODO: commented out because boosters that come from a consumable are a fuck, especially with multiple at once. Somebody else's problem.
60+
--[[
61+
local avarice = {
62+
dependencies = {
63+
items = {
64+
"set_entr_inversions",
65+
}
66+
},
67+
object_type = "Consumable",
68+
order = -900 + 35,
69+
key = "avarice",
70+
set = "Fraud",
71+
72+
inversion = "c_bunc_lust",
73+
74+
atlas = "crossmod_consumables",
75+
config = {
76+
boosters = 3
77+
},
78+
pos = {x=10,y=0},
79+
use = function(self, card)
80+
for i = 1, math.min(card.ability.boosters, 20) do
81+
G.E_MANAGER:add_event(Event({
82+
trigger = "before",
83+
blocking = false,
84+
func = function()
85+
if ((G.STATE == G.STATES.SMODS_BOOSTER_OPENED) or G.pack_cards) then return false end
86+
local key = "p_standard_normal_1"
87+
local booster = Card(
88+
G.play.T.x + G.play.T.w / 2 - G.CARD_W * 1.27 / 2,
89+
G.play.T.y + G.play.T.h / 2 - G.CARD_H * 1.27 / 2,
90+
G.CARD_W * 1.27,
91+
G.CARD_H * 1.27,
92+
G.P_CARDS.empty,
93+
G.P_CENTERS[key],
94+
{ bypass_discovery_center = true, bypass_discovery_ui = true }
95+
)
96+
booster.cost = 0
97+
booster.from_tag = true
98+
G.FUNCS.use_card({ config = { ref_table = booster } })
99+
booster:start_materialize()
100+
return true
101+
end,
102+
}))
103+
end
104+
end,
105+
can_use = function(self, card)
106+
return not (G.STATE == G.STATES.SMODS_BOOSTER_OPENED)
107+
end,
108+
loc_vars = function(self, q, card) return {vars = {math.min(card.ability.boosters, 20)}} end,
109+
entr_credits = {
110+
idea = {"Athebyne"}
111+
},
112+
113+
demicoloncompat = true,
114+
force_use = function(self, card)
115+
self:use(card)
116+
end
117+
}
118+
]]--
119+
120+
local muse = {
121+
dependencies = {
122+
items = {
123+
"set_entr_inversions",
124+
}
125+
},
126+
object_type = "Consumable",
127+
order = -900 + 36,
128+
key = "muse",
129+
set = "Fraud",
130+
131+
inversion = "c_bunc_art",
132+
133+
atlas = "crossmod_consumables",
134+
config = {
135+
min_highlighted = 2,
136+
max_highlighted = 2
137+
},
138+
pos = {x=9,y=0},
139+
use = function(self, card)
140+
link_cards(G.hand.highlighted, self.key)
141+
card:juice_up(0.3, 0.5)
142+
end,
143+
can_use = function(self, card)
144+
if G.hand then
145+
local cards = G.hand.highlighted
146+
-- Group check:
147+
for i = 1, #cards do
148+
if cards[i].ability.group then return false end
149+
end
150+
if #cards > 1 and #cards <= card.ability.max_highlighted then
151+
return true
152+
end
153+
end
154+
return false
155+
end,
156+
loc_vars = function(self, info_queue, card)
157+
return {
158+
vars = {
159+
card.ability.min_highlighted
160+
}
161+
}
162+
end,
163+
entr_credits = {
164+
idea = {"Athebyne"}
165+
},
166+
167+
demicoloncompat = true,
168+
force_use = function(self, card)
169+
self:use(card)
170+
end
171+
}
172+
173+
local garden = {
174+
dependencies = {
175+
items = {
176+
"set_entr_inversions",
177+
}
178+
},
179+
object_type = "Consumable",
180+
order = -900 + 37,
181+
key = "garden",
182+
set = "Fraud",
183+
184+
inversion = "c_bunc_universe",
185+
186+
atlas = "crossmod_consumables",
187+
config = {
188+
min_highlighted = 3,
189+
max_highlighted = 3
190+
},
191+
pos = {x=11,y=0},
192+
use = function(self, card)
193+
local new_suit = pseudorandom_element(SMODS.Suits, pseudoseed('microcosm')).key
194+
local new_rank = pseudorandom_element(SMODS.Ranks, pseudoseed('microcosm')).key
195+
for _, playing_card in ipairs(G.hand.cards) do
196+
if playing_card.highlighted then
197+
G.E_MANAGER:add_event(Event({delay = 0.2, trigger = 'before', func = function()
198+
i = i and (i + 1) or 1
199+
play_sound('card1', 0.85 + (i * 0.05))
200+
playing_card:juice_up(0.7)
201+
SMODS.change_base(playing_card, new_suit, new_rank)
202+
return true end}))
203+
end
204+
end
205+
end,
206+
can_use = function(self, card)
207+
if G.hand and #G.hand.highlighted <= card.ability.max_highlighted and #G.hand.highlighted >= card.ability.min_highlighted then
208+
return true
209+
end
210+
end,
211+
loc_vars = function(self, info_queue, card)
212+
return {
213+
vars = {
214+
card.ability.max_highlighted
215+
}
216+
}
217+
end,
218+
entr_credits = {
219+
idea = {"Athebyne"}
220+
},
221+
222+
demicoloncompat = true,
223+
force_use = function(self, card)
224+
self:use(card)
225+
end
226+
}
227+
228+
local desert = {
229+
dependencies = {
230+
items = {
231+
"set_entr_inversions",
232+
}
233+
},
234+
object_type = "Consumable",
235+
order = -900 + 38,
236+
key = "desert",
237+
set = "Fraud",
238+
239+
inversion = "c_bunc_sky",
240+
241+
atlas = "crossmod_consumables",
242+
config = {
243+
-- consistent with bunco's exotic suits, buffs to them are stronger than buffs to the standard four.
244+
per_level = 15
245+
},
246+
pos = {x=8,y=1},
247+
use = function(self, card2)
248+
Entropy.LevelSuit("bunc_Fleurons", card2, 1, card2.ability.per_level)
249+
end,
250+
bulk_use = function(self, card2, _, _, amount)
251+
Entropy.LevelSuit("bunc_Fleurons", card2, amount, card2.ability.per_level)
252+
end,
253+
can_use = function(self, card)
254+
return true
255+
end,
256+
loc_vars = function(self, q, card)
257+
if not G.GAME.SuitBuffs then G.GAME.SuitBuffs = {} end
258+
if not G.GAME.SuitBuffs["bunc_Fleurons"] then G.GAME.SuitBuffs["bunc_Fleurons"] = {} end
259+
return {
260+
vars = {
261+
G.GAME.SuitBuffs["bunc_Fleurons"].level or 1,
262+
"",
263+
localize("bunc_Fleurons",'suits_plural'),
264+
card.ability.per_level,
265+
colours = {
266+
to_big(G.GAME.SuitBuffs["bunc_Fleurons"].level or 1) < to_big(2) and G.C.BLACK or G.C.HAND_LEVELS[to_number(math.min(7, G.GAME.SuitBuffs["bunc_Fleurons"].level or 1))]
267+
}
268+
}
269+
}
270+
end,
271+
in_pool = function(self)
272+
return BUNCOMOD.funcs.exotic_in_pool()
273+
end,
274+
entr_credits = {
275+
idea = {"Athebyne"}
276+
},
277+
demicoloncompat = true,
278+
force_use = function(self, card)
279+
self:use(card)
280+
end
281+
}
282+
283+
local wastes = {
284+
dependencies = {
285+
items = {
286+
"set_entr_inversions",
287+
}
288+
},
289+
object_type = "Consumable",
290+
order = -900 + 39,
291+
key = "wastes",
292+
set = "Fraud",
293+
294+
inversion = "c_bunc_abyss",
295+
296+
atlas = "crossmod_consumables",
297+
config = {
298+
-- consistent with bunco's exotic suits, buffs to them are stronger than buffs to the standard four.
299+
per_level = 15
300+
},
301+
pos = {x=9,y=1},
302+
use = function(self, card2)
303+
Entropy.LevelSuit("bunc_Halberds", card2, 1, card2.ability.per_level)
304+
end,
305+
bulk_use = function(self, card2, _, _, amount)
306+
Entropy.LevelSuit("bunc_Halberds", card2, amount, card2.ability.per_level)
307+
end,
308+
can_use = function(self, card)
309+
return true
310+
end,
311+
loc_vars = function(self, q, card)
312+
if not G.GAME.SuitBuffs then G.GAME.SuitBuffs = {} end
313+
if not G.GAME.SuitBuffs["bunc_Halberds"] then G.GAME.SuitBuffs["bunc_Halberds"] = {} end
314+
return {
315+
vars = {
316+
G.GAME.SuitBuffs["bunc_Halberds"].level or 1,
317+
"",
318+
localize("bunc_Halberds",'suits_plural'),
319+
card.ability.per_level,
320+
colours = {
321+
to_big(G.GAME.SuitBuffs["bunc_Halberds"].level or 1) < to_big(2) and G.C.BLACK or G.C.HAND_LEVELS[to_number(math.min(7, G.GAME.SuitBuffs["bunc_Halberds"].level or 1))]
322+
}
323+
}
324+
}
325+
end,
326+
in_pool = function(self)
327+
return BUNCOMOD.funcs.exotic_in_pool()
328+
end,
329+
entr_credits = {
330+
idea = {"Athebyne"}
331+
},
332+
demicoloncompat = true,
333+
force_use = function(self, card)
334+
self:use(card)
335+
end
336+
}
337+
338+
return {
339+
items = {
340+
--disturbance,
341+
--avarice,
342+
muse,
343+
garden,
344+
desert,
345+
wastes
346+
}
347+
}
348+
end

compat/compat_loader.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ local i = {
99
"compat/revosvault",
1010
"compat/aikoshen",
1111
"compat/tspectrals",
12-
"compat/grabbag"
12+
"compat/grabbag",
13+
"compat/bunco"
1314
}
1415
Entropy.load_files(i)
1516

0 commit comments

Comments
 (0)