Compare commits

..

24 commits
2.9.69 ... main

Author SHA1 Message Date
4b8094efab
Ensure table is mutated before use 2026-08-16 16:25:54 +02:00
374aa5ec24
Fix 2 pixel discrepancy 2026-08-12 18:31:50 +02:00
7d2bd84c9f
Add a README. Mod is ready for the public! 2026-08-06 21:03:11 +02:00
31627f836d
Fix logic 2026-08-03 23:37:14 +02:00
58b1ee9a63
Fix incompatibility 2026-08-03 23:29:48 +02:00
407c18dc6e
Add a familiar joker, add new art 2026-08-03 18:38:17 +02:00
ff55a27567
Improve stability of Frozen and debugging tools 2026-07-31 05:25:52 +02:00
178e415614
Account for quantity in leveling up 2026-07-27 20:53:55 +02:00
f126173091
Add compatibility patch 2026-07-27 20:51:42 +02:00
27ce5bbb2e
Make bulk use very fast 2026-07-27 20:23:21 +02:00
4fda3af9c0
Make bulk use consistent with use RNG 2026-07-27 20:17:33 +02:00
ad24529beb
Add bulk use for Afterimage 2026-07-27 19:58:41 +02:00
fd9ad55325
Add qty support in Basket 2026-07-27 19:42:30 +02:00
44367939a6
Make negative copies silent 2026-07-27 19:31:49 +02:00
f170f855a1
Make Arctic Circle retriggers more generic 2026-07-27 14:43:32 +02:00
4619a24736
Rewrite Arctic Circle to be uncapped without crashing 2026-07-27 12:55:58 +02:00
9f19d85769
Fix consumables being usable without any selected cards 2026-07-27 11:46:07 +02:00
8edd1c1c73
Loosen consumable usage requirements 2026-07-24 18:41:43 +02:00
2628ae39e6
Hotfix 2026-07-22 04:51:18 +02:00
5e5abf42aa
Vastly improve funky.lua 2026-07-22 03:58:23 +02:00
b6b49350cb
Do not override editions, again 2026-07-21 21:57:39 +02:00
e8d0b74a1d
Do not override editions 2026-07-21 17:43:37 +02:00
b4b05d37dc
Fix off-by-one 2026-07-21 01:21:49 +02:00
5204ba71a0
Make harsh ante scaling even harsher 2026-07-21 01:05:36 +02:00
20 changed files with 522 additions and 145 deletions

52
README.md Normal file
View file

