From 5c9dd3701a03e17f90840ccc2f742aeeeeb98c08 Mon Sep 17 00:00:00 2001 From: Orrin Sheppard Date: Sat, 10 Jun 2023 12:01:53 -0500 Subject: [PATCH 1/6] H6nik71T Glowstick cleanup --- .../entities/ent_bglowstick/shared.lua | 103 +++++++-------- .../entities/ent_bglowstick_fly/init.lua | 25 ++-- .../entities/ent_glowstick/shared.lua | 105 ++++++++-------- .../entities/ent_glowstick_fly/init.lua | 27 ++-- .../entities/ent_sglowstick/shared.lua | 119 +++++++++--------- .../entities/ent_sglowstick_fly/init.lua | 79 ++++++------ 6 files changed, 223 insertions(+), 235 deletions(-) diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick/shared.lua b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick/shared.lua index 148a091..c0992ef 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick/shared.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick/shared.lua @@ -5,66 +5,69 @@ ENT.Type = "anim" if SERVER then -AddCSLuaFile("shared.lua") - -function ENT:Initialize() - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_NONE ) - self:SetCollisionGroup( COLLISION_GROUP_NONE ) - self:DrawShadow(false) - self:SetModel("models/glowstick/stick_lblu.mdl") + AddCSLuaFile("shared.lua") -end - function ENT:Think() + function ENT:Initialize() + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_NONE ) + self:SetCollisionGroup( COLLISION_GROUP_NONE ) + self:DrawShadow(false) + self:SetModel("models/glowstick/stick_lblu.mdl") + local player = self:GetOwner() self:SetColor(player:GetColor()) self:SetMaterial(player:GetMaterial()) -end - + + end end if CLIENT then - function ENT:Draw() --- some lines of code were modified, cause i dont need all bones, only right hand. - local p = self:GetOwner():GetRagdollEntity() or self:GetOwner() - local hand = p:LookupBone("ValveBiped.Bip01_R_Hand") - if hand then - local position, angles = p:GetBonePosition(hand) - - local x = angles:Up() * (-0.00 ) - local y = angles:Right() * 2.50 - local z = angles:Forward() * 4.15 - - local pitch = 0.00 - local yaw = 0.00 - local roll = 0.00 - - angles:RotateAroundAxis(angles:Forward(), pitch) - angles:RotateAroundAxis(angles:Right(), yaw) - angles:RotateAroundAxis(angles:Up(), roll) - - self:SetPos(position + x + y + z) - self:SetAngles(angles) - end + function ENT:Draw() + -- some lines of code were modified, cause i dont need all bones, only right hand. + local p = self:GetOwner():GetRagdollEntity() or self:GetOwner() + local hand = p:LookupBone("ValveBiped.Bip01_R_Hand") + if hand then + local position, angles = p:GetBonePosition(hand) + local x = angles:Up() * (-0.00 ) + local y = angles:Right() * 2.50 + local z = angles:Forward() * 4.15 + + local pitch = 0.00 + local yaw = 0.00 + local roll = 0.00 + + angles:RotateAroundAxis(angles:Forward(), pitch) + angles:RotateAroundAxis(angles:Right(), yaw) + angles:RotateAroundAxis(angles:Up(), roll) + + self:SetPos(position + x + y + z) + self:SetAngles(angles) + end + local eyepos = EyePos() local eyepos2 = LocalPlayer():EyePos() if eyepos:Distance(eyepos2) > 5 or LocalPlayer() != self:GetOwner() then self:DrawModel() end - end - function ENT:Think() - if self:GetPos():Distance(LocalPlayer():GetPos()) > 5000 then return end - local dlight = DynamicLight( self:EntIndex() ) - if ( dlight ) then - local r, g, b, a = self:GetColor() - dlight.Pos = self:GetPos() - dlight.r = 12 - dlight.g = 240 - dlight.b = 250 - dlight.Brightness = 1 - dlight.Size = 750 - dlight.Decay = 750 - dlight.DieTime = CurTime() + 1 - end -end + end + + function ENT:Think() + if self:GetPos():Distance(LocalPlayer():GetPos()) > 5000 then + self:SetNextClientThink(CurTime() + 0.25) + return true + end + + local dlight = DynamicLight( self:EntIndex() ) + if ( dlight ) then + local r, g, b, a = self:GetColor() + dlight.Pos = self:GetPos() + dlight.r = 12 + dlight.g = 240 + dlight.b = 250 + dlight.Brightness = 1 + dlight.Size = 750 + dlight.Decay = 750 + dlight.DieTime = CurTime() + 1 + end + end end \ No newline at end of file diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick_fly/init.lua b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick_fly/init.lua index 3b77e18..1185229 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick_fly/init.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_bglowstick_fly/init.lua @@ -10,26 +10,19 @@ function ENT:Initialize() self:SetSolid(SOLID_VPHYSICS) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:Wake() end - self.Death = CurTime() + 90 + + timer.Simple(90, function() if self.Entity then self.Entity:Remove() end end) end function ENT:SpawnFunction( ply, tr ) - if ( !tr.Hit ) then return end - local ent = ents.Create("ent_glowstick_fly") - ent:SetPos( tr.HitPos + tr.HitNormal * 16 ) - ent:Spawn() - ent:Activate() + if ( !tr.Hit ) then return end + + local ent = ents.Create("ent_glowstick_fly") + ent:SetPos( tr.HitPos + tr.HitNormal * 16 ) + ent:Spawn() + ent:Activate() - return ent -end - -function ENT:OnRemove() -end - -function ENT:Think() - if self.Death && self.Death < CurTime() then - self:Remove() - end + return ent end function ENT:Use( activator, caller ) diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick/shared.lua b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick/shared.lua index 0e36f04..f17ebc8 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick/shared.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick/shared.lua @@ -5,66 +5,69 @@ ENT.Type = "anim" if SERVER then -AddCSLuaFile("shared.lua") - -function ENT:Initialize() - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_NONE ) - self:SetCollisionGroup( COLLISION_GROUP_NONE ) - self:DrawShadow(false) - self:SetModel("models/glowstick/stick.mdl") + AddCSLuaFile("shared.lua") -end - function ENT:Think() + function ENT:Initialize() + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_NONE ) + self:SetCollisionGroup( COLLISION_GROUP_NONE ) + self:DrawShadow(false) + self:SetModel("models/glowstick/stick.mdl") + local player = self:GetOwner() self:SetColor(player:GetColor()) self:SetMaterial(player:GetMaterial()) -end - -end + end +end if CLIENT then - function ENT:Draw() --- some lines of code were modified, cause i dont need all bones, only right hand. - local p = self:GetOwner():GetRagdollEntity() or self:GetOwner() - local hand = p:LookupBone("ValveBiped.Bip01_R_Hand") - if hand then - local position, angles = p:GetBonePosition(hand) - - local x = angles:Up() * (-0.00 ) - local y = angles:Right() * 2.50 - local z = angles:Forward() * 4.15 - - local pitch = 0.00 - local yaw = 0.00 - local roll = 0.00 - - angles:RotateAroundAxis(angles:Forward(), pitch) - angles:RotateAroundAxis(angles:Right(), yaw) - angles:RotateAroundAxis(angles:Up(), roll) - - self:SetPos(position + x + y + z) - self:SetAngles(angles) - end + function ENT:Draw() + -- some lines of code were modified, cause i dont need all bones, only right hand. + local p = self:GetOwner():GetRagdollEntity() or self:GetOwner() + local hand = p:LookupBone("ValveBiped.Bip01_R_Hand") + if hand then + local position, angles = p:GetBonePosition(hand) + + local x = angles:Up() * (-0.00 ) + local y = angles:Right() * 2.50 + local z = angles:Forward() * 4.15 + + local pitch = 0.00 + local yaw = 0.00 + local roll = 0.00 + + angles:RotateAroundAxis(angles:Forward(), pitch) + angles:RotateAroundAxis(angles:Right(), yaw) + angles:RotateAroundAxis(angles:Up(), roll) + + self:SetPos(position + x + y + z) + self:SetAngles(angles) + end + local eyepos = EyePos() local eyepos2 = LocalPlayer():EyePos() if eyepos:Distance(eyepos2) > 5 or LocalPlayer() != self:GetOwner() then self:DrawModel() end - end - function ENT:Think() - if self:GetPos():Distance(LocalPlayer():GetPos()) > 5000 then return end - local dlight = DynamicLight( self:EntIndex() ) - if ( dlight ) then - local r, g, b, a = self:GetColor() - dlight.Pos = self:GetPos() - dlight.r = 0 - dlight.g = 255 - dlight.b = 0 - dlight.Brightness = 1 - dlight.Size = 750 - dlight.Decay = 750 - dlight.DieTime = CurTime() + 1 - end -end + end + + function ENT:Think() + if self:GetPos():Distance(LocalPlayer():GetPos()) > 5000 then + self:SetNextClientThink(CurTime() + 0.25) + return true + end + + local dlight = DynamicLight( self:EntIndex() ) + if ( dlight ) then + local r, g, b, a = self:GetColor() + dlight.Pos = self:GetPos() + dlight.r = 0 + dlight.g = 255 + dlight.b = 0 + dlight.Brightness = 1 + dlight.Size = 750 + dlight.Decay = 750 + dlight.DieTime = CurTime() + 1 + end + end end \ No newline at end of file diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick_fly/init.lua b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick_fly/init.lua index 4ac98c9..5093c4c 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick_fly/init.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_glowstick_fly/init.lua @@ -10,26 +10,19 @@ function ENT:Initialize() self:SetSolid(SOLID_VPHYSICS) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:Wake() end - self.Death = CurTime() + 90 + + timer.Simple(90, function() if self.Entity then self.Entity:Remove() end end) end function ENT:SpawnFunction( ply, tr ) - if ( !tr.Hit ) then return end - local ent = ents.Create("ent_glowstick_fly") - ent:SetPos( tr.HitPos + tr.HitNormal * 16 ) - ent:Spawn() - ent:Activate() - - return ent -end - -function ENT:OnRemove() -end - -function ENT:Think() - if self.Death && self.Death < CurTime() then - self:Remove() - end + if ( !tr.Hit ) then return end + + local ent = ents.Create("ent_glowstick_fly") + ent:SetPos( tr.HitPos + tr.HitNormal * 16 ) + ent:Spawn() + ent:Activate() + + return ent end function ENT:Use( activator, caller ) diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick/shared.lua b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick/shared.lua index 8d7bc3f..980dfde 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick/shared.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick/shared.lua @@ -5,66 +5,69 @@ ENT.Type = "anim" if SERVER then -AddCSLuaFile("shared.lua") - -function ENT:Initialize() - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_NONE ) - self:SetCollisionGroup( COLLISION_GROUP_NONE ) - self:DrawShadow(false) - self:SetModel("models/glowstick/stick_rng.mdl") - -end - function ENT:Think() - local player = self:GetOwner() - self:SetColor(player:GetColor()) - self:SetMaterial(player:GetMaterial()) -end + AddCSLuaFile("shared.lua") + function ENT:Initialize() + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_NONE ) + self:SetCollisionGroup( COLLISION_GROUP_NONE ) + self:DrawShadow(false) + self:SetModel("models/glowstick/stick_rng.mdl") + + local player = self:GetOwner() + self:SetColor(player:GetColor()) + self:SetMaterial(player:GetMaterial()) + end end if CLIENT then - function ENT:Draw() --- some lines of code were modified, cause i dont need all bones, only right hand. - local p = self:GetOwner():GetRagdollEntity() or self:GetOwner() - local hand = p:LookupBone("ValveBiped.Bip01_R_Hand") - if hand then - local position, angles = p:GetBonePosition(hand) - - local x = angles:Up() * (-0.00 ) - local y = angles:Right() * 2.50 - local z = angles:Forward() * 4.15 - - local pitch = 0.00 - local yaw = 0.00 - local roll = 0.00 - - angles:RotateAroundAxis(angles:Forward(), pitch) - angles:RotateAroundAxis(angles:Right(), yaw) - angles:RotateAroundAxis(angles:Up(), roll) - - self:SetPos(position + x + y + z) - self:SetAngles(angles) - end - local eyepos = EyePos() - local eyepos2 = LocalPlayer():EyePos() - if eyepos:Distance(eyepos2) > 5 or LocalPlayer() != self:GetOwner() then - self:DrawModel() - end - end - function ENT:Think() - if self:GetPos():Distance(LocalPlayer():GetPos()) > 5000 then return end - local dlight = DynamicLight( self:EntIndex() ) - if ( dlight ) then - local r, g, b, a = self:GetColor() - dlight.Pos = self:GetPos() - dlight.r = 255 - dlight.g = 127 - dlight.b = 0 - dlight.Brightness = 1 - dlight.Size = 750 - dlight.Decay = 750 - dlight.DieTime = CurTime() + 1 - end -end + function ENT:Draw() + -- some lines of code were modified, cause i dont need all bones, only right hand. + local p = self:GetOwner():GetRagdollEntity() or self:GetOwner() + local hand = p:LookupBone("ValveBiped.Bip01_R_Hand") + if hand then + local position, angles = p:GetBonePosition(hand) + + local x = angles:Up() * (-0.00 ) + local y = angles:Right() * 2.50 + local z = angles:Forward() * 4.15 + + local pitch = 0.00 + local yaw = 0.00 + local roll = 0.00 + + angles:RotateAroundAxis(angles:Forward(), pitch) + angles:RotateAroundAxis(angles:Right(), yaw) + angles:RotateAroundAxis(angles:Up(), roll) + + self:SetPos(position + x + y + z) + self:SetAngles(angles) + end + + local eyepos = EyePos() + local eyepos2 = LocalPlayer():EyePos() + if eyepos:Distance(eyepos2) > 5 or LocalPlayer() != self:GetOwner() then + self:DrawModel() + end + end + + function ENT:Think() + if self:GetPos():Distance(LocalPlayer():GetPos()) > 5000 then + self:SetNextClientThink(CurTime() + 0.25) + return true + end + + local dlight = DynamicLight( self:EntIndex() ) + if ( dlight ) then + local r, g, b, a = self:GetColor() + dlight.Pos = self:GetPos() + dlight.r = 255 + dlight.g = 127 + dlight.b = 0 + dlight.Brightness = 1 + dlight.Size = 750 + dlight.Decay = 750 + dlight.DieTime = CurTime() + 1 + end + end end \ No newline at end of file diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick_fly/init.lua b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick_fly/init.lua index f25043a..6354fa2 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick_fly/init.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/entities/ent_sglowstick_fly/init.lua @@ -10,57 +10,50 @@ function ENT:Initialize() self:SetSolid(SOLID_VPHYSICS) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:Wake() end - self.Death = CurTime() + 90 + + timer.Simple(90, function() if self.Entity then self.Entity:Remove() end end) end function ENT:SpawnFunction( ply, tr ) - if ( !tr.Hit ) then return end - local ent = ents.Create("ent_sglowstick_fly") - ent:SetPos( tr.HitPos + tr.HitNormal * 16 ) - ent:Spawn() - ent:Activate() - - return ent + if ( !tr.Hit ) then return end + + local ent = ents.Create("ent_sglowstick_fly") + ent:SetPos( tr.HitPos + tr.HitNormal * 16 ) + ent:Spawn() + ent:Activate() + + return ent end -function testProp(ply) - ent = ents.Create("prop_physics") - ent:SetPos(ply:GetPos() + Vector(5,0,0)) - ent:SetModel("models/hunter/blocks/cube1x2x1.mdl") - ent:Spawn() +/*function testProp(ply) + ent = ents.Create("prop_physics") + ent:SetPos(ply:GetPos() + Vector(5,0,0)) + ent:SetModel("models/hunter/blocks/cube1x2x1.mdl") + ent:Spawn() end -concommand.Add("testprop",testProp) +concommand.Add("testprop",testProp)*/ function ENT:PhysicsCollide( data, physobj ) - if IsValid(self:GetParent()) then return end - if data.HitEntity then - ent = data.HitEntity - if ent:IsWorld() then - self:SetMoveType(MOVETYPE_NONE) - self:SetPos(data.HitPos - data.HitNormal * 1.2) - flip = 1 - if data.HitNormal.y > 0 then - flip = -1 - end - self:SetAngles(Angle(0,data.HitNormal.y + data.HitNormal.x,-data.HitNormal.z * flip) * 90) - elseif !ent:IsPlayer() and !ent:IsWeapon() then - self:SetPos(data.HitPos - data.HitNormal * 1.2) - flip = 1 - if data.HitNormal.y > 0 then - flip = -1 - end - self:SetAngles(Angle(0,data.HitNormal.y + data.HitNormal.x,-data.HitNormal.z * flip) * 90) - self:SetParent(ent) - end - end -end - -function ENT:OnRemove() -end - -function ENT:Think() - if self.Death && self.Death < CurTime() then - self:Remove() + if IsValid(self:GetParent()) then return end + if data.HitEntity then + ent = data.HitEntity + if ent:IsWorld() then + self:SetMoveType(MOVETYPE_NONE) + self:SetPos(data.HitPos - data.HitNormal * 1.2) + + flip = 1 + if data.HitNormal.y > 0 then flip = -1 end + + self:SetAngles(Angle(0,data.HitNormal.y + data.HitNormal.x,-data.HitNormal.z * flip) * 90) + elseif !ent:IsPlayer() and !ent:IsWeapon() then + self:SetPos(data.HitPos - data.HitNormal * 1.2) + + flip = 1 + if data.HitNormal.y > 0 then flip = -1 end + + self:SetAngles(Angle(0,data.HitNormal.y + data.HitNormal.x,-data.HitNormal.z * flip) * 90) + self:SetParent(ent) + end end end From 85a558551f76835ef10c402ed14a73e0e5649b5b Mon Sep 17 00:00:00 2001 From: Orrin Sheppard Date: Sat, 10 Jun 2023 12:09:18 -0500 Subject: [PATCH 2/6] Fixed gamemode info and added ULX muting/gagging --- .../gamemodes/morbusgame/gamemode/server/sv_chat.lua | 7 ++++++- MorbusGamemode/gamemodes/morbusgame/morbusgame.txt | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua index 0fd8ac7..f6a3743 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua @@ -67,6 +67,10 @@ end function GM:PlayerSay(ply, text, to_all) -- Shitty chat shit --ToDo: REDO THIS if not ValidEntity(ply) then return end + + --Checks ULX gag and blocks chatting if true + if ply:GetNWBool("ulx_gagged", false) then return "" end + if ply.Gagged then return "" end -- for later use to_all = !to_all @@ -213,7 +217,8 @@ end function GM:PlayerCanHearPlayersVoice(listener, speaker) - if mute_all then + --Checks ULX gag and blocks speaking if true + if (mute_all || speaker:GetNWBool("ulx_muted", false)) then return false,false end diff --git a/MorbusGamemode/gamemodes/morbusgame/morbusgame.txt b/MorbusGamemode/gamemodes/morbusgame/morbusgame.txt index 6e395c7..9bf90d4 100644 --- a/MorbusGamemode/gamemodes/morbusgame/morbusgame.txt +++ b/MorbusGamemode/gamemodes/morbusgame/morbusgame.txt @@ -1,10 +1,10 @@ "morbusgame" { "base" "base" - "title" "MORBUS" + "title" "MORBUS RENAISSANCE" "maps" "^mor_" + "category" "other" "menusystem" "1" - "workshopid" "139263490" "settings" { From 84b4a1cac085537ee6f20e1cfa76a865c8cf84f6 Mon Sep 17 00:00:00 2001 From: Orrin Sheppard Date: Sun, 11 Jun 2023 09:00:01 -0500 Subject: [PATCH 3/6] Spawn protection for swarm aliens, glow stick cleanup --- MorbusGamemode/addon.json | 11 --- .../gamemodes/morbusgame/gamemode/init.lua | 2 +- .../gamemode/server/player/sv_player.lua | 15 +++- .../server/player/sv_player_damage.lua | 4 ++ .../morbusgame/gamemode/server/sv_chat.lua | 8 +-- .../gamemodes/morbusgame/gamemode/shared.lua | 68 ++++++++++++------- 6 files changed, 66 insertions(+), 42 deletions(-) delete mode 100644 MorbusGamemode/addon.json diff --git a/MorbusGamemode/addon.json b/MorbusGamemode/addon.json deleted file mode 100644 index 869d052..0000000 --- a/MorbusGamemode/addon.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "default_changelog": "http://remscar.com/morbusgame", - "description": "Description", - "tags": [ - "roleplay", - "realism" - ], - "title": "Morbus Gamemode", - "type": "gamemode", - "workshopid": 139263490 -} \ No newline at end of file diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua index f8a1980..391bf06 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua @@ -67,7 +67,7 @@ CreateConVar("morbus_mission_time_max", "220", FCVAR_NOTIFY) 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_swarm_protection_time", "3", FCVAR_NOTIFY) CreateConVar("morbus_rpnames_optional", "0", FCVAR_NOTIFY) ----------------------------------------------- diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua index c976692..d5033ca 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua @@ -40,7 +40,7 @@ function GM:PlayerInitialSpawn(ply) 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 @@ -215,6 +215,19 @@ function GM:PlayerSpawn(ply) end + 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 + ply:PrintMessage(HUD_PRINTTALK, "Spawn protection de-activated!") + end) + end + ply:ResetViewRoll() ply:SetNWBool("alienform", false) diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player_damage.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player_damage.lua index 53597a4..1a09a0a 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player_damage.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player_damage.lua @@ -73,6 +73,10 @@ function GM:PlayerTakeDamage(ent, infl, att, amount, dmginfo) end end + if ent:IsSwarm() && ent.SpawnProtected == true then + dmginfo:ScaleDamage(0.01) + end + end // Brood Alien damage reudction upgrades diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua index f6a3743..e1fddca 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua @@ -68,10 +68,10 @@ function GM:PlayerSay(ply, text, to_all) -- Shitty chat shit --ToDo: REDO THIS if not ValidEntity(ply) then return end - --Checks ULX gag and blocks chatting if true - if ply:GetNWBool("ulx_gagged", false) then return "" end + --Checks ULX mute and blocks chatting if true + if ply:GetNWBool("ulx_muted", false) then return "" end - if ply.Gagged then return "" end -- for later use + --if ply.Gagged then return "" end -- for later use to_all = !to_all @@ -218,7 +218,7 @@ end function GM:PlayerCanHearPlayersVoice(listener, speaker) --Checks ULX gag and blocks speaking if true - if (mute_all || speaker:GetNWBool("ulx_muted", false)) then + if (mute_all || speaker:GetNWBool("ulx_gagged", false)) then return false,false end diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/shared.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/shared.lua index ecb6477..91bae46 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/shared.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/shared.lua @@ -118,40 +118,58 @@ aka humanss ---------------------------------------------------*/ Models = {} Models.Male = { -"models/player/group01/male_01.mdl", -"models/player/group01/male_02.mdl", -"models/player/group01/male_03.mdl", -"models/player/group01/male_04.mdl", -"models/player/group01/male_05.mdl", -"models/player/group01/male_06.mdl", -"models/player/group01/male_07.mdl", -"models/player/group01/male_08.mdl", -"models/player/group01/male_09.mdl", -"models/player/monk.mdl", -"models/player/odessa.mdl", -"models/player/Kleiner.mdl", -"models/player/breen.mdl", -"models/player/Barney.mdl", -"models/player/Hostage/hostage_01.mdl", -"models/player/Hostage/hostage_02.mdl", -"models/player/Hostage/hostage_03.mdl", -"models/player/Hostage/hostage_04.mdl", +-- "models/player/group01/male_01.mdl", +-- "models/player/group01/male_02.mdl", +-- "models/player/group01/male_03.mdl", +-- "models/player/group01/male_04.mdl", +-- "models/player/group01/male_05.mdl", +-- "models/player/group01/male_06.mdl", +-- "models/player/group01/male_07.mdl", +-- "models/player/group01/male_08.mdl", +-- "models/player/group01/male_09.mdl", +-- "models/player/monk.mdl", +-- "models/player/odessa.mdl", +-- "models/player/Kleiner.mdl", +-- "models/player/breen.mdl", +-- "models/player/Barney.mdl", +-- "models/player/Hostage/hostage_01.mdl", +-- "models/player/Hostage/hostage_02.mdl", +-- "models/player/Hostage/hostage_03.mdl", +-- "models/player/Hostage/hostage_04.mdl", +"models/player/combine_soldier_prisonguard.mdl", +"models/player/combine_soldier.mdl", +"models/player/police.mdl", +"models/player/marine/marine.mdl", +"models/ez2models/combine_soldier_bloody.mdl", +"models/ez2models/humans/group05b/male_01.mdl", +"models/ez2models/humans/group05b/male_02.mdl", +"models/ez2models/humans/group05b/male_03.mdl", +"models/ez2models/humans/group05b/male_05.mdl", +"models/ez2models/humans/group05b/male_06.mdl", +"models/ez2models/humans/group05b/male_08.mdl", +"models/ez2models/humans/group05b/male_09.mdl", +"models/player/marine/marine.mdl", +"models/bloo_ltcom/citizens/male_09.mdl", +"models/player/deadspace2023/dsrisaaclv3.mdl", +"models/ez2models/radioguy.mdl", } Models.Female = { -"models/player/group01/female_01.mdl", -"models/player/group01/female_02.mdl", -"models/player/group01/female_03.mdl", -"models/player/group01/female_04.mdl", -"models/player/group01/female_06.mdl", +-- "models/player/group01/female_01.mdl", +-- "models/player/group01/female_02.mdl", +-- "models/player/group01/female_03.mdl", +-- "models/player/group01/female_04.mdl", +-- "models/player/group01/female_06.mdl", "models/player/alyx.mdl", "models/player/mossman.mdl", +"models/player/police_fem.mdl", +"models/ez2models/mossman_young.mdl", } -Models.Brood = "models/player/verdugo/verdugo.mdl" -Models.Swarm = "models/morbus/swarm/enhancedslasher.mdl" +Models.Brood = "models/player/stalker/packboy.mdl" +Models.Swarm = "models/player/avp2/predalien.mdl" util.PrecacheModel(Models.Brood) util.PrecacheModel(Models.Swarm) From cd8218da4be92152cfcba93f1d46d0e4e4b419cf Mon Sep 17 00:00:00 2001 From: Orrin Sheppard Date: Sun, 11 Jun 2023 09:15:17 -0500 Subject: [PATCH 4/6] Weapon logic cleanup --- .../morbusgame/entities/weapons/weapon_mor_base/shared.lua | 6 +----- .../gamemodes/morbusgame/gamemode/client/vgui/cl_help.lua | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua b/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua index 7cecee0..06a85bb 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua @@ -183,11 +183,7 @@ end Think ---------------------------------------------------------*/ function SWEP:Think() - if (self.Weapon:GetNetworkedBool("Reloading")) then - self.Weapon:SetNWBool( "IsLaserOn", false ) - else - self.Weapon:SetNWBool( "IsLaserOn", true ) - end + self.Weapon:SetNWBool("IsLaserOn", !self.Weapon:GetNetworkedBool("Reloading")) self:IronSight() diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/client/vgui/cl_help.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/client/vgui/cl_help.lua index 6a701a5..023629c 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/client/vgui/cl_help.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/client/vgui/cl_help.lua @@ -69,19 +69,19 @@ function PANEL:Init() self.CurrentTab = 1 self.Tab[2]:SetVisible(false) self.Tab[1]:SetVisible(true) - self.Tab[1]:OpenURL("http://remscar.com/morbus/ingame/guide.html") + self.Tab[1]:OpenURL("https://www.google.com") end self.Tab[1] = vgui.Create("HTML",self) self.Tab[1]:SetPos(4,34) self.Tab[1]:SetSize(850-6,750-38) - self.Tab[1]:OpenURL("http://remscar.com/morbus/ingame/guide.html") + self.Tab[1]:OpenURL("https://afterhoursgaming.gg") self.Tab[1]:SetVisible(false) self.Tab[2] = vgui.Create("HTML",self) self.Tab[2].Slide = 1 - self.Tab[2]:OpenURL("http://remscar.com/morbus/ingame/guide_mini.html") + self.Tab[2]:OpenURL("https://www.amazon.com") self.Tab[2]:SetPos(4,34) self.Tab[2]:SetSize(850-6,500-38) From c76ee2f9a8cf16acef9f6b9749eb1c4d49d863af Mon Sep 17 00:00:00 2001 From: Orrin Sheppard Date: Sun, 11 Jun 2023 09:41:03 -0500 Subject: [PATCH 5/6] Spawn protection fixes, upped time to 12 seconds --- .../gamemodes/morbusgame/gamemode/init.lua | 2 +- .../gamemode/server/player/sv_player.lua | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua index 391bf06..35a7dad 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/init.lua @@ -67,7 +67,7 @@ CreateConVar("morbus_mission_time_max", "220", FCVAR_NOTIFY) 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_swarm_protection_time", "3", FCVAR_NOTIFY) +CreateConVar("morbus_swarm_protection_time", "12", FCVAR_NOTIFY) CreateConVar("morbus_rpnames_optional", "0", FCVAR_NOTIFY) ----------------------------------------------- diff --git a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua index d5033ca..86f8788 100644 --- a/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua +++ b/MorbusGamemode/gamemodes/morbusgame/gamemode/server/player/sv_player.lua @@ -40,7 +40,7 @@ function GM:PlayerInitialSpawn(ply) ply:InitSanity() ply:SetNWInt("Mute_Status",0) - ply:SpawnProtected = false + ply.SpawnProtected = false --ply:SetForceRPName( 0 ) -- 0 = no, 1 = yes --ply:SetForceGender( 0 ) -- 0 = don't force, 1 = male, 2 = female @@ -215,18 +215,21 @@ function GM:PlayerSpawn(ply) end - if ply:IsSwarm() then - ply:PrintMessage(HUD_PRINTTALK, "Spawn protection activated!") + --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 + ply.SpawnProtected = true - local ProtectionTime = GetConVar("morbus_swarm_protection_time"):GetInt() - timer.Simple(ProtectionTime, function() - if IsValid(ply) && ply:IsGame() then - ply.SpawnProtected = false + local ProtectionTime = GetConVar("morbus_swarm_protection_time"):GetInt() + timer.Simple(ProtectionTime , function() + if IsValid(ply) && ply:IsGame() then + ply.SpawnProtected = false ply:PrintMessage(HUD_PRINTTALK, "Spawn protection de-activated!") - end) - end + end + end) + end ply:ResetViewRoll() From d103b5a811f9409077094677071d58fc21d8e4d0 Mon Sep 17 00:00:00 2001 From: Orrin Sheppard Date: Sun, 11 Jun 2023 10:50:01 -0500 Subject: [PATCH 6/6] optimizations --- .../morbusgame/entities/weapons/weapon_mor_base/shared.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua b/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua index 06a85bb..79e5e1f 100644 --- a/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua +++ b/MorbusGamemode/gamemodes/morbusgame/entities/weapons/weapon_mor_base/shared.lua @@ -186,7 +186,6 @@ function SWEP:Think() self.Weapon:SetNWBool("IsLaserOn", !self.Weapon:GetNetworkedBool("Reloading")) self:IronSight() - end @@ -257,7 +256,7 @@ function SWEP:Reload() -- Zoom = 0 self:SetIronsights(false) -- Set the ironsight to false - self.Weapon:SetNetworkedBool("Reloading", true) + self.Weapon:SetNWBool("Reloading", true) end local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) timer.Simple(waitdammit + .1,