implemented token removal below hand zone

This commit is contained in:
Chr1Z93 2023-10-22 10:24:54 +02:00
parent bb1a4edd7c
commit 85f449ce4b
6 changed files with 36 additions and 14 deletions

View File

@ -32,13 +32,13 @@
"Sticky": true, "Sticky": true,
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
"posX": -30.5, "posX": -30.35,
"posY": 6, "posY": 6,
"posZ": 36.053, "posZ": 36.6,
"rotX": 0, "rotX": 0,
"rotY": 180, "rotY": 180,
"rotZ": 0, "rotZ": 0,
"scaleX": 21.96, "scaleX": 22,
"scaleY": 7, "scaleY": 7,
"scaleZ": 5 "scaleZ": 5
}, },

View File

@ -32,13 +32,13 @@
"Sticky": true, "Sticky": true,
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
"posX": -65.7, "posX": -65,
"posY": 6, "posY": 6,
"posZ": -15.5, "posZ": -16.1,
"rotX": 0, "rotX": 0,
"rotY": 90, "rotY": 90,
"rotZ": 0, "rotZ": 0,
"scaleX": 22.96, "scaleX": 22,
"scaleY": 7, "scaleY": 7,
"scaleZ": 5 "scaleZ": 5
}, },

View File

@ -32,13 +32,13 @@
"Sticky": true, "Sticky": true,
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
"posX": -65.7, "posX": -65,
"posY": 6, "posY": 6,
"posZ": 15.5, "posZ": 16.1,
"rotX": 0, "rotX": 0,
"rotY": 90, "rotY": 90,
"rotZ": 0, "rotZ": 0,
"scaleX": 22.96, "scaleX": 22,
"scaleY": 7, "scaleY": 7,
"scaleZ": 5 "scaleZ": 5
}, },

View File

@ -32,13 +32,13 @@
"Sticky": true, "Sticky": true,
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
"posX": -30.5, "posX": -30.35,
"posY": 6, "posY": 6,
"posZ": -36.364, "posZ": -36.6,
"rotX": 0, "rotX": 0,
"rotY": 0, "rotY": 0,
"rotZ": 0, "rotZ": 0,
"scaleX": 21.96, "scaleX": 22,
"scaleY": 7, "scaleY": 7,
"scaleZ": 5 "scaleZ": 5
}, },

View File

@ -353,9 +353,9 @@
"Sticky": true, "Sticky": true,
"Tooltip": false, "Tooltip": false,
"Transform": { "Transform": {
"posX": -54.999, "posX": -55,
"posY": 1.45, "posY": 1.45,
"posZ": -16.098, "posZ": -16.1,
"rotX": 0, "rotX": 0,
"rotY": 270, "rotY": 270,
"rotZ": 0, "rotZ": 0,

View File

@ -89,6 +89,9 @@ local matColor = self.getMemo()
-- variable to track the status of the "Show Draw Button" option -- variable to track the status of the "Show Draw Button" option
local isDrawButtonVisible = false local isDrawButtonVisible = false
-- limit search calls if multiple cards enter the hand
local pendingHandSearch = false
-- global variable to report "Dream-Enhancing Serum" status -- global variable to report "Dream-Enhancing Serum" status
isDES = false isDES = false
@ -182,6 +185,10 @@ function isCard(x) return x.type == 'Card' end
function isDeck(x) return x.type == 'Deck' end function isDeck(x) return x.type == 'Deck' end
function isCardOrDeck(x) return x.type == 'Card' or 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. -- finds all objects on the playmat and associated set aside zone.
function searchAroundSelf(filter) function searchAroundSelf(filter)
local bounds = self.getBoundsNormalized() local bounds = self.getBoundsNormalized()
@ -811,6 +818,21 @@ function resetSkillTracker()
end end
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 -- calls to 'Global' / functions for calls from outside
--------------------------------------------------------- ---------------------------------------------------------