implemented token removal below hand zone
This commit is contained in:
parent
bb1a4edd7c
commit
85f449ce4b
@ -32,13 +32,13 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -30.5,
|
||||
"posX": -30.35,
|
||||
"posY": 6,
|
||||
"posZ": 36.053,
|
||||
"posZ": 36.6,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
"scaleX": 21.96,
|
||||
"scaleX": 22,
|
||||
"scaleY": 7,
|
||||
"scaleZ": 5
|
||||
},
|
||||
|
@ -32,13 +32,13 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -65.7,
|
||||
"posX": -65,
|
||||
"posY": 6,
|
||||
"posZ": -15.5,
|
||||
"posZ": -16.1,
|
||||
"rotX": 0,
|
||||
"rotY": 90,
|
||||
"rotZ": 0,
|
||||
"scaleX": 22.96,
|
||||
"scaleX": 22,
|
||||
"scaleY": 7,
|
||||
"scaleZ": 5
|
||||
},
|
||||
|
@ -32,13 +32,13 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -65.7,
|
||||
"posX": -65,
|
||||
"posY": 6,
|
||||
"posZ": 15.5,
|
||||
"posZ": 16.1,
|
||||
"rotX": 0,
|
||||
"rotY": 90,
|
||||
"rotZ": 0,
|
||||
"scaleX": 22.96,
|
||||
"scaleX": 22,
|
||||
"scaleY": 7,
|
||||
"scaleZ": 5
|
||||
},
|
||||
|
@ -32,13 +32,13 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -30.5,
|
||||
"posX": -30.35,
|
||||
"posY": 6,
|
||||
"posZ": -36.364,
|
||||
"posZ": -36.6,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"scaleX": 21.96,
|
||||
"scaleX": 22,
|
||||
"scaleY": 7,
|
||||
"scaleZ": 5
|
||||
},
|
||||
|
@ -353,9 +353,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -54.999,
|
||||
"posX": -55,
|
||||
"posY": 1.45,
|
||||
"posZ": -16.098,
|
||||
"posZ": -16.1,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -89,6 +89,9 @@ local matColor = self.getMemo()
|
||||
-- variable to track the status of the "Show Draw Button" option
|
||||
local isDrawButtonVisible = false
|
||||
|
||||
-- limit search calls if multiple cards enter the hand
|
||||
local pendingHandSearch = false
|
||||
|
||||
-- global variable to report "Dream-Enhancing Serum" status
|
||||
isDES = false
|
||||
|
||||
@ -182,6 +185,10 @@ function isCard(x) return x.type == 'Card' end
|
||||
function isDeck(x) return x.type == 'Deck' end
|
||||
function isCardOrDeck(x) return x.type == 'Card' or x.type == 'Deck' end
|
||||
|
||||
function isUnlockedTokenOrTileWithMemo(x)
|
||||
return (x.type == "Token" or x.type == "Tile") and x.getMemo() and x.getLock() == false
|
||||
end
|
||||
|
||||
-- finds all objects on the playmat and associated set aside zone.
|
||||
function searchAroundSelf(filter)
|
||||
local bounds = self.getBoundsNormalized()
|
||||
@ -811,6 +818,21 @@ function resetSkillTracker()
|
||||
end
|
||||
end
|
||||
|
||||
-- removal of tokens when a card enters the hand by searching the area below the handzone for tokens/tiles
|
||||
function onObjectEnterZone(zone)
|
||||
if pendingHandSearch == false and zone == ownedObjects.HandZone then
|
||||
pendingHandSearch = true
|
||||
Wait.time(function()
|
||||
local searchPos = zone.getPosition():setAt("y", 1.5)
|
||||
local searchSize = zone.getScale():setAt("y", 1)
|
||||
for _, obj in ipairs(searchArea(searchPos, searchSize, isUnlockedTokenOrTileWithMemo)) do
|
||||
ownedObjects.Trash.putObject(obj)
|
||||
end
|
||||
pendingHandSearch = false
|
||||
end, 1)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------
|
||||
-- calls to 'Global' / functions for calls from outside
|
||||
---------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user