Skip to content

Commit ad37e8d

Browse files
committed
unhardcode some editions
1 parent 4fd5ede commit ad37e8d

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

items/misc.lua

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ local mosaic = {
750750
get_weight = function(self)
751751
return G.GAME.edition_rate * self.weight
752752
end,
753-
loc_vars = function(self, info_queue)
754-
return { vars = { self.config.x_chips } }
753+
loc_vars = function(self, info_queue, card)
754+
return { vars = { card and card.edition and card.edition.x_chips or self.config.x_chips } }
755755
end,
756756
calculate = function(self, card, context)
757757
if
@@ -764,7 +764,7 @@ local mosaic = {
764764
and context.cardarea == G.play
765765
)
766766
then
767-
return { x_chips = self.config.x_chips } -- updated value
767+
return { x_chips = card and card.edition and card.edition.x_chips or self.config.x_chips } -- updated value
768768
end
769769
if context.joker_main then
770770
card.config.trigger = true -- context.edition triggers twice, this makes it only trigger once (only for jonklers)
@@ -1177,8 +1177,8 @@ local astral = {
11771177
return G.GAME.edition_rate * self.weight
11781178
end,
11791179
config = { e_mult = 1.1, trigger = nil },
1180-
loc_vars = function(self, info_queue)
1181-
return { vars = { self.config.e_mult } }
1180+
loc_vars = function(self, info_queue, card)
1181+
return { vars = { card and card.edition and card.edition.e_mult or self.config.e_mult } }
11821182
end,
11831183
calculate = function(self, card, context)
11841184
if
@@ -1191,7 +1191,7 @@ local astral = {
11911191
and context.cardarea == G.play
11921192
)
11931193
then
1194-
return { e_mult = self.config.e_mult } -- updated value
1194+
return { e_mult = card and card.edition and card.edition.e_mult or self.config.e_mult } -- updated value
11951195
end
11961196
if context.joker_main then
11971197
card.config.trigger = true -- context.edition triggers twice, this makes it only trigger once (only for jonklers)
@@ -1257,10 +1257,11 @@ local blurred = {
12571257
)
12581258
then
12591259
local extra_retrigger = pseudorandom("cry_blurred")
1260-
<= G.GAME.probabilities.normal / self.config.retrigger_chance
1260+
<= G.GAME.probabilities.normal / (card and card.edition and card.edition.retrigger_chance or self.config.retrigger_chance)
12611261
return {
12621262
message = localize("cry_again_q"),
1263-
repetitions = self.config.retriggers + (extra_retrigger and self.config.extra_retriggers or 0),
1263+
repetitions = (card and card.edition and card.edition.retriggers or self.config.retriggers) +
1264+
(extra_retrigger and card and card.edition and card.edition.extra_retriggers or self.config.extra_retriggers or 0),
12641265
card = card,
12651266
}
12661267
end
@@ -1329,9 +1330,13 @@ local noisy = {
13291330
and context.cardarea == G.play
13301331
)
13311332
then
1333+
local min_mult = card and card.edition and card.edition.min_mult or self.config.min_mult
1334+
local max_mult = card and card.edition and card.edition.max_mult or self.config.max_mult
1335+
local min_chips = card and card.edition and card.edition.min_chips or self.config.min_chips
1336+
local max_chips = card and card.edition and card.edition.max_chips or self.config.max_chips
13321337
return {
1333-
mult = pseudorandom("cry_noisy_mult", self.config.min_mult, self.config.max_mult),
1334-
chips = pseudorandom("cry_noisy_chips", self.config.min_chips, self.config.max_chips),
1338+
mult = pseudorandom("cry_noisy_mult", min_mult, max_mult),
1339+
chips = pseudorandom("cry_noisy_chips", min_chips, max_chips),
13351340
} -- updated value
13361341
end
13371342
if context.joker_main then
@@ -1681,8 +1686,8 @@ local jollyedition = {
16811686
shader = "m",
16821687
disable_base_shader = true,
16831688
disable_shadow = true,
1684-
loc_vars = function(self, info_queue)
1685-
return { vars = { self.config.mult } }
1689+
loc_vars = function(self, info_queue, card)
1690+
return { vars = { card and card.edition and card.edition.mult or self.config.mult } }
16861691
end,
16871692
calculate = function(self, card, context)
16881693
if
@@ -1695,7 +1700,7 @@ local jollyedition = {
16951700
and context.cardarea == G.play
16961701
)
16971702
then
1698-
return { mult = self.config.mult } -- updated value
1703+
return { card and card.edition and card.edition.mult or self.config.mult } -- updated value
16991704
end
17001705
if context.joker_main then
17011706
card.config.trigger = true -- context.edition triggers twice, this makes it only trigger once (only for jonklers)
@@ -1818,18 +1823,18 @@ local glass_edition = {
18181823
weight = 7,
18191824
extra_cost = 2,
18201825
config = { x_mult = 3, shatter_chance = 8, trigger = nil },
1821-
loc_vars = function(self, info_queue)
1826+
loc_vars = function(self, info_queue, card)
18221827
return {
18231828
vars = {
1824-
(self.config.shatter_chance - 1),
1825-
self.config.shatter_chance,
1826-
self.config.x_mult,
1829+
((card and card.edition and card.edition.shatter_chance or self.config.shatter_chance) - 1),
1830+
(card and card.edition and card.edition.shatter_chance or self.config.shatter_chance),
1831+
card and card.edition and card.edition.x_mult or self.config.x_mult,
18271832
},
18281833
}
18291834
end,
18301835
calculate = function(self, card, context)
18311836
if context.edition and context.cardarea == G.jokers and card.config.trigger then
1832-
return { x_mult = self.config.x_mult }
1837+
return { x_mult = card and card.edition and card.edition.x_mult or self.config.x_mult }
18331838
end
18341839

18351840
if
@@ -1947,8 +1952,8 @@ local gold_edition = {
19471952
extra_cost = 4,
19481953
in_shop = true,
19491954
config = { dollars = 2, active = true },
1950-
loc_vars = function(self, info_queue)
1951-
return { vars = { self.config.dollars } }
1955+
loc_vars = function(self, info_queue, card)
1956+
return { vars = { card and card.edition and card.edition.dollars or self.config.dollars } }
19521957
end,
19531958
sound = {
19541959
sound = "cry_e_golden",
@@ -1974,7 +1979,7 @@ local gold_edition = {
19741979
and context.consumeable == card
19751980
)
19761981
then
1977-
return { p_dollars = self.config.dollars } -- updated value
1982+
return { p_dollars = card and card.edition and card.edition.dollars or self.config.dollars } -- updated value
19781983
end
19791984
end,
19801985
}

0 commit comments

Comments
 (0)