Jane/src/blind.lua

138 lines
3.6 KiB
Lua

SMODS.Atlas {
px = 34,
py = 34,
frames = 21,
key = "janeblinds",
atlas_table = "ANIMATION_ATLAS",
path = Jane.config.texture_pack .. "/bl_jane_blinds.png",
}
local function offset_operator(by)
local function set(number)
if G.GAME then
G.GAME.operator = math.max(math.min(number, 3), 1)
end
end
local previous = Jane.get_operator()
set(by + previous)
by = Jane.get_operator()
SMODS.set_scoring_calculation(({"add", "multiply", "exponent"})[by])
end
local function to_number(x)
return type(x) == "table" and x:to_number() or x
end
SMODS.Blind {
loc_txt = {
name = "The Descending",
text = {"Decrease Chip-Mult", "operator by 1 level"},
},
key = "descending",
config = {},
boss = {min = 1, max = 10, hardcore = true},
boss_colour = HEX("b200ff"),
atlas = "janeblinds",
pos = {x = 0, y = 0},
vars = {},
dollars = 6,
defeat = function(_)
if not Cryptid then
offset_operator(2 - Jane.get_operator())
elseif not G.GAME.blind.disabled then
offset_operator(1)
end
end,
disable = function(_)
offset_operator(1)
end,
drawn_to_hand = function(_)
offset_operator(0)
end,
press_play = function(_)
offset_operator(0)
end,
set_blind = function(self)
if to_number(self.mult) == 0 then
self.chips = math.floor(8 * math.sqrt(get_blind_amount(G.GAME.round_resets.ante)))
end
offset_operator(-1)
end,
}
if Cryptid then
SMODS.Blind {
loc_txt = {
name = "The Insignia",
text = {"Hand must contain", "only one suit"},
},
key = "insignia",
config = {},
boss = {min = 2, max = 10, no_orb = true, hardcore = true},
boss_colour = HEX("a5aa00"),
atlas = "janeblinds",
pos = {x = 0, y = 9},
vars = {},
dollars = 5,
mult = 2,
debuff_hand = function(_, cards, _, _, _)
local numsuits = 0
local checked_suits = {}
for _, card in ipairs(cards) do
if not card:nosuit() and not checked_suits[card.base.suit] then
numsuits = numsuits + 1
checked_suits[card.base.suit] = true
if numsuits > 1 then
return true
end
end
end
end,
}
end
SMODS.Blind {
loc_txt = {
name = "The Wee",
text = {"Only 2s can be played"},
},
key = "wee",
config = {},
boss = {min = 2, max = 10, no_orb = true, hardcore = true},
boss_colour = HEX("7F3F3F"),
atlas = "janeblinds",
pos = {x = 0, y = 3},
vars = {},
dollars = 2,
disable = function(self)
self.disabled = true
end,
debuff_hand = function(self, cards, _, _, _)
if self.disabled then
return false
end
for _, v in ipairs(cards) do
if (v:norank() or v:get_id() ~= 2) and (v.ability or {}).aikoyori_letters_stickers ~= "2" then
return true
end
end
end,
get_loc_debuff_text = function(_)
return "Hand must contain only 2s"
end,
recalc_debuff = function(self, card, _)
return not self.disabled and
(card:norank() or card:get_id() ~= 2) and
(card.ability or {}).aikoyori_letters_stickers ~= "2"
end,
set_blind = function(self)
if to_number(self.mult) == 0 then
self.chips = 22
end
end,
}