Skip to content

Commit 8de1a72

Browse files
committed
individual edition deck sprites (new ones by Gud Username)
1 parent 89e83d0 commit 8de1a72

File tree

5 files changed

+85
-12
lines changed

5 files changed

+85
-12
lines changed

assets/1x/atlaseditiondeck.png

38.5 KB
Loading

assets/2x/atlaseditiondeck.png

46.2 KB
Loading

items/enhanced.lua

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,82 @@ local atlasenhanced = {
55
px = 71,
66
py = 95,
77
}
8+
local atlasedition = {
9+
object_type = "Atlas",
10+
key = "atlaseditiondeck",
11+
path = "atlaseditiondeck.png",
12+
px = 71,
13+
py = 95,
14+
}
15+
16+
Cryptid.edeck_sprites = {
17+
edition = {
18+
order = 1,
19+
default = { atlas = "centers", pos = { x = 5, y = 2 } },
20+
foil = { atlas = "cry_atlaseditiondeck", pos = { x = 0, y = 0 } },
21+
holo = { atlas = "cry_atlaseditiondeck", pos = { x = 1, y = 0 } },
22+
polychrome = { atlas = "cry_atlaseditiondeck", pos = { x = 2, y = 0 } },
23+
negative = { atlas = "cry_atlaseditiondeck", pos = { x = 3, y = 0 } },
24+
cry_mosaic = { atlas = "cry_atlaseditiondeck", pos = { x = 0, y = 1 } },
25+
cry_oversat = { atlas = "cry_atlaseditiondeck", pos = { x = 1, y = 1 } },
26+
cry_glass = { atlas = "cry_atlaseditiondeck", pos = { x = 2, y = 1 } },
27+
cry_gold = { atlas = "cry_atlaseditiondeck", pos = { x = 3, y = 1 } },
28+
cry_blur = { atlas = "cry_atlaseditiondeck", pos = { x = 0, y = 2 } },
29+
cry_noisy = { atlas = "cry_atlaseditiondeck", pos = { x = 1, y = 2 } },
30+
cry_astral = { atlas = "cry_atlaseditiondeck", pos = { x = 2, y = 2 } },
31+
cry_m = { atlas = "cry_atlaseditiondeck", pos = { x = 3, y = 2 } },
32+
},
33+
enhancement = {
34+
order = 2,
35+
default = { atlas = "centers", pos = { x = 5, y = 2 } },
36+
m_bonus = { atlas = "cry_atlasenhanced", pos = { x = 3, y = 3 }},
37+
m_mult = { atlas = "cry_atlasenhanced", pos = { x = 2, y = 3 }},
38+
m_wild = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 3 }},
39+
m_glass = { atlas = "cry_atlasenhanced", pos = { x = 4, y = 3 }},
40+
m_steel = { atlas = "centers", pos = { x = 6, y = 1 }},
41+
m_stone = { atlas = "centers", pos = { x = 5, y = 0 }},
42+
m_gold = { atlas = "centers", pos = { x = 6, y = 0 }},
43+
m_lucky = { atlas = "centers", pos = { x = 4, y = 1 }},
44+
m_cry_echo = { atlas = "cry_atlasenhanced", pos = { x = 1, y = 5 }},
45+
m_cry_light = { atlas = "cry_misc", pos = { x = 0, y = 3 }},
46+
},
47+
sticker = {
48+
order = 3,
49+
default = { atlas = "centers", pos = { x = 5, y = 2 } },
50+
eternal = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 2 } },
51+
perishable = { atlas = "cry_atlasenhanced", pos = { x = 0, y = 3 } },
52+
rental = { atlas = "cry_atlasenhanced", pos = { x = 1, y = 3 } },
53+
pinned = { atlas = "cry_atlasenhanced", pos = { x = 0, y = 5 } },
54+
banana = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 4 } },
55+
},
56+
suit = {
57+
order = 4,
58+
default = { atlas = "centers", pos = { x = 5, y = 2 } },
59+
Diamonds = { atlas = "cry_atlasenhanced", pos = { x = 2, y = 1 } },
60+
Hearts = { atlas = "cry_atlasenhanced", pos = { x = 3, y = 1 } },
61+
Spades = { atlas = "cry_atlasenhanced", pos = { x = 4, y = 1 } },
62+
Clubs = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 1 } },
63+
},
64+
seal = {
65+
order = 5,
66+
default = { atlas = "centers", pos = { x = 5, y = 2 } },
67+
Gold = { atlas = "centers", pos = { x = 1, y = 2 } },
68+
Red = { atlas = "centers", pos = { x = 0, y = 0 } },
69+
Blue = { atlas = "cry_atlasenhanced", pos = { x = 2, y = 2 } },
70+
Purple = { atlas = "cry_atlasenhanced", pos = { x = 1, y = 2 } },
71+
cry_azure = { atlas = "centers", pos = { x = 0, y = 2 } },
72+
cry_green = { atlas = "cry_atlasenhanced", pos = { x = 3, y = 5 } },
73+
},
74+
}
75+
76+
cry_edeck_atlas_update = function(self)
77+
local sprite = Cryptid.edeck_sprites[self.edeck_type]
78+
if not sprite then error(self.edeck_type) end
79+
local enh_info = {cry_get_enchanced_deck_info(self)}
80+
sprite = sprite[enh_info[sprite.order]] or sprite.default
81+
self.atlas, self.pos = sprite.atlas, sprite.pos
82+
return sprite
83+
end
884

