fixed param type

This commit is contained in:
Chr1Z93 2024-02-04 13:30:39 +01:00
parent acf3f805d6
commit b8dfdfd294
9 changed files with 35 additions and 35 deletions

View File

@ -162,7 +162,7 @@ end
-- Callback handler for the main deck spawning. Looks for cards which should start in hand, and
-- draws them for the appropriate player.
---@param deck tts__GameObject Callback-provided spawned deck object
---@param deck tts__Object Callback-provided spawned deck object
---@param playerColor string Color of the player to draw the cards to
function deckSpawned(deck, playerColor)
local player = Player[playmatApi.getPlayerColor(playerColor)]
@ -471,7 +471,7 @@ function handlePeteSignatureAssets(investigatorId, cardList)
end
-- Callback function for investigator cards and minicards to set the correct state for alt art
---@param card tts__GameObject Card which needs to be set the state for
---@param card tts__Object Card which needs to be set the state for
---@param loadAltInvestigator string Contains the name of alternative art for the investigator ("normal", "revised" or "promo")
function loadAltArt(card, loadAltInvestigator)
-- states are set up this way:

View File

@ -49,7 +49,7 @@ do
-- adds bless / curse sealing to the hovered card
---@param playerColor string Color of the player to show the broadcast to
---@param hoveredObject tts__GameObject Hovered object
---@param hoveredObject tts__Object Hovered object
BlessCurseManagerApi.addBlurseSealingMenu = function(playerColor, hoveredObject)
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
end

View File

@ -46,7 +46,7 @@ do
end
-- returns a chaos token to the bag and calls all relevant functions
---@param token tts__GameObject Chaos token to return
---@param token tts__Object Chaos token to return
ChaosBagApi.returnChaosTokenToBag = function(token)
return Global.call("returnChaosTokenToBag", token)
end
@ -67,7 +67,7 @@ do
end
-- called by playermats (by the "Draw chaos token" button)
---@param mat tts__GameObject Playermat that triggered this
---@param mat tts__Object Playermat that triggered this
---@param drawAdditional boolean Controls whether additional tokens should be drawn
ChaosBagApi.drawChaosToken = function(mat, drawAdditional)
return Global.call("drawChaosToken", {mat = mat, drawAdditional = drawAdditional})

View File

@ -17,7 +17,7 @@ do
end
-- draw an encounter card for the requesting mat
---@param mat tts__GameObject Playermat that triggered this
---@param mat tts__Object Playermat that triggered this
---@param alwaysFaceUp boolean Whether the card should be drawn face-up
MythosAreaApi.drawEncounterCard = function(mat, alwaysFaceUp)
getMythosArea().call("drawEncounterCard", {mat = mat, alwaysFaceUp = alwaysFaceUp})

View File

