Files
wnsrc/lua/stormfox2/functions/sh_vfire.lua
lifestorm 94063e4369 Upload
2024-08-04 22:55:00 +03:00

40 lines
1.2 KiB
Lua

--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
--[[-------------------------------------------------------------------------
vFire support :D
---------------------------------------------------------------------------]]
local vFireList = {}
hook.Add("vFireOnCalculateWind","vFire - StormFox Handshake",function(vFireEnt)
local outside = StormFox2.Wind.IsEntityInWind(vFireEnt)
if outside then
vFireList[vFireEnt] = true
return StormFox2.Wind.GetVector() / 20
end
end)
if CLIENT then return end
local ran = math.random
timer.Create("vFire - StormFox Rain",2,0,function()
local r = StormFox2.Weather.GetRainAmount()
if r <= 0 then table.Empty(vFireList) return end
for ent,_ in pairs(vFireList) do
if IsValid(ent) then
ent:SoftExtinguish(r * ran(130,160))
end
end
table.Empty(vFireList)
end)
timer.Simple(2,function()
if not vFireInstalled then return end
StormFox2.Msg("Gee, vFire, what do you want to do tonight?")
hook.Call("vFire - StormFox Handeshake")
end)