Skip to content

Commit c435095

Browse files
committed
add starfruit
1 parent 0b57f12 commit c435095

File tree

5 files changed

+133
-0
lines changed

5 files changed

+133
-0
lines changed

assets/1x/atlasepic.png

-19.2 KB
Loading

assets/2x/atlasepic.png

-50.8 KB
Loading

items/epic.lua

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,111 @@ local demicolon = {
24542454
code = { "Nova" },
24552455
},
24562456
}
2457+
2458+
local starfruit = {
2459+
object_type = "Joker",
2460+
dependencies = {
2461+
items = {
2462+
"set_cry_epic",
2463+
},
2464+
},
2465+
name = "cry-starfruit",
2466+
key = "starfruit",
2467+
rarity = "cry_epic",
2468+
cost = 14,
2469+
order = 300,
2470+
blueprint_compat = false,
2471+
demicoloncompat = false,
2472+
atlas = "atlasepic",
2473+
pos = { x = 4, y = 5 },
2474+
config = { emult = 2, emult_mod = 0.2 },
2475+
immutable = true,
2476+
pools = { ["Food"] = true },
2477+
calculate = function(self, card, context)
2478+
if context.joker_main then
2479+
return {
2480+
Emult = card.ability.emult
2481+
}
2482+
end
2483+
if context.reroll_shop then
2484+
card.ability.emult = card.ability.emult - card.ability.emult_mod
2485+
--floating point precision can kiss my ass istg
2486+
if card.ability.emult <= 1.00000001 then
2487+
G.E_MANAGER:add_event(Event({
2488+
func = function()
2489+
play_sound("tarot1")
2490+
card.T.r = -0.2
2491+
card:juice_up(0.3, 0.4)
2492+
card.states.drag.is = true
2493+
card.children.center.pinch.x = true
2494+
G.E_MANAGER:add_event(Event({
2495+
trigger = "after",
2496+
delay = 0.3,
2497+
blockable = false,
2498+
func = function()
2499+
G.jokers:remove_card(card)
2500+
card:remove()
2501+
card = nil
2502+
return true
2503+
end,
2504+
}))
2505+
return true
2506+
end,
2507+
}))
2508+
return {
2509+
message = localize("k_eaten_ex"),
2510+
colour = G.C.RARITY.cry_epic,
2511+
}
2512+
else
2513+
return {
2514+
message = "-^"..number_format(card.ability.emult_mod).." Mult",
2515+
colour = G.C.RARITY.cry_epic,
2516+
}
2517+
end
2518+
end
2519+
end,
2520+
loc_vars = function(self, queue, card)
2521+
return {
2522+
vars = {
2523+
number_format(card.ability.emult),
2524+
number_format(card.ability.emult_mod)
2525+
}
2526+
}
2527+
end,
2528+
cry_credits = {
2529+
art = {"lord.ruby"},
2530+
code = {"lord.ruby"},
2531+
idea = {"NinjaBanana"}
2532+
},
2533+
check_for_unlock = function(self, args)
2534+
if args.type == "foods_destroyed" and to_big(args.destroyed) >= 2 then
2535+
unlock_card(self)
2536+
end
2537+
if args.type == "cry_lock_all" then
2538+
lock_card(self)
2539+
end
2540+
if args.type == "cry_unlock_all" then
2541+
unlock_card(self)
2542+
end
2543+
end,
2544+
init = function()
2545+
local card_remove_ref = Card.remove
2546+
function Card:remove(...)
2547+
if self:is_food() and self.area == G.jokers and not G.SETTINGS.paused then
2548+
G.cry_foods_eaten = (G.cry_foods_eaten or 0) + 1
2549+
check_for_unlock({type="foods_destroyed", destroyed = G.cry_foods_eaten})
2550+
G.E_MANAGER:add_event(Event({
2551+
func = function()
2552+
G.cry_foods_eaten = nil
2553+
return true
2554+
end
2555+
}))
2556+
end
2557+
return card_remove_ref(self, ...)
2558+
end
2559+
end
2560+
}
2561+
24572562
return {
24582563
name = "Epic Jokers",
24592564
items = {
@@ -2483,5 +2588,6 @@ return {
24832588
jtron,
24842589
clockwork,
24852590
demicolon,
2591+
starfruit
24862592
},
24872593
}

lib/misc.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,3 +917,22 @@ function Cryptid.reset_to_none()
917917
handname = localize("cry_None", "poker_hands"),
918918
})
919919
end
920+
921+
922+
923+
function Card:is_food()
924+
--you cant really check if vanilla jokers are in a pool because its hardcoded
925+
--so i have to hardcode it here too for the starfruit unlock
926+
local food = {
927+
j_gros_michel=true,
928+
j_egg=true,
929+
j_ice_cream=true,
930+
j_cavendish=true,
931+
j_turtle_bean=true,
932+
j_diet_cola=true,
933+
j_popcorn=true,
934+
j_ramen=true,
935+
j_selzer=true,
936+
}
937+
if food[self.config.center.key] or Cryptid.safe_get(self.config.center, "pools", "Food") then return true end
938+
end

localization/en-us.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,14 @@ return {
15141514
"to the right",
15151515
},
15161516
},
1517+
j_cry_starfruit = {
1518+
name = "Starfruit",
1519+
text = {
1520+
"{X:dark_edition,C:white}^#1#{} Mult",
1521+
"{X:dark_edition,C:white}-^#2#{} Mult per",
1522+
"{C:attention}reroll{} in the shop"
1523+
}
1524+
},
15171525
j_cry_digitalhallucinations = {
15181526
name = "Digital Hallucinations",
15191527
text = {

0 commit comments

Comments
 (0)