Skip to content

Commit 6b64960

Browse files
committed
ceramic cards
1 parent eeb5d13 commit 6b64960

File tree

11 files changed

+199
-5
lines changed

11 files changed

+199
-5
lines changed

assets/1x/enhancements.png

4.63 KB
Loading

assets/1x/reverse_tarots.png

1.2 KB
Loading

assets/1x/second_consumables.png

2.04 KB
Loading

assets/2x/enhancements.png

6.03 KB
Loading

assets/2x/reverse_tarots.png

1.47 KB
Loading

assets/2x/second_consumables.png

2.54 KB
Loading

items/inversions/reverse_tarots.lua

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,68 @@ local tent = {
11921192
end
11931193
}
11941194

1195-
1195+
local frail = {
1196+
key = "frail",
1197+
set = "Fraud",
1198+
atlas = "fraud",
1199+
object_type = "Consumable",
1200+
order = -901+33,
1201+
dependencies = {
1202+
items = {
1203+
"set_entr_inversions"
1204+
}
1205+
},
1206+
config = {
1207+
select = 1
1208+
},
1209+
pos = {x=7,y=2},
1210+
inversion = "c_entr_kiln",
1211+
loc_vars = function(self, q, card)
1212+
return {
1213+
vars = {
1214+
card.ability.select
1215+
}
1216+
}
1217+
end,
1218+
use = function(self, card2)
1219+
local cards = Entropy.GetHighlightedCards({G.hand}, card2, 1, card2.ability.select)
1220+
local modifications = {}
1221+
for i, v in pairs(cards) do
1222+
if v.config.center.set == "Enhanced" then
1223+
modifications[#modifications+1] = {enhancement=v.config.center.key}
1224+
end
1225+
if v.edition then
1226+
modifications[#modifications+1] = {edition=v.edition.key}
1227+
end
1228+
if v.seal then
1229+
modifications[#modifications+1] = {seal = v.seal}
1230+
end
1231+
end
1232+
local possible_cards = {}
1233+
for i, v in pairs(G.hand.cards) do
1234+
if v ~= card2 then
1235+
possible_cards[#possible_cards+1] = v
1236+
end
1237+
end
1238+
for i, v in pairs(modifications) do
1239+
local card = pseudorandom_element(possible_cards, pseudoseed("frail_card"))
1240+
if v.enhancement then card:set_ability(v.enhancement) end
1241+
if v.edition then card:set_edition(v.edition) end
1242+
if v.seal then card:set_seal(v.seal) end
1243+
end
1244+
for i, v in pairs(cards) do
1245+
v:start_dissolve()
1246+
end
1247+
end,
1248+
can_use = function(self, card)
1249+
local cards = Entropy.GetHighlightedCards({G.hand}, card, 1, card.ability.select)
1250+
return #cards > 0 and #cards <= card.ability.select
1251+
end,
1252+
demicoloncompat = true,
1253+
force_use = function(self, card)
1254+
self:use(card)
1255+
end
1256+
}
11961257

11971258
return {
11981259
items = {
@@ -1219,5 +1280,6 @@ return {
12191280
tent,
12201281
companion,
12211282
village,
1283+
frail
12221284
}
12231285
}

items/misc/atlases.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,15 @@ SMODS.Atlas {
228228

229229
SMODS.Atlas {
230230
key = 'rune_atlas',
231-
path = 'runes.png', --placeholder
231+
path = 'runes.png',
232+
px = 71,
233+
py = 95
234+
}
235+
236+
237+
SMODS.Atlas {
238+
key = 'consumables2',
239+
path = 'second_consumables.png', --placeholder
232240
px = 71,
233241
py = 95
234242
}

items/misc/enhancements.lua

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ local dark = {
111111
"set_entr_inversions"
112112
}
113113
},
114-
order = 6999,
114+
order = 10000+3,
115115
object_type = "Enhancement",
116116
key = "dark",
117117
atlas = "enhancements",
@@ -164,11 +164,108 @@ local dark = {
164164
end,
165165
}
166166

167+
local ceramic = {
168+
dependencies = {
169+
items = {
170+
"set_entr_misc"
171+
}
172+
},
173+
order = 10000+5,
174+
object_type = "Enhancement",
175+
key = "ceramic",
176+
atlas = "enhancements",
177+
pos = { x = 2, y = 0 },
178+
specific_rank = "entr_ceramic",
179+
shatters = true,
180+
force_no_face = true,
181+
config = {
182+
extra = {
183+
survive = false
184+
}
185+
},
186+
overrides_base_rank = true, --enhancement do not generate in grim, incantation, etc...
187+
replace_base_card = true, --So no base chips and no image
188+
calculate = function(self, card, context)
189+
if context.final_scoring_step
190+
and context.cardarea == G.play
191+
and not context.repetition
192+
and not SMODS.is_eternal(card)
193+
and not (card.will_shatter or card.destroyed or card.shattered) then
194+
G.E_MANAGER:add_event(Event({
195+
trigger = "immediate",
196+
func = function()
197+
198+
if (#G.consumeables.cards + G.GAME.consumeable_buffer <= G.consumeables.config.card_limit) then
199+
SMODS.add_card{
200+
area=G.consumeables,
201+
set = "Consumeables"
202+
}
203+
end
204+
card:juice_up(0.9, 0.9)
205+
card:shatter()
206+
return true
207+
end,
208+
}))
209+
end
210+
end,
211+
entr_credits = {
212+
art = {"gudusername_53951"}
213+
}
214+
}
215+
216+
local kiln = {
217+
key = "kiln",
218+
set = "Tarot",
219+
atlas = "consumables2",
220+
object_type = "Consumable",
221+
order = -1000,
222+
dependencies = {
223+
items = {
224+
"set_entr_misc",
225+
"m_entr_ceramic"
226+
}
227+
},
228+
config = {
229+
select = 1
230+
},
231+
pos = {x=0,y=0},
232+
use = function(self, card2)
233+
local cards = Entropy.GetHighlightedCards({G.hand}, card2, 1, card2.ability.select)
234+
Entropy.FlipThen(cards, function(card)
235+
card:set_ability(G.P_CENTERS.m_entr_ceramic)
236+
G.hand:remove_from_highlighted(card)
237+
end)
238+
239+
end,
240+
can_use = function(self, card)
241+
local num = #Entropy.GetHighlightedCards({G.hand}, card, 1, card.ability.select)
242+
return num > 0 and num <= card.ability.select
243+
end,
244+
loc_vars = function(self, q, card)
245+
q[#q+1] = G.P_CENTERS.m_entr_ceramic
246+
return {
247+
vars = {
248+
card.ability.select
249+
}
250+
}
251+
end,
252+
253+
254+
entr_credits = {
255+
art = {"aduckted"}
256+
},
257+
demicoloncompat = true,
258+
force_use = function(self, card)
259+
self:use(card)
260+
end
261+
}
167262
return {
168263
items = {
169264
flesh,
170265
disavowed,
171266
prismatic,
172-
dark
267+
dark,
268+
ceramic,
269+
kiln
173270
}
174271
}

items/misc/runes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function calculate_runes(context)
297297
if ret.func then ret.func() end
298298
else
299299
if ret.func then
300-
v:yep("+", G.C.DARK_EDITION, function()
300+
v:yep("+", G.C.PURPLE, function()
301301
ret.func()
302302
return true
303303
end)

0 commit comments

Comments
 (0)