Skip to content

Commit 2e2380d

Browse files
authored
Merge pull request #386 from AlexZGreat/main
LeBaron James
2 parents adf04bd + 73aba5d commit 2e2380d

File tree

6 files changed

+107
-1
lines changed

6 files changed

+107
-1
lines changed

assets/1x/atlasone.png

2.91 KB
Loading

assets/2x/atlasone.png

2.92 KB
Loading

config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ return {
99
["family_mode"] = false,
1010
["experimental"] = false,
1111
["HTTPS"] = false,
12-
["menu"] = false,
12+
["menu"] = true,
1313
}

items/misc_joker.lua

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7600,6 +7600,81 @@ local zooble = {
76007600
},
76017601
},
76027602
}
7603+
local lebaron_james = {
7604+
object_type = "Joker",
7605+
dependencies = {
7606+
items = {
7607+
"set_cry_misc_joker",
7608+
},
7609+
},
7610+
name = "cry-LeBaron James",
7611+
key = "lebaron_james",
7612+
pos = { x = 2, y = 5 },
7613+
config = { extra = { h_mod = 1, h_size = 0 } },
7614+
rarity = 3,
7615+
cost = 6,
7616+
atlas = "atlasone",
7617+
order = 133,
7618+
loc_vars = function(self, info_queue, center)
7619+
return { vars = { center.ability.extra.h_mod, center.ability.extra.h_size } }
7620+
end,
7621+
calculate = function(self, card, context)
7622+
if context.cardarea == G.play and context.individual then
7623+
if SMODS.Ranks[context.other_card.base.value].key == "King" then
7624+
G.hand:change_size(math.min(1000 - card.ability.extra.h_size, card.ability.extra.h_mod))
7625+
card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.h_mod
7626+
return {
7627+
message = localize({ type = "variable", key = "a_handsize", vars = { card.ability.extra.h_mod } }),
7628+
colour = G.C.FILTER,
7629+
card = card,
7630+
}
7631+
end
7632+
end
7633+
if context.end_of_round and not context.individual and not context.repetition then
7634+
G.hand:change_size(-1 * math.min(1000, card.ability.extra.h_size))
7635+
card.ability.extra.h_size = 0
7636+
return {
7637+
card = card,
7638+
message = localize("k_reset"),
7639+
}
7640+
end
7641+
end,
7642+
remove_from_deck = function(self, card, from_debuff)
7643+
G.hand:change_size(-1 * math.min(1000, card.ability.extra.h_size))
7644+
end,
7645+
cry_credits = {
7646+
idea = {
7647+
"indefenite_idiot",
7648+
"HexaCryonic",
7649+
},
7650+
code = {
7651+
"AlexZGreat",
7652+
},
7653+
art = {
7654+
"lamborghiniofficial",
7655+
},
7656+
},
7657+
init = function(self)
7658+
-- Calculate enhancements for kings as if held in hand
7659+
-- Note that for enhancements that work when played and held in hand, this will fail
7660+
-- Not tested since no enhancements use this yet (Steel is weird, and Gold won't work)
7661+
local cce = Card.calculate_enhancement
7662+
function Card:calculate_enhancement(context)
7663+
local ret = cce(self, context)
7664+
if
7665+
not ret
7666+
and next(SMODS.find_card("j_cry_lebaron_james"))
7667+
and SMODS.Ranks[self.base.value].key == "King"
7668+
and context.cardarea == G.play
7669+
then
7670+
context.cardarea = G.hand
7671+
local ret = cce(self, context)
7672+
context.cardarea = G.play
7673+
end
7674+
return ret
7675+
end
7676+
end,
7677+
}
76037678
local miscitems = {
76047679
jimball_sprite,
76057680
dropshot,
@@ -7710,6 +7785,7 @@ local miscitems = {
77107785
fuckedup,
77117786
foolhardy,
77127787
translucent,
7788+
lebaron_james,
77137789
}
77147790
return {
77157791
name = "Misc. Jokers",

localization/en-us.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,15 @@ return {
16401640
"{C:attention}Jokers",
16411641
},
16421642
},
1643+
j_cry_lebaron_james = {
1644+
name = "LeBaron James",
1645+
text = {
1646+
"Played and scoring {C:attention}Kings{} give",
1647+
"{C:attention}+#1#{} hand size for the round",
1648+
"and trigger {C:attention}held in hand{} effects",
1649+
"{C:inactive}(Currently {C:attention}+#2#{C:inactive} hand size)",
1650+
},
1651+
},
16431652
j_cry_lightupthenight = {
16441653
name = "Light Up the Night",
16451654
text = {

lovely/misc_joker.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[manifest]
2+
version = "1.0.0"
3+
dump_lua = true
4+
priority = -1
5+
6+
# LeBaron James - Calculate Steel effects when played
7+
[[patches]]
8+
[patches.pattern]
9+
target = "functions/common_events.lua"
10+
pattern = "if context.cardarea == G.hand and context.main_scoring then"
11+
position = "at"
12+
payload = "if (context.cardarea == G.hand or context.cardarea == G.play and next(SMODS.find_card('j_cry_lebaron_james')) and safe_get(SMODS.Ranks,safe_get(card,'base','value') or 'm','key') == 'King') and context.main_scoring then"
13+
match_indent = true
14+
15+
[[patches]]
16+
[patches.pattern]
17+
target = "functions/common_events.lua"
18+
pattern = "ret.playing_card = {}"
19+
position = "at"
20+
payload = "ret.playing_card = ret.playing_card or {}"
21+
match_indent = true

0 commit comments

Comments
 (0)