@ -213,7 +213,7 @@ end
-- Checks the given card and adds it to the list of locations tracked for connection purposes.
-- A card will be added to the tracking if it is a location in the play area (based on centerpoint).
---@param card tts__GameObject A card object, possibly a location.
---@param card tts__Object A card object, possibly a location.
function maybeTrackLocation(card)
-- Collision checks for any part of the card overlap, but our other tracking is centerpoint
-- Ignore any collision where the centerpoint isn't in the area
@ -243,7 +243,7 @@ end
-- and destruction, as a destroyed object does not trigger collision exit. An object can also be
-- deleted mid-drag, but the ordering for drag events means we can't clear those here and those will
-- be cleared in the next onUpdate() cycle.
---@param card tts__GameObject Card to (maybe) stop tracking
---@param card tts__Object Card to (maybe) stop tracking
function maybeUntrackLocation(card)
-- Locked objects no longer collide (hence triggering an exit event) but are still in the play
-- area. If the object is now locked, don't remove it.
@ -412,9 +412,9 @@ end
-- Draws a bidirectional location connection between the two cards, adding the lines to do so to the
-- given lines list.
---@param card1 tts__GameObject One of the card objects to connect
---@param card2 tts__GameObject The other card object to connect
---@param vectorOwner tts__GameObject The object which these lines will be set to. Used for relative
---@param card1 tts__Object One of the card objects to connect
---@param card2 tts__Object The other card object to connect
---@param vectorOwner tts__Object The object which these lines will be set to. Used for relative
--- positioning and scaling, as well as highlighting connections during a drag operation
---@param lines table List of vector line elements. Mutable, will be updated to add this connector
function addBidirectionalVector(card1, card2, vectorOwner, lines)
@ -435,9 +435,9 @@ end
-- Draws a one-way location connection between the two cards, adding the lines to do so to the
-- given lines list. Arrows will point towards the target card.
---@param origin tts__GameObject Origin card in the connection
---@param target tts__GameObject Target card object to connect
---@param vectorOwner tts__GameObject The object which these lines will be set to. Used for relative
---@param origin tts__Object Origin card in the connection
---@param target tts__Object Target card object to connect
---@param vectorOwner tts__Object The object which these lines will be set to. Used for relative
--- positioning and scaling, as well as highlighting connections during a drag operation
---@param lines table List of vector line elements. Mutable, will be updated to add this connector
function addOneWayVector(origin, target, vectorOwner, lines)
@ -470,7 +470,7 @@ end
-- Draws an arrowhead at the given position.
---@param arrowheadPos tts__Vector Centerpoint of the arrowhead to draw (NOT the tip of the arrow)
---@param originPos tts__Vector Origin point of the connection, used to position the arrow arms
---@param vectorOwner tts__GameObject The object which these lines will be set to. Used for relative
---@param vectorOwner tts__Object The object which these lines will be set to. Used for relative
--- positioning and scaling, as well as highlighting connections during a drag operation
---@param lines table List of vector line elements. Mutable, will be updated to add this arrow
function addArrowLines(arrowheadPos, originPos, vectorOwner, lines)
@ -524,7 +524,7 @@ end
-- Check to see if the given object is within the bounds of the play area, based solely on the X and
-- Z coordinates, ignoring height
---@param object tts__GameObject Object to check
---@param object tts__Object Object to check
---@return boolean: True if the object is inside the play area
function isInPlayArea(object)
local bounds = self.getBounds()
@ -613,7 +613,7 @@ function countVP(highlightOff)
end
-- checks if a card has clues on it, returns true if clues are on it
---@param card tts__GameObject Card to check for clues
---@param card tts__Object Card to check for clues
function cardHasClues(card)
local searchResult = searchLib.onObject(card, "isClue")
return #searchResult > 0

View File

@ -13,7 +13,7 @@ do
end
-- moves a card to the victory display (in the first empty spot)
---@param object tts__GameObject Object that should be checked and potentially moved
---@param object tts__Object Object that should be checked and potentially moved
VictoryDisplayApi.placeCard = function(object)
if object ~= nil and object.tag == "Card" then
getVictoryDisplay().call("placeCard", object)

View File

