diff --git a/localization/en-us.lua b/localization/en-us.lua index 7bb7ec3..60a74c3 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -13,7 +13,7 @@ return { name = "Pass GO Deck", text = { "Start with a {C:attention}Credit Card", - "Set money to {C:money}0$", + "Set money to {C:money}$0", "when entering the shop", }, }, @@ -87,12 +87,12 @@ return { }, j_Roland_estrogen = { name = "Estrogen", - text = {"{C:mult}+Chips{} Mult"}, + text = {"{C:mult}+(Chips/#1#){} Mult"}, }, j_Roland_hexagon = { name = "Hexagon", text = { - "Earn {C:money}#1#${} if", + "Earn {C:money}$#1#{} if", "played hand is a", "{C:attention}Four of a Kind", }, @@ -188,7 +188,7 @@ return { j_Roland_yard = { name = "Yard Sale", text = { - "Gain {C:money}#1#${} when a", + "Gain {C:money}$#1#{} when a", "card is {C:attention}removed", "from the deck", }, @@ -204,6 +204,39 @@ return { }, }, }, + Sleeve = { + sleeve_Roland_blossom = { + name = "Blossom Sleeve", + text = { + "{C:attention}Small{} and {C:attention}Big Blinds{} are", + "replaced with {C:attention}Boss Blinds", + "that are {C:dark_edition}debuffed #1# times", + }, + }, + sleeve_Roland_blossom_alt = { + name = "Efflorescent Sleeve", + text = { + "{C:attention}Blinds{} are {C:dark_edition}debuffed", + "{C:dark_edition}({X:dark_edition,C:white}ante{} {X:dark_edition,C:white}number{C:dark_edition}) times", + "{C:inactive}(Instead of #1#)", + }, + }, + sleeve_Roland_go = { + name = "Pass GO Sleeve", + text = { + "Start with a {C:attention}Credit Card", + "Set money to {C:money}$0", + "when entering the shop", + }, + }, + sleeve_Roland_go_alt = { + name = "Free Parking Sleeve", + text = { + "Start with an additional", + "{X:attention,C:white}#1#{C:attention} Credit Cards", + }, + }, + }, Spectral = { c_Roland_afterimage = { name = "Afterimage", diff --git a/manifest.json b/manifest.json index f3082b0..3bffcfd 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "priority": 5e-324, + "priority": -2, "id": "Roland", "name": "Roland", "prefix": "Roland", diff --git a/refs/CardSleeves b/refs/CardSleeves new file mode 120000 index 0000000..0619a3c --- /dev/null +++ b/refs/CardSleeves @@ -0,0 +1 @@ +../../CardSleeves/ \ No newline at end of file diff --git a/src/back.lua b/src/back.lua index 39be540..3cb9538 100644 --- a/src/back.lua +++ b/src/back.lua @@ -1,4 +1,54 @@ -local _, q = unpack(... or require "src.functional") +local f, q = unpack(... or require "src.functional") + +local function save(ret) + q(function() + save_run() + end) + + return ret +end + +local function back(b) + local key = b.key + local apply = b.apply + local calculate = b.calculate + + function b:apply(...) + return apply and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and save(apply(self, ...)) + end + + function b:calculate(...) + return calculate and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and calculate(self, ...) + end + + b.atlas = "void" + SMODS.Back(b) + + if not CardSleeves then + return + end + + CardSleeves.Sleeve { + key = key, + pos = b.pos, + atlas = "void", + config = b.config and f(b.config):into() or nil, + loc_vars = function(self, ...) + local ret = b.loc_vars and b.loc_vars(self, ...) or {} + ret.key = self:is_alt() and self.key .. "_alt" or self.key + return ret + end, + apply = function(self, ...) + return (b.alt_apply and self:is_alt() and b.alt_apply or apply)(self, ...) + end, + calculate = function(self, ...) + return (b.alt_calculate and self:is_alt() and b.alt_calculate or calculate)(self, ...) + end, + is_alt = function(self) + return self.get_current_deck_key() == "b_Roland_" .. key + end, + } +end -- SMODS.Atlas { -- key = "back", @@ -6,10 +56,9 @@ local _, q = unpack(... or require "src.functional") -- px = 71, -- py = 95, -- } -SMODS.Back { +back { key = "blossom", name = "Blossom", - atlas = "void", pos = {x = 0, y = 0}, config = {extra = {times = 2}}, loc_vars = function(self, _, _) @@ -17,7 +66,6 @@ SMODS.Back { end, apply = function(_, _) G.GAME.modifiers.Roland_blossom_deck = true - save_run() end, calculate = function(self, _, context) if not context.setting_blind then @@ -26,35 +74,47 @@ SMODS.Back { local blinds = G.GAME.round_resets.blind_states - if blinds.Small == "Current" or blinds.Big == "Current" then - q(function() - for _ = 1, self.config.extra.times do - G.GAME.blind:disable() - end + if blinds.Small ~= "Current" and blinds.Big ~= "Current" then + return + end - play_sound "timpani" - end) + local count = self:is_alt() and G.GAME.round_resets.ante or self.config.extra.times + + for _ = 1, count do + G.GAME.blind:disable() + + q { + delay = 0.4, + func = function() + G.GAME.blind:wiggle() + play_sound "timpani" + end, + } end end, } -SMODS.Back { +back { key = "go", name = "Go", - atlas = "void", pos = {x = 0, y = 0}, - apply = function(_, _) + config = {extra = {times = 1, alt_times = 5}}, + loc_vars = function(self, _, _) + return {vars = {self.config.extra.alt_times - self.config.extra.times}} + end, + apply = function(self) q(function() - local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_credit_card", "Roland_go") - card:add_to_deck() - card:start_materialize() - G.jokers:emplace(card) - save_run() + local count = self:is_alt() and self.config.extra.alt_times or self.config.extra.times + + for _ = 1, count do + local c = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_credit_card", "Roland_go") + c:add_to_deck() + c:start_materialize() + G.jokers:emplace(c) + end end) end, calculate = function(_, _, context) - if context.starting_shop then - ease_dollars(-G.GAME.dollars) - end + local _ = context.starting_shop and ease_dollars(-G.GAME.dollars) end, } diff --git a/src/charm.lua b/src/charm.lua index 1a12e65..ef71981 100644 --- a/src/charm.lua +++ b/src/charm.lua @@ -7,20 +7,30 @@ SMODS.Atlas { py = 68, } -Bakery_API.Charm { - key = "iphone", - atlas = "iphone", - pos = {x = 0, y = 0}, - calculate = function(_, _, context) - local _ = context.skip_blind and q(function() - G.round_eval = G.round_eval and G.round_eval:remove() - G.blind_select = G.blind_select and G.blind_select:remove() - G.blind_prompt_box = G.blind_prompt_box and G.blind_prompt_box:remove() - G.GAME.current_round.jokers_purchased = 0 - G.STATE = G.STATES.SHOP - G.GAME.shop_free = nil - G.GAME.shop_d6ed = nil - G.STATE_COMPLETE = false - end) - end, -} +q(function() + local current_mod = SMODS.current_mod + SMODS.current_mod = SMODS.Mods.Roland + + local charm = Bakery_API.Charm { + key = "iphone", + atlas = "iphone", + pos = {x = 0, y = 0}, + calculate = function(_, _, context) + local _ = context.skip_blind and q(function() + G.blind_prompt_box = G.blind_prompt_box and G.blind_prompt_box:remove() + G.blind_select = G.blind_select and G.blind_select:remove() + G.round_eval = G.round_eval and G.round_eval:remove() + G.GAME.current_round.jokers_purchased = 0 + G.STATE = G.STATES.SHOP + G.GAME.shop_free = nil + G.GAME.shop_d6ed = nil + G.STATE_COMPLETE = false + end) + end, + } + + charm:inject() + charm:process_loc_text() + SMODS._save_d_u(charm) + SMODS.current_mod = current_mod +end) diff --git a/src/joker.lua b/src/joker.lua index f0f7457..b5e4096 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -474,13 +474,17 @@ SMODS.Joker { atlas = "void", pronouns = "they_them", pos = {x = 0, y = 0}, + config = {extra = {division = 4}}, cost = 8, rarity = 3, eternal_compat = true, blueprint_compat = true, perishable_compat = true, - calculate = function(_, _, context) - return context.joker_main and {mult = hand_chips} or nil + loc_vars = function(_, _, card) + return {vars = {card.ability.extra.division}} + end, + calculate = function(_, card, context) + return context.joker_main and {mult = hand_chips / card.ability.extra.division} or nil end, } diff --git a/src/seal.lua b/src/seal.lua index 9e21ec5..cb221a0 100644 --- a/src/seal.lua +++ b/src/seal.lua @@ -40,7 +40,7 @@ SMODS.Seal { tag.ability.orbital_hand = pseudorandom_element( f(G.GAME.hands):filter(function(v) return v.visible - end):into(), + end):keys():into(), pseudoseed "Roland_glass" ) end diff --git a/src/spectral.lua b/src/spectral.lua index f6bbb02..ca952a3 100644 --- a/src/spectral.lua +++ b/src/spectral.lua @@ -69,27 +69,21 @@ SMODS.Consumable { return u() and #G.hand.cards > 0 end, use = function(_, card, _) - local banned_seals = {"Roland_glass"} - local cards = f(G.hand.cards, ipairs):into() pseudoshuffle(cards, pseudoseed "RolandDual") f(cards):take(card.ability.extra.amount):foreach(function(v) local seal - local function nq(s) - return s ~= seal - end - for _ = 1, 31 do seal = SMODS.poll_seal {guaranteed = true} - if f(banned_seals):all(nq) then + if seal ~= "Roland_glass" then break end end - v:set_seal(f(banned_seals):all(nq) and seal or "Red") + v:set_seal(seal == "Roland_glass" and "Red" or seal) end) end, }