Skip to content

Commit d00a019

Browse files
committed
(Joker) implement "Pear"
still need to do the secret sprite
1 parent 39c3829 commit d00a019

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

content/joker/pear.lua

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
SMODS.Joker {
2+
key = 'pear',
3+
config = {
4+
extra = {
5+
chips = 0,
6+
chip_gain = 5,
7+
chip_loss = 10
8+
}
9+
},
10+
rarity = 1,
11+
pos = { x = 17, y = 4 },
12+
atlas = 'jokers_atlas',
13+
cost = 4,
14+
unlocked = true,
15+
discovered = false,
16+
blueprint_compat = true,
17+
eternal_compat = false,
18+
pools = {
19+
Food = true
20+
},
21+
22+
loc_vars = function(self, info_queue, card)
23+
return {
24+
vars = {
25+
localize('Pair', 'poker_hands'),
26+
card.ability.extra.chip_gain,
27+
card.ability.extra.chip_loss,
28+
card.ability.extra.chips
29+
}
30+
}
31+
end,
32+
33+
calculate = function(self, card, context)
34+
if context.before and not context.blueprint then
35+
if next(context.poker_hands['Pair']) then
36+
card.ability.extra.chips = card.ability.extra.chips + card.ability.extra.chip_gain
37+
return {
38+
message = localize('k_upgrade_ex'),
39+
colour = G.C.CHIPS
40+
}
41+
elseif card.ability.extra.chips < 10 then
42+
PB_UTIL.destroy_joker(card)
43+
return {
44+
message = localize('k_eaten_ex'),
45+
colour = G.C.FILTER
46+
}
47+
else
48+
card.ability.extra.chips = card.ability.extra.chips - card.ability.extra.chip_loss
49+
return {
50+
message = localize { type = 'variable', key = 'a_chips_minus', vars = { card.ability.extra.chip_loss } },
51+
colour = G.C.CHIPS
52+
}
53+
end
54+
end
55+
56+
if context.joker_main then
57+
return {
58+
chips = card.ability.extra.chips
59+
}
60+
end
61+
end
62+
}

localization/en-us.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ return {
8787
},
8888
},
8989
Joker = {
90+
j_paperback_pear = {
91+
name = "Pear",
92+
text = {
93+
"If played hand contains a {C:attention}#1#{},",
94+
"this Joker gains {C:chips}+#2#{} Chips. If it",
95+
"does not, this Joker loses {C:chips}-#3#{} Chips.",
96+
"{C:red,E:2}Eaten{} if Chips are lower than 0",
97+
"{C:inactive}(Currently {C:chips}+#4# {C:inactive}Chips)"
98+
}
99+
},
90100
j_paperback_the_one_who_waits = {
91101
name = "The One Who Waits",
92102
text = {

utilities/definitions.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ PB_UTIL.ENABLED_JOKERS = {
192192
"pointy_stick",
193193
"charred_marshmallow",
194194
"sticky_stick",
195+
"pear",
195196
"sake_cup",
196197
"full_moon",
197198
"black_rainbows",

0 commit comments

Comments
 (0)