Skip to content

Commit 292ed96

Browse files
committed
adversary and lock
1 parent 2653d03 commit 292ed96

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

items/spectral.lua

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,25 @@ local lock = {
2020
name = "cry-Lock",
2121
key = "lock",
2222
pos = { x = 0, y = 1 },
23-
config = {},
23+
config = { extra = 1 },
2424
cost = 4,
2525
order = 451,
2626
atlas = "atlasnotjokers",
2727
loc_vars = function(self, info_queue, card)
2828
info_queue[#info_queue + 1] = { key = "eternal", set = "Other" }
29+
return {
30+
vars = {
31+
card.ability.extra
32+
}
33+
}
2934
end,
3035
can_use = function(self, card)
31-
return #G.jokers.cards > 0
36+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, card.ability.extra)
37+
return #cards > 0 and #cards <= card.ability.extra
3238
end,
3339
use = function(self, card, area, copier)
3440
local used_consumable = copier or card
41+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, card.ability.extra)
3542
check_for_unlock({ cry_used_consumable = "c_cry_lock" })
3643
local target = #G.jokers.cards == 1 and G.jokers.cards[1] or G.jokers.cards[math.random(#G.jokers.cards)]
3744
G.E_MANAGER:add_event(Event({
@@ -43,23 +50,23 @@ local lock = {
4350
return true
4451
end,
4552
}))
46-
for i = 1, #G.jokers.cards do
47-
local percent = 1.15 - (i - 0.999) / (#G.jokers.cards - 0.998) * 0.3
53+
for i = 1, #cards do
54+
local percent = 1.15 - (i - 0.999) / (#cards - 0.998) * 0.3
4855
G.E_MANAGER:add_event(Event({
4956
trigger = "after",
5057
delay = 0.15,
5158
func = function()
52-
G.jokers.cards[i]:flip()
59+
cards[i]:flip()
5360
play_sound("card1", percent)
54-
G.jokers.cards[i]:juice_up(0.3, 0.3)
61+
cards[i]:juice_up(0.3, 0.3)
5562
return true
5663
end,
5764
}))
5865
end
5966
delay(0.2)
60-
for i = 1, #G.jokers.cards do
61-
local CARD = G.jokers.cards[i]
62-
local percent = 0.85 + (i - 0.999) / (#G.jokers.cards - 0.998) * 0.3
67+
for i = 1, #cards do
68+
local CARD = cards[i]
69+
local percent = 0.85 + (i - 0.999) / (#cards - 0.998) * 0.3
6370
G.E_MANAGER:add_event(Event({
6471
trigger = "after",
6572
delay = 0.15,
@@ -719,6 +726,11 @@ local adversary = {
719726
if not center.edition or (center.edition and not center.edition.negative) then
720727
info_queue[#info_queue + 1] = G.P_CENTERS.e_negative
721728
end
729+
return {
730+
vars = {
731+
G.jokers and number_format(1 + #G.jokers.cards) or "1"
732+
}
733+
}
722734
end,
723735
can_use = function(self, card)
724736
return #G.jokers.cards > 0
@@ -778,7 +790,7 @@ local adversary = {
778790
}))
779791
G.E_MANAGER:add_event(Event({
780792
func = function()
781-
G.GAME.cry_shop_joker_price_modifier = G.GAME.cry_shop_joker_price_modifier * 2
793+
G.GAME.cry_shop_joker_price_modifier = G.GAME.cry_shop_joker_price_modifier * number_format(1 + #G.jokers.cards)
782794
for k, v in pairs(G.I.CARD) do
783795
if v.set_cost then
784796
v:set_cost()

localization/en-us.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,7 @@ return {
33833383
text = {
33843384
"{C:red}All{} of your {C:attention}Jokers{} become {C:dark_edition}Negative{},",
33853385
"{C:red}all{} {C:attention}Jokers{} in the shop cost",
3386-
"{C:red}double{} for the rest of the run",
3386+
"{X:red,C:white}X#1#{} for the rest of the run",
33873387
},
33883388
},
33893389
c_cry_analog = {
@@ -3434,7 +3434,7 @@ return {
34343434
name = "Lock",
34353435
text = {
34363436
"Remove {C:red}all{} stickers",
3437-
"from {C:red}all{} Jokers,",
3437+
"from {C:attention}#1#{} selected Joker#<s>1#",
34383438
"then apply {C:purple,E:1}Eternal{}",
34393439
"to a random {C:attention}Joker{}",
34403440
},

0 commit comments

Comments
 (0)