mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
local charMeta = ix.meta.character
|
||||
|
||||
function charMeta:IsAffectedByFatigue()
|
||||
return PLUGIN.noFatigueFactions[self:GetFaction()] != true
|
||||
end
|
||||
|
||||
function charMeta:GetActionTimeInfluencedByEnergyLevel(time)
|
||||
if (!self:IsAffectedByFatigue()) then
|
||||
return time
|
||||
end
|
||||
|
||||
local charEnergy = self:GetEnergy()
|
||||
local energyLevelToApplyDebuffs = ix.config.Get("energyLevelToApplyDebuffs", 50)
|
||||
|
||||
if (charEnergy < energyLevelToApplyDebuffs) then
|
||||
local energyMaxActionSpeedDebuff = ix.config.Get("energyMaxActionSpeedDebuff", 50) / 100
|
||||
|
||||
return math.ceil(time + (energyMaxActionSpeedDebuff * (1 - charEnergy / energyLevelToApplyDebuffs)))
|
||||
elseif (charEnergy > 100) then
|
||||
local energyMaxActionSpeedBuff = ix.config.Get("energyMaxActionSpeedBuff", 50) / 100
|
||||
|
||||
return math.floor(time - (time * energyMaxActionSpeedBuff))
|
||||
end
|
||||
|
||||
return time
|
||||
end
|
||||
17
gamemodes/ixhl2rp/plugins/fatigue_system/meta/sh_player.lua
Normal file
17
gamemodes/ixhl2rp/plugins/fatigue_system/meta/sh_player.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
local playerMeta = FindMetaTable("Player")
|
||||
|
||||
function playerMeta:IsAffectedByFatigue()
|
||||
return PLUGIN.noFatigueFactions[self:Team()] != true
|
||||
end
|
||||
Reference in New Issue
Block a user