Skip to content

Commit

Permalink
various bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesthejellyfish authored Mar 10, 2024
1 parent d25ced6 commit 6a512d0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
10 changes: 7 additions & 3 deletions JellyTarots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ function Card.use_consumeable(self, area, copier)
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.4, func = function()
play_sound('timpani')
local card = create_card('Joker', G.jokers, chosen_joker.config.center.rarity == 4, rarity, nil, nil, nil, 'rev_jud')
card:set_edition(chosen_joker.edition or {}, true)
sendDebugMessage(tostring(chosen_joker.edition))
if chosen_joker.edition ~= nil then card:set_edition(chosen_joker.edition, true) end
chosen_joker:start_dissolve()
card:add_to_deck()
G.jokers:emplace(card)
Expand Down Expand Up @@ -822,6 +823,9 @@ function play_tarot_cards(n, i)
print(card.ability.name)
G.GAME.consumeable_buffer = 0
end
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function()
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
func = (function()
Expand Down Expand Up @@ -853,9 +857,9 @@ function play_tarot_cards(n, i)
return true end)}))
return true end)}))
return true end)}))
return true end)}))
end
return true end)
}))
return true end)}))
end


Expand Down
39 changes: 23 additions & 16 deletions game_modifications.lua
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, h
}}
}
loc_vars = {last_tarot_planet, G.GAME.probabilities.normal, 2}
if not (not fool_c or fool_c.name == 'The Fool') then
if not (not fool_c or fool_c.name == 'The Reverse Fool') then
info_queue[#info_queue+1] = fool_c
end
elseif _c.name == "The Magician" then loc_vars = {_c.config.max_highlighted, localize{type = 'name_text', set = 'Enhanced', key = _c.config.mod_conv}}; info_queue[#info_queue+1] = G.P_CENTERS[_c.config.mod_conv]
Expand Down Expand Up @@ -1361,6 +1361,7 @@ end


G.FUNCS.evaluate_play_scouter = function(e)
G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + G.consumeables.config.card_limit
local text,disp_text,poker_hands,scoring_hand,non_loc_disp_text = G.FUNCS.get_poker_hand_info(G.hand.highlighted)

--Add all the pure bonus cards to the scoring hand
Expand Down Expand Up @@ -1452,9 +1453,11 @@ G.FUNCS.evaluate_play_scouter = function(e)
local effects = {eval_card(scoring_hand[i], {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, poker_hand = text})}
for k=1, #G.jokers.cards do
--calculate the joker individual card effects
local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], individual = true, blueprint = 1, scouter = true})
if eval then
table.insert(effects, eval)
if G.jokers.cards[k].ability.name ~= 'Vagabond' then
local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], individual = true, blueprint = 1, scouter = true})
if eval then
table.insert(effects, eval)
end
end
end
scoring_hand[i].lucky_trigger = nil
Expand Down Expand Up @@ -1515,10 +1518,12 @@ G.FUNCS.evaluate_play_scouter = function(e)

for k=1, #G.jokers.cards do
--calculate the joker individual card effects
local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.hand, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = hand_scouter[i], individual = true, blueprint=1, scouter=true})
if eval then
mod_percent = true
table.insert(effects, eval)
if G.jokers.cards[k].ability.name ~= 'Vagabond' then
local eval = G.jokers.cards[k]:calculate_joker({cardarea = G.hand, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = hand_scouter[i], individual = true, blueprint=1, scouter=true})
if eval then
mod_percent = true
table.insert(effects, eval)
end
end
end

Expand Down Expand Up @@ -1614,13 +1619,15 @@ G.FUNCS.evaluate_play_scouter = function(e)

--Joker on Joker effects
for _, v in ipairs(G.jokers.cards) do
local effect = v:calculate_joker{full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_joker = _card}
if effect then
local extras = {mult = false, hand_chips = false}
if effect.mult_mod then mult = mod_mult(mult + effect.mult_mod);extras.mult = true end
if effect.chip_mod then hand_chips = mod_chips(hand_chips + effect.chip_mod);extras.hand_chips = true end
if effect.Xmult_mod then mult = mod_mult(mult*effect.Xmult_mod);extras.mult = true end
percent = percent+percent_delta
if v.ability.name ~= 'Vagabond' then
local effect = v:calculate_joker{full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_joker = _card}
if effect then
local extras = {mult = false, hand_chips = false}
if effect.mult_mod then mult = mod_mult(mult + effect.mult_mod);extras.mult = true end
if effect.chip_mod then hand_chips = mod_chips(hand_chips + effect.chip_mod);extras.hand_chips = true end
if effect.Xmult_mod then mult = mod_mult(mult*effect.Xmult_mod);extras.mult = true end
percent = percent+percent_delta
end
end
end

Expand All @@ -1631,7 +1638,7 @@ G.FUNCS.evaluate_play_scouter = function(e)
percent = percent+percent_delta
end
end

G.GAME.consumeable_buffer = math.max(0, G.GAME.consumeable_buffer - G.consumeables.config.card_limit)
local nu_chip, nu_mult = G.GAME.selected_back:trigger_effect{context = 'final_scoring_step', chips = hand_chips, mult = mult}
mult = mod_mult(nu_mult or mult)
hand_chips = mod_chips(nu_chip or hand_chips)
Expand Down

0 comments on commit 6a512d0

Please sign in to comment.