Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ CreateConVar("morbus_mission_time_min", "120", FCVAR_NOTIFY)
CreateConVar("morbus_mission_next_time_max", "80", FCVAR_NOTIFY)
CreateConVar("morbus_mission_next_time_min", "220", FCVAR_NOTIFY)


CreateConVar("morbus_rpnames_optional", "0", FCVAR_NOTIFY)

--This cvar sets the time swarms are spawn protected for after spawning
CreateConVar("morbus_swarm_protection_time", "3", FCVAR_NOTIFY)

-----------------------------------------------

util.AddNetworkString("RoundLog")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function GM:PlayerInitialSpawn(ply)
ply.DamageFactor = 1
ply:InitSanity()
ply:SetNWInt("Mute_Status",0)


ply:SpawnProtected = false

--ply:SetForceRPName( 0 ) -- 0 = no, 1 = yes
--ply:SetForceGender( 0 ) -- 0 = don't force, 1 = male, 2 = female
Expand Down Expand Up @@ -215,6 +215,23 @@ function GM:PlayerSpawn(ply)

end

--Enable spawn protection when a new swarn alien spawns
--Create a timer to disable it after the convar time
if ply:IsSwarm() then
--ply:PrintMessage(HUD_PRINTTALK, "Spawn protection activated!")

ply.SpawnProtected = true

local ProtectionTime = GetConVar("morbus_swarm_protection_time"):GetInt()
timer.Simple(ProtectionTime , function()
if IsValid(ply) && ply:IsGame() then
ply.SpawnProtected = false
end
end)
end



ply:ResetViewRoll()

ply:SetNWBool("alienform", false)
Expand Down Expand Up @@ -640,4 +657,4 @@ function WhoIsRemscar()
end
SendMsg("Remscar is not playing on this server")
end
concommand.Add("remscar",WhoIsRemscar)
concommand.Add("remscar",WhoIsRemscar)
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ function GM:PlayerTakeDamage(ent, infl, att, amount, dmginfo)
end
end

--if the entity taking damage is swarm & has spawn protection
if ent:IsSwarm() && ent.SpawnProtected == true then
--scale damage to almost nothing
dmginfo:ScaleDamage(0.01)
end
end

// Brood Alien damage reudction upgrades
Expand Down