Skip to content

Commit 18ec1e5

Browse files
committed
demicolon logic
1 parent 4a1aa04 commit 18ec1e5

File tree

5 files changed

+74
-1
lines changed

5 files changed

+74
-1
lines changed

assets/1x/atlasepic.png

2.49 KB
Loading

assets/2x/atlasepic.png

3.18 KB
Loading

items/epic.lua

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,10 @@ local m = {
661661
return { vars = { center.ability.extra.extra, center.ability.extra.x_mult } }
662662
end,
663663
atlas = "atlasepic",
664+
force_context = {
665+
selling_card = true,
666+
card = { is_jolly = function(self) return true end},
667+
},
664668
calculate = function(self, card, context)
665669
if context.joker_main and (to_big(card.ability.extra.x_mult) > to_big(1)) then
666670
return {
@@ -683,7 +687,10 @@ local m = {
683687
{ message = localize({ type = "variable", key = "a_xmult", vars = { card.ability.extra.x_mult } }) }
684688
)
685689
end
686-
return nil, true
690+
return context.forced and {
691+
message = localize({ type = "variable", key = "a_xmult", vars = { card.ability.extra.x_mult } }),
692+
Xmult_mod = card.ability.extra.x_mult,
693+
} or nil, true
687694
end
688695
end,
689696
cry_credits = {
@@ -1901,6 +1908,51 @@ local jtron = {
19011908
code = { "candycanearter" },
19021909
},
19031910
}
1911+
1912+
local demicolon = {
1913+
object_type = "Joker",
1914+
dependencies = {
1915+
items = {
1916+
"set_cry_misc_joker",
1917+
},
1918+
},
1919+
name = "cry-Demicolon",
1920+
key = "demicolon",
1921+
pos = { x = 3, y = 5 },
1922+
order = -114,
1923+
atlas = "atlasepic",
1924+
rarity = "cry_epic",
1925+
cost = 17,
1926+
blueprint_compat = true,
1927+
calculate = function(self, card, context)
1928+
if context.joker_main then
1929+
for i = 1, #G.jokers.cards-1 do
1930+
if G.jokers.cards[i] == card then
1931+
if not Talisman.disable_anims then
1932+
G.E_MANAGER:add_event(Event({
1933+
func = function()
1934+
card:juice_up(0.5, 0.5)
1935+
return true
1936+
end,
1937+
}))
1938+
end
1939+
return nil, force_calculate(G.jokers.cards[i+1])
1940+
end
1941+
end
1942+
end
1943+
end,
1944+
cry_credits = {
1945+
idea = {
1946+
"HexaCryonic",
1947+
},
1948+
art = {
1949+
"HexaCryonic",
1950+
},
1951+
code = {
1952+
"Math",
1953+
},
1954+
},
1955+
}
19041956
return {
19051957
name = "Epic Jokers",
19061958
items = {
@@ -1928,5 +1980,6 @@ return {
19281980
fleshpanopticon,
19291981
spectrogram,
19301982
jtron,
1983+
demicolon,
19311984
},
19321985
}

lib/calculate.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,3 +905,16 @@ function compound_interest_scale_mod(self, orig_scale_scale, orig_scale_base, ne
905905
end
906906
end
907907
end
908+
909+
-- Forced joker triggering, used by Demicolon
910+
function force_calculate(card)
911+
local context = {}
912+
if card.config.center.force_context then
913+
context = card.config.center.force_context
914+
end
915+
context.forced = true
916+
local eval, post = eval_card(card, context)
917+
local effects = {eval}
918+
SMODS.trigger_effects(effects, card)
919+
return eval and true or post
920+
end

localization/en-us.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,13 @@ return {
12081208
"{C:inactive}(Currently {X:mult,C:white} X#2# {C:inactive} Mult)",
12091209
},
12101210
},
1211+
j_cry_demicolon = {
1212+
name = "Demicolon",
1213+
text = {
1214+
"Trigger the {C:attention}Joker{} to the right",
1215+
"{E:1}regardless of its usual conditions",
1216+
}
1217+
},
12111218
j_cry_delirious = {
12121219
name = "Delirious Joker",
12131220
text = {

0 commit comments

Comments
 (0)