diff --git a/assets/1x/default/j_jane_oxy.png b/assets/1x/default/j_jane_oxy.png index 905ae8d..92e74e5 100644 Binary files a/assets/1x/default/j_jane_oxy.png and b/assets/1x/default/j_jane_oxy.png differ diff --git a/assets/2x/default/j_jane_oxy.png b/assets/2x/default/j_jane_oxy.png index e830681..696e65f 100644 Binary files a/assets/2x/default/j_jane_oxy.png and b/assets/2x/default/j_jane_oxy.png differ diff --git a/src/joker.lua b/src/joker.lua index 65c4389..a8c96b4 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -104,46 +104,158 @@ local function voucher_count() return count end +local oxy_quotes = { + normal = { + "YOU WILL LOSE", + "DON'T EVEN TRY", + "WE WILL STOP YOU", + "He glares at the blinds with conviction.", + }, + scared = { + "...H-how are you doing t-that...?", + "This is... unsettling...", + "S-... So much power...", + } +} + SMODS.Joker { key = "oxy", atlas = "janeoxy", loc_txt = { - name = "Oxy", + name = "Oxy{C:dark_edition}#1#", text = { - "{C:attention}Scored steel{} cards give", - "{X:mult,C:white}x#1#{} {C:mult}Mult {}& {X:chips,C:white}x#1#{} {C:chips}Chips", - " ", - "{C:inactive,s:0.75,E:1}#2#{C:red,s:1.5,E:1}#3#", + "{C:attention}Scored steel {}cards give", + "{X:mult,C:white}x#2#{} {C:mult}Mult {}and {X:chips,C:white}x#2#{} {C:chips}Chips", + "{C:dark_edition,E:1}#3#{}#4#{C:red}#5#{C:attention}#6#", + "{C:dark_edition,E:1}#7#{}#8#", + "#9#{C:dark_edition,E:1}#10#", + "{C:inactive,s:0.75,E:1}#11#{C:red,s:1.5,E:1}#12#", } }, pos = {x = 0, y = 0}, - config = {steel = 1.5}, + config = {extra = {corrupted_steel = 2.25, is_corrupted = false, milestone = 5, progress = 0, steel = 1.5}}, sinis = {x = 2, y = 0}, soul_pos = {x = 1, y = 0}, cost = 10, blueprint_compat = true, rarity = Cryptid and 3 or 4, - loc_vars = function(_, _, center) + loc_vars = function(_, _, card) + local ability = card.ability.extra or {} + local milestone = ability.milestone + local progress = ability.progress + local is_corrupted = ability.is_corrupted + local amount = is_corrupted and ability.corrupted_steel or ability.steel + local effective = is_corrupted and progress or milestone - progress + local plural = effective == 1 and "" or "s" + return {vars = { - center.ability.steel, - Jane.sinister and "" or "We all cut close...", - Jane.sinister and "WHAT ARE YOU DOING DOWN THERE?!?" or "", + is_corrupted and " (Corrupted)" or "", + amount, + is_corrupted and "Uncorrupts " or "", + is_corrupted and "in " or "", + is_corrupted and "" or "Destroying ", + effective .. (is_corrupted and " round" or " steel card") .. plural, + is_corrupted and "" or "corrupts ", + is_corrupted and "Destroying steel cards" or "this joker", + is_corrupted and "prolongs the " or "", + is_corrupted and "corruption" or "", + Jane.sinister and "" or (is_corrupted and pseudorandom_element(oxy_quotes.normal, pseudoseed("OxyQuotes")) or "We all cut close..."), + Jane.sinister and (is_corrupted and pseudorandom_element(oxy_quotes.scared, pseudoseed("OxyQuotes")) or "WHAT ARE YOU DOING DOWN THERE?!?") or "", }} end, + update = function(_, card, _) + if card.added_to_deck and card.children.center and card.children.floating_sprite then + local extra = card.ability.extra or {} + card.children.center:set_sprite_pos({x = 0, y = extra.is_corrupted and 1 or 0}) + card.children.floating_sprite:set_sprite_pos({x = Jane.sinister and 2 or 1, y = extra.is_corrupted and 1 or 0}) + end + end, calculate = function(_, card, context) + local extra = card.ability.extra or {} + local destroyed_steel = 0 + + for _, v in pairs(context.removed or {}) do + if (v.ability or {}).name == "Steel Card" then + destroyed_steel = destroyed_steel + 1 + end + end + + if destroyed_steel > 0 then + extra.progress = extra.progress + destroyed_steel + + card_eval_status_text( + card, + "extra", + nil, + nil, + nil, + { + message = (extra.is_corrupted and "+" or "-") .. destroyed_steel, + colour = extra.is_corrupted and G.C.PURPLE or G.C.GREY + } + ) + end + + if context.end_of_round and + extra.progress > 0 and not + context.individual and not + context.repetition and not + context.retrigger_joker then + extra.progress = extra.progress - 1 + + card_eval_status_text( + card, + "extra", + nil, + nil, + nil, + { + message = extra.is_corrupted and "-1" or "+1", + colour = extra.is_corrupted and G.C.PURPLE or G.C.GREY + } + ) + end + + if not extra.is_corrupting and + ((extra.progress >= extra.milestone and not extra.is_corrupted) or + (extra.progress <= 0 and extra.is_corrupted)) then + extra.is_corrupting = true + + G.E_MANAGER:add_event(Event({ + delay = 0.1, + func = function() + card:flip() + play_sound("card1") + return true + end + })) + + G.E_MANAGER:add_event(Event({ + delay = 1, + func = function() + card:flip() + card:juice_up(1, 1) + play_sound("card1") + extra.is_corrupted = not extra.is_corrupted + extra.is_corrupting = nil + return true + end + })) + end + if context.individual and context.cardarea == G.play and context.other_card.ability.name == "Steel Card" then - return { - x_chips = card.ability.steel, - x_mult = card.ability.steel, - colour = G.C.PURPLE, - card = card - }, true + local amount = extra.is_corrupted and extra.corrupted_steel or extra.steel + return {x_chips = amount, x_mult = amount, colour = G.C.PURPLE, card = card}, true end end } +if Cryptid then + Cryptid.aliases["oxy"] = "j_jane_oxy" +end + SMODS.Joker { key = "7granddad", loc_txt = {