#returning funcs
1 messages · Page 1 of 1 (latest)
working on this atm. give me a minute
@buoyant zinc do you use a loc file?
also you don't need to return the normal prob because it's a public variable accessible anywhere in your script
ok, found the issues
change one:
config = { [2;32mextra = {[0mretrigger_chance = 4, retriggers = 24 [2;32m}[0m},
change two:
return { vars = { [2;31mG.GAME.probabilities.normal,[0m [2;32mcard.ability.extra.retrigger_[0mchance, [2;32mcard.ability.extra.[0mretriggers } }
remove the red, add the green
@hazy girder this is honestly worse
...
loc_vars = function(self, info_queue)
info_queue[#info_queue + 1] = { key = "e_crp_four-dimensional", set = "Edition", config = { extra = { retrigger_chance = 4, retriggers = 24 } } }
return { vars = {} }
end,
...
SMODS.Edition {
disable_base_shader = true,
disable_shadow = true,
key = "four-dimensional",
weight = 0.2,
shader = "fourdimensional",
in_shop = true,
extra_cost = 5,
sound = {
sound = "crp_e_fourdimensional",
per = 1,
vol = 0.5,
},
get_weight = function(self)
return G.GAME.edition_rate * self.weight
end,
config = { extra = { retrigger_chance = 4, retriggers = 24 } },
loc_vars = function(self, info_queue, center)
local chance = center and center.edition and center.edition.retrigger_chance or lenient_bignum(self.config.retrigger_chance)
local retriggers = center and center.edition and center.edition.retriggers or lenient_bignum(self.config.retriggers)
return { vars = { card.ability.extra.retrigger_chance, card.ability.extra.retriggers } }
end,
calculate = function(self, card, context)
if
context.other_card == card
and (
(context.repetition and context.cardarea == G.play)
or (context.retrigger_joker_check and not context.retrigger_joker)
)
then
local should_retrigger = pseudorandom("crp_fourdimensional") <= G.GAME.probabilities.normal / lenient_bignum(self.config.retrigger_chance)
return {
message = localize("k_again_ex"),
repetitions = should_retrigger and lenient_bignum(self.config.retriggers) or 0,
card = card,
}
end
end,
crp_credits = {
idea = { "Glitchkat10" },
art = { "Glitchkat10" },
code = { "Glitchkat10" },
},
}
howdy
it's hard to tell what's happening since you have a loc file, but I'm going to assume the short of it is that you didn't change the variable usage in your loc_txt file, so I need to see that as well to make an informed response about how to fix this
ah sorry i didn’t tell you, but i fixed it earlier today
glad to hear it
yippee