fix for "hidden" cards
This commit is contained in:
parent
e9dcfdb38d
commit
c701e2a472
@ -526,6 +526,11 @@ function setSpawnedPlayerCardGuid(params)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- deprecated, use metadata (GM Notes) instead (still used by custom data helpers)
|
||||||
|
-- Encounter Cards with "Hidden."
|
||||||
|
HIDDEN_CARD_DATA = {}
|
||||||
|
|
||||||
|
-- called by "Global" during encounter card drawing
|
||||||
function checkHiddenCard(name)
|
function checkHiddenCard(name)
|
||||||
for _, n in ipairs(HIDDEN_CARD_DATA) do
|
for _, n in ipairs(HIDDEN_CARD_DATA) do
|
||||||
if name == n then
|
if name == n then
|
||||||
@ -535,6 +540,7 @@ function checkHiddenCard(name)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- called by custom data helpers
|
||||||
function updateHiddenCards(args)
|
function updateHiddenCards(args)
|
||||||
local custom_data_helper = getObjectFromGUID(args[1])
|
local custom_data_helper = getObjectFromGUID(args[1])
|
||||||
local data_hiddenCards = custom_data_helper.getTable("HIDDEN_CARD_DATA")
|
local data_hiddenCards = custom_data_helper.getTable("HIDDEN_CARD_DATA")
|
||||||
@ -565,12 +571,6 @@ end
|
|||||||
-- }
|
-- }
|
||||||
-- }]])
|
-- }]])
|
||||||
|
|
||||||
-- deprecated, use metadata (GM Notes) instead
|
|
||||||
-- Encounter Cards with "Hidden."
|
|
||||||
-- HIDDEN_CARD_DATA = {
|
|
||||||
-- "Visions in Your Mind (Death)"
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- deprecated, included in TokenManager
|
-- deprecated, included in TokenManager
|
||||||
-- PLAYER_CARD_TOKEN_OFFSETS = {
|
-- PLAYER_CARD_TOKEN_OFFSETS = {
|
||||||
-- [1] = {{ 0, 3, -0.2 }}
|
-- [1] = {{ 0, 3, -0.2 }}
|
||||||
|
@ -217,7 +217,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
|
||||||
|
Loading…
Reference in New Issue
Block a user