From d15638243f8d2beb8ffd59fd7e1f7d9445939e66 Mon Sep 17 00:00:00 2001 From: Emik Date: Sun, 5 Jul 2026 04:59:25 +0200 Subject: [PATCH] Add unlock conditions for blind jokers --- localization/en-us.lua | 6 ++++++ manifest.json | 2 +- src/joker.lua | 22 +++++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/localization/en-us.lua b/localization/en-us.lua index 850e8a6..88caeef 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -138,6 +138,7 @@ return { "Moves before", "hand is played", }, + unlock = {"Defeat {C:attention}#1#"}, }, j_Roland_arctic = { name = "Arctic Circle", @@ -184,6 +185,7 @@ return { "All other {C:attention}Jokers {}cannot", "be selected or dragged", }, + unlock = {"Defeat {C:blue}#1#"}, }, j_Roland_crimson = { name = "Crimson Heart", @@ -192,6 +194,7 @@ return { "{C:red}Debuffs {C:attention}Joker", "to the left", }, + unlock = {"Defeat {C:red}#1#"}, }, j_Roland_domino = { name = "Domino", @@ -366,6 +369,7 @@ return { "{C:red}Debuffs {}the {C:attention}first", "{C:attention}#2# {}scored cards", }, + unlock = {"Defeat {C:green}#1#"}, }, j_Roland_violet = { name = "Violet Vessel", @@ -374,10 +378,12 @@ return { "but {X:mult,C:white}X#2#{} Mult", "{C:attention}before {}scoring", }, + unlock = {"Defeat {C:purple}#1#"}, }, j_Roland_venerable = { name = "Venerable Visage", text = {"{X:red,C:white}X#1#{} discards each round"}, + unlock = {"Defeat {C:dark_edition}#1#"}, }, j_Roland_yard = { name = "Yard Sale", diff --git a/manifest.json b/manifest.json index e2e6a44..5f0bd3f 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "Roland", "name": "Roland", "prefix": "Roland", - "version": "2.9.31", + "version": "2.9.32", "badge_colour": "8BE9FD", "display_name": "Roland", "main_file": "src/main.lua", diff --git a/src/joker.lua b/src/joker.lua index 393ec0d..423908d 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -22,7 +22,7 @@ local joker = (function() return ret end - ---@param tbl SMODS.Joker|{artist?: string, idea?: string, Bakery_can_use: (fun(self: self, card: Card): boolean?), Bakery_use_button_text: (fun(self: self, card: Card): string|table|nil), Bakery_use_joker: fun(self: self, card: Card), attributes?: Attributes[]} + ---@param tbl SMODS.Joker|{artist?: string, defeated_blind: string?, idea?: string, Bakery_can_use: (fun(self: self, card: Card): boolean?), Bakery_use_button_text: (fun(self: self, card: Card): string|table|nil), Bakery_use_joker: fun(self: self, card: Card), attributes?: Attributes[]} return function(tbl) tbl.pos = inc() tbl.atlas = "joker" @@ -34,6 +34,20 @@ local joker = (function() tbl.config.extra.back_pos = inc() end + if tbl.defeated_blind then + tbl.discovered, tbl.unlocked = false, false + + function tbl.check_for_unlock() + return Bakery_API.defeated_blinds[tbl.defeated_blind] > 0 + end + + function tbl.locked_loc_vars() + return G.P_BLINDS[tbl.defeated_blind].discovered and + {vars = {localize {type = "name_text", key = tbl.defeated_blind, set = "Blind"}}} or + {vars = {localize "k_unknown"}} + end + end + return q(SMODS.Joker(tbl)) end end)() @@ -579,6 +593,7 @@ joker { joker { key = "amber", pronouns = "they_them", + defeated_blind = "bl_final_acorn", config = {extra = {xmult = 3}}, pixel_size = {w = 68, h = 68}, attributes = {"xmult"}, @@ -626,6 +641,7 @@ joker { joker { key = "cerulean", pronouns = "she_her", + defeated_blind = "bl_final_bell", config = {extra = {xmult = 3}}, pixel_size = {w = 68, h = 68}, attributes = {"xmult"}, @@ -659,6 +675,7 @@ joker { joker { key = "crimson", pronouns = "she_her", + defeated_blind = "bl_final_heart", config = {extra = {xmult = 3}}, pixel_size = {w = 68, h = 68}, attributes = {"xmult"}, @@ -706,6 +723,7 @@ end joker { key = "verdant", pronouns = "she_her", + defeated_blind = "bl_final_leaf", config = {extra = {debuffs = 2, xmult = 3}}, pixel_size = {w = 68, h = 68}, attributes = {"xmult"}, @@ -756,6 +774,7 @@ end joker { key = "violet", pronouns = "she_they", + defeated_blind = "bl_final_vessel", idea = "hamester", config = {extra = {before = 0.1, xmult = 6}}, pixel_size = {w = 68, h = 68}, @@ -781,6 +800,7 @@ joker { joker { key = "venerable", pronouns = "any_all", + defeated_blind = "bl_Roland_venerable_visage", config = {extra = {xdiscard = 3}}, pixel_size = {w = 68, h = 68}, attributes = {"discard", "passive"},