985
local e_deck = {
1086
object_type = "Back",
@@ -37,7 +113,6 @@ local e_deck = {
37113
}))
38114
end
39115
}
40-
-- I set up some WIP tables for sprites here, will finish later
41116
local et_deck = {
42117
object_type = "Back",
43118
name = "cry-Enhancement Deck",
@@ -46,9 +121,6 @@ local et_deck = {
46121
pos = { x = 5, y = 2},
47122
edeck_type = "enhancement",
48123
config = {},
49-
sprites = {
50-
default = { atlas = "centers", pos = { x = 5, y = 2 } },
51-
},
52124
loc_vars = function(self, info_queue, center)
53125
local _, bbb = cry_get_enchanced_deck_info(self)
54126
return { vars = { localize{type = "name_text", set = "Enhanced", key = bbb} } }
@@ -65,10 +137,7 @@ local et_deck = {
65137
end,
66138
}))
67139
end,
68-
draw = function(self, card)
69-
-- Ensure atlas is up to date
70-
71-
end
140+
draw = cry_edeck_draw
72141
}
73142
local sk_deck = {
74143
object_type = "Back",
@@ -291,14 +360,15 @@ return {
291360
}
292361
local editions = {}
293362
for _, v in pairs(pool_table[center.edeck_type]) do
294-
if not v.no_edeck then
363+
if v.key ~= "e_base" and not v.no_edeck then
295364
editions[#editions + 1] = (center.edeck_type == "edition" and v.key:sub(3)) or v.key
296365
end
297366
end
298367

299368
for i = 1, #editions do
300369
local _center = cry_deep_copy(center)
301370
_center.config["cry_force_"..center.edeck_type] = editions[i]
371+
cry_edeck_atlas_update(_center)
302372
local card = create_generic_card(_center)
303373
card.edeck_select = editions[i]
304374
G.your_collection[1]:emplace(card)
@@ -324,5 +394,5 @@ return {
324394
end
325395
end,
326396
order = 1000000,
327-
items = {e_deck, et_deck, sk_deck, st_deck, sl_deck, atlasenhanced},
397+
items = {e_deck, et_deck, sk_deck, st_deck, sl_deck, atlasenhanced, atlasedition},
328398
}

items/misc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ local double_sided = {
10701070
weight = 10,
10711071
extra_cost = 0,
10721072
in_shop = true,
1073-
no_edeck = true,
1073+
no_edeck = true, --major lag issues even if draw_shader crashes are patched
10741074
sound = {
10751075
sound = "cry_e_double_sided",
10761076
per = 1,

lovely/enhanced.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ if currentBack.effect.config.cry_antimatter or currentBack.effect.config.cry_for
3939
self.children.back:draw_shader('negative', nil, self.ARGS.send_to_shader, true)
4040
self.children.center:draw_shader('negative_shine', nil, self.ARGS.send_to_shader, true)
4141
end
42-
--todo override for current run
4342
if currentBack.effect.center.edeck_type then
4443
local edition, enhancement, sticker, suit, seal = cry_get_enchanced_deck_info(currentBack)
44+
local sprite = cry_edeck_atlas_update(currentBack.effect.center)
45+
self.children.back.atlas = G.ASSET_ATLAS[sprite.atlas] or self.children.back.atlas
46+
self.children.back.sprite_pos = sprite.pos
47+
self.children.back:reset()
4548
if currentBack.effect.center.edeck_type == 'edition' then
4649
self.children.back:draw_shader(edition, nil, self.ARGS.send_to_shader, true)
4750
if edition == 'negative' then

0 commit comments

Comments
 (0)