#returning funcs

1 messages · Page 1 of 1 (latest)

hazy girder
#

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 = { extra = {retrigger_chance = 4, retriggers = 24 }},

change two:

return { vars = { G.GAME.probabilities.normal, card.ability.extra.retrigger_chance, card.ability.extra.retriggers } }
#

remove the red, add the green

buoyant zinc
#

@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" },
    },
}
hazy girder
#

howdy

hazy girder
buoyant zinc
hazy girder
#

glad to hear it

buoyant zinc
#

yippee