SCED/src/core/PlayAreaApi.ttslua

51 lines
2.6 KiB
Plaintext
Raw Normal View History

do
local PlayAreaApi = { }
local PLAY_AREA_GUID = "721ba2"
-- Returns the current value of the investigator counter from the playmat
---@return Integer. Number of investigators currently set on the counter
PlayAreaApi.getInvestigatorCount = function()
return getObjectFromGUID(PLAY_AREA_GUID).call("getInvestigatorCount")
end
-- Move all contents on the play area (cards, tokens, etc) one row up. Certain fixed objects will
-- be ignored, as will anything the player has tagged with 'displacement_excluded'
---@param playerColor Color of the player requesting the shift. Used solely to send an error
--- message in the unlikely case that the scripting zone has been deleted
PlayAreaApi.shiftContentsUp = function(playerColor)
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsUp", playerColor)
end
-- Move all contents on the play area (cards, tokens, etc) one row down. Certain fixed objects
-- will be ignored, as will anything the player has tagged with 'displacement_excluded'
---@param playerColor Color of the player requesting the shift. Used solely to send an error
--- message in the unlikely case that the scripting zone has been deleted
PlayAreaApi.shiftContentsDown = function(playerColor)
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsDown", playerColor)
end
-- Move all contents on the play area (cards, tokens, etc) one column left. Certain fixed objects
-- will be ignored, as will anything the player has tagged with 'displacement_excluded'
---@param playerColor Color of the player requesting the shift. Used solely to send an error
--- message in the unlikely case that the scripting zone has been deleted
PlayAreaApi.shiftContentsLeft = function(playerColor)
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsLeft", playerColor)
end
-- Move all contents on the play area (cards, tokens, etc) one column right. Certain fixed
-- objects will be ignored, as will anything the player has tagged with 'displacement_excluded'
---@param playerColor Color of the player requesting the shift. Used solely to send an error
--- message in the unlikely case that the scripting zone has been deleted
PlayAreaApi.shiftContentsRight = function(playerColor)
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsRight", playerColor)
end
-- Reset the play area's tracking of which cards have had tokens spawned.
PlayAreaApi.resetSpawnedCards = function()
return getObjectFromGUID(PLAY_AREA_GUID).call("resetSpawnedCards")
end
return PlayAreaApi
end