updated tekelili cards and clean up helper for tekelili helper
This commit is contained in:
parent
5eb5b1e840
commit
5b474a6b77
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/Tekeli-li\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
|
@ -269,6 +269,8 @@ end
|
||||
|
||||
-- clean up for the four playermats and the mythos area
|
||||
function tidyPlayerMatCoroutine()
|
||||
local tekeliliHelper = getTekeliliHelper()
|
||||
|
||||
for i = 1, 5 do
|
||||
-- only continue for playermat (1-4) if option enabled
|
||||
if options["tidyPlayermats"] or i == 5 then
|
||||
@ -282,6 +284,11 @@ function tidyPlayerMatCoroutine()
|
||||
goto continue
|
||||
end
|
||||
|
||||
-- maybe store tekelili cards
|
||||
if tekeliliHelper and i ~= 5 then
|
||||
tekeliliHelper.call("storeTekelili", COLORS[i])
|
||||
end
|
||||
|
||||
local objList
|
||||
if i < 5 then
|
||||
objList = playmatApi.searchAroundPlaymat(COLORS[i])
|
||||
@ -320,6 +327,11 @@ function tidyPlayerMatCoroutine()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- maybe respawn tekelili cards
|
||||
if tekeliliHelper and i ~= 5 then
|
||||
tekeliliHelper.call("spawnStoredTekelili", COLORS[i])
|
||||
end
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
@ -340,3 +352,12 @@ function tidyPlayerMatCoroutine()
|
||||
printToAll("Clean up completed!", "Green")
|
||||
return 1
|
||||
end
|
||||
|
||||
-- used to detect the "Tekeli-li Helper" for Edge of the Earth
|
||||
function getTekeliliHelper()
|
||||
for _, obj in ipairs(getObjects()) do
|
||||
if obj.getName() == "Tekeli-li Helper" then
|
||||
return obj
|
||||
end
|
||||
end
|
||||
end
|
||||
|
22
src/playercards/cards/Tekeli-li.ttslua
Normal file
22
src/playercards/cards/Tekeli-li.ttslua
Normal file
@ -0,0 +1,22 @@
|
||||
function onLoad()
|
||||
self.addContextMenuItem("Return this card", returnSelf)
|
||||
end
|
||||
|
||||
-- uses the tekeli-li helper to place this card at the bottom of the deck
|
||||
function returnSelf()
|
||||
local helper = getTekeliliHelper()
|
||||
if helper == nil then
|
||||
printToAll("Couldn't find Tekeli-li Helper!")
|
||||
else
|
||||
helper.call("returnObject", self)
|
||||
end
|
||||
end
|
||||
|
||||
-- used to detect the "Tekeli-li Helper" for Edge of the Earth
|
||||
function getTekeliliHelper()
|
||||
for _, obj in ipairs(getObjects()) do
|
||||
if obj.getName() == "Tekeli-li Helper" then
|
||||
return obj
|
||||
end
|
||||
end
|
||||
end
|
@ -800,6 +800,10 @@ function returnGlobalDiscardPosition()
|
||||
return self.positionToWorld(DISCARD_PILE_POSITION)
|
||||
end
|
||||
|
||||
function returnGlobalDrawPosition()
|
||||
return self.positionToWorld(DRAW_DECK_POSITION)
|
||||
end
|
||||
|
||||
-- Sets this playermat's draw 1 button to visible
|
||||
---@param visible boolean Whether the draw 1 button should be visible
|
||||
function showDrawButton(visible)
|
||||
|
@ -79,6 +79,14 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns the position of the draw pile of the requested playmat
|
||||
---@param matColor string Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||
PlaymatApi.getDrawPosition = function(matColor)
|
||||
for _, mat in pairs(getMatForColor(matColor)) do
|
||||
return mat.call("returnGlobalDrawPosition")
|
||||
end
|
||||
end
|
||||
|
||||
-- Transforms a local position into a global position
|
||||
---@param localPos table Local position to be transformed
|
||||
---@param matColor string Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||
|
Loading…
x
Reference in New Issue
Block a user