implement use of inArea

This commit is contained in:
Chr1Z93 2023-01-01 22:34:18 +01:00
parent b9a2339b80
commit 97914af1f7

View File

@ -237,7 +237,7 @@ function doUpkeep(_, color, alt_click)
local obj = v.hit_object
if obj.getDescription() == "Action Token" and obj.is_face_down then
obj.flip()
elseif obj.tag == "Card" and not obj.is_face_down and self.positionToLocal(obj.getPosition()).x > -0.75 then
elseif obj.tag == "Card" and not obj.is_face_down and not inArea(self.positionToLocal(obj.getPosition()), INVESTIGATOR_AREA) then
local cardMetadata = JSON.decode(obj.getGMNotes()) or {}
if not doNotReady(obj) then
obj.setRotation(PLAY_ZONE_ROTATION)
@ -536,7 +536,7 @@ end
function maybeUpdateActiveInvestigator(card)
local notes = JSON.decode(card.getGMNotes())
if notes ~= nil and notes.type == "Investigator" and notes.id ~= activeInvestigatorId then
if notes ~= nil and notes.type == "Investigator" and notes.id ~= nil and notes.id ~= activeInvestigatorId then
activeInvestigatorId = notes.id
STAT_TRACKER.call("updateStats", {notes.willpowerIcons, notes.intellectIcons, notes.combatIcons, notes.agilityIcons})