Skip to content

Commit f826070

Browse files
Convert patch to SMODS api + Translucent bp compat
-made translucent joker bp compatible (for consistency with other selling_self bp compats) -converted lovely patch (epic)
1 parent cfabe6c commit f826070

File tree

3 files changed

+72
-46
lines changed

3 files changed

+72
-46
lines changed

items/epic.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ local membershipcardtwo = {
134134
demicoloncompat = true,
135135
atlas = "atlasepic",
136136
loc_vars = function(self, info_queue, card)
137+
local aaa
138+
if not Cryptid_config.HTTPS then
139+
if G.localization.descriptions.Other.cry_https_disabled then
140+
aaa = {}
141+
localize({ type = "other", key = "cry_https_disabled", nodes = aaa, vars = {} })
142+
aaa = aaa[1]
143+
end
144+
end
137145
return {
138146
key = Cryptid.gameset_loc(self, { modest = "balanced" }),
139147
vars = {
@@ -145,6 +153,7 @@ local membershipcardtwo = {
145153
)
146154
),
147155
},
156+
main_end = aaa,
148157
}
149158
end,
150159
calculate = function(self, card, context)

items/misc_joker.lua

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,18 @@ local blurred = {
22052205
blueprint_compat = true,
22062206
demicoloncompat = true,
22072207
loc_vars = function(self, info_queue, center)
2208-
return { vars = { math.min(center.ability.immutable.max_hand_size_mod, center.ability.extra.extra_hands) } }
2208+
local aaa
2209+
if next(SMODS.find_mod("sdm0sstuff")) then
2210+
if G.localization.descriptions.Other.blurred_sdm0 then
2211+
aaa = {}
2212+
localize({ type = "other", key = "blurred_sdm0", nodes = aaa, vars = {} })
2213+
aaa = aaa[1]
2214+
end
2215+
end
2216+
return {
2217+
vars = { math.min(center.ability.immutable.max_hand_size_mod, center.ability.extra.extra_hands) },
2218+
main_end = aaa,
2219+
}
22092220
end,
22102221
atlas = "atlastwo",
22112222
calculate = function(self, card, context)
@@ -8070,11 +8081,28 @@ local translucent = {
80708081
cost = 4,
80718082
order = 52,
80728083
immutable = true,
8084+
blueprint_compat = true,
80738085
eternal_compat = false,
80748086
demicoloncompat = true,
80758087
atlas = "atlasthree",
8088+
loc_vars = function(self, info_queue, card)
8089+
local aaa
8090+
if G.jokers then
8091+
for k, v in ipairs(G.jokers.cards) do
8092+
if (v.edition and v.edition.negative) and G.localization.descriptions.Other.remove_negative then
8093+
aaa = {}
8094+
localize({ type = "other", key = "remove_negative", nodes = aaa, vars = {} })
8095+
aaa = aaa[1]
8096+
break
8097+
end
8098+
end
8099+
end
8100+
return {
8101+
main_end = aaa,
8102+
}
8103+
end,
80768104
calculate = function(self, card, context)
8077-
if (context.selling_self and not (context.retrigger_joker or context.blueprint)) or context.forcetrigger then
8105+
if context.selling_self and not context.retrigger_joker or context.forcetrigger then
80788106
local jokers = {}
80798107
for i = 1, #G.jokers.cards do
80808108
if G.jokers.cards[i] ~= card and not G.jokers.cards[i].debuff then
@@ -8083,7 +8111,14 @@ local translucent = {
80838111
end
80848112
if #jokers > 0 then
80858113
if #G.jokers.cards <= G.jokers.config.card_limit then
8086-
card_eval_status_text(card, "extra", nil, nil, nil, { message = localize("k_duplicated_ex") })
8114+
card_eval_status_text(
8115+
context.blueprint_card or card,
8116+
"extra",
8117+
nil,
8118+
nil,
8119+
nil,
8120+
{ message = localize("k_duplicated_ex") }
8121+
)
80878122
local chosen_joker = pseudorandom_element(jokers, pseudoseed("trans"))
80888123
local _card =
80898124
copy_card(chosen_joker, nil, nil, nil, chosen_joker.edition and chosen_joker.edition.negative)
@@ -8094,10 +8129,24 @@ local translucent = {
80948129
G.jokers:emplace(_card)
80958130
return nil, true
80968131
else
8097-
card_eval_status_text(card, "extra", nil, nil, nil, { message = localize("k_no_room_ex") })
8132+
card_eval_status_text(
8133+
context.blueprint_card or card,
8134+
"extra",
8135+
nil,
8136+
nil,
8137+
nil,
8138+
{ message = localize("k_no_room_ex") }
8139+
)
80988140
end
80998141
else
8100-
card_eval_status_text(card, "extra", nil, nil, nil, { message = localize("k_no_other_jokers") })
8142+
card_eval_status_text(
8143+
context.blueprint_card or card,
8144+
"extra",
8145+
nil,
8146+
nil,
8147+
nil,
8148+
{ message = localize("k_no_other_jokers") }
8149+
)
81018150
end
81028151
end
81038152
end,
@@ -8206,11 +8255,20 @@ local membershipcard = {
82068255
demicoloncompat = true,
82078256
atlas = "atlasthree",
82088257
loc_vars = function(self, info_queue, card)
8258+
local aaa
8259+
if not Cryptid_config.HTTPS then
8260+
if G.localization.descriptions.Other.cry_https_disabled then
8261+
aaa = {}
8262+
localize({ type = "other", key = "cry_https_disabled", nodes = aaa, vars = {} })
8263+
aaa = aaa[1]
8264+
end
8265+
end
82098266
return {
82108267
vars = {
82118268
number_format(card.ability.extra.Xmult_mod),
82128269
number_format(lenient_bignum(to_big(card.ability.extra.Xmult_mod) * Cryptid.member_count)),
82138270
},
8271+
main_end = aaa,
82148272
}
82158273
end,
82168274
calculate = function(self, card, context)

lovely/lib_https.toml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,6 @@ if Cryptid.update_member_count then Cryptid.update_member_count() end
1515
'''
1616
match_indent = true
1717

18-
# notice if https is disabled (by default)
19-
# also does some other things since this is patching in the same spot (SDM0 easter egg)
20-
[[patches]]
21-
[patches.pattern]
22-
target = "functions/common_events.lua"
23-
pattern = "if _c.set == 'Other' then"
24-
position = "before"
25-
payload = '''
26-
if _c.name == 'cry-membershipcard' or _c.name == 'cry-membershipcardtwo' then
27-
if not Cryptid_config["HTTPS Module"] then
28-
if G.localization.descriptions.Other.cry_https_disabled then
29-
main_end = {}
30-
localize{type = 'other', key = 'cry_https_disabled', nodes = main_end, vars = {}}
31-
main_end = main_end[1]
32-
end
33-
end
34-
end
35-
if _c.name == 'cry-translucent Joker' then
36-
if G.jokers and G.jokers.cards then
37-
for k, v in ipairs(G.jokers.cards) do
38-
if (v.edition and v.edition.negative) and (G.localization.descriptions.Other.remove_negative)then
39-
main_end = {}
40-
localize{type = 'other', key = 'remove_negative', nodes = main_end, vars = {}}
41-
main_end = main_end[1]
42-
break
43-
end
44-
end
45-
end
46-
end
47-
if _c.name == 'cry-blurred Joker' then
48-
if (SMODS.Mods["sdm0sstuff"] or {}).can_load then
49-
if G.localization.descriptions.Other.blurred_sdm0 then
50-
main_end = {}
51-
localize{type = 'other', key = 'blurred_sdm0', nodes = main_end, vars = {}}
52-
main_end = main_end[1]
53-
end
54-
end
55-
end
56-
'''
57-
match_indent = true
58-
5918
# test
6019
[[patches]]
6120
[patches.pattern]

0 commit comments

Comments
 (0)