Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
release/
mktest
.idea
2 changes: 1 addition & 1 deletion localization/en-us.lua
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ return {
c_bplus_sigil_dupe = {
name = "Dupe",
text = {
"Covert all {C:attention}unselected",
"Convert all {C:attention}unselected",
"cards to {C:attention}selected{} card",
"{C:blue}-#1#{} Hand",
},
Expand Down
93 changes: 37 additions & 56 deletions src/bplus/override.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,71 +53,59 @@ end
function Blind:hand_played()
if self.config.blind.hand_played then
if self.config.blind.hand_played(self) then
G.E_MANAGER:add_event(Event {
trigger = "immediate",
func = function()
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function()
SMODS.juice_up_blind()
G.E_MANAGER:add_event(Event {
trigger = "after",
trigger = 'after',
delay = 0.06 * G.SETTINGS.GAMESPEED,
blockable = false,
blocking = false,
func = function()
play_sound("tarot2", 0.76, 0.4)
play_sound('tarot2', 0.76, 0.4)
return true
end,
})
play_sound("tarot2", 1, 0.4)
play_sound('tarot2', 1, 0.4)
return true
end,
})
end)
}))
delay(0.4)
end
end
end

local card_is_suit = Card.is_suit
function Card:is_suit(suit, bypass_debuff, flush_calc)
local opt
local first_pass
local res
local orig_suit = self.base.suit
if not G.bplus_card_is_suit_opt then
G.bplus_card_is_suit_opt = {}
first_pass = true
end
opt = G.bplus_card_is_suit_opt

if self.debuff and not bypass_debuff then
return
end
if flush_calc then
if SMODS.has_enhancement(self, "m_stone") and not self.debuff and next(find_joker("j_bplus_stone_carving")) then
return G.GAME.current_round.bplus_stone_carving_card.suit == suit
end

if not res and not opt.stone_carving and SMODS.has_enhancement(self, "m_stone") and next(find_joker("j_bplus_stone_carving")) then
opt.stone_carving = true
local orig_center = self.config.center
self.config.center = G.P_CENTERS.c_base
self.base.suit = G.GAME.current_round.bplus_stone_carving_card.suit
res = self:is_suit(suit, bypass_debuff, flush_calc)
self.config.center = orig_center
self.base.suit = orig_suit
end
if not self.debuff and next(find_joker("j_bplus_blured")) then
local blured_suit
local transform = G.GAME.current_round.bplus_blured_suit
if self.base.suit == transform.from then
blured_suit = transform.to
end
return self.base.suit == suit or blured_suit == suit
end
else
if self.debuff and not bypass_debuff then return end

if not res and not opt.blured and next(find_joker("j_bplus_blured")) then
opt.blured = true
local transform = G.GAME.current_round.bplus_blured_suit
if self:is_suit(transform.from, bypass_debuff, flush_calc) then
self.base.suit = transform.to
if self.ability.name == G.P_CENTERS.m_stone.name and next(find_joker("j_bplus_stone_carving")) then
return G.GAME.current_round.bplus_stone_carving_card.suit == suit
end
res = self:is_suit(suit, bypass_debuff, flush_calc)
self.base.suit = orig_suit
res = res or self:is_suit(suit, bypass_debuff, flush_calc)
end

if first_pass then
G.bplus_card_is_suit_opt = nil
end
if res ~= nil then
return res
if next(find_joker("j_bplus_blured")) then
local blured_suit
local transform = G.GAME.current_round.bplus_blured_suit
if self.base.suit == transform.from then
blured_suit = transform.to
end
return self.base.suit == suit or blured_suit == suit
end
end
return card_is_suit(self, suit, bypass_debuff, flush_calc)
end
Expand All @@ -133,14 +121,9 @@ end
local card_calculate_joker = Card.calculate_joker
function Card:calculate_joker(ctx)
local ret = card_calculate_joker(self, ctx)
if not ret then
return
end
if ret == true then
return ret
end
if not ret then return end

if ret.repetitions and not G.GAME.blind.disabled and G.GAME.blind.name == "bl_bplus_lazy" then
if type(ret) == "table" and ret.repetitions and not G.GAME.blind.disabled and G.GAME.blind.name == "bl_bplus_lazy" then
BPlus.bl_lazy_trigger(ret.card or self)
ret = nil
end
Expand All @@ -151,11 +134,9 @@ end
local card_calculate_seal = Card.calculate_seal
function Card:calculate_seal(ctx)
local ret = card_calculate_seal(self, ctx)
if not ret then
return
end
if not ret then return end

if ret.repetitions and not G.GAME.blind.disabled and G.GAME.blind.name == "bl_bplus_lazy" then
if type(ret) == "table" and ret.repetitions and not G.GAME.blind.disabled and G.GAME.blind.name == "bl_bplus_lazy" then
BPlus.bl_lazy_trigger(ret.card or self)
ret = nil
end
Expand Down Expand Up @@ -195,4 +176,4 @@ for key, override in pairs(center_overrides) do
for field, value in pairs(override) do
G.P_CENTERS[key][field] = value
end
end
end