Ban discarding effects

This commit is contained in:
Emik 2026-06-21 12:26:26 +02:00
parent 8b00262f22
commit 2086d386d8
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
3 changed files with 18 additions and 3 deletions

View file

@ -18,5 +18,5 @@
"conflicts": [
"Jen"
],
"version": "1.8.6"
"version": "1.8.7"
}

View file

@ -10,17 +10,31 @@ local rain_world_jokers = {
"j_jane_rot",
}
local is_rain_world_joker = {}
local is_rain_world_joker, survival = {}, {}
for _, v in pairs(rain_world_jokers) do
is_rain_world_joker[v] = true
end
Jane.q(function()
for gk, g in pairs(G.localization.descriptions) do
for ck, c in pairs((type(g) == "table" and not ({Back = true, Sleeve = true})[gk]) and g or {}) do
for _, text in pairs((type(c) == "table" and type(c.text) == "table" and G.P_CENTERS[ck]) and c.text or {}) do
if type(text) == "string" and (text:find("discard") or text:find("Discard")) then
survival[#survival + 1] = {id = ck}
break
end
end
end
end
end, nil, nil, nil, nil, false, true)
SMODS.Challenge {
key = "survival",
loc_txt = {name = "Survival"},
jokers = {{id = "j_jane_survivor"}},
rules = {modifiers = {{id = "discards", value = 0}}},
restrictions = {banned_cards = survival},
}
SMODS.Challenge {

View file

@ -199,13 +199,14 @@ function Jane.resize(card, mod)
end
end
function Jane.q(func, delay, timer, trigger, blockable, blocking)
function Jane.q(func, delay, timer, trigger, blockable, blocking, no_delete)
G.E_MANAGER:add_event(Event({
delay = delay,
timer = timer,
trigger = (delay and not trigger) and "after" or trigger,
blocking = blocking,
blockable = blockable,
no_delete = no_delete,
func = function(...)
local ret = func(...)
return ret == nil and true or ret