diff --git a/lovely.toml b/lovely.toml index 78d439c..b354ae0 100644 --- a/lovely.toml +++ b/lovely.toml @@ -1,7 +1,7 @@ [manifest] version = "1.0.0" dump_lua = true -priority = 2147483647 +priority = 114 [[patches]] [patches.pattern] @@ -118,7 +118,7 @@ match_indent = true [[patches]] [patches.regex] target = "functions/state_events.lua" -pattern = '''hand_chips\*mult''' +pattern = '''hand_chips\*mult\)''' position = "at" -payload = "Jane.get_chipmult_sum(hand_chips, mult)" +payload = "Jane.get_chipmult_sum(hand_chips, mult))" match_indent = true diff --git a/manifest.json b/manifest.json index dade862..b940def 100644 --- a/manifest.json +++ b/manifest.json @@ -2,15 +2,15 @@ "id": "jane", "name": "Almighty", "author": ["jenwalter666", "Emik"], - "description": "Fork of Jen's almanac that focuses on only including the absolute best parts of the mod, and removing everything else.", + "description": "Fork of Jen's almanac that", "prefix": "jane", "main_file": "src/main.lua", "badge_colour": "3c3cff", - "priority": 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, + "priority": 114, "dependencies": [ "Steamodded (>=1.0.0~ALPHA-1304a)", "Bakery (>=0.1.26~*)" ], "conflicts": ["Jen"], - "version": "0.1.3" + "version": "0.1.4" } \ No newline at end of file diff --git a/src/joker.lua b/src/joker.lua index 5a20056..802ebd7 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -385,6 +385,48 @@ if Cryptid then Cryptid.aliases["oxy"] = "j_jane_oxy" end +local operator = Cryptid and "^" or "X" + +SMODS.Joker { + key = "betmma", + atlas = "janebetmma", + loc_txt = { + name = "Betmma", + text = { + "{X:dark_edition,C:chips}+" .. operator .. "#1#{C:chips} Chips{} for every", + "{C:attention}unique Voucher redeemed", + "{C:inactive}(Currently {X:dark_edition,C:chips}" .. operator .. "#2#{C:inactive})", + } + }, + config = {big_num_scaler = true, extra = {tet = Cryptid and 0.1 or 0.5}}, + pos = {x = 0, y = 0}, + soul_pos = {x = 1, y = 0}, + blueprint_compat = true, + cost = Cryptid and 20 or 8, + rarity = Cryptid and 4 or 3, + loc_vars = function(_, _, center) + return {vars = {center.ability.extra.tet, 1 + (voucher_count() * center.ability.extra.tet)}} + end, + calculate = function(_, card, context) + if not context.joker_main then + return + end + + local v = voucher_count() + + if v > 0 then + local num = 1 + (v * card.ability.extra.tet) + + return { + card = card, + colour = G.C.jane_RGB, + message = operator .. number_format(num), + [Cryptid and "Echips_mod" or "Xchips_mod"] = num, + }, true + end + end +} + SMODS.Joker { key = "7granddad", loc_txt = { @@ -476,48 +518,6 @@ SMODS.Joker { end } -local operator = Cryptid and "^" or "X" - -SMODS.Joker { - key = "betmma", - atlas = "janebetmma", - loc_txt = { - name = "Betmma", - text = { - "{X:dark_edition,C:chips}+" .. operator .. "#1#{C:chips} Chips{} for every", - "{C:attention}unique Voucher redeemed", - "{C:inactive}(Currently {X:dark_edition,C:chips}" .. operator .. "#2#{C:inactive})", - } - }, - config = {big_num_scaler = true, extra = {tet = Cryptid and 0.1 or 0.5}}, - pos = {x = 0, y = 0}, - soul_pos = {x = 1, y = 0}, - blueprint_compat = true, - cost = Cryptid and 20 or 8, - rarity = Cryptid and 4 or 3, - loc_vars = function(_, _, center) - return {vars = {center.ability.extra.tet, 1 + (voucher_count() * center.ability.extra.tet)}} - end, - calculate = function(_, card, context) - if not context.joker_main then - return - end - - local v = voucher_count() - - if v > 0 then - local num = 1 + (v * card.ability.extra.tet) - - return { - card = card, - colour = G.C.jane_RGB, - message = operator .. number_format(num), - [Cryptid and "Echips_mod" or "Xchips_mod"] = num, - }, true - end - end -} - SMODS.Joker { key = "peppino", atlas = "janepeppino", diff --git a/src/main.lua b/src/main.lua index f5910c1..aaf3292 100644 --- a/src/main.lua +++ b/src/main.lua @@ -14,7 +14,7 @@ if not Jane.misprintize then assert(SMODS.load_file("src/misprintize.lua"))() end -function Jane.canuse() +function Jane.can_use() return not (((G.play and #G.play.cards > 0) or (G.CONTROLLER.locked) or (G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and @@ -149,6 +149,11 @@ function Jane.get_operator() return math.max(math.min(G.GAME.operator, 3), 1) end +function Jane.get_small_chipmult_sum(chips, mult) + local ret = Jane.get_chipmult_sum() + return type(ret) == "table" and ret:to_number() or ret +end + function Jane.hidden(card) return G.GAME and not G.GAME.obsidian and diff --git a/src/slugcat.lua b/src/slugcat.lua index 069fa70..17426ab 100644 --- a/src/slugcat.lua +++ b/src/slugcat.lua @@ -39,30 +39,44 @@ SMODS.Joker { loc_txt = { name = "The Monk", text = { - "{C:attention}Retrigger{} scored cards", - "{C:attention} {}times", - "{C:inactive}(ex. 9 = 9 times, Ace = 11 times)", + "{C:attention}Retrigger {}scored", + "cards {C:attention}#1# time#2# {}if", + "hand contains {C:attention}#3#", + "or fewer card#4#", } }, + config = {extra = {retriggers = 2, requirement = 4}}, pos = {x = 0, y = 0}, soul_pos = {x = 1, y = 0}, cost = 20, rarity = 4, blueprint_compat = true, - calculate = function(_, card, context) - if context.repetition and - context.cardarea == G.play and - context.other_card and - context.other_card.ability.name ~= "Stone Card" then - local id = context.other_card:get_id() + loc_vars = function(_, _, card) + local extra = card.ability.extra + local retriggers = extra.retriggers + local requirement = extra.requirement - return { - message = localize("k_again_ex"), - repetitions = id == 14 and 11 or math.min(id, 10), - colour = G.C.ORANGE, - card = card - }, true + return {vars = { + retriggers, + retriggers == 1 and "" or "s", + requirement, + requirement == 1 and "" or "s" + }} + end, + calculate = function(_, card, context) + if not context.repetition or + context.cardarea ~= G.play or not + context.other_card or + #G.play.cards > card.ability.extra.requirement then + return end + + return { + message = localize("k_again_ex"), + repetitions = card.ability.extra.retriggers, + colour = G.C.ORANGE, + card = card + }, true end } @@ -84,7 +98,7 @@ SMODS.Joker { rarity = 4, } -local hunter = { 7, 5, 3, 2, 1 } +local hunter = {7, 5, 3, 2, 1} SMODS.Joker { key = "hunter", @@ -99,7 +113,7 @@ SMODS.Joker { "#4#{C:red}The Rot{} without rewards", } }, - config = {rounds_left = hunter[1]}, + config = {extra = {rounds_left = hunter[1]}}, pos = {x = 0, y = 0}, eternal_compat = false, soul_pos = {x = 1, y = 0}, @@ -110,7 +124,7 @@ SMODS.Joker { return " round" .. ((math.abs(amount) > 1 or math.abs(amount) == 0) and "s" or "") end - local rounds_left = card.ability.rounds_left + local rounds_left = card.ability.extra.rounds_left local sold = rounds_left - hunter[2] return {vars = { @@ -123,7 +137,7 @@ SMODS.Joker { update = function(_, card, _) if card.added_to_deck and card.children.center and card.children.floating_sprite then for k, v in ipairs(hunter) do - if card.ability.rounds_left <= v then + if card.ability.extra.rounds_left <= v then card.children.center:set_sprite_pos({x = 0, y = k - 1}) card.children.floating_sprite:set_sprite_pos({x = 1, y = k - 1}) else @@ -169,7 +183,7 @@ SMODS.Joker { return end - if context.selling_self and card.ability.rounds_left <= hunter[2] then + if context.selling_self and card.ability.extra.rounds_left <= hunter[2] then spawn_rot() elseif not context.individual and not context.repetition and not context.retrigger_joker then if G.GAME.round_resets.hands <= 0 then @@ -197,9 +211,9 @@ SMODS.Joker { end card.hunter_prep = nil - card.ability.rounds_left = card.ability.rounds_left - 1 - local rl = card.ability.rounds_left - Jane.card_status_text(card, tostring(card.ability.rounds_left), nil, nil, G.C.RED, nil, nil, nil, nil, nil, "generic1") + card.ability.extra.rounds_left = card.ability.extra.rounds_left - 1 + local rl = card.ability.extra.rounds_left + Jane.card_status_text(card, tostring(card.ability.extra.rounds_left), nil, nil, G.C.RED, nil, nil, nil, nil, nil, "generic1") if rl > hunter[2] then card:juice_up(0.6, 0.1) @@ -296,7 +310,7 @@ SMODS.Joker { rarity = exotic, Bakery_use_button_text = function(_, _) return "DESTROY" end, Bakery_can_use = function(_, card) - return not card.debuff and Jane.canuse() and next(G.hand.highlighted) + return not card.debuff and Jane.can_use() and next(G.hand.highlighted) end, Bakery_use_joker = function(_, _) for _, v in pairs(G.hand.highlighted) do diff --git a/src/spectral.lua b/src/spectral.lua index 714c12d..9eb8cbb 100644 --- a/src/spectral.lua +++ b/src/spectral.lua @@ -194,7 +194,7 @@ SMODS.Consumable { pos = {x = 0, y = 4}, cost = 4, can_use = function(_, _) - return Jane.canuse() and #((G.hand or {}).cards or {}) > 0 + return Jane.can_use() and #((G.hand or {}).cards or {}) > 0 end, use = function(_, card, _, _) G.E_MANAGER:add_event(Event({ @@ -230,7 +230,7 @@ SMODS.Consumable { loc_vars = function(self, info_queue, center) return {vars = {math.ceil(center.ability.extra.spectrals)}} end, - can_use = Jane.canuse, + can_use = Jane.can_use, use = function(_, card, _, _) conjure(card, 1) delay(0.6) @@ -259,7 +259,7 @@ SMODS.Consumable { loc_vars = function(_, _, center) return {vars = {((center.ability or {}).extra or {}).shadows or 2}} end, - can_use = Jane.canuse, + can_use = Jane.can_use, use = function(_, card, _, _) for _ = 1, card.ability.extra.shadows do local joker = create_card("Joker", G.jokers, nil, nil, nil, nil, nil, "phantom") @@ -327,7 +327,7 @@ SMODS.Consumable { math.ceil(#(G.playing_cards or {}) * center.ability.extra.destruction) }} end, - can_use = Jane.canuse, + can_use = Jane.can_use, use = function(_, _, _, _) Jane.q(function() for _, v in pairs(G.playing_cards) do diff --git a/src/tarot.lua b/src/tarot.lua index d97e24b..6b2cf3a 100644 --- a/src/tarot.lua +++ b/src/tarot.lua @@ -43,7 +43,7 @@ SMODS.Consumable { end, pos = {x = 0, y = 1}, cost = 3, - can_use = Jane.canuse, + can_use = Jane.can_use, use = function(_, _, _, _) local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_joker", "jokerfromatarot") card:set_edition({negative = true}, true) diff --git a/src/token.lua b/src/token.lua index e5d1e20..e897681 100644 --- a/src/token.lua +++ b/src/token.lua @@ -66,7 +66,7 @@ for _, v in pairs({ cost = v[5], can_stack = true, can_divide = true, - can_use = Jane.canuse, + can_use = Jane.can_use, in_pool = function (_, _) return G.GAME.used_vouchers.v_jane_token_voucher end,