-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblinds.lua
138 lines (129 loc) · 3.94 KB
/
blinds.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
local function recalculate_on_disable(self)
StrangeLib.dynablind.update_blind_scores(StrangeLib.dynablind.find_blind(self.key))
end
SMODS.Blind({
key = "glove",
boss = { showdown = true },
dollars = 8,
boss_colour = HEX("FFFFFF"),
pos = { x = 0, y = 0 },
atlas = "blinds",
mult = 2,
increase = 0.1,
score = function(self, base)
return base * (self.mult + (self.disabled and 0 or (self.increase * G.GAME.hands_played)))
end,
disable = recalculate_on_disable,
})
SMODS.Blind({
key = "caret",
boss = { min = 9 },
in_pool = function()
return G.GAME.round_resets.ante >= G.GAME.win_ante -- Boss should only appear in endless
or G.GAME.modifiers.endless_scaling -- or if endless scaling is enabled
end,
boss_colour = HEX("FFFFFF"),
pos = { x = 0, y = 1 },
atlas = "blinds",
mult = 1.5,
score = function(self, base)
return self.disabled and base or base ^ self.mult
end,
disable = recalculate_on_disable,
})
SMODS.Blind({
key = "arrow",
boss = { min = 4 },
boss_colour = HEX("FFFFFF"),
pos = { x = 0, y = 2 },
atlas = "blinds",
mult = 2,
})
local hook3 = Card.calculate_joker
function Card:calculate_joker(context)
if not (G.GAME.blind.name == "bl_pencil_arrow" and (context.repetition or context.retrigger_joker_check)) then
return hook3(self, context)
elseif hook3(self, context) then
G.GAME.blind.triggered = true
end
end
local hook4 = Card.calculate_seal
function Card:calculate_seal(context)
if not (G.GAME.blind.name == "bl_pencil_arrow" and context.repetition) then
return hook4(self, context)
elseif hook4(self, context) then
G.GAME.blind.triggered = true
end
end
SMODS.Blind({
key = "lock",
boss = { min = 3 },
in_pool = function(self)
if G.GAME.round_resets.ante < 3 then
return false
end
for k, v in ipairs(G.jokers.cards) do
if not v.ability.pinned then
return true
end
end
return false
end,
boss_colour = HEX("FFFFFF"),
pos = { x = 0, y = 3 },
atlas = "blinds",
mult = 2,
press_play = function(self)
local targets = {}
for k, v in ipairs(G.jokers.cards) do
if not v.ability.pinned then
table.insert(targets, v)
end
end
if #targets >= 1 then
local hit = pseudorandom_element(targets, pseudoseed(self.key))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.3,
func = function()
play_sound("gold_seal", 1.2, 0.4)
hit:juice_up(0.3, 0.3)
SMODS.Stickers.pinned:apply(hit, true)
SMODS.juice_up_blind()
return true
end
}))
G.GAME.blind.triggered = true
end
end,
})
SMODS.Blind({
key = "star",
boss = { showdown = true },
dollars = 8,
boss_colour = HEX("000058"),
pos = { x = 0, y = 4 },
atlas = "blinds",
mult = 2,
})
local hook5 = G.FUNCS.get_poker_hand_info
G.FUNCS.get_poker_hand_info = function(_cards)
local text
local loc_disp_text
local poker_hands
local scoring_hand
local disp_text
text, loc_disp_text, poker_hands, scoring_hand, disp_text = hook5(_cards)
if G.GAME.blind and G.GAME.blind.name == "bl_pencil_star" then
local old_size = #scoring_hand
scoring_hand = SMODS.has_no_rank(poker_hands["High Card"][1][1]) and {} or poker_hands["High Card"][1]
if old_size ~= #scoring_hand then
G.GAME.blind.triggered = true
end
end
return text, loc_disp_text, poker_hands, scoring_hand, disp_text
end
local hook6 = SMODS.always_scores
function SMODS.always_scores(card)
return not (G.GAME.blind and G.GAME.blind.name == "bl_pencil_star") and hook6(card)
end