diff --git a/assets/1x/atlasepic.png b/assets/1x/atlasepic.png index f35ae50cb..b59afd6af 100644 Binary files a/assets/1x/atlasepic.png and b/assets/1x/atlasepic.png differ diff --git a/assets/2x/atlasepic.png b/assets/2x/atlasepic.png index 3104e41dc..ffc9fd228 100644 Binary files a/assets/2x/atlasepic.png and b/assets/2x/atlasepic.png differ diff --git a/items/epic.lua b/items/epic.lua index 4a8c389e8..8043e06cb 100644 --- a/items/epic.lua +++ b/items/epic.lua @@ -2619,6 +2619,71 @@ local starfruit = { end, } +local sundial = { + object_type = "Joker", + dependencies = { + items = { + "set_cry_epic", + }, + }, + name = "cry-sundail", + key = "sundial", + rarity = "cry_epic", + cost = 14, + order = 300, + blueprint_compat = true, + demicoloncompat = true, + atlas = "atlasepic", + pos = { x = 5, y = 5 }, + config = { extra = { handleft = 12, handloss = -1 } }, + + cry_credits = { + art = { "Tatturedlurker" }, + code = { "candycanearter" }, + idea = { "HexaCryonic" }, + }, + + loc_vars = function(self, info_queue, center) + local active = "permanently" + if G.GAME.sundial then + active = "already active, does nothing" + end + return { vars = { number_format(center.ability.extra.handleft), G.GAME.sundial_amount, active } } + end, + + in_pool = function(self) + return not G.GAME.sundial + end, + + calculate = function(self, card, context) + if + context.before + and not context.blueprint + and not context.retrigger_joker + and not context.individual + and not context.repetition + and card.ability.extra.handleft > 0 + then + SMODS.scale_card(card, { + ref_table = card.ability.extra, + ref_value = "handleft", + scalar_value = "handloss", + }) + return { message = localize("k_upgrade_ex") } + end + + if context.selling_self and not context.retrigger_joker and not context.blueprint then + if card.ability.extra.handleft < 1 then + G.GAME.sundial = true + G.GAME.cry_banished_keys[card.config.center.key] = true + return { message = localize("k_active_ex") } + else + return { message = localize("k_nope_ex") } + end + end + end, +} + return { name = "Epic Jokers", items = { @@ -2649,5 +2714,6 @@ return { clockwork, demicolon, starfruit, + sundial, }, } diff --git a/lib/calculate.lua b/lib/calculate.lua index c1ce0b872..17da89e13 100644 --- a/lib/calculate.lua +++ b/lib/calculate.lua @@ -1,5 +1,13 @@ -- calculate.lua: modifications specifically for card calculation +-- this seems like a good spot to put the mod calc +SMODS.current_mod.calculate = function(self, context) + if context.setting_blind and G.GAME.sundial then + G.GAME.blind.chips = G.GAME.blind.chips * (1 - (G.GAME.sundial_amount / 100)) + G.GAME.blind.chip_text = number_format(G.GAME.blind.chips) + end +end + -- deal with Rigged and Fragile when scoring a playing card local ec = eval_card function eval_card(card, context) diff --git a/lib/overrides.lua b/lib/overrides.lua index 24c274a1f..8e3f8a9e8 100644 --- a/lib/overrides.lua +++ b/lib/overrides.lua @@ -290,6 +290,9 @@ function Game:init_game_object() g.cry_percrate[v:lower()] = 100 end + g.sundial = false + g.sundial_amount = 85 + return g end diff --git a/localization/en-us.lua b/localization/en-us.lua index 39da6d08f..039d574d9 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -1615,6 +1615,14 @@ return { "{C:attention}reroll{} in the shop", }, }, + j_cry_sundial = { + name = "Project Sundial", + text = { + "After playing #1# hands, {C:attention}sell this Joker", + "to reduce blind size by #2# percent", + "{C:red,E:1}#3#", + }, + }, j_cry_digitalhallucinations = { name = "Digital Hallucinations", text = {