Merge branch 'main' into chaos-token-updates
This commit is contained in:
commit
5239229bde
@ -1473,7 +1473,7 @@
|
|||||||
"PowerWordUpgradeSheet.0d9481",
|
"PowerWordUpgradeSheet.0d9481",
|
||||||
"PocketMultiToolUpgradeSheet.d706e7",
|
"PocketMultiToolUpgradeSheet.d706e7",
|
||||||
"MakeshiftTrapUpgradeSheet.64dfce",
|
"MakeshiftTrapUpgradeSheet.64dfce",
|
||||||
"LivingLinkUpgradeSheet.19a05b",
|
"LivingInkUpgradeSheet.19a05b",
|
||||||
"HyperphysicalShotcasterUpgradeSheet.a4eec2",
|
"HyperphysicalShotcasterUpgradeSheet.a4eec2",
|
||||||
"HuntersArmorUpgradeSheet.d2d01b",
|
"HuntersArmorUpgradeSheet.d2d01b",
|
||||||
"HonedInstinctUpgradeSheet.ba0e34",
|
"HonedInstinctUpgradeSheet.ba0e34",
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
"LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[]]",
|
"LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[]]",
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
"Name": "CardCustom",
|
"Name": "CardCustom",
|
||||||
"Nickname": "Living Link Upgrade Sheet",
|
"Nickname": "Living Ink Upgrade Sheet",
|
||||||
"SidewaysCard": false,
|
"SidewaysCard": false,
|
||||||
"Snap": true,
|
"Snap": true,
|
||||||
"Sticky": true,
|
"Sticky": true,
|
@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"ImageScalar": 1,
|
"ImageScalar": 1,
|
||||||
"ImageSecondaryURL": "",
|
"ImageSecondaryURL": "",
|
||||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1910115722577754046/64AF9853E51B79561BEAA3BEF13BBC694BBF9A34/",
|
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2018214163835858903/EECF1C00C9A0C837DD40D7B5A3456B88DF0CEC08/",
|
||||||
"WidthScale": 0
|
"WidthScale": 0
|
||||||
},
|
},
|
||||||
"Description": "Left-Click: Add token\nRight-Click: Remove token\n\nContextmenu allows resetting the current state or removing all bless/curse tokens from play.\n\nSee Notebook for detailed instructions.",
|
"Description": "Left-Click: Add token\nRight-Click: Remove token\n\nContextmenu allows resetting the current state or removing all bless/curse tokens from play.\n\nSee Notebook for detailed instructions.",
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "",
|
"LuaScript": "require(\"util/Trashcan\")",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MaterialIndex": -1,
|
"MaterialIndex": -1,
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "",
|
"LuaScript": "require(\"util/Trashcan\")",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MaterialIndex": -1,
|
"MaterialIndex": -1,
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "",
|
"LuaScript": "require(\"util/Trashcan\")",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MaterialIndex": -1,
|
"MaterialIndex": -1,
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "",
|
"LuaScript": "require(\"util/Trashcan\")",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MaterialIndex": -1,
|
"MaterialIndex": -1,
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "",
|
"LuaScript": "require(\"util/Trashcan\")",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MaterialIndex": -1,
|
"MaterialIndex": -1,
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
|
@ -35,6 +35,11 @@ local BACKGROUNDS = {
|
|||||||
url = "http://cloud-3.steamusercontent.com/ugc/1754695635919099826/3C3CBFFAADB2ACA9957C736491F470AE906CC953/",
|
url = "http://cloud-3.steamusercontent.com/ugc/1754695635919099826/3C3CBFFAADB2ACA9957C736491F470AE906CC953/",
|
||||||
fontcolor = { 0, 0, 0 }
|
fontcolor = { 0, 0, 0 }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title = "Stick to the Plan",
|
||||||
|
url = "http://cloud-3.steamusercontent.com/ugc/2018214163838897493/8E38B96C5A8D703A59009A932432CBE21ABE63A2/",
|
||||||
|
fontcolor = { 1, 1, 1 }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title = "Wooden Sledge",
|
title = "Wooden Sledge",
|
||||||
url = "http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/",
|
url = "http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,7 @@ local chaosTokens = {}
|
|||||||
local chaosTokensLastMat = nil
|
local chaosTokensLastMat = nil
|
||||||
local IS_RESHUFFLING = false
|
local IS_RESHUFFLING = false
|
||||||
local bagSearchers = {}
|
local bagSearchers = {}
|
||||||
|
local MAT_COLORS = {"White", "Orange", "Green", "Red"}
|
||||||
local hideTitleSplashWaitFunctionId = nil
|
local hideTitleSplashWaitFunctionId = nil
|
||||||
local playmatApi = require("playermat/PlaymatApi")
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
local tokenManager = require("core/token/TokenManager")
|
local tokenManager = require("core/token/TokenManager")
|
||||||
@ -179,7 +180,8 @@ function actualEncounterCardDraw(card, params)
|
|||||||
local alwaysFaceUp = params[3]
|
local alwaysFaceUp = params[3]
|
||||||
local faceUpRotation = 0
|
local faceUpRotation = 0
|
||||||
if not alwaysFaceUp then
|
if not alwaysFaceUp then
|
||||||
if getObjectFromGUID(DATA_HELPER_GUID).call('checkHiddenCard', card.getName()) then
|
local metadata = JSON.decode(card.getGMNotes()) or {}
|
||||||
|
if metadata.hidden or getObjectFromGUID(DATA_HELPER_GUID).call('checkHiddenCard', card.getName()) then
|
||||||
faceUpRotation = 180
|
faceUpRotation = 180
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -856,17 +858,19 @@ function applyOptionPanelChange(id, state)
|
|||||||
|
|
||||||
-- option: Show hand helper for each player
|
-- option: Show hand helper for each player
|
||||||
elseif id == "showHandHelper" then
|
elseif id == "showHandHelper" then
|
||||||
optionPanel[id][1] = spawnOrRemoveHelper(state, "Hand Helper", {-50.85, 1.6, 7.32}, {0, 270, 0})
|
for i, color in ipairs(MAT_COLORS) do
|
||||||
optionPanel[id][2] = spawnOrRemoveHelper(state, "Hand Helper", {-50.85, 1.6, -24.88}, {0, 270, 0})
|
local pos = playmatApi.transformLocalPosition({0.05, 0, -1.182}, color)
|
||||||
optionPanel[id][3] = spawnOrRemoveHelper(state, "Hand Helper", {-39.13, 1.6, 22.45}, {0, 000, 0})
|
local rot = playmatApi.returnRotation(color)
|
||||||
optionPanel[id][4] = spawnOrRemoveHelper(state, "Hand Helper", {-21.57, 1.6, -22.45}, {0, 180, 0})
|
optionPanel[id][i] = spawnOrRemoveHelper(state, "Hand Helper", pos, rot)
|
||||||
|
end
|
||||||
|
|
||||||
-- option: Show search assistant for each player
|
-- option: Show search assistant for each player
|
||||||
elseif id == "showSearchAssistant" then
|
elseif id == "showSearchAssistant" then
|
||||||
optionPanel[id][1] = spawnOrRemoveHelper(state, "Search Assistant", {-50.85, 1.6, 10.25}, {0, 270, 0})
|
for i, color in ipairs(MAT_COLORS) do
|
||||||
optionPanel[id][2] = spawnOrRemoveHelper(state, "Search Assistant", {-50.85, 1.6, -21.95}, {0, 270, 0})
|
local pos = playmatApi.transformLocalPosition({-0.3, 0, -1.182}, color)
|
||||||
optionPanel[id][3] = spawnOrRemoveHelper(state, "Search Assistant", {-36.20, 1.6, 22.45}, {0, 000, 0})
|
local rot = playmatApi.returnRotation(color)
|
||||||
optionPanel[id][4] = spawnOrRemoveHelper(state, "Search Assistant", {-24.50, 1.6, -22.45}, {0, 180, 0})
|
optionPanel[id][i] = spawnOrRemoveHelper(state, "Search Assistant", pos, rot)
|
||||||
|
end
|
||||||
|
|
||||||
-- option: Show chaos bag manager
|
-- option: Show chaos bag manager
|
||||||
elseif id == "showChaosBagManager" then
|
elseif id == "showChaosBagManager" then
|
||||||
@ -913,7 +917,6 @@ end
|
|||||||
---@param name String Name of the object that should be copied
|
---@param name String Name of the object that should be copied
|
||||||
---@param position Table Desired position of the object
|
---@param position Table Desired position of the object
|
||||||
function spawnHelperObject(name, position, rotation)
|
function spawnHelperObject(name, position, rotation)
|
||||||
|
|
||||||
local sourceBag = getObjectFromGUID("830bd0")
|
local sourceBag = getObjectFromGUID("830bd0")
|
||||||
|
|
||||||
-- error handling for missing sourceBag
|
-- error handling for missing sourceBag
|
||||||
|
@ -309,7 +309,8 @@ function buildConnection(cardId, iconCardList, locData)
|
|||||||
for _, connectedGuid in ipairs(iconCardList[icon]) do
|
for _, connectedGuid in ipairs(iconCardList[icon]) do
|
||||||
-- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way
|
-- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way
|
||||||
if locationConnections[connectedGuid] ~= nil
|
if locationConnections[connectedGuid] ~= nil
|
||||||
and locationConnections[connectedGuid][cardId] == ONE_WAY then
|
and (locationConnections[connectedGuid][cardId] == ONE_WAY
|
||||||
|
or locationConnections[connectedGuid][cardId] == BIDIRECTIONAL) then
|
||||||
locationConnections[connectedGuid][cardId] = BIDIRECTIONAL
|
locationConnections[connectedGuid][cardId] = BIDIRECTIONAL
|
||||||
locationConnections[cardId][connectedGuid] = nil
|
locationConnections[cardId][connectedGuid] = nil
|
||||||
else
|
else
|
||||||
|
@ -197,7 +197,7 @@ function getCardVP(obj, notes)
|
|||||||
cardVP = tonumber(notes.locationBack.victory)
|
cardVP = tonumber(notes.locationBack.victory)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if cardVP > 0 then
|
if (cardVP or 0) > 0 then
|
||||||
table.insert(countedVP, obj)
|
table.insert(countedVP, obj)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -52,7 +52,6 @@ local THREAT_AREA = {
|
|||||||
|
|
||||||
local DRAW_DECK_POSITION = { x = -1.82, y = 1, z = 0 }
|
local DRAW_DECK_POSITION = { x = -1.82, y = 1, z = 0 }
|
||||||
local DISCARD_PILE_POSITION = { x = -1.82, y = 1.5, z = 0.61 }
|
local DISCARD_PILE_POSITION = { x = -1.82, y = 1.5, z = 0.61 }
|
||||||
local PLAY_ZONE_ROTATION = self.getRotation()
|
|
||||||
|
|
||||||
local TRASHCAN
|
local TRASHCAN
|
||||||
local STAT_TRACKER
|
local STAT_TRACKER
|
||||||
@ -151,7 +150,7 @@ function searchArea(origin, size)
|
|||||||
return Physics.cast({
|
return Physics.cast({
|
||||||
origin = origin,
|
origin = origin,
|
||||||
direction = {0, 1, 0},
|
direction = {0, 1, 0},
|
||||||
orientation = PLAY_ZONE_ROTATION,
|
orientation = self.getRotation(),
|
||||||
type = 3,
|
type = 3,
|
||||||
size = size,
|
size = size,
|
||||||
max_distance = 1,
|
max_distance = 1,
|
||||||
@ -176,7 +175,7 @@ function makeDiscardHandlerFor(searchPosition, discardPosition)
|
|||||||
if obj.tag == "Deck" or obj.tag == "Card" then
|
if obj.tag == "Deck" or obj.tag == "Card" then
|
||||||
if obj.hasTag("PlayerCard") then
|
if obj.hasTag("PlayerCard") then
|
||||||
obj.setPositionSmooth(self.positionToWorld(DISCARD_PILE_POSITION), false, true)
|
obj.setPositionSmooth(self.positionToWorld(DISCARD_PILE_POSITION), false, true)
|
||||||
obj.setRotation(PLAY_ZONE_ROTATION)
|
obj.setRotation(self.getRotation())
|
||||||
else
|
else
|
||||||
obj.setPositionSmooth(discardPosition, false, true)
|
obj.setPositionSmooth(discardPosition, false, true)
|
||||||
obj.setRotation({0, -90, 0})
|
obj.setRotation({0, -90, 0})
|
||||||
@ -215,7 +214,7 @@ function findObjectsAtPosition(localPos)
|
|||||||
return Physics.cast({
|
return Physics.cast({
|
||||||
origin = self.positionToWorld(localPos),
|
origin = self.positionToWorld(localPos),
|
||||||
direction = {0, 1, 0},
|
direction = {0, 1, 0},
|
||||||
orientation = {0, PLAY_ZONE_ROTATION.y + 90, 0},
|
orientation = {0, self.getRotation().y + 90, 0},
|
||||||
type = 3,
|
type = 3,
|
||||||
size = {3.2, 1, 2},
|
size = {3.2, 1, 2},
|
||||||
max_distance = 0,
|
max_distance = 0,
|
||||||
@ -246,7 +245,7 @@ function doUpkeep(_, clickedByColor, isRightClick)
|
|||||||
elseif obj.tag == "Card" and not obj.is_face_down and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then
|
elseif obj.tag == "Card" and not obj.is_face_down and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then
|
||||||
local cardMetadata = JSON.decode(obj.getGMNotes()) or {}
|
local cardMetadata = JSON.decode(obj.getGMNotes()) or {}
|
||||||
if not doNotReady(obj) then
|
if not doNotReady(obj) then
|
||||||
obj.setRotation(PLAY_ZONE_ROTATION)
|
obj.setRotation(self.getRotation())
|
||||||
end
|
end
|
||||||
if cardMetadata.id == "08031" then
|
if cardMetadata.id == "08031" then
|
||||||
forcedLearning = true
|
forcedLearning = true
|
||||||
@ -810,7 +809,7 @@ function clickableClues(showCounter)
|
|||||||
local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})
|
local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})
|
||||||
for i = 1, clueCount do
|
for i = 1, clueCount do
|
||||||
pos.y = pos.y + 0.045 * i
|
pos.y = pos.y + 0.045 * i
|
||||||
tokenManager.spawnToken(pos, "clue", PLAY_ZONE_ROTATION)
|
tokenManager.spawnToken(pos, "clue", self.getRotation())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -70,6 +70,21 @@ do
|
|||||||
return mat.call("returnGlobalDiscardPosition")
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playermat
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playermat
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
||||||
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
@ -30,7 +30,7 @@ do
|
|||||||
|
|
||||||
local commonZones = {}
|
local commonZones = {}
|
||||||
commonZones["Investigator"] = { -1.17702, 0, 0.00209 }
|
commonZones["Investigator"] = { -1.17702, 0, 0.00209 }
|
||||||
commonZones["Minicard"] = { -0.16, 0, -1.222326 }
|
commonZones["Minicard"] = { -1.17702, 0, -1.45 }
|
||||||
commonZones["Deck"] = { -1.822724, 0, -0.02940192 }
|
commonZones["Deck"] = { -1.822724, 0, -0.02940192 }
|
||||||
commonZones["Discard"] = { -1.822451, 0, 0.6092291 }
|
commonZones["Discard"] = { -1.822451, 0, 0.6092291 }
|
||||||
commonZones["Ally"] = { -0.6157398, 0, 0.02435675 }
|
commonZones["Ally"] = { -0.6157398, 0, 0.02435675 }
|
||||||
|
11
src/util/Trashcan.ttslua
Normal file
11
src/util/Trashcan.ttslua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
-- adds a context menu entry to trigger the emptying
|
||||||
|
function onLoad()
|
||||||
|
self.addContextMenuItem("Empty Trash", emptyTrash)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all objects by taking them out and then destructing them
|
||||||
|
function emptyTrash()
|
||||||
|
for _, trash in ipairs(self.getObjects()) do
|
||||||
|
self.takeObject().destruct()
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user