excluded threat area

This commit is contained in:
Chr1Z93 2024-02-17 01:31:08 +01:00
parent 2186d5f07e
commit 6a426ff492

View File

@ -5,6 +5,7 @@ local searchLib = require("util/SearchLib")
exposedValue = 0
local playmat
local searchParam = {}
function onLoad()
self.createButton({
@ -22,6 +23,13 @@ function onLoad()
local matColor = playmatApi.getMatColorByPosition(self.getPosition())
playmat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
-- get search parameters (threat area excluded)
local localPos = playmat.positionToLocal(playmat.getPosition())
searchParam.pos = playmat.positionToWorld(localPos + Vector(0, 0, 0.4))
searchParam.rot = playmat.getRotation() + Vector(0, 90, 0)
searchParam.size = Vector(8, 1, 27)
searchParam.filter = "isClue"
-- start loop
Wait.time(countItems, 1.5, -1)
end
@ -43,5 +51,5 @@ function removeAllClues(trash)
end
function getClues()
return searchLib.onObject(playmat, "isClue")
return searchLib.inArea(searchParam.pos, searchParam.rot, searchParam.size, searchParam.filter)
end