-
Notifications
You must be signed in to change notification settings - Fork 0
/
JokerOnlyDeck.lua
145 lines (132 loc) · 4.07 KB
/
JokerOnlyDeck.lua
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
--- STEAMODDED HEADER
--- MOD_NAME: Joker Only Deck
--- MOD_ID: JokerOnlyDeck
--- MOD_AUTHOR: [Mojimoon]
--- MOD_DESCRIPTION: Adds a deck that filters out all consumables and vouchers, leaving only the jokers.
----------------------------------------------
------------MOD CODE -------------------------
local Backapply_to_runRef = Back.apply_to_run
function Back.apply_to_run(arg_56_0)
Backapply_to_runRef(arg_56_0)
if arg_56_0.effect.config.moji_ban_sets then
G.E_MANAGER:add_event(Event({
func = function()
for _, _set in ipairs(arg_56_0.effect.config.moji_ban_sets) do
for k, v in ipairs(G.P_CENTER_POOLS[_set.set]) do
G.GAME.banned_keys[v.key] = true
end
end
return true
end
}))
end
if arg_56_0.effect.config.moji_ban_keys then
G.E_MANAGER:add_event(Event({
func = function()
for k, v in ipairs(arg_56_0.effect.config.moji_ban_keys) do
G.GAME.banned_keys[v.id] = true
end
return true
end
}))
end
if arg_56_0.effect.config.moji_ban_boosters then
G.E_MANAGER:add_event(Event({
func = function()
for k, v in ipairs(G.P_CENTER_POOLS['Booster']) do
for _, _type in ipairs(arg_56_0.effect.config.moji_ban_boosters) do
if _type.kind == v.kind then
G.GAME.banned_keys[v.key] = true
end
end
end
return true
end
}))
end
if arg_56_0.effect.config.moji_joker_only then
G.GAME.starting_params.moji_joker_only = arg_56_0.effect.config.moji_joker_only
G.E_MANAGER:add_event(Event({
func = function()
G.GAME.tarot_rate = 0
G.GAME.planet_rate = 0
return true
end
}))
end
end
local Gameupdate_shopRef = Game.update_shop
function Game:update_shop(dt)
if G.GAME.starting_params.moji_joker_only then
G.load_shop_vouchers = nil
G.GAME.current_round.voucher = nil
end
Gameupdate_shopRef(self, dt)
end
local loc_en = {
["name"]="Joker Only Deck",
["text"]={
[1]="All {C:tarot}Consumables{} and {C:attention}Vouchers{}",
[2]="are banned, together with",
[3]="related Jokers, Tags",
[4]="and Booster Packs"
}
}
local loc_zh = {
["name"]="仅小丑牌组",
["text"]={
[1]="所有{C:tarot}消耗牌{}和{C:attention}优惠券{}",
[2]="及相关的小丑牌、标签",
[3]="和补充包都被禁用"
}
}
local loc_txt = loc_en
if G.SETTINGS.language == "zh_CN" then
loc_txt = loc_zh
end
local jokeronly = SMODS.Deck:new(
"Joker Only Deck",
"b_jokeronly",
{
moji_ban_sets = {
{set = "Planet"},
{set = "Tarot"},
{set = "Spectral"},
{set = "Voucher"}
},
moji_ban_keys = {
-- Planet Card
{id = 'j_8_ball'},
{id = 'j_constellation'},
{id = 'j_satellite'},
{id = 'j_astronomer'},
-- Tarot Card
{id = 'j_superposition'},
{id = 'j_vagabond'},
{id = 'j_hallucination'},
{id = 'j_fortune_teller'},
{id = 'j_cartomancer'},
-- Spectral Card
{id = 'j_sixth_sense'},
{id = 'j_seance'},
-- Tags
{id = 'tag_voucher'},
{id = 'tag_charm'},
{id = 'tag_meteor'},
{id = 'tag_ethereal'},
{id = 'tag_orbital'}
},
moji_ban_boosters = {
{kind = "Celestial"},
{kind = "Arcana"},
{kind = "Spectral"}
},
moji_joker_only = true,
consumable_slot = -2
},
{x = 5, y = 2},
loc_txt
)
jokeronly:register()
----------------------------------------------
------------MOD CODE END----------------------