Skip to content

Commit b3ea7ea

Browse files
authored
Merge pull request #439 from GauntletGames-2086/lsp-fixes
Quick LSP Fixes
2 parents abf98ce + d368f16 commit b3ea7ea

File tree

14 files changed

+41
-18
lines changed

14 files changed

+41
-18
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# LSP setting files (add more if applicable)
2+
.vscode/*
3+
.luarc.json

items/code.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ local hooked = {
12071207
var = localize({ type = "name_text", set = "Joker", key = G.jokers.cards[i].config.center.key })
12081208
end
12091209
end
1210-
var = var or "[no joker found - " .. (card.hook_id or "nil") .. "]"
1210+
var = var or ("[no joker found - " .. (card.hook_id or "nil") .. "]")
12111211
end
12121212
return { vars = { var or "hooked Joker" } }
12131213
end,

items/epic.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,7 @@ local fleshpanopticon = {
17241724
card.gone = false
17251725
G.GAME.blind.chips = G.GAME.blind.chips * card.ability.extra.boss_size
17261726
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
1727-
G.HUD_blind:recalculate(true)
1727+
G.HUD_blind:recalculate()
17281728
G.E_MANAGER:add_event(Event({
17291729
func = function()
17301730
G.E_MANAGER:add_event(Event({

items/misc.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ local oversat = {
247247
return cry_misprintize_val(val, {
248248
min = 2,
249249
max = 2,
250-
}, is_card_big(card), true)
250+
}, is_card_big(card))
251251
end)
252252
end
253253
end,
@@ -347,7 +347,7 @@ local glitched = {
347347
return cry_misprintize_val(val, {
348348
min = 0.1 * (G.GAME.modifiers.cry_misprint_min or 1),
349349
max = 10 * (G.GAME.modifiers.cry_misprint_max or 1),
350-
}, is_card_big(card), true)
350+
}, is_card_big(card))
351351
end)
352352
end
353353
end,

items/misc_joker.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,6 @@ local fspinner = {
14981498
order = 77,
14991499
blueprint_compat = true,
15001500
perishable_compat = false,
1501-
atlas = "fspinner",
15021501
calculate = function(self, card, context)
15031502
if context.before and not context.blueprint then
15041503
local play_more_than = (G.GAME.hands[context.scoring_name].played or 0)

lib/ascended.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function cry_ascend(num) -- edit this function at your leisure
155155
else
156156
return math.max(
157157
num,
158-
num * ((1.25 + (0.05 * (G.GAME.sunnumber or 0))) ^ G.GAME.current_round.current_hand.cry_asc_num or 0)
158+
num * ((1.25 + (0.05 * (G.GAME.sunnumber or 0))) ^ (G.GAME.current_round.current_hand.cry_asc_num or 0))
159159
)
160160
end
161161
end

lib/gameset.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,11 +936,13 @@ end
936936
---- CARD ENABLING SYSTEM ----
937937
------------------------------
938938

939+
---@type fun(self: SMODS.GameObject|table, reason: table)?
939940
SMODS.GameObject._disable = function(self, reason)
940941
if not self.cry_disabled then
941942
self.cry_disabled = reason or { type = "manual" } --used to display more information that can be used later
942943
end
943944
end
945+
---@type fun(self: SMODS.GameObject|table)?
944946
SMODS.GameObject.enable = function(self)
945947
if self.cry_disabled then
946948
self.cry_disabled = nil
@@ -950,6 +952,7 @@ end
950952
-- Note: For custom pools, these only support Center.pools, not ObjectType.cards
951953
-- That could cause issues with mod compat in the future
952954
-- Potential improvement: automatic pool detection from gamesets?
955+
---@type fun(self: SMODS.Center|table, reason: table)?
953956
SMODS.Center._disable = function(self, reason)
954957
if not self.cry_disabled then
955958
self.cry_disabled = reason or { type = "manual" } --used to display more information that can be used later
@@ -960,6 +963,7 @@ SMODS.Center._disable = function(self, reason)
960963
G.P_CENTERS[self.key] = nil
961964
end
962965
end
966+
---@type fun(self: SMODS.Center|table)?
963967
SMODS.Center.enable = function(self)
964968
if self.cry_disabled then
965969
self.cry_disabled = nil
@@ -970,6 +974,8 @@ SMODS.Center.enable = function(self)
970974
end
971975
end
972976
end
977+
978+
---@type fun(self: SMODS.Joker|table)?
973979
SMODS.Joker.enable = function(self)
974980
if self.cry_disabled then
975981
SMODS.Center.enable(self)
@@ -980,6 +986,7 @@ SMODS.Joker.enable = function(self)
980986
end
981987
end
982988
end
989+
---@type fun(self: SMODS.Joker|table, reason: table)?
983990
SMODS.Joker._disable = function(self, reason)
984991
if not self.cry_disabled then
985992
SMODS.Center._disable(self, reason)
@@ -990,6 +997,7 @@ SMODS.Joker._disable = function(self, reason)
990997
end
991998
end
992999
end
1000+
---@type fun(self: SMODS.Joker|table, rarity: string|number)?
9931001
SMODS.Joker.set_rarity = function(self, rarity)
9941002
SMODS.remove_pool(G.P_JOKER_RARITY_POOLS[self.rarity], self.key)
9951003
self.rarity = rarity
@@ -1000,26 +1008,30 @@ SMODS.Joker.set_rarity = function(self, rarity)
10001008
end
10011009
end
10021010

1011+
---@type fun(self: SMODS.Consumable|table)?
10031012
SMODS.Consumable.enable = function(self)
10041013
if self.cry_disabled then
10051014
SMODS.Center.enable(self)
10061015
SMODS.insert_pool(G.P_CENTER_POOLS["Consumeables"], self)
10071016
end
10081017
end
1018+
---@type fun(self: SMODS.Consumable|table, reason: table)?
10091019
SMODS.Consumable._disable = function(self, reason)
10101020
if not self.cry_disabled then
10111021
SMODS.Center._disable(self, reason)
10121022
SMODS.remove_pool(G.P_CENTER_POOLS["Consumeables"], self.key)
10131023
end
10141024
end
10151025

1026+
---@type fun(self: SMODS.Tag|table, reason: table)?
10161027
SMODS.Tag._disable = function(self, reason)
10171028
if not self.cry_disabled then
10181029
self.cry_disabled = reason or { type = "manual" } --used to display more information that can be used later
10191030
SMODS.remove_pool(G.P_CENTER_POOLS[self.set], self.key)
10201031
G.P_TAGS[self.key] = nil
10211032
end
10221033
end
1034+
---@type fun(self: SMODS.Tag|table)?
10231035
SMODS.Tag.enable = function(self)
10241036
if self.cry_disabled then
10251037
self.cry_disabled = nil
@@ -1028,12 +1040,14 @@ SMODS.Tag.enable = function(self)
10281040
end
10291041
end
10301042

1043+
---@type fun(self: SMODS.Blind|table, reason: table)?
10311044
SMODS.Blind._disable = function(self, reason)
10321045
if not self.cry_disabled then
10331046
self.cry_disabled = reason or { type = "manual" } --used to display more information that can be used later
10341047
G.P_BLINDS[self.key] = nil
10351048
end
10361049
end
1050+
---@type fun(self: SMODS.Blind|table)?
10371051
SMODS.Blind.enable = function(self)
10381052
if self.cry_disabled then
10391053
self.cry_disabled = nil
@@ -1042,12 +1056,14 @@ SMODS.Blind.enable = function(self)
10421056
end
10431057

10441058
--Removing seals from the center table causes issues
1059+
---@type fun(self: SMODS.Seal|table, reason: table)?
10451060
SMODS.Seal._disable = function(self, reason)
10461061
if not self.cry_disabled then
10471062
self.cry_disabled = reason or { type = "manual" } --used to display more information that can be used later
10481063
SMODS.remove_pool(G.P_CENTER_POOLS[self.set], self.key)
10491064
end
10501065
end
1066+
---@type fun(self: SMODS.Seal|table)?
10511067
SMODS.Seal.enable = function(self)
10521068
if self.cry_disabled then
10531069
self.cry_disabled = nil
@@ -1056,6 +1072,7 @@ SMODS.Seal.enable = function(self)
10561072
end
10571073

10581074
--Removing editions from the center table causes issues, so instead we make them unable to spawn naturally
1075+
---@type fun(self: SMODS.Seal|table, reason: table)?
10591076
SMODS.Edition._disable = function(self, reason)
10601077
if not self.cry_disabled then
10611078
self.cry_disabled = reason or { type = "manual" } --used to display more information that can be used later
@@ -1066,6 +1083,7 @@ SMODS.Edition._disable = function(self, reason)
10661083
end
10671084
end
10681085
end
1086+
---@type fun(self: SMODS.Seal|table)?
10691087
SMODS.Edition.enable = function(self)
10701088
if self.cry_disabled then
10711089
self.cry_disabled = nil

lib/misc.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@ function is_card_big(joker)
563563
end
564564

565565
--Utility function to check things without erroring
566+
---@param t table
567+
---@param ... any
568+
---@return table|false
566569
function safe_get(t, ...)
567570
local current = t
568571
for _, k in ipairs({ ... }) do

localization/id.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,7 +3083,7 @@ return {
30833083
k_disable_music = "Disable Music",
30843084

30853085
k_cry_epic = "Epic",
3086-
k_cry_epic = "Exotic",
3086+
k_cry_exotic = "Exotic",
30873087

30883088
cry_notif_jimball_1 = "Jimball",
30893089
cry_notif_jimball_2 = "Copyright Notice",
@@ -3113,7 +3113,7 @@ return {
31133113
cry_oversat = "Oversaturated",
31143114

31153115
k_cry_epic = "Epic",
3116-
k_cry_epic = "Exotic",
3116+
k_cry_exotic = "Exotic",
31173117
},
31183118
rnj_loc_txts = {
31193119
stats = {

localization/ja.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,7 +3083,7 @@ return {
30833083
k_disable_music = "Disable Music",
30843084

30853085
k_cry_epic = "Epic",
3086-
k_cry_epic = "Exotic",
3086+
k_cry_exotic = "Exotic",
30873087

30883088
cry_notif_jimball_1 = "Jimball",
30893089
cry_notif_jimball_2 = "Copyright Notice",
@@ -3113,7 +3113,7 @@ return {
31133113
cry_oversat = "Oversaturated",
31143114

31153115
k_cry_epic = "Epic",
3116-
k_cry_epic = "Exotic",
3116+
k_cry_exotic = "Exotic",
31173117
},
31183118
rnj_loc_txts = {
31193119
stats = {

0 commit comments

Comments
 (0)