@ -0,0 +1,52 @@
# Roland
[![License](https://img.shields.io/github/license/Emik03/Roland.svg?color=6272a4&style=for-the-badge)](https://github.com/Emik03/Roland/blob/main/LICENSE)
This is a [Steamodded](https://github.com/Steamodded/smods) mod for the video game [Balatro (2024)](https://playbalatro.com).
This mod has been in the works since early 2025, and been worked on continously until its official public release as a celebration for my 23rd birthday.
---
- [About](#about)
- [Contents](#contents)
- [Installation](#installation)
- [License](#license)
---
## About
The main theme of this mod centers around the addition of a new edition: Frozen.
Frozen can be applied to playing cards or jokers and will cause whatever state they have to be locked in place, removing any possibility of future scaling; positive or negative.
The primary goal is to create interesting interactions in-and-outside of the added editions. This does not necessarily mean that these mechanics have to be balanced, but does hopefully make new strategies viable and breathe new life into some of the base game's weaker jokers. It is designed to work very well with its parent mod [Bakery](https://github.com/BakersDozenBagels/BalatroBakery), but can work just as well on its own or with other content mods.
The mod offers a config for accessibility options, general convenience, modifications that I believe make the game healthier, and otherwise purely cosmetic.
## Contents
- 31 Jokers
- 1 Tarot Card
- 4 Spectral Cards
- 2 Vouchers
- 1 Seal
- 1 Edition
- 2 Tags
- 9 Blinds
- 4 Decks
- 4 [Deck Sleeves (CardSleeves)](https://github.com/larswijn/CardSleeves)
- 5 [Charms (Bakery)](https://github.com/BakersDozenBagels/BalatroBakery)
## Installation
1. Set up [Steamodded](https://github.com/Steamodded/smods/wiki#i-want-to-play-with-mods).
2. Set up [Bakery](https://github.com/BakersDozenBagels). You are free to use the [Lite version](https://github.com/BakersDozenBagels/BalatroBakery/tree/lite) if you want to play Roland standalone.
3. Clone the repository into your mods folder, or download it as a zip and place it there.
## License
This repository falls under the [MPL-2 license](https://www.mozilla.org/en-US/MPL/2.0/).
You may copy individual or multiple source files, granted that you keep the copyright license, and disclose the source back to this repository.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -414,6 +414,16 @@ return {
text = {"{X:red,C:white}X#1#{} discards each round"},
unlock = {"Defeat {C:dark_edition}#1#"},
},
j_Roland_yard = {
name = "Yard Sale",
text = {
"Gain {C:money}$#1#{} when a",
"card is {C:attention}added",
"or {C:attention}removed",
"from the deck",
},
unlock = {"Complete the", "{C:attention}#1#", "challenge"},
},
},
Other = {
roland_glass_seal = {
@ -594,7 +604,7 @@ return {
c_Roland_Jokerful = "Jokerful",
c_Roland_Pastries = "Sweet Pastries",
c_Roland_Spin_To_Win = "Spin to Win",
c_Roland_Yard_Sale = "Yard Sale",
c_Roland_Spring_Cleaning = "Spring Cleaning",
},
v_dictionary = {
b_Roland_add = "ADD",
@ -634,8 +644,6 @@ return {
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_Yard_Sale1 = {"Gain {C:money}$5 {}when playing cards are {C:attention}added {}or {C:attention}removed"},
ch_c_Roland_Yard_Sale2 = {"Earn {C:red}no money {}from any other source"},
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"},
@ -644,6 +652,7 @@ return {
ch_c_Roland_Showdown_Crimson = {"Showdown blinds are {C:attention}Crimson Heart {}(stacks with above)"},
ch_c_Roland_Showdown_Verdant = {"Showdown blinds are {C:attention}Verdant Leaf {}(stacks with above)"},
ch_c_Roland_Showdown_Violet = {"Showdown blinds are {C:attention}Violet Vessel {}(stacks with above)"},
ch_c_Roland_Spring_Cleaning = {"Earn {C:red}no money {}from sources other than {C:attention}Yard Sale"},
},
},
}

View file

@ -65,6 +65,18 @@ position = "at"
payload = "elseif G.GAME.blind_on_deck == 'Big' then"
match_indent = true
# Prevent Incantation from overriding Faster Planets
[[patches]]
[patches.pattern]
target = '=[SMODS incantation "Incantation.lua"]'
pattern = "function Card:use_consumeable(area, copier)"
position = "after"
payload = """if SMODS.Mods.Roland.config.faster_planets and
self.ability.consumeable.hand_type then
return useconsumeref(self, area, copier)
end"""
match_indent = true
# Misfortune Cookie
[[patches]]
[patches.pattern]
@ -83,7 +95,7 @@ pattern = "local card = create_card('Tarot',G.consumeables, nil, nil, nil, nil,
position = "after"
times = 1
payload = """if next(SMODS.find_card "j_Roland_misfortune") then
card:set_edition "e_negative"
card:set_edition("e_negative", true, true)
end"""
match_indent = true
@ -105,7 +117,7 @@ target = "card.lua"
pattern = "local card = create_card(card_type,G.consumeables, nil, nil, nil, nil, _planet, 'blusl')"
position = "after"
payload = """if next(SMODS.find_card "j_Roland_misfortune") then
card:set_edition "e_negative"
card:set_edition("e_negative", true, true)
end"""
match_indent = true

View file

@ -3,7 +3,7 @@
"id": "Roland",
"name": "Roland",
"prefix": "Roland",
"version": "2.9.69",
"version": "3.0.2",
"badge_colour": "8BE9FD",
"display_name": "Roland",
"main_file": "src/main.lua",

View file

@ -80,10 +80,10 @@ back {
pronouns = "any_all",
config = {extra = {alt_times = 9, times = 3}},
attributes = {"passive", "boss_blind"},
loc_vars = function(self, _, _)
loc_vars = function(self)
return {vars = {self.config.extra.alt_times}}
end,
apply = function(_, _)
apply = function()
G.GAME.modifiers.Roland_blossom_deck = true
end,
calculate = function(self, b, context)

View file

@ -257,7 +257,7 @@ blind {
boss = {min = 6},
boss_colour = HEX "bdaeccff",
pronouns = "they_them",
collection_loc_vars = function(_)
collection_loc_vars = function()
return {
vars = {localize {
type = "variable",
@ -265,7 +265,7 @@ blind {
}},
}
end,
loc_vars = function(_)
loc_vars = function()
local _, name = common_rank()
return {vars = {localize(name or "Ace", "ranks")}}
end,
@ -319,7 +319,7 @@ blind {
dollars = 5,
defeat = disable_improbable,
disable = disable_improbable,
set_blind = function(_)
set_blind = function()
G.GAME.modifiers.Roland_improbable = true
end,
}
@ -380,7 +380,7 @@ function SMODS.current_mod:calculate(context)
:map(f.index_into(G.P_CENTERS))
:where("config.extra.hand_type", context.scoring_name)
:pun "SMODS.Voucher"
:each(function(v, _)
:each(function(v)
SMODS.smart_level_up_hand(nil, v.config.extra.hand_type, false, v.config.extra.amount)
end)

View file

@ -40,7 +40,7 @@ end
---@param v SMODS.GameObject
---@return boolean|string
local function is_economy(v)
return f(Bakery_API.econ_only_items):where(f.id, v.key):any()
return f(Bakery_API.econ_only_items):where(f.eq(v.key)):any()
end
---@param key string
@ -82,26 +82,22 @@ SMODS.Challenge {
end,
}
local yard_sale
SMODS.Challenge {
key = "Yard_Sale",
config = {extra = {dollars = 5}, no_interest = true},
key = "Spring_Cleaning",
config = {no_interest = true},
consumeables = {{id = "c_hanged_man"}},
jokers = {{id = "j_Roland_yard"}, {id = "j_Roland_yard"}},
vouchers = {{id = "v_magic_trick"}, {id = "v_overstock_norm"}},
rules = {custom = multirule("Yard_Sale", 2), modifiers = {{id = "dollars", value = 14}}},
rules = {custom = {{id = "Roland_Spring_Cleaning"}}},
restrictions = yard,
apply = function()
G.GAME.modifiers.no_blind_reward = {Small = true, Big = true, Boss = true}
G.GAME.modifiers.no_extra_hand_money = true
f(Bakery_API.econ_only_items):keys():each(function(v)
f(Bakery_API.econ_only_items):keys():where(f.nq "j_Roland_yard"):each(function(v)
G.GAME.banned_keys[v] = true
end)
end,
calculate = function(self, context)
yard_sale = (context.playing_card_added or context.remove_playing_cards) and not context.blueprint
return yard_sale and {dollars = self.config.extra.dollars * #(context.cards or context.removed or {})} or nil
end,
}
SMODS.Challenge {
@ -342,12 +338,14 @@ q {
return false
end
table.insert(Bakery_API.econ_only_items, "j_Roland_yard")
table.insert(Bakery_API.econ_only_items, "j_Roland_artemis")
local orig = Bakery_API.no_money_decks
Bakery_API.no_money_decks = setmetatable({}, {
orig = orig,
__index = function(_, k)
return (G.GAME or {}).challenge == "c_Roland_Yard_Sale" and not yard_sale or orig[k]
return (G.GAME or {}).challenge == "c_Roland_Spring_Cleaning" or orig[k]
end,
})

View file

@ -10,11 +10,6 @@ return {
fg = HEX "362708ff",
bg = HEX "edd198ff",
},
char = {
name = "char (@irregulester)",
fg = HEX "f8f8f2ff",
bg = HEX "ff79c6ff",
},
ghostlyfield = {
name = "ghostlyfield",
fg = HEX "ffffffff",

View file

@ -329,8 +329,6 @@ function Card:calculate_dollar_bonus(...)
return orig_calculate_dollar_bonus(self, ...)
end
local orig_get_probability_vars = SMODS.get_probability_vars
function SMODS.current_mod.bootstraps_mult(card)
local ability = card.Roland_frozen_ability
local ret = math.floor((G.GAME.dollars + (G.GAME.dollar_buffer or 0)) / card.ability.extra.dollars)
@ -343,9 +341,17 @@ function SMODS.current_mod.bootstraps_mult(card)
return ability.Roland_bootstraps_mult
end
local orig_get_probability_vars = SMODS.get_probability_vars
function SMODS.get_probability_vars(trigger_obj, ...)
local numerator, denominator = orig_get_probability_vars(trigger_obj, ...)
return trigger_obj and (trigger_obj.Roland_frozen or {}).probability or numerator, denominator
local override = ((trigger_obj or {}).Roland_frozen or {}).probability
if override then
return type(denominator) == "table" and to_big(override) or override, denominator
else
return numerator, denominator
end
end
q {

View file

@ -54,25 +54,10 @@ local joker = (function()
end
end)()
---@generic T
---@param tbl T[]
---@return fun(t: T[], i: integer): integer, T
---@return T[]
local function ipairs_reversed(tbl)
return function(t, i)
local k = i and i - 1 or #t
local v = t[k]
if v ~= nil then
return k, v
end
end, tbl
end
---@param card Card
---@return boolean
local function is_frozen(card)
return card and card.edition and card.edition.key == "e_Roland_frozen"
return card and card.edition and card.edition.Roland_frozen
end
---@param card? Card|false|{suit: string, value: string}
@ -211,8 +196,8 @@ joker {
joker {
key = "sunny",
pronouns = "it_its",
artist = "char",
idea = "redstoad",
artist = "ghostlyfield",
attributes = {"food", "on_sell"},
cost = 2,
rarity = 1,
@ -233,8 +218,8 @@ 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,
hand_drawn = facing_blind and {G.deck.cards[1]} or true,
other_drawn = not facing_blind and {G.deck.cards[1]} or true,
first_hand_drawn = not current_round.any_hand_drawn and facing_blind or nil,
}
@ -258,14 +243,15 @@ joker {
table.insert(info_queue, G.P_CENTERS.e_Roland_frozen)
end,
calculate = function(_, _, context)
return (context.selling_self or context.forcetrigger) and f(G.hand.cards):each(function(v)
q {
delay = 0.1,
func = function()
v:set_edition {Roland_frozen = true}
end,
}
end) or nil
return (context.selling_self or context.forcetrigger) and
f(G.hand.cards):where("edition", false):each(function(v)
q {
delay = 0.1,
func = function()
v:set_edition {Roland_frozen = true}
end,
}
end) or nil
end,
}
@ -288,7 +274,9 @@ joker {
delay = 1,
func = function()
play_sound "timpani"
SMODS.add_card {edition = "e_negative", key = v.config.center.key}
SMODS.add_card {edition = "e_negative", key = v.config.center.key, silent = true}
.ability.qty = v.ability.qty
end,
}
end) or nil
@ -298,7 +286,7 @@ joker {
joker {
key = "monomino",
pronouns = "it_its",
artist = "char",
artist = "ghostlyfield",
config = {extra = {price = 4, hand_name = "Four of a Kind"}},
attributes = {"sell_value", "scaling", "economy", "hand_type"},
cost = 4,
@ -327,7 +315,7 @@ joker {
joker {
key = "domino",
pronouns = "it_its",
artist = "char",
artist = "ghostlyfield",
config = {extra = {mult_gain = 4, hand_name = "Four of a Kind", mult = 0}},
attributes = {"mult", "scaling", "hand_type"},
cost = 4,
@ -358,7 +346,7 @@ joker {
joker {
key = "trimino",
pronouns = "it_its",
artist = "char",
artist = "ghostlyfield",
config = {extra = {times = 4, hand_name = "Four of a Kind"}},
attributes = {"generation", "hand_type"},
cost = 8,
@ -417,7 +405,7 @@ joker {
joker {
key = "misfortune",
pronouns = "she_they",
artist = "char",
artist = "ghostlyfield",
attributes = {"discard", "passive", "tarot", "planet", "generation", "seals"},
cost = 6,
rarity = 2,
@ -437,6 +425,7 @@ joker {
joker {
key = "polaris",
pronouns = "he_him",
artist = "ghostlyfield",
attributes = {"editions", "space"},
cost = 6,
rarity = 1,
@ -509,6 +498,7 @@ joker {
joker {
key = "snowsquall",
pronouns = "he_they",
artist = "ghostlyfield",
config = {extra = {mult_gain = 3, mult = 0}},
attributes = {"mult", "scaling", "hand_type"},
cost = 6,
@ -540,13 +530,37 @@ joker {
end,
}
---comment
---@param card Card
---@param context table|CalcContext
---@return function
local function copy(card, context)
---@param v Card
return function(v)
local override_compat = v.config.center.blueprint_compat == nil
if override_compat then
v.config.center.blueprint_compat = true
end
local ret = SMODS.blueprint_effect(card, v, context)
if override_compat then
v.config.center.blueprint_compat = nil
end
return ret
end
end
joker {
key = "arctic",
pronouns = "they_them",
artist = "ghostlyfield",
cost = 10,
rarity = 3,
config = {extra = {frozen = 1, non_frozen = 0, max_stack = 6, color = "DARK_EDITION"}},
attributes = {"retrigger", "editions"},
config = {extra = {frozen = 1, non_frozen = 0, color = "DARK_EDITION"}},
attributes = {"retrigger", "editions", "copying"},
eternal_compat = true,
blueprint_compat = true,
perishable_compat = true,
@ -556,9 +570,9 @@ joker {
calculate = function(_, card, context)
local extra = card.ability.extra
if extra.max_stack and
context.blueprint_copiers_stack and
extra.max_stack < #context.blueprint_copiers_stack then
if f(context.blueprint_copiers_stack)
:where("config.center.key", card.config.center.key)
:any() then
return
end
@ -571,14 +585,15 @@ joker {
end
return SMODS.merge_effects(
f(G.jokers.cards):where(is_frozen):where(function(v)
return v.config.center.key ~= card.config.center.key
end):map(function(v)
return SMODS.blueprint_effect(card, v, context)
end):where(type, "table"):map(function(v)
v.colour = G.C[extra.color]
return v
end):values():table()
f(G)
:where(getmetatable, CardArea)
:flatmap("cards", ipairs)
:where(is_frozen)
:map(copy(card, context))
:where(type, "table")
:map(f.insert(G.C[extra.color], "colour"))
:values()
:table()
)
end,
}
@ -586,8 +601,8 @@ joker {
joker {
key = "sapling",
pronouns = "they_them",
artist = "char",
idea = "redstoad",
artist = "ghostlyfield",
attributes = {"mult", "suit"},
cost = 4,
rarity = 1,
@ -720,9 +735,9 @@ 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)
local r = G.jokers.cards[v.rank + 1]
local debuffed_by_crimson = r and not r.debuff and r.config.center.key == "j_Roland_crimson"
local _ = G.jokers and f(G.jokers.cards, f.revpairs):where(is_frozen, false):each(function(v)
local right = G.jokers.cards[v.rank + 1]
local debuffed_by_crimson = right and not right.debuff and right.config.center.key == "j_Roland_crimson"
if debuffed_by_crimson and v.ability.Roland_crimson == nil then
local debuff = not not v.debuff
@ -824,6 +839,7 @@ joker {
joker {
key = "venerable",
pronouns = "any_all",
artist = "ghostlyfield",
defeated_blind = "bl_Roland_venerable_visage",
config = {extra = {xdiscard = 3}},
pixel_size = {w = 68, h = 68},
@ -850,11 +866,45 @@ joker {
ease_discard(round_resets.discards - discards)
end,
}
joker {
key = "yard",
pronouns = "he_him",
artist = "ghostlyfield",
config = {extra = {dollars = 3}},
attributes = {"economy"},
cost = 6,
rarity = 1,
unlocked = true,
discovered = true,
eternal_compat = true,
blueprint_compat = true,
perishable_compat = true,
check_for_unlock = function()
return not not f.indices "challenge_progress.completed.c_Roland_Spring_Cleaning" (G.PROFILES[G.SETTINGS.profile])
end,
locked_loc_vars = function()
return {vars = {localize("c_Roland_Spring_Cleaning", "challenge_names")}}
end,
loc_vars = function(_, _, card)
return {vars = {card.ability.extra.dollars}}
end,
calculate = function(_, card, c)
local ret = (c.forcetrigger or c.playing_card_added or c.remove_playing_cards) and
{dollars = card.ability.extra.dollars * #(c.cards or c.removed or {c.forcetrigger})} or nil
if ret and (G.GAME or {}).challenge == "c_Roland_Spring_Cleaning" then
G.GAME.dollars = G.GAME.dollars + ret.dollars
else
return ret
end
end,
}
joker {
key = "bulldozer",
pronouns = "she_her",
idea = "redstoad",
artist = "ghostlyfield",
attributes = {"xmult"},
cost = 6,
rarity = 2,
@ -917,8 +967,8 @@ joker {
joker {
key = "nilly",
pronouns = "any_all",
artist = "ghostlyfield",
idea = "redstoad",
artist = "ghostlyfield",
config = {extra = {flipped = false}},
attributes = {"xmult", "bakery_double_sided"},
cost = 0,
@ -954,6 +1004,7 @@ joker {
key = "martingale",
pronouns = "he_him",
idea = "redstoad",
artist = "ghostlyfield",
config = {extra = {odds = 2}},
attributes = {"xmult", "chance"},
cost = 8,
@ -1017,6 +1068,7 @@ joker {
joker {
key = "idle",
pronouns = "any_all",
artist = "ghostlyfield",
rarity = 2,
Roland_idle_capacity = 6,
cost = G.P_CENTERS.j_idol.cost,
@ -1093,6 +1145,7 @@ joker {
joker {
key = "suitable",
pronouns = "she_they",
artist = "ghostlyfield",
attributes = {"suit", "passive", "hearts", "diamonds", "spades", "clubs"},
cost = 4,
rarity = 2,
@ -1145,8 +1198,8 @@ end
joker {
key = "artemis",
pronouns = "any_all",
artist = "hamester",
idea = "redstoad",
artist = "hamester",
cost = 6,
rarity = 2,
config = {extra = {
@ -1212,6 +1265,7 @@ joker {
key = "excalibur",
pronouns = "he_him",
idea = "redstoad",
artist = "ghostlyfield",
cost = 8,
rarity = 3,
config = {extra = {
@ -1283,7 +1337,7 @@ joker {
joker {
key = "oops",
pronouns = "she_they",
artist = "char",
artist = "ghostlyfield",
cost = 7,
rarity = 3,
config = {extra = {probability = 1, probability_mult = 2, reset = 1}},
@ -1317,15 +1371,3 @@ joker {
end
end,
}
q {
blocking = false,
no_delete = true,
func = function()
if not Bakery_API then
return false
end
table.insert(Bakery_API.econ_only_items, "j_Roland_artemis")
end,
}

View file

@ -8,6 +8,42 @@
local f = {}
if not f then
---@generic T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R
---@param self F
---@param first? T1
---@param second? T2
---@param third? T3
---@param fourth? T4
---@param fifth? T5
---@param sixth? T6
---@param seventh? T7
---@param eighth? T8
---@param ninth? T9
---@param tenth? T10
---@return fun(v: fun(first: T1, second: T2, third: T3, fourth: T4, fifth: T5, sixth: T6, seventh: T7, eighth: T8, ninth: T9, tenth: T10): R): R
---@nodiscard
function f:call(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth)
error {first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth}
end
---@generic T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R
---@param self string
---@param first? T1
---@param second? T2
---@param third? T3
---@param fourth? T4
---@param fifth? T5
---@param sixth? T6
---@param seventh? T7
---@param eighth? T8
---@param ninth? T9
---@param tenth? T10
---@return fun(v: {[string]: fun(self: self, first: T1, second: T2, third: T3, fourth: T4, fifth: T5, sixth: T6, seventh: T7, eighth: T8, ninth: T9, tenth: T10): R}): R
---@nodiscard
function f.call(self, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth)
error {self, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth}
end
---@generic I, O
---@param first integer|string|fun(v: I): O
---@return fun(v: I): O
@ -98,6 +134,96 @@ if not f then
error(all)
end
---@generic I, O
---@param first integer|string|fun(v: I): O
---@return fun(v: I): O
---@nodiscard
function f.compose(first)
error {first}
end
---@generic I, T, O
---@param first integer|string|fun(v: T): O
---@param second integer|string|fun(v: I): T
---@return fun(v: I): O
---@nodiscard
function f.compose(first, second)
error {first, second}
end
---@generic I, T1, T2, O
---@param first integer|string|fun(v: T2): O
---@param second integer|string|fun(v: T1): T2
---@param third integer|string|fun(v: I): T1
---@return fun(v: I): O
---@nodiscard
function f.compose(first, second, third)
error {first, second, third}
end
---@generic I, T1, T2, T3, O
---@param first integer|string|fun(v: T3): O
---@param second integer|string|fun(v: T2): T3
---@param third integer|string|fun(v: T1): T2
---@param fourth integer|string|fun(v: I): T1
---@return fun(v: I): O
---@nodiscard
function f.compose(first, second, third, fourth)
error {first, second, third, fourth}
end
---@generic I, T1, T2, T3, T4, O
---@param first integer|string|fun(v: T4): O
---@param second integer|string|fun(v: T3): T4
---@param third integer|string|fun(v: T2): T3
---@param fourth integer|string|fun(v: T1): T2
---@param fifth integer|string|fun(v: I): T1
---@return fun(v: I): O
---@nodiscard
function f.compose(first, second, third, fourth, fifth)
error {first, second, third, fourth, fifth}
end
---@generic I, O
---@param all { [1]: (integer|string|fun(v: I): O) }
---@return fun(v: I): O
---@nodiscard
function f.compose(all)
error(all)
end
---@generic I, T, O
---@param all { [1]: (integer|string|fun(v: T): O), [2]: (integer|string|fun(v: I): T) }
---@return fun(v: I): O
---@nodiscard
function f.compose(all)
error(all)
end
---@generic I, T1, T2, O
---@param all { [1]: (integer|string|fun(v: T2): O), [2]: (integer|string|fun(v: T1): T2), [3]: (integer|string|fun(v: I): T1) }
---@return fun(v: I): O
---@nodiscard
function f.compose(all)
error(all)
end
---@generic I, T1, T2, T3, O
---@param all { [1]: (integer|string|fun(v: T3): O), [2]: (integer|string|fun(v: T2): T3), [3]: (integer|string|fun(v: T1): T2), [4]: (integer|string|fun(v: I): T1) }
---@return fun(v: I): O
---@nodiscard
function f.compose(all)
error(all)
end
---@generic I, T1, T2, T3, T4, O
---@param all { [1]: (integer|string|fun(v: T4): O), [2]: (integer|string|fun(v: T3): T4), [3]: (integer|string|fun(v: T2): T3), [4]: (integer|string|fun(v: T1): T2), [4]: (integer|string|fun(v: I): T1) }
---@return fun(v: I): O
---@nodiscard
function f.compose(all)
error(all)
end
---@generic K, V
---@param self F | { [K]: V }
---@return K?, V?
@ -169,7 +295,7 @@ end
---@generic T
---@param value T
---@return fun(T): boolean
---@return fun(v: T): boolean
---@nodiscard
function f.eq(value)
return function(v)
@ -252,6 +378,36 @@ function f.indices(v)
end
end
---@generic K, V
---@param v V
---@param k K
---@return fun(x: { [K]: V }): { [K]: V }
---@nodiscard
function f.insert(v, k)
return function(x)
if type(x) == "table" then
x[k] = v
end
return x
end
end
---@generic T
---@param tbl T[]
---@return fun(t: T[], i?: integer): integer, T
---@return T[]
function f.revpairs(tbl)
return function(t, i)
local k = i and i - 1 or #t
local v = t[k]
if v ~= nil then
return k, v
end
end, tbl
end
---@param any any
---@return boolean
---@nodiscard
@ -259,10 +415,24 @@ function f.isf(any)
return type(any) == "table" and any.from == f.from and any.new == f.new
end
local unpack = table.unpack or unpack
f[true and "call"] = function(self, ...)
local args = {...}
return type(self) == "string" and function(v)
return v[self](v, unpack(args))
end or function(v)
return v(unpack(args))
end
end
f[true and "chain"] = function(...)
local ret
for _, v in ipairs {...} do
v = f.isf(v) and v:table() or v
if type(v) == "table" then
for _, vv in ipairs(v) do
local copy = ret
@ -285,6 +455,10 @@ f[true and "chain"] = function(...)
return ret or f.noop
end
f[true and "compose"] = function(...)
return f.chain(f.from({...}, f.revpairs):values())
end
---@generic K, V
---@param fnext? fun(): K?, V?
---@return F|{ [K]: V }
@ -295,7 +469,9 @@ function f.new(fnext)
all = f.all,
any = f.any,
arg = f.arg,
call = f.call,
chain = f.chain,
compose = f.compose,
concat = f.concat,
const = f.const,
count = f.count,
@ -310,6 +486,7 @@ function f.new(fnext)
index = f.index,
index_into = f.index_into,
indices = f.indices,
insert = f.insert,
isf = f.isf,
keys = f.keys,
map = f.map,
@ -319,6 +496,8 @@ function f.new(fnext)
nq = f.nq,
peek = f.peek,
pun = f.pun,
rev = f.rev,
revpairs = f.revpairs,
skip = f.skip,
slice = f.slice,
string = f.string,
@ -377,10 +556,10 @@ function f.from(iter, fpairs, step)
end
end)
else
local next, context, k, v = autopairs(iter, type(fpairs) == "function" and fpairs or nil)
local next, tbl, k, v = autopairs(iter, type(fpairs) == "function" and fpairs or nil)
return f.new(function()
k, v = next(context, k)
k, v = next(tbl, k)
return k, v
end)
end
@ -392,12 +571,14 @@ end
---@return F|{ [K]: V }
---@nodiscard
function f:concat(...)
self = f.isf(self) and self or f.from(self)
local fsi = 0
local fs = {...}
local sum, last = 0, 0
for i = 1, #fs do
fs[i] = f.isf(fs[i]) and fs[i] or f.from(fs[i])
local s = fs[i]
fs[i] = f.isf(s) and s or f.from(s)
end
return f.new(function()
@ -431,6 +612,7 @@ end
---@return F|{ [K]: V }
---@nodiscard
function f:peek(func)
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
return f.new(function()
@ -450,6 +632,7 @@ end
---@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: U }
---@nodiscard
function f:map(func)
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
return f.new(function()
@ -469,11 +652,14 @@ end
---@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
function f:flatmap(func, fpairs)
self = f.isf(self) and self or f.from(self)
-- local i = 0
local vt, vk, vv, vp
local vt, vk, vp
func = autofunc(func)
return f.new(function()
local vv
if vk then
vk, vv = vp(vt, vk)
@ -519,6 +705,7 @@ end
---@nodiscard
---@overload fun(self: F|{ [K]: V }, func: string, is?: any): F|{ [K]: V }
function f:where(func, is)
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
return f.new(function()
@ -551,6 +738,7 @@ end
---@return F|{ [integer]: K }
---@nodiscard
function f:keys()
self = f.isf(self) and self or f.from(self)
local i = 0
return f.new(function()
@ -568,6 +756,7 @@ end
---@return F|{ [integer]: V }
---@nodiscard
function f:values()
self = f.isf(self) and self or f.from(self)
local i = 0
return f.new(function()
@ -585,6 +774,8 @@ end
---@return F|{ [V]: K }
---@nodiscard
function f:swap()
self = f.isf(self) and self or f.from(self)
return f.new(function()
local k, v = self:next()
@ -594,6 +785,28 @@ function f:swap()
end)
end
---@generic K, V
---@param self F|{ [K]: V }
---@return F|{ [K]: V }
---@nodiscard
function f:rev()
self = f.isf(self) and self or f.from(self)
local t, p, k
return f.new(function()
if not t then
p, t = f.revpairs(self:table())
end
local v
k, v = p(t, k)
if k ~= nil then
return k, v
end
end)
end
---@generic K, V
---@param self F|{ [K]: V }
---@param skip? integer
@ -601,6 +814,8 @@ end
---@return F|{ [K]: V }
---@nodiscard
function f:slice(skip, take)
self = f.isf(self) and self or f.from(self)
if (not skip or skip <= 0) and not take then
return self
end
@ -632,6 +847,7 @@ end
---@return F|{ [K]: V }
---@nodiscard
function f:skip(n)
self = f.isf(self) and self or f.from(self)
return self:slice(n)
end
@ -641,6 +857,7 @@ end
---@return F|{ [K]: V }
---@nodiscard
function f:take(n)
self = f.isf(self) and self or f.from(self)
return self:slice(0, n)
end
@ -652,6 +869,7 @@ end
---@overload fun(self: F|{ [K]: V }, seed: fun(a: A, v: V, k: K): A): A
---@nodiscard
function f:fold(seed, func)
self = f.isf(self) and self or f.from(self)
local k, v
if not func then
@ -681,6 +899,7 @@ end
---@overload fun(self: F|{ [K]: V }, func: string?): boolean|V
---@nodiscard
function f:any(func)
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
for k, v in self.next do
@ -699,6 +918,7 @@ end
---@overload fun(self: F|{ [K]: V }, func: string?): boolean|V
---@nodiscard
function f:all(func)
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
for k, v in self.next do
@ -717,8 +937,9 @@ end
---@overload fun(self: F|{ [K]: V }, func: string): integer
---@nodiscard
function f:count(func)
local ret = 0
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
local ret = 0
for k, v in self.next do
if not func or func(v, k) then
@ -733,15 +954,16 @@ end
---@param self F|{ [K]: V }
---@param other { [K]: V }
---@param func? fun(v: V, k: K): any
---@return K?
---@return K?, V?
---@overload fun(self: F|{ [K]: V }, func: string): integer
---@nodiscard
function f:diff(other, func)
self = f.isf(self) and self or f.from(self)
func = autofunc(func)
for k, v in self.next do
if (not func or func(v, k)) and other[k] ~= v then
return k
return k, v
end
end
end
@ -760,6 +982,7 @@ end
---@return string
---@nodiscard
function f:string()
self = f.isf(self) and self or f.from(self)
local k, v = self:next()
if k == nil then
@ -784,6 +1007,7 @@ end
---@return { [K]: V }
---@nodiscard
function f:table()
self = f.isf(self) and self or f.from(self)
local ret = {}
for k, v in self.next do
@ -797,6 +1021,8 @@ end
---@param self F|{ [K]: V }
---@param func? fun(v: V, k: K): nil
function f:each(func)
self = f.isf(self) and self or f.from(self)
for k, v in self.next do
if func then
func(v, k)

View file

@ -28,6 +28,11 @@ CardSleeves.Sleeve = CardSleeves.Sleeve
--- @type {aliases: { [string]: [string] }}
Cryptid = Cryptid
---@return Card
function copy_card(...)
error(...)
end
--- @type fun(area: CardArea, ...: ...): Card
create_card_for_shop = create_card_for_shop
@ -43,13 +48,18 @@ G.playing_cards = G.playing_cards
---@type userdata|{getWidth: fun(self: self): number}
SMODS.Atlas.image_data = SMODS.Atlas.image_data
---@return Card
function copy_card(...)
error(...)
---@param context CalcContext|table|{hand_drawn: true, other_drawn: true}
---@param return_table? table
---@return table?
function SMODS.calculate_context(context, return_table)
error {context, return_table}
end
SMODS.Mods.Roland.config = require "config"
---@type (fun(rem: number): number|table)[]
SMODS.Mods.Roland.harsh_ante_scaling = SMODS.Mods.Roland.harsh_ante_scaling
--- @type table
Talisman = Talisman

View file

@ -14,10 +14,13 @@ local function add(v)
end
if G.P_BLINDS[v] then
G.from_boss_tag = true
G.GAME.perscribed_bosses = G.GAME.perscribed_bosses or {}
G.GAME.perscribed_bosses[G.GAME.round_resets.ante] = v
G.FUNCS.reroll_boss()
if G.STATE ~= G.STATES.MENU then
G.from_boss_tag = true
G.GAME.perscribed_bosses = G.GAME.perscribed_bosses or {}
G.GAME.perscribed_bosses[G.GAME.round_resets.ante] = v
G.FUNCS.reroll_boss()
end
return G.P_BLINDS[v]
end

View file

@ -1,7 +1,7 @@
local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared"
local f, q = qol[1], qol[2]
local animated = SMODS.current_mod.config.animated_icon
SMODS.current_mod.qol = qol
local animated = SMODS.Mods.Roland.config.animated_icon
local f, q = qol[1], qol[2]
q {
front = true,

View file

@ -38,26 +38,32 @@ spectral {
return {vars = {card.ability.extra.amount}}
end,
can_use = function()
return u() and #G.hand.cards > 0
return next(G.hand.cards) and u()
end,
use = function(_, card, _)
use = function(_, card)
local cards = f(G.hand.cards):table()
pseudoshuffle(cards, pseudoseed "RolandDual")
f(cards):take(card.ability.extra.amount):each(function(v)
local seal
local seal = SMODS.poll_seal {
guaranteed = true,
options = f(G.P_SEALS):keys():where(f.nq "Roland_glass"):values():table(),
}
for _ = 1, 64 do
seal = SMODS.poll_seal {guaranteed = true}
if seal ~= "Roland_glass" then
break
end
end
v:set_seal(seal == "Roland_glass" and "Red" or seal)
local _ = not card.Roland_immediate and q {
delay = 0.5,
trigger = "after",
func = function()
v:set_seal(seal, nil, true)
end,
} or v:set_seal(seal, true, true)
end)
end,
bulk_use = function(self, card, area, copier, number)
card.Roland_immediate = true
f(number):map(f.const(self)):each(f.call("use", card, area, copier))
card.Roland_immediate = nil
end,
}
spectral {
@ -77,7 +83,7 @@ spectral {
delay = 0.4,
func = function()
card:juice_up(0.3, 0.5)
play_sound("tarot1")
play_sound "tarot1"
end,
}
@ -132,9 +138,10 @@ spectral {
return {vars = {card.ability.extra.amount}}
end,
can_use = function(_, card)
return u() and #Bakery_API.get_highlighted() == card.ability.extra.amount
local count = #Bakery_API.get_highlighted()
return u() and count > 0 and count <= card.ability.extra.amount
end,
use = function(_, _, _)
use = function()
f(Bakery_API.get_highlighted()):each(function(v)
v:set_seal "Roland_glass"
end)

View file

@ -73,9 +73,10 @@ SMODS.Tag {
end
if tag.triggered or
(tag.ability.amount or self.config.amount) <= 0 or
((context.card or {}).edition or {}).Roland_frozen or
context.type ~= "Bakery_score_card" then
not context.card or
context.card.edition or
context.type ~= "Bakery_score_card" or
(tag.ability.amount or self.config.amount) <= 0 then
return
end
@ -121,6 +122,7 @@ SMODS.Tag {
ab.total_rounds = ab.total_rounds or self.config.total_rounds
if tag.triggered or
not G.jokers or
not next(G.jokers.cards) or
ab.invis_rounds < ab.total_rounds or
#G.jokers.cards + (modifiers.Roland_invisible or 0) >= G.jokers.config.card_limit then

View file

@ -26,8 +26,9 @@ q(SMODS.Consumable {
end
local highlighted = Bakery_API.get_highlighted()
local count = #G.jokers.highlighted + #highlighted
return #G.jokers.highlighted + #highlighted == card.ability.extra.amount and
return count > 0 and count <= card.ability.extra.amount and
f(G.jokers.highlighted):concat(highlighted):all(function(v)
return not v.edition
end)

View file

@ -20,7 +20,7 @@ local orig_use_consumeable = Card.use_consumeable
function Card:use_consumeable(area, copier, ...)
if SMODS.Mods.Roland.config.faster_planets and self.ability.consumeable.hand_type then
set_consumeable_usage(self)
level_up_hand(copier or self, self.ability.consumeable.hand_type, true)
level_up_hand(copier or self, self.ability.consumeable.hand_type, true, self.ability.qty or 1)
return
end
@ -110,21 +110,35 @@ local function no_harsh_ante_scaling()
return not Talisman or not SMODS.Mods.Roland.config.harsh_ante_scaling
end
function get_blind_amount(ante, ...)
local loop = 39
---@type (fun(rem: number): number|table)[]
SMODS.current_mod.harsh_ante_scaling = {
function(rem)
return (Big.constants and Big.constants.TEN or Big:new {10}):pow(blind(rem + 1))
end,
function(rem)
return Big:new {1, rem + 2}
end,
function(rem)
return Big:new {1, 1, [rem + 2] = 1}
end,
function(rem)
return Big:new {1, 1, [blind(rem) + 2] = 1}
end,
function(rem)
return rem <= 1 and Big:new {1.7976931348623157e308, 1, [1.7975e308] = 1} or 1 / 0
end,
}
if ante < loop or no_harsh_ante_scaling() then
function get_blind_amount(ante, ...)
local offset = 40
if ante < offset or no_harsh_ante_scaling() then
return orig_get_blind_amount(ante, ...)
end
if (ante - 9) / 15 >= loop then
return 1 / 0
end
local loop = 10
local rem = 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 f(SMODS.Mods.Roland.harsh_ante_scaling, f.revpairs):any(function(_, k)
return (ante - offset) / loop + 1 >= k
end)((ante - offset) % loop + 1)
end