Skip to content

Commit a7aea59

Browse files
committed
add rotten egg
1 parent c4a1fd9 commit a7aea59

File tree

6 files changed

+111
-0
lines changed

6 files changed

+111
-0
lines changed

assets/1x/atlasone.png

-39 Bytes
Loading

assets/1x/atlasspooky.png

1.92 KB
Loading

assets/2x/atlasone.png

2.23 KB
Loading

assets/2x/atlasspooky.png

3.48 KB
Loading

items/spooky.lua

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,104 @@ local possessed = {
11951195
no_sticker_sheet = true,
11961196
badge_colour = HEX("aaaaaa"),
11971197
}
1198+
1199+
local rotten_egg = {
1200+
object_type = "Joker",
1201+
dependencies = {
1202+
items = {
1203+
"set_cry_cursed",
1204+
},
1205+
},
1206+
key = "rotten_egg",
1207+
pos = { x = 3, y = 3 },
1208+
config = {
1209+
extra = {
1210+
starting_money = 1,
1211+
lose_money = 1,
1212+
needed_money = 10,
1213+
left_money = 10,
1214+
},
1215+
},
1216+
rarity = "cry_cursed",
1217+
cost = 0,
1218+
order = 138,
1219+
atlas = "atlasspooky",
1220+
blueprint_compat = false,
1221+
eternal_compat = false,
1222+
perishable_compat = false,
1223+
demicoloncompat = true,
1224+
no_dbl = true,
1225+
add_to_deck = function(self, card, from_debuff)
1226+
G.GAME.cry_rotten_amount = card.ability.extra.starting_money
1227+
for i, v in pairs(G.jokers.cards) do
1228+
v:set_cost()
1229+
end
1230+
end,
1231+
remove_from_deck = function()
1232+
G.GAME.cry_rotten_amount = nil
1233+
for i, v in pairs(G.jokers.cards) do
1234+
v:set_cost()
1235+
end
1236+
end,
1237+
calculate = function(self, card, context)
1238+
if context.end_of_round
1239+
and not context.blueprint
1240+
and not context.individual
1241+
and not context.repetition
1242+
and not context.retrigger_joker then
1243+
for i, v in pairs(G.jokers.cards) do
1244+
v.sell_cost = v.sell_cost - 1
1245+
end
1246+
return {
1247+
message = localize("k_downgraded_ex")
1248+
}
1249+
end
1250+
if context.selling_card and context.card.ability.set == "Joker" and context.card and context.card.sell_cost ~= 0 then
1251+
card.ability.extra.left_money = card.ability.extra.left_money - context.card.sell_cost
1252+
if to_big(card.ability.extra.left_money) <= to_big(0) then
1253+
G.E_MANAGER:add_event(Event({
1254+
func = function()
1255+
card:start_dissolve()
1256+
return true
1257+
end,
1258+
}))
1259+
else
1260+
return {
1261+
message = number_format(card.ability.extra.needed_money-card.ability.extra.left_money).."/"..number_format(card.ability.extra.needed_money)
1262+
}
1263+
end
1264+
end
1265+
if context.forcetrigger then
1266+
G.E_MANAGER:add_event(Event({
1267+
func = function()
1268+
card:start_dissolve()
1269+
return true
1270+
end,
1271+
}))
1272+
end
1273+
end,
1274+
loc_vars = function(self, info_queue, card)
1275+
return {
1276+
vars = {
1277+
number_format(card.ability.extra.starting_money),
1278+
number_format(card.ability.extra.lose_money),
1279+
number_format(card.ability.extra.needed_money),
1280+
number_format(card.ability.extra.left_money),
1281+
},
1282+
}
1283+
end,
1284+
init = function()
1285+
local set_costref = Card.set_cost
1286+
function Card:set_cost(...)
1287+
local c = set_costref(self, ...)
1288+
if G.GAME.cry_rotten_amount then
1289+
self.sell_cost = G.GAME.cry_rotten_amount
1290+
self.sell_cost_label = self.facing == 'back' and '?' or number_format(self.sell_cost)
1291+
end
1292+
end
1293+
end
1294+
}
1295+
11981296
local spookydeck = {
11991297
object_type = "Back",
12001298
dependencies = {
@@ -2083,6 +2181,7 @@ items = {
20832181
trick_or_treat,
20842182
candy_basket,
20852183
blacklist,
2184+
rotten_egg,
20862185
--ghost,
20872186
--possessed,
20882187
spookydeck,

localization/en-us.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,16 @@ return {
11111111
"{C:inactive,s:0.8}Rank does not change",
11121112
},
11131113
},
1114+
j_cry_rotten_egg = {
1115+
name = "Rotten Egg",
1116+
text = {
1117+
"When Obtained Set sell value of",
1118+
"all current and future Jokers to {C:attention}$#1#{}",
1119+
"Reduce sell value of all {C:attention}Jokers{} by {C:attention}$#2#{}",
1120+
"at end of round, After Gaining {C:attention}$#3#{} {C:inactive}[#4#]{}",
1121+
"from selling {C:attention}Jokers{}, {C:red}Self-destruct{}"
1122+
},
1123+
},
11141124
j_cry_blender = {
11151125
name = "Blender",
11161126
text = {
@@ -5019,6 +5029,8 @@ return {
50195029
k_cry_candy = "Candy",
50205030
k_cry_cursed = "Cursed",
50215031

5032+
k_downgraded_ex = "Downgraded!",
5033+
50225034
k_planet_disc = "Circumstellar Disc",
50235035
k_planet_satellite = "Natural Satellites",
50245036
k_planet_universe = Cryptid_config.family_mode and "Universe" or "The Actual Fucking Universe",

0 commit comments

Comments
 (0)