Skip to content

Commit ce3fce6

Browse files
Code card fixes
- Fixed Quantum Computing not working correctly with cards that have a multiuse that isn't 1 (ex exploit) - Fixed code cards using up a multiuse when pulled from a program pack
1 parent 451d80d commit ce3fce6

File tree

4 files changed

+110
-16
lines changed

4 files changed

+110
-16
lines changed

items/code.lua

Lines changed: 102 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ local crash = {
310310
force_use = function(self, card, area)
311311
self:use(card, area)
312312
end,
313+
set_ability = function(self, center)
314+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
315+
end,
313316
init = function(self)
314317
function create_UIBox_crash(card)
315318
G.E_MANAGER:add_event(Event({
@@ -953,6 +956,9 @@ local keygen = {
953956
force_use = function(self, card, area)
954957
self:use(card, area)
955958
end,
959+
set_ability = function(self, center)
960+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
961+
end,
956962
}
957963
-- ://Payload
958964
-- Triple interest gained on next cash out, stacks exponentially (multiplicative on modest)
@@ -1002,6 +1008,9 @@ local payload = {
10021008
force_use = function(self, card, area)
10031009
self:use(card, area)
10041010
end,
1011+
set_ability = function(self, center)
1012+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1013+
end,
10051014
}
10061015
-- ://Exploit
10071016
-- Choose a hand, next hand is forced to that hand regardless of cards played, +1 asc power for that hand, multi-use 2
@@ -1030,7 +1039,7 @@ local exploit = {
10301039
pos = { x = 8, y = 3 },
10311040
cost = 4,
10321041
order = 403,
1033-
config = { cry_multiuse = 2, extra = { enteredhand = "" } }, -- i don't think this ever uses config...?
1042+
config = { extra = { enteredhand = "" } }, -- i don't think this ever uses config...?
10341043
loc_vars = function(self, info_queue, card)
10351044
if G.STAGE == G.STAGES.RUN and Cryptid.enabled("set_cry_poker_hand_stuff") == true then
10361045
local modest = Cryptid.gameset(G.P_CENTERS.c_cry_sunplanet) == "modest"
@@ -1075,6 +1084,9 @@ local exploit = {
10751084
G.GAME.ACTIVE_CODE_CARD = G.GAME.CODE_DESTROY_CARD or card
10761085
G.FUNCS.overlay_menu({ definition = G.UIDEF.exploit_menu() })
10771086
end,
1087+
set_ability = function(self, center)
1088+
center.ability.cry_multiuse = math.ceil(2 + (G.GAME.extra_multiuse or 0))
1089+
end,
10781090
}
10791091
-- ://Malware
10801092
-- Apply Glitched edition to held in hand cards
@@ -1153,6 +1165,9 @@ local malware = {
11531165
force_use = function(self, card, area)
11541166
self:use(card, area)
11551167
end,
1168+
set_ability = function(self, center)
1169+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1170+
end,
11561171
}
11571172
-- ://NPERROR
11581173
-- Add last played hand back to your hand, multi-use 2
@@ -1181,9 +1196,9 @@ local crynperror = {
11811196
cost = 4,
11821197
atlas = "atlasnotjokers",
11831198
order = 405,
1184-
config = { cry_multiuse = 2 },
11851199
can_use = function(self, card)
1186-
return G.GAME.last_hand_played_cards and (Cryptid.safe_get(G.GAME, "blind", "in_blind")) -- TODO: work in boosters
1200+
return G.GAME.last_hand_played_cards
1201+
and (Cryptid.safe_get(G.GAME, "blind", "in_blind") and not G.GAME.USING_RUN) -- TODO: work in boosters
11871202
end,
11881203
use = function(self, card, area, copier)
11891204
for i = 1, #G.GAME.last_hand_played_cards do
@@ -1209,6 +1224,9 @@ local crynperror = {
12091224
force_use = function(self, card, area)
12101225
self:use(card, area)
12111226
end,
1227+
set_ability = function(self, center)
1228+
center.ability.cry_multiuse = math.ceil(2 + (G.GAME.extra_multiuse or 0))
1229+
end,
12121230
}
12131231
-- ://Rework
12141232
-- Destroy a selected joker, create a Rework Tag of that joker with an upgraded edition via collection
@@ -1295,6 +1313,9 @@ local rework = {
12951313
force_use = function(self, card, area)
12961314
self:use(card, area)
12971315
end,
1316+
set_ability = function(self, center)
1317+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1318+
end,
12981319
}
12991320
-- Rework Tag
13001321
-- Upgraded edition refers to the next edition along in the collection; base -> foil -> holo -> poly -> negative -> etc
@@ -1479,6 +1500,9 @@ local merge = {
14791500
force_use = function(self, card, area)
14801501
self:use(card, area)
14811502
end,
1503+
set_ability = function(self, center)
1504+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1505+
end,
14821506
}
14831507
-- ://Commit
14841508
-- Destroys a selected joker and creates a different joker of the same rarity
@@ -1564,6 +1588,9 @@ local commit = {
15641588
force_use = function(self, card, area)
15651589
self:use(card, area)
15661590
end,
1591+
set_ability = function(self, center)
1592+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1593+
end,
15671594
}
15681595
-- ://MACHINECODE
15691596
-- Creates a random Glitched consumable
@@ -1839,6 +1866,9 @@ local machinecode = {
18391866
force_use = function(self, card, area)
18401867
self:use(card, area)
18411868
end,
1869+
set_ability = function(self, center)
1870+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1871+
end,
18421872
}
18431873
-- ://Spaghetti
18441874
-- Creates a random Glitched food joker
@@ -1886,6 +1916,9 @@ local spaghetti = {
18861916
force_use = function(self, card, area)
18871917
self:use(card, area)
18881918
end,
1919+
set_ability = function(self, center)
1920+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1921+
end,
18891922
}
18901923
-- ://Seed
18911924
-- Gives any card Rigged
@@ -1945,6 +1978,9 @@ local seed = {
19451978
force_use = function(self, card, area)
19461979
self:use(card, area)
19471980
end,
1981+
set_ability = function(self, center)
1982+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
1983+
end,
19481984
}
19491985
-- Rigged sticker, guarantees listed odds (most of the time)
19501986
local rigged = {
@@ -2106,6 +2142,9 @@ local patch = {
21062142
force_use = function(self, card, area)
21072143
self:use(card, area)
21082144
end,
2145+
set_ability = function(self, center)
2146+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2147+
end,
21092148
}
21102149
-- ://Update, TBD, missing art
21112150
local cryupdate = {
@@ -2230,6 +2269,9 @@ local hook = {
22302269
force_use = function(self, card, area)
22312270
self:use(card, area)
22322271
end,
2272+
set_ability = function(self, center)
2273+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2274+
end,
22332275
}
22342276
-- Hooked Sticker
22352277
-- When a joker is naturally triggered, Force-Trigger the hooked joker
@@ -2342,6 +2384,9 @@ local oboe = {
23422384
force_use = function(self, card, area)
23432385
self:use(card, area)
23442386
end,
2387+
set_ability = function(self, center)
2388+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2389+
end,
23452390
}
23462391
-- ://Assemble
23472392
-- Add the number of jokers to selected hand's +mult
@@ -2424,6 +2469,9 @@ local assemble = {
24242469
force_use = function(self, card, area)
24252470
self:use(card, area)
24262471
end,
2472+
set_ability = function(self, center)
2473+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2474+
end,
24272475
}
24282476
-- ://Instantiate
24292477
-- Draw 2 cards; one with selected card's rank and the other with selected card's suit (if possible)
@@ -2500,6 +2548,9 @@ local inst = {
25002548
force_use = function(self, card, area)
25012549
self:use(card, area)
25022550
end,
2551+
set_ability = function(self, center)
2552+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2553+
end,
25032554
}
25042555
-- ://Revert
25052556
-- Loads the game state from the end of the last boss blind, at cash out
@@ -2571,6 +2622,9 @@ local revert = {
25712622
force_use = function(self, card, area)
25722623
self:use(card, area)
25732624
end,
2625+
set_ability = function(self, center)
2626+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2627+
end,
25742628
}
25752629
-- Function://
25762630
-- Saves the last 3 consumables used on first use, every use thereafter creates a copy of all 3 of those
@@ -2683,6 +2737,9 @@ local cryfunction = {
26832737
force_use = function(self, card, area)
26842738
self:use(card, area)
26852739
end,
2740+
set_ability = function(self, center)
2741+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2742+
end,
26862743
}
26872744
-- Function:// Sticker
26882745
-- When used, creates the next saved Function:// card
@@ -2862,6 +2919,9 @@ local run = {
28622919
force_use = function(self, card, area)
28632920
self:use(card, area)
28642921
end,
2922+
set_ability = function(self, center)
2923+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
2924+
end,
28652925
}
28662926

28672927
-- ://Declare
@@ -3128,6 +3188,9 @@ local declare = {
31283188
return c
31293189
end
31303190
end,
3191+
set_ability = function(self, center)
3192+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
3193+
end,
31313194
}
31323195

31333196
-- ://Class
@@ -3266,6 +3329,9 @@ local class = {
32663329
v:set_ability(pseudorandom_element(choices, pseudoseed("forceclass")))
32673330
end
32683331
end,
3332+
set_ability = function(self, center)
3333+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
3334+
end,
32693335
}
32703336
-- ://Global
32713337
-- Gives a selected card the Global sticker
@@ -3315,6 +3381,9 @@ local global = {
33153381
force_use = function(self, card, area)
33163382
self:use(card, area)
33173383
end,
3384+
set_ability = function(self, center)
3385+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
3386+
end,
33183387
}
33193388
-- Global sticker
33203389
-- Always drawn on blind start or when booster pack opened
@@ -3500,6 +3569,9 @@ local variable = {
35003569
SMODS.change_base(v, v.base.suit, pseudorandom_element(choices, pseudoseed("forcevariable")))
35013570
end
35023571
end,
3572+
set_ability = function(self, center)
3573+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
3574+
end,
35033575
}
35043576
-- ://Log
35053577
-- View one of:
@@ -3813,6 +3885,9 @@ local log = {
38133885
G.GAME.USING_CODE = false
38143886
end
38153887
end,
3888+
set_ability = function(self, center)
3889+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
3890+
end,
38163891
-- bulk_use = function(self, card, area, copier, number)
38173892

38183893
-- end,
@@ -3995,6 +4070,9 @@ local quantify = {
39954070
end
39964071
end
39974072
end,
4073+
set_ability = function(self, center)
4074+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4075+
end,
39984076
}
39994077
-- ://Divide,
40004078
-- Halves item costs in shop
@@ -4061,6 +4139,9 @@ local divide = {
40614139
c:set_cost()
40624140
end
40634141
end,
4142+
set_ability = function(self, center)
4143+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4144+
end,
40644145
}
40654146
-- ://Multiply
40664147
-- Doubles a joker's values until the end of the round (exponentially)
@@ -4123,6 +4204,9 @@ local multiply = {
41234204
force_use = function(self, card, area)
41244205
self:use(card, area)
41254206
end,
4207+
set_ability = function(self, center)
4208+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4209+
end,
41264210
}
41274211

41284212
-- ://Delete
@@ -4153,7 +4237,6 @@ local delete = {
41534237
order = 428,
41544238
pos = { x = 11, y = 2 },
41554239
cost = 4,
4156-
config = { cry_multiuse = 3 },
41574240
loc_vars = function(self, info_queue, card)
41584241
return { vars = { Cryptid.safe_get(card, "ability", "cry_multiuse") or self.config.cry_multiuse } }
41594242
end,
@@ -4212,6 +4295,9 @@ local delete = {
42124295
end
42134296
c:start_dissolve()
42144297
end,
4298+
set_ability = function(self, center)
4299+
center.ability.cry_multiuse = math.ceil(3 + (G.GAME.extra_multiuse or 0))
4300+
end,
42154301
}
42164302
-- ://Alt-Tab
42174303
-- Creates the current blind's Tag
@@ -4319,6 +4405,9 @@ local alttab = {
43194405
force_use = function(self, card, area)
43204406
self:use(card, area)
43214407
end,
4408+
set_ability = function(self, center)
4409+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4410+
end,
43224411
}
43234412
-- ://Ctrl-V
43244413
-- Creates a copy of a selected playing card or consumable
@@ -4478,6 +4567,9 @@ local ctrl_v = {
44784567
force_use = function(self, card, area)
44794568
self:use(card, area)
44804569
end,
4570+
set_ability = function(self, center)
4571+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4572+
end,
44814573
}
44824574
-- ://Reboot
44834575
-- Shuffle all cards into deck, then reset Hands and Discards to default values
@@ -4537,6 +4629,9 @@ local reboot = {
45374629
force_use = function(self, card, area)
45384630
self:use(card, area)
45394631
end,
4632+
set_ability = function(self, center)
4633+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4634+
end,
45404635
}
45414636
-- ://;
45424637
-- Ends the current non-boss blind, skips cash out
@@ -4591,6 +4686,9 @@ local semicolon = {
45914686
force_use = function(self, card, area)
45924687
self:use(card, area)
45934688
end,
4689+
set_ability = function(self, center)
4690+
center.ability.cry_multiuse = math.ceil(1 + (G.GAME.extra_multiuse or 0))
4691+
end,
45944692
}
45954693

45964694
-- Automaton (Tarot)

items/voucher.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,12 @@ local quantum_computing = { -- Code T3; Code cards spawn with +1 use
12241224
return { vars = { (card and card.ability.extra or self.config.extra) } }
12251225
end,
12261226
requires = { "v_cry_satellite_uplink" },
1227+
redeem = function(self, card)
1228+
G.GAME.extra_multiuse = (G.GAME.extra_multiuse or 0) + card.ability.extra
1229+
end,
1230+
unredeem = function(self, card)
1231+
G.GAME.extra_multiuse = (G.GAME.extra_multiuse or 0) - card.ability.extra
1232+
end,
12271233
}
12281234

12291235
-- Triple+ tag tags

lib/overrides.lua

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ function Game:init_game_object()
272272
g.bonus_asc_power = 0
273273
g.cry_oboe = 0
274274
g.boostertag = 0
275+
g.extra_multiuse = 0
275276
-- Create G.GAME.events when starting a run, so there's no errors
276277
g.events = {}
277278
g.jokers_sold = {}
@@ -1103,17 +1104,6 @@ function create_card(_type, area, legendary, _rarity, skip_materialize, soulable
11031104
end
11041105
end
11051106
end
1106-
if (card.ability.set == "Code") and G.GAME.used_vouchers.v_cry_quantum_computing then
1107-
local tot = 0
1108-
for k, v in pairs(SMODS.find_card("v_cry_quantum_computing")) do
1109-
tot = tot + v.ability.extra
1110-
end
1111-
if card.ability.cry_multiuse then
1112-
card.ability.cry_multiuse = math.ceil((card.ability.cry_multiuse + tot))
1113-
else
1114-
card.ability.cry_multiuse = tot + 1
1115-
end
1116-
end
11171107
if
11181108
G.GAME.modifiers.cry_force_edition
11191109
and not G.GAME.modifiers.cry_force_random_edition

0 commit comments

Comments
 (0)