Skip to content

Commit 0f16c7a

Browse files
Fix Off by one and Booster Tag
1 parent 2595862 commit 0f16c7a

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

items/code.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,18 +2309,18 @@ local oboe = {
23092309
can_bulk_use = true,
23102310
loc_vars = function(self, info_queue, card)
23112311
if not card then
2312-
return { vars = { self.config.extra.choices, (Cryptid.safe_get(G.GAME, "cry_oboe") or 0) } }
2312+
return { vars = { math.floor(self.config.extra.choices), (Cryptid.safe_get(G.GAME, "cry_oboe") or 0) } }
23132313
end
2314-
return { vars = { card.ability.extra.choices, (Cryptid.safe_get(G.GAME, "cry_oboe") or 0) } }
2314+
return { vars = { math.floor(card.ability.extra.choices), (Cryptid.safe_get(G.GAME, "cry_oboe") or 0) } }
23152315
end,
23162316
can_use = function(self, card)
23172317
return true
23182318
end,
23192319
use = function(self, card, area, copier)
2320-
G.GAME.cry_oboe = (G.GAME.cry_oboe or 0) + card.ability.extra.choices
2320+
G.GAME.cry_oboe = G.GAME.cry_oboe + math.floor(card.ability.extra.choices)
23212321
end,
23222322
bulk_use = function(self, card, area, copier, number)
2323-
G.GAME.cry_oboe = (G.GAME.cry_oboe or 0) + (card.ability.extra.choices * number)
2323+
G.GAME.cry_oboe = G.GAME.cry_oboe + (math.floor(card.ability.extra.choices) * number)
23242324
end,
23252325
demicoloncompat = true,
23262326
force_use = function(self, card, area)

items/tag.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ local booster = {
13991399
local lock = tag.ID
14001400
G.CONTROLLER.locks[lock] = true
14011401
tag:yep("+", G.C.BLUE, function()
1402-
G.GAME.boostertag = (G.GAME.boostertag or 0) + 1
1402+
G.GAME.boostertag = G.GAME.boostertag + 1
14031403
G.CONTROLLER.locks[lock] = nil
14041404
return true
14051405
end)

lib/overrides.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ function Game:init_game_object()
263263
g.sunlevel = 1
264264
g.sunnumber = { modest = 0, not_modest = 0 }
265265
g.bonus_asc_power = 0
266+
g.cry_oboe = 0
267+
g.boostertag = 0
266268
-- Create G.GAME.events when starting a run, so there's no errors
267269
g.events = {}
268270
g.jokers_sold = {}

lovely/misprint.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,22 @@ match_indent = true
4040
[[patches]]
4141
[patches.pattern]
4242
target = "card.lua"
43-
pattern = "G.GAME.pack_choices = self.ability.choose or self.config.center.config.choose or 1"
43+
pattern = "G.GAME.pack_choices = math.min((self.ability.choose or self.config.center.config.choose or 1) + (G.GAME.modifiers.booster_choice_mod or 0), self.ability.extra and math.max(1, self.ability.extra + (G.GAME.modifiers.booster_size_mod or 0)) or self.config.center.extra and math.max(1, self.config.center.extra + (G.GAME.modifiers.booster_size_mod or 0)) or 1)"
4444
position = "after"
4545
payload = '''
4646
G.GAME.pack_choices = ((self.ability.choose and self.ability.extra) and math.min(math.floor(self.ability.extra), self.ability.choose)) or 1
4747
if G.GAME.modifiers.cry_misprint_min then
4848
G.GAME.pack_size = self.ability.extra
49-
if to_big(G.GAME.pack_size) < to_big(1) then G.GAME.pack_size = 1 end
49+
if G.GAME.pack_size < 1 then G.GAME.pack_size = 1 end
5050
self.ability.extra = G.GAME.pack_size
5151
G.GAME.pack_choices = math.min(math.floor(G.GAME.pack_size), self.ability.choose)
52-
--G.GAME.pack_choices = math.min(math.floor(G.GAME.pack_size),cry_format(G.GAME.pack_choices * Cryptid.log_random(pseudoseed('cry_misprint_p'..G.GAME.round_resets.ante),G.GAME.modifiers.cry_misprint_min,G.GAME.modifiers.cry_misprint_max),"%.2f"))
5352
end
54-
if G.GAME.cry_oboe then
53+
if G.GAME.cry_oboe > 0 then
5554
self.ability.extra = self.ability.extra + G.GAME.cry_oboe
5655
G.GAME.pack_choices = G.GAME.pack_choices + G.GAME.cry_oboe
57-
G.GAME.cry_oboe = nil
56+
G.GAME.cry_oboe = 0
5857
end
59-
if G.GAME.boostertag and to_big(G.GAME.boostertag) > to_big(0) then
58+
if G.GAME.boostertag and G.GAME.boostertag > 0 then
6059
self.ability.extra = self.ability.extra * 2
6160
G.GAME.pack_choices = G.GAME.pack_choices * 2
6261
G.GAME.boostertag = math.max(0, G.GAME.boostertag - 1)
@@ -76,8 +75,8 @@ if G.GAME.boostertag and to_big(G.GAME.boostertag) > to_big(0) then
7675
}))
7776
end
7877
end
79-
self.ability.extra = math.min(self.ability.extra, 1000)
80-
G.GAME.pack_choices = math.min(G.GAME.pack_choices, 1000)
78+
self.ability.extra = math.min(self.ability.extra, 500)
79+
G.GAME.pack_choices = math.min(G.GAME.pack_choices, 500)
8180
G.GAME.pack_size = self.ability.extra
8281
'''
8382
match_indent = true

0 commit comments

Comments
 (0)