Compare commits
No commits in common. "main" and "2.9.2" have entirely different histories.
4
.vscode/settings.json
vendored
|
|
@ -65,8 +65,4 @@
|
|||
"unused-local": "Error",
|
||||
"unused-vararg": "Error",
|
||||
},
|
||||
"Lua.runtime.version": "LuaJIT",
|
||||
"Lua.workspace.library": [
|
||||
"${3rd}/love2d/library"
|
||||
],
|
||||
}
|
||||
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
|
@ -1,6 +1,5 @@
|
|||
return {
|
||||
animated_icon = true,
|
||||
cool_phones = true,
|
||||
equinox_assist = false,
|
||||
faster_planets = false,
|
||||
harsh_ante_scaling = false,
|
||||
|
|
@ -8,5 +7,4 @@ return {
|
|||
import_funky = false,
|
||||
no_wild_debuff = true,
|
||||
scribable_basket = false,
|
||||
vitriol = true,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ return {
|
|||
text = {
|
||||
"{C:attention}Small{} and {C:attention}Big Blinds{} are",
|
||||
"replaced with {C:attention}Boss Blinds",
|
||||
"that are {C:dark_edition}debuffed twice",
|
||||
"",
|
||||
"{C:Bakery_credit_fg_Roland_bakersdozenbagels,s:0.75}Art: BakersDozenBagels",
|
||||
"that are {C:dark_edition}debuffed #1# times",
|
||||
},
|
||||
},
|
||||
b_Roland_swapper = {
|
||||
|
|
@ -16,14 +14,12 @@ return {
|
|||
text = {
|
||||
"{C:tarot}Tarot {}and {C:spectral}Spectral",
|
||||
"cards swap places",
|
||||
"",
|
||||
"{C:Bakery_credit_fg_Roland_bakersdozenbagels,s:0.75}Art: BakersDozenBagels",
|
||||
},
|
||||
},
|
||||
},
|
||||
BakeryCharm = {
|
||||
BakeryCharm_Roland_cocacola = {
|
||||
name = SMODS.Mods.Roland.config.cool_phones and "coca cola phone" or "Pentagram",
|
||||
name = "coca cola phone",
|
||||
text = {
|
||||
"{C:attention}Discard 0 cards {}to",
|
||||
"gain {C:red}#1# {}discards and",
|
||||
|
|
@ -32,7 +28,7 @@ return {
|
|||
},
|
||||
},
|
||||
BakeryCharm_Roland_fat = {
|
||||
name = SMODS.Mods.Roland.config.cool_phones and "fat i phone" or "Product",
|
||||
name = "fat i phone",
|
||||
text = {
|
||||
"{C:attention}+#1# Booster Pack {}slots",
|
||||
"All {C:attention}Booster Packs {}are {C:attention}Mega",
|
||||
|
|
@ -40,15 +36,15 @@ return {
|
|||
},
|
||||
},
|
||||
BakeryCharm_Roland_flexible = {
|
||||
name = SMODS.Mods.Roland.config.cool_phones and "flexi ble phone" or "Ring",
|
||||
name = "flexi ble phone",
|
||||
text = {unpack(G.localization.descriptions.Joker.j_ring_master.text)},
|
||||
},
|
||||
BakeryCharm_Roland_hand = {
|
||||
name = SMODS.Mods.Roland.config.cool_phones and "hand phone" or "Shell",
|
||||
name = "hand phone",
|
||||
text = {"{C:attention}+#1# {}hand size", "{C:blue}#2# {}hands"},
|
||||
},
|
||||
BakeryCharm_Roland_wii = {
|
||||
name = SMODS.Mods.Roland.config.cool_phones and "wii phone" or "Tire",
|
||||
name = "wii phone",
|
||||
text = {
|
||||
"Enter the shop",
|
||||
"when any {C:attention}Blind",
|
||||
|
|
@ -59,47 +55,39 @@ return {
|
|||
Blind = {
|
||||
bl_Roland_blizzard = {
|
||||
name = "The Blizzard",
|
||||
text = {"All cards", "are {C:dark_edition}Frozen"},
|
||||
text = {"All cards", "are Frozen"},
|
||||
},
|
||||
bl_Roland_divide = {
|
||||
name = "The Great Divide",
|
||||
text = {"Half of the deck", "is {C:red}discarded"},
|
||||
text = {"Half of the deck", "is discarded"},
|
||||
},
|
||||
bl_Roland_equinox = {
|
||||
name = "The Equinox",
|
||||
text = {"{C:inactive}No UI"},
|
||||
text = {"No UI"},
|
||||
},
|
||||
bl_Roland_falseshuffle = {
|
||||
name = "The False Shuffle",
|
||||
text = {"{C:enhanced}Enhanced {}cards", "are drawn {C:attention}last"},
|
||||
text = {"Enhanced cards", "are drawn last"},
|
||||
},
|
||||
bl_Roland_improbable = {
|
||||
name = "The Improbable",
|
||||
text = {"All {C:green}probabilities", "cannot happen"},
|
||||
text = {"All probabilities", "cannot happen"},
|
||||
},
|
||||
bl_Roland_mitotic = {
|
||||
name = "The Mitotic",
|
||||
text = {"{C:red}Discarded {}cards", "are {C:attention}copied"},
|
||||
text = {"Discarded cards", "are copied"},
|
||||
},
|
||||
bl_Roland_nimble = {
|
||||
name = "The Nimble",
|
||||
text = {"The {C:attention}first 5 {}cards", "drawn are {C:blue}played"},
|
||||
text = {"The first 5 cards", "drawn are played"},
|
||||
},
|
||||
bl_Roland_tranquilizer = {
|
||||
name = "The Tranquilizer",
|
||||
text = {
|
||||
"{C:attention}#1#s {}are {C:red}debuffed",
|
||||
"Changes based on",
|
||||
"most common rank",
|
||||
},
|
||||
text = {"#1#s are debuffed", "Changes based on", "most common rank"},
|
||||
},
|
||||
bl_Roland_venerable_visage = {
|
||||
name = "Venerable Visage",
|
||||
text = {
|
||||
"Infinite {C:red}discards",
|
||||
"Lose if {C:attention}any {}card was",
|
||||
"not {C:blue}played {}or {C:red}discarded",
|
||||
},
|
||||
text = {"Infinite discards", "Lose if any card was", "not played or discarded"},
|
||||
fail = {
|
||||
"Blasphemy.",
|
||||
"Blunder.",
|
||||
|
|
@ -338,7 +326,7 @@ return {
|
|||
text = {
|
||||
"Sell this Joker to",
|
||||
"{C:attention}draw{} the bottom",
|
||||
"card of the deck",
|
||||
"card of the {C:hand}deck",
|
||||
"{C:inactive}(Currently {V:1}#1#{C:inactive}#2#{V:2}#3#{C:inactive})",
|
||||
},
|
||||
},
|
||||
|
|
@ -404,18 +392,15 @@ return {
|
|||
text = {
|
||||
"{C:attention}Small{} and {C:attention}Big Blinds{} are",
|
||||
"replaced with {C:attention}Boss Blinds",
|
||||
"that are {C:dark_edition}debuffed twice",
|
||||
"",
|
||||
"{C:Bakery_credit_fg_Roland_bakersdozenbagels,s:0.75}Art: BakersDozenBagels",
|
||||
"that are {C:dark_edition}debuffed #1# times",
|
||||
},
|
||||
},
|
||||
sleeve_Roland_blossom_alt = {
|
||||
name = "Efflorescent Sleeve",
|
||||
text = {
|
||||
"{C:dark_edition}Debuff {X:dark_edition,C:white}#1#X<ante>{C:dark_edition} times",
|
||||
"{C:inactive}(Instead of twice)",
|
||||
"",
|
||||
"{C:Bakery_credit_fg_Roland_bakersdozenbagels,s:0.75}Art: BakersDozenBagels",
|
||||
"{C:attention}Blinds{} are {C:dark_edition}debuffed",
|
||||
"{C:dark_edition}({X:dark_edition,C:white}(ante * #2#){C:dark_edition}) times",
|
||||
"{C:inactive}(Instead of #1#)",
|
||||
},
|
||||
},
|
||||
sleeve_Roland_swapper = {
|
||||
|
|
@ -423,16 +408,13 @@ return {
|
|||
text = {
|
||||
"{C:tarot}Tarot {}and {C:spectral}Spectral",
|
||||
"cards swap places",
|
||||
"",
|
||||
"{C:Bakery_credit_fg_Roland_bakersdozenbagels,s:0.75}Art: BakersDozenBagels",
|
||||
},
|
||||
},
|
||||
sleeve_Roland_swapper_alt = {
|
||||
name = "Sleeve Swapper",
|
||||
text = {
|
||||
"Swap {C:attention}all {}consumables",
|
||||
"",
|
||||
"{C:Bakery_credit_fg_Roland_bakersdozenbagels,s:0.75}Art: BakersDozenBagels",
|
||||
"{C:attention}All {}consumable",
|
||||
"types swap places",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -442,7 +424,7 @@ return {
|
|||
text = {
|
||||
"Add random seals",
|
||||
"to {C:attention}#1#{} random",
|
||||
"cards in hand",
|
||||
"cards in {C:hands}hand",
|
||||
},
|
||||
},
|
||||
c_Roland_primal = {
|
||||
|
|
@ -458,7 +440,7 @@ return {
|
|||
text = {
|
||||
"Add a {C:dark_edition}Glass Seal",
|
||||
"to {C:attention}#1#{} selected",
|
||||
"cards in hand",
|
||||
"cards in {C:hands}hand",
|
||||
},
|
||||
},
|
||||
c_Roland_void = {
|
||||
|
|
@ -495,22 +477,6 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
Voucher = {
|
||||
v_Roland_ceres = {
|
||||
name = "Ceres",
|
||||
text = {
|
||||
"Level up {C:attention}Flush House",
|
||||
"by {C:attention}#1# {}when it is played",
|
||||
},
|
||||
},
|
||||
v_Roland_neptune = {
|
||||
name = "Neptune",
|
||||
text = {
|
||||
"Level up {C:attention}Straight Flush",
|
||||
"by {C:attention}#1# {}when it is played",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
misc = {
|
||||
challenge_names = {
|
||||
|
|
@ -530,7 +496,6 @@ return {
|
|||
b_Roland_animated_icon = "Animated Icon (requires restart)",
|
||||
b_Roland_bye = "Bye!",
|
||||
b_Roland_comma = ", ",
|
||||
b_Roland_cool_phones = "cool phones (requires restart)",
|
||||
b_Roland_debuffed = "DEBUFFED",
|
||||
b_Roland_disabled = "Disabled",
|
||||
b_Roland_enabled = "Enabled",
|
||||
|
|
@ -542,13 +507,12 @@ return {
|
|||
b_Roland_harsh_ante_scaling = "Harsh ante scaling (Ante 40+)",
|
||||
b_Roland_illusion_seal = "Allow seals from Illusion voucher",
|
||||
b_Roland_import_funky = "Debug: Import funky.lua",
|
||||
b_Roland_most_common_card = "Rank",
|
||||
b_Roland_most_common_card = "(Rank)",
|
||||
b_Roland_no_wild_debuff = "No wild card debuffs",
|
||||
b_Roland_na = "N/A",
|
||||
b_Roland_of = " of ",
|
||||
b_Roland_toggle = "TOGGLE",
|
||||
b_Roland_unassigned = "(Unassigned)",
|
||||
b_Roland_vitriol = "Vitriol (Venerable Visage)",
|
||||
},
|
||||
labels = {
|
||||
Roland_frozen = "Frozen",
|
||||
|
|
@ -561,7 +525,7 @@ return {
|
|||
ch_c_Roland_Eternally_Verdant = {"{C:attention}Verdant Leaf{}'s effect is active every blind"},
|
||||
ch_c_Roland_Eternally_Violet = {"{C:attention}Violet Vessel{}'s effect is active every blind"},
|
||||
ch_c_Roland_Glass1 = {"Played cards with no seal have a"},
|
||||
ch_c_Roland_Glass2 = {"{C:green}1 in 2{} chance to gain {C:dark_edition}Glass Seal"},
|
||||
ch_c_Roland_Glass2 = {"{C:green}1 in 4{} chance to gain {C:dark_edition}Glass Seal"},
|
||||
ch_c_Roland_Go = {"Set money to {C:money}$0 {}when entering the shop"},
|
||||
ch_c_Roland_Jokerful = {"The only jokers are {C:mult}Joker{} and {C:chips}Ms. Joker"},
|
||||
ch_c_Roland_Pastries = {"All blinds, cards, and tags are of {C:gold}Bakery{} or {C:blue}Roland"},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"id": "Roland",
|
||||
"name": "Roland",
|
||||
"prefix": "Roland",
|
||||
"version": "2.9.28",
|
||||
"version": "2.9.2",
|
||||
"badge_colour": "8BE9FD",
|
||||
"display_name": "Roland",
|
||||
"main_file": "src/main.lua",
|
||||
|
|
|
|||
47
src/back.lua
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
local function save(ret)
|
||||
q(save_run)
|
||||
|
|
@ -8,7 +8,7 @@ end
|
|||
local back = (function()
|
||||
local x = 0
|
||||
|
||||
---@param tbl SMODS.Back|{is_alt: (fun(self: self): boolean), alt_apply?: fun(self: SMODS.Back|table, back: Back|table), alt_calculate?: fun(self: SMODS.Back|table, back: Back|table, context: CalcContext|table): table?, boolean?}
|
||||
---@param tbl SMODS.Back|{artist?: string, is_alt: function, alt_apply?: fun(self: SMODS.Back|table, back: Back|table), alt_calculate?: fun(self: SMODS.Back|table, back: Back|table, context: CalcContext|table): table?, boolean?}
|
||||
return function(tbl)
|
||||
local key = tbl.key
|
||||
local apply = tbl.apply
|
||||
|
|
@ -22,16 +22,34 @@ local back = (function()
|
|||
return (calculate and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key) and calculate(self, ...) or nil
|
||||
end
|
||||
|
||||
tbl.artist = tbl.artist and "Roland_" .. tbl.artist or nil
|
||||
tbl.pos = {x = x, y = 0}
|
||||
tbl.is_alt = f.fals
|
||||
tbl.atlas = "back"
|
||||
x = x + 1
|
||||
local back = q(SMODS.Back(tbl))
|
||||
|
||||
local _ = CardSleeves and CardSleeves.Sleeve {
|
||||
-- This API intends that you share the same functions for apply/calculate,
|
||||
-- meaning that this may be called to check if a deck/sleeve combo is used even
|
||||
-- when we are from the deck context. We add this to prevent accidental calls to nil.
|
||||
function tbl:is_alt()
|
||||
return false
|
||||
end
|
||||
|
||||
local sleeve = (_G["CardSleeves"] or {}).Sleeve
|
||||
local b = SMODS.Back(tbl)
|
||||
x = x + 1
|
||||
|
||||
q(function()
|
||||
Bakery_API.credit(b)
|
||||
end)
|
||||
|
||||
if not sleeve then
|
||||
return b
|
||||
end
|
||||
|
||||
local s = sleeve {
|
||||
key = key,
|
||||
pos = tbl.pos,
|
||||
atlas = "sleeve",
|
||||
artist = tbl.artist,
|
||||
config = tbl.config and f(tbl.config):table() or nil,
|
||||
loc_vars = function(self, ...)
|
||||
local ret = tbl.loc_vars and tbl.loc_vars(self, ...) or {}
|
||||
|
|
@ -49,7 +67,11 @@ local back = (function()
|
|||
end,
|
||||
}
|
||||
|
||||
return back
|
||||
q(function()
|
||||
Bakery_API.credit(s)
|
||||
end)
|
||||
|
||||
return b
|
||||
end
|
||||
end)()
|
||||
|
||||
|
|
@ -60,7 +82,7 @@ SMODS.Atlas {
|
|||
py = 95,
|
||||
}
|
||||
|
||||
local _ = CardSleeves and SMODS.Atlas {
|
||||
local _ = _G["CardSleeves"] and SMODS.Atlas {
|
||||
key = "sleeve",
|
||||
path = "sleeve.png",
|
||||
px = 73,
|
||||
|
|
@ -70,10 +92,11 @@ local _ = CardSleeves and SMODS.Atlas {
|
|||
back {
|
||||
key = "blossom",
|
||||
pronouns = "any_all",
|
||||
artist = "bakersdozenbagels",
|
||||
config = {extra = {alt_times = 4, times = 2}},
|
||||
attributes = {"boss_blind"},
|
||||
loc_vars = function(self, _, _)
|
||||
return {vars = {self.config.extra.alt_times}}
|
||||
return {vars = {self.config.extra.times, self.config.extra.alt_times}}
|
||||
end,
|
||||
apply = function(_, _)
|
||||
G.GAME.modifiers.Roland_blossom_deck = true
|
||||
|
|
@ -93,13 +116,12 @@ back {
|
|||
G.GAME.round_resets.ante * self.config.extra.alt_times or
|
||||
self.config.extra.times
|
||||
|
||||
f(count):each(function(i)
|
||||
local _ = i == 1 and G.GAME.blind:disable()
|
||||
f(count):each(function()
|
||||
G.GAME.blind:disable()
|
||||
|
||||
q {
|
||||
delay = 0.4,
|
||||
func = function()
|
||||
local _ = i ~= 1 and G.GAME.blind:disable()
|
||||
SMODS.calculate_effect({message = localize "ph_boss_disabled"}, card)
|
||||
G.GAME.blind:wiggle()
|
||||
play_sound "timpani"
|
||||
|
|
@ -112,6 +134,7 @@ back {
|
|||
back {
|
||||
key = "swapper",
|
||||
pronouns = "he_him",
|
||||
artist = "bakersdozenbagels",
|
||||
attributes = {"spectral", "tarot"},
|
||||
apply = function(self)
|
||||
local modifiers = G.GAME.modifiers
|
||||
|
|
|
|||
145
src/blind.lua
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
local blind = (function()
|
||||
local y = 0
|
||||
|
|
@ -6,11 +6,17 @@ local blind = (function()
|
|||
---@param tbl SMODS.Blind|{idea?: string}
|
||||
---@return SMODS.Blind
|
||||
return function(tbl)
|
||||
tbl.idea = tbl.idea and "Roland_" .. tbl.idea or nil
|
||||
tbl.pos = {x = 0, y = y}
|
||||
tbl.atlas = "blind"
|
||||
tbl.idea = tbl.idea and "Roland_" .. tbl.idea or nil
|
||||
local blind = SMODS.Blind(tbl)
|
||||
y = y + 1
|
||||
return q(SMODS.Blind(tbl))
|
||||
|
||||
q(function()
|
||||
Bakery_API.credit(blind)
|
||||
end)
|
||||
|
||||
return blind
|
||||
end
|
||||
end)()
|
||||
|
||||
|
|
@ -23,7 +29,10 @@ SMODS.Atlas {
|
|||
atlas_table = "ANIMATION_ATLAS",
|
||||
}
|
||||
|
||||
SMODS.Sound {key = "kick", path = "kick.ogg"}
|
||||
SMODS.Sound {
|
||||
key = "kick",
|
||||
path = "kick.ogg",
|
||||
}
|
||||
|
||||
local function common_rank()
|
||||
local tally, to_name = {}, {}
|
||||
|
|
@ -52,7 +61,7 @@ end
|
|||
|
||||
local function has_enhancement(card)
|
||||
local e = SMODS.get_enhancements(card)
|
||||
return e and next(e)
|
||||
return not not (e and next(e))
|
||||
end
|
||||
|
||||
local function set_freeze(state)
|
||||
|
|
@ -174,7 +183,13 @@ blind {
|
|||
pronouns = "he_they",
|
||||
disable = function()
|
||||
-- Ensures that this runs after 'set_blind' since it also gets added to queue.
|
||||
q {delay = 0.8, trigger = "after", func = G.FUNCS.draw_from_discard_to_deck}
|
||||
q {
|
||||
delay = 0.8,
|
||||
trigger = "after",
|
||||
func = function()
|
||||
G.FUNCS.draw_from_discard_to_deck()
|
||||
end,
|
||||
}
|
||||
end,
|
||||
set_blind = function()
|
||||
-- Allows the background to ease in first before drawing cards.
|
||||
|
|
@ -239,16 +254,16 @@ blind {
|
|||
disable = function(self)
|
||||
self:defeat()
|
||||
end,
|
||||
calculate = function(self, b, context)
|
||||
return not b.disabled and
|
||||
context.hand_drawn and
|
||||
self.cards()
|
||||
calculate = function(self, b)
|
||||
return not b.disabled and self.cards()
|
||||
:where("Roland_blizzard", false)
|
||||
:where("facing", "front")
|
||||
:each(set_freeze(true)) or nil
|
||||
end,
|
||||
cards = function()
|
||||
return f(G):where(getmetatable, CardArea):flatmap("cards", ipairs)
|
||||
return f(G):where(function(v)
|
||||
return type(v) == "table" and type(v.cards) == "table"
|
||||
end):flatmap("cards", ipairs)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -334,32 +349,8 @@ end
|
|||
|
||||
function SMODS.current_mod:calculate(context)
|
||||
local _ = type(G.calccontext) == "function" and G.calccontext(context)
|
||||
|
||||
if type(G.calc) == "function" then
|
||||
G.calc = {G.calc}
|
||||
end
|
||||
|
||||
if type(G.calc) == "table" then
|
||||
local str
|
||||
|
||||
f(context):keys():map(f.index_into(G.calc)):where(type, "function"):each(function(v)
|
||||
str = str or f(context):keys():string()
|
||||
v(str)
|
||||
end)
|
||||
|
||||
local _ = not str and type(G.calc[1]) == "function" and G.calc[1](f(context):keys():string())
|
||||
end
|
||||
|
||||
local _ = context.before and
|
||||
f {"v_Roland_ceres", "v_Roland_neptune"}
|
||||
:where(f.index_into(G.GAME.used_vouchers))
|
||||
:map(f.index_into(G.P_CENTERS))
|
||||
:where("config.extra.hand_type", context.scoring_name)
|
||||
:pun "SMODS.Voucher"
|
||||
:each(function(v, _)
|
||||
SMODS.smart_level_up_hand(nil, v.config.extra.hand_type, nil, v.config.extra.amount)
|
||||
end)
|
||||
|
||||
local _ = type(G.calckeys) == "function" and G.calckeys(f(context):keys())
|
||||
local _ = type(G.calc) == "function" and G.calc(f(context):keys():string())
|
||||
local improbable, orig = G.GAME.modifiers.Roland_improbable, G.GAME.probabilities
|
||||
|
||||
local _ = context.end_of_round and
|
||||
|
|
@ -481,31 +472,15 @@ local venerable_visage = blind {
|
|||
}
|
||||
end,
|
||||
vitriol = function(b)
|
||||
local vitriol = SMODS.Mods.Roland.config.vitriol
|
||||
local resize_to_w, resize_to_h = 320, 200
|
||||
local is_fullscreen = love.window.getFullscreen()
|
||||
|
||||
if vitriol then
|
||||
love.window.setFullscreen(false)
|
||||
delay(1.5)
|
||||
end
|
||||
|
||||
local function jitter()
|
||||
local x, y = love.window.getDesktopDimensions()
|
||||
|
||||
return pseudorandom(pseudoseed "RolandVenerableVisageX", 0, x) - x / 2,
|
||||
pseudorandom(pseudoseed "RolandVenerableVisageY", 0, y) - y / 2
|
||||
end
|
||||
|
||||
if type(b) == "table" and type(b.wiggle) == "function" then
|
||||
b:wiggle()
|
||||
end
|
||||
|
||||
f(G.playing_cards):each(function(v, k)
|
||||
return v.area ~= G.hand and draw_card(v.area, G.hand, k * 100 / #G.playing_cards, "up", true, v)
|
||||
end)
|
||||
|
||||
local fail = G.localization.descriptions.Blind.bl_Roland_venerable_visage.fail
|
||||
local speed = 0.1
|
||||
|
||||
SMODS.draw_cards(#G.deck.cards)
|
||||
play_sound("gong", 0.6)
|
||||
|
||||
attention_text {
|
||||
text = pseudorandom_element(fail, pseudoseed "RolandVenerableVisage"),
|
||||
|
|
@ -515,50 +490,46 @@ local venerable_visage = blind {
|
|||
hold = 2,
|
||||
}
|
||||
|
||||
f {0.15, 0.3, 0.45, 0.6}:each(function(v)
|
||||
play_sound("gong", v)
|
||||
end)
|
||||
delay(1)
|
||||
|
||||
---@type number, number, table
|
||||
local w, h, flags = love.window.getMode()
|
||||
local len = #G.playing_cards
|
||||
|
||||
if vitriol then
|
||||
love.window.setMode(resize_to_w, resize_to_h)
|
||||
love.resize(resize_to_w, resize_to_h)
|
||||
end
|
||||
|
||||
local x, y = love.window.getPosition()
|
||||
|
||||
f(G.playing_cards):each(function(v, i)
|
||||
f(G.playing_cards):each(function(v)
|
||||
q {
|
||||
trigger = "before",
|
||||
delay = 6 / len,
|
||||
delay = speed,
|
||||
func = function()
|
||||
if vitriol then
|
||||
local x_random, y_random = jitter()
|
||||
love.window.setPosition(x + x_random * i / len, y + y_random * i / len)
|
||||
end
|
||||
|
||||
v:start_dissolve()
|
||||
v:shatter()
|
||||
b:wiggle()
|
||||
end,
|
||||
}
|
||||
end)
|
||||
|
||||
local _ = vitriol and q {
|
||||
trigger = "before",
|
||||
delay = 1.5,
|
||||
delay(1)
|
||||
|
||||
f(G.P_CARDS):each(function(v)
|
||||
q {
|
||||
delay = speed,
|
||||
func = function()
|
||||
love.window.setPosition(x, y)
|
||||
love.window.setMode(w, h, flags)
|
||||
love.resize(w, h)
|
||||
love.window.setFullscreen(is_fullscreen)
|
||||
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
|
||||
|
||||
local card = Card(
|
||||
b and b.T.x or 0,
|
||||
b and b.T.y or 0,
|
||||
G.CARD_W,
|
||||
G.CARD_H,
|
||||
v,
|
||||
G.P_CENTERS.m_Bakery_Curse or G.P_CENTERS.c_base,
|
||||
{playing_card = G.playing_card}
|
||||
)
|
||||
|
||||
table.insert(G.playing_cards, card)
|
||||
G.deck:emplace(card)
|
||||
play_sound "card1"
|
||||
card:add_to_deck()
|
||||
end,
|
||||
}
|
||||
end)
|
||||
|
||||
delay(1.5)
|
||||
delay(1)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
local function bans()
|
||||
return {banned_cards = {}, banned_tags = {}, banned_other = {}}
|
||||
|
|
@ -46,7 +46,7 @@ SMODS.Challenge {
|
|||
key = "Glass",
|
||||
rules = {custom = {{id = "Roland_Glass1"}, {id = "Roland_Glass2"}}},
|
||||
pronouns = "they_them",
|
||||
config = {extra = {odds = 2}},
|
||||
config = {extra = {odds = 4}},
|
||||
calculate = function(self, context)
|
||||
if not context.after or context.blueprint_card then
|
||||
return
|
||||
|
|
@ -110,10 +110,12 @@ SMODS.Challenge {
|
|||
pronouns = "she_them",
|
||||
}
|
||||
|
||||
local starting_jokers = f(5):map(f.const {id = "j_joker"}):table()
|
||||
|
||||
SMODS.Challenge {
|
||||
key = "Eternally_Amber",
|
||||
rules = {custom = {{id = "Roland_Eternally_Amber"}, {id = "Roland_Showdown_Amber"}}},
|
||||
jokers = {{id = "j_Roland_amber"}},
|
||||
jokers = starting_jokers,
|
||||
restrictions = amber,
|
||||
pronouns = "they_them",
|
||||
calculate = function(_, context)
|
||||
|
|
@ -152,7 +154,7 @@ SMODS.Challenge {
|
|||
SMODS.Challenge {
|
||||
key = "Eternally_Cerulean",
|
||||
rules = {custom = {{id = "Roland_Eternally_Cerulean"}, {id = "Roland_Showdown_Cerulean"}}},
|
||||
jokers = {{id = "j_Roland_cerulean"}},
|
||||
jokers = starting_jokers,
|
||||
restrictions = cerulean,
|
||||
pronouns = "she_her",
|
||||
calculate = function(_, context)
|
||||
|
|
@ -179,7 +181,7 @@ SMODS.Challenge {
|
|||
SMODS.Challenge {
|
||||
key = "Eternally_Crimson",
|
||||
rules = {custom = {{id = "Roland_Eternally_Crimson"}, {id = "Roland_Showdown_Crimson"}}},
|
||||
jokers = {{id = "j_Roland_crimson"}},
|
||||
jokers = starting_jokers,
|
||||
restrictions = crimson,
|
||||
pronouns = "she_her",
|
||||
calculate = function(_, context)
|
||||
|
|
@ -188,7 +190,7 @@ SMODS.Challenge {
|
|||
end)
|
||||
|
||||
local mod = G.GAME.modifiers
|
||||
mod.Roland_Eternally_Crimson = context.setting_blind and true or mod.Roland_Eternally_Crimson
|
||||
mod.Roland_Eternally_Crimson = not context.setting_blind and mod.Roland_Eternally_Crimson or nil
|
||||
local debuff = context.debuff_card
|
||||
local cards = G.jokers.cards
|
||||
|
||||
|
|
@ -239,7 +241,7 @@ SMODS.Challenge {
|
|||
SMODS.Challenge {
|
||||
key = "Eternally_Verdant",
|
||||
rules = {custom = {{id = "Roland_Eternally_Verdant"}, {id = "Roland_Showdown_Verdant"}}},
|
||||
jokers = {{id = "j_Roland_verdant"}},
|
||||
jokers = starting_jokers,
|
||||
restrictions = verdant,
|
||||
pronouns = "she_her",
|
||||
calculate = function(_, context)
|
||||
|
|
@ -262,7 +264,7 @@ SMODS.Challenge {
|
|||
SMODS.Challenge {
|
||||
key = "Eternally_Violet",
|
||||
rules = {custom = {{id = "Roland_Eternally_Violet"}, {id = "Roland_Showdown_Violet"}}},
|
||||
jokers = {{id = "j_joker"}, {id = "j_Roland_violet"}},
|
||||
jokers = starting_jokers,
|
||||
restrictions = violet,
|
||||
pronouns = "she_they",
|
||||
calculate = function(_, context)
|
||||
|
|
|
|||
265
src/charm.lua
|
|
@ -1,15 +1,14 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
local mod = SMODS.current_mod
|
||||
local cool_phones = SMODS.Mods.Roland.config.cool_phones
|
||||
|
||||
SMODS.Atlas {
|
||||
key = "charm",
|
||||
path = cool_phones and "phorm.png" or "charm.png",
|
||||
path = "charm.png",
|
||||
px = 68,
|
||||
py = 68,
|
||||
}
|
||||
|
||||
local _ = cool_phones and SMODS.Sound {
|
||||
SMODS.Sound {
|
||||
key = "phone",
|
||||
path = "phone.ogg",
|
||||
}
|
||||
|
|
@ -17,16 +16,11 @@ local _ = cool_phones and SMODS.Sound {
|
|||
local charm = (function()
|
||||
local x = 0
|
||||
|
||||
---@param tbl SMODS.Joker|{alerted?: boolean, artist?: string, equip?: fun(self: self, card: Card)}
|
||||
---@param tbl SMODS.Joker|{alerted?: boolean, equip?: fun(self: self, card: Card)}
|
||||
return function(tbl)
|
||||
q {
|
||||
blocking = false,
|
||||
no_delete = true,
|
||||
front = true,
|
||||
func = function()
|
||||
if not Bakery_API or not Bakery_API.Charm then
|
||||
return false
|
||||
end
|
||||
|
||||
local current_mod = SMODS.current_mod
|
||||
SMODS.current_mod = mod
|
||||
|
||||
|
|
@ -36,20 +30,19 @@ local charm = (function()
|
|||
tbl.discovered = true
|
||||
tbl.pos = {x = x, y = 0}
|
||||
tbl.atlas = "charm"
|
||||
tbl.artist = not cool_phones and "Roland_bakersdozenbagels" or nil
|
||||
x = x + 1
|
||||
|
||||
local orig_equip = tbl.equip
|
||||
|
||||
function tbl.equip(...)
|
||||
local _ = cool_phones and play_sound("Roland_phone", 1, 0.5)
|
||||
play_sound("Roland_phone", 1, 0.5)
|
||||
|
||||
if orig_equip then
|
||||
return orig_equip(...)
|
||||
end
|
||||
end
|
||||
|
||||
local charm = Bakery_API.credit(Bakery_API.Charm(tbl))
|
||||
local charm = Bakery_API.Charm(tbl)
|
||||
charm:inject()
|
||||
charm:process_loc_text()
|
||||
SMODS.current_mod = current_mod
|
||||
|
|
@ -66,30 +59,115 @@ local function can_discard_zero()
|
|||
end
|
||||
|
||||
charm {
|
||||
key = "hand",
|
||||
pronouns = "he_him",
|
||||
config = {extra = {hands = -2, hand_size = 5}},
|
||||
attributes = {"hands", "hand_size", "passive"},
|
||||
loc_vars = function(_, _, card)
|
||||
local extra = card.ability.extra
|
||||
return {vars = {extra.hand_size, extra.hands}}
|
||||
end,
|
||||
equip = function(_, card)
|
||||
local extra = card.ability.extra
|
||||
local round = G.GAME.round_resets
|
||||
ease_hands_played(extra.hands)
|
||||
G.hand:change_size(extra.hand_size)
|
||||
round.hands = round.hands + extra.hands
|
||||
end,
|
||||
unequip = function(_, card)
|
||||
local extra = card.ability.extra
|
||||
local round = G.GAME.round_resets
|
||||
ease_hands_played(-extra.hands)
|
||||
G.hand:change_size(-extra.hand_size)
|
||||
round.hands = round.hands - extra.hands
|
||||
key = "wii",
|
||||
pronouns = "they_them",
|
||||
attributes = {"skip"},
|
||||
config = {extra = {active = true}},
|
||||
calculate = function(_, card, context)
|
||||
if context.prevent_tag_trigger and card.ability.extra.active then
|
||||
return {prevent_trigger = true}
|
||||
end
|
||||
|
||||
if not context.skip_blind then
|
||||
return
|
||||
end
|
||||
|
||||
card.ability.extra.active = true
|
||||
local message = localize {type = "variable", key = "b_Roland_entering_shop"}
|
||||
SMODS.calculate_effect({card = card, message = message, sound = "whoosh1"}, card)
|
||||
|
||||
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.GAME.shop_free = nil
|
||||
G.GAME.shop_d6ed = nil
|
||||
play_sound("whoosh1", 1.33333, 0.8)
|
||||
play_sound("whoosh1", 0.66666, 0.8)
|
||||
|
||||
q(function()
|
||||
G.STATE = G.STATES.SHOP
|
||||
G.STATE_COMPLETE = false
|
||||
delay(1)
|
||||
|
||||
q(function()
|
||||
card.ability.extra.active = false
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end,
|
||||
}
|
||||
|
||||
local orig_apply_to_run = Tag.apply_to_run
|
||||
|
||||
function Tag:apply_to_run(...)
|
||||
if G.GAME.Bakery_charm == "BakeryCharm_Roland_wii" and
|
||||
G.Bakery_charm_area.cards[1].config.center.ability.extra.active then
|
||||
return
|
||||
end
|
||||
|
||||
return orig_apply_to_run(self, ...)
|
||||
end
|
||||
|
||||
charm {
|
||||
key = "flexible",
|
||||
pronouns = "any_all",
|
||||
}
|
||||
|
||||
local orig_showman = SMODS.showman
|
||||
|
||||
function SMODS.showman(...)
|
||||
return G.GAME.Bakery_charm == "BakeryCharm_Roland_flexible" or orig_showman(...)
|
||||
end
|
||||
|
||||
charm {
|
||||
key = "fat",
|
||||
pronouns = "he_they",
|
||||
attributes = {"passive"},
|
||||
config = {extra = {mod = 2}},
|
||||
loc_vars = function(_, _, card)
|
||||
return {vars = {card.ability.extra.mod}}
|
||||
end,
|
||||
equip = function(_, card)
|
||||
SMODS.change_booster_limit(card.ability.extra.mod)
|
||||
end,
|
||||
unequip = function(_, card)
|
||||
SMODS.change_booster_limit(-card.ability.extra.mod)
|
||||
end,
|
||||
}
|
||||
|
||||
local orig_init = Card.init
|
||||
|
||||
function Card:init(X, Y, W, H, card, center, params, ...)
|
||||
if G.GAME.Bakery_charm ~= "BakeryCharm_Roland_fat" or center.set ~= "Booster" then
|
||||
return orig_init(self, X, Y, W, H, card, center, params, ...)
|
||||
end
|
||||
|
||||
local key = f {"mini", "jumbo", "normal"}:fold(center.key, function(a, v)
|
||||
return a:gsub(v, "mega")
|
||||
end)
|
||||
|
||||
if G.P_CENTERS[key] then
|
||||
return orig_init(self, X, Y, W, H, card, G.P_CENTERS[key], params, ...)
|
||||
end
|
||||
|
||||
key = key:gsub("_?%d+$", "_1")
|
||||
|
||||
if G.P_CENTERS[key] then
|
||||
return orig_init(self, X, Y, W, H, card, G.P_CENTERS[key], params, ...)
|
||||
end
|
||||
|
||||
key = key:gsub("_?%d+$", "")
|
||||
|
||||
if G.P_CENTERS[key] then
|
||||
return orig_init(self, X, Y, W, H, card, G.P_CENTERS[key], params, ...)
|
||||
end
|
||||
|
||||
self.Roland_no_mega = true
|
||||
return orig_init(self, X, Y, W, H, card, center, params, ...)
|
||||
end
|
||||
|
||||
charm {
|
||||
key = "cocacola",
|
||||
pronouns = "he_they",
|
||||
|
|
@ -159,111 +237,26 @@ G.FUNCS.Roland_cocacola = function()
|
|||
end
|
||||
|
||||
charm {
|
||||
key = "fat",
|
||||
pronouns = "he_they",
|
||||
attributes = {"passive"},
|
||||
config = {extra = {mod = 2}},
|
||||
key = "hand",
|
||||
pronouns = "he_him",
|
||||
config = {extra = {hands = -2, hand_size = 5}},
|
||||
attributes = {"hands", "hand_size", "passive"},
|
||||
loc_vars = function(_, _, card)
|
||||
return {vars = {card.ability.extra.mod}}
|
||||
local extra = card.ability.extra
|
||||
return {vars = {extra.hand_size, extra.hands}}
|
||||
end,
|
||||
equip = function(_, card)
|
||||
SMODS.change_booster_limit(card.ability.extra.mod)
|
||||
local extra = card.ability.extra
|
||||
local round = G.GAME.round_resets
|
||||
ease_hands_played(extra.hands)
|
||||
G.hand:change_size(extra.hand_size)
|
||||
round.hands = round.hands + extra.hands
|
||||
end,
|
||||
unequip = function(_, card)
|
||||
SMODS.change_booster_limit(-card.ability.extra.mod)
|
||||
local extra = card.ability.extra
|
||||
local round = G.GAME.round_resets
|
||||
ease_hands_played(-extra.hands)
|
||||
G.hand:change_size(-extra.hand_size)
|
||||
round.hands = round.hands - extra.hands
|
||||
end,
|
||||
}
|
||||
|
||||
local orig_init = Card.init
|
||||
|
||||
function Card:init(X, Y, W, H, card, center, params, ...)
|
||||
if G.GAME.Bakery_charm ~= "BakeryCharm_Roland_fat" or center.set ~= "Booster" then
|
||||
return orig_init(self, X, Y, W, H, card, center, params, ...)
|
||||
end
|
||||
|
||||
local key = f {"mini", "jumbo", "normal"}:fold(center.key, function(a, v)
|
||||
return a:gsub(v, "mega")
|
||||
end)
|
||||
|
||||
if G.P_CENTERS[key] then
|
||||
return orig_init(self, X, Y, W, H, card, G.P_CENTERS[key], params, ...)
|
||||
end
|
||||
|
||||
key = key:gsub("_?%d+$", "_1")
|
||||
|
||||
if G.P_CENTERS[key] then
|
||||
return orig_init(self, X, Y, W, H, card, G.P_CENTERS[key], params, ...)
|
||||
end
|
||||
|
||||
key = key:gsub("_?%d+$", "")
|
||||
|
||||
if G.P_CENTERS[key] then
|
||||
return orig_init(self, X, Y, W, H, card, G.P_CENTERS[key], params, ...)
|
||||
end
|
||||
|
||||
self.Roland_no_mega = true
|
||||
return orig_init(self, X, Y, W, H, card, center, params, ...)
|
||||
end
|
||||
|
||||
charm {
|
||||
key = "flexible",
|
||||
pronouns = "any_all",
|
||||
}
|
||||
|
||||
local orig_showman = SMODS.showman
|
||||
|
||||
function SMODS.showman(...)
|
||||
return G.GAME.Bakery_charm == "BakeryCharm_Roland_flexible" or orig_showman(...)
|
||||
end
|
||||
|
||||
charm {
|
||||
key = "wii",
|
||||
pronouns = "they_them",
|
||||
attributes = {"skip"},
|
||||
config = {extra = {active = true}},
|
||||
calculate = function(_, card, context)
|
||||
if context.prevent_tag_trigger and card.ability.extra.active then
|
||||
return {prevent_trigger = true}
|
||||
end
|
||||
|
||||
if not context.skip_blind then
|
||||
return
|
||||
end
|
||||
|
||||
card.ability.extra.active = true
|
||||
local message = localize {type = "variable", key = "b_Roland_entering_shop"}
|
||||
SMODS.calculate_effect({card = card, message = message, sound = "whoosh1"}, card)
|
||||
|
||||
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.GAME.shop_free = nil
|
||||
G.GAME.shop_d6ed = nil
|
||||
play_sound("whoosh1", 1.33333, 0.8)
|
||||
play_sound("whoosh1", 0.66666, 0.8)
|
||||
|
||||
q(function()
|
||||
G.STATE = G.STATES.SHOP
|
||||
G.STATE_COMPLETE = false
|
||||
delay(1)
|
||||
|
||||
q(function()
|
||||
card.ability.extra.active = false
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end,
|
||||
}
|
||||
|
||||
local orig_apply_to_run = Tag.apply_to_run
|
||||
|
||||
function Tag:apply_to_run(...)
|
||||
if G.GAME.Bakery_charm == "BakeryCharm_Roland_wii" and
|
||||
G.Bakery_charm_area.cards[1].ability.extra.active then
|
||||
return
|
||||
end
|
||||
|
||||
return orig_apply_to_run(self, ...)
|
||||
end
|
||||
|
|
|
|||
218
src/edition.lua
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
SMODS.Shader {
|
||||
key = "frozen",
|
||||
|
|
@ -13,7 +13,7 @@ end
|
|||
|
||||
frozen_sound "_click"
|
||||
local frozen_blocklist = {CardSleeve = true}
|
||||
local frozen_sounds = f(4):map(frozen_sound):map "key":table()
|
||||
local frozen_sounds = f(4):map(frozen_sound):map("key"):table()
|
||||
|
||||
local needs_chip_mult_override = {
|
||||
Bull = true,
|
||||
|
|
@ -81,107 +81,6 @@ local function freeze(card)
|
|||
return ret
|
||||
end
|
||||
|
||||
local function hook_estate()
|
||||
---@param card Card|{ Roland_frozen: {estate: integer} }
|
||||
local function estate_pos(card)
|
||||
if card.area ~= G.jokers and card.area.config.type ~= "title" then
|
||||
return 1
|
||||
end
|
||||
|
||||
card.Roland_frozen.estate = card.Roland_frozen.estate or card.rank or 1
|
||||
return card.Roland_frozen.estate
|
||||
end
|
||||
|
||||
local estate = G.P_CENTERS.j_Bakery_Estate
|
||||
local orig_calculate = estate.calculate
|
||||
|
||||
function estate:calculate(card, context, ...)
|
||||
if not (card or {}).Roland_frozen or not (card.edition or {}).Roland_frozen then
|
||||
return orig_calculate(self, card, context, ...)
|
||||
end
|
||||
|
||||
if not context.joker_main then
|
||||
return
|
||||
end
|
||||
|
||||
local joker_count = estate_pos(card)
|
||||
local extra = card.ability.extra
|
||||
return {chips = extra.chips * joker_count, mult = extra.mult * joker_count}
|
||||
end
|
||||
|
||||
local orig_loc_vars = estate.loc_vars
|
||||
|
||||
function estate:loc_vars(info_queue, card, ...)
|
||||
if not (card or {}).Roland_frozen or not (card.edition or {}).Roland_frozen then
|
||||
return orig_loc_vars(self, info_queue, card, ...)
|
||||
end
|
||||
|
||||
local joker_count = estate_pos(card)
|
||||
local extra = card.ability.extra or {}
|
||||
return {vars = {extra.chips * joker_count, extra.mult * joker_count}}
|
||||
end
|
||||
end
|
||||
|
||||
local function hook_proxy()
|
||||
---@param card Card|{ Roland_frozen: {proxy: string} }
|
||||
local function get_proxied_joker(card)
|
||||
if not G.jokers or not G.jokers.cards then
|
||||
return
|
||||
end
|
||||
|
||||
card.Roland_frozen.proxy = card.Roland_frozen.proxy or
|
||||
(Bakery_API.get_proxied_joker() or card).config.center.key
|
||||
|
||||
---@param v Card
|
||||
local function eq(v)
|
||||
return v.config.center.key == card.Roland_frozen.proxy
|
||||
end
|
||||
|
||||
return f(G.jokers.cards):any(eq)
|
||||
end
|
||||
|
||||
local proxy = G.P_CENTERS.j_Bakery_Proxy
|
||||
local orig_calculate = proxy.calculate
|
||||
|
||||
function proxy:calculate(card, context, ...)
|
||||
if not (card or {}).Roland_frozen or not (card.edition or {}).Roland_frozen then
|
||||
return orig_calculate(self, card, context, ...)
|
||||
else
|
||||
return SMODS.blueprint_effect(card, get_proxied_joker(card), context)
|
||||
end
|
||||
end
|
||||
|
||||
local orig_loc_vars = proxy.loc_vars
|
||||
|
||||
function proxy:loc_vars(info_queue, card, ...)
|
||||
if not (card or {}).Roland_frozen or not (card.edition or {}).Roland_frozen then
|
||||
return orig_loc_vars(self, info_queue, card, ...)
|
||||
end
|
||||
|
||||
local other = get_proxied_joker(card)
|
||||
|
||||
local var = (other and other ~= card) and localize {
|
||||
type = "name_text",
|
||||
set = other.config.center.set,
|
||||
key = other.config.center.key,
|
||||
} or localize "k_none"
|
||||
|
||||
return {vars = {var}}
|
||||
end
|
||||
end
|
||||
|
||||
local function hook_scribe()
|
||||
local scribe = G.P_CENTERS.c_Bakery_Scribe
|
||||
local orig_can_use = scribe.can_use
|
||||
|
||||
function scribe.can_use(...)
|
||||
return orig_can_use(...) and
|
||||
(SMODS.Mods.Roland.config.scribable_basket or f(G.jokers.highlighted):all(function(v)
|
||||
return v.config.center.key ~= "j_Roland_basket"
|
||||
end))
|
||||
end
|
||||
end
|
||||
|
||||
SMODS.Edition {
|
||||
key = "frozen",
|
||||
shader = "frozen",
|
||||
|
|
@ -304,14 +203,110 @@ function SMODS.get_probability_vars(trigger_obj, ...)
|
|||
return trigger_obj and (trigger_obj.Roland_frozen or {}).probability or numerator, denominator
|
||||
end
|
||||
|
||||
q {
|
||||
blocking = false,
|
||||
no_delete = true,
|
||||
func = function()
|
||||
q(function()
|
||||
local estate = G.P_CENTERS.j_Bakery_Estate
|
||||
|
||||
if not estate then
|
||||
return true
|
||||
end
|
||||
|
||||
---@param card Card|{ Roland_frozen: {estate: integer} }
|
||||
local function estate_pos(card)
|
||||
if card.area ~= G.jokers and card.area.config.type ~= "title" then
|
||||
return 1
|
||||
end
|
||||
|
||||
card.Roland_frozen.estate = card.Roland_frozen.estate or card.rank or 1
|
||||
return card.Roland_frozen.estate
|
||||
end
|
||||
|
||||
local orig_calculate = estate.calculate
|
||||
|
||||
function estate:calculate(card, context, ...)
|
||||
if not (card or {}).Roland_frozen or not (card.edition or {}).Roland_frozen then
|
||||
return orig_calculate(self, card, context, ...)
|
||||
end
|
||||
|
||||
if not context.joker_main then
|
||||
return
|
||||
end
|
||||
|
||||
local joker_count = estate_pos(card)
|
||||
local extra = card.ability.extra
|
||||
return {chips = extra.chips * joker_count, mult = extra.mult * joker_count}
|
||||
end
|
||||
|
||||
local orig_loc_vars = estate.loc_vars
|
||||
|
||||
function estate:loc_vars(info_queue, card, ...)
|
||||
if not (card or {}).Roland_frozen or not (card.edition or {}).Roland_frozen then
|
||||
return orig_loc_vars(self, info_queue, card, ...)
|
||||
end
|
||||
|
||||
local joker_count = estate_pos(card)
|
||||
local extra = card.ability.extra or {}
|
||||
return {vars = {extra.chips * joker_count, extra.mult * joker_count}}
|
||||
end
|
||||
end)
|
||||
|
||||
q(function()
|
||||
local proxy = G.P_CENTERS.j_Bakery_Proxy
|
||||
|
||||
if not proxy then
|
||||
return true
|
||||
end
|
||||
|
||||
---@param card Card|{ Roland_frozen: {proxy: string} }
|
||||
local function get_proxied_joker(card)
|
||||
if not G.jokers or not G.jokers.cards then
|
||||
return
|
||||
end
|
||||
|
||||
card.Roland_frozen.proxy = card.Roland_frozen.proxy or
|
||||
(Bakery_API.get_proxied_joker() or card).config.center.key
|
||||
|
||||
---@param v Card
|
||||
local function eq(v)
|
||||
return v.config.center.key == card.Roland_frozen.proxy
|
||||
end
|
||||
|
||||
return f(G.jokers.cards):any(eq)
|
||||
end
|
||||
|
||||
local orig_calculate = proxy.calculate
|
||||
|
||||
function proxy:calculate(card, context, ...)
|
||||
if not card or not card.edition or not card.edition.Roland_frozen then
|
||||
return orig_calculate(self, card, context, ...)
|
||||
else
|
||||
return SMODS.blueprint_effect(card, get_proxied_joker(card), context)
|
||||
end
|
||||
end
|
||||
|
||||
local orig_loc_vars = proxy.loc_vars
|
||||
|
||||
function proxy:loc_vars(info_queue, card, ...)
|
||||
if not card or not card.edition or not card.edition.Roland_frozen then
|
||||
return orig_loc_vars(self, info_queue, card, ...)
|
||||
end
|
||||
|
||||
local other = get_proxied_joker(card)
|
||||
|
||||
local var = (other and other ~= card) and localize {
|
||||
type = "name_text",
|
||||
set = other.config.center.set,
|
||||
key = other.config.center.key,
|
||||
} or localize "k_none"
|
||||
|
||||
return {vars = {var}}
|
||||
end
|
||||
end)
|
||||
|
||||
q(function()
|
||||
local orig_flip_double_sided = (Bakery_API or {}).flip_double_sided
|
||||
|
||||
if not orig_flip_double_sided then
|
||||
return false
|
||||
return true
|
||||
end
|
||||
|
||||
function Bakery_API.flip_double_sided(card, ...)
|
||||
|
|
@ -319,9 +314,4 @@ q {
|
|||
return orig_flip_double_sided(card, ...)
|
||||
end
|
||||
end
|
||||
|
||||
local _ = G.P_CENTERS.j_Bakery_Estate and hook_estate()
|
||||
local _ = G.P_CENTERS.c_Bakery_Scribe and hook_scribe()
|
||||
local _ = G.P_CENTERS.j_Bakery_Proxy and hook_proxy()
|
||||
end,
|
||||
}
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
local atlas = SMODS.Atlas {
|
||||
key = "joker",
|
||||
|
|
@ -34,7 +34,13 @@ local joker = (function()
|
|||
tbl.config.extra.back_pos = inc()
|
||||
end
|
||||
|
||||
return q(SMODS.Joker(tbl))
|
||||
local joker = SMODS.Joker(tbl)
|
||||
|
||||
q(function()
|
||||
Bakery_API.credit(joker)
|
||||
end)
|
||||
|
||||
return joker
|
||||
end
|
||||
end)()
|
||||
|
||||
|
|
@ -216,9 +222,9 @@ joker {
|
|||
SMODS.calculate_context {drawing_cards = true, draw = {G.deck.cards}}
|
||||
|
||||
SMODS.calculate_context {
|
||||
hand_drawn = facing_blind and {G.deck.cards[1]} and true,
|
||||
other_drawn = not facing_blind and {G.deck.cards[1]} and true,
|
||||
first_hand_drawn = not current_round.any_hand_drawn and facing_blind or nil,
|
||||
hand_drawn = facing_blind and {G.deck.cards[1]} --[[@as true]],
|
||||
other_drawn = not facing_blind and {G.deck.cards[1]},
|
||||
}
|
||||
|
||||
if type(facing_blind) == "table" then
|
||||
|
|
@ -488,9 +494,11 @@ joker {
|
|||
end
|
||||
end
|
||||
|
||||
return SMODS.merge_effects(
|
||||
local key = card.config.center.key
|
||||
|
||||
local merged = SMODS.merge_effects(
|
||||
f(G.jokers.cards):where(is_frozen):where(function(v)
|
||||
return v.config.center.key ~= card.config.center.key
|
||||
return v.config.center.key ~= key
|
||||
end):map(function(v)
|
||||
return SMODS.blueprint_effect(card, v, context)
|
||||
end):where(type, "table"):map(function(v)
|
||||
|
|
@ -498,6 +506,8 @@ joker {
|
|||
return v
|
||||
end):values():table()
|
||||
)
|
||||
|
||||
return merged
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -648,7 +658,7 @@ joker {
|
|||
local _ = card.area == G.jokers and self:cerulean(false)
|
||||
end,
|
||||
cerulean = function(_, value)
|
||||
local _ = G.jokers and f(G.jokers.cards):each(function(v)
|
||||
f(G.jokers.cards):each(function(v)
|
||||
f {"click", "drag", "focus", "hover"}:map(f.index_into(v.states)):each(function(s)
|
||||
s.can = value or v.config.center.key == "j_Roland_cerulean"
|
||||
end)
|
||||
|
|
@ -675,7 +685,7 @@ joker {
|
|||
{card = card, xmult = card.ability.extra.xmult} or nil
|
||||
end,
|
||||
crimson = function()
|
||||
local _ = G.jokers and f(G.jokers.cards, ipairs_reversed):where(is_frozen, false):each(function(v)
|
||||
f(G.jokers.cards, ipairs_reversed):where(is_frozen, false):each(function(v)
|
||||
local right = G.jokers.cards[v.rank + 1]
|
||||
|
||||
local debuffed_by_crimson = right and
|
||||
|
|
@ -684,13 +694,11 @@ joker {
|
|||
right.config.center.key == "j_Roland_crimson"
|
||||
|
||||
if debuffed_by_crimson and v.ability.Roland_crimson == nil then
|
||||
local debuff = not not v.debuff
|
||||
v.ability.Roland_crimson = not not v.debuff
|
||||
v:set_debuff(true)
|
||||
v.ability.Roland_crimson = debuff
|
||||
elseif not debuffed_by_crimson and v.ability.Roland_crimson ~= nil then
|
||||
local debuff = v.ability.Roland_crimson
|
||||
v:set_debuff(v.ability.Roland_crimson)
|
||||
v.ability.Roland_crimson = nil
|
||||
v:set_debuff(debuff)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
|
|
@ -757,7 +765,7 @@ joker {
|
|||
key = "violet",
|
||||
pronouns = "she_they",
|
||||
idea = "hamester",
|
||||
config = {extra = {before = 0.1, xmult = 6}},
|
||||
config = {extra = {before = 1 / 3, xmult = 9}},
|
||||
pixel_size = {w = 68, h = 68},
|
||||
attributes = {"xmult"},
|
||||
cost = 6,
|
||||
|
|
@ -774,7 +782,7 @@ joker {
|
|||
|
||||
return (context.joker_main or context.forcetrigger) and
|
||||
{card = card, xmult = extra.xmult} or
|
||||
(context.initial_scoring_step and {card = card, xmult = extra.before} or nil)
|
||||
(context.before and {card = card, xmult = extra.before} or nil)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -936,14 +944,10 @@ joker {
|
|||
local extra, numerator, xmult = card.ability.extra, 1, 1
|
||||
|
||||
if G.GAME.blind.name == "bl_mp_nemesis" then
|
||||
local n, d = SMODS.get_probability_vars(card, 1, extra.odds, self.key)
|
||||
return n < d and {card = card, xmult = extra.odds} or nil
|
||||
return {card = card, xmult = extra.odds}
|
||||
end
|
||||
|
||||
-- 2^38 is the first iteration displayed as scientific notation.
|
||||
local max, overflown = 38, false
|
||||
|
||||
for i = 1, max do
|
||||
for _ = 1, 256 do
|
||||
local key = "RolandMartingale" .. tostring(G.GAME.modifiers.Roland_martingale_seed or "")
|
||||
|
||||
if SMODS.pseudorandom_probability(card, self.key, 1, extra.odds, key) then
|
||||
|
|
@ -955,18 +959,9 @@ joker {
|
|||
xmult = xmult * extra.odds
|
||||
local message = number_format(numerator) .. "/" .. number_format(xmult)
|
||||
SMODS.calculate_effect({card = card, repetitions = 1, message = message, message_card = card}, card)
|
||||
overflown = overflown or i == max
|
||||
end
|
||||
|
||||
if overflown then
|
||||
SMODS.calculate_effect({card = card, score = 1 / 0}, card)
|
||||
|
||||
q(function()
|
||||
card:shatter()
|
||||
end)
|
||||
else
|
||||
SMODS.calculate_effect({card = card, xmult = xmult}, card)
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -1212,10 +1207,7 @@ joker {
|
|||
local delta = (context.cardarea == G.play and not card.blueprint) and 1 or 0
|
||||
extra.scored = extra.scored + delta
|
||||
|
||||
if not extra.getting_flipped and
|
||||
not extra.flipped and
|
||||
extra.scored == extra.required then
|
||||
extra.getting_flipped = true
|
||||
if not extra.flipped and extra.scored == extra.required then
|
||||
Bakery_API.flip_double_sided(card)
|
||||
|
||||
q(function()
|
||||
|
|
@ -1223,7 +1215,7 @@ joker {
|
|||
end)
|
||||
end
|
||||
|
||||
return extra.scored >= extra.required and {card = card, xmult = card.ability.extra.xmult} or
|
||||
return extra.scored > extra.required and {card = card, xmult = card.ability.extra.xmult} or
|
||||
(delta > 0 and {
|
||||
message = extra.scored .. "/" .. extra.required,
|
||||
colour = G.C.JOKER_GREY,
|
||||
|
|
@ -1258,7 +1250,7 @@ joker {
|
|||
return {card = card, numerator = extra.probability}
|
||||
end
|
||||
|
||||
if context.end_of_round and not context.repetition and extra.probability ~= extra.reset then
|
||||
if context.end_of_round and extra.probability ~= extra.reset then
|
||||
extra.probability = extra.reset
|
||||
return {message = localize "k_reset", colour = G.C.RED, message_card = card, repetitions = 0}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,91 +9,81 @@ local f = {}
|
|||
|
||||
if not f then
|
||||
---@generic I, O
|
||||
---@param first string|fun(v: I): O
|
||||
---@param first fun(v: I): O
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(first)
|
||||
error {first}
|
||||
end
|
||||
|
||||
---@generic I, T, O
|
||||
---@param first string|fun(v: I): T
|
||||
---@param second string|fun(v: T): O
|
||||
---@param first fun(v: I): T
|
||||
---@param second fun(v: T): O
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(first, second)
|
||||
error {first, second}
|
||||
end
|
||||
|
||||
---@generic I, T1, T2, O
|
||||
---@param first string|fun(v: I): T1
|
||||
---@param second string|fun(v: T1): T2
|
||||
---@param third string|fun(v: T2): O
|
||||
---@param first fun(v: I): T1
|
||||
---@param second fun(v: T1): T2
|
||||
---@param third fun(v: T2): O
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(first, second, third)
|
||||
error {first, second, third}
|
||||
end
|
||||
|
||||
---@generic I, T1, T2, T3, O
|
||||
---@param first string|fun(v: I): T1
|
||||
---@param second string|fun(v: T1): T2
|
||||
---@param third string|fun(v: T2): T3
|
||||
---@param fourth string|fun(v: T3): O
|
||||
---@param first fun(v: I): T1
|
||||
---@param second fun(v: T1): T2
|
||||
---@param third fun(v: T2): T3
|
||||
---@param fourth fun(v: T3): O
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(first, second, third, fourth)
|
||||
error {first, second, third, fourth}
|
||||
end
|
||||
|
||||
---@generic I, T1, T2, T3, T4, O
|
||||
---@param first string|fun(v: I): T1
|
||||
---@param second string|fun(v: T1): T2
|
||||
---@param third string|fun(v: T2): T3
|
||||
---@param fourth string|fun(v: T3): T4
|
||||
---@param fifth string|fun(v: T4): O
|
||||
---@param first fun(v: I): T1
|
||||
---@param second fun(v: T1): T2
|
||||
---@param third fun(v: T2): T3
|
||||
---@param fourth fun(v: T3): T4
|
||||
---@param fifth fun(v: T4): O
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(first, second, third, fourth, fifth)
|
||||
error {first, second, third, fourth, fifth}
|
||||
end
|
||||
|
||||
---@generic I, O
|
||||
---@param all { [1]: (string|fun(v: I): O) }
|
||||
---@param all {[1]: (fun(v: I): O)}
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(all)
|
||||
error(all)
|
||||
end
|
||||
|
||||
---@generic I, T, O
|
||||
---@param all { [1]: (string|fun(v: I): T), [2]: (string|fun(v: T): O) }
|
||||
---@param all {[1]: (fun(v: I): T), [2]: (fun(v: T): O)}
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(all)
|
||||
error(all)
|
||||
end
|
||||
|
||||
---@generic I, T1, T2, O
|
||||
---@param all { [1]: (string|fun(v: I): T1), [2]: (string|fun(v: T1): T2), [3]: (string|fun(v: T2): O) }
|
||||
---@param all {[1]: (fun(v: I): T1), [2]: (fun(v: T1): T2), [3]: (fun(v: T2): O)}
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(all)
|
||||
error(all)
|
||||
end
|
||||
|
||||
---@generic I, T1, T2, T3, O
|
||||
---@param all { [1]: (string|fun(v: I): T1), [2]: (string|fun(v: T1): T2), [3]: (string|fun(v: T2): T3), [4]: (string|fun(v: T3): O) }
|
||||
---@param all {[1]: (fun(v: I): T1), [2]: (fun(v: T1): T2), [3]: (fun(v: T2): T3), [4]: (fun(v: T3): O)}
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(all)
|
||||
error(all)
|
||||
end
|
||||
|
||||
---@generic I, T1, T2, T3, T4, O
|
||||
---@param all { [1]: (string|fun(v: I): T1), [2]: (string|fun(v: T1): T2), [3]: (string|fun(v: T2): T3), [4]: (string|fun(v: T3): T4), [4]: (string|fun(v: T4): O) }
|
||||
---@param all {[1]: (fun(v: I): T1), [2]: (fun(v: T1): T2), [3]: (fun(v: T2): T3), [4]: (fun(v: T3): T4), [4]: (fun(v: T4): O)}
|
||||
---@return fun(v: I): O
|
||||
---@nodiscard
|
||||
function f.chain(all)
|
||||
error(all)
|
||||
end
|
||||
|
|
@ -114,7 +104,7 @@ local none
|
|||
---@return T
|
||||
---@nodiscard
|
||||
local function autofunc(func)
|
||||
return type(func) == "string" and f.indices(func) or func or f.id
|
||||
return type(func) == "string" and f.index(func) or func or f.id
|
||||
end
|
||||
|
||||
---@generic K, V
|
||||
|
|
@ -128,6 +118,13 @@ local function autopairs(tbl, fpairs)
|
|||
return (fpairs or (tbl[#tbl] and ipairs or pairs))(tbl)
|
||||
end
|
||||
|
||||
---@param any any
|
||||
---@return boolean
|
||||
---@nodiscard
|
||||
local function is_f(any)
|
||||
return type(any) == "table" and any.from == f.from and any.new == f.new
|
||||
end
|
||||
|
||||
--- Always returns nil.
|
||||
---@return nil
|
||||
---@nodiscard
|
||||
|
|
@ -160,7 +157,6 @@ end
|
|||
---@generic T
|
||||
---@param value T
|
||||
---@return fun(T): boolean
|
||||
---@nodiscard
|
||||
function f.eq(value)
|
||||
return function(v)
|
||||
return value == v
|
||||
|
|
@ -170,7 +166,6 @@ end
|
|||
---@generic T
|
||||
---@param value T
|
||||
---@return fun(T): boolean
|
||||
---@nodiscard
|
||||
function f.nq(value)
|
||||
return function(v)
|
||||
return value ~= v
|
||||
|
|
@ -195,15 +190,6 @@ function f.const(v)
|
|||
end
|
||||
end
|
||||
|
||||
---@param i integer
|
||||
---@return fun(...: any): any
|
||||
---@nodiscard
|
||||
function f.arg(i)
|
||||
return function(...)
|
||||
return ({...})[i]
|
||||
end
|
||||
end
|
||||
|
||||
---@generic K, V
|
||||
---@param v K
|
||||
---@return fun(x: { [K]: V }): V
|
||||
|
|
@ -242,32 +228,17 @@ function f.indices(v)
|
|||
end
|
||||
end
|
||||
|
||||
---@param any any
|
||||
---@return boolean
|
||||
---@nodiscard
|
||||
function f.isf(any)
|
||||
return type(any) == "table" and any.from == f.from and any.new == f.new
|
||||
end
|
||||
|
||||
f[true and "chain"] = function(...)
|
||||
local ret
|
||||
|
||||
for _, v in ipairs {...} do
|
||||
for _, v in ipairs(...) do
|
||||
if type(v) == "table" then
|
||||
for _, vv in ipairs(v) do
|
||||
local copy = ret
|
||||
vv = autofunc(vv)
|
||||
|
||||
ret = ret and function(...)
|
||||
return vv(copy(...))
|
||||
return vv(ret(...))
|
||||
end or vv
|
||||
end
|
||||
else
|
||||
local copy = ret
|
||||
v = autofunc(v)
|
||||
|
||||
ret = ret and function(...)
|
||||
return v(copy(...))
|
||||
return v(ret(...))
|
||||
end or v
|
||||
end
|
||||
end
|
||||
|
|
@ -284,7 +255,6 @@ function f.new(fnext)
|
|||
return {
|
||||
all = f.all,
|
||||
any = f.any,
|
||||
arg = f.arg,
|
||||
chain = f.chain,
|
||||
concat = f.concat,
|
||||
const = f.const,
|
||||
|
|
@ -299,14 +269,12 @@ function f.new(fnext)
|
|||
index = f.index,
|
||||
index_into = f.index_into,
|
||||
indices = f.indices,
|
||||
isf = f.isf,
|
||||
keys = f.keys,
|
||||
map = f.map,
|
||||
new = f.new,
|
||||
next = fnext or f.noop,
|
||||
noop = f.noop,
|
||||
nq = f.nq,
|
||||
peek = f.peek,
|
||||
pun = f.pun,
|
||||
skip = f.skip,
|
||||
slice = f.slice,
|
||||
|
|
@ -386,7 +354,7 @@ function f:concat(...)
|
|||
local sum, last = 0, 0
|
||||
|
||||
for i = 1, #fs do
|
||||
fs[i] = f.isf(fs[i]) and fs[i] or f.from(fs[i])
|
||||
fs[i] = is_f(fs[i]) and fs[i] or f.from(fs[i])
|
||||
end
|
||||
|
||||
return f.new(function()
|
||||
|
|
@ -414,30 +382,12 @@ function f:concat(...)
|
|||
end)
|
||||
end
|
||||
|
||||
---@generic K, V
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): any
|
||||
---@return F|{ [K]: V }
|
||||
---@nodiscard
|
||||
function f:peek(func)
|
||||
func = autofunc(func)
|
||||
|
||||
return f.new(function()
|
||||
local k, v = self:next()
|
||||
|
||||
if k ~= nil then
|
||||
func(v, k)
|
||||
return k, v
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
---@generic K, V, U
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): U
|
||||
---@param func F|fun(v: V, k: K): U
|
||||
---@return F|{ [K]: U }
|
||||
---@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: U }
|
||||
---@nodiscard
|
||||
---@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: U }
|
||||
function f:map(func)
|
||||
func = autofunc(func)
|
||||
|
||||
|
|
@ -452,11 +402,61 @@ end
|
|||
|
||||
---@generic K, V, U
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): { [any]: U }
|
||||
---@param func F|fun(v: V, k: K): { [any]: U }
|
||||
---@param fpairs? fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)
|
||||
---@return F|{ [K]: U }
|
||||
---@overload fun(self: F|{ [K]: V }, func: string, fpairs?: fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)): F|{ [K]: U }
|
||||
---@nodiscard
|
||||
---@overload fun(self: F|{ [K]: V }, func: string, fpairs?: fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)): F|{ [K]: U }
|
||||
function f:flatmap(func, fpairs)
|
||||
-- local i = 0
|
||||
local vt, vk, vv, vp
|
||||
func = autofunc(func)
|
||||
|
||||
return f.new(function()
|
||||
if vk then
|
||||
vk, vv = vp(vt, vk)
|
||||
|
||||
if vk ~= nil then
|
||||
-- i = i + 1
|
||||
-- return i, vv
|
||||
return vk, vv
|
||||
end
|
||||
end
|
||||
|
||||
while true do
|
||||
local k, v = self:next()
|
||||
|
||||
if k == nil then
|
||||
return
|
||||
end
|
||||
|
||||
v = func(v, k)
|
||||
|
||||
if type(v) ~= "table" then
|
||||
-- i = i + 1
|
||||
-- return i, v
|
||||
return k, v
|
||||
end
|
||||
|
||||
vp, vt, vk = autopairs(v, fpairs)
|
||||
vk, vv = vp(vt, vk)
|
||||
|
||||
if vk ~= nil then
|
||||
-- i = i + 1
|
||||
-- return i, vv
|
||||
return vk, vv
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
---@generic K, V, U
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func F|fun(v: V, k: K): { [any]: U }
|
||||
---@param fpairs? fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)
|
||||
---@return F|{ [K]: U }
|
||||
---@nodiscard
|
||||
---@overload fun(self: F|{ [K]: V }, func: string, fpairs?: fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)): F|{ [K]: U }
|
||||
function f:flatmap(func, fpairs)
|
||||
-- local i = 0
|
||||
local vt, vk, vv, vp
|
||||
|
|
@ -502,7 +502,7 @@ end
|
|||
|
||||
---@generic K, V
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): boolean
|
||||
---@param func F|fun(v: V, k: K): boolean
|
||||
---@param is? any
|
||||
---@return F|{ [K]: V }
|
||||
---@nodiscard
|
||||
|
|
@ -665,10 +665,10 @@ end
|
|||
|
||||
---@generic K, V
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): any
|
||||
---@param func F|fun(v: V, k: K): any
|
||||
---@return boolean|V
|
||||
---@overload fun(self: F|{ [K]: V }, func: string?): boolean|V
|
||||
---@nodiscard
|
||||
---@overload fun(self: F|{ [K]: V }, func: string?): boolean|V
|
||||
function f:any(func)
|
||||
func = autofunc(func)
|
||||
|
||||
|
|
@ -683,10 +683,10 @@ end
|
|||
|
||||
---@generic K, V
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): any
|
||||
---@param func F|fun(v: V, k: K): any
|
||||
---@return boolean|V
|
||||
---@overload fun(self: F|{ [K]: V }, func: string?): boolean|V
|
||||
---@nodiscard
|
||||
---@overload fun(self: F|{ [K]: V }, func: string?): boolean|V
|
||||
function f:all(func)
|
||||
func = autofunc(func)
|
||||
|
||||
|
|
@ -701,10 +701,10 @@ end
|
|||
|
||||
---@generic K, V
|
||||
---@param self F|{ [K]: V }
|
||||
---@param func fun(v: V, k: K): any
|
||||
---@param func F|fun(v: V, k: K): any
|
||||
---@return integer
|
||||
---@overload fun(self: F|{ [K]: V }, func: string): integer
|
||||
---@nodiscard
|
||||
---@overload fun(self: F|{ [K]: V }, func: string): integer
|
||||
function f:count(func)
|
||||
local ret = 0
|
||||
func = autofunc(func)
|
||||
|
|
|
|||
|
|
@ -1,76 +0,0 @@
|
|||
---@meta
|
||||
---@alias Attributes "mult"|"chips"|"xmult"|"xchips"|"score"|"xscore"|"blindsize"|"xblindsize"|"balance"|"swap"|"retrigger"|"scaling"|"reset"|"suit"|"diamonds"|"hearts"|"spades"|"clubs"|"hand_type"|"rank"|"ace"|"two"|"three"|"four"|"five"|"six"|"seven"|"eight"|"nine"|"ten"|"jack"|"queen"|"king"|"face"|"economy"|"generation"|"destroy_card"|"hands"|"discard"|"hand_size"|"chance"|"joker_slot"|"mod_chance"|"copying"|"full_deck"|"passive"|"joker"|"tarot"|"planet"|"spectral"|"enhancements"|"seals"|"editions"|"tag"|"skip"|"modify_card"|"perma_bonus"|"prevents_death"|"boss_blind"|"reroll"|"on_sell"|"sell_value"|"food"|"space"|"bakery_double_sided"|"bakery_usable"|"bakery_werewolf"
|
||||
---@type Card[]
|
||||
CardArea.cards = CardArea.cards
|
||||
|
||||
--- @overload fun(tbl: SMODS.Joker): SMODS.GameObject
|
||||
Bakery_API.Charm = Bakery_API.Charm
|
||||
|
||||
--- @generic T: SMODS.GameObject
|
||||
--- @param obj T
|
||||
--- @return T
|
||||
function Bakery_API.credit(obj)
|
||||
error(obj)
|
||||
end
|
||||
|
||||
---@type table
|
||||
Balatest = Balatest
|
||||
|
||||
--- @type { constants?: { TEN: table }, new: (fun(self: self, arr?: number[], sign?: number, noNormalize?: boolean): table), pow: (fun(x: number, y: number): number) }
|
||||
Big = Big
|
||||
|
||||
--- @type table?
|
||||
CardSleeves = CardSleeves
|
||||
|
||||
--- @type table|fun(obj: SMODS.Back): SMODS.Back
|
||||
CardSleeves.Sleeve = CardSleeves.Sleeve
|
||||
|
||||
--- @type {aliases: { [string]: [string] }}
|
||||
Cryptid = Cryptid
|
||||
|
||||
--- @type fun(area: CardArea, ...: ...): Card
|
||||
create_card_for_shop = create_card_for_shop
|
||||
|
||||
--- @type boolean|table
|
||||
G.Bakery_charm_area.cards[1].ability.extra = G.Bakery_charm_area.cards[1].ability.extra
|
||||
|
||||
SMODS.Mods.Roland.config = require "config"
|
||||
|
||||
---@type userdata|{getWidth: fun(self: self): number}
|
||||
SMODS.Atlas.image_data = SMODS.Atlas.image_data
|
||||
|
||||
--- @type table
|
||||
Talisman = Talisman
|
||||
|
||||
--- @type fun(obj: any): number
|
||||
to_number = to_number
|
||||
|
||||
-- This exists to remove the @deprecated warning.
|
||||
---Returns the elements from the given `list`. This function is equivalent to
|
||||
---```lua
|
||||
--- return list[i], list[i+1], ···, list[j]
|
||||
---```
|
||||
---
|
||||
---
|
||||
---[View documents](command:extension.lua.doc?["en-us/52/manual.html/pdf-unpack"])
|
||||
---
|
||||
---@generic T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
|
||||
---@param list {
|
||||
--- [1]?: T1,
|
||||
--- [2]?: T2,
|
||||
--- [3]?: T3,
|
||||
--- [4]?: T4,
|
||||
--- [5]?: T5,
|
||||
--- [6]?: T6,
|
||||
--- [7]?: T7,
|
||||
--- [8]?: T8,
|
||||
--- [9]?: T9,
|
||||
--- [10]?: T10,
|
||||
---}
|
||||
---@param i? integer
|
||||
---@param j? integer
|
||||
---@return T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
|
||||
---@nodiscard
|
||||
function unpack(list, i, j)
|
||||
error {list, i, j}
|
||||
end
|
||||
|
|
@ -1,59 +1,3 @@
|
|||
local f = assert(SMODS.load_file "src/lib/funky.lua")() or require "lib.funky"
|
||||
|
||||
---@param v string
|
||||
---@return Card|Tag
|
||||
local function add(v)
|
||||
if not G.P_TAGS[v] then
|
||||
return SMODS.add_card {no_edition = true, key = v}
|
||||
end
|
||||
|
||||
local tag = Tag(v)
|
||||
|
||||
if tag.name == "Orbital Tag" then
|
||||
local hands = f(G.GAME.hands):where "visible":keys():table()
|
||||
tag.ability.orbital_hand = pseudorandom_element(hands, pseudoseed "Roland_c_orbital_tag")
|
||||
end
|
||||
|
||||
add_tag(tag)
|
||||
return tag
|
||||
end
|
||||
|
||||
local function simplify(x)
|
||||
return type(x) == "string" and x:lower():gsub("%s", ""):gsub("_", ""):gsub("^the", "") or x
|
||||
end
|
||||
|
||||
local function flatten(v)
|
||||
return type(v) ~= "table" and {v} or (f.isf(v) and v:table() or v)
|
||||
end
|
||||
|
||||
---@param it string
|
||||
local function find(it)
|
||||
if (G.P_CENTERS[it] or {}).config then
|
||||
return it
|
||||
end
|
||||
|
||||
local match = simplify(it)
|
||||
local pool = f(G.P_CENTER_POOLS):any(f.chain(f.arg(2), simplify, f.eq(match)))
|
||||
|
||||
if type(pool) == "table" and next(pool) then
|
||||
return pseudorandom_element(pool, pseudoseed "Roland_c").key
|
||||
end
|
||||
|
||||
if Cryptid and Cryptid.aliases and Cryptid.aliases[it] then
|
||||
return Cryptid.aliases[it]
|
||||
end
|
||||
|
||||
return f(G.localization.descriptions)
|
||||
:flatmap(flatten)
|
||||
:where(type, "table")
|
||||
:where(f.chain(f.arg(2), f.index_into(G.P_CENTERS), "config"))
|
||||
:where(function(v, k)
|
||||
return match == simplify(k) or match == simplify(v.name)
|
||||
end)
|
||||
:keys()
|
||||
:any()
|
||||
end
|
||||
|
||||
local function protect(fun)
|
||||
return function()
|
||||
local res, ret = pcall(fun)
|
||||
|
|
@ -67,78 +11,88 @@ local function protect(fun)
|
|||
end
|
||||
|
||||
local function protect_ev(fun)
|
||||
if type(fun) == "function" then
|
||||
return Event {func = protect(fun)}
|
||||
elseif type(fun) ~= "table" then
|
||||
error("Expected a function or table, got a " .. type(fun), 3)
|
||||
elseif type(fun.is) == "function" and fun:is(SMODS.GameObject) then
|
||||
return Event {
|
||||
blocking = false,
|
||||
no_delete = true,
|
||||
func = protect(function()
|
||||
if not Bakery_API or not Bakery_API.credit then
|
||||
return false
|
||||
local no_delete = not not SMODS.current_mod
|
||||
|
||||
if type(fun) == "table" then
|
||||
fun.func = protect(fun.func)
|
||||
fun.no_delete = no_delete
|
||||
fun = getmetatable(fun) == Event and fun or Event(fun)
|
||||
elseif type(fun) == "function" then
|
||||
fun = Event {func = protect(fun), no_delete = no_delete}
|
||||
else
|
||||
error("Expected a function or event, got a " .. type(fun), 3)
|
||||
end
|
||||
|
||||
Bakery_API.credit(fun)
|
||||
end),
|
||||
}
|
||||
else
|
||||
fun.func = protect(fun.func or fun[1])
|
||||
return getmetatable(fun) == Event and fun or Event(fun)
|
||||
return fun
|
||||
end
|
||||
|
||||
---@alias Attributes "mult"|"chips"|"xmult"|"xchips"|"score"|"xscore"|"blindsize"|"xblindsize"|"balance"|"swap"|"retrigger"|"scaling"|"reset"|"suit"|"diamonds"|"hearts"|"spades"|"clubs"|"hand_type"|"rank"|"ace"|"two"|"three"|"four"|"five"|"six"|"seven"|"eight"|"nine"|"ten"|"jack"|"queen"|"king"|"face"|"economy"|"generation"|"destroy_card"|"hands"|"discard"|"hand_size"|"chance"|"joker_slot"|"mod_chance"|"copying"|"full_deck"|"passive"|"joker"|"tarot"|"planet"|"spectral"|"enhancements"|"seals"|"editions"|"tag"|"skip"|"modify_card"|"perma_bonus"|"prevents_death"|"boss_blind"|"reroll"|"on_sell"|"sell_value"|"food"|"space"|"bakery_double_sided"
|
||||
if false then
|
||||
-- This allows for better type inference.
|
||||
SMODS.Mods.Roland.config = require "config"
|
||||
|
||||
---@type Card[]
|
||||
CardArea.cards = CardArea.cards
|
||||
|
||||
---@type userdata|{getWidth: fun(self: self): number}
|
||||
SMODS.Atlas.image_data = SMODS.Atlas.image_data
|
||||
|
||||
--- @type { constants?: { TEN: table }, new: (fun(self: self, arr?: number[], sign?: number, noNormalize?: boolean): table), pow: (fun(x: number, y: number): number) }
|
||||
_G["Big"] = _G["Big"]
|
||||
|
||||
--- @type fun(area: CardArea, ...: ...): Card
|
||||
create_card_for_shop = create_card_for_shop
|
||||
|
||||
-- This exists to remove the @deprecated warning.
|
||||
---Returns the elements from the given `list`. This function is equivalent to
|
||||
---```lua
|
||||
--- return list[i], list[i+1], ···, list[j]
|
||||
---```
|
||||
---
|
||||
---
|
||||
---[View documents](command:extension.lua.doc?["en-us/52/manual.html/pdf-unpack"])
|
||||
---
|
||||
---@generic T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
|
||||
---@param list {
|
||||
--- [1]?: T1,
|
||||
--- [2]?: T2,
|
||||
--- [3]?: T3,
|
||||
--- [4]?: T4,
|
||||
--- [5]?: T5,
|
||||
--- [6]?: T6,
|
||||
--- [7]?: T7,
|
||||
--- [8]?: T8,
|
||||
--- [9]?: T9,
|
||||
--- [10]?: T10,
|
||||
---}
|
||||
---@param i? integer
|
||||
---@param j? integer
|
||||
---@return T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
|
||||
---@nodiscard
|
||||
function unpack(list, i, j)
|
||||
error {list, i, j}
|
||||
end
|
||||
end
|
||||
|
||||
local f = assert(SMODS.load_file "src/lib/funky.lua")() or require "lib.funky"
|
||||
|
||||
--- Queues an event to be run.
|
||||
--- Note that events added this way implicitly `return true` unless you explicitly `return false`.
|
||||
--- For `front`; boolean `true` to add the event to the front of the queue, rather than the end.
|
||||
--- @generic T: fun():boolean?|Event
|
||||
--- @param fun T|Event|{front?: boolean} The table or function to turn into an event.
|
||||
--- @return T fun
|
||||
--- @param fun fun():boolean?|{front?: boolean}|Event The event or a function to run turn into an event.
|
||||
local function q(fun)
|
||||
local ev = protect_ev(fun)
|
||||
G.E_MANAGER:add_event(ev, nil, ev.front)
|
||||
return fun
|
||||
end
|
||||
|
||||
--- Determines if a center is allowed to be usable.
|
||||
---@return boolean
|
||||
local function u()
|
||||
return not ((G.play and next(G.play.cards) or G.CONTROLLER.locked or G.GAME.STOP_USE and G.GAME.STOP_USE > 0) and
|
||||
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
|
||||
G.STATE ~= G.STATES.HAND_PLAYED and
|
||||
G.STATE ~= G.STATES.DRAW_TO_HAND and
|
||||
G.STATE ~= G.STATES.PLAY_TAROT)
|
||||
end
|
||||
|
||||
--- Creates one or more cards.
|
||||
---@param ... any
|
||||
---@return Card|Tag|(Card|Tag[])
|
||||
local function c(...)
|
||||
local cards = f {...}
|
||||
:flatmap(flatten)
|
||||
:where(type, "string")
|
||||
:map(string.lower)
|
||||
:map(find)
|
||||
:where(f.id)
|
||||
:map(add)
|
||||
:values()
|
||||
:table()
|
||||
|
||||
return #cards > 1 and cards or cards[1]
|
||||
end
|
||||
|
||||
return {f, q, u, setmetatable({}, {
|
||||
__call = function(_, ...)
|
||||
return c(...)
|
||||
end,
|
||||
__index = function(_, k)
|
||||
return c(k)
|
||||
end,
|
||||
__newindex = function(_, k, v)
|
||||
local n = tonumber(v)
|
||||
|
||||
for _ = 1, type(n) == "number" and n or 1 do
|
||||
c(k)
|
||||
end
|
||||
end,
|
||||
})}
|
||||
return {f, q, u}
|
||||
|
|
|
|||
49
src/main.lua
|
|
@ -1,15 +1,11 @@
|
|||
local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared"
|
||||
local f, q = qol[1], qol[2]
|
||||
local f, q = unpack(qol)
|
||||
|
||||
q {
|
||||
front = true,
|
||||
no_delete = true,
|
||||
blocking = false,
|
||||
func = function()
|
||||
q(function()
|
||||
local contributors = (Bakery_API or {}).contributors
|
||||
|
||||
if not contributors then
|
||||
return false
|
||||
return true
|
||||
end
|
||||
|
||||
-- Special shoutout to all contributors. <3
|
||||
|
|
@ -48,36 +44,19 @@ q {
|
|||
|
||||
f(credits):each(function(v, k)
|
||||
contributors["Roland_" .. k] = v
|
||||
-- G.ARGS.LOC_COLOURS["Bakery_credit_fg_Roland_" .. k] = v.fg
|
||||
-- G.ARGS.LOC_COLOURS["Bakery_credit_bg_Roland_" .. k] = v.bg
|
||||
end)
|
||||
|
||||
if not SMODS.Mods.DebugPlus or not SMODS.Mods.Roland.config.import_funky then
|
||||
return
|
||||
if SMODS.Mods.DebugPlus and SMODS.Mods.Roland.config.import_funky then
|
||||
_G.f, _G.q, _G.u = unpack(qol)
|
||||
end
|
||||
end)
|
||||
|
||||
_G.f, _G.q, _G.u, _G.c = unpack(qol)
|
||||
end,
|
||||
}
|
||||
|
||||
f {
|
||||
"challenge",
|
||||
"spectral",
|
||||
"edition",
|
||||
"tweaks",
|
||||
"blind",
|
||||
"charm",
|
||||
"joker",
|
||||
"tarot",
|
||||
"back",
|
||||
"seal",
|
||||
"tag",
|
||||
"voucher",
|
||||
}:each(function(v)
|
||||
f {"challenge", "spectral", "edition", "tweaks", "blind", "charm", "joker", "tarot", "back", "seal", "tag"}
|
||||
:each(function(v)
|
||||
assert(SMODS.load_file("src/" .. v .. ".lua"))(qol)
|
||||
end)
|
||||
|
||||
if Balatest then
|
||||
if _G["Balatest"] then
|
||||
f {"joker", "blind", "spectral"}:each(function(v)
|
||||
assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol)
|
||||
end)
|
||||
|
|
@ -113,15 +92,13 @@ function SMODS.current_mod.config_tab()
|
|||
config = {minw = 1, minh = 1, align = "tl", padding = 0.1, colour = G.C.CLEAR},
|
||||
nodes = {
|
||||
toggle "animated_icon",
|
||||
toggle "cool_phones",
|
||||
toggle "faster_planets",
|
||||
-- toggle "illusion_seal",
|
||||
-- toggle "no_wild_debuff",
|
||||
toggle "vitriol",
|
||||
toggle "equinox_assist",
|
||||
_G["Talisman"] and toggle "harsh_ante_scaling",
|
||||
toggle "illusion_seal",
|
||||
SMODS.Mods.DebugPlus and toggle "import_funky",
|
||||
toggle "no_wild_debuff",
|
||||
toggle "equinox_assist",
|
||||
G.P_CENTERS.c_Bakery_Scribe and toggle "scribable_basket",
|
||||
Talisman and toggle "harsh_ante_scaling",
|
||||
},
|
||||
}},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
SMODS.Atlas {
|
||||
px = 71,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f, q, u = (... or require "lib.shared")[1], (... or require "lib.shared")[2], (... or require "lib.shared")[3]
|
||||
local f, q, u = unpack(... or require "lib.shared")
|
||||
|
||||
local spectral = (function()
|
||||
local x = 0
|
||||
|
|
@ -6,13 +6,19 @@ local spectral = (function()
|
|||
---@param tbl SMODS.Consumable|{artist?: string}
|
||||
---@return SMODS.Consumable
|
||||
return function(tbl)
|
||||
tbl.artist = tbl.artist and "Roland_" .. tbl.artist or nil
|
||||
tbl.pos = {x = x, y = 0}
|
||||
tbl.atlas = "spectral"
|
||||
tbl.set = "Spectral"
|
||||
tbl.cost = 4
|
||||
tbl.set = "Spectral"
|
||||
tbl.atlas = "spectral"
|
||||
tbl.pos = {x = x, y = 0}
|
||||
tbl.artist = tbl.artist and "Roland_" .. tbl.artist or nil
|
||||
local spectral = SMODS.Consumable(tbl)
|
||||
x = x + 1
|
||||
return q(SMODS.Consumable(tbl))
|
||||
|
||||
q(function()
|
||||
Bakery_API.credit(spectral)
|
||||
end)
|
||||
|
||||
return spectral
|
||||
end
|
||||
end)()
|
||||
|
||||
|
|
@ -69,15 +75,15 @@ spectral {
|
|||
table.insert(info_queue, G.P_CENTERS.m_stone)
|
||||
end,
|
||||
can_use = function()
|
||||
return next(G.hand.cards) and u()
|
||||
return u() and not not next(G.hand.cards)
|
||||
end,
|
||||
use = function(_, card)
|
||||
q {
|
||||
trigger = "after",
|
||||
delay = 0.4,
|
||||
func = function()
|
||||
card:juice_up(0.3, 0.5)
|
||||
play_sound("tarot1")
|
||||
card:juice_up(0.3, 0.5)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -89,8 +95,8 @@ spectral {
|
|||
delay = 0.15,
|
||||
func = function()
|
||||
v:flip()
|
||||
v:juice_up(0.3, 0.3)
|
||||
play_sound("card1", percent)
|
||||
v:juice_up(0.3, 0.3)
|
||||
return true
|
||||
end,
|
||||
}
|
||||
|
|
@ -110,8 +116,8 @@ spectral {
|
|||
delay = 0.15,
|
||||
func = function()
|
||||
v:flip()
|
||||
v:juice_up(0.3, 0.3)
|
||||
play_sound("tarot2", percent, 0.6)
|
||||
v:juice_up(0.3, 0.3)
|
||||
return true
|
||||
end,
|
||||
}
|
||||
|
|
@ -155,7 +161,7 @@ spectral {
|
|||
return {vars = {card.ability.extra.amount}}
|
||||
end,
|
||||
can_use = function()
|
||||
return next(G.playing_cards) and u()
|
||||
return #G.playing_cards > 1 and not not u()
|
||||
end,
|
||||
use = function(_, card)
|
||||
local function destructible(v)
|
||||
|
|
@ -190,6 +196,12 @@ spectral {
|
|||
end
|
||||
|
||||
play_sound("Roland_void", 1, 0.7)
|
||||
q {delay = 0.28, timer = "REAL", trigger = "after", func = void}
|
||||
|
||||
q {
|
||||
delay = 0.28,
|
||||
timer = "REAL",
|
||||
trigger = "after",
|
||||
func = void,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
SMODS.Atlas {
|
||||
px = 34,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f, q, u = (... or require "lib.shared")[1], (... or require "lib.shared")[2], (... or require "lib.shared")[3]
|
||||
local f, q, u = unpack(... or require "lib.shared")
|
||||
|
||||
SMODS.Atlas {
|
||||
px = 71,
|
||||
|
|
@ -7,7 +7,7 @@ SMODS.Atlas {
|
|||
path = "tarot.png",
|
||||
}
|
||||
|
||||
q(SMODS.Consumable {
|
||||
local coolheaded = SMODS.Consumable {
|
||||
key = "coolheaded",
|
||||
pos = {x = 0, y = 0},
|
||||
config = {extra = {amount = 1}},
|
||||
|
|
@ -28,7 +28,7 @@ q(SMODS.Consumable {
|
|||
local highlighted = Bakery_API.get_highlighted()
|
||||
|
||||
return #G.jokers.highlighted + #highlighted == card.ability.extra.amount and
|
||||
f(G.jokers.highlighted):concat(highlighted):all(function(v)
|
||||
f(G.jokers.highlighted):concat(Bakery_API.get_highlighted()):all(function(v)
|
||||
return not v.edition
|
||||
end)
|
||||
end,
|
||||
|
|
@ -42,4 +42,8 @@ q(SMODS.Consumable {
|
|||
}
|
||||
end)
|
||||
end,
|
||||
})
|
||||
}
|
||||
|
||||
q(function()
|
||||
Bakery_API.credit(coolheaded)
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local f = (... or require "lib.shared")[1]
|
||||
local f = unpack(... or require "lib.shared")
|
||||
|
||||
if not Balatest then
|
||||
return
|
||||
|
|
@ -192,9 +192,9 @@ Balatest.TestPlay {
|
|||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"blind", "mitotic"},
|
||||
name = "mitotic",
|
||||
blind = "bl_Roland_mitotic",
|
||||
category = {"blind", "xerox"},
|
||||
name = "xerox",
|
||||
blind = "bl_Roland_xerox",
|
||||
execute = function()
|
||||
Balatest.discard {"2S"}
|
||||
end,
|
||||
|
|
@ -204,9 +204,9 @@ Balatest.TestPlay {
|
|||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"blind", "mitotic"},
|
||||
name = "mitotic_disabled",
|
||||
blind = "bl_Roland_mitotic",
|
||||
category = {"blind", "xerox"},
|
||||
name = "xerox_disabled",
|
||||
blind = "bl_Roland_xerox",
|
||||
jokers = {"j_chicot"},
|
||||
execute = function()
|
||||
Balatest.discard {"2S"}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,330 @@ if not Balatest then
|
|||
return
|
||||
end
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_none",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
execute = function() end,
|
||||
assert = function()
|
||||
Balatest.assert(not G.jokers.cards[1].config.center:Bakery_can_use(G.jokers.cards[1]))
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_one_consumable",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
consumeables = {"c_strength"},
|
||||
execute = function()
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_two_consumables",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
consumeables = {"c_strength", "c_strength"},
|
||||
execute = function()
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 3)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_one_tag",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
no_auto_start = true,
|
||||
execute = function()
|
||||
Balatest.skip_blind("tag_investment")
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_two_tags",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
no_auto_start = true,
|
||||
execute = function()
|
||||
Balatest.skip_blind("tag_investment")
|
||||
Balatest.skip_blind("tag_investment")
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 3)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_consumables_and_tags",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
consumeables = {"c_strength"},
|
||||
no_auto_start = true,
|
||||
execute = function()
|
||||
Balatest.skip_blind("tag_investment")
|
||||
Balatest.skip_blind("tag_investment")
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_partial_selected_consumables_and_tags",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
consumeables = {"c_strength", "c_strength"},
|
||||
no_auto_start = true,
|
||||
execute = function()
|
||||
Balatest.skip_blind("tag_investment")
|
||||
Balatest.skip_blind("tag_investment")
|
||||
|
||||
Balatest.q(function()
|
||||
G.consumeables:add_to_highlighted(G.consumeables.cards[1])
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "escape"},
|
||||
name = "escapey_full_selected_consumables_and_tags",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
consumeables = {"c_strength"},
|
||||
no_auto_start = true,
|
||||
execute = function()
|
||||
Balatest.skip_blind("tag_investment")
|
||||
Balatest.skip_blind("tag_investment")
|
||||
|
||||
Balatest.q(function()
|
||||
G.consumeables:add_to_highlighted(G.consumeables.cards[1])
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 3)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "fuse"},
|
||||
name = "escapey_fusion",
|
||||
jokers = {"j_Roland_escapey", "j_Roland_escapey"},
|
||||
execute = function()
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(#G.jokers.cards, 1)
|
||||
Balatest.assert_eq(G.jokers.cards[1].sell_cost, 8)
|
||||
Balatest.assert_eq(G.jokers.cards[1].ability.extra.levels, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "fuse"},
|
||||
name = "escapey_consumable_takes_precedence",
|
||||
jokers = {"j_Roland_escapey", "j_Roland_escapey"},
|
||||
consumeables = {"c_strength"},
|
||||
execute = function()
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(#G.jokers.cards, 2)
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "fuse"},
|
||||
name = "escapey_tag_takes_precedence",
|
||||
jokers = {"j_Roland_escapey", "j_Roland_escapey"},
|
||||
no_auto_start = true,
|
||||
execute = function()
|
||||
Balatest.skip_blind("tag_investment")
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(#G.jokers.cards, 2)
|
||||
Balatest.assert_eq(G.GAME.hands["High Card"].level, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "fuse"},
|
||||
name = "escapey_fusion_takes_precedence",
|
||||
jokers = {"j_Roland_escapey", "j_Roland_escapey"},
|
||||
consumeables = {"c_strength"},
|
||||
execute = function()
|
||||
Balatest.q(function()
|
||||
G.consumeables:add_to_highlighted(G.consumeables.cards[1])
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(#G.jokers.cards, 1)
|
||||
Balatest.assert_eq(G.jokers.cards[1].sell_cost, 8)
|
||||
Balatest.assert_eq(G.jokers.cards[1].ability.extra.levels, 2)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "fuse"},
|
||||
name = "escapey_scribe_fusion",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
execute = function()
|
||||
if not G.P_CENTERS.c_Bakery_Scribe then
|
||||
sendWarnMessage("escapey_scribe_fusion cannot run without c_Bakery_Scribe, skipping test.")
|
||||
return
|
||||
end
|
||||
|
||||
Balatest.q(function()
|
||||
local scribe = create_card(nil, G.consumeables, nil, nil, nil, nil, "c_Bakery_Scribe", "balatest")
|
||||
scribe:add_to_deck()
|
||||
G.consumeables:emplace(scribe)
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
|
||||
Balatest.q(function()
|
||||
G.jokers:add_to_highlighted(G.jokers.cards[1])
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
Balatest.use(function() return G.consumeables.cards[1] end)
|
||||
|
||||
Balatest.q(function()
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[1]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
if not G.P_CENTERS.c_Bakery_Scribe then
|
||||
return
|
||||
end
|
||||
|
||||
Balatest.assert_eq(#G.jokers.cards, 1)
|
||||
Balatest.assert_eq(G.jokers.cards[1].sell_cost, 8)
|
||||
Balatest.assert_eq(G.jokers.cards[1].ability.extra.levels, 1)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "escapey", "fuse"},
|
||||
name = "escapey_scribe_fusion_alt",
|
||||
jokers = {"j_Roland_escapey"},
|
||||
execute = function()
|
||||
if not G.P_CENTERS.c_Bakery_Scribe then
|
||||
sendWarnMessage("escapey_scribe_fusion_alt cannot run without c_Bakery_Scribe, skipping test.")
|
||||
return
|
||||
end
|
||||
|
||||
Balatest.q(function()
|
||||
local scribe = create_card(nil, G.consumeables, nil, nil, nil, nil, "c_Bakery_Scribe", "balatest")
|
||||
scribe:add_to_deck()
|
||||
G.consumeables:emplace(scribe)
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
|
||||
Balatest.q(function()
|
||||
G.jokers:add_to_highlighted(G.jokers.cards[1])
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
Balatest.use(function() return G.consumeables.cards[1] end)
|
||||
|
||||
Balatest.q(function()
|
||||
G.jokers:add_to_highlighted(G.jokers.cards[2])
|
||||
G.FUNCS.Bakery_use_joker {config = {ref_table = G.jokers.cards[2]}}
|
||||
end)
|
||||
|
||||
Balatest.wait()
|
||||
end,
|
||||
assert = function()
|
||||
if not G.P_CENTERS.c_Bakery_Scribe then
|
||||
return
|
||||
end
|
||||
|
||||
Balatest.assert_eq(#G.jokers.cards, 1)
|
||||
Balatest.assert_eq(G.jokers.cards[1].sell_cost, 8)
|
||||
Balatest.assert_eq(G.jokers.cards[1].ability.extra.levels, 1)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"joker", "martingale"},
|
||||
name = "martingale_oops",
|
||||
|
|
@ -10,7 +334,7 @@ Balatest.TestPlay {
|
|||
Balatest.play_hand {"2S"}
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_chips(7)
|
||||
Balatest.assert_chips(7 * 2)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -23,6 +347,6 @@ Balatest.TestPlay {
|
|||
Balatest.play_hand {"2S"}
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_chips(1 / 0)
|
||||
Balatest.assert_chips(7 * math.pow(2, 32))
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,22 @@ if not Balatest then
|
|||
return
|
||||
end
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"spectral", "afterimage"},
|
||||
name = "afterimage",
|
||||
consumeables = {"c_Roland_afterimage"},
|
||||
deck = {cards = {{s = "S", r = "2"}}},
|
||||
execute = function()
|
||||
Balatest.highlight({"2S"})
|
||||
Balatest.use(G.consumeables.cards[1])
|
||||
Balatest.end_round()
|
||||
end,
|
||||
assert = function()
|
||||
Balatest.assert_eq(G.hand.config.card_limit, 51)
|
||||
Balatest.assert(G.deck.cards[1].edition.negative)
|
||||
end,
|
||||
}
|
||||
|
||||
Balatest.TestPlay {
|
||||
category = {"spectral", "void"},
|
||||
name = "spectral",
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
||||
local f, q = unpack(... or require "lib.shared")
|
||||
|
||||
SMODS.Joker:take_ownership("joker", {cost = 1}, true)
|
||||
local orig_set_debuff = Card.set_debuff
|
||||
|
||||
function Card:set_debuff(should_debuff, ...)
|
||||
if self.ability.Roland_crimson ~= nil then
|
||||
self.ability.Roland_crimson = not not should_debuff
|
||||
return
|
||||
end
|
||||
|
||||
function Card:set_debuff(...)
|
||||
if SMODS.get_enhancements(self).m_wild and SMODS.Mods.Roland.config.no_wild_debuff then
|
||||
self.debuff = false
|
||||
else
|
||||
orig_set_debuff(self, should_debuff, ...)
|
||||
orig_set_debuff(self, ...)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -30,11 +26,10 @@ function Card:use_consumeable(area, copier, ...)
|
|||
return orig_use_consumeable(self, area, copier, ...)
|
||||
end
|
||||
|
||||
local card = copier or self
|
||||
|
||||
f(Bakery_API.get_highlighted()):each(function(v)
|
||||
q(function()
|
||||
play_sound "tarot1"
|
||||
local card = (copier or self)
|
||||
card:juice_up(0.3, 0.5)
|
||||
end)
|
||||
|
||||
|
|
@ -47,7 +42,13 @@ function Card:use_consumeable(area, copier, ...)
|
|||
}
|
||||
end)
|
||||
|
||||
q {delay = 0.7, trigger = "after", func = Bakery_API.unhighlight_all}
|
||||
q {
|
||||
delay = 0.7,
|
||||
trigger = "after",
|
||||
func = function()
|
||||
Bakery_API.unhighlight_all()
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local orig_use_card = G.FUNCS.use_card
|
||||
|
|
@ -67,10 +68,7 @@ function G.FUNCS.use_card(e, ...)
|
|||
discover_card(ref.config.center)
|
||||
ref:use_consumeable(ref.area)
|
||||
SMODS.calculate_context {area = ref.area, consumeable = ref, using_consumeable = true}
|
||||
|
||||
q(function()
|
||||
ref:remove()
|
||||
end)
|
||||
|
||||
if normal then
|
||||
return
|
||||
|
|
@ -102,11 +100,11 @@ local orig_get_blind_amount = get_blind_amount
|
|||
---@param ante number
|
||||
---@return table|number
|
||||
local function blind(ante)
|
||||
return ante == 39 and 1e294 or (to_number or f.id)(orig_get_blind_amount(ante))
|
||||
return ante == 39 and 1e294 or (_G["to_number"] or f.id)(orig_get_blind_amount(ante))
|
||||
end
|
||||
|
||||
local function no_harsh_ante_scaling()
|
||||
return not Talisman or not SMODS.Mods.Roland.config.harsh_ante_scaling
|
||||
return not _G["Talisman"] or not SMODS.Mods.Roland.config.harsh_ante_scaling
|
||||
end
|
||||
|
||||
function get_blind_amount(ante, ...)
|
||||
|
|
@ -120,10 +118,27 @@ function get_blind_amount(ante, ...)
|
|||
return 1 / 0
|
||||
end
|
||||
|
||||
local rem = tonumber(blind((ante % loop) + 1))
|
||||
local big, rem = _G["Big"], tonumber(blind((ante % loop) + 1))
|
||||
|
||||
return ante / 15 >= loop and Big:new(f(blind(ante - (loop * 15))):map(f.const(10)):table()) or
|
||||
(ante / 9 >= loop and Big:new(f(ante / loop - 8):map(f.const(10)):concat {rem}:table()) or
|
||||
(ante / 2 >= loop and Big:new {rem, ante / loop} or
|
||||
(Big.constants and Big.constants.TEN or Big:new {10}):pow(rem)))
|
||||
return ante / 15 >= loop and big:new(f(blind(ante - (loop * 15))):map(f.const(10)):table()) or
|
||||
(ante / 9 >= loop and big:new(f(ante / loop - 8):map(f.const(10)):concat {rem}:table()) or
|
||||
(ante / 2 >= loop and big:new {rem, ante / loop} or
|
||||
(big.constants and big.constants.TEN or big:new {10}):pow(rem)))
|
||||
end
|
||||
|
||||
q(function()
|
||||
local scribe = G.P_CENTERS.c_Bakery_Scribe
|
||||
|
||||
if not scribe then
|
||||
return true
|
||||
end
|
||||
|
||||
local orig_can_use = scribe.can_use
|
||||
|
||||
function scribe.can_use(...)
|
||||
return orig_can_use(...) and
|
||||
(SMODS.Mods.Roland.config.scribable_basket or f(G.jokers.highlighted):all(function(v)
|
||||
return v.config.center.key ~= "j_Roland_basket"
|
||||
end))
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
local voucher = (function()
|
||||
local x = 0
|
||||
|
||||
---@param tbl SMODS.Voucher|{attributes: Attributes[]}
|
||||
---@return SMODS.Voucher
|
||||
return function(tbl)
|
||||
tbl.pos = {x = x, y = 0}
|
||||
tbl.atlas = "voucher"
|
||||
tbl.cost = 10
|
||||
x = x + 1
|
||||
return SMODS.Voucher(tbl)
|
||||
end
|
||||
end)()
|
||||
|
||||
SMODS.Atlas {
|
||||
px = 71,
|
||||
py = 95,
|
||||
key = "voucher",
|
||||
path = "voucher.png",
|
||||
}
|
||||
|
||||
voucher {
|
||||
key = "ceres",
|
||||
pronouns = "it_its",
|
||||
config = {extra = {amount = 1, hand_type = "Flush House"}},
|
||||
attributes = {"planet", "passive", "hand_type", "space"},
|
||||
loc_vars = function(_, _, card)
|
||||
return {vars = {card.ability.extra.amount}}
|
||||
end,
|
||||
in_pool = function(self)
|
||||
return G.GAME.hands[self.config.extra.hand_type].visible
|
||||
end,
|
||||
}
|
||||
|
||||
voucher {
|
||||
key = "neptune",
|
||||
pronouns = "it_its",
|
||||
requires = {"v_Roland_ceres"},
|
||||
config = {extra = {amount = 2, hand_type = "Straight Flush"}},
|
||||
attributes = {"planet", "passive", "hand_type", "space"},
|
||||
loc_vars = function(_, _, card)
|
||||
return {vars = {card.ability.extra.amount}}
|
||||
end,
|
||||
}
|
||||