Skip to content

Commit a55d0af

Browse files
committed
more jonklers
1 parent 1776f6d commit a55d0af

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

lib/calculate.lua

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,20 @@ function force_calculate(card)
912912
if not (context and context[1]) then
913913
return false
914914
end
915+
local trig
916+
if context[3] then
917+
trig = context[3]
918+
end
915919
if type(context[1]) == "function" then
916920
context = context[1](context[2] or {})
917921
else
918922
context = context[1]
919923
end
920924
context.forced = true
925+
temp = {}
926+
if trig then trig(true, temp, card) end
921927
local eval, post = eval_card(card, context)
928+
if trig then trig(false, temp, card) end
922929
local effects = { eval }
923930
SMODS.trigger_effects(effects, card)
924931
return eval and true or post
@@ -940,13 +947,17 @@ function __individual_play(t)
940947
return __context(t, { cardarea = G.play, individual = true })
941948
end
942949

950+
function __setting_blind(t)
951+
return __context(t, { setting_blind = true})
952+
end
953+
943954
function __poker_hand(t)
944955
return { poker_hands = { [t] = {"m"} } }
945956
end
946957

947958
__any_suit = { other_card = { is_suit = function(self) return true end } }
948959

949-
-- How these work: {constructor function, extra args}
960+
-- How these work: {constructor function, extra args, wrapper func}
950961
Cryptid.force_contexts = {
951962
-- Vanilla Jokers (collection order)
952963
-- Page 1
@@ -965,6 +976,43 @@ Cryptid.force_contexts = {
965976
j_clever = {__joker_main, __poker_hand("Two Pair")},
966977
j_devious = {__joker_main, __poker_hand("Straight")},
967978
j_crafty = {__joker_main, __poker_hand("Flush")},
979+
-- Page 2
980+
j_half = {__joker_main, { full_hand = {} }},
981+
j_stencil = {__joker_main},
982+
-- Four Fingers, Mime, Credit Card
983+
j_ceremonial = {__setting_blind}, --TODO: also trigger mult, acts janky with multiple triggers
984+
j_banner = {__joker_main},
985+
j_mystic_summit = {__joker_main, nil, function(trigger, memory)
986+
if trigger then
987+
memory.discards = G.GAME.current_round.discards_left
988+
G.GAME.current_round.discards_left = 0
989+
else
990+
G.GAME.current_round.discards_left = memory.discards
991+
end end
992+
},
993+
j_marble = {__context, nil, function(trigger, memory, _card) --Doesn't play nicely, redoing from scratch
994+
if trigger then
995+
local front = pseudorandom_element(G.P_CARDS, pseudoseed('marb_fr'))
996+
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
997+
local card = Card(G.discard.T.x + G.discard.T.w/2, G.discard.T.y, G.CARD_W, G.CARD_H, front, G.P_CENTERS.m_stone, {playing_card = G.playing_card})
998+
G.E_MANAGER:add_event(Event({
999+
func = function()
1000+
card:start_materialize({G.C.SECONDARY_SET.Enhanced})
1001+
G.deck:emplace(card)
1002+
table.insert(G.playing_cards, card)
1003+
return true
1004+
end}))
1005+
card_eval_status_text(_card, 'extra', nil, nil, nil, {message = localize('k_plus_stone'), colour = G.C.SECONDARY_SET.Enhanced})
1006+
1007+
G.E_MANAGER:add_event(Event({
1008+
func = function()
1009+
G.deck.config.card_limit = G.deck.config.card_limit + 1
1010+
return true
1011+
end}))
1012+
1013+
playing_card_joker_effects({card})
1014+
end end
1015+
},
9681016
-- Cryptid Jokers (alphabetical order probably?)
9691017
j_cry_demicolon = {__joker_main},
9701018
j_cry_m = {{ selling_card = true, card = {

0 commit comments

Comments
 (0)