Repository navigation
Expand file tree
/
Copy pathbooster_util.lua
More file actions
48 lines (47 loc) · 1.64 KB
/
Copy pathbooster_util.lua
File metadata and controls
48 lines (47 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
for k, v in pairs(G.P_CENTER_POOLS["Booster"]) do
local booster_sizes = {"normal", "jumbo", "mega"}
for k, size in pairs(booster_sizes) do
if string.find(v.key, size) then
v.size = size
end
end
if v.size then
if v.in_pool then --hook in case of booster pack already having a in_pool function... No idea if this works
local pool_hook = v.in_pool
v.in_pool = function(self, args)
for k, size in pairs(booster_sizes) do
if v.size ~= size then
if args and args.source then
if args.source == "only_"..size then
return false
end
end
end
end
return pool_hook(self, args)
end
end
if not v.in_pool then
v.in_pool = function(self, args)
for k, size in pairs(booster_sizes) do
if v.size ~= size then
if args and args.source then
if args.source == "only_"..size then
return false
end
end
end
end
return true
end
end
end
end
JAND.booster_emplace = function(card)
create_shop_card_ui(card, 'Booster', G.shop_booster)
card.ability.booster_pos = #G.shop_booster.cards + 1
card:start_materialize()
card.T.w = G.CARD_W*1.27
card.T.h = G.CARD_H*1.27
G.shop_booster:emplace(card)
end