Skip to content

Commit 10749ff

Browse files
etherware-novicejolly[bot]
andauthored
project sundial (#806)
* done * jolly-bot: auto-format Lua files using Stylua * scale_card * done * jolly-bot: auto-format Lua files using Stylua --------- Co-authored-by: jolly[bot] <jolly[bot]@users.noreply.github.com>
1 parent 82675e8 commit 10749ff

File tree

6 files changed

+85
-0
lines changed

6 files changed

+85
-0
lines changed

assets/1x/atlasepic.png

-9.15 KB
Loading

assets/2x/atlasepic.png

-22.7 KB
Loading

items/epic.lua

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,6 +2619,71 @@ local starfruit = {
26192619
end,
26202620
}
26212621

2622+
local sundial = {
2623+
object_type = "Joker",
2624+
dependencies = {
2625+
items = {
2626+
"set_cry_epic",
2627+
},
2628+
},
2629+
name = "cry-sundail",
2630+
key = "sundial",
2631+
rarity = "cry_epic",
2632+
cost = 14,
2633+
order = 300,
2634+
blueprint_compat = true,
2635+
demicoloncompat = true,
2636+
atlas = "atlasepic",
2637+
pos = { x = 5, y = 5 },
2638+
config = { extra = { handleft = 12, handloss = -1 } },
2639+
2640+
cry_credits = {
2641+
art = { "Tatturedlurker" },
2642+
code = { "candycanearter" },
2643+
idea = { "HexaCryonic" },
2644+
},
2645+
2646+
loc_vars = function(self, info_queue, center)
2647+
local active = "permanently"
2648+
if G.GAME.sundial then
2649+
active = "already active, does nothing"
2650+
end
2651+
return { vars = { number_format(center.ability.extra.handleft), G.GAME.sundial_amount, active } }
2652+
end,
2653+
2654+
in_pool = function(self)
2655+
return not G.GAME.sundial
2656+
end,
2657+
2658+
calculate = function(self, card, context)
2659+
if
2660+
context.before
2661+
and not context.blueprint
2662+
and not context.retrigger_joker
2663+
and not context.individual
2664+
and not context.repetition
2665+
and card.ability.extra.handleft > 0
2666+
then
2667+
SMODS.scale_card(card, {
2668+
ref_table = card.ability.extra,
2669+
ref_value = "handleft",
2670+
scalar_value = "handloss",
2671+
})
2672+
return { message = localize("k_upgrade_ex") }
2673+
end
2674+
2675+
if context.selling_self and not context.retrigger_joker and not context.blueprint then
2676+
if card.ability.extra.handleft < 1 then
2677+
G.GAME.sundial = true
2678+
G.GAME.cry_banished_keys[card.config.center.key] = true
2679+
return { message = localize("k_active_ex") }
2680+
else
2681+
return { message = localize("k_nope_ex") }
2682+
end
2683+
end
2684+
end,
2685+
}
2686+
26222687
return {
26232688
name = "Epic Jokers",
26242689
items = {
@@ -2649,5 +2714,6 @@ return {
26492714
clockwork,
26502715
demicolon,
26512716
starfruit,
2717+
sundial,
26522718
},
26532719
}

lib/calculate.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
-- calculate.lua: modifications specifically for card calculation
22

3+
-- this seems like a good spot to put the mod calc
4+
SMODS.current_mod.calculate = function(self, context)
5+
if context.setting_blind and G.GAME.sundial then
6+
G.GAME.blind.chips = G.GAME.blind.chips * (1 - (G.GAME.sundial_amount / 100))
7+
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
8+
end
9+
end
10+
311
-- deal with Rigged and Fragile when scoring a playing card
412
local ec = eval_card
513
function eval_card(card, context)

lib/overrides.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ function Game:init_game_object()
291291
g.cry_percrate[v:lower()] = 100
292292
end
293293

294+
g.sundial = false
295+
g.sundial_amount = 85
296+
294297
return g
295298
end
296299

localization/en-us.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,14 @@ return {
16151615
"{C:attention}reroll{} in the shop",
16161616
},
16171617
},
1618+
j_cry_sundial = {
1619+
name = "Project Sundial",
1620+
text = {
1621+
"After playing #1# hands, {C:attention}sell this Joker",
1622+
"to reduce blind size by #2# percent",
1623+
"{C:red,E:1}#3#",
1624+
},
1625+
},
16181626
j_cry_digitalhallucinations = {
16191627
name = "Digital Hallucinations",
16201628
text = {

0 commit comments

Comments
 (0)