@ -135,7 +135,7 @@ do
-- the work once a card has hit an area where it might spawn tokens. It will check to see if
-- the card has already spawned, find appropriate data from either the uses metadata or the Data
-- Helper, and spawn the tokens.
---@param card tts__GameObject Card to maybe spawn tokens for
---@param card tts__Object Card to maybe spawn tokens for
---@param extraUses table A table of <use type>=<count> which will modify the number of tokens
--- spawned for that type. e.g. Akachi's playmat should pass "Charge"=1
TokenManager.spawnForCard = function(card, extraUses)
@ -151,7 +151,7 @@ do
end
-- Spawns a set of tokens on the given card.
---@param card tts__GameObject Card to spawn tokens on
---@param card tts__Object Card to spawn tokens on
---@param tokenType string Type of token to spawn, for example "damage", "horror" or "resource"
---@param tokenCount number How many tokens to spawn. For damage or horror this value will be set to the
-- spawned state object rather than spawning multiple tokens
@ -173,7 +173,7 @@ do
-- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror
-- tokens.
---@param card tts__GameObject Card to spawn tokens on
---@param card tts__Object Card to spawn tokens on
---@param tokenType string type of token to spawn, valid values are "damage" and "horror". Other
-- types should use spawnMultipleTokens()
---@param tokenValue number Value to set the damage/horror to
@ -291,9 +291,9 @@ do
end
-- Checks a card for metadata to maybe replenish it
---@param card tts__GameObject Card object to be replenished
---@param card tts__Object Card object to be replenished
---@param uses table The already decoded metadata.uses (to avoid decoding again)
---@param mat tts__GameObject The playmat the card is placed on (for rotation and casting)
---@param mat tts__Object The playmat the card is placed on (for rotation and casting)
TokenManager.maybeReplenishCard = function(card, uses, mat)
-- TODO: support for cards with multiple uses AND replenish (as of yet, no official card needs that)
if uses[1].count and uses[1].replenish then
@ -303,7 +303,7 @@ do
-- Delegate function to the token spawn tracker. Exists to avoid circular dependencies in some
-- callers.
---@param card tts__GameObject Card object to reset the tokens for
---@param card tts__Object Card object to reset the tokens for
TokenManager.resetTokensSpawned = function(card)
tokenSpawnTrackerApi.resetTokensSpawned(card.getGUID())
end
@ -327,7 +327,7 @@ do
end
-- Checks to see if the given card has location data in the DataHelper
---@param card tts__GameObject Card to check for data
---@param card tts__Object Card to check for data
---@return boolean: True if this card has data in the helper, false otherwise
TokenManager.hasLocationData = function(card)
internal.initDataHelperData()
@ -358,7 +358,7 @@ do
-- Spawn tokens for a card based on the uses metadata. This will consider the face up/down state
-- of the card for both locations and standard cards.
---@param card tts__GameObject Card to maybe spawn tokens for
---@param card tts__Object Card to maybe spawn tokens for
---@param extraUses table A table of <use type>=<count> which will modify the number of tokens
--- spawned for that type. e.g. Akachi's playmat should pass "Charge"=1
internal.spawnTokensFromUses = function(card, extraUses)
@ -381,7 +381,7 @@ do
-- Spawn tokens for a card based on the data helper data. This will consider the face up/down state
-- of the card for both locations and standard cards.
---@param card tts__GameObject Card to maybe spawn tokens for
---@param card tts__Object Card to maybe spawn tokens for
internal.spawnTokensFromDataHelper = function(card)
internal.initDataHelperData()
local playerData = internal.getPlayerCardData(card)
@ -395,7 +395,7 @@ do
end
-- Spawn tokens for a player card using data retrieved from the Data Helper.
---@param card tts__GameObject Card to maybe spawn tokens for
---@param card tts__Object Card to maybe spawn tokens for
---@param playerData table Player card data structure retrieved from the DataHelper. Should be
-- the right data for this card.
internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)
@ -406,7 +406,7 @@ do
end
-- Spawn tokens for a location using data retrieved from the Data Helper.
---@param card tts__GameObject Card to maybe spawn tokens for
---@param card tts__Object Card to maybe spawn tokens for
---@param locationData table Location data structure retrieved from the DataHelper. Should be
-- the right data for this card.
internal.spawnLocationTokensFromDataHelper = function(card, locationData)
@ -446,7 +446,7 @@ do
end
-- Gets the right uses structure for this card, based on metadata and face up/down state
---@param card tts__GameObject Card to pull the uses from
---@param card tts__Object Card to pull the uses from
internal.getUses = function(card)
local metadata = JSON.decode(card.getGMNotes()) or { }
if metadata.type == "Location" then
@ -463,7 +463,7 @@ do
end
-- Dynamically create positions for clues on a card.
---@param card tts__GameObject Card the clues will be placed on
---@param card tts__Object Card the clues will be placed on
---@param count number How many clues?
---@return table: Array of global positions to spawn the clues at
internal.buildClueOffsets = function(card, count)
@ -477,9 +477,9 @@ do
return cluePositions
end
---@param card tts__GameObject Card object to be replenished
---@param card tts__Object Card object to be replenished
---@param uses table The already decoded metadata.uses (to avoid decoding again)
---@param mat tts__GameObject The playmat the card is placed on (for rotation and casting)
---@param mat tts__Object The playmat the card is placed on (for rotation and casting)
internal.replenishTokens = function(card, uses, mat)
local cardPos = card.getPosition()

View File

@ -225,7 +225,7 @@ do
-- Callback for creation of the camera hook object. Will attach the camera and show the current
-- (presumably first) card.
---@param hook tts__GameObject Created object
---@param hook tts__Object Created object
internal.onHookCreated = function(hook)
local playerColor = hook.getGMNotes()
tourState[playerColor].cameraHookGuid = hook.getGUID()

View File

@ -3,7 +3,7 @@ do
local searchLib = require("util/SearchLib")
-- places a card/deck at a position or merges into an existing deck
---@param obj tts__GameObject Object to move
---@param obj tts__Object Object to move
---@param pos table New position for the object
---@param rot table New rotation for the object (optional)
DeckLib.placeOrMergeIntoDeck = function(obj, pos, rot)