From 27658524e8cc97f5a31ee67046553ed5483b3876 Mon Sep 17 00:00:00 2001 From: Guilhem PECH Date: Mon, 6 Aug 2018 16:26:04 +0200 Subject: [PATCH] Maj Bates --- entities/entities/batesmum/cl_init.lua | 12 + entities/entities/batesmum/init.lua | 93 ++++++++ entities/entities/batesmum/shared.lua | 15 ++ entities/entities/sls_motherbates/cl_init.lua | 66 ++++++ entities/entities/sls_motherbates/init.lua | 151 ++++++++++++ entities/entities/sls_motherbates/shared.lua | 17 ++ .../weapons/weapon_batesmother/cl_init.lua | 69 ++++++ entities/weapons/weapon_batesmother/init.lua | 59 +++++ .../weapons/weapon_batesmother/shared.lua | 75 ++++++ gamemode/languages/de.lua | 1 + gamemode/languages/en.lua | 2 +- gamemode/languages/fr.lua | 2 +- gamemode/languages/pl.lua | 1 + gamemode/languages/ru.lua | 1 + gamemode/maps/slash_motel.lua | 224 ++++++++++++++---- 15 files changed, 738 insertions(+), 50 deletions(-) create mode 100644 entities/entities/batesmum/cl_init.lua create mode 100644 entities/entities/batesmum/init.lua create mode 100644 entities/entities/batesmum/shared.lua create mode 100644 entities/entities/sls_motherbates/cl_init.lua create mode 100644 entities/entities/sls_motherbates/init.lua create mode 100644 entities/entities/sls_motherbates/shared.lua create mode 100644 entities/weapons/weapon_batesmother/cl_init.lua create mode 100644 entities/weapons/weapon_batesmother/init.lua create mode 100644 entities/weapons/weapon_batesmother/shared.lua diff --git a/entities/entities/batesmum/cl_init.lua b/entities/entities/batesmum/cl_init.lua new file mode 100644 index 0000000..6446dc8 --- /dev/null +++ b/entities/entities/batesmum/cl_init.lua @@ -0,0 +1,12 @@ +-- Utopia Games - Slashers +-- +-- @Author: Vyn +-- @Date: 2017-07-26 00:53:59 +-- @Last modified by: Guilhem PECH +-- @Last modified time: 2018-01-09 17:05:52 + +include('shared.lua') + +function ENT:Draw() + self:DrawModel() +end diff --git a/entities/entities/batesmum/init.lua b/entities/entities/batesmum/init.lua new file mode 100644 index 0000000..8fa98e7 --- /dev/null +++ b/entities/entities/batesmum/init.lua @@ -0,0 +1,93 @@ +-- @Author: Guilhem PECH +-- @Date: 2018-01-09 11:09:22 +-- @Email: guilhempech@gmail.com +-- @Project: Slashers +-- @Last modified by: Guilhem PECH +-- @Last modified time: 2018-01-11 16:59:23 +local GM = GM or GAMEMODE +AddCSLuaFile("cl_init.lua") -- Make sure clientside +AddCSLuaFile("shared.lua") -- and shared scripts are sent. +include("shared.lua") +util.AddNetworkString("slash_mother_bates") +local timer = 0 + +local radiusFar = 500 +local radiusMedium = 400 +local radiusClose = 200 + +local function getDistanceNearestPlayer(table, origin) + local result = false + + for k, v in ipairs(table) do + if v:IsValid() and v:IsPlayer() and v:Team() ~= TEAM_KILLER and (not result or v:GetPos():Distance(origin) < result) then + result = v:GetPos():Distance(origin) + end + end + + return result +end + +function ENT:Think() + local status = 0 + if not GM.ROUND.Active then return end + if (timer + 0.5) < CurTime() then + timer = CurTime() + + proximityPlayers = getDistanceNearestPlayer(ents.FindInSphere(self:GetPos(), radiusFar or 500), self:GetPos()) + + if not proximityPlayers then + print("Not") + GM.ROUND.Killer:SetWalkSpeed( GM.MAP.Killer.WalkSpeed ) + GM.ROUND.Killer:SetRunSpeed(GM.MAP.Killer.RunSpeed ) + status = 0 + elseif proximityPlayers <= radiusClose then + print("Supplosed =", GM.MAP.Killer.WalkSpeed * 1.8) + GM.ROUND.Killer:SetWalkSpeed( GM.MAP.Killer.WalkSpeed * 1.8 ) + GM.ROUND.Killer:SetRunSpeed(GM.MAP.Killer.RunSpeed * 1.8) + status = 3 + elseif proximityPlayers <= radiusMedium then + print("Supplosed =", GM.MAP.Killer.WalkSpeed * 1.3) + GM.ROUND.Killer:SetWalkSpeed( GM.MAP.Killer.WalkSpeed * 1.3 ) + GM.ROUND.Killer:SetRunSpeed(GM.MAP.Killer.RunSpeed * 1.3) + status = 2 + else + print("Supplosed =", GM.MAP.Killer.WalkSpeed * 1.1) + GM.ROUND.Killer:SetWalkSpeed( GM.MAP.Killer.WalkSpeed * 1.1 ) + GM.ROUND.Killer:SetRunSpeed(GM.MAP.Killer.RunSpeed * 1.1) + status = 1 + end + + net.Start("slash_mother_bates") + net.WriteUInt(status, 3) + net.Broadcast() + end +end + +local ragdoll = ents.Create("prop_ragdoll") + +function ENT:Initialize() + if ConVarExists("slashers_bates_far_radius") and ConVarExists("slashers_bates_medium_radius") and ConVarExists("slashers_bates_close_radius") then + radiusFar = GetConVar("slashers_bates_far_radius"):GetInt() + radiusMedium = GetConVar("slashers_bates_medium_radius"):GetInt() + radiusClose = GetConVar("slashers_bates_close_radius"):GetInt() + end + for k,v in pairs(ents.GetAll()) do + if v:GetName() == "slash_bates_points" then + v:Remove() + end + end + if (not IsValid(ragdoll)) then + ragdoll = ents.Create("prop_ragdoll") + end + ragdoll:SetModel("models/skeleton/skeleton_whole_noskins.mdl") + ragdoll:PhysicsInit(SOLID_VPHYSICS) + ragdoll:GetPhysicsObject():EnableDrag(true) + ragdoll:SetPos(self:GetPos()) + self:SetParent(ragdoll) + ragdoll:Spawn() + ragdoll:SetName("slash_bates_mother") + self:SetName("slash_bates_points") +end + +function ENT:Touch(ent) +end diff --git a/entities/entities/batesmum/shared.lua b/entities/entities/batesmum/shared.lua new file mode 100644 index 0000000..3a5459a --- /dev/null +++ b/entities/entities/batesmum/shared.lua @@ -0,0 +1,15 @@ +-- @Author: Guilhem PECH +-- @Date: 2018-01-09 11:09:22 +-- @Email: guilhempech@gmail.com +-- @Project: Slashers +-- @Last modified by: Guilhem PECH +-- @Last modified time: 2018-01-09 17:05:43 + + +ENT.Type = "point" +ENT.Author = "Daryl Winters" +ENT.PrintName = "Bates Mother" +ENT.Spawnable = true +--ENT.AutomaticFrameAdvance = true + +slashers_batesmum_maxtap = 1 diff --git a/entities/entities/sls_motherbates/cl_init.lua b/entities/entities/sls_motherbates/cl_init.lua new file mode 100644 index 0000000..fc5d316 --- /dev/null +++ b/entities/entities/sls_motherbates/cl_init.lua @@ -0,0 +1,66 @@ +-- Utopia Games - Slashers +-- +-- @Author: Guilhem PECH +-- @Date: 2017-07-26T13:54:42+02:00 +-- @Last modified by: Guilhem PECH +-- @Last modified time: 15-Apr-2018 + +include("shared.lua") + + +local GM = GM or GAMEMODE + + +GM.oldLevel = null +GM.SoundPlayed = null + +ENT.RenderGroup = RENDERGROUP_BOTH + +GM.MommyEntity = nil + +function ENT:Initialize() + GM.MommyEntity = self +end + +function ENT:Draw() + self.Entity:DrawModel() +end + +local function HUDPaintBackground() + if LocalPlayer():Team() != TEAM_KILLER || !GM.ROUND.Active || !IsValid(GM.MommyEntity) then return end + + local pos = GM.MommyEntity:GetPos():ToScreen() + local color = Color(255,255,255) + if GM.oldLevel == 3 then + color = Color(255,0,0) + elseif GM.oldLevel == 1 then + color = Color(0,255,0) + elseif GM.oldLevel == 2 then + color = Color(255, 239, 0) + else + color = Color(255, 255, 255) + end + + surface.SetDrawColor(color) + surface.SetMaterial(Material("icons/icon_mother.png")) + surface.DrawTexturedRect(pos.x - 50, pos.y -100, 64, 64) +end +hook.Add("HUDPaintBackground", "sls_kability_HUDPaintBackground", HUDPaintBackground) + +function ENT:DrawTranslucent() + if LocalPlayer():IsLineOfSightClear( self.Entity ) and self.Entity:GetPos():Distance( LocalPlayer():GetPos()) < 150 and LocalPlayer():Team() != TEAM_KILLER then + DrawIndicator(self.Entity) + end +end + +function ENT:Think() + +end + +function ENT:OnRemove() + if IsValid(GM.SoundPlayed) then + GM.SoundPlayed:Stop() + end + GM.oldLevel = null + GM.MommyEntity = null +end \ No newline at end of file diff --git a/entities/entities/sls_motherbates/init.lua b/entities/entities/sls_motherbates/init.lua new file mode 100644 index 0000000..482d101 --- /dev/null +++ b/entities/entities/sls_motherbates/init.lua @@ -0,0 +1,151 @@ +-- Utopia Games - Slashers +-- +-- @Author: Guilhem PECH +-- @Date: 2017-07-26T13:54:42+02:00 +-- @Last modified by: Guilhem PECH +-- @Last modified time: 15-Apr-2018 + + + +local GM = GAMEMODE + +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) +include('shared.lua') + +util.AddNetworkString("sls_motherradar") + +function endMusic(victim) + net.Start("sls_motherradar",true) + net.WriteUInt(0,2) + net.Send(victim) +end +hook.Add("PlayerDeath","slash_deathmusicend",'endMusic') + +function ENT:Initialize() + + self.Active = false + self:SetModel("models/poly_wheelchair.mdl") + self:PhysicsInit(SOLID_VPHYSICS) + self:SetMoveType(MOVETYPE_VPHYSICS) + self:SetNWBool('activated',false) + self:SetSolid(SOLID_VPHYSICS) + self:SetUseType( SIMPLE_USE ) + + local bones = ents.Create( "prop_physics" ) + bones:SetModel( "models/skeleton/skeleton_torso.mdl" ) + bones:SetPos( self:GetPos() + Vector(-4.116044,0.400906,37.009029) ) + bones:SetAngles(self:GetAngles() + Angle(-22.855,-15.711,9.402)) + bones:SetMoveType(MOVETYPE_NONE) + bones:SetParent(self) + bones:Spawn() + + + local phys = self:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(true) + phys:Wake() + end + + timer.Simple( 1, function() + if(IsValid(self)) then + self:SetMoveType(MOVETYPE_NONE) + end + end ) +end + +function ENT:SpawnFunction( ply, tr ) + if ( !tr.Hit ) then return end + local ent = ents.Create("sls_motherbates") + ent:SetPos( tr.HitPos + tr.HitNormal ) + ent:Spawn() + + return ent +end +ents.Create("prop_physics") + + +function sendInfo (ply,DistSqr) + if(!IsValid(ply)) then return end + net.Start("sls_motherradar",true) + net.WriteUInt(howFar (DistSqr),2) + net.Send(ply) +end + +function howFar (pos) + if (pos) < ( 500*500 ) then + return 3 + elseif (pos) < ( 1000*1000 ) then + return 2 + elseif (pos) < ( 1500*1500 ) then + return 1 + else + return 0 + end +end + + +function ENT:FindAroundPlayers(radius) + local entsNearby = ents.FindInSphere( self:GetPos() , radius ) + local plyNearby = {} + for i,v in pairs(entsNearby) do + if (v:IsValid() and v:IsPlayer() and v:Team() ~= TEAM_KILLER and v.ClassID != CLASS_SURV_SHY) then + plyNearby[v] = v:GetPos():DistToSqr( self:GetPos() ) + sendInfo(v,plyNearby[v]) + end + end + return plyNearby +end + +function ApplyModifications(ply,pos) + if(!IsValid(ply)) then return end + if (!ply.normWalk) then ply.normWalk = ply:GetWalkSpeed() end + + if (pos) < ( 500*500 ) then + ply:SetWalkSpeed(ply.normWalk * 1.6) + ply:SetRunSpeed(ply.normWalk * 1.6) + elseif (pos) < ( 1000*1000 ) then + ply:SetWalkSpeed(ply.normWalk * 1.4) + ply:SetRunSpeed(ply.normWalk * 1.4) + elseif (pos) < ( 1500*1500 ) then + ply:SetWalkSpeed(ply.normWalk * 1.2) + ply:SetRunSpeed(ply.normWalk * 1.2) + else + ply:SetWalkSpeed(ply.normWalk) + ply:SetRunSpeed(ply.normWalk) + + end +end + + +function ENT:Think() + local plyNearby = self:FindAroundPlayers(3000) + local last = 5000*5000 + for k,v in pairs(plyNearby) do + if v < last then + sendInfo (GM.ROUND.Killer,v) + ApplyModifications(GM.ROUND.Killer,v) + last = v + end + end + self:NextThink( CurTime() + 1 ) + return true +end + +function ENT:OnTakeDamage(dmg) + +end + +function ENT:Use( activator, caller ) + if ( activator:IsPlayer() && activator ~= GM.ROUND.Killer && !GM.ROUND.WaitingPolice) then + CurrentObjective = "wainting_police" + objectifComplete() + GM.ROUND:StartWaitingPolice() + end +end + +function ENT:OnRemove() + if self:IsPlayer() then + self:GetOwner():SetWalkSpeed(ply.normWalk) + end +end diff --git a/entities/entities/sls_motherbates/shared.lua b/entities/entities/sls_motherbates/shared.lua new file mode 100644 index 0000000..2bc44db --- /dev/null +++ b/entities/entities/sls_motherbates/shared.lua @@ -0,0 +1,17 @@ +-- Utopia Games - Slashers +-- +-- @Author: Guilhem PECH +-- @Date: 2017-07-26T13:54:42+02:00 +-- @Last modified by: Guilhem PECH +-- @Last modified time: 15-Apr-2018 + + + +ENT.Type = "anim" +ENT.Base = "base_entity" +ENT.PrintName = "Mother" +ENT.Author = "Daryl Winters" +ENT.Information = " To Call the Police" +ENT.Category = "Slashers" +ENT.Spawnable = true +ENT.AdminSpawnable = false diff --git a/entities/weapons/weapon_batesmother/cl_init.lua b/entities/weapons/weapon_batesmother/cl_init.lua new file mode 100644 index 0000000..f8031f7 --- /dev/null +++ b/entities/weapons/weapon_batesmother/cl_init.lua @@ -0,0 +1,69 @@ +-- @Author: Guilhem PECH +-- @Date: 2018-01-09 10:40:07 +-- @Email: guilhempech@gmail.com +-- @Project: Slashers +-- @Last modified by: Guilhem PECH +-- @Last modified time: 2018-01-11 15:50:02 + +include("shared.lua") +SWEP.Slot = 1 +SWEP.SlotPos = 1 +SWEP.DrawAmmo = false +SWEP.DrawCrosshair = false +language.Add("Undone_batesmum", "Undone batesmum") +SWEP.Instructions = "Left click to place it on the floor" +local batesmum_holo = nil + +function SWEP:Initialize() + self.m_bInitialized = true + +end + +function SWEP:Think() + if ( not self.m_bInitialized ) then + self:Initialize() + end +end + + + +function SWEP:Holster() + +end + + +function SWEP:PrimaryAttack() + +end + +function SWEP:SecondaryAttack() +end + +function SWEP:OnRemove() + +end + +function SWEP:GetViewModelPosition(pos, ang) + pos = pos + ang:Right() * 30 + ang:Up() * -20 + ang:Forward() * 50 + ang.pitch = ang.pitch - 10 + ang.row = ang.row + 15 + if(self:Ammo1() == 0) then + return -pos, -ang + end + return pos, ang +end + +function SWEP:DrawWorldModel() + local holdType = self:GetHoldType() + if(holdType != 'normal') then + local bone = self.Owner:LookupBone("ValveBiped.Bip01_R_Hand") + if !bone then return end + local hand_pos = self.Owner:GetBonePosition(bone) + local hand_ang = Angle(-30 , self.Owner:EyeAngles().yaw - 90, 0) + hand_pos = hand_pos + hand_ang:Forward() * - 18 + hand_ang:Right() * 3 + self:SetRenderOrigin(hand_pos) + self:SetRenderAngles(hand_ang) + self:SetModelScale(0.8) + self:DrawModel() + end +end \ No newline at end of file diff --git a/entities/weapons/weapon_batesmother/init.lua b/entities/weapons/weapon_batesmother/init.lua new file mode 100644 index 0000000..b0109fb --- /dev/null +++ b/entities/weapons/weapon_batesmother/init.lua @@ -0,0 +1,59 @@ +-- @Author: Guilhem PECH +-- @Date: 2018-01-09 10:40:07 +-- @Email: guilhempech@gmail.com +-- @Project: Slashers +-- @Last modified by: Guilhem PECH +-- @Last modified time: 2018-01-11 17:03:44 + +AddCSLuaFile("shared.lua") +AddCSLuaFile("cl_init.lua") +include("shared.lua") +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +local GM = GAMEMODE +function SWEP:Equip(NewOwner) + NewOwner:GiveAmmo(1, "ammo_batesmum", true) +end + +function SWEP:PrimaryAttack() + if self:Ammo1() <= 0 then + self:SecondaryAttack() + return + end + + local ent = ents.Create("sls_motherbates") + local batesmum_pos, batesmum_angle = slashers_batesmum_place(self.Owner, ent) + local tracedata = {} + tracedata.start = Vector(self.Owner:GetEyeTrace().HitPos) + tracedata.endpos = Vector(self.Owner:GetEyeTrace().HitPos) + tracedata.endpos.z = tracedata.endpos.z - 5 + if self.Owner:GetPos():Distance(self.Owner:GetEyeTrace().HitPos) > self.MaxDistance or not util.TraceLine(tracedata).HitWorld or (batesmum_angle.pitch % 360) > 45 then + ent:Remove() + return + end + + ent:Spawn() + cleanup.Add(self.Owner, "props", ent) + undo.Create("sls_motherbates") + undo.AddEntity(ent) + undo.SetPlayer(self.Owner) + undo.Finish() + self.Owner:SetAmmo(self:Ammo1() - 1, "ammo_batesmum") +end + +function SWEP:Reload() +end + +function SWEP:SecondaryAttack() + local trace = self.Owner:GetEyeTrace() + if self.Owner:GetPos():Distance(trace.HitPos) < self.MaxDistance and trace.Entity:GetClass() == "sls_motherbates" then + trace.Entity:Remove() + if (GM.MAP) then + self.Owner:SetWalkSpeed(GM.MAP.Killer.WalkSpeed) + self.Owner:SetRunSpeed(GM.MAP.Killer.WalkSpeed) + end + self.Owner:GiveAmmo(1, "ammo_batesmum", true) + end +end diff --git a/entities/weapons/weapon_batesmother/shared.lua b/entities/weapons/weapon_batesmother/shared.lua new file mode 100644 index 0000000..4830840 --- /dev/null +++ b/entities/weapons/weapon_batesmother/shared.lua @@ -0,0 +1,75 @@ +-- @Author: Guilhem PECH +-- @Date: 2018-01-09 10:40:07 +-- @Email: guilhempech@gmail.com +-- @Project: Slashers +-- @Last modified by: Guilhem PECH +-- @Last modified time: 2018-01-09 18:37:18 + + +SWEP.Author = "Daryl Winters" + +SWEP.Category = "Bates" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true +SWEP.AutoSwitchTo = false +SWEP.PrintName = "Mother" + +SWEP.HoldType = "duel" +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = false +SWEP.UseHands = false +SWEP.ViewModel = "models/skeleton/skeleton_torso.mdl" +SWEP.WorldModel = "models/props/debris/skeleton/cr_skel_pose03.mdl" +SWEP.ShowViewModel = true + + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "ammo_batesmum" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.MaxDistance = 120 + +game.AddAmmoType( { + name = "ammo_batesmum", + dmgtype = DMG_BULLET, + tracer = TRACER_LINE, + plydmg = 0, + npcdmg = 0, + force = 2000, + minsplash = 10, + maxsplash = 5 +} ) + +function SWEP:Initialize() + self:SetHoldType( self.HoldType ) +end + +function SWEP:Think( ) + local holdType = self:GetHoldType() + if (self:Ammo1() == 0 && holdType != 'normal' ) then + self:SetHoldType('normal') + return + elseif (self:Ammo1() > 0 && holdType == 'normal') then + self:SetHoldType('duel') + end +end + +function slashers_batesmum_place(ply, ent) + local batesmum_pos = ply:GetEyeTrace().HitPos + Vector(0,0,10) + local batesmum_angle = ply:GetEyeTrace().HitNormal:Angle() + + ent:SetPos(batesmum_pos) + batesmum_angle.pitch = batesmum_angle.pitch + 90 + ent:SetAngles(batesmum_angle) + + return batesmum_pos, batesmum_angle +end + + diff --git a/gamemode/languages/de.lua b/gamemode/languages/de.lua index 8ac3d92..5884b4d 100644 --- a/gamemode/languages/de.lua +++ b/gamemode/languages/de.lua @@ -21,6 +21,7 @@ LANG["class_desc_ghostface"] = "Du hast die Fähigkeit zu sehen, wenn ein Überl LANG["class_desc_myers"] = "Du bist der langsamste Killer und hast die Fähigkeit, dich auf einen Überlebenden zu fokussieren. Nutze diese Fähigkeit vorsichtig, um den Überlebenden zu überraschen und schnell zu töten. Höre genau hin, du kannst manchmal den Herzschlag der Überlebenden hören." LANG["class_desc_proxy"] = "Du hast die Fähigkeit, dich unsichtbar und wieder sichtbar zu machen, wenn dich kein Überlebender sieht. Nutze dies, um dem Überlebenden unauffällig zu folgen und ihn zu überraschen. Drücke deine Menü Taste (Standardmäßig 'Q'), um diese Fähigkeit zu nutzen. Höre genau hin, du kannst manchmal den Herzschlag der Überlebenden hören." LANG["class_desc_intruder"] = "Du hast die Fähigkeit Fallen zu platzieren, welche die Überlebenden töten können. Nutze deine Alert Ropes, um einen Überlebenden zu hören, die Bärenfalle, um ihn zu neutralisieren und die Door Axt, um ihn überraschend zu töten. Höre genau hin, du kannst manchmal den Herzschlag der Überlebenden hören." +LANG["class_desc_bates"] = "Use the corpse of your dead mother to help you locate the survivors. The more a survivor is near the body, the more your speed will increase but be careful, if someone finds it, the police will be called immediately. Listen carefully, you may hear survivors' heartbeat." LANG["round_mission_police"] = "Die Polizei kommt in %s" LANG["round_mission_police_killer"] = "Töte sie alle %s" diff --git a/gamemode/languages/en.lua b/gamemode/languages/en.lua index 77e1ef2..8bb0e72 100644 --- a/gamemode/languages/en.lua +++ b/gamemode/languages/en.lua @@ -24,7 +24,7 @@ LANG["class_desc_ghostface"] = "You have the ability to see when a survivor open LANG["class_desc_myers"] = "You're the slowest killer and have the ability to focus one survivor at the time. Use it carefully to surprise the survivors and kill them quickly. Listen carefully, you may heard survivors' hearbeat." LANG["class_desc_proxy"] = "You have the ability to appear and disappear when not visible by a survivor. Use it to sneak and surprise your victims. Press your menu key ('A' by default) to use it. Listen carefully, you may hear survivors' heartbeat." LANG["class_desc_intruder"] = "You have the ability to place traps to help you killing the survivors. Use your alert ropes to spot the survivors, your bear traps to neutralize them and the door axe to kill them by surprise.Listen carefully, you may hear survivors' heartbeat." -LANG["class_desc_bates"] = "I like trains" +LANG["class_desc_bates"] = "Use the corpse of your dead mother to help you locate the survivors. The more a survivor is near the body, the more your speed will increase but be careful, if someone finds it, the police will be called immediately. Listen carefully, you may hear survivors' heartbeat." LANG["round_mission_police"] = "Police arrives in %s" LANG["round_mission_police_killer"] = "Kill them all %s" diff --git a/gamemode/languages/fr.lua b/gamemode/languages/fr.lua index d9ef2bb..03860d4 100644 --- a/gamemode/languages/fr.lua +++ b/gamemode/languages/fr.lua @@ -24,7 +24,7 @@ LANG["class_desc_ghostface"] = "Vous avez la capaciter de voir quand un survivan LANG["class_desc_myers"] = "Vous êtes le tueur le plus lent et vous avez la capacité de voir un survivant en permanence. Utilisez la intelligemment pour surprendre vos victimes. Ecoutez bien, vous pouvez peut être entendre le coeur des survivants battre." LANG["class_desc_proxy"] = "Vous avez la capacité de disparaitre ou de réaparaitre quand vous êtes hors du chap de vision d'un survivant. Utilisez la pour surprendre vos victimes ! Appuyez sur votre menu des objets ('A' par défaut) pour l'utiliser. Ecoutez bien, vous pouvez peut être entendre le coeur des survivants battre." LANG["class_desc_intruder"] = "Vous avez la capacité de placer des pièges pour vous aider dans vos meurtre. Utilisez l'Alert Rope pour repérer vos victimes, les Bear Trap pour les ralentir ou la Door Trap pour les tuer. Ecoutez bien, vous pouvez peut être entendre le coeur des survivants battre." -LANG["class_desc_bates"] = "J'aime les trains" +LANG["class_desc_bates"] = "Utilisez le corps de votre défunte mère pour vous aidez à localiser les survivants. Plus un survivant est proche du corps, plus vous vous déplacerez rapidement mais attention, si quelqu'un le découvre, la police sera immédiatement appelée. Ecoutez bien, vous pouvez peut être entendre le coeur des survivants battre." LANG["round_mission_police"] = "La Police arrive dans %s" LANG["round_mission_police_killer"] = "Tuez les tous %s" diff --git a/gamemode/languages/pl.lua b/gamemode/languages/pl.lua index 0618ff5..7b77abc 100644 --- a/gamemode/languages/pl.lua +++ b/gamemode/languages/pl.lua @@ -24,6 +24,7 @@ LANG["class_desc_ghostface"] = "Masz zdolność, dzięki której możesz zobaczy LANG["class_desc_myers"] = "Jesteś najwolniejszym zabójcą, a także masz zdolność skupienia się na jednym graczu. Używaj jej, aby ich zaskoczyć. Słuchaj uważnie - możesz usłyszeć bicie serc ludzi w pobliżu." LANG["class_desc_proxy"] = "Masz umiejętność do pojawiania się i znikania, gdy nikt nie widzi. Używaj jej aby zakraść się i zaskoczyć swoje ofiary. Naciśnij przycisk menu ( domyślnie 'Q' ) aby jej użyć. Słuchaj uważnie - możesz usłyszeć bicie serc ludzi w pobliżu." LANG["class_desc_intruder"] = "Masz możliwość umieszczania pułapek aby zaskoczyć swoje ofiary. Używaj lin aby wykrywać ludzi, pułapek na misie aby ich zneutralizować oraz siekiery, którą możesz zamontować do drzwi, aby zabić ich z zaskoczenia. Słuchaj uważnie - możesz usłyszeć bicie serc ludzi w pobliżu." +LANG["class_desc_bates"] = "Use the corpse of your dead mother to help you locate the survivors. The more a survivor is near the body, the more your speed will increase but be careful, if someone finds it, the police will be called immediately. Listen carefully, you may hear survivors' heartbeat." LANG["round_mission_police"] = "Policja przybędzie za %s" LANG["round_mission_police_killer"] = "Zabij ich wszystkich %s" diff --git a/gamemode/languages/ru.lua b/gamemode/languages/ru.lua index 34301db..4bb6318 100644 --- a/gamemode/languages/ru.lua +++ b/gamemode/languages/ru.lua @@ -24,6 +24,7 @@ LANG["class_desc_ghostface"] = "У вас есть возможность вид LANG["class_desc_myers"] = "Вы самый медленный убийца и имеете возможность видеть позицию одного выжившего. Используйте его осторожно, чтобы удивить выживших и убить его быстро. Слушайте внимательно, вы можете услышать сердцебиение выживших." LANG["class_desc_proxy"] = "У вас есть способность появляться и исчезать, когда не видно выжившим. Используйте его, чтобы прокрасться и удивить своих жертв. Нажмите клавишу меню (по умолчанию «A»), чтобы использовать способность. Слушайте внимательно, вы можете услышать сердцебиение выживших." LANG["class_desc_intruder"] = "У вас есть возможность разместить ловушки, чтобы помочь вам убить оставшихся в живых. Используйте сигнальную веревку для выявления выживших и ваши медвежьи ловушеки чтобы нейтрализовать их и убить их топором в врасплох. Слушайте внимательно, вы можете услышать сердцебиение выживших." +LANG["class_desc_bates"] = "Use the corpse of your dead mother to help you locate the survivors. The more a survivor is near the body, the more your speed will increase but be careful, if someone finds it, the police will be called immediately. Listen carefully, you may hear survivors' heartbeat." LANG["round_mission_police"] = "Полиция приедет в %s" LANG["round_mission_police_killer"] = "Убейте их всех за %s минут." diff --git a/gamemode/maps/slash_motel.lua b/gamemode/maps/slash_motel.lua index 1adb58d..2a23677 100644 --- a/gamemode/maps/slash_motel.lua +++ b/gamemode/maps/slash_motel.lua @@ -3,43 +3,162 @@ -- @Email: guilhempech@gmail.com -- @Project: Slashers -- @Last modified by: Guilhem PECH --- @Last modified time: 05-Jan-2018 - - - +-- @Last modified time: 2018-01-11 16:57:16 local GM = GM or GAMEMODE -if CLIENT then - local ply = LocalPlayer() + +if SERVER then + util.AddNetworkString("sls_killerseesurvivor") end GM.MAP.Name = "Motel" GM.MAP.EscapeDuration = 90 -GM.MAP.StartMusic = "slashers_start_game_jason.wav" -GM.MAP.ChaseMusic = "slashers/ambient/chase_jason.wav" -GM.MAP.Goal = { - Generator = { - - }, +GM.MAP.StartMusic = "slashers_start_game_bates.wav" +GM.MAP.ChaseMusic = "slashers/ambient/chase_bates.wav" +GM.MAP.Goal = { Jerrican = { - + { + type = "sls_jerrican", + pos = Vector(-132.72776794434, 1096.9440917969, -46.418460845947), + ang = Angle(-11.512167930603, -17.985958099365, -0.28103637695313) + }, + { + type = "sls_jerrican", + pos = Vector(123.1305847168, 960.47161865234, -20.908155441284), + ang = Angle(-0.83715111017227, 152.2551574707, -0.34161376953125) + }, + { + type = "sls_jerrican", + pos = Vector(-434.62466430664, -977.69158935547, -255.93627929688), + ang = Angle(-85.384300231934, -129, 106.13331604004) + }, + { + type = "sls_jerrican", + pos = Vector(-250.34573364258, -1045.3840332031, -249.05012512207), + ang = Angle(-89.269607543945, -20.53507232666, -58.782928466797) + }, + { + type = "sls_jerrican", + pos = Vector(250.06280517578, -2957.9208984375, -283.96633911133), + ang = Angle(-3.1291873455048, -44.645122528076, 0.069202430546284) + }, + { + type = "sls_jerrican", + pos = Vector(1117.3536376953, 228.73536682129, -164.76811218262), + ang = Angle(0.76776641607285, -85.551902770996, -0.00201416015625) + }, + { + type = "sls_jerrican", + pos = Vector(1042.9167480469, 102.60068511963, -132.91305541992), + ang = Angle(0.0029051210731268, 125.01371002197, 0.049701131880283) + }, + { + type = "sls_jerrican", + pos = Vector(1130.7811279297, 352.00085449219, -164.88528442383), + ang = Angle(0.33160337805748, 134.03518676758, -0.088836669921875) + }, + { + type = "sls_jerrican", + pos = Vector(1532.0753173828, 401.02243041992, -190.75386047363), + ang = Angle(-0.35057589411736, 150.84475708008, 0.19333827495575) + }, + { + type = "sls_jerrican", + pos = Vector(-10.897481918335, -1617.4521484375, -250.09585571289), + ang = Angle(-87.549354553223, -47.964279174805, 141.82122802734) + }, + { + type = "sls_jerrican", + pos = Vector(-460.42602539063, -2192.0817871094, -284.11688232422), + ang = Angle(-26.21688079834, 90.1982421875, -0.027374267578125) + }, + { + type = "sls_jerrican", + pos = Vector(3103.1127929688, -6156.3852539063, 378.30126953125), + ang = Angle(0.47352004051208, 134.45399475098, -0.0120849609375) + } }, - Radio = { - + { + type = "sls_radio", + pos = Vector(478.4401550293, -1266.5806884766, -247.88885498047), + ang = Angle(0.062253076583147, -179.25592041016, 0.13994246721268) + }, + { + type = "sls_radio", + pos = Vector(403.36065673828, -1300.5260009766, -241.02865600586), + ang = Angle(0.080258369445801, 90.004638671875, 0.079702265560627) + }, + { + type = "sls_radio", + pos = Vector(177.14535522461, -1513.4949951172, -257.55368041992), + ang = Angle(-0.0058267875574529, -85.650054931641, 0.00013644844875671) + }, + { + type = "sls_radio", + pos = Vector(198.41107177734, -2267.7893066406, -257.55194091797), + ang = Angle(-0.0035855418536812, 98.675651550293, 0.0048219640739262) + }, + { + type = "sls_radio", + pos = Vector(-36.193283081055, -2901.6440429688, -247.77038574219), + ang = Angle(0.01403109356761, 76.468772888184, -0.01080322265625) + }, + { + type = "sls_radio", + pos = Vector(1318.7042236328, 334.52438354492, 20.178447723389), + ang = Angle(-0.40564346313477, 171.32048034668, 0.055375158786774) + }, + { + type = "sls_radio", + pos = Vector(978.34875488281, 209.58619689941, 183.30209350586), + ang = Angle(-1.5395933132822e-06, -4.6450867652893, 0.20672005414963) + }, + { + type = "sls_radio", + pos = Vector(1514.5386962891, 473.43273925781, 178.69873046875), + ang = Angle(-0.049126088619232, -121.3890838623, 0.018864806741476) + }, + { + type = "sls_radio", + pos = Vector(1211.291015625, 458.81875610352, 27.832090377808), + ang = Angle(-0.084948137402534, 90.007133483887, -0.004180908203125) + } + }, + Generator = { + { + type = "sls_generator", + pos = Vector(1361.044921875, 284.83706665039, -205.71798706055), + ang = Angle(-0.079552337527275, -65.23762512207, -0.090576171875) + }, + { + type = "sls_generator", + pos = Vector(133.97138977051, -3001.6188964844, -299.79745483398), + ang = Angle(-0.080492347478867, -66.50919342041, -0.0030517578125) + }, + { + type = "sls_generator", + pos = Vector(75.01806640625, 1272.2097167969, -66.514503479004), + ang = Angle(0.60224843025208, 19.975690841675, 1.6436053514481) + }, + { + type = "sls_generator", + pos = Vector(3291.0981445313, -6158.21875, 296.88793945313), + ang = Angle(2.6277825832367, -73.653427124023, 10.224415779114) + } } } -- Killer GM.MAP.Killer.Name = "Norman Bates" -GM.MAP.Killer.Model = "models/player/mkx_jason.mdl" -GM.MAP.Killer.WalkSpeed = 190 -GM.MAP.Killer.RunSpeed = 240 -GM.MAP.Killer.ExtraWeapons = {} +GM.MAP.Killer.Model = "models/steinman/slashers/bates_pm.mdl" +GM.MAP.Killer.WalkSpeed = 200 +GM.MAP.Killer.RunSpeed = 200 +GM.MAP.Killer.ExtraWeapons = {"weapon_batesmother"} if CLIENT then GM.MAP.Killer.Desc = GM.LANG:GetString("class_desc_bates") - GM.MAP.Killer.Icon = Material("icons/icon_jason.png") + GM.MAP.Killer.Icon = Material("icons/icon_bates.png") end -- Convars @@ -47,41 +166,50 @@ CreateConVar("slashers_bates_far_radius", 400, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ CreateConVar("slashers_bates_medium_radius", 200, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Set the second radius (medium).") CreateConVar("slashers_bates_close_radius", 100, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Set the third radius (close).") - -- Ability -------------------The other part of the ability code is in the 'Mother' entity code --------------------The corpse entity send a net.Message ("slash_mother_bates") to the killer, processed here : if CLIENT then - local curSound - local function playSound(sound) - sound.PlayFile( sound, "", function( station ) - if ( IsValid( station ) then - if IsValid(curSound) then - curSound:Stop() - end - curSound = station - curSound:Play() - curSound:EnableLooping(true) + function GM:playSoundMother(file) + if IsValid(GM.SoundPlayed) then + GM.SoundPlayed:Stop() + end + sound.PlayFile( file, "", function( station,num,err ) + if ( IsValid( station ) ) then + station:Play() + station:EnableLooping(true) + GM.SoundPlayed = station end - end ) + end) end - - local function receiveMotherInfo() - local radius = net.ReadUInt(2) // 0 if there is nobody inside the radius / 1 if far / 2 if medium / 3 if close - if radius == 1 then - // far - playSound("sound/music/vlvx_song22.mp3") - elseif radius == 2 then - //medium - playSound("sound/music/vlvx_song22.mp3") - elseif radius == 3 then - // close - playSound("sound/music/vlvx_song22.mp3") + function autoEnd() + if IsValid(GM.SoundPlayed) then + GM.SoundPlayed:Stop() + end + end + hook.Add('sls_round_End',"sls_musicEndRound", autoEnd) + hook.Add('sls_round_End',"sls_musicEndRound", autoEnd) + + function GM:SoundToPlay(level) + if(LocalPlayer():Team() == 1) then return end + if level == 3 then + GM:playSoundMother("sound/slashers/effects/whisper_loop_high.wav") + elseif level == 2 then + GM:playSoundMother("sound/slashers/effects/whisper_loop_medium.wav") + elseif level == 1 then + GM:playSoundMother("sound/slashers/effects/whisper_loop_small.wav") else - if IsValid(curSound) then - curSound:Stop() + if GM.SoundPlayed then + GM.SoundPlayed:Stop() end end end - net.Receive("slash_mother_bates",receiveMotherInfo) + + net.Receive( "sls_motherradar", function( len, ply ) + local distLevel = net.ReadUInt(2) + if GM.oldLevel != distLevel then + GM.oldLevel = distLevel + GM:SoundToPlay(distLevel) + end + end) +end