Skip to content

Commit df89d68

Browse files
Merge pull request #21 from IcebergLettuce0/dev
costumes of jimbo patch 1
2 parents cee90eb + 2c65a27 commit df89d68

File tree

8 files changed

+63
-89
lines changed

8 files changed

+63
-89
lines changed

config.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
return {
2+
["decks_enabled"] = true,
3+
["seals_enabled"] = true,
4+
["spectral_cards_enabled"] = true,
5+
["vouchers_enabled"] = true,
6+
}

localization/en-us.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ return {
154154
name = 'Pop-Up Joker',
155155
text = {
156156
'{C:green}#1# in #2#{} chance to',
157-
'add a random {C:attention}Booster Pack',
158-
'to the shop after {C:attention}reroll'
157+
'refill 1 {C:attention}Booster Pack',
158+
'in shop on {C:attention}reroll'
159159
}
160160
},
161161
j_pl_lamp = {

plantain.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"dependencies": [
1111
"Steamodded (>=1.0.0~BETA-0509c)"
1212
],
13-
"version": "1.2.0"
13+
"version": "1.2.1"
1414
}

src/additions/pl_jokers_w2.lua

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ SMODS.Joker {
6060
pos = { x = 1, y = 0 },
6161
soul_pos = { x = 0, y = 2},
6262

63-
config = { extra = { chance = 4 } },
63+
config = { extra = { chance = 2 } },
6464
loc_vars = function(self, info_queue, card)
6565
return { vars = { (G.GAME.probabilities.normal or 1), card.ability.extra.chance} }
6666
end,
@@ -75,26 +75,28 @@ SMODS.Joker {
7575

7676
calculate = function(self, card, context)
7777
if context.reroll_shop then
78-
if pseudorandom('popup') < G.GAME.probabilities.normal/card.ability.extra.chance then
79-
G.E_MANAGER:add_event(Event {
80-
func = function()
81-
PL_UTIL.add_booster_pack()
82-
return true
83-
end
84-
})
78+
if #G.shop_booster.cards < G.GAME.starting_params.boosters_in_shop + (G.GAME.modifiers.extra_boosters or 0) then
79+
if pseudorandom('popup') < G.GAME.probabilities.normal/card.ability.extra.chance then
80+
G.E_MANAGER:add_event(Event {
81+
func = function()
82+
PL_UTIL.add_booster_pack()
83+
return true
84+
end
85+
})
8586

86-
local pop_up_options = {
87-
'pl_pop_up_joker_winner_1',
88-
'pl_pop_up_joker_winner_2',
89-
'pl_pop_up_joker_winner_3',
90-
'pl_pop_up_joker_winner_4',
91-
}
87+
local pop_up_options = {
88+
'pl_pop_up_joker_winner_1',
89+
'pl_pop_up_joker_winner_2',
90+
'pl_pop_up_joker_winner_3',
91+
'pl_pop_up_joker_winner_4',
92+
}
9293

93-
local pop_up_message = pop_up_options[ math.random( #pop_up_options ) ]
94-
95-
return {
96-
message = localize(pop_up_message),
97-
}
94+
local pop_up_message = pop_up_options[ math.random( #pop_up_options ) ]
95+
96+
return {
97+
message = localize(pop_up_message),
98+
}
99+
end
98100
end
99101
end
100102
end
@@ -418,7 +420,7 @@ SMODS.Joker {
418420
discovered = true,
419421

420422
rarity = 3,
421-
cost = 5,
423+
cost = 8,
422424

423425
pools = {
424426
Food = true

src/additions/pl_jokers_w3.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ SMODS.Joker {
99
eternal_compat = true,
1010
perishable_compat = true,
1111
discovered = true,
12+
loc_vars = function(self, info_queue, card)
13+
info_queue[#info_queue + 1] = G.P_CENTERS.c_wheel_of_fortune
14+
end,
1215

1316
rarity = 1,
1417
cost = 3,
@@ -42,7 +45,7 @@ SMODS.Joker {
4245

4346
config = { extra = { chips = 25 } },
4447
loc_vars = function(self, info_queue, card)
45-
return {vars = { localize(card.ability.extra.suit, 'suits_singular') , card.ability.extra.chips, colours = {G.C.SUITS[card.ability.extra.suit]}}}
48+
return {vars = { localize(card.ability.extra.suit, 'suits_singular'), card.ability.extra.chips, colours = {G.C.SUITS[card.ability.extra.suit]}}}
4649
end,
4750

4851
blueprint_compat = true,
@@ -99,7 +102,7 @@ SMODS.Joker {
99102
discovered = true,
100103

101104
rarity = 2,
102-
cost = 5,
105+
cost = 6,
103106

104107
calculate = function (self, card, context)
105108
if context.individual and context.cardarea == G.play then

src/additions/pl_vouchers.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ SMODS.Voucher {
2020

2121
calculate = function(self, card, context)
2222
if context.reroll_shop then
23-
for i=1, #G.shop_booster.cards do
24-
PL_UTIL.reroll_booster_pack(i)
25-
end
23+
PL_UTIL.reroll_booster_packs()
2624
end
2725
end,
2826
}

src/config.lua

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/utilities/functions.lua

Lines changed: 26 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,74 +10,45 @@ end
1010

1111
function PL_UTIL.add_booster_pack()
1212
if not G.shop then return end
13-
local pack_watch = {}
14-
for k, v in pairs(G.P_CENTERS) do
15-
if v.set == 'Booster' then
16-
table.insert(pack_watch, k)
17-
end
18-
end
19-
local pack_chosen = pseudorandom_element(pack_watch, pseudoseed('pl_pop_up'))
20-
local pack = Card(
21-
G.shop_booster.T.x + G.shop_booster.T.w / 2,
22-
G.shop_booster.T.y,
23-
G.CARD_W * 1.27, G.CARD_H * 1.27,
24-
G.P_CARDS.empty,
25-
G.P_CENTERS[pack_chosen],
26-
{ bypass_discovery_center = true, bypass_discovery_ui = true }
27-
)
28-
if price then
29-
pack.cost = price
30-
end
13+
local pack = SMODS.create_card({ set = 'Booster', key_append = 'pl_popup'..G.GAME.round_resets.ante })
14+
pack.T.w = G.CARD_W * 1.27
15+
pack.T.h = G.CARD_H * 1.27
16+
17+
G.shop_booster:emplace(pack)
18+
3119
create_shop_card_ui(pack, 'Booster', G.shop_booster)
3220
pack:start_materialize()
33-
G.shop_booster:emplace(pack)
21+
pack:set_card_area(G.shop_booster)
22+
pack:juice_up()
3423
end
3524

36-
function PL_UTIL.reroll_booster_pack(position)
25+
function PL_UTIL.reroll_booster_packs()
3726
if not G.shop then return end
38-
if #G.shop_booster.cards <= 0 then return end
39-
40-
local booster_to_replace = G.shop_booster.cards[position]
4127

42-
local pack_watch = {}
43-
for k, v in pairs(G.P_CENTERS) do
44-
if v.set == 'Booster' then
45-
table.insert(pack_watch, k)
46-
end
47-
end
28+
local pack_count = #G.shop_booster.cards
4829

49-
local pack_chosen = pseudorandom_element(pack_watch, pseudoseed(('pl_booster_reroll')..G.GAME.round_resets.ante))
30+
if pack_count <= 0 then return end
5031

51-
local pack = Card(
52-
G.shop_booster.T.x + G.shop_booster.T.w / 2,
53-
G.shop_booster.T.y,
54-
G.CARD_W * 1.27, G.CARD_H * 1.27,
55-
G.P_CARDS.empty,
56-
G.P_CENTERS[pack_chosen],
57-
{ bypass_discovery_center = true, bypass_discovery_ui = true }
58-
)
32+
for i=1, pack_count do
33+
34+
local booster_to_replace = G.shop_booster.cards[i]
5935

60-
if price then
61-
pack.cost = price
62-
end
36+
local pack = SMODS.create_card({ set = 'Booster', key_append = 'pl_booster_reroll'..G.GAME.round_resets.ante })
37+
pack.T.w = G.CARD_W * 1.27
38+
pack.T.h = G.CARD_H * 1.27
6339

64-
create_shop_card_ui(pack, 'Booster', G.shop_booster)
65-
pack:start_materialize()
40+
table.insert(G.shop_booster.cards, i, pack)
6641

67-
local pack_pos = 1
68-
for k, v in ipairs(G.shop_booster.cards) do
69-
if v == booster_to_replace then
70-
pack_pos = k
71-
end
72-
end
42+
create_shop_card_ui(pack, 'Booster', G.shop_booster)
43+
pack:start_materialize()
44+
pack:set_card_area(G.shop_booster)
45+
pack:juice_up()
7346

74-
table.insert(G.shop_booster.cards, pack_pos, pack)
75-
pack:set_card_area(G.shop_booster)
76-
pack:juice_up()
47+
local c = G.shop_booster:remove_card(booster_to_replace)
48+
c:remove()
49+
c = nil
7750

78-
local c = G.shop_booster:remove_card(booster_to_replace)
79-
c:remove()
80-
c = nil
51+
end
8152

8253
end
8354

0 commit comments

Comments
 (0)