Skip to content

Commit

Permalink
Quick bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
GauntletGames-2086 committed Feb 18, 2025
1 parent ace1899 commit 000811d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lsp_def/classes/blind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
---@field defeat? fun(self: SMODS.Blind|table) Handles effect reverting when this Blind is defeated.
---@field drawn_to_hand? fun(self: SMODS.Blind|table) Handles effects when cards are drawn to hand.
---@field press_play? fun(self: SMODS.Blind|table) Handles effects when a hand is played.
---@field recalc_debuff? fun(self: SMODS.Blind|table, card: Card|table, from_blind: boolean): nil|boolean Determines if a card should be debuffed by this blind.
---@field debuff_hand? fun(self: SMODS.Blind|table, cards: table, hand: table, handname: string, check: nil|boolean): boolean Determines if the hand is debuffed.
---@field stay_flipped? fun(self: SMODS.Blind|table, area: CardArea|table, card: Card|table): boolean Determines if a card is drawn face down.
---@field recalc_debuff? fun(self: SMODS.Blind|table, card: Card|table, from_blind: boolean): boolean? Determines if a card should be debuffed by this blind.
---@field debuff_hand? fun(self: SMODS.Blind|table, cards: table, hand: table, handname: string, check: nil|boolean): boolean? Determines if the hand is debuffed.
---@field stay_flipped? fun(self: SMODS.Blind|table, area: CardArea|table, card: Card|table): boolean? Determines if a card is drawn face down.
---@field modify_hand? fun(self: SMODS.Blind|table, cards: table, poker_hands: table, text: string, mult: number, hand_chips: number): number?, number?, boolean? Handles modifications of the base score for played poker hand.
---@field get_loc_debuff_text? fun(self: SMODS.Blind|table): string? Handles text displayed for debuff warnings or invalid hands.
---@field loc_vars? fun(self: SMODS.Blind|table): table? Provides control over displaying the Blind descriptions. See [SMODS.Blind `loc_vars` implementation](https://github.com/Steamodded/smods/wiki/SMODS.Blind#api-methods) documentation for return value details.
Expand Down
2 changes: 1 addition & 1 deletion lsp_def/classes/poker_hand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
---@field inject? fun(self: SMODS.PokerHand|table, i?: number) Called during `inject_class`. Injects the object into the game.
---@field take_ownership? fun(self: SMODS.PokerHand|table, key: string, obj: table, silent?: boolean): nil|SMODS.PokerHand Takes control of vanilla objects. Child class must have get_obj for this to function
---@field get_obj? fun(self: SMODS.PokerHand|table, key: string): table? Returns an object if one matches the `key`.
---@field evaluate? fun(parts: table, hand: table): table Determines if played cards contain this hand, and what cards are a part of it.
---@field evaluate? fun(parts: table, hand: table): table? Determines if played cards contain this hand, and what cards are a part of it.
---@field modify_display_text? fun(self: SMODS.PokerHand|table, cards: Card[]|table[], scoring_hand: Card[]|table[]): string? Allows modifying the display text when this poker hand's text is meant to display.
---@overload fun(self: SMODS.PokerHand): SMODS.PokerHand
SMODS.PokerHand = setmetatable({}, {
Expand Down
2 changes: 1 addition & 1 deletion lsp_def/classes/sound.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---@field inject? fun(self: SMODS.Sound|table, i?: number) Called during `inject_class`. Injects the object into the game.
---@field take_ownership? fun(self: SMODS.Sound|table, key: string, obj: table, silent?: boolean): nil|SMODS.Sound Takes control of vanilla objects. Child class must have get_obj for this to function
---@field get_obj? fun(self: SMODS.Sound|table, key: string): table? Returns an object if one matches the `key`.
---@field select_music_track? fun(self: SMODS.Sound|table): nil|number Called each frame. Determines what music track to play. Music track with the highest number is played.
---@field select_music_track? fun(self: SMODS.Sound|table): nil|number|boolean Called each frame. Determines what music track to play. Music track with the highest number is played.
---@field create_replace_sound? fun(self: SMODS.Sound|table, replace: string|table) Replaces another sound with this one.
---@field create_stop_sound? fun(self: SMODS.Sound|table, key: string, times: nil|number) Supress sounds with the given sound code `times` amount of times or indefinitely.
---@field register_global? fun(self: SMODS.Sound|table) Registers all sound files of the current mod.
Expand Down
2 changes: 1 addition & 1 deletion lsp_def/classes/voucher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
---@field inject? fun(self: SMODS.Voucher|table, i?: number) Called during `inject_class`. Injects the object into the game.
---@field take_ownership? fun(self: SMODS.Voucher|table, key: string, obj: table, silent?: boolean): nil|SMODS.Voucher Takes control of vanilla objects. Child class must have get_obj for this to function
---@field get_obj? fun(self: SMODS.Voucher|table, key: string): table? Returns an object if one matches the `key`.
---@field redeem? fun(self: SMODS.Voucher|table) Defines behaviour when this voucher is redeemed.
---@field redeem? fun(self: SMODS.Voucher|table, voucher?: Card|table) Defines behaviour when this voucher is redeemed.
---@field new? fun(self, name, slug, config, pos, loc_txt, cost, unlocked, discovered, available, requires, atlas): any DEPRECATED. DO NOT USE
---@overload fun(self: SMODS.Voucher): SMODS.Voucher
SMODS.Voucher = setmetatable({}, {
Expand Down
8 changes: 6 additions & 2 deletions lsp_def/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MODDED_VERSION = ""
SMODS.path = ""

---@class Mod
---@field id string Unique ID.
---@field id? string Unique ID.
---@field name? string Name of the mod.
---@field display_name? string Display name of the mod.
---@field description? string Mod description.
Expand Down Expand Up @@ -43,6 +43,10 @@ SMODS.path = ""
---@type table<string, Mod|table>
SMODS.Mods = {}

---@type Mod|table?
--- The current mod being loaded.
SMODS.current_mod = {}

SMODS.Mods["Steamodded"] = SMODS
SMODS.Mods["Lovely"] = {
id = "Lovely",
Expand All @@ -63,4 +67,4 @@ function loadMods(modsDirectory) end
function initSteamodded() end

--- Injects all classes and items.
function SMODS.injectItems() end
function SMODS.injectItems() end
10 changes: 5 additions & 5 deletions lsp_def/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function SMODS.merge_lists(...) end
function SMODS.get_optional_features() end

---@param context CalcContext|table
---@param return_table table
---@param return_table? table
--- Used to calculate contexts across `G.jokers`, `scoring_hand` (if present), `G.play` and `G.GAME.selected_back`.
--- Hook this function to add different areas to MOST calculations
function SMODS.calculate_context(context, return_table) end
Expand Down Expand Up @@ -98,15 +98,15 @@ function SMODS.calculate_destroying_cards(context, cards_destroyed, scoring_hand
---@param scored_card Card|table
---@param key string
---@param amount number|boolean
---@param from_edition boolean
---@param from_edition? boolean
---@return boolean?
--- This function handles the calculation of each effect returned to evaluate play.
--- Can easily be hooked to add more calculation effects ala Talisman
function SMODS.calculate_individual_effect(effect, scored_card, key, amount, from_edition) end

---@param effect table
---@param scored_card Card|table
---@param from_edition boolean
---@param from_edition? boolean
---@return table
--- Handles calculating effects on provided `scored_card`.
function SMODS.calculate_effect(effect, scored_card, from_edition, pre_jokers) end
Expand Down Expand Up @@ -225,8 +225,8 @@ function SMODS.process_loc_text(ref_table, ref_value, loc_txt, key) end
--- Handles injecting localization files.
function SMODS.handle_loc_file(path) end

---@param pool table
---@param center SMODS.GameObject|table
---@param pool table[]
---@param center metatable
---@param replace boolean?
--- Injects an object into provided pool.
function SMODS.insert_pool(pool, center, replace) end
Expand Down
2 changes: 2 additions & 0 deletions lsp_def/vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ G.GAME.blind = Blind()

---@class Card: Moveable
---@field ability? table
---@field ignore_base_shader? table
---@field ignore_shadow? table
---@overload fun(...: any): Card|table
Card = {}
function Card:__call(...) return self end
Expand Down

0 comments on commit 000811d

Please sign in to comment.