Merge pull request #670 from argonui/clean-up

Fixed action token handling for Clean Up Helper
This commit is contained in:
BootleggerFinn 2024-05-03 00:50:54 -05:00 committed by GitHub
commit 5687a00ba9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,14 +3,14 @@
-- puts everything on playmats and hands into respective trashcans
-- use the IGNORE_TAG to exclude objects from tidying (default: "CleanUpHelper_Ignore")
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
local chaosBagApi = require("chaosbag/ChaosBagApi")
local guidReferenceApi = require("core/GUIDReferenceApi")
local playAreaApi = require("core/PlayAreaApi")
local playmatApi = require("playermat/PlaymatApi")
local searchLib = require("util/SearchLib")
local soundCubeApi = require("core/SoundCubeApi")
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
local chaosBagApi = require("chaosbag/ChaosBagApi")
local guidReferenceApi = require("core/GUIDReferenceApi")
local playAreaApi = require("core/PlayAreaApi")
local playmatApi = require("playermat/PlaymatApi")
local searchLib = require("util/SearchLib")
local soundCubeApi = require("core/SoundCubeApi")
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
-- objects with this tag will be ignored
local IGNORE_TAG = "CleanUpHelper_ignore"
@ -133,8 +133,8 @@ end
---------------------------------------------------------
function updateCounters()
playmatApi.updateCounter("All", "ResourceCounter" , 5)
playmatApi.updateCounter("All", "ClickableClueCounter" , 0)
playmatApi.updateCounter("All", "ResourceCounter", 5)
playmatApi.updateCounter("All", "ClickableClueCounter", 0)
playmatApi.resetSkillTracker("All")
for i = 1, 4 do
@ -196,7 +196,7 @@ function loadTrauma()
if i < 5 then
RESET_VALUES.Damage[i] = trauma[i]
else
RESET_VALUES.Horror[i-4] = trauma[i]
RESET_VALUES.Horror[i - 4] = trauma[i]
end
end
loadingFailedBefore = false
@ -319,7 +319,6 @@ function tidyPlayerMatCoroutine()
and obj.hasTag("chaosBag") == false
and (obj.locked == false or obj.hasTag("Investigator"))
and obj.interactable == true then
coroutine.yield(0)
trash.putObject(obj)
-- action token handling
@ -328,18 +327,18 @@ function tidyPlayerMatCoroutine()
if obj.getScale().x < 0.4 then
local pos = playmatApi.transformLocalPosition(Vector(-0.865, 0.1, -0.28), COLORS[i])
obj.setPosition(pos)
coroutine.yield(0)
end
-- flip action tokens back to ready
if obj.is_face_down then
obj.flip()
coroutine.yield(0)
local rot = playmatApi.returnRotation(COLORS[i])
obj.setRotation(rot)
end
-- reset action token state
local stateId = obj.getStateId()
if stateId ~= -1 and stateId ~= 6 then
coroutine.yield(0)
obj.setState(6)
end
end