Additional functionality for fans to disperse clouds.
Quotelocal function DisperseCloud(inst)
if inst.components.timer ~= nil and inst.components.timer:TimerExists("disperse") then
inst.components.timer:SetTimeLeft("disperse", 0)
end
endlocal FANTARGET_CANT_TAGS = { "FX", "NOCLICK", "DECOR", "INLIMBO", "playerghost" }
local FANTARGET_ONEOF_TAGS = { "smolder", "fire", "player" }
local function OnUse(inst, target)
local x, y, z = target.Transform:GetWorldPosition()
local ents = TheSim:FindEntities(x, y, z, TUNING.FEATHERFAN_RADIUS, nil, FANTARGET_CANT_TAGS, FANTARGET_ONEOF_TAGS)
for i, v in pairs(ents) do
if v.components.burnable ~= nil then
-- Extinguish smoldering/fire and reset the propagator to a heat of .2
v.components.burnable:Extinguish(true, 0)
end
if v.components.temperature ~= nil then
-- cool off yourself and any other nearby players
v.components.temperature:DoDelta(math.clamp(TUNING.FEATHERFAN_MINIMUM_TEMP - v.components.temperature:GetCurrent(), TUNING.FEATHERFAN_COOLING, 0))
end
end
--todo: add a special tag to distinguish clouds
FindEntity(target, TUNING.FEATHERFAN_RADIUS, DisperseCloud)
end