-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspectrumframework.lua
More file actions
123 lines (109 loc) · 4.92 KB
/
spectrumframework.lua
File metadata and controls
123 lines (109 loc) · 4.92 KB
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
SPECF = {
prefix = SMODS.current_mod.prefix,
config = SMODS.current_mod.config,
}
SPECF.config.planet_design.last_option = {} --
SPECF.config.joker_design.last_option = {} --Clear these on boot to ensure everything works
SMODS.load_file("configui.lua")()
SMODS.load_file("atli.lua")()
SMODS.load_file("functions.lua")()
SMODS.load_file("hands.lua")()
SMODS.load_file("planets.lua")()
SMODS.load_file("jokers.lua")()
if not SMODS.current_mod.lovely then
NFS.write(SMODS.current_mod.path .. '.lovelyignore', '')
error("Spectrum Framework: Lovely patches failed! Please make sure the file structure is not nested. The mod will be automatically disabled on restart.")
end
--Talisman compatibility compatibility
to_big = to_big or function(x)
return x
end
to_number = to_number or function(x)
return x
end
local GameStartRef = Game.start_run
function Game:start_run(args)
GameStartRef(self, args)
SPECF.say("Starting run", "TRACE")
if SPECF.easy_spectra() and not args.savetext then
SPECF.say('Lowering hand values', "TRACE")
G.GAME.hands["spectrum_Spectrum"].visible = true
local hand_adjustments = {
["spectrum_Spectrum"] = { mult = 3, chips = 20, l_mult = 3, l_chips = 15 },
["spectrum_Straight Spectrum"] = { mult = 6, chips = 60, l_mult = 2, l_chips = 35 },
["spectrum_Spectrum House"] = { mult = 7, chips = 80, l_mult = 4, l_chips = 35 },
["spectrum_Spectrum Five"] = { mult = 14, chips = 120, l_mult = 3, l_chips = 40 },
}
for hand_name, values in pairs(hand_adjustments) do
local hand = G.GAME.hands[hand_name]
if hand then
hand.mult = to_big(values.mult)
hand.chips = to_big(values.chips)
hand.s_mult = to_big(values.mult)
hand.s_chips = to_big(values.chips)
hand.l_mult = to_big(values.l_mult)
hand.l_chips = to_big(values.l_chips)
end
end
SPECF.reposition_modded_hands(G.handlist, {
["spectrum_Spectrum Five"] = {name = "Five of a Kind", position = "above"},
["spectrum_Spectrum House"] = {name = "Four of a Kind", position = "above"},
["spectrum_Straight Spectrum"] = {name = "Four of a Kind", position = "below"},
["spectrum_Spectrum"] = {name = "Three of a Kind", position = "below"}
})
else
if args.savetext then
SPECF.say('Restoring saved run', "TRACE")
if G.GAME.spectrum_status == 1 then
SPECF.reposition_modded_hands(G.handlist, {
["spectrum_Spectrum Five"] = {name = "Five of a Kind", position = "above"},
["spectrum_Spectrum House"] = {name = "Four of a Kind", position = "above"},
["spectrum_Straight Spectrum"] = {name = "Four of a Kind", position = "below"},
["spectrum_Spectrum"] = {name = "Three of a Kind", position = "below"}
})
SPECF.say("Hands moved to lower positions", "TRACE")
end
else
SPECF.reposition_modded_hands(G.handlist, { --Move back to default locations in case they've been lowered
["spectrum_Spectrum Five"] = {name = "Flush Five", position = "above"},
["spectrum_Spectrum House"] = {name = "Flush House", position = "above"},
["spectrum_Straight Spectrum"] = {name = "Straight Flush", position = "above"},
["spectrum_Spectrum"] = {name = "Full House", position = "above"}
})
SPECF.say('Hand values have not been modified for new run', "TRACE")
end
end
end
SMODS.Joker:take_ownership('smeared',{
loc_vars = function(self)
local key, vars
if not SPECF.config.smear_modded_suits then
key = self.key
else
key = self.key.."_alt"
end
return { key = key, vars = vars }
end,
locked_loc_vars = function(self, info_queue, card) --Make it not say 'nil nil'
return {
key = "j_smeared",
vars = {
G.P_CENTERS.j_smeared.unlock_condition.extra.count,
localize{
type = 'name_text',
key = G.P_CENTERS.j_smeared.unlock_condition.extra.e_key,
set = 'Enhanced'
},
},
}
end
}, true)
local issuitref = Card.is_suit
function Card:is_suit(suit, bypass_debuff, flush_calc)
if next(find_joker('Smeared Joker')) and SPECF.config.smear_modded_suits and not SMODS.has_no_suit(self) then
if (self.base.suit ~= 'Spades' and self.base.suit ~= 'Clubs' and self.base.suit ~= 'Hearts' and self.base.suit ~= 'Diamonds') and (suit ~= 'Spades' and suit ~= 'Clubs' and suit ~= 'Hearts' and suit ~= 'Diamonds') then
return true
end
end
return issuitref(self, suit, bypass_debuff, flush_calc)
end