Merge pull request #749 from argonui/mythos-area
Mythos Area token discarding fix
This commit is contained in:
commit
123f6b7e42
@ -8,12 +8,12 @@ local tokenChecker = require("core/token/TokenChecker")
|
|||||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||||
|
|
||||||
local ENCOUNTER_DECK_AREA = {
|
local ENCOUNTER_DECK_AREA = {
|
||||||
upperLeft = { x = 0.9, z = 0.42 },
|
upperLeft = { x = 1.05, z = 0.15 },
|
||||||
lowerRight = { x = 0.86, z = 0.38 }
|
lowerRight = { x = 0.70, z = 0.59 }
|
||||||
}
|
}
|
||||||
local ENCOUNTER_DISCARD_AREA = {
|
local ENCOUNTER_DISCARD_AREA = {
|
||||||
upperLeft = { x = 1.62, z = 0.42 },
|
upperLeft = { x = 1.77, z = 0.15 },
|
||||||
lowerRight = { x = 1.58, z = 0.38 }
|
lowerRight = { x = 1.42, z = 0.59 }
|
||||||
}
|
}
|
||||||
|
|
||||||
-- global position of encounter deck and discard pile
|
-- global position of encounter deck and discard pile
|
||||||
@ -240,18 +240,16 @@ end
|
|||||||
function inArea(point, bounds)
|
function inArea(point, bounds)
|
||||||
return (point.x < bounds.upperLeft.x
|
return (point.x < bounds.upperLeft.x
|
||||||
and point.x > bounds.lowerRight.x
|
and point.x > bounds.lowerRight.x
|
||||||
and point.z < bounds.upperLeft.z
|
and point.z > bounds.upperLeft.z
|
||||||
and point.z > bounds.lowerRight.z)
|
and point.z < bounds.lowerRight.z)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes tokens from the provided card/deck
|
-- removes tokens from the provided card/deck
|
||||||
function removeTokensFromObject(object)
|
function removeTokensFromObject(object)
|
||||||
local TRASH = guidReferenceApi.getObjectByOwnerAndType("Mythos", "Trash")
|
local TRASH = guidReferenceApi.getObjectByOwnerAndType("Mythos", "Trash")
|
||||||
for _, obj in ipairs(searchLib.onObject(object)) do
|
for _, obj in ipairs(searchLib.onObject(object, "isTileOrToken")) do
|
||||||
if obj.getGUID() ~= "4ee1f2" and -- table
|
if obj.getGUID() ~= "4ee1f2" and -- table
|
||||||
obj ~= self and
|
obj ~= self and
|
||||||
obj.type ~= "Deck" and
|
|
||||||
obj.type ~= "Card" and
|
|
||||||
obj.memo ~= nil and
|
obj.memo ~= nil and
|
||||||
obj.getLock() == false and
|
obj.getLock() == false and
|
||||||
not tokenChecker.isChaosToken(obj) then
|
not tokenChecker.isChaosToken(obj) then
|
||||||
|
Loading…
Reference in New Issue
Block a user