diff --git a/content/materials/models/perkacola/pack_a_punch_c.vmt b/content/materials/models/perkacola/pack_a_punch_c.vmt deleted file mode 100644 index 184ca704..00000000 --- a/content/materials/models/perkacola/pack_a_punch_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/pack_a_punch_c" - "$normalmap" "models/perkacola/pack_a_punch_c" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/pack_a_punch_moving_c.vmt b/content/materials/models/perkacola/pack_a_punch_moving_c.vmt deleted file mode 100644 index e27f47c2..00000000 --- a/content/materials/models/perkacola/pack_a_punch_moving_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/pack_a_punch_moving_c" - "$normalmap" "models/perkacola/pack_a_punch_moving_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_perkbottle_sleight_c.vmt b/content/materials/models/perkacola/zombie_perkbottle_sleight_c.vmt deleted file mode 100644 index 9c1de3cc..00000000 --- a/content/materials/models/perkacola/zombie_perkbottle_sleight_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_perkbottle_sleight_c" - "$normalmap" "models/perkacola/zombie_perkbottle_jugg_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_perkbottle_sleight_c.vtf b/content/materials/models/perkacola/zombie_perkbottle_sleight_c.vtf deleted file mode 100644 index bfbe2fed..00000000 Binary files a/content/materials/models/perkacola/zombie_perkbottle_sleight_c.vtf and /dev/null differ diff --git a/content/materials/models/perkacola/zombie_vending_doubletap_c.vmt b/content/materials/models/perkacola/zombie_vending_doubletap_c.vmt deleted file mode 100644 index f64f039f..00000000 --- a/content/materials/models/perkacola/zombie_vending_doubletap_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_doubletap_c" - "$normalmap" "models/perkacola/zombie_vending_doubletap_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_vending_doubletap_n.vtf b/content/materials/models/perkacola/zombie_vending_doubletap_n.vtf deleted file mode 100644 index 1ebccab1..00000000 Binary files a/content/materials/models/perkacola/zombie_vending_doubletap_n.vtf and /dev/null differ diff --git a/content/materials/models/perkacola/zombie_vending_jugg_col.vmt b/content/materials/models/perkacola/zombie_vending_jugg_col.vmt deleted file mode 100644 index 9227b20d..00000000 --- a/content/materials/models/perkacola/zombie_vending_jugg_col.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_jugg_col" - "$normalmap" "models/perkacola/zombie_vending_jugg_norm" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_vending_revive_c.vmt b/content/materials/models/perkacola/zombie_vending_revive_c.vmt deleted file mode 100644 index fa5fb6c1..00000000 --- a/content/materials/models/perkacola/zombie_vending_revive_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_revive_c" - "$normalmap" "models/perkacola/zombie_vending_revive_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_vending_revive_n.vtf b/content/materials/models/perkacola/zombie_vending_revive_n.vtf deleted file mode 100644 index 6b24d9d6..00000000 Binary files a/content/materials/models/perkacola/zombie_vending_revive_n.vtf and /dev/null differ diff --git a/content/materials/models/perkacola/zombie_vending_revsign_c.vmt b/content/materials/models/perkacola/zombie_vending_revsign_c.vmt deleted file mode 100644 index 4ec2615b..00000000 --- a/content/materials/models/perkacola/zombie_vending_revsign_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_revsign_c" - "$normalmap" "models/perkacola/zombie_vending_revsign_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_vending_revsign_n.vtf b/content/materials/models/perkacola/zombie_vending_revsign_n.vtf deleted file mode 100644 index 748549c2..00000000 Binary files a/content/materials/models/perkacola/zombie_vending_revsign_n.vtf and /dev/null differ diff --git a/content/materials/models/perkacola/zombie_vending_sleight_c.vmt b/content/materials/models/perkacola/zombie_vending_sleight_c.vmt deleted file mode 100644 index 46a09042..00000000 --- a/content/materials/models/perkacola/zombie_vending_sleight_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_sleight_c" - "$normalmap" "models/perkacola/zombie_vending_sleight_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_vending_sleight_gc.vmt b/content/materials/models/perkacola/zombie_vending_sleight_gc.vmt deleted file mode 100644 index 14cd2308..00000000 --- a/content/materials/models/perkacola/zombie_vending_sleight_gc.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_sleight_gc" - "$normalmap" "models/perkacola/zombie_vending_sleight_n" - "$surfaceprop" "Metal" - "$translucent" 1 -} diff --git a/content/materials/models/perkacola/zombie_vending_sleight_logo_c.vmt b/content/materials/models/perkacola/zombie_vending_sleight_logo_c.vmt deleted file mode 100644 index 8228f29d..00000000 --- a/content/materials/models/perkacola/zombie_vending_sleight_logo_c.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_sleight_logo_c" - "$normalmap" "models/perkacola/zombie_perkbottle_jugg_n" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/perkacola/zombie_vending_sleight_n.vtf b/content/materials/models/perkacola/zombie_vending_sleight_n.vtf deleted file mode 100644 index 9a064f46..00000000 Binary files a/content/materials/models/perkacola/zombie_vending_sleight_n.vtf and /dev/null differ diff --git a/content/materials/models/perkacola/zombie_vending_vent_power_on_c.vmt b/content/materials/models/perkacola/zombie_vending_vent_power_on_c.vmt deleted file mode 100644 index acbf2182..00000000 --- a/content/materials/models/perkacola/zombie_vending_vent_power_on_c.vmt +++ /dev/null @@ -1,5 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/perkacola/zombie_vending_vent_power_on_c" - "$surfaceprop" "Metal" -} diff --git a/content/materials/models/toybox/zombie_treasure_fill_c.vmt b/content/materials/models/toybox/zombie_treasure_fill_c.vmt deleted file mode 100644 index 57e93e0d..00000000 --- a/content/materials/models/toybox/zombie_treasure_fill_c.vmt +++ /dev/null @@ -1,4 +0,0 @@ -"VertexlitGeneric" -{ - "$basetexture" "models/toybox/zombie_treasure_fill_c" -} diff --git a/content/models/perkacola/dtap.dx80.vtx b/content/models/perkacola/dtap.dx80.vtx deleted file mode 100644 index a5ab05c9..00000000 Binary files a/content/models/perkacola/dtap.dx80.vtx and /dev/null differ diff --git a/content/models/perkacola/dtap.dx90.vtx b/content/models/perkacola/dtap.dx90.vtx deleted file mode 100644 index 422dd2e7..00000000 Binary files a/content/models/perkacola/dtap.dx90.vtx and /dev/null differ diff --git a/content/models/perkacola/dtap.mdl b/content/models/perkacola/dtap.mdl deleted file mode 100644 index 732b9171..00000000 Binary files a/content/models/perkacola/dtap.mdl and /dev/null differ diff --git a/content/models/perkacola/dtap.phy b/content/models/perkacola/dtap.phy deleted file mode 100644 index aea41812..00000000 Binary files a/content/models/perkacola/dtap.phy and /dev/null differ diff --git a/content/models/perkacola/dtap.sw.vtx b/content/models/perkacola/dtap.sw.vtx deleted file mode 100644 index f31eac3e..00000000 Binary files a/content/models/perkacola/dtap.sw.vtx and /dev/null differ diff --git a/content/models/perkacola/dtap.vvd b/content/models/perkacola/dtap.vvd deleted file mode 100644 index d5589931..00000000 Binary files a/content/models/perkacola/dtap.vvd and /dev/null differ diff --git a/content/models/perkacola/dtap.xbox.vtx b/content/models/perkacola/dtap.xbox.vtx deleted file mode 100644 index 14e84086..00000000 Binary files a/content/models/perkacola/dtap.xbox.vtx and /dev/null differ diff --git a/content/models/perkacola/jug.dx80.vtx b/content/models/perkacola/jug.dx80.vtx deleted file mode 100644 index 3bdc013a..00000000 Binary files a/content/models/perkacola/jug.dx80.vtx and /dev/null differ diff --git a/content/models/perkacola/jug.dx90.vtx b/content/models/perkacola/jug.dx90.vtx deleted file mode 100644 index ff5a0a9f..00000000 Binary files a/content/models/perkacola/jug.dx90.vtx and /dev/null differ diff --git a/content/models/perkacola/jug.mdl b/content/models/perkacola/jug.mdl deleted file mode 100644 index b8525d8e..00000000 Binary files a/content/models/perkacola/jug.mdl and /dev/null differ diff --git a/content/models/perkacola/jug.phy b/content/models/perkacola/jug.phy deleted file mode 100644 index 1113fd58..00000000 Binary files a/content/models/perkacola/jug.phy and /dev/null differ diff --git a/content/models/perkacola/jug.sw.vtx b/content/models/perkacola/jug.sw.vtx deleted file mode 100644 index 4775d5a3..00000000 Binary files a/content/models/perkacola/jug.sw.vtx and /dev/null differ diff --git a/content/models/perkacola/jug.vvd b/content/models/perkacola/jug.vvd deleted file mode 100644 index 4b949ed1..00000000 Binary files a/content/models/perkacola/jug.vvd and /dev/null differ diff --git a/content/models/perkacola/jug.xbox.vtx b/content/models/perkacola/jug.xbox.vtx deleted file mode 100644 index bd318312..00000000 Binary files a/content/models/perkacola/jug.xbox.vtx and /dev/null differ diff --git a/content/models/perkacola/packapunch.dx80.vtx b/content/models/perkacola/packapunch.dx80.vtx deleted file mode 100644 index fff68390..00000000 Binary files a/content/models/perkacola/packapunch.dx80.vtx and /dev/null differ diff --git a/content/models/perkacola/packapunch.dx90.vtx b/content/models/perkacola/packapunch.dx90.vtx deleted file mode 100644 index 9ca66bf0..00000000 Binary files a/content/models/perkacola/packapunch.dx90.vtx and /dev/null differ diff --git a/content/models/perkacola/packapunch.mdl b/content/models/perkacola/packapunch.mdl deleted file mode 100644 index cef67098..00000000 Binary files a/content/models/perkacola/packapunch.mdl and /dev/null differ diff --git a/content/models/perkacola/packapunch.phy b/content/models/perkacola/packapunch.phy deleted file mode 100644 index b0f2454b..00000000 Binary files a/content/models/perkacola/packapunch.phy and /dev/null differ diff --git a/content/models/perkacola/packapunch.sw.vtx b/content/models/perkacola/packapunch.sw.vtx deleted file mode 100644 index 8af837d1..00000000 Binary files a/content/models/perkacola/packapunch.sw.vtx and /dev/null differ diff --git a/content/models/perkacola/packapunch.vvd b/content/models/perkacola/packapunch.vvd deleted file mode 100644 index 76fae33d..00000000 Binary files a/content/models/perkacola/packapunch.vvd and /dev/null differ diff --git a/content/models/perkacola/packapunch.xbox.vtx b/content/models/perkacola/packapunch.xbox.vtx deleted file mode 100644 index e2902d9a..00000000 Binary files a/content/models/perkacola/packapunch.xbox.vtx and /dev/null differ diff --git a/content/models/perkacola/revive.dx80.vtx b/content/models/perkacola/revive.dx80.vtx deleted file mode 100644 index 78e3fd65..00000000 Binary files a/content/models/perkacola/revive.dx80.vtx and /dev/null differ diff --git a/content/models/perkacola/revive.dx90.vtx b/content/models/perkacola/revive.dx90.vtx deleted file mode 100644 index 80315ef8..00000000 Binary files a/content/models/perkacola/revive.dx90.vtx and /dev/null differ diff --git a/content/models/perkacola/revive.mdl b/content/models/perkacola/revive.mdl deleted file mode 100644 index 820c498d..00000000 Binary files a/content/models/perkacola/revive.mdl and /dev/null differ diff --git a/content/models/perkacola/revive.phy b/content/models/perkacola/revive.phy deleted file mode 100644 index 5052a6ad..00000000 Binary files a/content/models/perkacola/revive.phy and /dev/null differ diff --git a/content/models/perkacola/revive.sw.vtx b/content/models/perkacola/revive.sw.vtx deleted file mode 100644 index 9d1e8886..00000000 Binary files a/content/models/perkacola/revive.sw.vtx and /dev/null differ diff --git a/content/models/perkacola/revive.vvd b/content/models/perkacola/revive.vvd deleted file mode 100644 index 809677ed..00000000 Binary files a/content/models/perkacola/revive.vvd and /dev/null differ diff --git a/content/models/perkacola/revive.xbox.vtx b/content/models/perkacola/revive.xbox.vtx deleted file mode 100644 index d373155e..00000000 Binary files a/content/models/perkacola/revive.xbox.vtx and /dev/null differ diff --git a/content/models/perkacola/sleight.dx80.vtx b/content/models/perkacola/sleight.dx80.vtx deleted file mode 100644 index 1efebf89..00000000 Binary files a/content/models/perkacola/sleight.dx80.vtx and /dev/null differ diff --git a/content/models/perkacola/sleight.dx90.vtx b/content/models/perkacola/sleight.dx90.vtx deleted file mode 100644 index 74c668ff..00000000 Binary files a/content/models/perkacola/sleight.dx90.vtx and /dev/null differ diff --git a/content/models/perkacola/sleight.mdl b/content/models/perkacola/sleight.mdl deleted file mode 100644 index 8e0b9686..00000000 Binary files a/content/models/perkacola/sleight.mdl and /dev/null differ diff --git a/content/models/perkacola/sleight.phy b/content/models/perkacola/sleight.phy deleted file mode 100644 index 65f6a220..00000000 Binary files a/content/models/perkacola/sleight.phy and /dev/null differ diff --git a/content/models/perkacola/sleight.sw.vtx b/content/models/perkacola/sleight.sw.vtx deleted file mode 100644 index b2fbc3bc..00000000 Binary files a/content/models/perkacola/sleight.sw.vtx and /dev/null differ diff --git a/content/models/perkacola/sleight.vvd b/content/models/perkacola/sleight.vvd deleted file mode 100644 index 94977358..00000000 Binary files a/content/models/perkacola/sleight.vvd and /dev/null differ diff --git a/content/models/perkacola/sleight.xbox.vtx b/content/models/perkacola/sleight.xbox.vtx deleted file mode 100644 index 77a13bc0..00000000 Binary files a/content/models/perkacola/sleight.xbox.vtx and /dev/null differ diff --git a/content/models/toybox.dx80.vtx b/content/models/toybox.dx80.vtx deleted file mode 100644 index 3331d252..00000000 Binary files a/content/models/toybox.dx80.vtx and /dev/null differ diff --git a/content/models/toybox.dx90.vtx b/content/models/toybox.dx90.vtx deleted file mode 100644 index f18d357e..00000000 Binary files a/content/models/toybox.dx90.vtx and /dev/null differ diff --git a/content/models/toybox.mdl b/content/models/toybox.mdl deleted file mode 100644 index 1d75004e..00000000 Binary files a/content/models/toybox.mdl and /dev/null differ diff --git a/content/models/toybox.phy b/content/models/toybox.phy deleted file mode 100644 index 80013214..00000000 Binary files a/content/models/toybox.phy and /dev/null differ diff --git a/content/models/toybox.sw.vtx b/content/models/toybox.sw.vtx deleted file mode 100644 index 6df1479d..00000000 Binary files a/content/models/toybox.sw.vtx and /dev/null differ diff --git a/content/models/toybox.vvd b/content/models/toybox.vvd deleted file mode 100644 index 60007c17..00000000 Binary files a/content/models/toybox.vvd and /dev/null differ diff --git a/content/resource/fonts/BOYCOTT_.TTF b/content/resource/fonts/BOYCOTT_.TTF deleted file mode 100644 index 1b96a5e5..00000000 Binary files a/content/resource/fonts/BOYCOTT_.TTF and /dev/null differ diff --git a/content/resource/fonts/Read me.txt b/content/resource/fonts/Read me.txt deleted file mode 100644 index c72f0203..00000000 --- a/content/resource/fonts/Read me.txt +++ /dev/null @@ -1,18 +0,0 @@ -All fonts copyright Flat-it(http://flat-it.com/) - -This is a freeware typeface. This means that you can use it on your commercial or non-commercial works for free. - -But here is a list of things you could do, Only if you want to: - -* Mail me about your works -* Link http://flat-it.com/ -* Send me a sample of the work you did using my typeface -* Mail me some print material you did using my typeface -* Credit "Flat-it"on your work -* Smile - -to contact info@flat-it.com in JAPAN - - -Ryoichi Tsunekawa -Flat-it \ No newline at end of file diff --git a/content/sound/mkservers/nz/perkacola/double_tap.mp3 b/content/sound/mkservers/nz/perkacola/double_tap.mp3 deleted file mode 100644 index 39b97f47..00000000 Binary files a/content/sound/mkservers/nz/perkacola/double_tap.mp3 and /dev/null differ diff --git a/content/sound/mkservers/nz/perkacola/juggernog.mp3 b/content/sound/mkservers/nz/perkacola/juggernog.mp3 deleted file mode 100644 index 92015fcd..00000000 Binary files a/content/sound/mkservers/nz/perkacola/juggernog.mp3 and /dev/null differ diff --git a/content/sound/mkservers/nz/perkacola/quick_revive.mp3 b/content/sound/mkservers/nz/perkacola/quick_revive.mp3 deleted file mode 100644 index 695afdd9..00000000 Binary files a/content/sound/mkservers/nz/perkacola/quick_revive.mp3 and /dev/null differ diff --git a/content/sound/mkservers/nz/perkacola/speed_cola.mp3 b/content/sound/mkservers/nz/perkacola/speed_cola.mp3 deleted file mode 100644 index d5d5a348..00000000 Binary files a/content/sound/mkservers/nz/perkacola/speed_cola.mp3 and /dev/null differ diff --git a/content/sound/mkservers/nz/powerups/dp.mp3 b/content/sound/mkservers/nz/powerups/dp.mp3 deleted file mode 100644 index 8a616618..00000000 Binary files a/content/sound/mkservers/nz/powerups/dp.mp3 and /dev/null differ diff --git a/content/sound/mkservers/nz/powerups/maxammo.mp3 b/content/sound/mkservers/nz/powerups/maxammo.mp3 deleted file mode 100644 index f3445bec..00000000 Binary files a/content/sound/mkservers/nz/powerups/maxammo.mp3 and /dev/null differ diff --git a/entities/entities/nut_slow_zombie.lua b/entities/entities/nut_slow_zombie.lua deleted file mode 100644 index 63ffd8fa..00000000 --- a/entities/entities/nut_slow_zombie.lua +++ /dev/null @@ -1,265 +0,0 @@ -//This is no longer used, since it was replaced by the speed curve. - -AddCSLuaFile() - -ENT.Base = "base_nextbot" -ENT.PrintName = "Slow Zombie" -ENT.Category = "Dissolution" -ENT.Author = "Chessnut" -ENT.Spawnable = true -ENT.AdminOnly = true - -for i = 2, 4 do - util.PrecacheModel("models/zed/malezed_0"..(i * 2)..".mdl") -end - -function ENT:Initialize() - self:SetModel("models/zed/malezed_0"..(math.random(2, 4) * 2)..".mdl") - self.breathing = CreateSound(self, "npc/zombie_poison/pz_breathe_loop1.wav") - self.breathing:Play() - self.breathing:ChangePitch(60, 0) - self.breathing:ChangeVolume(0.3, 0) - self.loco:SetDeathDropHeight(700) - if SERVER then - self:SetHealth(bnpvbWJpZXM.Rounds.Curve.Health[bnpvbWJpZXM.Rounds.CurrentRound]) - end - self:SetCollisionBounds(Vector(-12,-12, 0), Vector(12, 12, 64)) - self:SetSkin(math.random(0, self:SkinCount() - 1)) - - hook.Add("EntityRemoved", self, function() - if (self.breathing) then - self.breathing:Stop() - self.breathing = nil - end - end) -end - -function ENT:TimedEvent(time, callback) - timer.Simple(time, function() - if (IsValid(self)) then - callback() - end - end) -end - -function ENT:RunBehaviour() - while (true) do - local target = self.target - - if (IsValid(target) and target:Alive()) then - local data = {} - data.start = self:GetPos() - data.endpos = self:GetPos() + self:GetForward()*128 - data.filter = self - data.mins = self:OBBMins() * 0.65 - data.maxs = self:OBBMaxs() * 0.65 - local trace = util.TraceHull(data) - local entity = trace.Entity - - if (IsValid(entity) and string.find(entity:GetClass(), "door")) then - if (!string.find(entity:GetModel(), "metal")) then - timer.Simple(0.3, function() - entity:EmitSound("physics/wood/wood_plank_break"..math.random(1, 4)..".wav", 100, math.random(90, 130)) - entity.nut_BreakHealth = (entity.nut_BreakHealth or 100) - math.random(5, 10) - - if (entity.nut_BreakHealth <= 0) then - entity.nut_BreakHealth = 100 - nut.util.BlastDoor(entity, self:GetForward() * 600) - entity:EmitSound("physics/wood/wood_furniture_break"..math.random(1, 2)..".wav", 140) - util.ScreenShake(entity:GetPos(), 8, 8, math.Rand(0.6, 0.8), 560) - end - - local effect = EffectData() - local position = entity:LocalToWorld(entity:OBBCenter()) + entity:GetRight()*math.random(-16, 16) + entity:GetUp()*math.random(-16, 16) - - effect:SetStart(position) - effect:SetOrigin(position) - util.Effect("GlassImpact", effect) - - util.ScreenShake(entity:GetPos(), 5, 5, math.Rand(0.2, 0.4), 360) - end) - - self:PlaySequenceAndWait("swing", 1) - end - end - end - - if (IsValid(target) and target:Alive() and self:GetRangeTo(target) <= 1500) then - self.loco:FaceTowards(target:GetPos()) - - if (self:GetRangeTo(target) <= 42) then - self:EmitSound("npc/zombie_poison/pz_throw2.wav", 100, math.random(75, 125)) - - self:TimedEvent(0.3, function() - self:EmitSound("npc/vort/claw_swing"..math.random(1, 2)..".wav") - end) - - self:TimedEvent(0.4, function() - if (IsValid(target) and self:GetRangeTo(target) <= 50) then - local damageInfo = DamageInfo() - damageInfo:SetAttacker(self) - damageInfo:SetDamage(math.random(5, 10)) - damageInfo:SetDamageType(DMG_CLUB) - - local force = target:GetAimVector() * -300 - force.z = 16 - - damageInfo:SetDamageForce(force) - target:TakeDamageInfo(damageInfo) - target:EmitSound("npc/zombie/zombie_hit.wav", 100, math.random(80, 160)) - target:ViewPunch(VectorRand():Angle() * 0.1) - target:SetVelocity(force) - end - end) - - self:TimedEvent(0.45, function() - if (IsValid(target) and !target:Alive()) then - target.target = nil - end - end) - - self:PlaySequenceAndWait("swing", 1) - else - self:StartActivity(ACT_WALK) - - if (self.breathing) then - self.breathing:ChangePitch(80, 1) - self.breathing:ChangeVolume(1.25, 1) - end - - if (math.random(1, 2) == 2 and (self.nextYell or 0) < CurTime()) then - self:EmitSound("npc/zombie_poison/pz_pain"..math.random(1, 3)..".wav", 80, math.random(30, 50)) - self.nextYell = CurTime() + math.random(4, 8) - end - - self.loco:SetDesiredSpeed(60) - self:MoveToPos(target:GetPos(), { - maxage = 0.67 - }) - end - else - self.target = nil - self:StartActivity(ACT_WALK) - self.loco:SetDesiredSpeed(60) - self:MoveToPos(self:GetPos() + Vector(math.random(-256, 256), math.random(-256, 256), 0), { - repath = 3, - maxage = 2 - }) - - if (math.random(1, 8) == 2) then - self:EmitSound("npc/zombie/zombie_voice_idle"..math.random(2, 7)..".wav", 100, 60) - - if (math.random(1, 2) == 2) then - self:PlaySequenceAndWait("scaredidle") - else - self:PlaySequenceAndWait("photo_react_startle") - end - end - - if (!self.target) then - for k, v in pairs(player.GetAll()) do - if (v:Alive() and self:GetRangeTo(v) <= 9999999) then - self:AlertNearby(v) - self.target = v - self:PlaySequenceAndWait("wave_smg1", 0.9) - - break - end - end - end - end - - coroutine.yield() - end -end - -function ENT:AlertNearby(target, range, noNoise) - range = range or 2400 - noNoise = noNoise or (#ents.FindByClass("nut_zombie") < 1) - - if (IsValid(self.target)) then - return - end - - for k, v in pairs(ents.FindByClass("nut_zombie")) do - if (self != v and !IsValid(v.target) and self:GetRangeTo(v) <= range) then - timer.Create("zombieAlert_"..v:EntIndex(), self:GetRangeTo(v) / 800, 1, function() - if (!IsValid(v) or !IsValid(target)) then - return - end - - v.target = target - v:EmitSound("npc/zombie/zombie_alert"..math.random(1, 3)..".wav", 100, math.random(60, 120)) - v:AlertNearby(target, range + 640) - end) - - noNoise = false - end - end - - if (!noNoise) then - self:EmitSound("npc/zombie_poison/pz_call1.wav", 100, 120) - end -end - -function ENT:OnLandOnGround() - self:EmitSound("physics/flesh/flesh_impact_hard"..math.random(1, 6)..".wav") -end - -local deathSounds = { - "npc/zombie_poison/pz_die1.wav", - "npc/zombie_poison/pz_die2.wav", - "npc/zombie/zombie_die1.wav", - "npc/zombie/zombie_die3.wav" -} - -function ENT:OnKilled(damageInfo) - local attacker = damageInfo:GetAttacker() - - if (IsValid(attacker) and self:GetRangeTo(attacker) <= 4800) then - self:AlertNearby(attacker, 1600, true) - else - local entities = ents.FindInSphere(self:GetPos(), 2400) - - for k, v in pairs(entities) do - if (v:IsPlayer()) then - self:AlertNearby(v, 2400, true) - - break - end - end - end - attacker:GivePoints(90) - bnpvbWJpZXM.Rounds.CurrentZombies = bnpvbWJpZXM.Rounds.CurrentZombies - 1 - bnpvbWJpZXM.Rounds.ZombiesSpawned = bnpvbWJpZXM.Rounds.ZombiesSpawned - 1 - self:EmitSound(table.Random(deathSounds), 100, math.random(75, 130)) - self:BecomeRagdoll(damageInfo) - local function createPowerup(pos) - local ent1 = ents.Create("drop_powerups") - local rand = table.Random({"ammobuff", "dp"}) - ent1.Buff = rand - ent1:SetModel( validPowerups[rand][1] ) - pos.z = pos.z - ent1:OBBMaxs().z - ent1:SetPos( pos ) - ent1:Spawn() - end - if math.random(1,25) == 1 then createPowerup(self:GetPos()+Vector(0,0,50)) end -end - -local painSounds = { - "npc/zombie_poison/pz_pain1.wav", - "npc/zombie_poison/pz_pain2.wav", - "npc/zombie_poison/pz_pain3.wav", - "npc/zombie/zombie_die1.wav", - "npc/zombie/zombie_die2.wav", - "npc/zombie/zombie_die3.wav" -} - -function ENT:OnInjured(damageInfo) - local attacker = damageInfo:GetAttacker() - local range = self:GetRangeTo(attacker) - attacker:GivePoints(10) - self:EmitSound(table.Random(painSounds), 100, math.random(50, 130)) - self.target = attacker - self:AlertNearby(attacker, 1000) -end \ No newline at end of file diff --git a/entities/entities/perk_machine/shared.lua b/entities/entities/perk_machine/shared.lua deleted file mode 100644 index fdab1468..00000000 --- a/entities/entities/perk_machine/shared.lua +++ /dev/null @@ -1,41 +0,0 @@ -AddCSLuaFile() - -ENT.Type = "anim" - -ENT.PrintName = "perk_machine" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - -function ENT:SetupDataTables() - self:NetworkVar("String", 0, "PerkID") -end - -function ENT:Initialize() - //self:SetModel(self.model or "models/perkacola/jug.mdl") - self:PhysicsInit(SOLID_VPHYSICS) - self:SetMoveType(MOVETYPE_VPHYSICS) - self:SetSolid(SOLID_VPHYSICS) - if SERVER then - self:SetUseType(SIMPLE_USE) - end - local phy = self:GetPhysicsObject() - if phy and phy:IsValid() then - phy:EnableGravity(false) - phy:EnableMotion(false) - end - self:DrawShadow(false) -end - -function ENT:Use(activator, caller) - if (table.Count(ents.FindByClass("button_elec"))==0||nz.Rounds.Elec) then - nz.Perks.Activate(self:GetPerkID(), self, activator) - end -end - -if CLIENT then - function ENT:Draw() - self:DrawModel() - end -end \ No newline at end of file diff --git a/entities/entities/random_box/shared.lua b/entities/entities/random_box/shared.lua deleted file mode 100644 index e5c30ddc..00000000 --- a/entities/entities/random_box/shared.lua +++ /dev/null @@ -1,88 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "random_box" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - - -function ENT:Initialize() - self:SetModel( "models/toybox.mdl" ) - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_VPHYSICS ) - self:DrawShadow( false ) - self.Uses = 0 - - if SERVER then - self:SetUseType( SIMPLE_USE ) - end -end - -function ENT:Use( activator, caller ) - //Work ateleast once before moving - if self.Uses > 0 then - //Ensure there is actually another place to move to - if math.random(self.Uses, 10) == 10 and #ents.FindByClass( "random_box_spawns" ) > 1 then - self:MoveAway() - end - end - - if !self.Moveing then - if #ents.FindByClass( "random_box_gunwindup" ) == 0 then - if activator:CanAfford(950) then - activator:TakePoints(950) - local gun = ents.Create( "random_box_gunwindup" ) - gun:SetPos( self:GetPos() + Vector(0,0,30) ) - gun:SetAngles( self:GetAngles() + Angle(0,90,0) ) - gun:Spawn() - gun:SetSolid( SOLID_VPHYSICS ) - gun:SetMoveType( MOVETYPE_NONE ) - gun.Buyer = activator - - self.Uses = self.Uses + 1 - end - end - end -end - -function ENT:MoveAway( ) - self.Moveing = true - local c = 0 - timer.Create( "moveAway", 0.1, 300, function() - if c == 30 then - local all = ents.FindByClass("random_box_spawns") - //Remove the old spot - table.RemoveByValue( all, self.BoxEnt ) - local rand = table.Random(all) - self:SetPos( rand:GetPos() ) - self:SetAngles( rand:GetAngles() ) - self.BoxEnt = rand - self.Uses = 0 - self.Moveing = false - timer.Destroy("moveAway") - else - c = c + 1 - self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z + 2*c)) - end - end ) -end - -if CLIENT then - function ENT:Draw() - self:DrawModel() - end - - hook.Add( "PostDrawOpaqueRenderables", "random_box_beam", function() - for k,v in pairs(ents.FindByClass("random_box")) do - if ( LocalPlayer():GetPos():Distance( v:GetPos() ) ) > 750 then - local Vector1 = v:LocalToWorld( Vector( 0, 0, -200 ) ) - local Vector2 = v:LocalToWorld( Vector( 0, 0, 5000 ) ) - render.SetMaterial( Material( "cable/redlaser" ) ) - render.DrawBeam( Vector1, Vector2, 300, 1, 1, Color( 255, 255, 255, 255 ) ) - end - end - end ) -end \ No newline at end of file diff --git a/entities/entities/random_box_gunwindup/shared.lua b/entities/entities/random_box_gunwindup/shared.lua deleted file mode 100644 index e1ff0d39..00000000 --- a/entities/entities/random_box_gunwindup/shared.lua +++ /dev/null @@ -1,89 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "random_box_windup" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - - -function ENT:Initialize() - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_NONE ) - if SERVER then - self:SetModel(self:GenList()[1].WorldModel) - end - self:DrawShadow( false ) - self.Winding = true - self.c = 0 - self.s = -20 - timer.Simple(7, function() self.Winding = false end) - if SERVER then - timer.Simple(18, function() if self:IsValid() then self:Remove() end end) - end -end - -function ENT:Use( activator, caller ) - if !self.Winding then - activator:Give(self.Gun.ClassName) - activator:GiveAmmo(nz.Config.BaseStartingAmmoAmount, weapons.Get(self.Gun.ClassName).Primary.Ammo) - self:Remove() - end -end - -function ENT:GenList( ) - local guns = {} - local blacklist = nz.Config.WeaponBlackList - if IsValid(self.Buyer) then - for k,v in pairs( self.Buyer:GetWeapons() ) do - table.insert(blacklist, v.ClassName) - end - end - for k,v in pairs( weapons.GetList() ) do - if !table.HasValue(blacklist, v.ClassName) then - table.insert(guns, v) - end - end - return guns -end - -function ENT:WindUp( ) - local gun = table.Random(self:GenList()) - if gun.WorldModel != nil then - self.Gun = gun - end - self.c = self.c + 1 - if self.c > 7 then - self.c = 7 - end - self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z + 0.1*self.c)) -end - -function ENT:WindDown( ) - self.s = self.s + 1 - if self.s > 7 then - self.s = 7 - end - if self.s >= 0 then - self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z - 0.1*self.s)) - end -end - -function ENT:Think() - if SERVER then - if self.Winding then - self:WindUp() - else - self:WindDown() - end - self:SetModel(self.Gun.WorldModel) - end -end - -if CLIENT then - function ENT:Draw() - self:DrawModel() - end -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_block/cl_init.lua b/entities/weapons/gmod_tool_block/cl_init.lua deleted file mode 100644 index 9c4fe274..00000000 --- a/entities/weapons/gmod_tool_block/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Hole Blocker Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_block/shared.lua b/entities/weapons/gmod_tool_block/shared.lua deleted file mode 100644 index be2aee1a..00000000 --- a/entities/weapons/gmod_tool_block/shared.lua +++ /dev/null @@ -1,254 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - -SWEP.BlockModel = "models/hunter/plates/plate2x2.mdl" - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - if SERVER then - - local tr = util.GetPlayerTrace( self.Owner ) - local pos = self.Owner:GetShootPos() - local ang = self.Owner:GetAimVector() - tr.start = pos - tr.endpos = pos+(ang*200) - local trace = util.TraceLine( tr ) - - local vec = trace.HitPos + trace.HitNormal * 8 - - - BlockSpawn(vec,trace.HitNormal:Angle() - Angle( 0, 90, 0 ), self.BlockModel) - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - end - -end - -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "wall_block" and SERVER then - trace.Entity:Remove() - end -end - -function SWEP:MakeGhostEntity( model, pos, angle ) - - util.PrecacheModel( model ) - - -- We do ghosting serverside in single player - -- It's done clientside in multiplayer - if (SERVER && !game.SinglePlayer()) then return end - if (CLIENT && game.SinglePlayer()) then return end - - -- Release the old ghost entity - self:ReleaseGhostEntity() - - -- Don't allow ragdolls/effects to be ghosts - if (!util.IsValidProp( model )) then return end - - if ( CLIENT ) then - self.GhostEntity = ents.CreateClientProp( model ) - else - self.GhostEntity = ents.Create( "prop_physics" ) - end - - -- If there's too many entities we might not spawn.. - if (!self.GhostEntity:IsValid()) then - self.GhostEntity = nil - return - end - - self.GhostEntity:SetModel( model ) - self.GhostEntity:SetPos( pos ) - self.GhostEntity:SetAngles( angle ) - self.GhostEntity:Spawn() - - self.GhostEntity:SetSolid( SOLID_VPHYSICS ); - self.GhostEntity:SetMoveType( MOVETYPE_NONE ) - self.GhostEntity:SetNotSolid( true ); - self.GhostEntity:SetRenderMode( RENDERMODE_TRANSALPHA ) - self.GhostEntity:SetColor( Color( 255, 255, 255, 150 ) ) - -end - -function SWEP:ReleaseGhostEntity() - - if ( self.GhostEntity ) then - if (!self.GhostEntity:IsValid()) then self.GhostEntity = nil return end - self.GhostEntity:Remove() - self.GhostEntity = nil - end - - if ( self.GhostEntities ) then - - for k,v in pairs( self.GhostEntities ) do - if ( v:IsValid() ) then v:Remove() end - self.GhostEntities[k] = nil - end - - self.GhostEntities = nil - end - - if ( self.GhostOffset ) then - - for k,v in pairs( self.GhostOffset ) do - self.GhostOffset[k] = nil - end - - end - -end - -function SWEP:Think() - - if ( !IsValid( self.GhostEntity ) ) then - self:MakeGhostEntity( self.BlockModel, Vector( 0, 0, 0 ), Angle( 0, 0, 0 ) ) - end - - self:UpdateGhostEntity( self.GhostEntity, self:GetOwner() ) - -end - -function SWEP:UpdateGhostEntity( ent, player ) - - if ( !IsValid( ent ) ) then return end - - local tr = util.GetPlayerTrace( player ) - local pos = self.Owner:GetShootPos() - local ang = self.Owner:GetAimVector() - tr.start = pos - tr.endpos = pos+(ang*200) - local trace = util.TraceLine( tr ) - --if ( !trace.Hit ) then return end - - if ( trace.Entity:IsPlayer() ) then - - ent:SetNoDraw( true ) - return - - end - local vec = trace.HitPos + trace.HitNormal * 8 - - ent:SetPos( vec ) - - ent:SetAngles( trace.HitNormal:Angle() - Angle( 0, 90, 0 ) ) - - ent:SetNoDraw( false ) - -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_buyabledebris/cl_init.lua b/entities/weapons/gmod_tool_buyabledebris/cl_init.lua deleted file mode 100644 index 8a8d5c53..00000000 --- a/entities/weapons/gmod_tool_buyabledebris/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Buyable Blocker Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_buyabledebris/init.lua b/entities/weapons/gmod_tool_buyabledebris/init.lua deleted file mode 100644 index f4b2f94e..00000000 --- a/entities/weapons/gmod_tool_buyabledebris/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false \ No newline at end of file diff --git a/entities/weapons/gmod_tool_buyabledebris/shared.lua b/entities/weapons/gmod_tool_buyabledebris/shared.lua deleted file mode 100644 index 96d5e794..00000000 --- a/entities/weapons/gmod_tool_buyabledebris/shared.lua +++ /dev/null @@ -1,259 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - -SWEP.BlockModel = "models/props_c17/fence03a.mdl" - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - if SERVER then - local tr = util.GetPlayerTrace( self.Owner ) - local pos = self.Owner:GetShootPos() - local ang = self.Owner:GetAimVector() - tr.start = pos - tr.endpos = pos+(ang*200) - local trace = util.TraceLine( tr ) - - local vec = trace.HitPos + trace.HitNormal * 8 - - BuyableBlockSpawn(vec, trace.HitNormal:Angle() - Angle( 90, 90, 0 ), self.BlockModel) - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - end -end - - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "wall_block_buy" and SERVER then - nz.Doors.Functions.RemoveLinkSpec( trace.Entity ) - trace.Entity:Remove() - end -end - -function SWEP:MakeGhostEntity( model, pos, angle ) - - util.PrecacheModel( model ) - - -- We do ghosting serverside in single player - -- It's done clientside in multiplayer - if (SERVER && !game.SinglePlayer()) then return end - if (CLIENT && game.SinglePlayer()) then return end - - -- Release the old ghost entity - self:ReleaseGhostEntity() - - -- Don't allow ragdolls/effects to be ghosts - if (!util.IsValidProp( model )) then return end - - if ( CLIENT ) then - self.GhostEntity = ents.CreateClientProp( model ) - else - self.GhostEntity = ents.Create( "prop_physics" ) - end - - -- If there's too many entities we might not spawn.. - if (!self.GhostEntity:IsValid()) then - self.GhostEntity = nil - return - end - - self.GhostEntity:SetModel( model ) - self.GhostEntity:SetPos( pos ) - self.GhostEntity:SetAngles( angle ) - self.GhostEntity:Spawn() - - self.GhostEntity:SetSolid( SOLID_VPHYSICS ); - self.GhostEntity:SetMoveType( MOVETYPE_NONE ) - self.GhostEntity:SetNotSolid( true ); - self.GhostEntity:SetRenderMode( RENDERMODE_TRANSALPHA ) - self.GhostEntity:SetColor( Color( 255, 255, 255, 150 ) ) - -end - ---[[--------------------------------------------------------- - Releases up the ghost entity ------------------------------------------------------------]] -function SWEP:ReleaseGhostEntity() - - if ( self.GhostEntity ) then - if (!self.GhostEntity:IsValid()) then self.GhostEntity = nil return end - self.GhostEntity:Remove() - self.GhostEntity = nil - end - - if ( self.GhostEntities ) then - - for k,v in pairs( self.GhostEntities ) do - if ( v:IsValid() ) then v:Remove() end - self.GhostEntities[k] = nil - end - - self.GhostEntities = nil - end - - if ( self.GhostOffset ) then - - for k,v in pairs( self.GhostOffset ) do - self.GhostOffset[k] = nil - end - - end - -end - -function SWEP:Think() - - if ( !IsValid( self.GhostEntity ) ) then - self:MakeGhostEntity( self.BlockModel, Vector( 0, 0, 0 ), Angle( 0, 0, 0 ) ) - end - - self:UpdateGhostEntity( self.GhostEntity, self:GetOwner() ) - -end - -function SWEP:UpdateGhostEntity( ent, player ) - - if ( !IsValid( ent ) ) then return end - - local tr = util.GetPlayerTrace( player ) - local pos = self.Owner:GetShootPos() - local ang = self.Owner:GetAimVector() - tr.start = pos - tr.endpos = pos+(ang*200) - local trace = util.TraceLine( tr ) - --if ( !trace.Hit ) then return end - - if ( trace.Entity:IsPlayer() ) then - - ent:SetNoDraw( true ) - return - - end - local vec = trace.HitPos + trace.HitNormal * 8 - - ent:SetPos( vec ) - - ent:SetAngles( trace.HitNormal:Angle() - Angle( 90, 90, 0 ) ) - - ent:SetNoDraw( false ) - -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_doors/cl_init.lua b/entities/weapons/gmod_tool_doors/cl_init.lua deleted file mode 100644 index fa033d57..00000000 --- a/entities/weapons/gmod_tool_doors/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Door Locker Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_doors/init.lua b/entities/weapons/gmod_tool_doors/init.lua deleted file mode 100644 index e6ad1094..00000000 --- a/entities/weapons/gmod_tool_doors/init.lua +++ /dev/null @@ -1,16 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false - -util.AddNetworkString( "tool_door_net" ) - -net.Receive( "tool_door_net", function( length, client ) - --validate - DoorSpawn(net.ReadString(), net.ReadString()) - bnpvbWJpZXM.Rounds.Functions.SyncClients() -end ) \ No newline at end of file diff --git a/entities/weapons/gmod_tool_doors/shared.lua b/entities/weapons/gmod_tool_doors/shared.lua deleted file mode 100644 index 8e6a4fd2..00000000 --- a/entities/weapons/gmod_tool_doors/shared.lua +++ /dev/null @@ -1,152 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - - if trace.Entity:IsDoor() then - if SERVER then - nz.Interface.ReqDoors( self.Owner, trace.Entity ) - end - end - -end - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - if trace.Entity:IsDoor() then - if SERVER then - if trace.Entity:GetClass() == "wall_block_buy" then - nz.Doors.Functions.RemoveLinkSpec( trace.Entity ) - else - nz.Doors.Functions.RemoveLink( trace.Entity:doorIndex() ) - end - end - end -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_ee/cl_init.lua b/entities/weapons/gmod_tool_ee/cl_init.lua deleted file mode 100644 index d897cc4b..00000000 --- a/entities/weapons/gmod_tool_ee/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Easter Egg Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_ee/init.lua b/entities/weapons/gmod_tool_ee/init.lua deleted file mode 100644 index f4b2f94e..00000000 --- a/entities/weapons/gmod_tool_ee/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false \ No newline at end of file diff --git a/entities/weapons/gmod_tool_ee/shared.lua b/entities/weapons/gmod_tool_ee/shared.lua deleted file mode 100644 index b669ead8..00000000 --- a/entities/weapons/gmod_tool_ee/shared.lua +++ /dev/null @@ -1,251 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} -SWEP.Rot = 0 - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - -SWEP.BlockModel = "models/props_lab/huladoll.mdl" - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - if SERVER then - - local tr = util.GetPlayerTrace( self.Owner ) - local trace = util.TraceLine( tr ) - - EasterEggSpawn(trace.HitPos, Angle(0,0,0), "models/props_lab/huladoll.mdl") - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - end -end - - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "easter_egg" and SERVER then - trace.Entity:Remove() - end -end - -function SWEP:MakeGhostEntity( model, pos, angle ) - - util.PrecacheModel( model ) - - -- We do ghosting serverside in single player - -- It's done clientside in multiplayer - if (SERVER && !game.SinglePlayer()) then return end - if (CLIENT && game.SinglePlayer()) then return end - - -- Release the old ghost entity - self:ReleaseGhostEntity() - - -- Don't allow ragdolls/effects to be ghosts - if (!util.IsValidProp( model )) then return end - - if ( CLIENT ) then - self.GhostEntity = ents.CreateClientProp( model ) - else - self.GhostEntity = ents.Create( "prop_physics" ) - end - - -- If there's too many entities we might not spawn.. - if (!self.GhostEntity:IsValid()) then - self.GhostEntity = nil - return - end - - self.GhostEntity:SetModel( model ) - self.GhostEntity:SetPos( pos ) - self.GhostEntity:SetAngles( angle ) - self.GhostEntity:Spawn() - - self.GhostEntity:SetSolid( SOLID_VPHYSICS ); - self.GhostEntity:SetMoveType( MOVETYPE_NONE ) - self.GhostEntity:SetNotSolid( true ); - self.GhostEntity:SetRenderMode( RENDERMODE_TRANSALPHA ) - self.GhostEntity:SetColor( Color( 255, 255, 255, 150 ) ) - -end - ---[[--------------------------------------------------------- - Releases up the ghost entity ------------------------------------------------------------]] -function SWEP:ReleaseGhostEntity() - - if ( self.GhostEntity ) then - if (!self.GhostEntity:IsValid()) then self.GhostEntity = nil return end - self.GhostEntity:Remove() - self.GhostEntity = nil - end - - if ( self.GhostEntities ) then - - for k,v in pairs( self.GhostEntities ) do - if ( v:IsValid() ) then v:Remove() end - self.GhostEntities[k] = nil - end - - self.GhostEntities = nil - end - - if ( self.GhostOffset ) then - - for k,v in pairs( self.GhostOffset ) do - self.GhostOffset[k] = nil - end - - end - -end - -function SWEP:Think() - - if ( !IsValid( self.GhostEntity ) ) then - self:MakeGhostEntity( self.BlockModel, Vector( 0, 0, 0 ), Angle( 0, 0, 0 ) ) - end - - self:UpdateGhostEntity( self.GhostEntity, self:GetOwner() ) - -end - -function SWEP:UpdateGhostEntity( ent, player ) - - if ( !IsValid( ent ) ) then return end - - local tr = util.GetPlayerTrace( player ) - local trace = util.TraceLine( tr ) - if ( !trace.Hit ) then return end - - if ( trace.Entity:IsPlayer() ) then - - ent:SetNoDraw( true ) - return - - end - local vec = trace.HitPos + trace.HitNormal * 8 - - ent:SetPos( vec ) - - ent:SetAngles( Angle(0,0,0) ) - - ent:SetNoDraw( false ) - -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_elec/cl_init.lua b/entities/weapons/gmod_tool_elec/cl_init.lua deleted file mode 100644 index 458c1c30..00000000 --- a/entities/weapons/gmod_tool_elec/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Power Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_elec/init.lua b/entities/weapons/gmod_tool_elec/init.lua deleted file mode 100644 index f4b2f94e..00000000 --- a/entities/weapons/gmod_tool_elec/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false \ No newline at end of file diff --git a/entities/weapons/gmod_tool_elec/shared.lua b/entities/weapons/gmod_tool_elec/shared.lua deleted file mode 100644 index f69db557..00000000 --- a/entities/weapons/gmod_tool_elec/shared.lua +++ /dev/null @@ -1,246 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - -SWEP.SwitchModel = "models/MaxOfS2D/button_01.mdl" - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - - - --ZedSpawn(trace.HitPos) - if SERVER then - - local tr = util.GetPlayerTrace( self.Owner ) - local pos = self.Owner:GetShootPos() - local trace = util.TraceLine( tr ) - if ( !trace.Hit ) then return end - - local vec = trace.HitPos + trace.HitNormal * 8 - - ElecSpawn(vec, trace.HitNormal:Angle() - Angle( 270, 0, 0 )) - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - end -end - - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - -end - -function SWEP:MakeGhostEntity( model, pos, angle ) - - util.PrecacheModel( model ) - - -- We do ghosting serverside in single player - -- It's done clientside in multiplayer - if (SERVER && !game.SinglePlayer()) then return end - if (CLIENT && game.SinglePlayer()) then return end - - -- Release the old ghost entity - self:ReleaseGhostEntity() - - -- Don't allow ragdolls/effects to be ghosts - if (!util.IsValidProp( model )) then return end - - if ( CLIENT ) then - self.GhostEntity = ents.CreateClientProp( model ) - else - self.GhostEntity = ents.Create( "prop_physics" ) - end - - -- If there's too many entities we might not spawn.. - if (!self.GhostEntity:IsValid()) then - self.GhostEntity = nil - return - end - - self.GhostEntity:SetModel( model ) - self.GhostEntity:SetPos( pos ) - self.GhostEntity:SetAngles( angle ) - self.GhostEntity:Spawn() - - self.GhostEntity:SetSolid( SOLID_VPHYSICS ); - self.GhostEntity:SetMoveType( MOVETYPE_NONE ) - self.GhostEntity:SetNotSolid( true ); - self.GhostEntity:SetRenderMode( RENDERMODE_TRANSALPHA ) - self.GhostEntity:SetColor( Color( 255, 255, 255, 150 ) ) - -end - ---[[--------------------------------------------------------- - Releases up the ghost entity ------------------------------------------------------------]] -function SWEP:ReleaseGhostEntity() - - if ( self.GhostEntity ) then - if (!self.GhostEntity:IsValid()) then self.GhostEntity = nil return end - self.GhostEntity:Remove() - self.GhostEntity = nil - end - - if ( self.GhostEntities ) then - - for k,v in pairs( self.GhostEntities ) do - if ( v:IsValid() ) then v:Remove() end - self.GhostEntities[k] = nil - end - - self.GhostEntities = nil - end - - if ( self.GhostOffset ) then - - for k,v in pairs( self.GhostOffset ) do - self.GhostOffset[k] = nil - end - - end - -end - -function SWEP:Think() - - if ( !IsValid( self.GhostEntity ) ) then - self:MakeGhostEntity( self.SwitchModel, Vector( 0, 0, 0 ), Angle( 0, 0, 0 ) ) - end - - self:UpdateGhostEntity( self.GhostEntity, self:GetOwner() ) - -end - -function SWEP:UpdateGhostEntity( ent, player ) - - if ( !IsValid( ent ) ) then return end - - local tr = util.GetPlayerTrace( player ) - local pos = self.Owner:GetShootPos() - local trace = util.TraceLine( tr ) - if ( !trace.Hit ) then return end - - if ( trace.Entity:IsPlayer() ) then - - ent:SetNoDraw( true ) - return - - end - local vec = trace.HitPos + trace.HitNormal * 8 - - ent:SetPos( vec ) - ent:SetAngles( trace.HitNormal:Angle() - Angle( 270, 0, 0 ) ) - - ent:SetNoDraw( false ) - -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_perkmachinespawns/cl_init.lua b/entities/weapons/gmod_tool_perkmachinespawns/cl_init.lua deleted file mode 100644 index a3e95411..00000000 --- a/entities/weapons/gmod_tool_perkmachinespawns/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Perk Machine Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_perkmachinespawns/init.lua b/entities/weapons/gmod_tool_perkmachinespawns/init.lua deleted file mode 100644 index c8de720b..00000000 --- a/entities/weapons/gmod_tool_perkmachinespawns/init.lua +++ /dev/null @@ -1,19 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false - -util.AddNetworkString( "tool_perk_net" ) - -net.Receive( "tool_perk_net", function( length, client ) - --validate - local id = net.ReadString() - local gun = client:GetWeapon("gmod_tool_perkmachinespawns") - gun.PerkID = id - gun.SwitchModel = PerksColas[id].Model - gun:ReleaseGhostEntity() -end ) \ No newline at end of file diff --git a/entities/weapons/gmod_tool_perkmachinespawns/shared.lua b/entities/weapons/gmod_tool_perkmachinespawns/shared.lua deleted file mode 100644 index 226f47b7..00000000 --- a/entities/weapons/gmod_tool_perkmachinespawns/shared.lua +++ /dev/null @@ -1,262 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true -SWEP.PerkID = "jug" - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - -SWEP.SwitchModel = nz.Perks.Get(SWEP.PerkID).model -SWEP.ReloadingTime = CurTime() - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - if SERVER then - - local tr = util.GetPlayerTrace( self.Owner ) - local pos = self.Owner:GetShootPos() - local trace = util.TraceLine( tr ) - if ( !trace.Hit ) then return end - - local vec = trace.HitPos + trace.HitNormal * -54 - - PerkMachineSpawn(vec, trace.HitNormal:Angle(), self.PerkID) - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - end -end - - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "perk_machine" and SERVER then - trace.Entity:Remove() - end -end - -function SWEP:Reload() - if SERVER then - if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end - nz.Interface.ReqPerks( self.Owner ) - self.ReloadingTime = CurTime() + 2 - end -end - -function SWEP:MakeGhostEntity( model, pos, angle ) - - util.PrecacheModel( model ) - - -- We do ghosting serverside in single player - -- It's done clientside in multiplayer - if (SERVER && !game.SinglePlayer()) then return end - if (CLIENT && game.SinglePlayer()) then return end - - -- Release the old ghost entity - self:ReleaseGhostEntity() - - -- Don't allow ragdolls/effects to be ghosts - if (!util.IsValidProp( model )) then return end - - if ( CLIENT ) then - self.GhostEntity = ents.CreateClientProp( model ) - else - self.GhostEntity = ents.Create( "prop_physics" ) - end - - -- If there's too many entities we might not spawn.. - if (!self.GhostEntity:IsValid()) then - self.GhostEntity = nil - return - end - - self.GhostEntity:SetModel( model ) - self.GhostEntity:SetPos( pos ) - self.GhostEntity:SetAngles( angle ) - self.GhostEntity:Spawn() - - self.GhostEntity:SetSolid( SOLID_VPHYSICS ); - self.GhostEntity:SetMoveType( MOVETYPE_NONE ) - self.GhostEntity:SetNotSolid( true ); - self.GhostEntity:SetRenderMode( RENDERMODE_TRANSALPHA ) - self.GhostEntity:SetColor( Color( 255, 255, 255, 150 ) ) - -end - ---[[--------------------------------------------------------- - Releases up the ghost entity ------------------------------------------------------------]] -function SWEP:ReleaseGhostEntity() - - if ( self.GhostEntity ) then - if (!self.GhostEntity:IsValid()) then self.GhostEntity = nil return end - self.GhostEntity:Remove() - self.GhostEntity = nil - end - - if ( self.GhostEntities ) then - - for k,v in pairs( self.GhostEntities ) do - if ( v:IsValid() ) then v:Remove() end - self.GhostEntities[k] = nil - end - - self.GhostEntities = nil - end - - if ( self.GhostOffset ) then - - for k,v in pairs( self.GhostOffset ) do - self.GhostOffset[k] = nil - end - - end - -end - -function SWEP:Think() - - if ( !IsValid( self.GhostEntity ) ) then - self:MakeGhostEntity( self.SwitchModel, Vector( 0, 0, 0 ), Angle(270,180,90) ) - end - - self:UpdateGhostEntity( self.GhostEntity, self:GetOwner() ) - -end - -function SWEP:UpdateGhostEntity( ent, player ) - - if ( !IsValid( ent ) ) then return end - - local tr = util.GetPlayerTrace( player ) - local pos = self.Owner:GetShootPos() - local trace = util.TraceLine( tr ) - if ( !trace.Hit ) then return end - - if ( trace.Entity:IsPlayer() ) then - - ent:SetNoDraw( true ) - return - - end - local vec = trace.HitPos + trace.HitNormal * -54 - - ent:SetPos( vec ) - - ent:SetAngles( trace.HitNormal:Angle() ) - - ent:SetNoDraw( false ) - -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_playerspawns/cl_init.lua b/entities/weapons/gmod_tool_playerspawns/cl_init.lua deleted file mode 100644 index 9618bdde..00000000 --- a/entities/weapons/gmod_tool_playerspawns/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Player Spawn Placer Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_playerspawns/init.lua b/entities/weapons/gmod_tool_playerspawns/init.lua deleted file mode 100644 index f4b2f94e..00000000 --- a/entities/weapons/gmod_tool_playerspawns/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false \ No newline at end of file diff --git a/entities/weapons/gmod_tool_playerspawns/shared.lua b/entities/weapons/gmod_tool_playerspawns/shared.lua deleted file mode 100644 index 02f54493..00000000 --- a/entities/weapons/gmod_tool_playerspawns/shared.lua +++ /dev/null @@ -1,144 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if SERVER then - PlayerSpawn(trace.HitPos) - end -end - - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "player_spawns" and SERVER then - trace.Entity:Remove() - end -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_randomboxspawns/cl_init.lua b/entities/weapons/gmod_tool_randomboxspawns/cl_init.lua deleted file mode 100644 index c29d673c..00000000 --- a/entities/weapons/gmod_tool_randomboxspawns/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "RandomBox Spawn Placer Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_randomboxspawns/init.lua b/entities/weapons/gmod_tool_randomboxspawns/init.lua deleted file mode 100644 index f4b2f94e..00000000 --- a/entities/weapons/gmod_tool_randomboxspawns/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false \ No newline at end of file diff --git a/entities/weapons/gmod_tool_randomboxspawns/shared.lua b/entities/weapons/gmod_tool_randomboxspawns/shared.lua deleted file mode 100644 index 60a998f6..00000000 --- a/entities/weapons/gmod_tool_randomboxspawns/shared.lua +++ /dev/null @@ -1,266 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} -SWEP.Rot = 0 - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if self.Rot then - i = 0 - else - i = 1 - end - - if SERVER then - RandomBoxSpawn(trace.HitPos, Angle(0,90*i,0)) - end -end - - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "random_box_spawns" and SERVER then - trace.Entity:Remove() - end -end - -function SWEP:MakeGhostEntity( model, pos, angle ) - - util.PrecacheModel( model ) - - -- We do ghosting serverside in single player - -- It's done clientside in multiplayer - if (SERVER && !game.SinglePlayer()) then return end - if (CLIENT && game.SinglePlayer()) then return end - - -- Release the old ghost entity - self:ReleaseGhostEntity() - - -- Don't allow ragdolls/effects to be ghosts - if (!util.IsValidProp( model )) then return end - - if ( CLIENT ) then - self.GhostEntity = ents.CreateClientProp( model ) - else - self.GhostEntity = ents.Create( "prop_physics" ) - end - - -- If there's too many entities we might not spawn.. - if (!self.GhostEntity:IsValid()) then - self.GhostEntity = nil - return - end - - self.GhostEntity:SetModel( model ) - self.GhostEntity:SetPos( pos ) - self.GhostEntity:SetAngles( angle ) - self.GhostEntity:Spawn() - - self.GhostEntity:SetSolid( SOLID_VPHYSICS ); - self.GhostEntity:SetMoveType( MOVETYPE_NONE ) - self.GhostEntity:SetNotSolid( true ); - self.GhostEntity:SetRenderMode( RENDERMODE_TRANSALPHA ) - self.GhostEntity:SetColor( Color( 255, 255, 255, 150 ) ) - -end - ---[[--------------------------------------------------------- - Releases up the ghost entity ------------------------------------------------------------]] -function SWEP:ReleaseGhostEntity() - - if ( self.GhostEntity ) then - if (!self.GhostEntity:IsValid()) then self.GhostEntity = nil return end - self.GhostEntity:Remove() - self.GhostEntity = nil - end - - if ( self.GhostEntities ) then - - for k,v in pairs( self.GhostEntities ) do - if ( v:IsValid() ) then v:Remove() end - self.GhostEntities[k] = nil - end - - self.GhostEntities = nil - end - - if ( self.GhostOffset ) then - - for k,v in pairs( self.GhostOffset ) do - self.GhostOffset[k] = nil - end - - end - -end - -function SWEP:Think() - - if ( !IsValid( self.GhostEntity ) ) then - self:MakeGhostEntity( "models/toybox.mdl", Vector( 0, 0, 0 ), Angle( 0, 0, 0 ) ) - end - - self:UpdateGhostEntity( self.GhostEntity, self:GetOwner() ) - -end - -function SWEP:UpdateGhostEntity( ent, player ) - - if ( !IsValid( ent ) ) then return end - - local tr = util.GetPlayerTrace( player ) - local pos = self.Owner:GetShootPos() - local ang = self.Owner:GetAimVector() - local trace = util.TraceLine( tr ) - if ( !trace.Hit ) then return end - - if ( trace.Entity:IsPlayer() ) then - - ent:SetNoDraw( true ) - return - - end - local vec = trace.HitPos + trace.HitNormal * 8 - - ent:SetPos( vec ) - if self.Rot then - i = 0 - else - i = 1 - end - ent:SetAngles( trace.HitNormal:Angle() - Angle( 90, 90*i, 0 ) ) - - ent:SetNoDraw( false ) - -end - -function SWEP:Reload() - self.Rot = !self.Rot -end \ No newline at end of file diff --git a/entities/weapons/gmod_tool_wepbuy/cl_init.lua b/entities/weapons/gmod_tool_wepbuy/cl_init.lua deleted file mode 100644 index 17ea1db1..00000000 --- a/entities/weapons/gmod_tool_wepbuy/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "WallGun Placer Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_wepbuy/init.lua b/entities/weapons/gmod_tool_wepbuy/init.lua deleted file mode 100644 index bd4518d5..00000000 --- a/entities/weapons/gmod_tool_wepbuy/init.lua +++ /dev/null @@ -1,15 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false - -util.AddNetworkString( "tool_wepbuy_net" ) - -net.Receive( "tool_wepbuy_net", function( length, client ) - --validate - WeaponBuySpawn(net.ReadVector(), net.ReadString(), tonumber(net.ReadString()), net.ReadAngle()) -end ) \ No newline at end of file diff --git a/entities/weapons/gmod_tool_zedspawns/cl_init.lua b/entities/weapons/gmod_tool_zedspawns/cl_init.lua deleted file mode 100644 index dd8f8031..00000000 --- a/entities/weapons/gmod_tool_zedspawns/cl_init.lua +++ /dev/null @@ -1,10 +0,0 @@ -include('shared.lua') - -SWEP.PrintName = "Zombie Spawn Placer Tool" -SWEP.Slot = 5 -SWEP.SlotPos = 6 -SWEP.DrawAmmo = false -SWEP.DrawCrosshair = true - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false diff --git a/entities/weapons/gmod_tool_zedspawns/init.lua b/entities/weapons/gmod_tool_zedspawns/init.lua deleted file mode 100644 index f63cb7c7..00000000 --- a/entities/weapons/gmod_tool_zedspawns/init.lua +++ /dev/null @@ -1,21 +0,0 @@ -AddCSLuaFile( "cl_init.lua" ) -AddCSLuaFile( "shared.lua" ) - -include('shared.lua') - -SWEP.Weight = 5 -SWEP.AutoSwitchTo = false -SWEP.AutoSwitchFrom = false - -util.AddNetworkString( "tool_zombies_net" ) - -net.Receive( "tool_zombies_net", function( length, client ) - --validate - local ent = net.ReadEntity() - local lin = net.ReadString() - - ent.Link = lin - - print(ent) - print("Link Set: "..lin) -end ) \ No newline at end of file diff --git a/entities/weapons/gmod_tool_zedspawns/shared.lua b/entities/weapons/gmod_tool_zedspawns/shared.lua deleted file mode 100644 index 0f958bf4..00000000 --- a/entities/weapons/gmod_tool_zedspawns/shared.lua +++ /dev/null @@ -1,161 +0,0 @@ --- Variables that are used on both client and server - -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" - -SWEP.ViewModel = "models/weapons/c_toolgun.mdl" -SWEP.WorldModel = "models/weapons/w_toolgun.mdl" -SWEP.AnimPrefix = "python" - -SWEP.UseHands = true - --- Be nice, precache the models -util.PrecacheModel( SWEP.ViewModel ) -util.PrecacheModel( SWEP.WorldModel ) - --- Todo, make/find a better sound. -SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) - -SWEP.Tool = {} - -SWEP.Primary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.Secondary = -{ - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" -} - -SWEP.CanHolster = true -SWEP.CanDeploy = true - ---[[--------------------------------------------------------- - Initialize ------------------------------------------------------------]] -function SWEP:Initialize() - - -- We create these here. The problem is that these are meant to be constant values. - -- in the toolmode they're not because some tools can be automatic while some tools aren't. - -- Since this is a global table it's shared between all instances of the gun. - -- By creating new tables here we're making it so each tool has its own instance of the table - -- So changing it won't affect the other tools. - - self.Primary = - { - -- Note: Switched this back to -1.. lets not try to hack our way around shit that needs fixing. -gn - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - - self.Secondary = - { - ClipSize = -1, - DefaultClip = -1, - Automatic = false, - Ammo = "none" - } - self.ReloadingTime = CurTime() - -end - ---[[--------------------------------------------------------- - Precache Stuff ------------------------------------------------------------]] -function SWEP:Precache() - - util.PrecacheSound( self.ShootSound ) - -end - ---[[--------------------------------------------------------- - The shoot effect ------------------------------------------------------------]] -function SWEP:DoShootEffect( hitpos, hitnormal, entity, physbone, bFirstTimePredicted ) - - self.Weapon:EmitSound( self.ShootSound ) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation - - -- There's a bug with the model that's causing a muzzle to - -- appear on everyone's screen when we fire this animation. - self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation - - if ( !bFirstTimePredicted ) then return end - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetNormal( hitnormal ) - effectdata:SetEntity( entity ) - effectdata:SetAttachment( physbone ) - util.Effect( "selection_indicator", effectdata ) - - local effectdata = EffectData() - effectdata:SetOrigin( hitpos ) - effectdata:SetStart( self.Owner:GetShootPos() ) - effectdata:SetAttachment( 1 ) - effectdata:SetEntity( self.Weapon ) - util.Effect( "ToolTracer", effectdata ) - -end - ---[[--------------------------------------------------------- - Trace a line then send the result to a mode function ------------------------------------------------------------]] -function SWEP:PrimaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if SERVER then - ZedSpawn(trace.HitPos, "0") - end -end - -function SWEP:Reload() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "zed_spawns" and SERVER then - if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end - //search for the entity spawn - nz.Interface.ReqZombieLink( self.Owner , trace.Entity ) - self.ReloadingTime = CurTime() + 2 - end -end - ---[[--------------------------------------------------------- - SecondaryAttack - Reset everything to how it was ------------------------------------------------------------]] -function SWEP:SecondaryAttack() - - local tr = util.GetPlayerTrace( self.Owner ) - --tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - - self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - - if trace.Entity:GetClass() == "zed_spawns" and SERVER then - trace.Entity:Remove() - end -end \ No newline at end of file diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua deleted file mode 100644 index a1a1576d..00000000 --- a/gamemode/cl_init.lua +++ /dev/null @@ -1,2 +0,0 @@ -include("shared.lua") -include( "loader.lua" ) diff --git a/gamemode/config/sh_config.lua b/gamemode/config/sh_config.lua deleted file mode 100644 index 80f36b28..00000000 --- a/gamemode/config/sh_config.lua +++ /dev/null @@ -1,129 +0,0 @@ -// nZombies - Zombie Survival Garrys Mod 13 Gamemode -// Copyright (C) 2014 Ali Aslam (Alig96) -// Contact Information: aliaslam191919@gmail.com -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// Defaults - -if SERVER then - //conv = {} - //MAIN CONFIG - //Disable player respawns? - nz.Config.Hardcore = false - //Allow players to spawn in directly after round, before game is over? - nz.Config.AllowDropins = false - //Time inbetween each round - nz.Config.PrepareTime = 10 - - //The first wave of zombies - nz.Config.BaseDifficultySpawnRateCurve = 5 - //Difficulty of the curve - nz.Config.DifficultySpawnRateCurve = 1.01 - //Base health at level 1 - nz.Config.BaseDifficultyHealthCurve = 75 - //Difficulty of the curve - nz.Config.DifficultyHealthCurve = 0.4 - - //Max amount of zombies at the same time - nz.Config.MaxZombiesSim = 100 - - //Self Explanitory - nz.Config.BaseStartingPoints = 500 - nz.Config.PerRoundPoints = 50 - - nz.Config.BaseStartingAmmoAmount = 120 - nz.Config.MaxAmmo = 120 - nz.Config.MaxWeapons = 2 - - nz.Config.BaseStartingWeapons = {"fas2_p226", "fas2_ots33"} - nz.Config.CustomConfigStartingWeps = true -- If this is set to false, the gamemode will avoid using custom weapons in configs - - //Change name variables - //Setting this to true allows for the gamemode change the name to have a tag in front while its going on - nz.Config.AllowServerName = true - nz.Config.ServerName = GetHostName() - nz.Config.ServerNameProg = "[In Progress] " - //Similar to Allow Server name, but it also locks the server. - nz.Config.AllowServerPasswordLocking = false - - //Guns that are NOT allowed in the random box. You should add things such as weapon bases here. - nz.Config.WeaponBlackList = {"gmod_tool_base", "gmod_tool_wepbuy", "gmod_tool_playerspawns", - "gmod_tool_zedspawns", "gmod_tool_doors", "gmod_tool_block", - "gmod_tool_elec", "gmod_tool_randomboxspawns", "gmod_tool_ee", - "weapon_dod_sim_base", "weapon_dod_sim_base_shot", - "weapon_dod_sim_base_snip", "weapon_sim_admin", - "weapon_medkit", "weapon_sim_spade", "gmod_tool_buyabledebris", "gmod_tool_perkmachinespawns", - "fas2_base", "fas2_ammobox", "weapon_base", "weapon_fists", "flechette_gun", "fas2_ifak", - "fas2_base_shotgun" - } - //The Speed curve - nz.Config.BaseDifficultySpeedCurve = 60 - nz.Config.DifficultySpeedCurve = 0.55 - - //Paths of player models that will be set as soon as a round starts. Leave empty if you want to keep it as sandbox models. - nz.Config.PlayerModels = { - "models/player/Group01/Male_01.mdl", - --"models/player/Group01/Male_01.mdl", - } - - //Should it choose the player models systematically(true) or randomly (false) - //Systematically would be: - //Player 1 gets the first model, Player 2 gets the second model and so on. - nz.Config.PlayerModelsSystem = false - - //The Percentage (out of a 100) of players that must be ready before the game will start - nz.Config.ReadyupPerc = 0.68 - - - //Example - //What to do when the easter eggs of the map has been found! - hook.Add("nzombies_ee_active", "nzombies_ee_MapActivate", function( ) - local map = game.GetMap() - - print("Yay! All Easter Eggs found!") - end) - - //Custom enemy setup - - nz.Config.ValidEnemies = {"nut_zombie", "nut_ex_zombie", "npc_zombie_test_752"} - - nz.Config.UseCustomEnemies = true - - nz.Config.EnemyTypes = {} - //Index is the round that it starts to spawn them - //The value is a table of all the zombie types that will spawn on that round - //The first value of the table is the name of the npc/next bot that will be used. - //The second is the weighting out of 100% - //Distribute it as you wish, but make sure it adds up to 100 - nz.Config.EnemyTypes[1] = {["nut_zombie"] = 100} - nz.Config.EnemyTypes[4] = {["nut_ex_zombie"] = 100} - nz.Config.EnemyTypes[5] = {["nut_zombie"] = 90, ["nut_ex_zombie"] = 10} - nz.Config.EnemyTypes[10] = {["nut_ex_zombie"] = 100} - nz.Config.EnemyTypes[11] = {["nut_ex_zombie"] = 20, ["nut_zombie"] = 80} - nz.Config.EnemyTypes[14] = {["nut_ex_zombie"] = 30, ["nut_zombie"] = 70} - -end - -//Shared - -hook.Add("EntityFireBullets", "nzombies_pap_firebullets", function( ent, data ) - local gun = ent:GetActiveWeapon() - if gun.PaP != nil then - if gun.PaP then - data.Damage = data.Damage * 10 - return true - end - end -end) diff --git a/gamemode/display/cl_fonts.lua b/gamemode/display/cl_fonts.lua deleted file mode 100644 index 9e47276c..00000000 --- a/gamemode/display/cl_fonts.lua +++ /dev/null @@ -1,18 +0,0 @@ -//Fonts - -surface.CreateFont( "RoundFont", { - font = "Boycott", - size = 64 - } -) -surface.CreateFont( "RoundFontSmall", { - font = "Boycott", - size = 38 - } -) - -surface.CreateFont( "ScoreFont", { - font = "Boycott", - size = 28 - } -) \ No newline at end of file diff --git a/gamemode/display/cl_hud.lua b/gamemode/display/cl_hud.lua deleted file mode 100644 index b026eda8..00000000 --- a/gamemode/display/cl_hud.lua +++ /dev/null @@ -1,41 +0,0 @@ -hook.Add("HUDPaint", "roundHUD", function() - local text = "" - local font = "RoundFont" - local w = ScrW() / 2 - if nz.Rounds.CurrentState == ROUND_INIT then - text = "Waiting for players. Type /ready to ready up." - font = "RoundFontSmall" - elseif nz.Rounds.CurrentState == ROUND_PREP then - if nz.Rounds.CurrentRound != 0 then - text = nz.Rounds.CurrentRound - else - text = "1" - end - w = ScrW() * 0.1 - elseif nz.Rounds.CurrentState == ROUND_PROG then - if nz.Rounds.CurrentRound != 0 then - text = nz.Rounds.CurrentRound - else - text = "1" - end - w = ScrW() * 0.1 - elseif nz.Rounds.CurrentState == ROUND_CREATE then - text = "Creative Mode" - elseif nz.Rounds.CurrentState == ROUND_GO then - text = "Game Over" - end - draw.SimpleText(text, font, w, ScrH() * 0.85, Color(200, 0, 0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) -end) - -hook.Add( "HUDPaint", "scoreHUD", function() - if nz.Rounds.CurrentState == ROUND_PREP or nz.Rounds.CurrentState == ROUND_PROG then - for k,v in pairs(player.GetAll()) do - if v:GetPoints() >= 0 then - draw.SimpleText(v:Nick().." - "..v:GetPoints(), "ScoreFont", ScrW() * 0.8, ScrH() / 2 + (20*k), Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) - end - end - end - if LocalPlayer():GetActiveWeapon():IsValid() and nz.Rounds.CurrentState == ROUND_CREATE then - draw.SimpleText(LocalPlayer():GetActiveWeapon():GetClass(), "RoundFontSmall", ScrW() * 0.8, ScrH() - 70, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) - end -end ) \ No newline at end of file diff --git a/gamemode/display/cl_target.lua b/gamemode/display/cl_target.lua deleted file mode 100644 index 20f58f28..00000000 --- a/gamemode/display/cl_target.lua +++ /dev/null @@ -1,90 +0,0 @@ -//HUD - -function GM:HUDDrawTargetID() - - local tr = util.GetPlayerTrace( LocalPlayer() ) - local trace = util.TraceLine( tr ) - if (!trace.Hit) then return end - if (!trace.HitNonWorld) then return end - - local text = "ERROR" - local font = "TargetID" - - if (trace.Entity:IsPlayer()) then - text = trace.Entity:Nick() - elseif (trace.Entity:GetClass() == "wall_buy") then - text = weapons.Get(trace.Entity:GetEntName()).PrintName.." Price: "..trace.Entity:GetPrice() - elseif (trace.Entity:GetClass() == "perk_machine") then - if !nz.Rounds.Elec then - text = "You must turn the electricity on first!" - else - local id = trace.Entity:GetPerkID() - text = "Press E to buy "..nz.Perks.Get(id).name.." for "..nz.Perks.Get(id).price.." points." - end - elseif (trace.Entity:IsDoor() and nz.Rounds.CurrentState != ROUND_INIT) then - //Normal Doors - if nz.Doors.Data.LinkFlags[trace.Entity:doorIndex()] != nil then - if tonumber(nz.Doors.Data.LinkFlags[trace.Entity:doorIndex()].elec) == 1 and !nz.Rounds.Elec then - text = "You must turn on the electricity first!" - else - text = "Press E to open for "..nz.Doors.Data.LinkFlags[trace.Entity:doorIndex()].price.." points." - end - elseif nz.Doors.Data.BuyableBlocks[trace.Entity:EntIndex()] != nil then - //Buyable Blocks - if tonumber(nz.Doors.Data.BuyableBlocks[trace.Entity:EntIndex()].elec) == 1 and nz.Rounds.Elec == false then - text = "You must turn on the electricity first!" - else - text = "Press E to open for "..nz.Doors.Data.BuyableBlocks[trace.Entity:EntIndex()].price.." points." - end - else - text = "You can't open this door." - end - else - return - --text = trace.Entity:GetClass() - end - - surface.SetFont( font ) - local w, h = surface.GetTextSize( text ) - - local MouseX, MouseY = gui.MousePos() - - if ( MouseX == 0 && MouseY == 0 ) then - - MouseX = ScrW() / 2 - MouseY = ScrH() / 2 - - end - - local x = MouseX - local y = MouseY - - x = x - w / 2 - y = y + 30 - - -- The fonts internal drop shadow looks lousy with AA on - draw.SimpleText( text, font, x+1, y+1, Color(0,0,0,120) ) - draw.SimpleText( text, font, x+2, y+2, Color(0,0,0,50) ) - draw.SimpleText( text, font, x, y, self:GetTeamColor( trace.Entity ) ) - - if (trace.Entity:IsPlayer()) then - y = y + h + 5 - - local text = trace.Entity:Health() .. "%" - local font = "TargetIDSmall" - - surface.SetFont( font ) - local w, h = surface.GetTextSize( text ) - local x = MouseX - w / 2 - - draw.SimpleText( text, font, x+1, y+1, Color(0,0,0,120) ) - draw.SimpleText( text, font, x+2, y+2, Color(0,0,0,50) ) - draw.SimpleText( text, font, x, y, self:GetTeamColor( trace.Entity ) ) - end -end - -concommand.Add( "PrintWeapons", function(player, command, arguments ) - for k,v in pairs( weapons.GetList() ) do - print( v.ClassName ) - end -end ) diff --git a/gamemode/door_system/cl_doors.lua b/gamemode/door_system/cl_doors.lua deleted file mode 100644 index be56c2fb..00000000 --- a/gamemode/door_system/cl_doors.lua +++ /dev/null @@ -1,11 +0,0 @@ -nz.Doors.Data = {} -nz.Doors.Data.EaDI = {} -nz.Doors.Data.LinkFlags = {} -nz.Doors.Data.OpenedLinks = {} -nz.Doors.Data.BuyableBlocks = {} - -net.Receive( "nz_Doors_Sync", function( length ) - print("Door Sync Received!") - nz.Doors.Data = net.ReadTable() - PrintTable(nz.Doors.Data) -end ) \ No newline at end of file diff --git a/gamemode/door_system/sh_meta.lua b/gamemode/door_system/sh_meta.lua deleted file mode 100644 index 7df25986..00000000 --- a/gamemode/door_system/sh_meta.lua +++ /dev/null @@ -1,95 +0,0 @@ -nz.Doors.Functions = {} - -local meta = FindMetaTable("Entity") - -function meta:IsDoor() - if not IsValid(self) then return false end - local class = self:GetClass() - - if class == "func_door" or - class == "func_door_rotating" or - class == "wall_block_buy" or - class == "prop_door_rotating" or - class == "prop_dynamic" then - return true - end - return false -end - -function meta:doorIndex() - if SERVER then - return self:CreatedByMap() and self:MapCreationID() or nil - else - //Check the ED table - return nz.Doors.Data.EaDI[self:EntIndex()] or 0 - end -end - -function meta:DoorUnlock() - if self:GetClass() == "wall_block_buy" then - self:BlockUnlock() - return - end - self.Locked = false - self:Fire("unlock", "", 0) - self:Fire("open", "", 0) - self:Fire("lock", "", 0) - self:SetKeyValue("wait",-1) - - return -end - -function meta:DoorLock() - if self:GetClass() == "wall_block_buy" then - self:BlockLock() - return - end - self.Locked = true - self:Fire("close", "", 0) - self:Fire("lock", "", 0) - return -end - - -//Functions -function nz.Doors.Functions.doorToEntIndex(num) - local ent = ents.GetMapCreatedEntity(num) - - return IsValid(ent) and ent:EntIndex() or nil -end - -function nz.Doors.Functions.doorIndexToEnt(num) - return ents.GetMapCreatedEntity(num) or NULL -end - -if SERVER then - //When a player uses a door - hook.Add( "PlayerUse", "player_buydoors", function( ply, ent ) - if ent:IsDoor() then - if ent.price != nil then - if ply:CanAfford(ent.price) and ent.Locked == true then - if (ent.elec == 0||(ent.elec == 1 and nz.Rounds.Elec)) then - ply:TakePoints(ent.price) - //Open the door and any other door with the same link - ent:DoorUnlock() - local link = ent.link - //Check the link - if link != nil then - //Go through all the doors - for k,v in pairs(ents.GetAll()) do - if v:IsDoor() then - if v.link != nil then - if ent.link == v.link and ent != v then - v:DoorUnlock() - end - end - end - nz.Doors.Data.OpenedLinks[ent.link] = true - end - end - end - end - end - end - end ) -end diff --git a/gamemode/door_system/sv_doors.lua b/gamemode/door_system/sv_doors.lua deleted file mode 100644 index 270d0510..00000000 --- a/gamemode/door_system/sv_doors.lua +++ /dev/null @@ -1,148 +0,0 @@ -nz.Doors.Data = {} -nz.Doors.Data.EaDI = {} -nz.Doors.Data.LinkFlags = {} -nz.Doors.Data.OpenedLinks = {} -nz.Doors.Data.BuyableBlocks = {} - -function nz.Doors.Functions.CreateLink( doorID, flagsStr ) - //Remove all traces of the old table if it exists - nz.Doors.Functions.RemoveLink( doorID ) - //Ensure the string is lower case - flagsStr = string.lower(flagsStr) - local door = nz.Doors.Functions.doorIndexToEnt(doorID) - //Translate the flags string into a table - local ex = string.Explode( ",", flagsStr ) - local flagsTbl = {} - if door:IsValid() and door:IsDoor() then - for k,v in pairs(ex) do - local ex2 = string.Explode( "=", v ) - flagsTbl[ex2[1]] = ex2[2] - end - //Assign the flags to the door - for k,v in pairs(flagsTbl) do - door[k] = tonumber(v) - - end - //Save the data into a convenient table for lua refresh - door.Data = flagsStr - else - print("error not a door") - end - - //Set the Door Data - nz.Doors.Data.LinkFlags[doorID] = flagsTbl - nz.Doors.Data.EaDI[nz.Doors.Functions.doorToEntIndex(doorID)] = doorID - - nz.Doors.Functions.SyncClients() - -end - -function nz.Doors.Functions.RemoveLink( doorID ) - local door = nz.Doors.Functions.doorIndexToEnt(doorID) - if door.Data != nil then - //Translate the flags string into a table - local ex = string.Explode( ",", door.Data ) - local flagsTbl = {} - if door:IsValid() and door:IsDoor() then - for k,v in pairs(ex) do - local ex2 = string.Explode( "=", v ) - flagsTbl[ex2[1]] = ex2[2] - end - //Assign the flags to the door - for k,v in pairs(flagsTbl) do - door[k] = nil - - end - //Save the data into a convenient table for lua refresh - door.Data = nil - else - print("error not a door") - end - - //Set the Door Data - nz.Doors.Data.LinkFlags[doorID] = nil - nz.Doors.Data.EaDI[nz.Doors.Functions.doorToEntIndex(doorID)] = nil - - nz.Doors.Functions.SyncClients() - end -end - -function nz.Doors.Functions.CreateLinkSpec( ent, flagsStr ) - if flagsStr != "" then - nz.Doors.Functions.RemoveLinkSpec( ent ) - local flagsTbl = {} - //Ensure the string is lower case - flagsStr = string.lower(flagsStr) - //Translate the flags string into a table - local ex = string.Explode( ",", flagsStr ) - - if ent:IsValid() then - for k,v in pairs(ex) do - local ex2 = string.Explode( "=", v ) - flagsTbl[ex2[1]] = ex2[2] - end - //Assign the flags to the door - for k,v in pairs(flagsTbl) do - ent[k] = tonumber(v) - end - //Save the data into a convenient table for lua refresh - ent.Data = flagsStr - else - print("error not a door") - end - //Set the Door Data - nz.Doors.Data.BuyableBlocks[ent] = flagsTbl - nz.Doors.Functions.SyncClients() - end -end - -function nz.Doors.Functions.RemoveLinkSpec( ent ) - local door = ent - if door.Data != nil then - //Translate the flags string into a table - local ex = string.Explode( ",", door.Data ) - local flagsTbl = {} - if door:IsValid() and door:IsDoor() then - for k,v in pairs(ex) do - local ex2 = string.Explode( "=", v ) - flagsTbl[ex2[1]] = ex2[2] - end - //Assign the flags to the door - for k,v in pairs(flagsTbl) do - door[k] = nil - - end - //Save the data into a convenient table for lua refresh - door.Data = nil - else - print("error not a door") - end - - //Set the Door Data - nz.Doors.Data.BuyableBlocks[door] = nil - - nz.Doors.Functions.SyncClients() - end -end - -//Client Side Syncing -util.AddNetworkString( "nz_Doors_Sync" ) - -function nz.Doors.Functions.SyncClients() - local data = table.Copy(nz.Doors.Data) - for k,v in pairs(data.BuyableBlocks) do - if type(k) == "Entity" then - data.BuyableBlocks[k:EntIndex()] = v - end - end - for k,v in pairs(data.BuyableBlocks) do - if type(k) == "Entity" then - //Sanitise - data.BuyableBlocks[k] = nil - end - end - net.Start( "nz_Doors_Sync" ) - net.WriteTable( data ) - net.Broadcast() -end - diff --git a/gamemode/effects/cl_fuck.lua b/gamemode/effects/cl_fuck.lua deleted file mode 100644 index 8e056526..00000000 --- a/gamemode/effects/cl_fuck.lua +++ /dev/null @@ -1,10 +0,0 @@ -// RAWR! -nz.Rounds.Effects = nz.Rounds.Effects or {} -net.Receive("nz_Effects_Sound", function() - nz.Rounds.Effects.Sound(net.ReadString()) -end) - -function nz.Rounds.Effects.Sound(snd) - playSound = CreateSound(LocalPlayer(), snd) - playSound:Play() -end \ No newline at end of file diff --git a/gamemode/effects/sv_fuck.lua b/gamemode/effects/sv_fuck.lua deleted file mode 100644 index d8d12f74..00000000 --- a/gamemode/effects/sv_fuck.lua +++ /dev/null @@ -1,8 +0,0 @@ -// RAWR! -nz.Rounds.Effects = nz.Rounds.Effects or {} -util.AddNetworkString("nz_Effects_Sound") -function nz.Rounds.Effects.Sound(str) - net.Start("nz_Effects_Sound") - net.WriteString(str) - net.Broadcast() -end \ No newline at end of file diff --git a/gamemode/enemies/sv_enemies.lua b/gamemode/enemies/sv_enemies.lua deleted file mode 100644 index 1551c8d4..00000000 --- a/gamemode/enemies/sv_enemies.lua +++ /dev/null @@ -1,43 +0,0 @@ -function OnEnemyKilled(enemy, attacker) - if attacker:IsPlayer() then - attacker:GivePoints(90) - attacker:AddFrags(1) - end - nz.Rounds.CurrentZombies = nz.Rounds.CurrentZombies - 1 - nz.Rounds.ZombiesSpawned = nz.Rounds.ZombiesSpawned - 1 - - local powerData = false - for id,data in pairs(nz.PowerUps.GetBufferAll()) do - if (math.Rand(0, 100) <= data.chance) then - powerData = data - break - end - end - if (powerData) then - local pos = enemy:GetPos()+Vector(0,0,50) - local ent1 = ents.Create("drop_powerups") - ent1.Buff = powerData.id - pos.z = pos.z - ent1:OBBMaxs().z - ent1:SetModel(powerData.model) - ent1:SetPos(pos) - ent1:Spawn() - end -end - -function OnEnemyHurt(enemy, attacker) - if attacker:IsPlayer() then - attacker:GivePoints(10) - end -end - -hook.Add("ScaleNPCDamage","nz_npc_hurt", function( npc, hitgroup, dmginfo ) - OnEnemyHurt( npc, dmginfo:GetAttacker(), hitgroup) - print(npc:Health() - dmginfo:GetDamage()) - if (npc:Health() - dmginfo:GetDamage()) <= 0 then - OnEnemyKilled( npc, dmginfo:GetAttacker()) - end -end) - -hook.Add("OnNPCKilled","nz_npc_kill", function( npc, attacker, inflictor ) - OnEnemyKilled( npc, attacker) -end) \ No newline at end of file diff --git a/gamemode/halos/cl_halos.lua b/gamemode/halos/cl_halos.lua deleted file mode 100644 index 415e2a6a..00000000 --- a/gamemode/halos/cl_halos.lua +++ /dev/null @@ -1,51 +0,0 @@ -// TODO: Tidy up similar to chat commands. - -//Zombie Spawns -hook.Add( "PreDrawHalos", "zed_spawns_halos", function() - if nz.Rounds.CurrentState == ROUND_CREATE then - halo.Add( ents.FindByClass( "zed_spawns" ), Color( 255, 0, 0 ), 0, 0, 0.1, 0, 1 ) - end -end ) - -hook.Add( "PreDrawHalos", "player_spawns_halos", function() - if nz.Rounds.CurrentState == ROUND_CREATE then - halo.Add( ents.FindByClass( "player_spawns" ), Color( 0, 255, 0 ), 0, 0, 0.1, 0, 1 ) - end -end ) - -hook.Add( "PreDrawHalos", "door_spawns_halos", function() - if nz.Rounds.CurrentState == ROUND_CREATE then - local doors = {} - for k,v in pairs(nz.Doors.Data.EaDI) do - table.insert(doors, ents.GetByIndex(k)) - end - for k,v in pairs(nz.Doors.Data.BuyableBlocks) do - table.insert(doors, ents.GetByIndex(k)) - end - halo.Add( doors, Color( 0, 0, 255 ), 0, 0, 0.1, 0, 1 ) - end -end ) - -hook.Add( "PreDrawHalos", "wall_block_buy_halos", function() - if nz.Rounds.CurrentState == ROUND_CREATE then - local doors = ents.FindByClass( "wall_block_buy" ) - for k,v in pairs(nz.Doors.Data.BuyableBlocks) do - table.RemoveByValue(doors, ents.GetByIndex(k)) - end - halo.Add( doors, Color( 255, 230, 255 ), 0, 0, 0.1 ) - end -end ) - -hook.Add( "PreDrawHalos", "wall_buy_halos", function() - halo.Add( ents.FindByClass( "wall_buy" ), Color( 255, 255, 255 ), 0, 0, 0.1 ) -end ) - -hook.Add( "PreDrawHalos", "wall_block_halos", function() - if nz.Rounds.CurrentState == ROUND_CREATE then - halo.Add( ents.FindByClass( "wall_block" ), Color( 0, 255, 255 ), 0, 0, 0.1 ) - end -end ) - -hook.Add( "PreDrawHalos", "button_elec_halos", function() - halo.Add( ents.FindByClass( "button_elec" ), Color( 255, 0, 255 ), 0, 0, 0.1 ) -end ) \ No newline at end of file diff --git a/gamemode/init.lua b/gamemode/init.lua deleted file mode 100644 index 10ef4be2..00000000 --- a/gamemode/init.lua +++ /dev/null @@ -1,6 +0,0 @@ -include( "shared.lua" ) -include( "loader.lua" ) - -AddCSLuaFile("loader.lua") -AddCSLuaFile("shared.lua") - diff --git a/gamemode/interface/cl_int.lua b/gamemode/interface/cl_int.lua deleted file mode 100644 index d838d64d..00000000 --- a/gamemode/interface/cl_int.lua +++ /dev/null @@ -1,424 +0,0 @@ -nz.Interface = {} -//Doors// -function nz.Interface.DoorProps( ent ) - local name = "Add New Door" - local valz = {} - valz["Row1"] = 0 - valz["Row2"] = 1 - valz["Row3"] = 1000 - valz["Row4"] = 0 - //Check if the ent has flags already - if ent:doorIndex() != 0 then - local data = nz.Doors.Data.LinkFlags[ent:doorIndex()] - if data.link != nil then - valz["Row1"] = 1 - valz["Row2"] = data.link - end - valz["Row3"] = data.price - valz["Row4"] = data.elec - name = "Modifying Door Flag" - elseif nz.Doors.Data.BuyableBlocks[ent] != nil then - local data = nz.Doors.Data.BuyableBlocks[ent] - if data.link != nil then - valz["Row1"] = 1 - valz["Row2"] = data.link - end - valz["Row3"] = data.price - valz["Row4"] = data.elec - name = "Modifying Door Flag" - end - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 300, 180 ) - DermaPanel:SetTitle( name ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local DProperties = vgui.Create( "DProperties", DermaPanel ) - DProperties:SetSize( 280, 180 ) - DProperties:SetPos( 10, 30 ) - - local Row1 = DProperties:CreateRow( "Door Settings", "Enable Flag?" ) - Row1:Setup( "Boolean" ) - Row1:SetValue( valz["Row1"] ) - Row1.DataChanged = function( _, val ) valz["Row1"] = val end - local Row2 = DProperties:CreateRow( "Door Settings", "Flag" ) - Row2:Setup( "Integer" ) - Row2:SetValue( valz["Row2"] ) - Row2.DataChanged = function( _, val ) valz["Row2"] = val end - local Row3 = DProperties:CreateRow( "Door Settings", "Price" ) - Row3:Setup( "Integer" ) - Row3:SetValue( valz["Row3"] ) - Row3.DataChanged = function( _, val ) valz["Row3"] = val end - local Row4 = DProperties:CreateRow( "Door Settings", "Requires Electricity?" ) - Row4:Setup( "Boolean" ) - Row4:SetValue( valz["Row4"] ) - Row4.DataChanged = function( _, val ) valz["Row4"] = val end - - local DermaButton = vgui.Create( "DButton" ) - DermaButton:SetParent( DermaPanel ) - DermaButton:SetText( "Submit" ) - DermaButton:SetPos( 10, 140 ) - DermaButton:SetSize( 280, 30 ) - DermaButton.DoClick = function() - local function compileString(price, elec, flag) - local str = "price="..price..",elec="..elec - if flag != false then - str = str..",link="..flag - end - return str - end - local flag = false - if valz["Row1"] == 1 then - flag = valz["Row2"] - end - DermaPanel:SetTitle( "Modifying Door Flag" ) - net.Start( "nz_int_doors" ) - net.WriteEntity(ent) - net.WriteString(compileString(valz["Row3"], valz["Row4"], flag)) - net.SendToServer( ) - - print(compileString(valz["Row3"], valz["Row4"], flag)) - end - - -end - -net.Receive( "nz_int_doors", function( len ) - nz.Interface.DoorProps( net.ReadEntity() ) -end ) -//End Doors// - -//Wep Buy// -function nz.Interface.WepBuyProps( vec, ang ) - local valz = {} - valz["Row1"] = "weapon_class" - valz["Row2"] = 500 - - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 300, 180 ) - DermaPanel:SetTitle( "Add New Weapon" ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local DProperties = vgui.Create( "DProperties", DermaPanel ) - DProperties:SetSize( 280, 180 ) - DProperties:SetPos( 10, 30 ) - - local Row1 = DProperties:CreateRow( "Weapon Settings", "Weapon Class" ) - Row1:Setup( "Generic" ) - Row1:SetValue( valz["Row1"] ) - Row1.DataChanged = function( _, val ) valz["Row1"] = val end - local Row2 = DProperties:CreateRow( "Weapon Settings", "Price" ) - Row2:Setup( "Integer" ) - Row2:SetValue( valz["Row2"] ) - Row2.DataChanged = function( _, val ) valz["Row2"] = val end - - local DermaButton = vgui.Create( "DButton" ) - DermaButton:SetParent( DermaPanel ) - DermaButton:SetText( "Submit" ) - DermaButton:SetPos( 10, 140 ) - DermaButton:SetSize( 280, 30 ) - DermaButton.DoClick = function() - - //Check the weapon class is fine first - if weapons.Get( valz["Row1"] ) != nil then - net.Start( "nz_int_wepbuy" ) - net.WriteVector( vec ) - net.WriteAngle( ang ) - net.WriteString( valz["Row1"] ) - net.WriteString( tostring(valz["Row2"]) ) - net.SendToServer( ) - - DermaPanel:Close() - end - - end - - -end - -net.Receive( "nz_int_wepbuy", function( len ) - nz.Interface.WepBuyProps( net.ReadVector(), net.ReadAngle() ) -end ) -//End Wep buy// - -//Map Config// -function nz.Interface.MapConfig( maps ) - - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 300, 180 ) - DermaPanel:SetTitle( "Load a config" ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local DermaListView = vgui.Create("DListView") - DermaListView:SetParent(DermaPanel) - DermaListView:SetPos(10, 30) - DermaListView:SetSize(280, 100) - DermaListView:SetMultiSelect(false) - DermaListView:AddColumn("Name") - //Populate - for k,v in pairs(maps) do - DermaListView:AddLine(v) - end - - local DermaButton = vgui.Create( "DButton" ) - DermaButton:SetParent( DermaPanel ) - DermaButton:SetText( "Submit" ) - DermaButton:SetPos( 10, 140 ) - DermaButton:SetSize( 280, 30 ) - DermaButton.DoClick = function() - if DermaListView:GetSelectedLine() != nil then - local str = DermaListView:GetLine(DermaListView:GetSelectedLine()):GetValue(1) - if str != nil then - net.Start( "nz_int_mapconfig" ) - net.WriteString(str) - net.SendToServer( ) - DermaPanel:Close() - end - end - end - - -end - -net.Receive( "nz_int_mapconfig", function( len ) - nz.Interface.MapConfig( net.ReadTable() ) -end ) -//End Map Config// - - -//Zombie Links// -function nz.Interface.ZombieSpawnLinks( ent, link ) - local name = "Add New Zombie Link" - local valz = {} - valz["Row1"] = 0 - valz["Row2"] = 1 - //Check if the ent has flags already - if link != 0 then - valz["Row1"] = 1 - valz["Row2"] = link - name = "Modifying Zombie Link" - end - - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 300, 180 ) - DermaPanel:SetTitle( name ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local DProperties = vgui.Create( "DProperties", DermaPanel ) - DProperties:SetSize( 280, 180 ) - DProperties:SetPos( 10, 30 ) - - local Row1 = DProperties:CreateRow( "Zombie Spawn", "Enable Flag?" ) - Row1:Setup( "Boolean" ) - Row1:SetValue( valz["Row1"] ) - Row1.DataChanged = function( _, val ) valz["Row1"] = val end - local Row2 = DProperties:CreateRow( "Zombie Spawn", "Flag" ) - Row2:Setup( "Integer" ) - Row2:SetValue( valz["Row2"] ) - Row2.DataChanged = function( _, val ) valz["Row2"] = val end - - local DermaButton = vgui.Create( "DButton" ) - DermaButton:SetParent( DermaPanel ) - DermaButton:SetText( "Submit" ) - DermaButton:SetPos( 10, 140 ) - DermaButton:SetSize( 280, 30 ) - DermaButton.DoClick = function() - local str="nil" - if valz["Row1"] == 0 then - str="nil" - else - str=valz["Row2"] - end - net.Start("nz_int_zombiespawn") - net.WriteEntity(ent) - net.WriteString(str) - net.SendToServer( ) - end -end - -net.Receive( "nz_int_zombiespawn", function( len ) - nz.Interface.ZombieSpawnLinks( net.ReadEntity(), tonumber(net.ReadString()) ) -end ) -//End Zombie Links// - -////////////////////////////////////////////// -//StartingWeps// -function nz.Interface.StartingWeps( cc, weps ) - local valz = {} - valz["Row1"] = cc - valz["Row2"] = weps[1] - valz["Row3"] = weps[2] - - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 300, 180 ) - DermaPanel:SetTitle( "Modifying Starting Weapons" ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local DProperties = vgui.Create( "DProperties", DermaPanel ) - DProperties:SetSize( 280, 180 ) - DProperties:SetPos( 10, 30 ) - - local Row1 = DProperties:CreateRow( "Weapon Settings", "Use Config'd Weps" ) - Row1:Setup( "Boolean" ) - Row1:SetValue( valz["Row1"] ) - Row1.DataChanged = function( _, val ) valz["Row1"] = val end - local Row2 = DProperties:CreateRow( "Weapon Settings", "Weapon Class 1" ) - Row2:Setup( "Generic" ) - Row2:SetValue( valz["Row2"] ) - Row2.DataChanged = function( _, val ) valz["Row2"] = val end - local Row3 = DProperties:CreateRow( "Weapon Settings", "Weapon Class 2" ) - Row3:Setup( "Generic" ) - Row3:SetValue( valz["Row3"] ) - Row3.DataChanged = function( _, val ) valz["Row3"] = val end - - local DermaButton = vgui.Create( "DButton" ) - DermaButton:SetParent( DermaPanel ) - DermaButton:SetText( "Submit" ) - DermaButton:SetPos( 10, 140 ) - DermaButton:SetSize( 280, 30 ) - DermaButton.DoClick = function() - - //Check the weapon class is fine first - if weapons.Get( valz["Row2"] ) != nil and weapons.Get( valz["Row3"] ) != nil then - local vl = valz["Row1"] - valz["Row1"] = nil - valz = table.ClearKeys(valz) - net.Start( "nz_int_startweps" ) - net.WriteString(vl) - net.WriteTable( valz ) - net.SendToServer( ) - - DermaPanel:Close() - end - - end -end - -net.Receive( "nz_int_startweps", function( len ) - nz.Interface.StartingWeps( net.ReadString(), net.ReadTable() ) -end ) -//End StartingWeps// - -//Perk Machines// -function nz.Interface.Perks( ) - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 300, 180 ) - DermaPanel:SetTitle( "Modifying Perk Machines" ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local choices = vgui.Create( "DComboBox", DermaPanel ) - choices:SetPos( 10, 30 ) - choices:SetSize( 280, 30 ) - for k,v in pairs(nz.Perks.GetAll()) do - choices:AddChoice( v.name, v.id ) - end - choices.OnSelect = function( panel, index, value, data ) - local gun = LocalPlayer():GetActiveWeapon( ) - gun.SwitchModel = nz.Perks.Get(data).model - gun:ReleaseGhostEntity() - net.Start( "nz_int_perks" ) - net.WriteString( data ) - net.SendToServer() - DermaPanel:Close() - end -end - -net.Receive( "nz_int_perks", function( len ) - nz.Interface.Perks( ) -end ) -//End Perk Machines// - - - -//Config Changer // -function nz.Interface.ConfigChange( tbl ) - local valz = table.Copy( tbl ) - local DermaPanel = vgui.Create( "DFrame" ) - DermaPanel:SetPos( 100, 100 ) - DermaPanel:SetSize( 400, 180 ) - DermaPanel:SetTitle( "Configure" ) - DermaPanel:SetVisible( true ) - DermaPanel:SetDraggable( true ) - DermaPanel:ShowCloseButton( true ) - DermaPanel:MakePopup() - DermaPanel:Center() - - local DProperties = vgui.Create( "DProperties", DermaPanel ) - DProperties:SetSize( 380, 100 ) - DProperties:SetPos( 10, 30 ) - - for k,v in pairs( tbl ) do - local Row = DProperties:CreateRow( "Config Settings", k ) - Row:Setup( "Generic" ) - Row:SetValue( valz[k] ) - Row.DataChanged = function( _, val ) valz[k] = val end - end - - //Submit Button - - local DermaButton = vgui.Create( "DButton" ) - DermaButton:SetParent( DermaPanel ) - DermaButton:SetText( "Submit" ) - DermaButton:SetPos( 10, 140 ) - DermaButton:SetSize( 380, 30 ) - DermaButton.DoClick = function() - local function detectChanges(tbl1, tbl2) - for k,v in pairs(tbl1) do - if tbl2[k] == v then - //Nothings Changed - //No need to send the same value back, remove it - tbl1[k] = "MARKED" - //else - //Change detected - end - end - for k,v in pairs(tbl1) do - if v == "MARKED" then - tbl1[k] = nil - end - - end - return tbl1 - end - net.Start( "nz_int_configchanger" ) - net.WriteTable(detectChanges(valz,tbl)) - net.SendToServer( ) - DermaPanel:Close() - end - - -end - -net.Receive( "nz_int_configchanger", function( len ) - nz.Interface.ConfigChange( net.ReadTable() ) -end ) -//End Config Changer // diff --git a/gamemode/interface/sv_rec.lua b/gamemode/interface/sv_rec.lua deleted file mode 100644 index e40340b6..00000000 --- a/gamemode/interface/sv_rec.lua +++ /dev/null @@ -1,189 +0,0 @@ -nz.Interface = {} - -//Door Interface -util.AddNetworkString( "nz_int_doors" ) - -//Server to client -function nz.Interface.ReqDoors( ply, door ) - net.Start( "nz_int_doors" ) - net.WriteEntity(door) - net.Send( ply ) -end - -//Client to Server -net.Receive( "nz_int_doors", function( len ) - local door = net.ReadEntity() - local flagStr = net.ReadString() - if door:GetClass() == "wall_block_buy" then - nz.Doors.Functions.CreateLinkSpec( door, flagStr ) - else - nz.Doors.Functions.CreateLink( door:doorIndex(), flagStr ) - end -end ) - -// END DOOR // - -//Weapon Buy Interface -util.AddNetworkString( "nz_int_wepbuy" ) - -//Server to client -function nz.Interface.ReqWepBuy( ply, vec, ang ) - net.Start( "nz_int_wepbuy" ) - net.WriteVector( vec ) - net.WriteAngle( ang ) - net.Send( ply ) -end - -//Client to Server -net.Receive( "nz_int_wepbuy", function( len ) - local vec = net.ReadVector() - local ang = net.ReadAngle() - local class = net.ReadString() - local price = tonumber(net.ReadString()) - WeaponBuySpawn(vec, class, price, ang) -end ) - -// END Weapon Buy // - -//Load Map Interface -util.AddNetworkString( "nz_int_mapconfig" ) - -//Server to client -function nz.Interface.ReqMapConfig( ply ) - local files = file.Find( "nz/nz_"..game.GetMap( ).."*", "DATA" ) - net.Start( "nz_int_mapconfig" ) - net.WriteTable(files) - net.Send( ply ) -end - -//Client to Server -net.Receive( "nz_int_mapconfig", function( len ) - local selected = net.ReadString() - local Sep = string.Explode(".", selected) - nz.Mapping.Functions.LoadConfig( Sep[1] ) -end ) - -// END Load Map Interface // - -//Zombie Tool -util.AddNetworkString( "nz_int_zombiespawn" ) - -//Server to client -function nz.Interface.ReqZombieLink( ply, ent ) - net.Start( "nz_int_zombiespawn" ) - net.WriteEntity( ent ) - net.WriteString( ent.Link ) - net.Send( ply ) -end - -//Client to Server -net.Receive( "nz_int_zombiespawn", function( len ) - local spawn = net.ReadEntity() - local link = net.ReadString() - if link == "nil" then - spawn.Link = 0 - else - spawn.Link = link - end - print("Link Changed!") -end ) - -// END Zombie Tool // - -//Starting weapons // -util.AddNetworkString( "nz_int_startweps" ) - -//Server to client -function nz.Interface.ReqStartingWeps( ply ) - //Redundant - if true then return end - net.Start( "nz_int_startweps" ) - net.WriteString(tostring(nz.Config.CustomConfigStartingWeps)) - net.WriteTable(nz.Config.BaseStartingWeapons) - net.Send( ply ) - -end - -//Client to Server -net.Receive( "nz_int_startweps", function( len ) - local bt = tobool(net.ReadString()) - local tbl = net.ReadTable() - nz.Config.CustomConfigStartingWeps = bt - nz.Config.BaseStartingWeapons = tbl -end ) - -// END Starting weapons // - -//Perk Machines // -util.AddNetworkString( "nz_int_perks" ) - -//Server to client -function nz.Interface.ReqPerks( ply ) - - net.Start( "nz_int_perks" ) - net.Send( ply ) - -end - -//Client to Server -net.Receive( "nz_int_perks", function( len, client ) - local id = net.ReadString() - local gun = client:GetWeapon("gmod_tool_perkmachinespawns") - gun.PerkID = id - gun.SwitchModel = nz.Perks.Get(id).model - gun:ReleaseGhostEntity() -end ) - -// END Perk Machines // - -// Config Changer // -util.AddNetworkString( "nz_int_configchanger" ) - -//Server to client -function nz.Interface.ReqConfigChange( ply ) - local ConfigChangerTbl = table.Copy(nz.Config) - //Convert all tables to strings - for k,v in pairs(ConfigChangerTbl) do - if type(v) == "table" then - ConfigChangerTbl[k] = util.TableToJSON(v) - else - ConfigChangerTbl[k] = tostring(v) - end - end - net.Start( "nz_int_configchanger" ) - net.WriteTable( ConfigChangerTbl ) - net.Send( ply ) - -end - -//Client to Server -net.Receive( "nz_int_configchanger", function( len, client ) - local tbl = net.ReadTable() - //Parse - for k,v in pairs(tbl) do - if v == "true" then - tbl[k] = true - elseif v == "false" then - tbl[k] = false - else - local char = string.sub(v, 1, 1) - if char == "{" then - //its a table - tbl[k] = util.JSONToTable(v) - elseif char == "0" or char == "1" or char == "2" or char == "3" or char == "4" or char == "5" or char == "6" or char == "7" or char == "8" or char == "9" then - //it must be a number - tbl[k] = tonumber(v) - end - end - end - //Apply settings - local cunt = 0 - for k,v in pairs(tbl) do - nz.Config[k] = v - cunt = cunt + 1 - end - print("Total of ".. cunt .. " config options changed by: ".. client:Nick()) - PrintTable(tbl) -end ) - -// END Config Changer // \ No newline at end of file diff --git a/gamemode/loader.lua b/gamemode/loader.lua deleted file mode 100644 index c3b2ea21..00000000 --- a/gamemode/loader.lua +++ /dev/null @@ -1,60 +0,0 @@ -//Main Tables -nz = {} -nz.Config = {} -nz.Doors = {} -nz.Rounds = {} -nz.Perks = {} -nz.PowerUps = {} - -//End Tables - -//Load all files recursively - -local gmfolder = "nzombies" - -local _,dirs = file.Find( gmfolder.."/gamemode/*", "LUA" ) - -function RecInclude(name, dir) - local sep = string.Explode("_", name) - name = dir..name - if sep[1] == "sv" then - if SERVER then - include(name) - end - elseif sep[1] == "sh" then - if SERVER then - AddCSLuaFile(name) - include(name) - else - include(name) - end - elseif sep[1] == "cl" then - if SERVER then - AddCSLuaFile(name) - else - include(name) - end - end - print("Including: "..name) -end - -if SERVER then - for k,v in pairs(dirs) do - local f2,d2 = file.Find( gmfolder.."/gamemode/"..v.."/*", "LUA" ) - for k2,v2 in pairs(f2) do - RecInclude(v2, v.."/") - end - end -end - -if CLIENT then - for k,v in pairs(dirs) do - local f2,d2 = file.Find( gmfolder.."/gamemode/"..v.."/*", "LUA" ) - for k2,v2 in pairs(f2) do - RecInclude(v2, v.."/") - end - end -end - - - diff --git a/gamemode/mapping/sv_spawnents.lua b/gamemode/mapping/sv_spawnents.lua deleted file mode 100644 index 836a8d1b..00000000 --- a/gamemode/mapping/sv_spawnents.lua +++ /dev/null @@ -1,114 +0,0 @@ -function WeaponBuySpawn(position, gun, price, angle) - if weapons.Get(gun) != nil then - local ent1 = ents.Create("wall_buy") - ent1:SetAngles(angle) - local pos = position - pos.z = pos.z - ent1:OBBMaxs().z - ent1:SetWeapon(gun, price) - ent1:SetPos( pos ) - ent1:Spawn() - else - print("SKIPPED "..gun.. ". Are you sure you have it installed?") - end -end - -function ZedSpawn(position, link) - local ent1 = ents.Create("zed_spawns") - local pos = position - pos.z = pos.z - ent1:OBBMaxs().z - ent1:SetPos( pos ) - ent1:Spawn() - ent1.Link = link -end - -function PlayerSpawn(position) - local ent1 = ents.Create("player_spawns") - local pos = position - pos.z = pos.z - ent1:OBBMaxs().z - ent1:SetPos( pos ) - ent1:Spawn() -end - -function RandomBoxSpawn(position, angle) - local gun = ents.Create( "random_box_spawns" ) - gun:SetPos( position ) - gun:SetAngles( angle ) - gun:Spawn() - gun:SetSolid( SOLID_VPHYSICS ) - gun:SetMoveType( MOVETYPE_NONE ) -end - -function MysteryBoxSpawn(position, angle) - local gun = ents.Create( "random_box" ) - gun:SetPos( position ) - gun:SetAngles( angle ) - gun:Spawn() - gun:SetSolid( SOLID_VPHYSICS ) - gun:SetMoveType( MOVETYPE_NONE ) -end - -function ElecSpawn(pos, ang) - //THERE CAN ONLY BE ONE TRUE HERO - local prevs = ents.FindByClass("button_elec") - if prevs[1] != nil then - prevs[1]:Remove() - end - - local ent1 = ents.Create( "button_elec" ) - ent1:SetPos( pos ) - ent1:SetAngles( ang ) - ent1:Spawn() -end - -function DoorSpawn(doorID,flagsStr) - nz.Doors.Functions.CreateLink(doorID, flagsStr) -end - -function BlockSpawn(pos,ang,model) - local block = ents.Create( "wall_block" ) - block:SetModel( model ) - block:SetPos( pos ) - block:SetAngles( ang ) - block:Spawn() - block:SetSolid( SOLID_VPHYSICS ) - block:SetMoveType( MOVETYPE_NONE ) -end - -function BuyableBlockSpawn(pos,ang,model,flagsStr) - if flagsStr == nil then flagsStr = "" end - local block = ents.Create( "wall_block_buy" ) - block:SetModel( model ) - block:SetPos( pos ) - block:SetAngles( ang ) - block:Spawn() - block:SetSolid( SOLID_VPHYSICS ) - block:SetMoveType( MOVETYPE_NONE ) - //Delay before setting flags - timer.Simple(3, function() nz.Doors.Functions.CreateLinkSpec(block, flagsStr) end) -end - -function PerkMachineSpawn(position, angle, id) - local perkData = nz.Perks.Get(id) - local perk = ents.Create("perk_machine") - perk:SetPerkID(id) - perk:SetModel(perkData.model) - perk:SetPos(position) - perk:SetAngles(angle) - perk:Spawn() - perk:Activate() -end - -function EasterEggSpawn(pos,ang,model) - local egg = ents.Create( "easter_egg" ) - egg:SetModel( model ) - egg:SetPos( pos ) - egg:SetAngles( ang ) - egg:Spawn() -end - -hook.Add( "InitPostEntity", "test_spawnents", function() - //ZedSpawn(Vector(-159.803314, -615.409302, 128.031250), 0) - //PlayerSpawn(Vector(-201.604568, -281.750580, 128.031250)) - //WeaponBuySpawn(Vector(271.441559,-631.911804,136.031250), "fas2_sg550", 100, Angle(2.816000,-41.491978,0.000000)) - //ElecSpawn(Vector(280.441559,-631.911804,136.031250), Angle(2.816000,-41.491978,0.000000)) -end ) diff --git a/gamemode/perks/cl_perks.lua b/gamemode/perks/cl_perks.lua deleted file mode 100644 index fbed8765..00000000 --- a/gamemode/perks/cl_perks.lua +++ /dev/null @@ -1 +0,0 @@ -// RAWR! \ No newline at end of file diff --git a/gamemode/perks/sh_fas2perks.lua b/gamemode/perks/sh_fas2perks.lua deleted file mode 100644 index a8ebd81f..00000000 --- a/gamemode/perks/sh_fas2perks.lua +++ /dev/null @@ -1,182 +0,0 @@ -//Override the function for Speed Cola / Double Tap -function FAS2_PlayAnim(wep, anim, speed, cyc, time) - speed = speed and speed or 1 - cyc = cyc and cyc or 0 - time = time or 0 - local owner = wep:GetOwner( ) - - if type(anim) == "table" then - anim = table.Random(anim) - end - - if IsValid(owner) then - anim = string.lower(anim) - //print(anim) - if owner:HasPerk("speedcola") then - if string.find(anim, "reload") != nil or string.find(anim, "insert") != nil then - speed = 2 - end - elseif owner:HasPerk("dtap") then - if string.find(anim, "fire") != nil or string.find(anim, "cock") != nil or string.find(anim, "pump") != nil then - speed = 1.25 - end - end - end - - if game.SinglePlayer() then - if SERVER then - if wep.Sounds[anim] then - wep.CurSoundTable = wep.Sounds[anim] - wep.CurSoundEntry = 1 - wep.SoundSpeed = speed - wep.SoundTime = CurTime() + time - end - end - /*if wep.Sounds[anim] then - for k, v in pairs(wep.Sounds[anim]) do - timer.Simple(v.time, function() - if IsValid(ply) and ply:Alive() and IsValid(wep) and wep == ply:GetActiveWeapon() then - wep:EmitSound(v.sound, 70, 100) - end - end) - end - end - end*/ - else - if wep.Sounds[anim] then - wep.CurSoundTable = wep.Sounds[anim] - wep.CurSoundEntry = 1 - wep.SoundSpeed = speed - wep.SoundTime = CurTime() + time - end - - /*if wep.Sounds[anim] then - for k, v in pairs(wep.Sounds[anim]) do - timer.Simple(v.time, function() - wep:EmitSound(v.sound, 70, 100) - end) - end - end*/ - end - - if SERVER and game.SinglePlayer() then - ply = Entity(1) - - umsg.Start("FAS2ANIM", ply) - umsg.String(anim) - umsg.Float(speed) - umsg.Float(cyc) - umsg.End() - end - - if CLIENT then - vm = wep.Wep - - wep.CurAnim = string.lower(anim) - - if vm then - vm:SetCycle(cyc) - vm:SetSequence(anim) - vm:SetPlaybackRate(speed) - end - end -end -//Sync the speed -if SERVER then - //Syncing - local playerMeta = FindMetaTable( "Player" ) - oldGive = playerMeta.Give - function playerMeta:Give(weaponClass) - oldGive(self, weaponClass) - //Sync the weps - timer.Simple(1, function() UpdatePerkWeps(self) end) - end - util.AddNetworkString( "nz_sync_speedweps" ) - util.AddNetworkString( "nz_sync_dtapweps" ) - //Call this function when the player buys a new gun or gets a new gun - function UpdatePerkWeps( ply ) - FAS2_SPEEDCOLA( ply ) - FAS2_DTAPCOLA( ply ) - end - - function FAS2_SPEEDCOLA( ply ) - //Check if they have the perk - if ply:HasPerk("speedcola") then - for _,gun in pairs(ply:GetWeapons()) do - local sep = string.Explode("_", gun:GetClass()) - //Add a special check for FAS weps - if sep[1] == "fas2" then - if gun.Speed != true then - gun.Speed = true - //Normal - if gun.ReloadTime != nil then gun.ReloadTime = gun.ReloadTime / 2 end - if gun.ReloadTime_Nomen != nil then gun.ReloadTime_Nomen = gun.ReloadTime_Nomen / 2 end - if gun.ReloadTime_Empty != nil then gun.ReloadTime_Empty = gun.ReloadTime_Empty / 2 end - if gun.ReloadTime_Empty_Nomen != nil then gun.ReloadTime_Empty_Nomen = gun.ReloadTime_Empty_Nomen / 2 end - //BiPod - if gun.ReloadTime_Bipod != nil then gun.ReloadTime_Bipod = gun.ReloadTime_Bipod / 2 end - if gun.ReloadTime_Bipod_Nomen != nil then gun.ReloadTime_Bipod_Nomen = gun.ReloadTime_Bipod_Nomen / 2 end - if gun.ReloadTime_Bipod_Empty != nil then gun.ReloadTime_Bipod_Empty = gun.ReloadTime_Bipod_Empty / 2 end - if gun.ReloadTime_Bipod_Empty_Nomen != nil then gun.ReloadTime_Bipod_Empty_Nomen = gun.ReloadTime_Bipod_Empty_Nomen / 2 end - end - end - end - //Send a sync to the client - net.Start( "nz_sync_speedweps" ) - net.Send( ply ) - end - end - - function FAS2_DTAPCOLA( ply ) - //Check if they have the perk - if ply:HasPerk("dtap") then - for _,gun in pairs(ply:GetWeapons()) do - local sep = string.Explode("_", gun:GetClass()) - //Add a special check for FAS weps - if sep[1] == "fas2" then - if gun.Dtap != true then - gun.Dtap = true - if gun.FireDelay != nil then gun.FireDelay = gun.FireDelay / 1.25 end - end - end - end - //Send a sync to the client - net.Start( "nz_sync_dtapweps" ) - net.Send( ply ) - end - end -else - net.Receive( "nz_sync_speedweps", function( len ) - for _,gun in pairs(LocalPlayer():GetWeapons()) do - local sep = string.Explode("_", gun:GetClass()) - //Add a special check for FAS weps - if sep[1] == "fas2" then - if gun.Speed != true then - gun.Speed = true - //Normal - if gun.ReloadTime != nil then gun.ReloadTime = gun.ReloadTime / 2 end - if gun.ReloadTime_Nomen != nil then gun.ReloadTime_Nomen = gun.ReloadTime_Nomen / 2 end - if gun.ReloadTime_Empty != nil then gun.ReloadTime_Empty = gun.ReloadTime_Empty / 2 end - if gun.ReloadTime_Empty_Nomen != nil then gun.ReloadTime_Empty_Nomen = gun.ReloadTime_Empty_Nomen / 2 end - //BiPod - if gun.ReloadTime_Bipod != nil then gun.ReloadTime_Bipod = gun.ReloadTime_Bipod / 2 end - if gun.ReloadTime_Bipod_Nomen != nil then gun.ReloadTime_Bipod_Nomen = gun.ReloadTime_Bipod_Nomen / 2 end - if gun.ReloadTime_Bipod_Empty != nil then gun.ReloadTime_Bipod_Empty = gun.ReloadTime_Bipod_Empty / 2 end - if gun.ReloadTime_Bipod_Empty_Nomen != nil then gun.ReloadTime_Bipod_Empty_Nomen = gun.ReloadTime_Bipod_Empty_Nomen / 2 end - end - end - end - end ) - net.Receive( "nz_sync_dtapweps", function( len ) - for _,gun in pairs(LocalPlayer():GetWeapons()) do - local sep = string.Explode("_", gun:GetClass()) - //Add a special check for FAS weps - if sep[1] == "fas2" then - if gun.Dtap != true then - gun.Dtap = true - if gun.FireDelay != nil then gun.FireDelay = gun.FireDelay / 1.25 end - end - end - end - end ) -end \ No newline at end of file diff --git a/gamemode/perks/sh_perks.lua b/gamemode/perks/sh_perks.lua deleted file mode 100644 index 5fcf5575..00000000 --- a/gamemode/perks/sh_perks.lua +++ /dev/null @@ -1,82 +0,0 @@ -// RAWR! -nz.Perks.buffer = nz.Perks.buffer or {} -function nz.Perks.Add(perkData) - perkData.OneTimeUse = perkData.OneTimeUse or true - perkData.scale = perkData.scale or 1 - perkData.price = perkData.price or 0 - perkData.snd = perkData.snd or false - perkData.material = perkData.material or false - perkData.func = perkData.func or function() end - nz.Perks.buffer[perkData.id] = perkData -end - -function nz.Perks.GetAll() - return nz.Perks.buffer -end -function nz.Perks.Get(id) - return nz.Perks.buffer[id] -end - -nz.Perks.Add({ - id = "jug", - name = "Juggernog", - model = "models/perkacola/jug.mdl", - material = "mkservers/nz/perks/juggernog.png", - scale = 1, - price = 2000, - snd = {"nz_juggernog", 1}, - func = (function(self, ply) - ply:SetHealth(200) - return true - end), -}) -nz.Perks.Add({ - id = "dtap", - name = "Double Tap", - model = "models/perkacola/dtap.mdl", - material = "mkservers/nz/perks/doubletap.png", - scale = 1, - price = 1500, - snd = {"nz_juggernog", 1}, - func = (function(self, ply) - //Check if they're holding any FAS2 weps - timer.Simple(1, function() FAS2_DTAPCOLA( ply ) end ) - return true - end), -}) -nz.Perks.Add({ - id = "speedcola", - name = "Speed Cola", - model = "models/perkacola/sleight.mdl", - material = "mkservers/nz/perks/speedcola.png", - scale = 1, - price = 3000, - snd = {"nz_juggernog", 1}, - func = function(self, ply) - timer.Simple(1, function() FAS2_SPEEDCOLA( ply ) end ) - return true - end, -}) -nz.Perks.Add({ - id = "pap", - name = "Pack A Punch", - model = "models/perkacola/packapunch.mdl", - scale = 1, - price = 2000, - snd = {"nz_juggernog", 1}, - func = (function(self, ply) - return false - end), -}) -nz.Perks.Add({ - id = "revive", - name = "Quick Revive", - model = "models/perkacola/revive.mdl", - material = "mkservers/nz/perks/quickrevive.png", - scale = 1, - price = 2000, - snd = {"nz_juggernog", 1}, - func = (function(self, ply) - return false - end), -}) \ No newline at end of file diff --git a/gamemode/perks/sv_perks.lua b/gamemode/perks/sv_perks.lua deleted file mode 100644 index 2844a97c..00000000 --- a/gamemode/perks/sv_perks.lua +++ /dev/null @@ -1,33 +0,0 @@ -// RAWR! -function nz.Perks.Activate(id, ent, ply) - local perkData = nz.Perks.Get(id) - if (perkData&&ply:CanAfford(tonumber(perkData.price))) then - if (perkData.OneTimeUse) then - if (!ply:HasPerk(id)) then - if (perkData.func(ent, ply)) then - ply:SetPerk(id, perkData.material) - ply:TakePoints(tonumber(perkData.price)) - ply:PrintMessage(HUD_PRINTTALK, "[NZ] You have used the "..perkData.name.."!") - else - ply:PrintMessage(HUD_PRINTTALK, "[NZ] This perk does not seem currently setup, contact someone about it.") - end - if (perkData.snd) then - ent:EmitSound(perkData.snd[1], perkData.snd[2]) - end - else - ply:PrintMessage(HUD_PRINTTALK, "[NZ] You already have this Perk!") - end - else - if (perkData.func(ent, ply)) then - ply:TakePoints(tonumber(ent.Price)) - ply:PrintMessage(HUD_PRINTTALK, "[NZ] You have used the "..perkData.name.."!") - else - ply:PrintMessage(HUD_PRINTTALK, "[NZ] This perk does not seem currently setup, contact someone about it.") - end - if (perkData.snd) then - ent:EmitSound(perkData.snd[1], perkData.snd[2]) - end - ply:PrintMessage(HUD_PRINTTALK, "[NZ] You have used the "..perkData.name.."!") - end - end -end \ No newline at end of file diff --git a/gamemode/player_class/sh_player_ingame.lua b/gamemode/player_class/sh_player_ingame.lua deleted file mode 100644 index 323703b0..00000000 --- a/gamemode/player_class/sh_player_ingame.lua +++ /dev/null @@ -1,80 +0,0 @@ -DEFINE_BASECLASS( "player_default" ) - -local PLAYER = {} - --- --- See gamemodes/base/player_class/player_default.lua for all overridable variables --- -PLAYER.WalkSpeed = 100 -PLAYER.RunSpeed = 200 -PLAYER.CanUseFlashlight = true - -//Don't forget Colours - -function PLAYER:Loadout() - - self.Player:SetTeam(TEAM_PLAYERS) - if self.Player:GetPoints() == 0 then - if nz.Rounds.CurrentRound != 1 then - self.Player:SetPoints(nz.Config.BaseStartingPoints + (nz.Rounds.CurrentRound * nz.Config.PerRoundPoints)) - else - self.Player:SetPoints(nz.Config.BaseStartingPoints) - end - end - - for k2,v2 in pairs(nz.Config.BaseStartingWeapons) do - self.Player:Give(v2) - self.Player:SetAmmo(nz.Config.BaseStartingAmmoAmount, weapons.Get(v2).Primary.Ammo) - end - for k,v in pairs(FAS2_Attachments) do - self.Player:FAS2_PickUpAttachment(v.key) - end -end - -function PLAYER:Spawn() - - //Get player number - for k,v in pairs(player.GetAll()) do - if v == self.Player then - //Set their position - if nz.Rounds.PlayerSpawns[1] != nil then - if #nz.Rounds.PlayerSpawns >= #player.GetAll() then - v:SetPos(nz.Rounds.PlayerSpawns[k] + Vector(0,0,20)) - else - print("Not enough player spawns! Not forcing player spawns.") - end - else - print("Not enough player spawns! Not forcing player spawns.") - end - end - end - -end - -function PLAYER:SetModel() - - local cl_playermodel = self.Player:GetInfo( "cl_playermodel" ) - - //Get player number - for k,v in pairs(player.GetAll()) do - if v == self.Player then - if nz.Config.PlayerModels[1] != nil then - if nz.Config.PlayerModelsSystem then - if nz.Config.PlayerModels[k] != nil then - cl_playermodel = nz.Config.PlayerModels[k] - else - //Fall back if there's not enough models - cl_playermodel = table.Random(nz.Config.PlayerModels) - end - end - end - end - end - - local modelname = player_manager.TranslatePlayerModel( cl_playermodel ) - util.PrecacheModel( modelname ) - self.Player:SetModel( modelname ) - -end - -player_manager.RegisterClass( "player_ingame", PLAYER, "player_default" ) \ No newline at end of file diff --git a/gamemode/player_class/sh_player_init.lua b/gamemode/player_class/sh_player_init.lua deleted file mode 100644 index 18962d35..00000000 --- a/gamemode/player_class/sh_player_init.lua +++ /dev/null @@ -1,21 +0,0 @@ -DEFINE_BASECLASS( "player_default" ) - -local PLAYER = {} - - -PLAYER.DisplayName = "Init Class" - -PLAYER.WalkSpeed = 200 -- How fast to move when not running -PLAYER.RunSpeed = 400 -- How fast to move when running - -function PLAYER:Loadout() - -end - -function PLAYER:Spawn() - //Determine if they should spectate - //Blah - print("Yay base class") -end - -player_manager.RegisterClass( "player_init", PLAYER, "player_default" ) diff --git a/gamemode/players/sh_perks.lua b/gamemode/players/sh_perks.lua deleted file mode 100644 index f9062694..00000000 --- a/gamemode/players/sh_perks.lua +++ /dev/null @@ -1,58 +0,0 @@ -// RAWR! -local playerMeta = FindMetaTable("Player") -if SERVER then - util.AddNetworkString("nz_Perks_Sync") - function playerMeta:SetPerk(id, img) - self.Perks = self.Perks or {} - self.Perks[id] = {material = img} - net.Start("nz_Perks_Sync") - net.WriteTable(self.Perks) - net.Send(self) - end - - function playerMeta:RemovePerk(id) - self.Perks[id] = {} - net.Start("nz_Perks_Sync") - net.WriteTable(self.Perks) - net.Send(self) - end - - function playerMeta:RemovePerks() - if (!self:GetPerks()) then return end - for id, data in pairs(self:GetPerks()) do - self.Perks[id] = nil - end - net.Start("nz_Perks_Sync") - net.WriteTable(self.Perks) - net.Send(self) - end - - hook.Add("PlayerDeath", "nz_Perks_Death", function(ply) - ply:RemovePerks() - end) -else - net.Receive("nz_Perks_Sync", function() - LocalPlayer().Perks = net.ReadTable() - end) -end - -function playerMeta:HasPerk(id) - if (self.Perks&&self.Perks[id]) then - return true - end - return false -end - -function playerMeta:GetPerk(id) - if (self.Perks&&self.Perks[id]) then - return self.Perks[id] - end - return false -end - -function playerMeta:GetPerks(id) - if (self.Perks) then - return self.Perks - end - return false -end \ No newline at end of file diff --git a/gamemode/players/sv_chatcommands.lua b/gamemode/players/sv_chatcommands.lua deleted file mode 100644 index 3e789760..00000000 --- a/gamemode/players/sv_chatcommands.lua +++ /dev/null @@ -1,84 +0,0 @@ -//Chat Commands -//Setup -nz.ChatCommands = {} - -function NewChatCommand(text, func) - table.insert(nz.ChatCommands, {text, func}) -end - -hook.Add( "PlayerSay", "chatCommand", function( ply, text, public ) - local text = string.lower(text) - for k,v in pairs(nz.ChatCommands) do - if (string.sub(text, 1, string.len(v[1])) == v[1]) then - v[2](ply, text) - return false - end - end -end ) - -// Actual Chat Commands - -NewChatCommand("/ready", function(ply, text) - PrintMessage( HUD_PRINTTALK, ply:Nick().." is ready!" ) - ply.Ready = 1 -end) - -NewChatCommand("/unready", function(ply, text) - PrintMessage( HUD_PRINTTALK, ply:Nick().." is no longer ready!" ) - ply.Ready = 0 -end) - -NewChatCommand("/create", function(ply, text) - if ply:IsSuperAdmin() then - nz.Rounds.Functions.CreateMode() - end -end) - -NewChatCommand("/generate", function(ply, text) - if ply:IsSuperAdmin() then - if #ents.FindByClass("info_player_start") > 0 then - navmesh.BeginGeneration( ) - else - ply:PrintMessage( HUD_PRINTTALK, "[NZ] There were no walkable seeds found. Please stand on the ground, and use /forcegenerate." ) - end - end -end) - -NewChatCommand("/save", function(ply, text) - if ply:IsSuperAdmin() then - if nz.Rounds.CurrentState == ROUND_CREATE then - nz.Mapping.Functions.SaveConfig() - else - ply:PrintMessage( HUD_PRINTTALK, "[NZ] You can't save outside of create mode." ) - end - end -end) - -NewChatCommand("/forcegenerate", function(ply, text) - if ply:IsSuperAdmin() then - local ent = ents.Create("info_player_start") - ent:SetPos(ply:GetPos()) - ent:Spawn() - navmesh.BeginGeneration( ) - end -end) - -NewChatCommand("/load", function(ply, text) - if ply:IsSuperAdmin() then - if nz.Rounds.CurrentState == ROUND_CREATE or nz.Rounds.CurrentState == ROUND_INIT then - nz.Interface.ReqMapConfig( ply ) - else - ply:PrintMessage( HUD_PRINTTALK, "[NZ] You can't load while playing!" ) - end - end -end) - -NewChatCommand("/config", function(ply, text) - if ply:IsSuperAdmin() then - if nz.Rounds.CurrentState == ROUND_CREATE or nz.Rounds.CurrentState == ROUND_INIT then - nz.Interface.ReqConfigChange( ply ) - else - ply:PrintMessage( HUD_PRINTTALK, "[NZ] You can't modify the config while in game." ) - end - end -end) diff --git a/gamemode/players/sv_players.lua b/gamemode/players/sv_players.lua deleted file mode 100644 index 1907f73b..00000000 --- a/gamemode/players/sv_players.lua +++ /dev/null @@ -1,65 +0,0 @@ -local META = FindMetaTable( "Player" ) - -local createWeps = { - "weapon_physgun", - "gmod_tool_wepbuy", - "gmod_tool_playerspawns", - "gmod_tool_zedspawns", - "gmod_tool_doors", - "gmod_tool_block", - "gmod_tool_elec", - "gmod_tool_randomboxspawns", - "gmod_tool_perkmachinespawns", - "gmod_tool_buyabledebris", - "gmod_tool_ee", -} - -function META:GiveCreateWeps() - for k,v in pairs(createWeps) do - self:Give(v) - end -end - -function META:StripCreateWeps() - for k,v in pairs(createWeps) do - self:StripWeapon(v) - end -end - -hook.Add("PlayerInitialSpawn", "nz_First_Spawn", function( ply ) - player_manager.SetPlayerClass( ply, "player_init" ) - nz.Rounds.Functions.SyncClients() - nz.Doors.Functions.SyncClients() -end) - - -function GM:OnReloaded( ) - //Reload the data from the entities back into the tables - //Door data - local doors = {} - for k,v in pairs(ents.GetAll()) do - if v:IsDoor() then - local data = v.Data - if data != nil then - if v:GetClass() != "wall_block_buy" then - //Regular Doors - local doorID = v:doorIndex() - nz.Doors.Functions.CreateLink(doorID, data) - else - //Buyable Blocks - nz.Doors.Functions.CreateLinkSpec(v, data) - end - end - end - end - nz.Rounds.Functions.SyncClients() - nz.Doors.Functions.SyncClients() -end - -//Friendly Fire -hook.Add("EntityTakeDamage", "nz_friendlyfire", function( target, dmginfo ) - if ( target:IsPlayer() and dmginfo:GetAttacker():IsPlayer() ) then - dmginfo:ScaleDamage( 0 ) - end - return dmginfo -end) \ No newline at end of file diff --git a/gamemode/players/sv_stamina.lua b/gamemode/players/sv_stamina.lua deleted file mode 100644 index 912cefb1..00000000 --- a/gamemode/players/sv_stamina.lua +++ /dev/null @@ -1 +0,0 @@ -// Placeholder \ No newline at end of file diff --git a/gamemode/powerups/cl_powerups.lua b/gamemode/powerups/cl_powerups.lua deleted file mode 100644 index bed0e274..00000000 --- a/gamemode/powerups/cl_powerups.lua +++ /dev/null @@ -1,14 +0,0 @@ -// RAWR! -local playSound = nil -net.Receive("nz_PowerUps_Sync", function() - local id = net.ReadString() - local data = net.ReadTable() - data.bool = tobool(data.bool) - nz.PowerUps.data[id] = data -end) - -net.Receive("nz_PowerUps_Sound", function() - local snd = net.ReadString() - playSound = CreateSound(LocalPlayer(), snd) - playSound:Play() -end) \ No newline at end of file diff --git a/gamemode/powerups/sh_powerups.lua b/gamemode/powerups/sh_powerups.lua deleted file mode 100644 index ea33cf52..00000000 --- a/gamemode/powerups/sh_powerups.lua +++ /dev/null @@ -1,71 +0,0 @@ -// RAWR! -nz.PowerUps.buffer = nz.PowerUps.buffer or {} -nz.PowerUps.data = nz.PowerUps.data or {} -if (SERVER) then - util.AddNetworkString("nz_PowerUps_Sync") - function nz.PowerUps.Set(id, bool, time) - local data = table.Copy(nz.PowerUps.Get(id) or {}) - data.id = id - data.bool = bool - data.time = time or data.time or -1 - nz.PowerUps.data[id] = data - net.Start("nz_PowerUps_Sync") - net.WriteString(id) - net.WriteTable(data) - net.Broadcast() - end -end - -function nz.PowerUps.Add(powerData) - powerData.snd = powerData.snd or false - powerData.effect = powerData.effect or {} - powerData.effect.time = powerData.effect.time or 0 - powerData.effect.material = powerData.effect.material or false - nz.PowerUps.buffer[powerData.id] = powerData - if (SERVER) and powerData.effect.time > 0 then - nz.PowerUps.Set(powerData.id, false, powerData.effect.time, powerData.name, powerData.effect.material) - end -end - -function nz.PowerUps.GetBufferAll() - return nz.PowerUps.buffer -end - -function nz.PowerUps.GetBuffer(id) - return nz.PowerUps.buffer[id] -end - -function nz.PowerUps.GetAll() - return nz.PowerUps.data -end - -function nz.PowerUps.Get(id) - return nz.PowerUps.data[id] -end - -nz.PowerUps.Add({ - id = "dp", - name = "Double Points", - model = "models/props_c17/gravestone003a.mdl", - scale = 0.5, - chance = 10, - effect = {time = 30}, - snd = {"mkservers/nz/powerups/dp.mp3", 0.5}, - func = (function(self, ply) - end), -}) -nz.PowerUps.Add({ - id = "maxammo", - name = "Max Ammo", - model = "models/Items/BoxSRounds.mdl", - scale = 1.5, - chance = 10, - snd = {"mkservers/nz/powerups/maxammo.mp3", 0.5}, - func = (function(self, ply) - for k,v in pairs(player.GetAll()) do - for k2,v2 in pairs(v:GetWeapons()) do - v:GiveAmmo(nz.Config.BaseStartingAmmoAmount, v2.Primary.Ammo) - end - end - end), -}) \ No newline at end of file diff --git a/gamemode/powerups/sv_powerups.lua b/gamemode/powerups/sv_powerups.lua deleted file mode 100644 index 2dd84751..00000000 --- a/gamemode/powerups/sv_powerups.lua +++ /dev/null @@ -1,34 +0,0 @@ -// RAWR! -function nz.PowerUps.Activate(id, ent, ply) - local powerData = nz.PowerUps.GetBuffer(id) - if (powerData.snd) then - nz.PowerUps.Sound(powerData.snd[1]) - end - if (nz.PowerUps.Get(id) != nil) then - if nz.PowerUps.Get(id).bool == false then - powerData.func(ent, ply) - nz.PowerUps.Set(id, true) - PrintMessage(HUD_PRINTTALK, "[NZ] "..powerData.name.." has begun!") - end - end - if (powerData.effect.time==0) then - powerData.func(ent, ply) - PrintMessage(HUD_PRINTTALK, "[NZ] "..powerData.name.."!") - elseif (powerData.time!=-1) then - if (timer.Exists(id)) then - timer.Destroy(id) - end - timer.Create(id, powerData.effect.time, 1, function() - nz.PowerUps.Set(id, false) - PrintMessage(HUD_PRINTTALK, "[NZ] "..powerData.name.." has ended!") - end) - end - ent:Remove() -end - -util.AddNetworkString("nz_PowerUps_Sound") -function nz.PowerUps.Sound(path) - net.Start("nz_PowerUps_Sound") - net.WriteString(path) - net.Broadcast() -end \ No newline at end of file diff --git a/gamemode/resources/sv_resources.lua b/gamemode/resources/sv_resources.lua deleted file mode 100644 index 2720e382..00000000 --- a/gamemode/resources/sv_resources.lua +++ /dev/null @@ -1,51 +0,0 @@ -//Downloads -resource.AddWorkshop("182104437") -resource.AddWorkshop("132835998") - -//Random Box -resource.AddFile( "models/toybox.mdl" ) -resource.AddFile( "materials/models/toybox/zombie_treasure_box_c.vmt" ) -resource.AddFile( "materials/models/toybox/zombie_treasure_box_c.vtf" ) -resource.AddFile( "materials/models/toybox/zombie_treasure_fill_c.vmt" ) -resource.AddFile( "materials/models/toybox/zombie_treasure_fill_c.vtf" ) -resource.AddFile( "materials/models/toybox/zombie_treasure_fill_c.vtf" ) - -//Fonts -resource.AddFile( "resource/fonts/BOYCOTT_.ttf" ) - -//Perkacola & PP -resource.AddFile( "models/perkacola/dtap.mdl" ) -resource.AddFile( "models/perkacola/jug.mdl" ) -resource.AddFile( "models/perkacola/packapunch.mdl" ) -resource.AddFile( "models/perkacola/revive.mdl" ) -resource.AddFile( "models/perkacola/sleight.mdl" ) -resource.AddFile( "materials/models/perkacola/pack_a_punch_c.vmt" ) -resource.AddFile( "materials/models/perkacola/pack_a_punch_c.vtf" ) -resource.AddFile( "materials/models/perkacola/pack_a_punch_moving_c.vmt" ) -resource.AddFile( "materials/models/perkacola/pack_a_punch_moving_c.vtf" ) -resource.AddFile( "materials/models/perkacola/pack_a_punch_moving_n.vtf" ) -resource.AddFile( "materials/models/perkacola/pack_a_punch_n.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_perkbottle_jugg_n.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_perkbottle_sleight_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_perkbottle_sleight_c.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_doubletap_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_doubletap_c.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_doubletap_n.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_jugg_col.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_jugg_col.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_jugg_norm.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_revive_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_revive_c.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_revive_n.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_revsign_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_revsign_c.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_revsign_n.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_c.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_gc.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_gc.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_logo_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_logo_c.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_sleight_n.vtf" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_vent_power_on_c.vmt" ) -resource.AddFile( "materials/models/perkacola/zombie_vending_vent_power_on_c.vtf" ) \ No newline at end of file diff --git a/gamemode/rounds/cl_round.lua b/gamemode/rounds/cl_round.lua deleted file mode 100644 index 8c0206ed..00000000 --- a/gamemode/rounds/cl_round.lua +++ /dev/null @@ -1,20 +0,0 @@ -//Defaults -nz.Rounds.CurrentState = ROUND_INIT -nz.Rounds.CurrentRound = 0 - -//Misc -nz.Rounds.Elec = false - -net.Receive( "nz_Round_Sync", function( length ) - print("Received Round Sync") - nz.Rounds.CurrentState = tonumber(net.ReadString()) - nz.Rounds.CurrentRound = tonumber(net.ReadString()) - if !(nz.Rounds.CurrentState == ROUND_PREP or nz.Rounds.CurrentState == ROUND_PROG) or (nz.Rounds.CurrentRound <= 1) then - nz.Rounds.Elec = false - end -end ) - -net.Receive( "nz_Elec_Sync", function( length ) - print("Received Elec Sync") - nz.Rounds.Elec = true -end ) \ No newline at end of file diff --git a/gamemode/rounds/sv_round.lua b/gamemode/rounds/sv_round.lua deleted file mode 100644 index 90e5979b..00000000 --- a/gamemode/rounds/sv_round.lua +++ /dev/null @@ -1,443 +0,0 @@ -//Main Tables -nz.Rounds.Functions = {} - -//Round Variables -nz.Rounds.CurrentState = ROUND_INIT -nz.Rounds.CurrentRound = 0 -nz.Rounds.CurrentZombies = 0 -nz.Rounds.ZombiesSpawned = 0 - -//Difficulty Curves -nz.Rounds.Curve = {} -nz.Rounds.Curve.SpawnRate = {} -nz.Rounds.Curve.Health = {} -nz.Rounds.Curve.Speed = {} - -//Misc -nz.Rounds.Elec = false -nz.Rounds.PlayerSpawns = {} -nz.Rounds.Effects = {} -nz.Rounds.EggCount = 0 - - -//Generate Curve -function nz.Rounds.Functions.GenerateCurve() - for i=1, 100 do - nz.Rounds.Curve.SpawnRate[i-1] = math.Round(nz.Config.BaseDifficultySpawnRateCurve*math.pow(i-1,nz.Config.DifficultySpawnRateCurve)) - nz.Rounds.Curve.Health[i-1] = math.Round(nz.Config.BaseDifficultyHealthCurve*math.pow(i-1,nz.Config.DifficultyHealthCurve)) - nz.Rounds.Curve.Speed[i-1] = math.Round(nz.Config.BaseDifficultySpeedCurve*math.pow(i-1,nz.Config.DifficultySpeedCurve)) - end -end - -function nz.Rounds.Functions.CheckPrerequisites() - - if #player.GetAll() >= 1 then - local count = 0 - for k,v in pairs(player.GetAll()) do - if v.Ready == 1 and v:IsValid() and v:Alive() then - count = count + 1 - end - end - if count / #player.GetAll() < nz.Config.ReadyupPerc then - return false - end - else - return false - end - //Check Player spawns - if #ents.FindByClass("player_spawns") == 0 then - for k,v in pairs(player.GetAll()) do - if v.Ready == 1 then - v.Ready = 0 - v:PrintMessage( HUD_PRINTTALK, "You have been set to un-ready since the map does have any player spawns placed." ) - end - end - return false - end - //Check Zombie Spawns - if #ents.FindByClass("zed_spawns") == 0 then - for k,v in pairs(player.GetAll()) do - if v.Ready == 1 then - v.Ready = 0 - v:PrintMessage( HUD_PRINTTALK, "You have been set to un-ready since the map does have any zombie spawns placed." ) - end - end - return false - end - //Check guns - for k2,v2 in pairs(nz.Config.BaseStartingWeapons) do - if !weapons.Get(v2) then - for k,v in pairs(player.GetAll()) do - if v.Ready == 1 then - v.Ready = 0 - v:PrintMessage( HUD_PRINTTALK, "You have been set to un-ready since the starting weapons have not been set or invalid." ) - end - end - return false - end - end - - return true -end - -//Client Side Syncing -util.AddNetworkString( "nz_Round_Sync" ) -util.AddNetworkString( "nz_Elec_Sync" ) - -hook.Add( "nz_elec_active", "activate_all_elec", function() - PrintMessage( HUD_PRINTTALK, "[NZ] Electricity is now on!" ) - nz.Rounds.Elec = true - nz.Rounds.Functions.SyncClients() - //Open all doors with no price and electricity requirement - for k,v in pairs(ents.GetAll()) do - if v:IsDoor() then - if v.price == 0 and v.elec == 1 then - v:DoorUnlock() - end - end - end -end ) - -function nz.Rounds.Functions.SyncClients() - net.Start( "nz_Round_Sync" ) - net.WriteString( nz.Rounds.CurrentState ) - net.WriteString( nz.Rounds.CurrentRound ) - net.Broadcast() - - if nz.Rounds.Elec then - net.Start( "nz_Elec_Sync" ) - net.Broadcast() - end -end - - -function nz.Rounds.Functions.PrepareRound() - nz.Rounds.CurrentState = ROUND_PREP - nz.Rounds.Functions.SyncClients() - nz.Rounds.CurrentRound = nz.Rounds.CurrentRound + 1 - nz.Rounds.CurrentZombies = nz.Rounds.Curve.SpawnRate[nz.Rounds.CurrentRound] - - timer.Simple(nz.Config.PrepareTime / 2, function() - //Remove All bodies - for k, v in pairs(ents.FindByClass("prop_ragdoll")) do - v:Remove() - end - end) - - PrintMessage( HUD_PRINTTALK, "ROUND: "..nz.Rounds.CurrentRound.." preparing" ) - hook.Run("nz_Round_Prep", nz.Rounds.CurrentRound) - //Spawn all dead players - if (!nz.Config.Hardcore) then - for k,v in pairs(player.GetAll()) do - if (nz.Config.AllowDropins) then - if (v:Team()!=TEAM_PLAYERS) then - player_manager.SetPlayerClass( v, "player_ingame" ) - end - end - if !(v:Alive()) then - v:Spawn() - end - end - end - - timer.Simple(nz.Config.PrepareTime, function() nz.Rounds.Functions.StartRound() end) - - local function checkVer() - http.Fetch( "https://raw.githubusercontent.com/Alig96/nzombies/master/version.txt", - function( body, len, headers, code ) - if tonumber(file.Read( "gamemodes/nzombies/version.txt", "GAME" )) < tonumber(body) then - print("Your version of nZombies is outdated. Please update via Github.") - end - end, - function( error ) - print("Version Check Failed!") - end - ) - end - checkVer() - -end - -function nz.Rounds.Functions.StartRound() - if nz.Rounds.CurrentState != ROUND_GO then - nz.Rounds.CurrentState = ROUND_PROG - nz.Rounds.Functions.SyncClients() - nz.Rounds.ZombiesSpawned = 0 - PrintMessage( HUD_PRINTTALK, "ROUND: "..nz.Rounds.CurrentRound.." started" ) - hook.Run("nz_Round_Start", nz.Rounds.CurrentRound) - end -end - -function nz.Rounds.Functions.ResetGame() - PrintMessage( HUD_PRINTTALK, "GAME READY!" ) - nz.Rounds.CurrentState = ROUND_INIT - nz.Rounds.Functions.SyncClients() - nz.Rounds.CurrentRound = 0 - nz.Rounds.CurrentZombies = 0 - nz.Rounds.ZombiesSpawned = 0 - nz.Rounds.Elec = false - - //Empty All the tables - table.Empty(nz.Rounds.PlayerSpawns) - //Reset all opened doors - table.Empty(nz.Doors.Data.OpenedLinks) - //Unlock all doors - for k,v in pairs(ents.GetAll()) do - if v:IsDoor() then - v:SetUseType( SIMPLE_USE ) - v:DoorUnlock() - v:SetKeyValue("wait",-1) - end - end - //Relock the buyable-blockers all doors - for k,v in pairs(ents.FindByClass("wall_block_buy")) do - v:DoorLock() - end - - //Replace with init player class - for k,v in pairs(player.GetAll()) do - player_manager.SetPlayerClass( v, "player_init" ) - v.Ready = 0 - v:SetPoints(0) - v:Spawn() - v:SendLua('RunConsoleCommand("stopsound")') - end - for k,v in pairs(nz.Config.ValidEnemies) do - for k2,v2 in pairs(ents.FindByClass(v)) do - v2:Remove() - end - end - //Reset easter eggs - for k,v in pairs(ents.FindByClass("easter_egg")) do - v.Used = false - end - nz.Rounds.EggCount = 0 - //Remove the random box - if #ents.FindByClass("random_box") > 0 then - for k,v in pairs(ents.FindByClass("random_box")) do - v:Remove() - end - end -end - -function nz.Rounds.Functions.EndRound() - if nz.Rounds.CurrentState != ROUND_GO then - nz.Rounds.CurrentState = ROUND_GO - nz.Rounds.Functions.SyncClients() - nz.Rounds.ZombiesSpawned = 0 - - PrintMessage( HUD_PRINTTALK, "GAME OVER!" ) - PrintMessage( HUD_PRINTTALK, "Restarting in 10 seconds!" ) - hook.Run("nz_Round_GO") - timer.Simple(10, function() - nz.Rounds.Functions.ResetGame() - end) - else - //This if statement is to prevent the game from ending twice if all players die during preparing - end -end - -function nz.Rounds.Functions.CreateMode() - if nz.Rounds.CurrentState == ROUND_INIT then - PrintMessage( HUD_PRINTTALK, "The mode has been set to creative mode!" ) - nz.Rounds.CurrentState = ROUND_CREATE - nz.Rounds.CurrentZombies = 0 - nz.Rounds.Functions.SyncClients() - elseif nz.Rounds.CurrentState == ROUND_CREATE then - PrintMessage( HUD_PRINTTALK, "The mode has been set to play mode!" ) - nz.Rounds.CurrentState = ROUND_INIT - nz.Rounds.CurrentZombies = 0 - for k,v in pairs(player.GetAll()) do - v:StripCreateWeps() - end - nz.Rounds.Functions.SyncClients() - else - return - end -end - -function nz.Rounds.Functions.SetupGame() - - //Create a list of all valid player spawns - for k,v in pairs(ents.FindByClass("player_spawns")) do - table.insert(nz.Rounds.PlayerSpawns, v:GetPos()) - end - //Set everyone's player class - for k,v in pairs(player.GetAll()) do - player_manager.SetPlayerClass( v, "player_ingame" ) - v:Spawn() - end - - //Spawn a random box - if #ents.FindByClass("random_box") == 0 and #ents.FindByClass("random_box_spawns") > 0 then - local rand = table.Random(ents.FindByClass("random_box_spawns")) - local box = ents.Create( "random_box" ) - box:SetPos( rand:GetPos() ) - box:SetAngles( rand:GetAngles() ) - box:Spawn() - box:SetSolid( SOLID_VPHYSICS ) - box:SetMoveType( MOVETYPE_NONE ) - box.BoxEnt = rand - end - - - - //Force all doors to lock and stay open when opened - for k,v in pairs(ents.GetAll()) do - if v:IsDoor() then - v:SetUseType( SIMPLE_USE ) - v:DoorLock() - v:SetKeyValue("wait",-1) - end - end - - //Open all doors with no price and electricity requirement - for k,v in pairs(ents.GetAll()) do - if v:IsDoor() then - if v.price == 0 and v.elec == 0 then - - v:DoorUnlock() - end - end - end - - //All doors with Link 0 (No Link) - nz.Doors.Data.OpenedLinks[0] = true - - timer.Simple(5, function() PrintMessage( HUD_PRINTTALK, "You are playing nZombies V2.0 BETA Revision "..file.Read( "gamemodes/nzombies/version.txt", "GAME" )) end) -end - -function nz.Rounds.Functions.RoundHandler() - if nz.Rounds.CurrentState == ROUND_INIT then - for k,v in pairs(player.GetAll()) do - if !(v:Alive()) then - v:Spawn() - end - end - if nz.Rounds.Functions.CheckPrerequisites() then - nz.Rounds.Functions.SetupGame() - nz.Rounds.Functions.PrepareRound() - else - return - end - - elseif nz.Rounds.CurrentState == ROUND_CREATE then - for k,v in pairs(player.GetAll()) do - if v.Ready == 1 then - v.Ready = 0 - v:PrintMessage( HUD_PRINTTALK, "You have been set to un-ready since the game has been set to creative mode" ) - //v:GiveCreateWeps() - end - if v:IsSuperAdmin() then - v:GiveCreateWeps() - end - end - return - end - - local function checkAlive() - //Check alive players! - for k,v in pairs(player.GetAll()) do - if v:Alive() then - return true - end - end - return false - end - - if !checkAlive() and (nz.Rounds.CurrentState == ROUND_PROG or nz.Rounds.CurrentState == ROUND_PREP) then - nz.Rounds.Functions.EndRound() - end - - //Check the NPCs on the map. - if nz.Rounds.CurrentZombies <= 0 and nz.Rounds.CurrentState == ROUND_PROG then - nz.Rounds.Functions.PrepareRound() - end -end - -function nz.Rounds.Functions.ZombieSpawner() - if nz.Rounds.ZombiesSpawned >= nz.Rounds.CurrentZombies or nz.Rounds.ZombiesSpawned >= 100 then - //Do nothing - else - if nz.Rounds.CurrentState == ROUND_PROG then - - local function CheckIfSuitable(pos) - local Ents = ents.FindInBox( pos + Vector( -16, -16, 0 ), pos + Vector( 16, 16, 64 ) ) - local Blockers = 0 - if Ents == nil then return true end - for k, v in pairs( Ents ) do - if ( IsValid( v ) and (v:GetClass() == "player" or table.HasValue(nz.Config.ValidEnemies, v:GetClass())) ) then - Blockers = Blockers + 1 - end - end - if Blockers == 0 then - return true - end - return false - end - - local valids = {} - //make a table of valid spawns - for k,v in pairs(ents.FindByClass("zed_spawns")) do - if nz.Doors.Data.OpenedLinks[tonumber(v.Link)] then - for k2,v2 in pairs(ents.FindInSphere(v:GetPos(), 1000)) do - if v2:IsPlayer() then - table.insert(valids, v:GetPos()) - break - end - end - end - end - if valids[1] == nil then - return - --Since we couldn't find a valid spawn, just back out for now. - end - local position = table.Random(valids) - if CheckIfSuitable(position) then - local typ = "nut_zombie" - - //Custom enemies - if nz.Config.UseCustomEnemies then - for i = nz.Rounds.CurrentRound, 0, -1 do - if nz.Config.EnemyTypes[i] != nil then - //http://snippets.luacode.org/snippets/Weighted_random_choice_104 - local function weighted_total(choices) - local total = 0 - for choice, weight in pairs(choices) do - total = total + weight - end - return total - end - local function weighted_random_choice( choices ) - local threshold = math.random(0, weighted_total(choices)) - local last_choice - for choice, weight in pairs(choices) do - threshold = threshold - weight - if threshold <= 0 then return choice end - last_choice = choice - end - return last_choice - end - - typ = weighted_random_choice(nz.Config.EnemyTypes[i]) - break - end - end - end - - local zombie = ents.Create(typ) - zombie:SetPos(position) - zombie:Spawn() - zombie:Activate() - nz.Rounds.ZombiesSpawned = nz.Rounds.ZombiesSpawned + 1 - end - end - end -end - - -timer.Simple(0, function() - nz.Rounds.Functions.GenerateCurve() - timer.Create("nz.Rounds.ZombieSpawner", 1, 0, nz.Rounds.Functions.ZombieSpawner) - timer.Create("nz.Rounds.handler", 1, 0, nz.Rounds.Functions.RoundHandler) -end) diff --git a/gamemode/spectate/sv_spectate.lua b/gamemode/spectate/sv_spectate.lua deleted file mode 100644 index 5198641c..00000000 --- a/gamemode/spectate/sv_spectate.lua +++ /dev/null @@ -1,31 +0,0 @@ -function GM:PlayerDeath( ply, wep, killer ) - - if ply:Team() != TEAM_SPECS then - ply:SetTeam(TEAM_SPECS) - end - - ply.SpecID = 1 - ply.SpecType = 5 - ply:Spectate( OBS_MODE_CHASE ) - ply:SpectateEntity( killer ) -end - -function GM:PlayerDeathThink( ply ) - local players = team.GetPlayers( TEAM_PLAYERS ) - - if ply:KeyPressed( IN_JUMP ) then - ply.SpecType = ply.SpecType + 1 - if ply.SpecType > 6 then ply.SpecType = 4 end - ply:Spectate( ply.SpecType ) - elseif ply:KeyPressed( IN_ATTACK ) then - if !ply.SpecID then ply.SpecID = 1 end - ply.SpecID = ply.SpecID + 1 - if ply.SpecID > #players then ply.SpecID = 1 end - ply:SpectateEntity( players[ ply.SpecID ] ) - elseif ply:KeyPressed( IN_ATTACK2 ) then - if !ply.SpecID then ply.SpecID = 1 end - ply.SpecID = ply.SpecID - 1 - if ply.SpecID <= 0 then ply.SpecID = #players end - ply:SpectateEntity( players[ ply.SpecID ] ) - end -end \ No newline at end of file diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vmt new file mode 100644 index 00000000..46c5d50d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap" + "$surfaceprop" "Metal" + "$nocull" 1 + "$alphatest" "1" +} diff --git a/content/materials/models/perkacola/zombie_vending_doubletap_c.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_doubletap_c.vtf rename to nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_off.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_off.vmt new file mode 100644 index 00000000..d7b852c4 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_on.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_on.vmt new file mode 100644 index 00000000..9d9bf454 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_on.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap" + "$selfillum" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_phong.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_phong.vtf new file mode 100644 index 00000000..df584bcd Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vmt new file mode 100644 index 00000000..79975557 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap_Price" + "$surfaceprop" "Metal" + "$nocull" 1 + "$alphatest" "1" +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vtf new file mode 100644 index 00000000..97c92093 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_off.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_off.vmt new file mode 100644 index 00000000..1812c8b8 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap_price" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_on.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_on.vmt new file mode 100644 index 00000000..018a5c64 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_on.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap_price" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/doubletap/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vmt new file mode 100644 index 00000000..689c9bd6 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap_SNN" + "$bumpmap" "models/alig96/perks/doubletap/Doubletap_SNN_NRM" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vtf new file mode 100644 index 00000000..b02a6418 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf new file mode 100644 index 00000000..58131b1f Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt new file mode 100644 index 00000000..3bfa4043 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap_SNN" + "$bumpmap" "models/alig96/perks/doubletap/Doubletap_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt new file mode 100644 index 00000000..06dc9265 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt @@ -0,0 +1,9 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Doubletap_SNN" + "$bumpmap" "models/alig96/perks/doubletap/Doubletap_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/doubletap/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf new file mode 100644 index 00000000..b60a6580 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vmt new file mode 100644 index 00000000..4636402a --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Power_Off" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vtf new file mode 100644 index 00000000..928366a9 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vmt b/nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vmt new file mode 100644 index 00000000..1f86c92a --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/doubletap/Power_On" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_vent_power_on_c.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_vent_power_on_c.vtf rename to nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/white.vtf b/nzombies3/content/materials/models/alig96/perks/doubletap/white.vtf new file mode 100644 index 00000000..b847bc06 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/doubletap/white.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg.vmt new file mode 100644 index 00000000..05cf4d3d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_jugg_col.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_jugg_col.vtf rename to nzombies3/content/materials/models/alig96/perks/jugg/jugg.vtf diff --git a/content/materials/models/perkacola/zombie_vending_jugg_norm.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_nrm.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_jugg_norm.vtf rename to nzombies3/content/materials/models/alig96/perks/jugg/jugg_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_off.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_off.vmt new file mode 100644 index 00000000..e102faa0 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_on.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_on.vmt new file mode 100644 index 00000000..5b4432df --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_on.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/jugg/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_phong.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_phong.vtf new file mode 100644 index 00000000..6040ca92 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vmt new file mode 100644 index 00000000..90ba080d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg_price" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vtf new file mode 100644 index 00000000..d7dccc16 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_off.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_off.vmt new file mode 100644 index 00000000..3c909a03 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg_price" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_on.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_on.vmt new file mode 100644 index 00000000..459806b0 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_on.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg_price" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/jugg/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vmt new file mode 100644 index 00000000..af30fafd --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg_SNN" + "$bumpmap" "models/alig96/perks/jugg/Jugg_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vtf new file mode 100644 index 00000000..590282f7 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf new file mode 100644 index 00000000..9bdc7695 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_off.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_off.vmt new file mode 100644 index 00000000..af30fafd --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_off.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg_SNN" + "$bumpmap" "models/alig96/perks/jugg/Jugg_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_on.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_on.vmt new file mode 100644 index 00000000..1bcf587f --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_on.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Jugg_SNN" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/jugg/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_phong.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_phong.vtf new file mode 100644 index 00000000..057c0c3a Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vmt new file mode 100644 index 00000000..fffd7927 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Power_Off" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vtf new file mode 100644 index 00000000..928366a9 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vmt b/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vmt new file mode 100644 index 00000000..14e2cd7d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/jugg/Power_On" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vtf new file mode 100644 index 00000000..5e05a60d Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/white.vtf b/nzombies3/content/materials/models/alig96/perks/jugg/white.vtf new file mode 100644 index 00000000..b847bc06 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/jugg/white.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt new file mode 100644 index 00000000..cc02989d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/packapunch/pack_a_punch_c" + "$normalmap" "models/alig96/perks/packapunch/pack_a_punch_c" + "$surfaceprop" "Metal" +} diff --git a/content/materials/models/perkacola/pack_a_punch_c.vtf b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vtf similarity index 100% rename from content/materials/models/perkacola/pack_a_punch_c.vtf rename to nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vmt b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vmt new file mode 100644 index 00000000..d2598bc8 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/packapunch/pack_a_punch_moving_c" + "$normalmap" "models/alig96/perks/packapunch/pack_a_punch_moving_n" + "$surfaceprop" "Metal" +} diff --git a/content/materials/models/perkacola/pack_a_punch_moving_c.vtf b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vtf similarity index 100% rename from content/materials/models/perkacola/pack_a_punch_moving_c.vtf rename to nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vtf diff --git a/content/materials/models/perkacola/pack_a_punch_moving_n.vtf b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_n.vtf similarity index 100% rename from content/materials/models/perkacola/pack_a_punch_moving_n.vtf rename to nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_n.vtf diff --git a/content/materials/models/perkacola/pack_a_punch_n.vtf b/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_n.vtf similarity index 100% rename from content/materials/models/perkacola/pack_a_punch_n.vtf rename to nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_n.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/readme.txt b/nzombies3/content/materials/models/alig96/perks/readme.txt new file mode 100644 index 00000000..c0801c50 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/readme.txt @@ -0,0 +1,3 @@ +Models by Beat the Zombie + +Recompiled by Alig96 so everything is in a nice folder. \ No newline at end of file diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_off.vmt b/nzombies3/content/materials/models/alig96/perks/revive/power_off.vmt new file mode 100644 index 00000000..32580cfe --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/power_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Power_Off" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_off.vtf b/nzombies3/content/materials/models/alig96/perks/revive/power_off.vtf new file mode 100644 index 00000000..928366a9 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/power_off.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_on.vmt b/nzombies3/content/materials/models/alig96/perks/revive/power_on.vmt new file mode 100644 index 00000000..237c3d1b --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/power_on.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Power_On" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_on.vtf b/nzombies3/content/materials/models/alig96/perks/revive/power_on.vtf new file mode 100644 index 00000000..5e05a60d Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/power_on.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive.vmt b/nzombies3/content/materials/models/alig96/perks/revive/revive.vmt new file mode 100644 index 00000000..45199a7a --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/revive.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Revive" + "$bumpmap" "models/alig96/perks/revive/Revive_NRM" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_revive_c.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_revive_c.vtf rename to nzombies3/content/materials/models/alig96/perks/revive/revive.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive_nrm.vtf new file mode 100644 index 00000000..e4d89d06 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revive_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_phong.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive_phong.vtf new file mode 100644 index 00000000..c3ab70c8 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revive_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vmt b/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vmt new file mode 100644 index 00000000..772b677b --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Revive_price" + "$bumpmap" "models/alig96/perks/revive/Revive_NRM" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vtf new file mode 100644 index 00000000..f88af4a6 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vmt b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vmt new file mode 100644 index 00000000..3e16f7be --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Revive_SNN" + "$bumpmap" "models/alig96/perks/revive/Revive_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vtf new file mode 100644 index 00000000..748f1b07 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_nrm.vtf new file mode 100644 index 00000000..e8b8a312 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_phong.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_phong.vtf new file mode 100644 index 00000000..c992333c Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign.vmt b/nzombies3/content/materials/models/alig96/perks/revive/revivesign.vmt new file mode 100644 index 00000000..b4ffa04d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/revivesign.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Revivesign" + "$bumpmap" "models/alig96/perks/revive/Revivesign_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_revsign_c.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revivesign.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_revsign_c.vtf rename to nzombies3/content/materials/models/alig96/perks/revive/revivesign.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_nrm.vtf new file mode 100644 index 00000000..94fac285 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_off.vmt b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_off.vmt new file mode 100644 index 00000000..b4ffa04d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_off.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Revivesign" + "$bumpmap" "models/alig96/perks/revive/Revivesign_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_on.vmt b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_on.vmt new file mode 100644 index 00000000..86e3c8e2 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_on.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/revive/Revivesign" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/revive/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_phong.vtf b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_phong.vtf new file mode 100644 index 00000000..8d8191ba Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/revivesign_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/revive/white.vtf b/nzombies3/content/materials/models/alig96/perks/revive/white.vtf new file mode 100644 index 00000000..b847bc06 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/revive/white.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vmt new file mode 100644 index 00000000..24091582 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vmt @@ -0,0 +1,15 @@ +"VertexLitGeneric" +{ + "$baseTexture" "models/alig96/perks/sleight/Perk_bottle_drips" + "$translucent" 1 + "$phong" "0" + "$phongexponent" "8" + "$phongboost" ".1" + "$phongfresnelranges" "[.3 1 8]" + "$halflambert" "1" + + // Rim lighting parameters + "$rimlight" "1" // To enable rim lighting (requires phong) + "$rimlightexponent" "4" // Exponent for phong component of rim lighting + "$rimlightboost" "1" // Boost for amb +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vtf new file mode 100644 index 00000000..20c4c1da Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vtf differ diff --git a/content/materials/models/perkacola/zombie_perkbottle_jugg_n.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_nrm.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_perkbottle_jugg_n.vtf rename to nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt new file mode 100644 index 00000000..3da10248 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt @@ -0,0 +1,14 @@ +"VertexLitGeneric" +{ + "$baseTexture" "models/alig96/perks/sleight/Perk_bottle_sleight" + "$phong" "1" + "$phongexponent" "8" + "$phongboost" ".1" + "$phongfresnelranges" "[.3 1 8]" + "$halflambert" "1" + + // Rim lighting parameters + "$rimlight" "1" // To enable rim lighting (requires phong) + "$rimlightexponent" "4" // Exponent for phong component of rim lighting + "$rimlightboost" "1" // Boost for amb +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf new file mode 100644 index 00000000..aa85979c Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vmt new file mode 100644 index 00000000..c4416641 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Power_Off" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vtf new file mode 100644 index 00000000..928366a9 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vmt new file mode 100644 index 00000000..8b4980bd --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Power_On" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vtf new file mode 100644 index 00000000..5e05a60d Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight.vmt new file mode 100644 index 00000000..63d30a69 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight" + "$bumpmap" "models/alig96/perks/sleight/Sleight_NRM" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_sleight_c.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_sleight_c.vtf rename to nzombies3/content/materials/models/alig96/perks/sleight/sleight.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_nrm.vtf new file mode 100644 index 00000000..e61f0aa8 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_off.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_off.vmt new file mode 100644 index 00000000..ab4a2482 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_off.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight" + "$bumpmap" "models/alig96/perks/sleight/Sleight_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_on.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_on.vmt new file mode 100644 index 00000000..09e6cd23 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_on.vmt @@ -0,0 +1,9 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight" + "$bumpmap" "models/alig96/perks/sleight/Sleight_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/sleight/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_phong.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_phong.vtf new file mode 100644 index 00000000..d5c865df Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vmt new file mode 100644 index 00000000..0d69c1f4 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight_Price" + "$bumpmap" "models/alig96/perks/sleight/Sleight_NRM" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vtf new file mode 100644 index 00000000..f0031236 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vmt new file mode 100644 index 00000000..1e478b2b --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight_SNN" + "$bumpmap" "models/alig96/perks/sleight/Sleight_SNN_NRM" + "$surfaceprop" "Metal" + "$alphatest" 1 + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vtf new file mode 100644 index 00000000..d8988dea Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf new file mode 100644 index 00000000..374ef888 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_off.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_off.vmt new file mode 100644 index 00000000..a8d6a821 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_off.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight_SNN" + "$bumpmap" "models/alig96/perks/sleight/Sleight_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_on.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_on.vmt new file mode 100644 index 00000000..507e29fa --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_on.vmt @@ -0,0 +1,9 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight_SNN" + "$bumpmap" "models/alig96/perks/sleight/Sleight_SNN_NRM" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/sleight/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_phong.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_phong.vtf new file mode 100644 index 00000000..fefce5fd Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_phong.vtf differ diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vmt new file mode 100644 index 00000000..367aa11d --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleight_window" + "$surfaceprop" "Glass" + "$nocull" 1 + "$translucent" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_sleight_gc.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_sleight_gc.vtf rename to nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vmt new file mode 100644 index 00000000..9dc3c0e5 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleightsign" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/content/materials/models/perkacola/zombie_vending_sleight_logo_c.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vtf similarity index 100% rename from content/materials/models/perkacola/zombie_vending_sleight_logo_c.vtf rename to nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_off.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_off.vmt new file mode 100644 index 00000000..9dc3c0e5 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleightsign" + "$surfaceprop" "Metal" + "$nocull" 1 +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_on.vmt b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_on.vmt new file mode 100644 index 00000000..96ddff78 --- /dev/null +++ b/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_on.vmt @@ -0,0 +1,8 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/alig96/perks/sleight/Sleightsign" + "$surfaceprop" "Metal" + "$nocull" 1 + "$selfillum" 1 + "$selfillummask" "models/alig96/perks/sleight/white" +} diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/white.vtf b/nzombies3/content/materials/models/alig96/perks/sleight/white.vtf new file mode 100644 index 00000000..b847bc06 Binary files /dev/null and b/nzombies3/content/materials/models/alig96/perks/sleight/white.vtf differ diff --git a/content/materials/models/toybox/zombie_treasure_box_c.vmt b/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt similarity index 55% rename from content/materials/models/toybox/zombie_treasure_box_c.vmt rename to nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt index b4790e5f..0abc0ee1 100644 --- a/content/materials/models/toybox/zombie_treasure_box_c.vmt +++ b/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt @@ -1,6 +1,6 @@ "VertexlitGeneric" { - "$basetexture" "models/toybox/zombie_treasure_box_c" + "$basetexture" "models/hoff/props/mysterybox/zombie_treasure_box_c" "$alphatest" "1" "$nocull" "1" } diff --git a/content/materials/models/toybox/zombie_treasure_box_c.vtf b/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vtf similarity index 100% rename from content/materials/models/toybox/zombie_treasure_box_c.vtf rename to nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vtf diff --git a/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vmt b/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vmt new file mode 100644 index 00000000..daa02667 --- /dev/null +++ b/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vmt @@ -0,0 +1,4 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/hoff/props/mysterybox/zombie_treasure_fill_c" +} diff --git a/content/materials/models/toybox/zombie_treasure_fill_c.vtf b/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vtf similarity index 100% rename from content/materials/models/toybox/zombie_treasure_fill_c.vtf rename to nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vtf diff --git a/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vmt b/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vmt new file mode 100644 index 00000000..4eabdaa7 --- /dev/null +++ b/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vmt @@ -0,0 +1,4 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/hoff/props/teddy_bear/zombie_teddybear_c" +} diff --git a/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf b/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf new file mode 100644 index 00000000..b95a2a61 Binary files /dev/null and b/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/art_facemap.vmt b/nzombies3/content/materials/models/zed/male/art_facemap.vmt new file mode 100644 index 00000000..0fc8b872 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/art_facemap.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/art_facemap" + "$Bumpmap" "models\Zombie_Classic/art_facemap_normal" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/art_facemap.vtf b/nzombies3/content/materials/models/zed/male/art_facemap.vtf new file mode 100644 index 00000000..ad25be31 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/art_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/art_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/art_facemap_normal.vtf new file mode 100644 index 00000000..8972f41f Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/art_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/blood_sheet.vmt b/nzombies3/content/materials/models/zed/male/blood_sheet.vmt new file mode 100644 index 00000000..a20c63e5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/blood_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/blood_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/blood_sheet.vtf b/nzombies3/content/materials/models/zed/male/blood_sheet.vtf new file mode 100644 index 00000000..b88b11c2 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/blood_sheet.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/citizen2_sheet.vmt b/nzombies3/content/materials/models/zed/male/citizen2_sheet.vmt new file mode 100644 index 00000000..97c02864 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/citizen2_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/citizen_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/citizen3_sheet.vmt b/nzombies3/content/materials/models/zed/male/citizen3_sheet.vmt new file mode 100644 index 00000000..97c02864 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/citizen3_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/citizen_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet.vmt b/nzombies3/content/materials/models/zed/male/citizen_sheet.vmt new file mode 100644 index 00000000..97c02864 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/citizen_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/citizen_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet.vtf b/nzombies3/content/materials/models/zed/male/citizen_sheet.vtf new file mode 100644 index 00000000..f92f0001 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/citizen_sheet.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet2.vmt b/nzombies3/content/materials/models/zed/male/citizen_sheet2.vmt new file mode 100644 index 00000000..71a9a383 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/citizen_sheet2.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/citizen_sheet2" + "$halflambert" 1 + +} diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet2.vtf b/nzombies3/content/materials/models/zed/male/citizen_sheet2.vtf new file mode 100644 index 00000000..d6d32980 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/citizen_sheet2.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet2_normal.vtf b/nzombies3/content/materials/models/zed/male/citizen_sheet2_normal.vtf new file mode 100644 index 00000000..b1eed595 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/citizen_sheet2_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet3.vmt b/nzombies3/content/materials/models/zed/male/citizen_sheet3.vmt new file mode 100644 index 00000000..ff69639d --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/citizen_sheet3.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/citizen_sheet3" + "$halflambert" 1 + +} diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet3.vtf b/nzombies3/content/materials/models/zed/male/citizen_sheet3.vtf new file mode 100644 index 00000000..bb9420d8 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/citizen_sheet3.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet_normal.vtf b/nzombies3/content/materials/models/zed/male/citizen_sheet_normal.vtf new file mode 100644 index 00000000..8706d940 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/citizen_sheet_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/corpse1.vmt b/nzombies3/content/materials/models/zed/male/corpse1.vmt new file mode 100644 index 00000000..120ec700 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/corpse1.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$baseTexture" "models/Zombie_Classic/corpse1" + "$model" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/corpse1.vtf b/nzombies3/content/materials/models/zed/male/corpse1.vtf new file mode 100644 index 00000000..58582bb7 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/corpse1.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vmt b/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vmt new file mode 100644 index 00000000..16e518a2 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vmt @@ -0,0 +1,6 @@ +"eyes" +{ + "$basetexture" "models/Zed/Male/dark_eyeball_l" + "$iris" "models/Zed/Male/pupil_l" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vtf b/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vtf new file mode 100644 index 00000000..1764f6ce Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vmt b/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vmt new file mode 100644 index 00000000..cdeb9165 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vmt @@ -0,0 +1,6 @@ +"eyes" +{ + "$basetexture" "models/Zed/Male/dark_eyeball_r" + "$iris" "models/Zed/Male/pupil_r" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vtf b/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vtf new file mode 100644 index 00000000..5f158985 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/erdim_cylmap.vmt b/nzombies3/content/materials/models/zed/male/erdim_cylmap.vmt new file mode 100644 index 00000000..90876cc1 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/erdim_cylmap.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/erdim_cylmap" + "$Bumpmap" "models\Zombie_Classic/erdim_cylmap_normal" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/erdim_cylmap.vtf b/nzombies3/content/materials/models/zed/male/erdim_cylmap.vtf new file mode 100644 index 00000000..a6397de5 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/erdim_cylmap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/erdim_cylmap_normal.vtf b/nzombies3/content/materials/models/zed/male/erdim_cylmap_normal.vtf new file mode 100644 index 00000000..e64cfb44 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/erdim_cylmap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/erdim_facemap.vmt b/nzombies3/content/materials/models/zed/male/erdim_facemap.vmt new file mode 100644 index 00000000..16fccf51 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/erdim_facemap.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/erdim_cylmap" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/eric_facemap.vmt b/nzombies3/content/materials/models/zed/male/eric_facemap.vmt new file mode 100644 index 00000000..5a6f0023 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/eric_facemap.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/eric_facemap" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/eric_facemap.vtf b/nzombies3/content/materials/models/zed/male/eric_facemap.vtf new file mode 100644 index 00000000..cbcfc641 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/eric_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/eric_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/eric_facemap_normal.vtf new file mode 100644 index 00000000..206c5405 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/eric_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/eyeball_l.vmt b/nzombies3/content/materials/models/zed/male/eyeball_l.vmt new file mode 100644 index 00000000..25ea99f8 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/eyeball_l.vmt @@ -0,0 +1,6 @@ +"eyes" +{ + "$basetexture" "models/Zed/Male/eyeball_l" + "$iris" "models/Zed/Male/pupil_l" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/eyeball_l.vtf b/nzombies3/content/materials/models/zed/male/eyeball_l.vtf new file mode 100644 index 00000000..8e571024 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/eyeball_l.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/eyeball_r.vmt b/nzombies3/content/materials/models/zed/male/eyeball_r.vmt new file mode 100644 index 00000000..bb0eb052 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/eyeball_r.vmt @@ -0,0 +1,6 @@ +"eyes" +{ + "$basetexture" "models/Zed/Male/eyeball_r" + "$iris" "models/Zed/Male/pupil_r" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/eyeball_r.vtf b/nzombies3/content/materials/models/zed/male/eyeball_r.vtf new file mode 100644 index 00000000..570c7d1c Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/eyeball_r.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/g1_01_sheet.vmt b/nzombies3/content/materials/models/zed/male/g1_01_sheet.vmt new file mode 100644 index 00000000..11a521cc --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g1_01_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/plaid_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g1_02_sheet.vmt b/nzombies3/content/materials/models/zed/male/g1_02_sheet.vmt new file mode 100644 index 00000000..65c06c9c --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g1_02_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/grey_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g1_03_sheet.vmt b/nzombies3/content/materials/models/zed/male/g1_03_sheet.vmt new file mode 100644 index 00000000..a20c63e5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g1_03_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/blood_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g1_04_sheet.vmt b/nzombies3/content/materials/models/zed/male/g1_04_sheet.vmt new file mode 100644 index 00000000..e5923156 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g1_04_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/service_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g1_05_sheet.vmt b/nzombies3/content/materials/models/zed/male/g1_05_sheet.vmt new file mode 100644 index 00000000..83dd7dd5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g1_05_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/jackson_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g2_01_sheet.vmt b/nzombies3/content/materials/models/zed/male/g2_01_sheet.vmt new file mode 100644 index 00000000..11a521cc --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g2_01_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/plaid_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g2_02_sheet.vmt b/nzombies3/content/materials/models/zed/male/g2_02_sheet.vmt new file mode 100644 index 00000000..65c06c9c --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g2_02_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/grey_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g2_03_sheet.vmt b/nzombies3/content/materials/models/zed/male/g2_03_sheet.vmt new file mode 100644 index 00000000..a20c63e5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g2_03_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/blood_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g2_04_sheet.vmt b/nzombies3/content/materials/models/zed/male/g2_04_sheet.vmt new file mode 100644 index 00000000..e5923156 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g2_04_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/service_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g2_05_sheet.vmt b/nzombies3/content/materials/models/zed/male/g2_05_sheet.vmt new file mode 100644 index 00000000..83dd7dd5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g2_05_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/jackson_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g3_01_sheet.vmt b/nzombies3/content/materials/models/zed/male/g3_01_sheet.vmt new file mode 100644 index 00000000..11a521cc --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g3_01_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/plaid_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g3_02_sheet.vmt b/nzombies3/content/materials/models/zed/male/g3_02_sheet.vmt new file mode 100644 index 00000000..65c06c9c --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g3_02_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/grey_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g3_03_sheet.vmt b/nzombies3/content/materials/models/zed/male/g3_03_sheet.vmt new file mode 100644 index 00000000..a20c63e5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g3_03_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/blood_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g3_04_sheet.vmt b/nzombies3/content/materials/models/zed/male/g3_04_sheet.vmt new file mode 100644 index 00000000..e5923156 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g3_04_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/service_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g3_05_sheet.vmt b/nzombies3/content/materials/models/zed/male/g3_05_sheet.vmt new file mode 100644 index 00000000..83dd7dd5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g3_05_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/jackson_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g4_01_sheet.vmt b/nzombies3/content/materials/models/zed/male/g4_01_sheet.vmt new file mode 100644 index 00000000..11a521cc --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g4_01_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/plaid_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g4_02_sheet.vmt b/nzombies3/content/materials/models/zed/male/g4_02_sheet.vmt new file mode 100644 index 00000000..65c06c9c --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g4_02_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/grey_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g4_03_sheet.vmt b/nzombies3/content/materials/models/zed/male/g4_03_sheet.vmt new file mode 100644 index 00000000..a20c63e5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g4_03_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/blood_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g4_04_sheet.vmt b/nzombies3/content/materials/models/zed/male/g4_04_sheet.vmt new file mode 100644 index 00000000..e5923156 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g4_04_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/service_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/g4_05_sheet.vmt b/nzombies3/content/materials/models/zed/male/g4_05_sheet.vmt new file mode 100644 index 00000000..83dd7dd5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/g4_05_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/jackson_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/glint.vmt b/nzombies3/content/materials/models/zed/male/glint.vmt new file mode 100644 index 00000000..9dd2d50e --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/glint.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + // Original shader: AddTexture + "$basetexture" "models/Zed/Male/glint" + "$additive" 1 + "$model" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/glint.vtf b/nzombies3/content/materials/models/zed/male/glint.vtf new file mode 100644 index 00000000..7d4a0ff6 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/glint.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/grey_sheet.vmt b/nzombies3/content/materials/models/zed/male/grey_sheet.vmt new file mode 100644 index 00000000..65c06c9c --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/grey_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/grey_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/grey_sheet.vtf b/nzombies3/content/materials/models/zed/male/grey_sheet.vtf new file mode 100644 index 00000000..69a621b4 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/grey_sheet.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/jackson_sheet.vmt b/nzombies3/content/materials/models/zed/male/jackson_sheet.vmt new file mode 100644 index 00000000..83dd7dd5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/jackson_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/jackson_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/jackson_sheet.vtf b/nzombies3/content/materials/models/zed/male/jackson_sheet.vtf new file mode 100644 index 00000000..de27faf7 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/jackson_sheet.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/joe_facemap.vmt b/nzombies3/content/materials/models/zed/male/joe_facemap.vmt new file mode 100644 index 00000000..80e15334 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/joe_facemap.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/joe_facemap" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/joe_facemap.vtf b/nzombies3/content/materials/models/zed/male/joe_facemap.vtf new file mode 100644 index 00000000..5c31cd96 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/joe_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/joe_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/joe_facemap_normal.vtf new file mode 100644 index 00000000..2e1b1839 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/joe_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/mike_facemap.vmt b/nzombies3/content/materials/models/zed/male/mike_facemap.vmt new file mode 100644 index 00000000..b67a27bd --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/mike_facemap.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/mike_facemap" + "$Bumpmap" "models\Zombie_Classic/mike_facemap_normal" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/mike_facemap.vtf b/nzombies3/content/materials/models/zed/male/mike_facemap.vtf new file mode 100644 index 00000000..f54636aa Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/mike_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/mike_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/mike_facemap_normal.vtf new file mode 100644 index 00000000..1a373b7d Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/mike_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/mouth.vmt b/nzombies3/content/materials/models/zed/male/mouth.vmt new file mode 100644 index 00000000..d0789af5 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/mouth.vmt @@ -0,0 +1,7 @@ +"Teeth" +{ + "$basetexture" "models/Zed/Male/mouth" + "$model" 1 + "$clientshader" "MouthShader" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/mouth.vtf b/nzombies3/content/materials/models/zed/male/mouth.vtf new file mode 100644 index 00000000..abe1c02b Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/mouth.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/plaid_sheet.vmt b/nzombies3/content/materials/models/zed/male/plaid_sheet.vmt new file mode 100644 index 00000000..11a521cc --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/plaid_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/plaid_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/plaid_sheet.vtf b/nzombies3/content/materials/models/zed/male/plaid_sheet.vtf new file mode 100644 index 00000000..21789e42 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/plaid_sheet.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/pupil_l.vmt b/nzombies3/content/materials/models/zed/male/pupil_l.vmt new file mode 100644 index 00000000..61dfe74b --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/pupil_l.vmt @@ -0,0 +1,4 @@ +"Eyeball" +{ + "$basetexture" "models/Zed/Male/pupil_l" +} diff --git a/nzombies3/content/materials/models/zed/male/pupil_l.vtf b/nzombies3/content/materials/models/zed/male/pupil_l.vtf new file mode 100644 index 00000000..481beab3 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/pupil_l.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/pupil_r.vmt b/nzombies3/content/materials/models/zed/male/pupil_r.vmt new file mode 100644 index 00000000..23fac5bc --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/pupil_r.vmt @@ -0,0 +1,4 @@ +"Eyeball" +{ + "$basetexture" "models/Zed/Male/pupil_r" +} diff --git a/nzombies3/content/materials/models/zed/male/pupil_r.vtf b/nzombies3/content/materials/models/zed/male/pupil_r.vtf new file mode 100644 index 00000000..3bdc93d5 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/pupil_r.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/sandro_facemap.vmt b/nzombies3/content/materials/models/zed/male/sandro_facemap.vmt new file mode 100644 index 00000000..bd3d3756 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/sandro_facemap.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/sandro_facemap" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/sandro_facemap.vtf b/nzombies3/content/materials/models/zed/male/sandro_facemap.vtf new file mode 100644 index 00000000..4e13337a Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/sandro_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/sandro_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/sandro_facemap_normal.vtf new file mode 100644 index 00000000..dfa6c600 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/sandro_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/service_sheet.vmt b/nzombies3/content/materials/models/zed/male/service_sheet.vmt new file mode 100644 index 00000000..e5923156 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/service_sheet.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/service_sheet" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/service_sheet.vtf b/nzombies3/content/materials/models/zed/male/service_sheet.vtf new file mode 100644 index 00000000..af96c062 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/service_sheet.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/ted_facemap.vmt b/nzombies3/content/materials/models/zed/male/ted_facemap.vmt new file mode 100644 index 00000000..8a093a84 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/ted_facemap.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/ted_facemap" + "$Bumpmap" "models\Zombie_Classic/ted_facemap_normal" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/ted_facemap.vtf b/nzombies3/content/materials/models/zed/male/ted_facemap.vtf new file mode 100644 index 00000000..f4c6f419 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/ted_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/ted_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/ted_facemap_normal.vtf new file mode 100644 index 00000000..c0f6bf2d Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/ted_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/van_facemap.vmt b/nzombies3/content/materials/models/zed/male/van_facemap.vmt new file mode 100644 index 00000000..5cf09f3b --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/van_facemap.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models\Zombie_Classic/van_facemap" + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/van_facemap.vtf b/nzombies3/content/materials/models/zed/male/van_facemap.vtf new file mode 100644 index 00000000..b1fcde85 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/van_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/van_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/van_facemap_normal.vtf new file mode 100644 index 00000000..c9584d98 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/van_facemap_normal.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/vance_facemap.vmt b/nzombies3/content/materials/models/zed/male/vance_facemap.vmt new file mode 100644 index 00000000..b88a5885 --- /dev/null +++ b/nzombies3/content/materials/models/zed/male/vance_facemap.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + // Original shader: VertexLitTexture + "$basetexture" "models/Zed/Male/vance_facemap" + "$envmapsphere" 1 + "$halflambert" 1 +} diff --git a/nzombies3/content/materials/models/zed/male/vance_facemap.vtf b/nzombies3/content/materials/models/zed/male/vance_facemap.vtf new file mode 100644 index 00000000..46913ec7 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/vance_facemap.vtf differ diff --git a/nzombies3/content/materials/models/zed/male/vance_facemap_normal.vtf b/nzombies3/content/materials/models/zed/male/vance_facemap_normal.vtf new file mode 100644 index 00000000..0c64c721 Binary files /dev/null and b/nzombies3/content/materials/models/zed/male/vance_facemap_normal.vtf differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx80.vtx b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx80.vtx new file mode 100644 index 00000000..f3697622 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx90.vtx b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx90.vtx new file mode 100644 index 00000000..aacc5cfd Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.mdl b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.mdl new file mode 100644 index 00000000..a39ba957 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.mdl differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.phy b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.phy new file mode 100644 index 00000000..7de8a3f9 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.phy differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.sw.vtx b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.sw.vtx new file mode 100644 index 00000000..25e70d79 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.vvd b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.vvd new file mode 100644 index 00000000..289234a4 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx80.vtx b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx80.vtx new file mode 100644 index 00000000..0e355863 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx90.vtx b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx90.vtx new file mode 100644 index 00000000..1ac2dbe3 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.mdl b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.mdl new file mode 100644 index 00000000..e422f075 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.mdl differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.phy b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.phy new file mode 100644 index 00000000..5f07ca04 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.phy differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.sw.vtx b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.sw.vtx new file mode 100644 index 00000000..65795395 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.vvd b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.vvd new file mode 100644 index 00000000..bf539637 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.vvd differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx80.vtx b/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx80.vtx new file mode 100644 index 00000000..f73b8f97 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx90.vtx b/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx90.vtx new file mode 100644 index 00000000..f2a532ea Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.mdl b/nzombies3/content/models/alig96/perks/jugg/jugg_off.mdl new file mode 100644 index 00000000..68a5a83c Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_off.mdl differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.phy b/nzombies3/content/models/alig96/perks/jugg/jugg_off.phy new file mode 100644 index 00000000..4ba6b4de Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_off.phy differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.sw.vtx b/nzombies3/content/models/alig96/perks/jugg/jugg_off.sw.vtx new file mode 100644 index 00000000..4302a580 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_off.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.vvd b/nzombies3/content/models/alig96/perks/jugg/jugg_off.vvd new file mode 100644 index 00000000..d0e83a42 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx80.vtx b/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx80.vtx new file mode 100644 index 00000000..aa1fd5c8 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx90.vtx b/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx90.vtx new file mode 100644 index 00000000..8bd2d513 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.mdl b/nzombies3/content/models/alig96/perks/jugg/jugg_on.mdl new file mode 100644 index 00000000..6c27c2e9 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_on.mdl differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.phy b/nzombies3/content/models/alig96/perks/jugg/jugg_on.phy new file mode 100644 index 00000000..a60fac5d Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_on.phy differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.sw.vtx b/nzombies3/content/models/alig96/perks/jugg/jugg_on.sw.vtx new file mode 100644 index 00000000..4f195087 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_on.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.vvd b/nzombies3/content/models/alig96/perks/jugg/jugg_on.vvd new file mode 100644 index 00000000..16edc3ab Binary files /dev/null and b/nzombies3/content/models/alig96/perks/jugg/jugg_on.vvd differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx80.vtx b/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx80.vtx new file mode 100644 index 00000000..bc55817b Binary files /dev/null and b/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx90.vtx b/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx90.vtx new file mode 100644 index 00000000..561382c3 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.mdl b/nzombies3/content/models/alig96/perks/packapunch/packapunch.mdl new file mode 100644 index 00000000..2237c182 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/packapunch/packapunch.mdl differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.phy b/nzombies3/content/models/alig96/perks/packapunch/packapunch.phy new file mode 100644 index 00000000..01884c68 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/packapunch/packapunch.phy differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.sw.vtx b/nzombies3/content/models/alig96/perks/packapunch/packapunch.sw.vtx new file mode 100644 index 00000000..107705a6 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/packapunch/packapunch.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.vvd b/nzombies3/content/models/alig96/perks/packapunch/packapunch.vvd new file mode 100644 index 00000000..f690c8d5 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/packapunch/packapunch.vvd differ diff --git a/nzombies3/content/models/alig96/perks/readme.txt b/nzombies3/content/models/alig96/perks/readme.txt new file mode 100644 index 00000000..c0801c50 --- /dev/null +++ b/nzombies3/content/models/alig96/perks/readme.txt @@ -0,0 +1,3 @@ +Models by Beat the Zombie + +Recompiled by Alig96 so everything is in a nice folder. \ No newline at end of file diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.dx80.vtx b/nzombies3/content/models/alig96/perks/revive/revive_off.dx80.vtx new file mode 100644 index 00000000..bcc55895 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_off.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.dx90.vtx b/nzombies3/content/models/alig96/perks/revive/revive_off.dx90.vtx new file mode 100644 index 00000000..30e9e56b Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_off.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.mdl b/nzombies3/content/models/alig96/perks/revive/revive_off.mdl new file mode 100644 index 00000000..c973d705 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_off.mdl differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.phy b/nzombies3/content/models/alig96/perks/revive/revive_off.phy new file mode 100644 index 00000000..5d5c2885 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_off.phy differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.sw.vtx b/nzombies3/content/models/alig96/perks/revive/revive_off.sw.vtx new file mode 100644 index 00000000..f3fd1b54 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_off.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.vvd b/nzombies3/content/models/alig96/perks/revive/revive_off.vvd new file mode 100644 index 00000000..e706a112 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.dx80.vtx b/nzombies3/content/models/alig96/perks/revive/revive_on.dx80.vtx new file mode 100644 index 00000000..0c4da67b Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_on.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.dx90.vtx b/nzombies3/content/models/alig96/perks/revive/revive_on.dx90.vtx new file mode 100644 index 00000000..38c425cb Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_on.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.mdl b/nzombies3/content/models/alig96/perks/revive/revive_on.mdl new file mode 100644 index 00000000..c6fa28e5 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_on.mdl differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.phy b/nzombies3/content/models/alig96/perks/revive/revive_on.phy new file mode 100644 index 00000000..a7bb97e4 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_on.phy differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.sw.vtx b/nzombies3/content/models/alig96/perks/revive/revive_on.sw.vtx new file mode 100644 index 00000000..05a15264 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_on.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.vvd b/nzombies3/content/models/alig96/perks/revive/revive_on.vvd new file mode 100644 index 00000000..b7610eba Binary files /dev/null and b/nzombies3/content/models/alig96/perks/revive/revive_on.vvd differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx80.vtx b/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx80.vtx new file mode 100644 index 00000000..d44ba040 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx90.vtx b/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx90.vtx new file mode 100644 index 00000000..715c4576 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.mdl b/nzombies3/content/models/alig96/perks/sleight/sleight_off.mdl new file mode 100644 index 00000000..893f8aa8 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_off.mdl differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.phy b/nzombies3/content/models/alig96/perks/sleight/sleight_off.phy new file mode 100644 index 00000000..b7ad8ce8 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_off.phy differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.sw.vtx b/nzombies3/content/models/alig96/perks/sleight/sleight_off.sw.vtx new file mode 100644 index 00000000..ebf421a7 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_off.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.vvd b/nzombies3/content/models/alig96/perks/sleight/sleight_off.vvd new file mode 100644 index 00000000..728ae443 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx80.vtx b/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx80.vtx new file mode 100644 index 00000000..5cc5d812 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx80.vtx differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx90.vtx b/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx90.vtx new file mode 100644 index 00000000..edf89fdd Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx90.vtx differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.mdl b/nzombies3/content/models/alig96/perks/sleight/sleight_on.mdl new file mode 100644 index 00000000..19aede86 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_on.mdl differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.phy b/nzombies3/content/models/alig96/perks/sleight/sleight_on.phy new file mode 100644 index 00000000..4258cdc5 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_on.phy differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.sw.vtx b/nzombies3/content/models/alig96/perks/sleight/sleight_on.sw.vtx new file mode 100644 index 00000000..39c1cf55 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_on.sw.vtx differ diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.vvd b/nzombies3/content/models/alig96/perks/sleight/sleight_on.vvd new file mode 100644 index 00000000..c66271e7 Binary files /dev/null and b/nzombies3/content/models/alig96/perks/sleight/sleight_on.vvd differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.dx80.vtx b/nzombies3/content/models/hoff/props/mysterybox/box.dx80.vtx new file mode 100644 index 00000000..4d6add08 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box.dx80.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.dx90.vtx b/nzombies3/content/models/hoff/props/mysterybox/box.dx90.vtx new file mode 100644 index 00000000..45415e70 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box.dx90.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.mdl b/nzombies3/content/models/hoff/props/mysterybox/box.mdl new file mode 100644 index 00000000..28167944 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box.mdl differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.phy b/nzombies3/content/models/hoff/props/mysterybox/box.phy new file mode 100644 index 00000000..e327f6c7 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box.phy differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.sw.vtx b/nzombies3/content/models/hoff/props/mysterybox/box.sw.vtx new file mode 100644 index 00000000..f71053f2 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box.sw.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.vvd b/nzombies3/content/models/hoff/props/mysterybox/box.vvd new file mode 100644 index 00000000..74b00c24 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box.vvd differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.dx80.vtx b/nzombies3/content/models/hoff/props/mysterybox/box1.dx80.vtx new file mode 100644 index 00000000..e6b22244 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box1.dx80.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.dx90.vtx b/nzombies3/content/models/hoff/props/mysterybox/box1.dx90.vtx new file mode 100644 index 00000000..94430cef Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box1.dx90.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.mdl b/nzombies3/content/models/hoff/props/mysterybox/box1.mdl new file mode 100644 index 00000000..c9332f0b Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box1.mdl differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.phy b/nzombies3/content/models/hoff/props/mysterybox/box1.phy new file mode 100644 index 00000000..3ee874d5 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box1.phy differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.sw.vtx b/nzombies3/content/models/hoff/props/mysterybox/box1.sw.vtx new file mode 100644 index 00000000..11945f88 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box1.sw.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.vvd b/nzombies3/content/models/hoff/props/mysterybox/box1.vvd new file mode 100644 index 00000000..d1734a9e Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box1.vvd differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.dx80.vtx b/nzombies3/content/models/hoff/props/mysterybox/box2.dx80.vtx new file mode 100644 index 00000000..f6ea7647 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box2.dx80.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.dx90.vtx b/nzombies3/content/models/hoff/props/mysterybox/box2.dx90.vtx new file mode 100644 index 00000000..c9a760b6 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box2.dx90.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.mdl b/nzombies3/content/models/hoff/props/mysterybox/box2.mdl new file mode 100644 index 00000000..c546884a Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box2.mdl differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.sw.vtx b/nzombies3/content/models/hoff/props/mysterybox/box2.sw.vtx new file mode 100644 index 00000000..8e90ef40 Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box2.sw.vtx differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.vvd b/nzombies3/content/models/hoff/props/mysterybox/box2.vvd new file mode 100644 index 00000000..82798e2c Binary files /dev/null and b/nzombies3/content/models/hoff/props/mysterybox/box2.vvd differ diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx80.vtx b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx80.vtx new file mode 100644 index 00000000..943068eb Binary files /dev/null and b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx80.vtx differ diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx90.vtx b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx90.vtx new file mode 100644 index 00000000..c7dc96ef Binary files /dev/null and b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx90.vtx differ diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.mdl b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.mdl new file mode 100644 index 00000000..f39bc5c2 Binary files /dev/null and b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.mdl differ diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.phy b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.phy new file mode 100644 index 00000000..1fa32c3b Binary files /dev/null and b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.phy differ diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.sw.vtx b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.sw.vtx new file mode 100644 index 00000000..2c66ca62 Binary files /dev/null and b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.sw.vtx differ diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.vvd b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.vvd new file mode 100644 index 00000000..b9e1d684 Binary files /dev/null and b/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.vvd differ diff --git a/nzombies3/content/models/zed/male_shared.mdl b/nzombies3/content/models/zed/male_shared.mdl new file mode 100644 index 00000000..3dacef39 Binary files /dev/null and b/nzombies3/content/models/zed/male_shared.mdl differ diff --git a/nzombies3/content/models/zed/malezed_04.dx80.vtx b/nzombies3/content/models/zed/malezed_04.dx80.vtx new file mode 100644 index 00000000..4286d81b Binary files /dev/null and b/nzombies3/content/models/zed/malezed_04.dx80.vtx differ diff --git a/nzombies3/content/models/zed/malezed_04.dx90.vtx b/nzombies3/content/models/zed/malezed_04.dx90.vtx new file mode 100644 index 00000000..602b05f8 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_04.dx90.vtx differ diff --git a/nzombies3/content/models/zed/malezed_04.mdl b/nzombies3/content/models/zed/malezed_04.mdl new file mode 100644 index 00000000..4cf04b03 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_04.mdl differ diff --git a/nzombies3/content/models/zed/malezed_04.phy b/nzombies3/content/models/zed/malezed_04.phy new file mode 100644 index 00000000..6837ae84 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_04.phy differ diff --git a/nzombies3/content/models/zed/malezed_04.sw.vtx b/nzombies3/content/models/zed/malezed_04.sw.vtx new file mode 100644 index 00000000..faa6237e Binary files /dev/null and b/nzombies3/content/models/zed/malezed_04.sw.vtx differ diff --git a/nzombies3/content/models/zed/malezed_04.vvd b/nzombies3/content/models/zed/malezed_04.vvd new file mode 100644 index 00000000..419ad42e Binary files /dev/null and b/nzombies3/content/models/zed/malezed_04.vvd differ diff --git a/nzombies3/content/models/zed/malezed_06.dx80.vtx b/nzombies3/content/models/zed/malezed_06.dx80.vtx new file mode 100644 index 00000000..48424622 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_06.dx80.vtx differ diff --git a/nzombies3/content/models/zed/malezed_06.dx90.vtx b/nzombies3/content/models/zed/malezed_06.dx90.vtx new file mode 100644 index 00000000..758e6fa7 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_06.dx90.vtx differ diff --git a/nzombies3/content/models/zed/malezed_06.mdl b/nzombies3/content/models/zed/malezed_06.mdl new file mode 100644 index 00000000..10196b8c Binary files /dev/null and b/nzombies3/content/models/zed/malezed_06.mdl differ diff --git a/nzombies3/content/models/zed/malezed_06.phy b/nzombies3/content/models/zed/malezed_06.phy new file mode 100644 index 00000000..e857d4e9 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_06.phy differ diff --git a/nzombies3/content/models/zed/malezed_06.sw.vtx b/nzombies3/content/models/zed/malezed_06.sw.vtx new file mode 100644 index 00000000..b59eb20f Binary files /dev/null and b/nzombies3/content/models/zed/malezed_06.sw.vtx differ diff --git a/nzombies3/content/models/zed/malezed_06.vvd b/nzombies3/content/models/zed/malezed_06.vvd new file mode 100644 index 00000000..452e5c10 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_06.vvd differ diff --git a/nzombies3/content/models/zed/malezed_08.dx80.vtx b/nzombies3/content/models/zed/malezed_08.dx80.vtx new file mode 100644 index 00000000..045dc1fe Binary files /dev/null and b/nzombies3/content/models/zed/malezed_08.dx80.vtx differ diff --git a/nzombies3/content/models/zed/malezed_08.dx90.vtx b/nzombies3/content/models/zed/malezed_08.dx90.vtx new file mode 100644 index 00000000..06984c79 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_08.dx90.vtx differ diff --git a/nzombies3/content/models/zed/malezed_08.mdl b/nzombies3/content/models/zed/malezed_08.mdl new file mode 100644 index 00000000..a1bca030 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_08.mdl differ diff --git a/nzombies3/content/models/zed/malezed_08.phy b/nzombies3/content/models/zed/malezed_08.phy new file mode 100644 index 00000000..99f6e054 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_08.phy differ diff --git a/nzombies3/content/models/zed/malezed_08.sw.vtx b/nzombies3/content/models/zed/malezed_08.sw.vtx new file mode 100644 index 00000000..f83c17c0 Binary files /dev/null and b/nzombies3/content/models/zed/malezed_08.sw.vtx differ diff --git a/nzombies3/content/models/zed/malezed_08.vvd b/nzombies3/content/models/zed/malezed_08.vvd new file mode 100644 index 00000000..8ba3f68d Binary files /dev/null and b/nzombies3/content/models/zed/malezed_08.vvd differ diff --git a/nzombies3/content/resource/fonts/DK Umbilical Noose.ttf b/nzombies3/content/resource/fonts/DK Umbilical Noose.ttf new file mode 100644 index 00000000..10e5362b Binary files /dev/null and b/nzombies3/content/resource/fonts/DK Umbilical Noose.ttf differ diff --git a/nzombies3/content/sound/nz/powerups/double_points.mp3 b/nzombies3/content/sound/nz/powerups/double_points.mp3 new file mode 100644 index 00000000..89d58487 Binary files /dev/null and b/nzombies3/content/sound/nz/powerups/double_points.mp3 differ diff --git a/nzombies3/content/sound/nz/powerups/insta_kill.mp3 b/nzombies3/content/sound/nz/powerups/insta_kill.mp3 new file mode 100644 index 00000000..1f7ecb20 Binary files /dev/null and b/nzombies3/content/sound/nz/powerups/insta_kill.mp3 differ diff --git a/nzombies3/content/sound/nz/powerups/max_ammo.mp3 b/nzombies3/content/sound/nz/powerups/max_ammo.mp3 new file mode 100644 index 00000000..0c375015 Binary files /dev/null and b/nzombies3/content/sound/nz/powerups/max_ammo.mp3 differ diff --git a/nzombies3/content/sound/nz/powerups/nuke.mp3 b/nzombies3/content/sound/nz/powerups/nuke.mp3 new file mode 100644 index 00000000..2e184065 Binary files /dev/null and b/nzombies3/content/sound/nz/powerups/nuke.mp3 differ diff --git a/nzombies3/content/sound/nz/round/game_over_4.mp3 b/nzombies3/content/sound/nz/round/game_over_4.mp3 new file mode 100644 index 00000000..5299d9be Binary files /dev/null and b/nzombies3/content/sound/nz/round/game_over_4.mp3 differ diff --git a/nzombies3/content/sound/nz/round/round_end.mp3 b/nzombies3/content/sound/nz/round/round_end.mp3 new file mode 100644 index 00000000..d92a113f Binary files /dev/null and b/nzombies3/content/sound/nz/round/round_end.mp3 differ diff --git a/nzombies3/content/sound/nz/round/round_start.mp3 b/nzombies3/content/sound/nz/round/round_start.mp3 new file mode 100644 index 00000000..1a71306c Binary files /dev/null and b/nzombies3/content/sound/nz/round/round_start.mp3 differ diff --git a/nzombies3/entities/entities/breakable_entry/shared.lua b/nzombies3/entities/entities/breakable_entry/shared.lua new file mode 100644 index 00000000..a8d700be --- /dev/null +++ b/nzombies3/entities/entities/breakable_entry/shared.lua @@ -0,0 +1,110 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "breakable_entry" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" +//models/props_interiors/elevatorshaft_door01a.mdl +//models/props_debris/wood_board02a.mdl +function ENT:Initialize() + + self:SetModel("models/props_c17/fence01b.mdl") + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + + self:SetHealth(0) + self:SetCustomCollisionCheck(true) + self.NextPlank = CurTime() + + self.Planks = {} + + if SERVER then + self:ResetPlanks() + end +end + +function ENT:AddPlank() + self:SpawnPlank() + self:SetHealth(self:Health()+10) + print("Health: " .. self:Health()) +end + +function ENT:RemovePlank() + + local plank = table.Random(self.Planks) + if plank != nil then + table.RemoveByValue(self.Planks, plank) + self:SetHealth(self:Health()-10) + + //Drop off + plank:SetParent(nil) + plank:PhysicsInit(SOLID_VPHYSICS) + local entphys = plank:GetPhysicsObject() + if entphys:IsValid() then + entphys:EnableGravity(true) + entphys:Wake() + end + plank:SetCollisionGroup( COLLISION_GROUP_DEBRIS ) + //Remove + timer.Simple(2, function() plank:Remove() end) + end +end + +function ENT:ResetPlanks() + for i=1, nz.Config.MaxPlanks do + self:RemovePlank() + end + for i=1, nz.Config.MaxPlanks do + self:AddPlank() + end +end + +function ENT:Use( activator, caller ) + if CurTime() > self.NextPlank then + if self:Health() < nz.Config.MaxPlanks * 10 then + self:AddPlank() + activator:GivePoints(10) + self.NextPlank = CurTime() + 1 + end + end +end + +function ENT:SpawnPlank() + //Spawn + local angs = {-60,-70,60,70} + local plank = ents.Create("breakable_entry_plank") + plank:SetPos( self:GetPos()+Vector(0,0, math.random( -45, 45 )) ) + plank:SetAngles( Angle(0,self:GetAngles().y, table.Random(angs)) ) + plank:Spawn() + plank:SetParent(self) + plank:SetCollisionGroup( COLLISION_GROUP_DEBRIS ) + table.insert(self.Planks, plank) +end + +hook.Add("ShouldCollide", "zCollisionHook", function(ent1, ent2) + if ent1:GetClass() == "breakable_entry" and ent2:GetClass() == "nut_zombie" then + if ent1:IsValid() and ent1:Health() == 0 then + ent1:SetSolid(SOLID_NONE) + timer.Simple(0.1, function() if ent1:IsValid() then ent1:SetSolid(SOLID_VPHYSICS) end end) + end + return false + end + if ent2:GetClass() == "breakable_entry" and ent1:GetClass() == "nut_zombie" then + if ent2:IsValid() and ent2:Health() == 0 then + ent2:SetSolid(SOLID_NONE) + timer.Simple(0.1, function() if ent2:IsValid() then ent2:SetSolid(SOLID_VPHYSICS) end end) + end + return false + end +end) + +if CLIENT then + function ENT:Draw() + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + self:DrawModel() + end + end +end diff --git a/nzombies3/entities/entities/breakable_entry_plank/shared.lua b/nzombies3/entities/entities/breakable_entry_plank/shared.lua new file mode 100644 index 00000000..4db68eee --- /dev/null +++ b/nzombies3/entities/entities/breakable_entry_plank/shared.lua @@ -0,0 +1,26 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "breakable_entry_plank" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" +//models/props_interiors/elevatorshaft_door01a.mdl +//models/props_debris/wood_board02a.mdl +function ENT:Initialize() + + self:SetModel("models/props_debris/wood_board02a.mdl") + self:SetMoveType( MOVETYPE_VPHYSICS ) + self:SetSolid( SOLID_VPHYSICS ) + +end + +if CLIENT then + function ENT:Draw() + //if nz.Rounds.Data.CurrentState == ROUND_CREATE then + self:DrawModel() + // end + end +end \ No newline at end of file diff --git a/entities/entities/button_elec/shared.lua b/nzombies3/entities/entities/button_elec/shared.lua similarity index 51% rename from entities/entities/button_elec/shared.lua rename to nzombies3/entities/entities/button_elec/shared.lua index 13201fbf..bef56b5a 100644 --- a/entities/entities/button_elec/shared.lua +++ b/nzombies3/entities/entities/button_elec/shared.lua @@ -8,6 +8,11 @@ ENT.Contact = "Don't" ENT.Purpose = "" ENT.Instructions = "" +function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "Switch" ) + +end function ENT:Initialize() if SERVER then @@ -15,7 +20,7 @@ function ENT:Initialize() self:SetSolid( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_NONE ) self:SetUseType( ONOFF_USE ) - //self.On = false + self:SetSwitch(false) else self.PosePosition = 0 end @@ -24,33 +29,27 @@ end function ENT:Use( activator ) if ( !activator:IsPlayer() ) then return end - if !nz.Rounds.Elec and (nz.Rounds.CurrentState == ROUND_PREP or nz.Rounds.CurrentState == ROUND_PROG) then - //self.On = true - hook.Call( "nz_elec_active" ) + if !IsElec() and (nz.Rounds.Data.CurrentState == ROUND_PREP or nz.Rounds.Data.CurrentState == ROUND_PROG) then + self:SetSwitch(true) + nz.Elec.Functions.Activate() end end - function ENT:Think() - if SERVER then - --print(self.On) - else - //self:UpdateLever() - end - end + if CLIENT then - -- function ENT:UpdateLever() + function ENT:Think() - -- local TargetPos = 0.0; + local TargetPos = 0.0; - -- if ( self.On ) then TargetPos = 1.0; end + if ( self:GetSwitch() ) then TargetPos = 1.0; end - -- self.PosePosition = math.Approach( self.PosePosition, TargetPos, FrameTime() * 5.0 ) + self.PosePosition = math.Approach( self.PosePosition, TargetPos, FrameTime() * 5.0 ) - -- self:SetPoseParameter( "switch", self.PosePosition ) - -- self:InvalidateBoneCache() + self:SetPoseParameter( "switch", self.PosePosition ) + self:InvalidateBoneCache() - -- end + end function ENT:Draw() self:DrawModel() diff --git a/entities/entities/drop_powerups/shared.lua b/nzombies3/entities/entities/drop_powerup/shared.lua similarity index 79% rename from entities/entities/drop_powerups/shared.lua rename to nzombies3/entities/entities/drop_powerup/shared.lua index 7eb93f8d..85146962 100644 --- a/entities/entities/drop_powerups/shared.lua +++ b/nzombies3/entities/entities/drop_powerup/shared.lua @@ -8,9 +8,17 @@ ENT.Contact = "Don't" ENT.Purpose = "" ENT.Instructions = "" +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "PowerUp" ) + +end + function ENT:Initialize() - self.Buff = self.Buff or "dp" - self:SetModelScale(nz.PowerUps.GetBuffer(self.Buff).scale, 0) + + //self:SetPowerUp("dp") + self:SetModelScale(nz.PowerUps.Functions.Get(self:GetPowerUp()).scale, 0) + self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_NONE) self:SetSolid(SOLID_VPHYSICS) @@ -36,10 +44,11 @@ function ENT:Initialize() end) end -if SERVER then +if SERVER then function ENT:StartTouch(hitEnt) if (hitEnt:IsValid() and hitEnt:IsPlayer()) then - nz.PowerUps.Activate(self.Buff, self, hitEnt) + nz.PowerUps.Functions.Activate(self:GetPowerUp(), hitEnt) + self:Remove() end end end @@ -66,6 +75,6 @@ if CLIENT then self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z +1*var)) end hook.Add( "PreDrawHalos", "drop_powerups_halos", function() - halo.Add( ents.FindByClass( "drop_powerups" ), Color( 0, 255, 0 ), 2, 2, 2 ) + halo.Add( ents.FindByClass( "drop_powerup" ), Color( 0, 255, 0 ), 2, 2, 2 ) end ) end \ No newline at end of file diff --git a/entities/entities/easter_egg/shared.lua b/nzombies3/entities/entities/easter_egg/shared.lua similarity index 60% rename from entities/entities/easter_egg/shared.lua rename to nzombies3/entities/entities/easter_egg/shared.lua index 753b7b78..11986b4e 100644 --- a/entities/entities/easter_egg/shared.lua +++ b/nzombies3/entities/entities/easter_egg/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - + ENT.PrintName = "easter_egg" ENT.Author = "Alig96" ENT.Contact = "Don't" @@ -22,15 +22,10 @@ function ENT:Initialize() self:SetUseType(SIMPLE_USE) end end - + function ENT:Use( activator, caller ) - if !self.Used and (nz.Rounds.CurrentState == ROUND_PROG or nz.Rounds.CurrentState == ROUND_PREP) then - self.Used = true - self:EmitSound("WeaponDissolve.Dissolve", 100, 100) - nz.Rounds.EggCount = nz.Rounds.EggCount + 1 - if nz.Rounds.EggCount == #ents.FindByClass("easter_egg") then - hook.Call( "nzombies_ee_active" ) - end + if !self.Used and nz.Rounds.Functions.IsInGame() then + nz.EE.Functions.ActivateEgg( self ) end end diff --git a/entities/entities/nut_zombie.lua b/nzombies3/entities/entities/nut_zombie.lua similarity index 85% rename from entities/entities/nut_zombie.lua rename to nzombies3/entities/entities/nut_zombie.lua index 4eac4d8d..904ffba7 100644 --- a/entities/entities/nut_zombie.lua +++ b/nzombies3/entities/entities/nut_zombie.lua @@ -19,7 +19,7 @@ function ENT:Initialize() self.breathing:ChangeVolume(0.1, 0) self.loco:SetDeathDropHeight(700) if SERVER then - self:SetHealth(nz.Rounds.Curve.Health[nz.Rounds.CurrentRound]) + self:SetHealth(nz.Curves.Data.Health[nz.Rounds.Data.CurrentRound]) end self:SetCollisionBounds(Vector(-12,-12, 0), Vector(12, 12, 64)) self:SetSkin(math.random(0, self:SkinCount() - 1)) @@ -42,9 +42,9 @@ end function ENT:GetPriorityEnemy() local pos = self:GetPos() - + local min_dist, closest_target = -1, nil - + for _, target in pairs(player.GetAll()) do if (IsValid(target)&&target:Alive()&&target:GetMoveType()==MOVETYPE_WALK) then local dist = target:NearestPoint(pos):Distance(pos) @@ -54,7 +54,7 @@ function ENT:GetPriorityEnemy() end end end - + return closest_target end @@ -71,6 +71,21 @@ function ENT:RunBehaviour() data.maxs = self:OBBMaxs() * 0.65 local trace = util.TraceHull(data) local entity = trace.Entity + + //Barricades + if (IsValid(entity) and entity:GetClass() == "breakable_entry" ) then + if entity:Health() != 0 then + timer.Simple(0.3, function() + + entity:EmitSound("physics/wood/wood_plank_break"..math.random(1, 4)..".wav", 100, math.random(90, 130)) + + entity:RemovePlank() + + end) + + self:PlaySequenceAndWait("swing", 1) + end + end end if (IsValid(target) and target:Alive() ) then --and self:GetRangeTo(target) <= 1500 @@ -109,7 +124,7 @@ function ENT:RunBehaviour() self:PlaySequenceAndWait("swing", 1) else - if nz.Rounds.Curve.Speed[nz.Rounds.CurrentRound] >= 160 then + if nz.Curves.Data.Speed[nz.Rounds.Data.CurrentRound] >= 160 then self:StartActivity(ACT_RUN) else self:StartActivity(ACT_WALK) @@ -124,7 +139,7 @@ function ENT:RunBehaviour() self.nextYell = CurTime() + math.random(4, 8) end - self.loco:SetDesiredSpeed(nz.Rounds.Curve.Speed[nz.Rounds.CurrentRound]) + self.loco:SetDesiredSpeed(nz.Curves.Data.Speed[nz.Rounds.Data.CurrentRound]) self:MoveToPos(target:GetPos(), { maxage = 0.67 }) @@ -222,12 +237,12 @@ function ENT:OnKilled(damageInfo) end end end - + self:EmitSound(table.Random(deathSounds), 50, math.random(75, 130)) self:BecomeRagdoll(damageInfo) - - OnEnemyKilled( self, attacker) - + + nz.Enemies.Functions.OnEnemyKilled( self, attacker ) + end local painSounds = { @@ -245,15 +260,19 @@ function ENT:OnInjured(damageInfo) local range = self:GetRangeTo(attacker) //Deal an double damage if headshot if hitgroup == HITGROUP_HEAD then - local headshot = DamageInfo() - headshot:SetDamage(damageInfo:GetDamage( )) - headshot:SetAttacker(attacker) - self:TakePhysicsDamage( headshot ) - print("Headshot! ", damageInfo:GetDamage( )) + if self:IsValid() and damageInfo:GetDamageType() != DMG_BLAST_SURFACE then + local headshot = DamageInfo() + headshot:SetDamage(damageInfo:GetDamage( )) + headshot:SetAttacker(attacker) + headshot:SetDamageType(DMG_BLAST_SURFACE) + print("Headshot! ", headshot:GetDamage( )) + //Delay so it doesn't "die" twice + timer.Simple(0.1, function() if self:IsValid() then self:TakeDamageInfo( headshot ) end end) + end end self:EmitSound(table.Random(painSounds), 50, math.random(50, 130)) self.target = attacker self:AlertNearby(attacker, 1000) - - OnEnemyHurt( self, attacker, hitgroup ) + + nz.Enemies.Functions.OnEnemyHurt( self, attacker, hitgroup ) end diff --git a/entities/entities/nut_ex_zombie.lua b/nzombies3/entities/entities/nut_zombie_ex.lua similarity index 79% rename from entities/entities/nut_ex_zombie.lua rename to nzombies3/entities/entities/nut_zombie_ex.lua index 168f1a02..58914475 100644 --- a/entities/entities/nut_ex_zombie.lua +++ b/nzombies3/entities/entities/nut_zombie_ex.lua @@ -13,14 +13,13 @@ end function ENT:Initialize() self:SetModel("models/zed/malezed_0"..(math.random(2, 4) * 2)..".mdl") - self:SetModelScale( 1.25, 0 ) self.breathing = CreateSound(self, "npc/zombie_poison/pz_breathe_loop1.wav") self.breathing:Play() self.breathing:ChangePitch(60, 0) self.breathing:ChangeVolume(0.1, 0) self.loco:SetDeathDropHeight(700) if SERVER then - self:SetHealth(nz.Rounds.Curve.Health[nz.Rounds.CurrentRound]) + self:SetHealth(nz.Curves.Data.Health[nz.Rounds.Data.CurrentRound]) end self:SetCollisionBounds(Vector(-12,-12, 0), Vector(12, 12, 64)) self:SetSkin(math.random(0, self:SkinCount() - 1)) @@ -33,17 +32,17 @@ function ENT:Initialize() end) //Lets show we're special by setting ourselves on fire local fire = ents.Create("env_fire") - if IsValid(fire) then + if IsValid(fire) then fire:SetParent(self, 2) fire:SetOwner(self) - fire:SetPos(self:GetPos()) + fire:SetPos(self:GetPos()-Vector(0,0,-50)) --no glow + delete when out + start on + last forever fire:SetKeyValue("spawnflags", tostring(128 + 32 + 4 + 2 + 1)) fire:SetKeyValue("firesize", (1 * math.Rand(0.7, 1.1))) fire:SetKeyValue("fireattack", 0) fire:SetKeyValue("health", 0) fire:SetKeyValue("damagescale", "-10") -- only neg. value prevents dmg - + fire:Spawn() fire:Activate() end @@ -54,10 +53,12 @@ function ENT:Explode() local ex = ents.Create("env_explosion") ex:SetPos(self:GetPos()) ex:SetKeyValue( "iMagnitude", "50" ) - ex:SetOwner(self) + ex:SetOwner(self) ex:Spawn() ex:Fire("Explode",0,0) ex:Fire("Kill",0,0) + self:BecomeRagdoll(DamageInfo()) + timer.Simple(5, function() nz.Enemies.Functions.OnEnemyKilled( self, self ) end) end function ENT:TimedEvent(time, callback) @@ -70,9 +71,9 @@ end function ENT:GetPriorityEnemy() local pos = self:GetPos() - + local min_dist, closest_target = -1, nil - + for _, target in pairs(player.GetAll()) do if (IsValid(target)&&target:Alive()&&target:GetMoveType()==MOVETYPE_WALK) then local dist = target:NearestPoint(pos):Distance(pos) @@ -82,7 +83,7 @@ function ENT:GetPriorityEnemy() end end end - + return closest_target end @@ -99,13 +100,28 @@ function ENT:RunBehaviour() data.maxs = self:OBBMaxs() * 0.65 local trace = util.TraceHull(data) local entity = trace.Entity + + //Barricades + if (IsValid(entity) and entity:GetClass() == "breakable_entry" ) then + if entity:Health() != 0 then + timer.Simple(0.3, function() + + entity:EmitSound("physics/wood/wood_plank_break"..math.random(1, 4)..".wav", 100, math.random(90, 130)) + + entity:RemovePlank() + + end) + + self:PlaySequenceAndWait("swing", 1) + end + end end if (IsValid(target) and target:Alive() ) then --and self:GetRangeTo(target) <= 1500 self.loco:FaceTowards(target:GetPos()) if (self:GetRangeTo(target) <= 42) then - self:EmitSound("npc/zombie_poison/pz_throw2.wav", 100, math.random(75, 125)) + self:EmitSound("npc/zombie_poison/pz_throw2.wav", 50, math.random(75, 125)) self:TimedEvent(0.3, function() self:EmitSound("npc/vort/claw_swing"..math.random(1, 2)..".wav") @@ -125,7 +141,7 @@ function ENT:RunBehaviour() self:PlaySequenceAndWait("swing", 1) else - if nz.Rounds.Curve.Speed[nz.Rounds.CurrentRound] >= 160 then + if nz.Curves.Data.Speed[nz.Rounds.Data.CurrentRound] >= 160 then self:StartActivity(ACT_RUN) else self:StartActivity(ACT_WALK) @@ -136,11 +152,11 @@ function ENT:RunBehaviour() end if (math.random(1, 2) == 2 and (self.nextYell or 0) < CurTime()) then - self:EmitSound("npc/zombie_poison/pz_pain"..math.random(1, 3)..".wav", 80, math.random(30, 50)) + self:EmitSound("npc/zombie_poison/pz_pain"..math.random(1, 3)..".wav", 40, math.random(30, 50)) self.nextYell = CurTime() + math.random(4, 8) end - self.loco:SetDesiredSpeed(nz.Rounds.Curve.Speed[nz.Rounds.CurrentRound]) + self.loco:SetDesiredSpeed(nz.Curves.Data.Speed[nz.Rounds.Data.CurrentRound]) self:MoveToPos(target:GetPos(), { maxage = 0.67 }) @@ -155,7 +171,7 @@ function ENT:RunBehaviour() }) if (math.random(1, 8) == 2) then - self:EmitSound("npc/zombie/zombie_voice_idle"..math.random(2, 7)..".wav", 100, 60) + self:EmitSound("npc/zombie/zombie_voice_idle"..math.random(2, 7)..".wav", 50, 60) if (math.random(1, 2) == 2) then self:PlaySequenceAndWait("scaredidle") @@ -198,7 +214,7 @@ function ENT:AlertNearby(target, range, noNoise) end v.target = target - v:EmitSound("npc/zombie/zombie_alert"..math.random(1, 3)..".wav", 100, math.random(60, 120)) + v:EmitSound("npc/zombie/zombie_alert"..math.random(1, 3)..".wav", 50, math.random(60, 120)) v:AlertNearby(target, range + 640) end) @@ -207,7 +223,7 @@ function ENT:AlertNearby(target, range, noNoise) end if (!noNoise) then - self:EmitSound("npc/zombie_poison/pz_call1.wav", 100, 120) + self:EmitSound("npc/zombie_poison/pz_call1.wav", 50, 120) end end @@ -223,7 +239,6 @@ local deathSounds = { } function ENT:OnKilled(damageInfo) - self:Explode() local attacker = damageInfo:GetAttacker() if (IsValid(attacker) and self:GetRangeTo(attacker) <= 4800) then @@ -239,12 +254,12 @@ function ENT:OnKilled(damageInfo) end end end - - self:EmitSound(table.Random(deathSounds), 100, math.random(75, 130)) + + self:EmitSound(table.Random(deathSounds), 50, math.random(75, 130)) self:BecomeRagdoll(damageInfo) - - OnEnemyKilled( self, attacker) - + + nz.Enemies.Functions.OnEnemyKilled( self, attacker ) + end local painSounds = { @@ -262,15 +277,19 @@ function ENT:OnInjured(damageInfo) local range = self:GetRangeTo(attacker) //Deal an double damage if headshot if hitgroup == HITGROUP_HEAD then - local headshot = DamageInfo() - headshot:SetDamage(damageInfo:GetDamage( )) - headshot:SetAttacker(attacker) - self:TakePhysicsDamage( headshot ) - print("Headshot! ", damageInfo:GetDamage( )) + if self:IsValid() and damageInfo:GetDamageType() != DMG_BLAST_SURFACE then + local headshot = DamageInfo() + headshot:SetDamage(damageInfo:GetDamage( )) + headshot:SetAttacker(attacker) + headshot:SetDamageType(DMG_BLAST_SURFACE) + print("Headshot! ", headshot:GetDamage( )) + //Delay so it doesn't "die" twice + timer.Simple(0.1, function() if self:IsValid() then self:TakeDamageInfo( headshot ) end end) + end end - self:EmitSound(table.Random(painSounds), 100, math.random(50, 130)) + self:EmitSound(table.Random(painSounds), 50, math.random(50, 130)) self.target = attacker self:AlertNearby(attacker, 1000) - - OnEnemyHurt( self, attacker, hitgroup ) + + nz.Enemies.Functions.OnEnemyHurt( self, attacker, hitgroup ) end diff --git a/nzombies3/entities/entities/perk_machine/shared.lua b/nzombies3/entities/entities/perk_machine/shared.lua new file mode 100644 index 00000000..02279c74 --- /dev/null +++ b/nzombies3/entities/entities/perk_machine/shared.lua @@ -0,0 +1,62 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "perk_machine" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + self:NetworkVar("String", 0, "PerkID") + self:NetworkVar("Bool", 0, "Active") +end + +function ENT:Initialize() + if SERVER then + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) + end +end + +function ENT:TurnOn() + local perkData = nz.Perks.Functions.Get(self:GetPerkID()) + self:SetModel(perkData.on_model) + self:SetActive(true) +end + +function ENT:TurnOff() + local perkData = nz.Perks.Functions.Get(self:GetPerkID()) + self:SetModel(perkData.off_model) + self:SetActive(false) +end + +function ENT:IsOn() + return self:GetActive() +end + +function ENT:Use(activator, caller) + local perkData = nz.Perks.Functions.Get(self:GetPerkID()) + + if self:IsOn() then + local price = perkData.price + //If they have enough money + if activator:CanAfford(price) then + if !activator:HasPerk(self:GetPerkID()) then + activator:TakePoints(price) + activator:GivePerk(self:GetPerkID()) + else + print("already have perk") + end + end + end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end +end \ No newline at end of file diff --git a/entities/entities/player_spawns/shared.lua b/nzombies3/entities/entities/player_spawns/shared.lua similarity index 89% rename from entities/entities/player_spawns/shared.lua rename to nzombies3/entities/entities/player_spawns/shared.lua index 22e6fea8..208782f9 100644 --- a/entities/entities/player_spawns/shared.lua +++ b/nzombies3/entities/entities/player_spawns/shared.lua @@ -20,7 +20,7 @@ end if CLIENT then function ENT:Draw() - if nz.Rounds.CurrentState == ROUND_CREATE then + if nz.Rounds.Data.CurrentState == ROUND_CREATE then self:DrawModel() end end diff --git a/entities/entities/wall_block_buy/shared.lua b/nzombies3/entities/entities/prop_buys/shared.lua similarity index 74% rename from entities/entities/wall_block_buy/shared.lua rename to nzombies3/entities/entities/prop_buys/shared.lua index dbb278e5..5f34c3c1 100644 --- a/entities/entities/wall_block_buy/shared.lua +++ b/nzombies3/entities/entities/prop_buys/shared.lua @@ -19,6 +19,7 @@ function ENT:Initialize() self:SetMoveType( MOVETYPE_NONE ) self:SetSolid( SOLID_VPHYSICS ) self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) self.Boundone,self.Boundtwo = self:GetCollisionBounds() end self:BlockLock() @@ -46,12 +47,17 @@ end if CLIENT then function ENT:Draw() - if nz.Rounds.CurrentState == ROUND_CREATE then - self:DrawModel() - elseif (nz.Rounds.CurrentState == ROUND_PROG or nz.Rounds.CurrentState == ROUND_PREP) then + if (nz.Rounds.Data.CurrentState == ROUND_PROG or nz.Rounds.Data.CurrentState == ROUND_PREP) then if self:GetLocked() then self:DrawModel() end + else + self:DrawModel() + end + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + if nz.Doors.Data.DisplayLinks[self] != nil then + nz.Display.Functions.DrawLinks(self, nz.Doors.Data.BuyableProps[self:EntIndex()].link) + end end end -end +end \ No newline at end of file diff --git a/nzombies3/entities/entities/random_box/shared.lua b/nzombies3/entities/entities/random_box/shared.lua new file mode 100644 index 00000000..3725736d --- /dev/null +++ b/nzombies3/entities/entities/random_box/shared.lua @@ -0,0 +1,153 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "random_box" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "Open" ) + +end + +function ENT:Initialize() + + self:SetModel( "models/hoff/props/mysterybox/box.mdl" ) + self:PhysicsInit( SOLID_VPHYSICS ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + + local phys = self:GetPhysicsObject() + if (phys:IsValid()) then + phys:Wake() + end + + self:DrawShadow( false ) + self:AddEffects( EF_ITEM_BLINK ) + self:SetOpen(false) + self.Moving = false + self:Activate() + if SERVER then + self:SetUseType( SIMPLE_USE ) + end +end + +function ENT:Use( activator, caller ) + if self:GetOpen() == true or self.Moving then return end + self:BuyWeapon(activator) + //timer.Simple(5,function() self:MoveAway() end) +end + +function ENT:BuyWeapon(ply) + if ply:CanAfford(950) then + local class = nz.RandomBox.Functions.DecideWep(ply) + if class != nil then + ply:TakePoints(950) + self:Open() + local wep = self:SpawnWeapon( ply, class ) + else + ply:PrintMessage( HUD_PRINTTALK, "No available weapons left!") + end + else + ply:PrintMessage( HUD_PRINTTALK, "You can't afford this!") + end +end + + +function ENT:Open() + local sequence = self:LookupSequence("Close") + self:ResetSequence(sequence) + self:RemoveEffects( EF_ITEM_BLINK ) + + self:SetOpen(true) +end + +function ENT:Close() + local sequence = self:LookupSequence("Open") + self:ResetSequence(sequence) + self:AddEffects( EF_ITEM_BLINK ) + + self:SetOpen(false) +end + +function ENT:SpawnWeapon(activator, class) + local wep = ents.Create("random_box_windup") + wep:Spawn() + wep:SetPos( self:GetPos( ) - Vector(0,0,-10) ) + wep.Buyer = activator + wep:SetParent( self ) + wep:SetWepClass(class) + + return wep +end + +function ENT:Think() + self:NextThink(CurTime()) + return true +end + +function ENT:MoveAway() + self.Moving = true + local s = 0 + //Shake Effect + timer.Create( "shake", 0.1, 300, function() + if s < 30 then + if s % 2 == 0 then + if self:IsValid() then + self:SetAngles(Angle(10, 0, 0)) + end + else + if self:IsValid() then + self:SetAngles(Angle(-10, 0, 0)) + end + end + else + timer.Destroy("shake") + end + s = s + 1 + end) + + //Move Up + timer.Simple( 1, function() + local c = 0 + timer.Create( "moveAway", 0.1, 300, function() + if c == 65 then + self.Moveing = false + timer.Destroy("moveAway") + timer.Destroy("shake") + + self:Remove() + else + if c < 30 then + c = c + 1 + else + c = c + 5 + end + self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z + c)) + end + end ) + end) + + +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end + + hook.Add( "PostDrawOpaqueRenderables", "random_box_beam", function() + for k,v in pairs(ents.FindByClass("random_box")) do + if ( LocalPlayer():GetPos():Distance( v:GetPos() ) ) > 750 then + local Vector1 = v:LocalToWorld( Vector( 0, 0, -200 ) ) + local Vector2 = v:LocalToWorld( Vector( 0, 0, 5000 ) ) + render.SetMaterial( Material( "cable/redlaser" ) ) + render.DrawBeam( Vector1, Vector2, 300, 1, 1, Color( 255, 255, 255, 255 ) ) + end + end + end ) +end diff --git a/entities/entities/random_box_spawns/shared.lua b/nzombies3/entities/entities/random_box_spawns/shared.lua similarity index 79% rename from entities/entities/random_box_spawns/shared.lua rename to nzombies3/entities/entities/random_box_spawns/shared.lua index 74149ebc..a9aa5bc3 100644 --- a/entities/entities/random_box_spawns/shared.lua +++ b/nzombies3/entities/entities/random_box_spawns/shared.lua @@ -10,7 +10,7 @@ ENT.Instructions = "" function ENT:Initialize() - self:SetModel( "models/toybox.mdl" ) + self:SetModel( "models/hoff/props/mysterybox/box.mdl" ) self:SetColor( 255, 255, 255 ) self:SetMoveType( MOVETYPE_NONE ) self:SetSolid( SOLID_VPHYSICS ) @@ -20,8 +20,8 @@ end if CLIENT then function ENT:Draw() - if nz.Rounds.CurrentState == ROUND_CREATE then + if nz.Rounds.Data.CurrentState == ROUND_CREATE then self:DrawModel() end end -end +end \ No newline at end of file diff --git a/nzombies3/entities/entities/random_box_windup/shared.lua b/nzombies3/entities/entities/random_box_windup/shared.lua new file mode 100644 index 00000000..73e81545 --- /dev/null +++ b/nzombies3/entities/entities/random_box_windup/shared.lua @@ -0,0 +1,89 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "random_box_windup" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "Winding" ) + self:NetworkVar( "String", 0, "WepClass") + +end + +function ENT:Initialize() + + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:DrawShadow( false ) + + self:SetWinding(true) + self.c = 0 + self.s = -20 + self:SetModel("models/weapons/w_rif_ak47.mdl") + + if SERVER then + //Stop winding up + timer.Simple(7, function() self:SetWinding(false) self:SetModel(weapons.Get(self:GetWepClass()).WorldModel) end) + //If we time out, remove the object + timer.Simple(18, function() if self:IsValid() then self:GetParent():Close() self:Remove() end end) + end +end + +function ENT:Use( activator, caller ) + if !self:GetWinding() then + if activator == self.Buyer then + local class = self:GetWepClass() + activator:Give(class) + nz.Weps.Functions.GiveMaxAmmoWep(activator, class) + self:GetParent():Close() + self:Remove() + else + if self.Buyer:IsValid() then + activator:PrintMessage( HUD_PRINTTALK, "This is " .. self.Buyer:Nick() .. "'s gun. You cannot take it." ) + end + end + end +end + +function ENT:WindUp( ) + local gun = table.Random(weapons.GetList()) + if gun.WorldModel != nil then + self:SetModel(gun.WorldModel) + end + self.c = self.c + 1 + if self.c > 7 then + self.c = 7 + end + self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z + 0.1*self.c)) +end + +function ENT:WindDown( ) + self.s = self.s + 1 + if self.s > 7 then + self.s = 7 + end + if self.s >= 0 then + self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z - 0.1*self.s)) + end +end + +function ENT:Think() + if SERVER then + if self:GetWinding() then + self:WindUp() + else + self:WindDown() + end + end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end +end diff --git a/entities/entities/wall_block/shared.lua b/nzombies3/entities/entities/wall_block/shared.lua similarity index 74% rename from entities/entities/wall_block/shared.lua rename to nzombies3/entities/entities/wall_block/shared.lua index c158f8ff..fdb6607c 100644 --- a/entities/entities/wall_block/shared.lua +++ b/nzombies3/entities/entities/wall_block/shared.lua @@ -12,14 +12,12 @@ function ENT:Initialize() self:SetMoveType( MOVETYPE_NONE ) self:SetSolid( SOLID_VPHYSICS ) self:DrawShadow( false ) - self:SetColor(Color(255, 255, 255, 0)) self:SetRenderMode( RENDERMODE_TRANSCOLOR ) end if CLIENT then function ENT:Draw() - if nz.Rounds.CurrentState == ROUND_CREATE then - self:SetColor(Color(255, 255, 255, 255)) + if nz.Rounds.Data.CurrentState == ROUND_CREATE then self:DrawModel() end end diff --git a/entities/entities/wall_buy/shared.lua b/nzombies3/entities/entities/wall_buys/shared.lua similarity index 54% rename from entities/entities/wall_buy/shared.lua rename to nzombies3/entities/entities/wall_buys/shared.lua index 2da57077..861eb438 100644 --- a/entities/entities/wall_buy/shared.lua +++ b/nzombies3/entities/entities/wall_buys/shared.lua @@ -1,7 +1,7 @@ AddCSLuaFile( ) ENT.Type = "anim" - + ENT.PrintName = "buy_gun_area" ENT.Author = "Alig96" ENT.Contact = "Don't" @@ -20,7 +20,7 @@ if SERVER then self:SetSolid( SOLID_VPHYSICS ) self:SetUseType(SIMPLE_USE) end - + function ENT:SetWeapon(weapon, price) //Add a special check for FAS weps if weapons.Get(weapon).Category == "FA:S 2 Weapons" then @@ -35,14 +35,34 @@ if SERVER then self:SetEntName(weapon) self:SetPrice(price) end - + function ENT:Use( activator, caller ) - if activator:CanAfford(self.Price) then - activator:TakePoints(self.Price) - activator:Give(self.WeaponGive) - activator:GiveAmmo(nz.Config.BaseStartingAmmoAmount, weapons.Get(self.WeaponGive).Primary.Ammo) - else - print("Can't afford!") + local price = self.Price + local ammo_type = weapons.Get(self.WeaponGive).Primary.Ammo + local ammo_price = math.Round((price - (price % 10))/2) + local curr_ammo = activator:GetAmmoCount( ammo_type ) + local give_ammo = nz.Weps.Functions.CalculateMaxAmmo(self.WeaponGive) - curr_ammo + + + if !activator:HasWeapon( self.WeaponGive ) then + if activator:CanAfford(price) then + activator:TakePoints(price) + activator:Give(self.WeaponGive) + nz.Weps.Functions.GiveMaxAmmoWep(activator, self.WeaponGive) + else + print("Can't afford!") + end + else // Refill ammo + if activator:CanAfford(ammo_price) then + if give_ammo != 0 then + activator:TakePoints(ammo_price) + nz.Weps.Functions.GiveMaxAmmoWep(activator, self.WeaponGive) + else + print("Max Clip!") + end + else + print("Can't afford!") + end end return end diff --git a/entities/entities/zed_spawns/shared.lua b/nzombies3/entities/entities/zed_spawns/shared.lua similarity index 78% rename from entities/entities/zed_spawns/shared.lua rename to nzombies3/entities/entities/zed_spawns/shared.lua index 62671f9a..b4938545 100644 --- a/entities/entities/zed_spawns/shared.lua +++ b/nzombies3/entities/entities/zed_spawns/shared.lua @@ -8,6 +8,11 @@ ENT.Contact = "Don't" ENT.Purpose = "" ENT.Instructions = "" +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "Link" ) + +end function ENT:Initialize() self:SetModel( "models/player/odessa.mdl" ) @@ -20,7 +25,7 @@ end if CLIENT then function ENT:Draw() - if nz.Rounds.CurrentState == ROUND_CREATE then + if nz.Rounds.Data.CurrentState == ROUND_CREATE then self:DrawModel() end end diff --git a/nzombies3/entities/weapons/nz_tool_barricades.lua b/nzombies3/entities/weapons/nz_tool_barricades.lua new file mode 100644 index 00000000..bebd3efe --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_barricades.lua @@ -0,0 +1,17 @@ +SWEP.PrintName = "Barricade Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 1 +SWEP.SlotPos = 9 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.BreakEntry(trace.HitPos,Angle(0,0,0)) + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "breakable_entry" then + trace.Entity:Remove() + end + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_base/cl_init.lua b/nzombies3/entities/weapons/nz_tool_base/cl_init.lua new file mode 100644 index 00000000..d09ea431 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_base/cl_init.lua @@ -0,0 +1,10 @@ +include('shared.lua') + +SWEP.PrintName = "nz_base_tool" +SWEP.Slot = 0 +SWEP.SlotPos = 10 +SWEP.DrawAmmo = false +SWEP.DrawCrosshair = true + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false \ No newline at end of file diff --git a/entities/weapons/gmod_tool_block/init.lua b/nzombies3/entities/weapons/nz_tool_base/init.lua similarity index 100% rename from entities/weapons/gmod_tool_block/init.lua rename to nzombies3/entities/weapons/nz_tool_base/init.lua diff --git a/entities/weapons/gmod_tool_wepbuy/shared.lua b/nzombies3/entities/weapons/nz_tool_base/shared.lua similarity index 83% rename from entities/weapons/gmod_tool_wepbuy/shared.lua rename to nzombies3/entities/weapons/nz_tool_base/shared.lua index e3b48686..17f572a2 100644 --- a/entities/weapons/gmod_tool_wepbuy/shared.lua +++ b/nzombies3/entities/weapons/nz_tool_base/shared.lua @@ -119,11 +119,16 @@ function SWEP:PrimaryAttack() if (!trace.Hit) then return end self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) + if SERVER then - nz.Interface.ReqWepBuy( self.Owner, trace.HitPos, Angle(0,0,0) ) + self:OnPrimaryAttack(trace) end end +function SWEP:OnPrimaryAttack( trace ) + print("dicks") +end + --[[--------------------------------------------------------- SecondaryAttack - Reset everything to how it was @@ -136,7 +141,36 @@ function SWEP:SecondaryAttack() if (!trace.Hit) then return end self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) - if trace.Entity:GetClass() == "wall_buy" and SERVER then - trace.Entity:Remove() + + if SERVER then + self:OnSecondaryAttack(trace) end + +end + +function SWEP:OnSecondaryAttack( trace ) + print("dicks2") +end + +local reload_cd = CurTime() + +function SWEP:Reload() + if reload_cd < CurTime() then + local tr = util.GetPlayerTrace( self.Owner ) + tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) + local trace = util.TraceLine( tr ) + if (!trace.Hit) then return end + + self:DoShootEffect( trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted() ) + + if SERVER then + self:OnReload(trace) + end + + reload_cd = CurTime() + 0.3 + end +end + +function SWEP:OnReload( trace ) + print("reload") end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_block_spawns.lua b/nzombies3/entities/weapons/nz_tool_block_spawns.lua new file mode 100644 index 00000000..d1c6a3de --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_block_spawns.lua @@ -0,0 +1,17 @@ +SWEP.PrintName = "Invisible Block Spawn Placer Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 4 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.BlockSpawn(trace.HitPos,Angle(90,0,0), "models/hunter/plates/plate2x2.mdl") + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "wall_block" then + trace.Entity:Remove() + end + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_door_locker.lua b/nzombies3/entities/weapons/nz_tool_door_locker.lua new file mode 100644 index 00000000..5c9bd327 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_door_locker.lua @@ -0,0 +1,30 @@ +SWEP.PrintName = "Door Locker Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 3 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + if trace.Entity:IsDoor() or trace.Entity:IsBuyableProp() then + //nz.Doors.Functions.CreateLink( trace.Entity, "price=500,elec=0,link=1" ) + nz.Interfaces.Functions.SendInterface(self.Owner, "DoorProps", {door = trace.Entity}) + else + print("Not a door.") + end + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:IsDoor() or trace.Entity:IsBuyableProp() then + nz.Doors.Functions.RemoveLink( trace.Entity ) + else + print("Not a door.") + end + end + //Display Links + function SWEP:OnReload( trace ) + if trace.Entity:IsDoor() or trace.Entity:IsBuyableProp() then + nz.Doors.Functions.DisplayDoorLinks( trace.Entity ) + end + end +end diff --git a/nzombies3/entities/weapons/nz_tool_ee.lua b/nzombies3/entities/weapons/nz_tool_ee.lua new file mode 100644 index 00000000..b9be358e --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_ee.lua @@ -0,0 +1,18 @@ +SWEP.PrintName = "Easter Egg Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 5 +SWEP.SlotPos = 8 +SWEP.Base = "nz_tool_base" + +if SERVER then + + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.EasterEgg(trace.HitPos, Angle(0,0,0), "models/props_lab/huladoll.mdl") + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "easter_egg" then + trace.Entity:Remove() + end + end +end diff --git a/nzombies3/entities/weapons/nz_tool_elec.lua b/nzombies3/entities/weapons/nz_tool_elec.lua new file mode 100644 index 00000000..5dd42419 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_elec.lua @@ -0,0 +1,15 @@ +SWEP.PrintName = "Electric Placer Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 5 +SWEP.SlotPos = 9 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.Electric(trace.HitPos, trace.HitNormal:Angle() - Angle( 270, 0, 0 )) + end + + function SWEP:OnSecondaryAttack( trace ) + + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_perk_machine.lua b/nzombies3/entities/weapons/nz_tool_perk_machine.lua new file mode 100644 index 00000000..d665fafa --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_perk_machine.lua @@ -0,0 +1,25 @@ +SWEP.PrintName = "Perk Machine Spawn Placer Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 5 +SWEP.SlotPos = 8 +SWEP.Base = "nz_tool_base" + +if SERVER then + + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.PerkMachine(trace.HitPos, Angle(0,0,0), "jugg") + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "perk_machine" then + trace.Entity:Remove() + end + end + + function SWEP:OnReload( trace ) + if trace.Entity:GetClass() == "perk_machine" then + nz.Interfaces.Functions.SendInterface(self.Owner, "PerkMachine", {ent = trace.Entity}) + end + end + +end diff --git a/nzombies3/entities/weapons/nz_tool_player_spawns.lua b/nzombies3/entities/weapons/nz_tool_player_spawns.lua new file mode 100644 index 00000000..a699c470 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_player_spawns.lua @@ -0,0 +1,17 @@ +SWEP.PrintName = "Player Spawn Placer Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 1 +SWEP.SlotPos = 9 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.PlayerSpawn(trace.HitPos) + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "player_spawns" then + trace.Entity:Remove() + end + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_prop_modifier.lua b/nzombies3/entities/weapons/nz_tool_prop_modifier.lua new file mode 100644 index 00000000..d5965a7c --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_prop_modifier.lua @@ -0,0 +1,19 @@ +SWEP.PrintName = "Prop Modifier Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 2 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + if trace.Entity:GetClass() == "prop_buys" then + trace.Entity:SetAngles(Angle(0,0,0)) + end + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "prop_buys" then + trace.Entity:Remove() + end + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_random_box.lua b/nzombies3/entities/weapons/nz_tool_random_box.lua new file mode 100644 index 00000000..5e6ab998 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_random_box.lua @@ -0,0 +1,17 @@ +SWEP.PrintName = "Random Box Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 5 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.BoxSpawn(trace.HitPos,Angle(0,0,0)) + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "random_box_spawns" then + trace.Entity:Remove() + end + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_template.lua b/nzombies3/entities/weapons/nz_tool_template.lua new file mode 100644 index 00000000..c58fd7ea --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_template.lua @@ -0,0 +1,18 @@ +SWEP.PrintName = "Tool Name" +SWEP.Author = "UserName" +SWEP.Slot = 0 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + PrintTable(trace) + end + + function SWEP:OnSecondaryAttack( trace ) + PrintTable(trace) + end + function SWEP:OnReload( trace ) + print(trace) + end +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_wall_buys.lua b/nzombies3/entities/weapons/nz_tool_wall_buys.lua new file mode 100644 index 00000000..e648a3f2 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_wall_buys.lua @@ -0,0 +1,23 @@ +SWEP.PrintName = "Weapon Placer Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 2 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + //nz.Mapping.Functions.WallBuy(trace.HitPos, "fas2_ak47", 100, trace.HitNormal:Angle()+Angle(0,270,0)) + nz.Interfaces.Functions.SendInterface(self.Owner, "WepBuy", {vec = trace.HitPos, ang = trace.HitNormal:Angle()+Angle(0,270,0)}) + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "wall_buys" then + trace.Entity:Remove() + end + end + function SWEP:OnReload( trace ) + if trace.Entity:GetClass() == "wall_buys" then + trace.Entity:SetAngles(trace.Entity:GetAngles()+Angle(0,90,0)) + end + end +end diff --git a/nzombies3/entities/weapons/nz_tool_zed_spawns.lua b/nzombies3/entities/weapons/nz_tool_zed_spawns.lua new file mode 100644 index 00000000..3a321d07 --- /dev/null +++ b/nzombies3/entities/weapons/nz_tool_zed_spawns.lua @@ -0,0 +1,23 @@ +SWEP.PrintName = "Zombie Spawn Placer Tool" +SWEP.Author = "Alig96" +SWEP.Slot = 1 +SWEP.SlotPos = 10 +SWEP.Base = "nz_tool_base" + +if SERVER then + function SWEP:OnPrimaryAttack( trace ) + nz.Mapping.Functions.ZedSpawn(trace.HitPos) + end + + function SWEP:OnSecondaryAttack( trace ) + if trace.Entity:GetClass() == "zed_spawns" then + trace.Entity:Remove() + end + end + + function SWEP:OnReload( trace ) + if trace.Entity:GetClass() == "zed_spawns" then + nz.Interfaces.Functions.SendInterface(self.Owner, "ZombLink", {ent = trace.Entity, link = trace.Entity.link}) + end + end +end diff --git a/nzombies3/gamemode/cl_init.lua b/nzombies3/gamemode/cl_init.lua new file mode 100644 index 00000000..bbbec58e --- /dev/null +++ b/nzombies3/gamemode/cl_init.lua @@ -0,0 +1,2 @@ +include( "shared.lua" ) +include( "loader.lua" ) \ No newline at end of file diff --git a/nzombies3/gamemode/config/sh_constructor.lua b/nzombies3/gamemode/config/sh_constructor.lua new file mode 100644 index 00000000..024ca47b --- /dev/null +++ b/nzombies3/gamemode/config/sh_constructor.lua @@ -0,0 +1,91 @@ +//Main Tables +nz.Config = {} +//nz.Config.Functions = {} +//nz.Config.Data = {} + +// Defaults +if SERVER then + + //Curves + + nz.Config.MaxRounds = 100 // How much round data should we load? + + //Spawn Rate Curve + nz.Config.BaseDifficultySpawnRateCurve = 5 + nz.Config.DifficultySpawnRateCurve = 1.01 + //Health Curve + nz.Config.BaseDifficultyHealthCurve = 75 + nz.Config.DifficultyHealthCurve = 0.4 + //Speed curve + nz.Config.BaseDifficultySpeedCurve = 60 + nz.Config.DifficultySpeedCurve = 0.55 + + //Display + + //Door_System + + //Electricity + + //Enemies + nz.Config.ValidEnemies = {"nut_zombie", "nut_zombie_ex"} + nz.Config.EnemyTypes = {} + nz.Config.EnemyTypes[1] = {["nut_zombie"] = 100} + nz.Config.EnemyTypes[6] = {["nut_zombie_ex"] = 100} + nz.Config.EnemyTypes[7] = {["nut_zombie"] = 100} + nz.Config.EnemyTypes[13] = {["nut_zombie"] = 80, ["nut_zombie_ex"] = 20} + nz.Config.EnemyTypes[18] = {["nut_zombie_ex"] = 100} + nz.Config.EnemyTypes[19] = {["nut_zombie"] = 70, ["nut_zombie_ex"] = 30} + //nz.Config.EnemyTypes[4] = {["hellhounds"] = 100} + //nz.Config.EnemyTypes[4] = {["nut_zombie"] = 80, ["hellhounds"] = 20} + + //Max amount of zombies at the same time + nz.Config.MaxZombiesSim = 100 + + //Interfaces + + //Mapping + + //Misc + nz.Config.Halos = false // I seem to be getting a lot of lag because of this, so it is disabled here + + //Perks + + //Player Class + nz.Config.BaseStartingWeapons = {"fas2_glock20"} //"fas2_p226", "fas2_ots33", "fas2_glock20" "weapon_pistol" + //nz.Config.CustomConfigStartingWeps = true -- If this is set to false, the gamemode will avoid using custom weapons in configs + + //Points + nz.Config.BaseStartingPoints = 500 + + //Powerups + + //Props_Menu + + //Random Box + + nz.Config.WeaponBlackList = { + "weapon_base", "weapon_fists", "weapon_flechettegun", "weapon_medkit", + "weapon_dod_sim_base", "weapon_dod_sim_base_shot", "weapon_dod_sim_base_snip", "weapon_sim_admin", "weapon_sim_spade", + "fas2_base", "fas2_ammobox", "fas2_ifak", "fas2_base_shotgun", + "nz_tool_base", "nz_tool_barricades", "nz_tool_block_spawns", "nz_tool_door_locker", "nz_tool_elec", "nz_tool_perk_machine", "nz_tool_player_spawns", "nz_tool_prop_modifier", "nz_tool_random_box", "nz_tool_template", "nz_tool_wall_buys", "nz_tool_zed_spawns" + } + + //Round Handler + + //Time Between rounds + nz.Config.PrepareTime = 10 + + //Spectator + + nz.Config.AllowDropins = true + + //Weapons + nz.Config.MaxWeps = 2 + + +end + +//Shared + +//Barricades +nz.Config.MaxPlanks = 6 diff --git a/nzombies3/gamemode/curves/sh_constructor.lua b/nzombies3/gamemode/curves/sh_constructor.lua new file mode 100644 index 00000000..8164291a --- /dev/null +++ b/nzombies3/gamemode/curves/sh_constructor.lua @@ -0,0 +1,25 @@ +//We only need this on the server +if SERVER then + //Main Tables + nz.Curves = {} + nz.Curves.Functions = {} + nz.Curves.Data = {} + + //Difficulty Curves + nz.Curves.Data.SpawnRate = {} + nz.Curves.Data.Health = {} + nz.Curves.Data.Speed = {} + + //Generate Curve + function nz.Curves.Functions.GenerateCurve() + for i=1, nz.Config.MaxRounds do + nz.Curves.Data.SpawnRate[i-1] = math.Round(nz.Config.BaseDifficultySpawnRateCurve*math.pow(i-1,nz.Config.DifficultySpawnRateCurve)) + nz.Curves.Data.Health[i-1] = math.Round(nz.Config.BaseDifficultyHealthCurve*math.pow(i-1,nz.Config.DifficultyHealthCurve)) + nz.Curves.Data.Speed[i-1] = math.Round(nz.Config.BaseDifficultySpeedCurve*math.pow(i-1,nz.Config.DifficultySpeedCurve)) + end + //PrintTable(nz.Curves.Data) + end + + nz.Curves.Functions.GenerateCurve() + +end \ No newline at end of file diff --git a/nzombies3/gamemode/display/cl_fonts.lua b/nzombies3/gamemode/display/cl_fonts.lua new file mode 100644 index 00000000..41e1ad3b --- /dev/null +++ b/nzombies3/gamemode/display/cl_fonts.lua @@ -0,0 +1,34 @@ +//Main Text +surface.CreateFont( "nz.display.hud.main", { + font = "DK Umbilical Noose", //Avenir Next + size = 48, + weight = 300, + blursize = 0, + scanlines = 0, + antialias = true, + underline = false, + italic = false, + strikeout = false, + symbol = false, + rotary = false, + shadow = false, + additive = false, + outline = false, +} ) + +surface.CreateFont( "nz.display.hud.small", { + font = "DK Umbilical Noose", //Avenir Next + size = 28, + weight = 300, + blursize = 0, + scanlines = 0, + antialias = true, + underline = false, + italic = false, + strikeout = false, + symbol = false, + rotary = false, + shadow = false, + additive = false, + outline = false, +} ) \ No newline at end of file diff --git a/nzombies3/gamemode/display/cl_halos.lua b/nzombies3/gamemode/display/cl_halos.lua new file mode 100644 index 00000000..1dc505d0 --- /dev/null +++ b/nzombies3/gamemode/display/cl_halos.lua @@ -0,0 +1,43 @@ +//Halos + +//Setup +nz.Display.Data.Halos = {} +nz.Display.Data.Halos.Normal = {} +nz.Display.Data.Halos.Create = {} + +//Functions +function nz.Display.Functions.NewHalo(class, colour, createOnly) + if createOnly == true then + table.insert(nz.Display.Data.Halos.Create, {class, colour}) + else + table.insert(nz.Display.Data.Halos.Normal, {class, colour}) + end + +end + +//Hooks +if nz.Config.Halos == true then + hook.Add( "PreDrawHalos", "nz_halos", function() + //Create + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + for k,v in pairs(nz.Display.Data.Halos.Create) do + halo.Add( ents.FindByClass( v[1] ), v[2], 0, 0, 0.1, 0, 1 ) + end + end + + //Normals + for k,v in pairs(nz.Display.Data.Halos.Normal) do + halo.Add( ents.FindByClass( v[1] ), v[2], 0, 0, 0.1, 0, 1 ) + end + end ) +end + +//Quick Function +NewHalo = nz.Display.Functions.NewHalo + +//Actual Halos + +//Zombie Spawns +NewHalo("zed_spawns", Color(255,0,0), true) +//Player Spawns +NewHalo("player_spawns", Color(0,255,0), true) \ No newline at end of file diff --git a/nzombies3/gamemode/display/cl_hud.lua b/nzombies3/gamemode/display/cl_hud.lua new file mode 100644 index 00000000..09abbe4b --- /dev/null +++ b/nzombies3/gamemode/display/cl_hud.lua @@ -0,0 +1,101 @@ +// + +function nz.Display.Functions.StatesHud() + local text = "" + local font = "nz.display.hud.main" + local w = ScrW() / 2 + if nz.Rounds.Data.CurrentState == ROUND_INIT then + text = "Waiting for players. Type /ready to ready up." + font = "nz.display.hud.small" + elseif nz.Rounds.Data.CurrentState == ROUND_PREP then + if nz.Rounds.Data.CurrentRound != 0 then + text = nz.Rounds.Data.CurrentRound + else + text = "1" + end + w = ScrW() * 0.1 + elseif nz.Rounds.Data.CurrentState == ROUND_PROG then + if nz.Rounds.Data.CurrentRound != 0 then + text = nz.Rounds.Data.CurrentRound + else + text = "1" + end + w = ScrW() * 0.1 + elseif nz.Rounds.Data.CurrentState == ROUND_CREATE then + text = "Creative Mode" + elseif nz.Rounds.Data.CurrentState == ROUND_GO then + text = "Game Over" + end + draw.SimpleText(text, font, w, ScrH() * 0.85, Color(200, 0, 0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) +end + +function nz.Display.Functions.ScoreHud() + if nz.Rounds.Data.CurrentState == ROUND_PREP or nz.Rounds.Data.CurrentState == ROUND_PROG then + for k,v in pairs(player.GetAll()) do + local hp = v:Health() + if hp == 0 then hp = "Dead" else hp = hp .. " HP" end + if v:GetPoints() >= 0 then + draw.SimpleText(v:Nick().."(" .. hp .. ") - "..v:GetPoints(), "nz.display.hud.small", ScrW() * 0.8, ScrH() / 2 + (20*k), Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + end + end + end + if LocalPlayer():GetActiveWeapon():IsValid() and nz.Rounds.Data.CurrentState == ROUND_CREATE then + draw.SimpleText(LocalPlayer():GetActiveWeapon():GetClass(), "nz.display.hud.small", ScrW() * 0.8, ScrH() - 70, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + end +end + +function nz.Display.Functions.PowerUpsHud() + if nz.Rounds.Data.CurrentState == ROUND_PREP or nz.Rounds.Data.CurrentState == ROUND_PROG then + local font = "nz.display.hud.main" + local w = ScrW() / 2 + local offset = 40 + local c = 0 + for k,v in pairs(nz.PowerUps.Data.ActivePowerUps) do + if nz.PowerUps.Functions.IsPowerupActive(k) then + local powerupData = nz.PowerUps.Functions.Get(k) + draw.SimpleText(powerupData.name .. " - " .. math.Round(v - CurTime()), font, w, ScrH() * 0.85 + offset * c, Color(255, 255, 255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + c = c + 1 + end + end + end +end + +local Laser = Material( "cable/redlaser" ) +function nz.Display.Functions.DrawLinks( ent, link ) + + local tbl = {} + //Check for zombie spawns + for k, v in pairs(ents.GetAll()) do + if v:IsBuyableProp() then + if nz.Doors.Data.BuyableProps[k] != nil then + if v.link == link then + table.insert(tbl, Entity(k)) + end + end + elseif v:IsDoor() then + if nz.Doors.Data.LinkFlags[v:doorIndex()] != nil then + if nz.Doors.Data.LinkFlags[v:doorIndex()].link == link then + table.insert(tbl, v) + end + end + elseif v:GetClass() == "zed_spawns" then + if v:GetLink() == link then + table.insert(tbl, v) + end + end + end + + + // Draw + if tbl[1] != nil then + for k,v in pairs(tbl) do + render.SetMaterial( Laser ) + render.DrawBeam( ent:GetPos(), v:GetPos(), 20, 1, 1, Color( 255, 255, 255, 255 ) ) + end + end +end + +//Hooks +hook.Add("HUDPaint", "roundHUD", nz.Display.Functions.StatesHud ) +hook.Add("HUDPaint", "scoreHUD", nz.Display.Functions.ScoreHud ) +hook.Add("HUDPaint", "powerupHUD", nz.Display.Functions.PowerUpsHud ) \ No newline at end of file diff --git a/nzombies3/gamemode/display/cl_target.lua b/nzombies3/gamemode/display/cl_target.lua new file mode 100644 index 00000000..c439edf7 --- /dev/null +++ b/nzombies3/gamemode/display/cl_target.lua @@ -0,0 +1,153 @@ +// + +function nz.Display.Functions.GetTarget() + local tr = util.GetPlayerTrace( LocalPlayer() ) + local trace = util.TraceLine( tr ) + if (!trace.Hit) then return end + if (!trace.HitNonWorld) then return end + + return trace.Entity +end + +function nz.Display.Functions.GetText( ent ) + + local class = ent:GetClass() + local text = "" + + if ent:IsPlayer() then + text = ent:Nick() .. " - " .. ent:Health() .. " HP" + end + + if class == "wall_buys" then + local wepclass = ent:GetEntName() + local price = ent:GetPrice() + local wep = weapons.Get(wepclass) + local name = wep.PrintName + local ammo_price = math.Round((price - (price % 10))/2) + if !LocalPlayer():HasWeapon( wepclass ) then + text = "Press E to buy " .. name .." for " .. price .. " points." + else + text = "Press E to buy " .. wep.Primary.Ammo .." Ammo refill for " .. ammo_price .. " points." // In future give more ammo + end + end + + if class == "nut_zombie" then + text = "Health: " .. ent:Health() + end + + if class == "breakable_entry" then + if ent:Health() < nz.Config.MaxPlanks * 10 then + text = "Hold E to rebuild the barricade." + end + end + + if class == "random_box" then + if !ent:GetOpen() then + text = "Press E to buy a random weapon for 950 points." + end + end + + if class == "random_box_windup" then + if !ent:GetWinding() then + local wepclass = ent:GetWepClass() + local wep = weapons.Get(wepclass) + local name = "UNKNOWN" + if wep != nil then + name = wep.PrintName + end + if name == nil then name = wepclass end + text = "Press E to take " .. name .. " from the box." + end + end + + if class == "perk_machine" then + if !ent:IsOn() then + text = "No Power." + else + local perkData = nz.Perks.Functions.Get(ent:GetPerkID()) + //Its on + text = "Press E to buy " .. perkData.name .. " for " .. perkData.price .. " points." + //Check if they already own it + if LocalPlayer():HasPerk(ent:GetPerkID()) then + text = "You already own this perk." + end + end + end + + local door_data = nil + + if ent:IsDoor() then + //Normal Doors + door_data = nz.Doors.Data.LinkFlags[ent:doorIndex()] + end + + if ent:IsBuyableProp() then + //Prop Doors + door_data = nz.Doors.Data.BuyableProps[ent:EntIndex()] + end + + //If we have door data + if door_data != nil then + local price = door_data.price + local req_elec = door_data.elec + local link = door_data.link + if req_elec == "1" and !IsElec() then + text = "You must turn on the electricity first!" + else + if !nz.Doors.Data.OpenedLinks[link] == true then + if price != "0" then + text = "Press E to open for " .. price .. " points." + end + end + end + end + + //Create Only + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + if class == "player_spawns" then + text = "Player Spawn" + end + + if class == "zed_spawns" then + text = "Zombie Spawn" + end + end + + return text +end + +function nz.Display.Functions.DrawTargetID( text ) + + local font = "nz.display.hud.small" + surface.SetFont( font ) + local w, h = surface.GetTextSize( text ) + + local MouseX, MouseY = gui.MousePos() + + if ( MouseX == 0 && MouseY == 0 ) then + + MouseX = ScrW() / 2 + MouseY = ScrH() / 2 + + end + + local x = MouseX + local y = MouseY + + x = x - w / 2 + y = y + 30 + + -- The fonts internal drop shadow looks lousy with AA on + draw.SimpleText( text, font, x+1, y+1, Color(255,255,255,255) ) +end + + +function GM:HUDDrawTargetID() + + local ent = nz.Display.Functions.GetTarget() + + if ent != nil then + nz.Display.Functions.DrawTargetID(nz.Display.Functions.GetText(ent)) + end + +end \ No newline at end of file diff --git a/nzombies3/gamemode/display/sh_constructor.lua b/nzombies3/gamemode/display/sh_constructor.lua new file mode 100644 index 00000000..7606c2a8 --- /dev/null +++ b/nzombies3/gamemode/display/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Display = {} +nz.Display.Functions = {} +nz.Display.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/door_system/sh_constructor.lua b/nzombies3/gamemode/door_system/sh_constructor.lua new file mode 100644 index 00000000..d4aa0029 --- /dev/null +++ b/nzombies3/gamemode/door_system/sh_constructor.lua @@ -0,0 +1,11 @@ +//Main Tables +nz.Doors = {} +nz.Doors.Functions = {} +nz.Doors.Data = {} + +//_ Variables +nz.Doors.Data.EaDI = {} +nz.Doors.Data.LinkFlags = {} +nz.Doors.Data.OpenedLinks = {} +nz.Doors.Data.BuyableProps = {} +nz.Doors.Data.DisplayLinks = {} \ No newline at end of file diff --git a/nzombies3/gamemode/door_system/sh_door_meta.lua b/nzombies3/gamemode/door_system/sh_door_meta.lua new file mode 100644 index 00000000..a02f4948 --- /dev/null +++ b/nzombies3/gamemode/door_system/sh_door_meta.lua @@ -0,0 +1,59 @@ +local meta = FindMetaTable("Entity") + +function meta:IsDoor() + if not IsValid(self) then return false end + local class = self:GetClass() + + if class == "func_door" or + class == "func_door_rotating" or + class == "prop_door_rotating" or + class == "prop_dynamic" then + return true + end + return false +end + +function meta:IsBuyableProp() + if not IsValid(self) then return false end + local class = self:GetClass() + + if class == "prop_buys" then + return true + end + return false +end + +function meta:doorIndex() + if SERVER then + return self:CreatedByMap() and self:MapCreationID() or nil + else + //Check the ED table + return nz.Doors.Data.EaDI[self:EntIndex()] or 0 + end +end + +function meta:DoorUnlock() + //Delay opening the door by a second to stop the door from accidentally opening then closing forever. + //timer.Simple(1, function() + if self:IsDoor() then + self.Locked = false + self:Fire("unlock", "", 0) + self:Fire("open", "", 0) + self:Fire("lock", "", 0) + self:SetKeyValue("wait",-1) + elseif self:IsBuyableProp() then + self.Locked = false + self:BlockUnlock() + end + //end) +end + +function meta:DoorLock() + if self:IsDoor() then + self.Locked = true + self:Fire("close", "", 0) + self:Fire("lock", "", 0) + elseif self:IsBuyableProp() then + self:BlockLock() + end +end \ No newline at end of file diff --git a/nzombies3/gamemode/door_system/sh_doors.lua b/nzombies3/gamemode/door_system/sh_doors.lua new file mode 100644 index 00000000..3236b3a3 --- /dev/null +++ b/nzombies3/gamemode/door_system/sh_doors.lua @@ -0,0 +1,11 @@ +//Functions + +function nz.Doors.Functions.doorToEntIndex(num) + local ent = ents.GetMapCreatedEntity(num) + + return IsValid(ent) and ent:EntIndex() or nil +end + +function nz.Doors.Functions.doorIndexToEnt(num) + return ents.GetMapCreatedEntity(num) or NULL +end \ No newline at end of file diff --git a/nzombies3/gamemode/door_system/sh_sync.lua b/nzombies3/gamemode/door_system/sh_sync.lua new file mode 100644 index 00000000..e8c041d8 --- /dev/null +++ b/nzombies3/gamemode/door_system/sh_sync.lua @@ -0,0 +1,29 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Doors.Sync" ) + + function nz.Doors.Functions.SendSync() + local data = table.Copy(nz.Doors.Data) + + net.Start( "nz.Doors.Sync" ) + net.WriteTable( data ) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Doors.Functions.ReceiveSync( length ) + print("Received Doors Sync") + nz.Doors.Data = net.ReadTable() + PrintTable(nz.Doors.Data) + end + + //Receivers + net.Receive( "nz.Doors.Sync", nz.Doors.Functions.ReceiveSync ) +end \ No newline at end of file diff --git a/nzombies3/gamemode/door_system/sv_doors.lua b/nzombies3/gamemode/door_system/sv_doors.lua new file mode 100644 index 00000000..1f77e751 --- /dev/null +++ b/nzombies3/gamemode/door_system/sv_doors.lua @@ -0,0 +1,138 @@ +// + +//price=500,elec=0,link=1 + +function nz.Doors.Functions.ParseFlagString( flagsStr ) + + local tbl = {} + + flagsStr = string.lower(flagsStr) + + //Translate the flags string into a table + local ex = string.Explode( ",", flagsStr ) + + for k,v in pairs(ex) do + local ex2 = string.Explode( "=", v ) + tbl[ex2[1]] = ex2[2] + end + + return tbl + +end + +function nz.Doors.Functions.CreateLink( ent, flagsStr ) + //First remove all links + nz.Doors.Functions.RemoveLink( ent ) + if ent:IsDoor() then + nz.Doors.Functions.CreateMapDoorLink( ent:doorIndex(), flagsStr ) + elseif ent:IsBuyableProp() then + nz.Doors.Functions.CreatePropDoorLink( ent, flagsStr ) + end +end + +function nz.Doors.Functions.RemoveLink( ent ) + if ent:IsDoor() then + nz.Doors.Functions.RemoveMapDoorLink( ent:doorIndex(), flagsStr ) + elseif ent:IsBuyableProp() then + nz.Doors.Functions.RemovePropDoorLink( ent ) + end +end + +function nz.Doors.Functions.CreateMapDoorLink( doorID, flagsStr ) + + local door = nz.Doors.Functions.doorIndexToEnt(doorID) + local flagsTbl = nz.Doors.Functions.ParseFlagString( flagsStr ) + + if door:IsValid() and door:IsDoor() then + //Assign the flags to the door + for k,v in pairs(flagsTbl) do + door[k] = tonumber(v) + end + //Save the data into a convenient table for lua refresh + door.Data = flagsStr + + //Set the Door Data + nz.Doors.Data.LinkFlags[doorID] = flagsTbl + nz.Doors.Data.EaDI[nz.Doors.Functions.doorToEntIndex(doorID)] = doorID + + nz.Doors.Functions.SendSync() + + else + print("Error: " .. doorID .. " is not a door. ") + end + +end + +function nz.Doors.Functions.RemoveMapDoorLink( doorID ) + + local door = nz.Doors.Functions.doorIndexToEnt(doorID) + + if door.Data != nil then + if door:IsValid() and door:IsDoor() then + local flagsTbl = nz.Doors.Functions.ParseFlagString( door.Data ) + + //Remove the flags to the door + for k,v in pairs(flagsTbl) do + door[k] = nil + end + + //Remove the data that was used for lua refresh + door.Data = nil + + //Set the Door Data + nz.Doors.Data.LinkFlags[doorID] = nil + nz.Doors.Data.EaDI[nz.Doors.Functions.doorToEntIndex(doorID)] = nil + + nz.Doors.Functions.SendSync() + else + print("Error: " .. doorID .. " is not a door. ") + end + end + +end + +function nz.Doors.Functions.CreatePropDoorLink( ent, flagsStr ) + + local flagsTbl = nz.Doors.Functions.ParseFlagString( flagsStr ) + + if ent:IsValid() and ent:IsBuyableProp() then + //Assign the flags to the door + for k,v in pairs(flagsTbl) do + ent[k] = tonumber(v) + end + //Save the data into a convenient table for lua refresh + ent.Data = flagsStr + //Set the Door Data + nz.Doors.Data.BuyableProps[ent:EntIndex()] = flagsTbl + nz.Doors.Functions.SendSync() + else + //print("Error: " .. doorID .. " is not a door. ") + end + +end + +function nz.Doors.Functions.RemovePropDoorLink( ent ) + + if ent:IsValid() and ent:IsBuyableProp() then + + //Save the data into a convenient table for lua refresh + ent.Data = nil + //Set the Door Data + nz.Doors.Data.BuyableProps[ent:EntIndex()] = nil + nz.Doors.Functions.SendSync() + + else + //print("Error: " .. doorID .. " is not a door. ") + end +end + +function nz.Doors.Functions.DisplayDoorLinks( ent ) + if ent.link == nil then nz.Doors.Data.DisplayLinks[ent] = nil return end + + if nz.Doors.Data.DisplayLinks[ent] == nil then + nz.Doors.Data.DisplayLinks[ent] = ent.link + else + nz.Doors.Data.DisplayLinks[ent] = nil + end + nz.Doors.Functions.SendSync() +end \ No newline at end of file diff --git a/nzombies3/gamemode/door_system/sv_gameplay.lua b/nzombies3/gamemode/door_system/sv_gameplay.lua new file mode 100644 index 00000000..db13ec03 --- /dev/null +++ b/nzombies3/gamemode/door_system/sv_gameplay.lua @@ -0,0 +1,65 @@ +function nz.Doors.Functions.OpenDoor( ent ) + //Open the door and any other door with the same link + ent:DoorUnlock() + + //Sync + if ent.link != nil then + nz.Doors.Data.OpenedLinks[ent.link] = true + nz.Doors.Functions.SendSync() + end +end + +function nz.Doors.Functions.OpenLinkedDoors( link ) + //Go through all the doors + for k,v in pairs(ents.GetAll()) do + if v:IsDoor() or v:IsBuyableProp() then + if v.link != nil then + if link == v.link then + nz.Doors.Functions.OpenDoor( v ) + end + end + end + end +end + +function nz.Doors.Functions.LockAllDoors() + //Force all doors to lock and stay open when opened + for k,v in pairs(ents.GetAll()) do + if v:IsDoor() or v:IsBuyableProp() then + v:SetUseType( SIMPLE_USE ) + v:DoorLock() + v:SetKeyValue("wait",-1) + end + end +end + +function nz.Doors.Functions.BuyDoor( ply, ent ) + local price = ent.price + local req_elec = ent.elec + local link = ent.link + //If it has a price + if price != nil then + if ply:CanAfford(price) and ent.Locked == true then + //If this door doesn't require electricity or if it does, then if the electricity is on at the same time + if (req_elec == 0 or (req_elec == 1 and IsElec())) then + ply:TakePoints(price) + if link == nil then + nz.Doors.Functions.OpenDoor( ent ) + else + nz.Doors.Functions.OpenLinkedDoors( link ) + end + end + end + end +end + + +//Hooks + +function nz.Doors.Functions.OnUseDoor( ply, ent ) + if ent:IsDoor() or ent:IsBuyableProp() then + nz.Doors.Functions.BuyDoor( ply, ent ) + end +end + +hook.Add( "PlayerUse", "player_buydoors", nz.Doors.Functions.OnUseDoor ) \ No newline at end of file diff --git a/nzombies3/gamemode/easter_eggs/sh_constructor.lua b/nzombies3/gamemode/easter_eggs/sh_constructor.lua new file mode 100644 index 00000000..2aec57ef --- /dev/null +++ b/nzombies3/gamemode/easter_eggs/sh_constructor.lua @@ -0,0 +1,7 @@ +//Main Tables +nz.EE = {} +nz.EE.Functions = {} +nz.EE.Data = {} + +nz.EE.Data.EggCount = 0 +nz.EE.Data.MaxEggCount = 0 diff --git a/nzombies3/gamemode/easter_eggs/sv_ee.lua b/nzombies3/gamemode/easter_eggs/sv_ee.lua new file mode 100644 index 00000000..bbd3bddf --- /dev/null +++ b/nzombies3/gamemode/easter_eggs/sv_ee.lua @@ -0,0 +1,30 @@ +// + +function nz.EE.Functions.Reset() + //Reset the counter of eggs + nz.EE.Data.EggCount = 0 + nz.EE.Data.MaxEggCount = 0 + + //Reset all easter eggs + for k,v in pairs(ents.FindByClass("easter_egg")) do + v.Used = false + end +end + +function nz.EE.Functions.ActivateEgg( ent ) + + ent.Used = true + ent:EmitSound("WeaponDissolve.Dissolve", 100, 100) + + nz.EE.Data.EggCount = nz.EE.Data.EggCount + 1 + + if nz.EE.Data.MaxEggCount == 0 then + nz.EE.Data.MaxEggCount = #ents.FindByClass("easter_egg") + end + + //What we should do when we have all the eggs + if nz.EE.Data.EggCount == nz.EE.Data.MaxEggCount then + print("All easter eggs found yay!") + hook.Call( "nz.EE.EasterEgg" ) + end +end diff --git a/nzombies3/gamemode/electricity/sh_constructor.lua b/nzombies3/gamemode/electricity/sh_constructor.lua new file mode 100644 index 00000000..35db8fe2 --- /dev/null +++ b/nzombies3/gamemode/electricity/sh_constructor.lua @@ -0,0 +1,13 @@ +//Main Tables +nz.Elec = {} +nz.Elec.Functions = {} +nz.Elec.Data = {} + +//_ Variables +nz.Elec.Data.Active = false + +function nz.Elec.Functions.IsElec() + return nz.Elec.Data.Active +end + +IsElec = nz.Elec.Functions.IsElec \ No newline at end of file diff --git a/nzombies3/gamemode/electricity/sh_sync.lua b/nzombies3/gamemode/electricity/sh_sync.lua new file mode 100644 index 00000000..08efd2d1 --- /dev/null +++ b/nzombies3/gamemode/electricity/sh_sync.lua @@ -0,0 +1,28 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Elec.Sync" ) + + function nz.Elec.Functions.SendSync() + net.Start( "nz.Elec.Sync" ) + net.WriteTable(nz.Elec.Data) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Elec.Functions.ReceiveSync( length ) + nz.Elec.Data = net.ReadTable() + end + + + //Receivers + net.Receive( "nz.Elec.Sync", nz.Elec.Functions.ReceiveSync ) + + +end \ No newline at end of file diff --git a/nzombies3/gamemode/electricity/sv_elec.lua b/nzombies3/gamemode/electricity/sv_elec.lua new file mode 100644 index 00000000..8bd6353a --- /dev/null +++ b/nzombies3/gamemode/electricity/sv_elec.lua @@ -0,0 +1,38 @@ +// + +function nz.Elec.Functions.Activate() + + nz.Elec.Data.Active = true + nz.Elec.Functions.SendSync() + + //Open all doors with no price and electricity requirement + for k,v in pairs(ents.GetAll()) do + if v:IsDoor() or v:IsBuyableProp() then + if v.price == 0 and v.elec == 1 then + nz.Doors.Functions.OpenDoor( v ) + end + end + end + + //Turn on all perk machines + for k,v in pairs(ents.FindByClass("perk_machine")) do + v:TurnOn() + end + + //Call the hook + PrintMessage(HUD_PRINTTALK, "[NZ] Electricity is on!") + +end + +function nz.Elec.Functions.Reset() + + nz.Elec.Data.Active = false + //Reset the button aswell + local prevs = ents.FindByClass("button_elec") + if prevs[1] != nil then + prevs[1]:SetSwitch(false) + end + + nz.Elec.Functions.SendSync() + +end \ No newline at end of file diff --git a/nzombies3/gamemode/enemies/sh_constructor.lua b/nzombies3/gamemode/enemies/sh_constructor.lua new file mode 100644 index 00000000..bca4711e --- /dev/null +++ b/nzombies3/gamemode/enemies/sh_constructor.lua @@ -0,0 +1,9 @@ +//We only need this on the server +if SERVER then + + //Main Tables + nz.Enemies = {} + nz.Enemies.Functions = {} + nz.Enemies.Data = {} + +end \ No newline at end of file diff --git a/nzombies3/gamemode/enemies/sv_hooks.lua b/nzombies3/gamemode/enemies/sv_hooks.lua new file mode 100644 index 00000000..120285ca --- /dev/null +++ b/nzombies3/gamemode/enemies/sv_hooks.lua @@ -0,0 +1,43 @@ +// + + +function nz.Enemies.Functions.OnEnemyKilled(enemy, attacker) + + if attacker:IsPlayer() then + attacker:GivePoints(90) + attacker:AddFrags(1) + end + + nz.Rounds.Data.KilledZombies = nz.Rounds.Data.KilledZombies + 1 + //nz.Rounds.Data.ZombiesSpawned = nz.Rounds.Data.ZombiesSpawned - 1 + + //Chance a powerup spawning + if nz.PowerUps.Functions.IsPowerupActive("insta") == false and enemy:IsValid() then //Don't spawn powerups during instakill + nz.PowerUps.Functions.SpawnPowerUp(enemy:GetPos()) + end + + print("Killed Enemy: " .. nz.Rounds.Data.KilledZombies .. "/" .. nz.Rounds.Data.MaxZombies ) +end + +function nz.Enemies.Functions.OnEnemyHurt(enemy, attacker) + if attacker:IsPlayer() and enemy:IsValid() then + attacker:GivePoints(10) + if nz.PowerUps.Functions.IsPowerupActive("insta") then + local insta = DamageInfo() + insta:SetDamage(enemy:Health()) + insta:SetAttacker(attacker) + insta:SetDamageType(DMG_BLAST_SURFACE) + //Delay so it doesn't "die" twice + timer.Simple(0.1, function() if enemy:IsValid() and enemy:Health() > 0 then enemy:TakeDamageInfo( insta ) end end) + end + end +end + + +function nz.Enemies.Functions.OnEntityCreated( ent ) + if ( ent:GetClass() == "prop_ragdoll" ) then + ent:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + end +end + +hook.Add("OnEntityCreated", "nz.Enemies.OnEntityCreated", nz.Enemies.Functions.OnEntityCreated) diff --git a/nzombies3/gamemode/enemies/sv_spawner.lua b/nzombies3/gamemode/enemies/sv_spawner.lua new file mode 100644 index 00000000..3f594152 --- /dev/null +++ b/nzombies3/gamemode/enemies/sv_spawner.lua @@ -0,0 +1,119 @@ +// + +function nz.Enemies.Functions.CheckIfSuitable(pos) + + local Ents = ents.FindInBox( pos + Vector( -16, -16, 0 ), pos + Vector( 16, 16, 64 ) ) + local Blockers = 0 + if Ents == nil then return true end + for k, v in pairs( Ents ) do + if ( IsValid( v ) and (v:GetClass() == "player" or table.HasValue(nz.Config.ValidEnemies, v:GetClass()) ) ) then + Blockers = Blockers + 1 + end + end + + if Blockers == 0 then + return true + end + + return false + +end + +function nz.Enemies.Functions.ValidSpawns() + + local valids = {} + local spawns = {} + + //Make a table of spawns + for k,v in pairs(team.GetPlayers(TEAM_PLAYERS)) do + //Get all spawns in the range + for k2,v2 in pairs(ents.FindInSphere(v:GetPos(), 1200)) do + if v2:GetClass() == "zed_spawns" then + table.insert(spawns, v2) + end + end + //Remove all spawns that are too close + for k2,v2 in pairs(ents.FindInSphere(v:GetPos(), 200)) do + if table.HasValue(spawns, v2) then + table.RemoveByValue(spawns, v2) + end + end + end + + //Removed unopened linked doors + for k,v in pairs(spawns) do + if v.link != nil then + if nz.Doors.Data.OpenedLinks[tonumber(v.link)] == nil then //Zombie Links + spawns[k] = nil + end + end + end + + //Get positions + for k,v in pairs(spawns) do + table.insert(valids, v:GetPos()) + end + + return valids +end + +function nz.Enemies.Functions.TotalCurrentEnemies() + local c = 0 + + //Count + for k,v in pairs(nz.Config.ValidEnemies) do + for k2,v2 in pairs(ents.FindByClass(v)) do + c = c + 1 + end + end + + return c +end + +function nz.Enemies.Functions.SpawnZombie(pos) + if nz.Enemies.Functions.TotalCurrentEnemies() < 100 then + local ent = "nut_zombie" + + //Get the latest round number from the table + for i = nz.Rounds.Data.CurrentRound, 0, -1 do + if nz.Config.EnemyTypes[i] != nil then + ent = nz.Misc.Functions.WeightedRandom(nz.Config.EnemyTypes[i]) + break + end + end + + local zombie = ents.Create(ent) + zombie:SetPos(pos) + zombie:Spawn() + zombie:Activate() + nz.Rounds.Data.ZombiesSpawned = nz.Rounds.Data.ZombiesSpawned + 1 + print("Spawning Enemy: " .. nz.Rounds.Data.ZombiesSpawned .. "/" .. nz.Rounds.Data.MaxZombies ) + else + print("Limit of Zombies Reached!") + end +end + + +function nz.Enemies.Functions.ZombieSpawner() + //Not enough Zombies + if nz.Rounds.Data.ZombiesSpawned < nz.Rounds.Data.MaxZombies then + if nz.Rounds.Data.CurrentState == ROUND_PROG then + + local valids = nz.Enemies.Functions.ValidSpawns() + + if valids[1] == nil then + print("No valid spawns were found!") + return + --Since we couldn't find a valid spawn, just back out for now. + end + + local pos = table.Random(valids) + + if nz.Enemies.Functions.CheckIfSuitable(pos) then + nz.Enemies.Functions.SpawnZombie(pos) + end + end + end +end + +timer.Create("nz.Rounds.ZombieSpawner", 1, 0, nz.Enemies.Functions.ZombieSpawner) \ No newline at end of file diff --git a/nzombies3/gamemode/fog/cl_fog.lua b/nzombies3/gamemode/fog/cl_fog.lua new file mode 100644 index 00000000..e6fdf230 --- /dev/null +++ b/nzombies3/gamemode/fog/cl_fog.lua @@ -0,0 +1,13 @@ +function nz.Fog.Functions.RenderFog() + if nz.Fog.Data.Enabled then + render.FogMode( 1 ) + render.FogStart( nz.Fog.Data.Start ) + render.FogEnd( nz.Fog.Data.End ) + render.FogMaxDensity( nz.Fog.Data.Density ) + render.FogColor( nz.Fog.Data.Color.r, nz.Fog.Data.Color.g, nz.Fog.Data.Color.b ) + + return true + end +end + +hook.Add( "SetupWorldFog", "nz.Fog", nz.Fog.Functions.RenderFog ) diff --git a/nzombies3/gamemode/fog/sh_constructor.lua b/nzombies3/gamemode/fog/sh_constructor.lua new file mode 100644 index 00000000..ff06f0a6 --- /dev/null +++ b/nzombies3/gamemode/fog/sh_constructor.lua @@ -0,0 +1,12 @@ +//Main Tables +nz.Fog = {} +nz.Fog.Functions = {} +nz.Fog.Data = {} + +//_ Variables + +nz.Fog.Data.Enabled = false +nz.Fog.Data.Start = 0 +nz.Fog.Data.End = 200 +nz.Fog.Data.Density = 1 +nz.Fog.Data.Color = Color(130,140,140) diff --git a/nzombies3/gamemode/fog/sh_sync.lua b/nzombies3/gamemode/fog/sh_sync.lua new file mode 100644 index 00000000..f016ad9e --- /dev/null +++ b/nzombies3/gamemode/fog/sh_sync.lua @@ -0,0 +1,28 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Fog.Sync" ) + + function nz.Fog.Functions.SendSync() + local data = table.Copy(nz.Fog.Data) + + net.Start( "nz.Fog.Sync" ) + net.WriteTable( data ) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Fog.Functions.ReceiveSync( length ) + print("Received Fog Sync") + nz.Fog.Data = net.ReadTable() + end + + //Receivers + net.Receive( "nz.Fog.Sync", nz.Fog.Functions.ReceiveSync ) +end diff --git a/nzombies3/gamemode/fog/sv_fog.lua b/nzombies3/gamemode/fog/sv_fog.lua new file mode 100644 index 00000000..653e0cdb --- /dev/null +++ b/nzombies3/gamemode/fog/sv_fog.lua @@ -0,0 +1,33 @@ +// + +function nz.Fog.Functions.Enable( bool ) + //Check if we have a fog entity + if #ents.FindByClass("env_fog_controller") == 0 then + //If not spawn one. + local ent = ents.Create( "env_fog_controller" ) + ent:Spawn() + end + + nz.Fog.Data.Enabled = bool + nz.Fog.Functions.SendSync() +end + +function nz.Fog.Functions.SetStart( val ) + nz.Fog.Data.Start = val + nz.Fog.Functions.SendSync() +end + +function nz.Fog.Functions.SetEnd( val ) + nz.Fog.Data.End = val + nz.Fog.Functions.SendSync() +end + +function nz.Fog.Functions.SetDensity( val ) + nz.Fog.Data.Density = val + nz.Fog.Functions.SendSync() +end + +function nz.Fog.Functions.SetColor( val ) + nz.Fog.Data.Color = val + nz.Fog.Functions.SendSync() +end diff --git a/nzombies3/gamemode/init.lua b/nzombies3/gamemode/init.lua new file mode 100644 index 00000000..7e12d398 --- /dev/null +++ b/nzombies3/gamemode/init.lua @@ -0,0 +1,5 @@ +include( "shared.lua" ) +include( "loader.lua" ) + +AddCSLuaFile( "shared.lua" ) +AddCSLuaFile( "loader.lua" ) \ No newline at end of file diff --git a/nzombies3/gamemode/interfaces/sh_constructor.lua b/nzombies3/gamemode/interfaces/sh_constructor.lua new file mode 100644 index 00000000..c115ae50 --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Interfaces = {} +nz.Interfaces.Functions = {} +nz.Interfaces.Data = {} + +//_ Variables \ No newline at end of file diff --git a/nzombies3/gamemode/interfaces/sh_int_configloader.lua b/nzombies3/gamemode/interfaces/sh_int_configloader.lua new file mode 100644 index 00000000..d96e33d4 --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_int_configloader.lua @@ -0,0 +1,51 @@ +// + +if SERVER then + function nz.Interfaces.Functions.ConfigLoaderHandler( ply, data ) + if ply:IsSuperAdmin() then + nz.Mapping.Functions.LoadConfig( data.config ) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.ConfigLoader( data ) + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 180 ) + DermaPanel:SetTitle( "Load a config" ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local DermaListView = vgui.Create("DListView") + DermaListView:SetParent(DermaPanel) + DermaListView:SetPos(10, 30) + DermaListView:SetSize(280, 100) + DermaListView:SetMultiSelect(false) + DermaListView:AddColumn("Name") + //Populate + for k,v in pairs(data.configs) do + DermaListView:AddLine(v) + end + + local DermaButton = vgui.Create( "DButton" ) + DermaButton:SetParent( DermaPanel ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 10, 140 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + if DermaListView:GetSelectedLine() != nil then + local str = DermaListView:GetLine(DermaListView:GetSelectedLine()):GetValue(1) + if str != nil then + data.configs = nil + data.config = str + nz.Interfaces.Functions.SendRequests( "ConfigLoader", data ) + DermaPanel:Close() + end + end + end + end +end diff --git a/nzombies3/gamemode/interfaces/sh_int_door.lua b/nzombies3/gamemode/interfaces/sh_int_door.lua new file mode 100644 index 00000000..f080dc9b --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_int_door.lua @@ -0,0 +1,97 @@ +// + +if SERVER then + function nz.Interfaces.Functions.DoorPropsHandler( ply, data ) + if ply:IsSuperAdmin() then + nz.Doors.Functions.CreateLink( data.ent, data.flags ) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.DoorProps( data ) + local ent = data.door + local name = "Add New Door" + local valz = {} + valz["Row1"] = 0 + valz["Row2"] = 1 + valz["Row3"] = 1000 + valz["Row4"] = 0 + + local door_data = nil + + //Check if the ent has flags already + if ent:IsDoor() then + door_data = nz.Doors.Data.LinkFlags[ent:doorIndex()] + elseif ent:IsBuyableProp() then + door_data = nz.Doors.Data.BuyableProps[ent:EntIndex()] + end + //If we do then; + if door_data != nil then + if door_data.link != nil then + valz["Row1"] = 1 + valz["Row2"] = door_data.link + end + valz["Row3"] = door_data.price + valz["Row4"] = door_data.elec + name = "Modifying Door Flag" + end + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 180 ) + DermaPanel:SetTitle( name ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local DProperties = vgui.Create( "DProperties", DermaPanel ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 30 ) + + local Row1 = DProperties:CreateRow( "Door Settings", "Enable Flag?" ) + Row1:Setup( "Boolean" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val end + local Row2 = DProperties:CreateRow( "Door Settings", "Flag" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val end + local Row3 = DProperties:CreateRow( "Door Settings", "Price" ) + Row3:Setup( "Integer" ) + Row3:SetValue( valz["Row3"] ) + Row3.DataChanged = function( _, val ) valz["Row3"] = val end + local Row4 = DProperties:CreateRow( "Door Settings", "Requires Electricity?" ) + Row4:Setup( "Boolean" ) + Row4:SetValue( valz["Row4"] ) + Row4.DataChanged = function( _, val ) valz["Row4"] = val end + + local DermaButton = vgui.Create( "DButton" ) + DermaButton:SetParent( DermaPanel ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 10, 140 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + local function compileString(price, elec, flag) + local str = "price="..price..",elec="..elec + if flag != false then + str = str..",link="..flag + end + return str + end + local flag = false + if valz["Row1"] == 1 then + flag = valz["Row2"] + end + DermaPanel:SetTitle( "Modifying Door Flag" ) + local flagString = compileString(valz["Row3"], valz["Row4"], flag) + print(flagString) + + //Send the data + nz.Interfaces.Functions.SendRequests( "DoorProps", {flags = flagString, ent = ent} ) + + end + end + +end diff --git a/nzombies3/gamemode/interfaces/sh_int_perkmachine.lua b/nzombies3/gamemode/interfaces/sh_int_perkmachine.lua new file mode 100644 index 00000000..20837186 --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_int_perkmachine.lua @@ -0,0 +1,36 @@ +// + +if SERVER then + function nz.Interfaces.Functions.PerkMachineHandler( ply, data ) + if ply:IsSuperAdmin() then + data.ent:SetPerkID(data.id) + data.ent:TurnOff() //Quickly update the model + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.PerkMachine( data ) + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 180 ) + DermaPanel:SetTitle( "Modifying Perk Machines" ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local choices = vgui.Create( "DComboBox", DermaPanel ) + choices:SetPos( 10, 30 ) + choices:SetSize( 280, 30 ) + choices:SetValue( nz.Perks.Functions.Get(data.ent:GetPerkID()).name ) + for k,v in pairs(nz.Perks.Functions.GetList()) do + choices:AddChoice( v, k ) + end + choices.OnSelect = function( panel, index, value, id ) + data.id = id + nz.Interfaces.Functions.SendRequests( "PerkMachine", data ) + end + end +end diff --git a/nzombies3/gamemode/interfaces/sh_int_weps.lua b/nzombies3/gamemode/interfaces/sh_int_weps.lua new file mode 100644 index 00000000..ac636b3a --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_int_weps.lua @@ -0,0 +1,60 @@ +// + +if SERVER then + function nz.Interfaces.Functions.WepBuyHandler( ply, data ) + if ply:IsSuperAdmin() then + nz.Mapping.Functions.WallBuy(data.vec, data.class, tonumber(data.price), data.ang) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.WepBuy( data ) + + local valz = {} + valz["Row1"] = "weapon_class" + valz["Row2"] = 500 + + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 180 ) + DermaPanel:SetTitle( "Add New Weapon" ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local DProperties = vgui.Create( "DProperties", DermaPanel ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 30 ) + + local Row1 = DProperties:CreateRow( "Weapon Settings", "Weapon Class" ) + Row1:Setup( "Generic" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val end + local Row2 = DProperties:CreateRow( "Weapon Settings", "Price" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val end + + local DermaButton = vgui.Create( "DButton" ) + DermaButton:SetParent( DermaPanel ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 10, 140 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + + //Check the weapon class is fine first + if weapons.Get( valz["Row1"] ) != nil then + data.class = valz["Row1"] + data.price = tostring(valz["Row2"]) + PrintTable(data) + nz.Interfaces.Functions.SendRequests( "WepBuy", data ) + + DermaPanel:Close() + end + + end + end +end diff --git a/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua b/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua new file mode 100644 index 00000000..d243df02 --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua @@ -0,0 +1,68 @@ +// + +if SERVER then + function nz.Interfaces.Functions.ZombLinkHandler( ply, data ) + if ply:IsSuperAdmin() then + data.ent.link = data.link + //For the link displayer + data.ent:SetLink(data.link) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.ZombLink( data ) + PrintTable(data) + local name = "Add New Zombie Link" + local valz = {} + valz["Row1"] = 0 + valz["Row2"] = 1 + //Check if the ent has flags already + if data.link != nil then + valz["Row1"] = 1 + valz["Row2"] = data.link + name = "Modifying Zombie Link" + end + + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 180 ) + DermaPanel:SetTitle( name ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local DProperties = vgui.Create( "DProperties", DermaPanel ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 30 ) + + local Row1 = DProperties:CreateRow( "Zombie Spawn", "Enable Flag?" ) + Row1:Setup( "Boolean" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val end + local Row2 = DProperties:CreateRow( "Zombie Spawn", "Flag" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val end + + local DermaButton = vgui.Create( "DButton" ) + DermaButton:SetParent( DermaPanel ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 10, 140 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + local str="nil" + if valz["Row1"] == 0 then + str=nil + else + str=valz["Row2"] + end + data.link = str + nz.Interfaces.Functions.SendRequests( "ZombLink", data ) + + DermaPanel:Close() + end + end +end diff --git a/nzombies3/gamemode/interfaces/sh_sync.lua b/nzombies3/gamemode/interfaces/sh_sync.lua new file mode 100644 index 00000000..6ff4d736 --- /dev/null +++ b/nzombies3/gamemode/interfaces/sh_sync.lua @@ -0,0 +1,50 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Interfaces.Send" ) + + function nz.Interfaces.Functions.SendInterface(ply, interface, data) + net.Start( "nz.Interfaces.Send" ) + net.WriteString( interface ) + net.WriteTable( data ) + net.Send(ply) + end + + //Client to Server (Server) + util.AddNetworkString( "nz.Interfaces.Requests" ) + + function nz.Interfaces.Functions.ReceiveRequests( len, ply ) + local interface = net.ReadString() + local data = net.ReadTable() + + nz.Interfaces.Functions[interface.."Handler"](ply, data) + end + + //Receivers + net.Receive( "nz.Interfaces.Requests", nz.Interfaces.Functions.ReceiveRequests ) + +end + +if CLIENT then + + //Server to client (Client) + function nz.Interfaces.Functions.ReceiveSync( length ) + local interface = net.ReadString() + local data = net.ReadTable() + + nz.Interfaces.Functions[interface](data) + end + + //Receivers + net.Receive( "nz.Interfaces.Send", nz.Interfaces.Functions.ReceiveSync ) + + //Client to Server (Client) + function nz.Interfaces.Functions.SendRequests( interface, data ) + net.Start( "nz.Interfaces.Requests" ) + net.WriteString( interface ) + net.WriteTable( data ) + net.SendToServer() + end +end diff --git a/nzombies3/gamemode/loader.lua b/nzombies3/gamemode/loader.lua new file mode 100644 index 00000000..ab2ad076 --- /dev/null +++ b/nzombies3/gamemode/loader.lua @@ -0,0 +1,67 @@ +//Load all our files in to the respective realms + +//Main Tables +nz = {} + +local gmfolder = "nzombies3" + +local _,dirs = file.Find( gmfolder.."/gamemode/*", "LUA" ) + +print("nZombies 3.0 Loading...") + +function AutoInclude(name, dir) + + local sep = string.Explode("_", name) + name = dir..name + + if sep[1] == "cl" and SERVER then + print("Sending: "..name) + else + print("Including: "..name) + end + + // Determine where to load the files + if sep[1] == "sv" then + if SERVER then + include(name) + end + elseif sep[1] == "sh" then + if SERVER then + AddCSLuaFile(name) + include(name) + else + include(name) + end + elseif sep[1] == "cl" then + if SERVER then + AddCSLuaFile(name) + else + include(name) + end + end + +end + +//Run this on both client and server +if SERVER then print(" ** Server List **") else print(" ** Client List **") end +for k,v in pairs(dirs) do + local f2,d2 = file.Find( gmfolder.."/gamemode/"..v.."/*", "LUA" ) + + //Load construction file before everything else + if table.HasValue(f2, "sh_constructor.lua") then + print("Constructing: " .. v) + AutoInclude("sh_constructor.lua", v.."/") + end + + for k2,v2 in pairs(f2) do + //we already loaded the construction file once, so dont load again + if v2 != "sh_constructor.lua" then + AutoInclude(v2, v.."/") + end + end + +end +print(" ** End List **") + + + diff --git a/nzombies3/gamemode/mapping/sh_constructor.lua b/nzombies3/gamemode/mapping/sh_constructor.lua new file mode 100644 index 00000000..628d2e60 --- /dev/null +++ b/nzombies3/gamemode/mapping/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Mapping = {} +nz.Mapping.Functions = {} +nz.Mapping.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/mapping/sv_mapping.lua b/nzombies3/gamemode/mapping/sv_mapping.lua new file mode 100644 index 00000000..1b571ff4 --- /dev/null +++ b/nzombies3/gamemode/mapping/sv_mapping.lua @@ -0,0 +1,174 @@ +// + +function nz.Mapping.Functions.ZedSpawn(pos, link) + + local ent = ents.Create("zed_spawns") + pos.z = pos.z - ent:OBBMaxs().z + ent:SetPos( pos ) + ent:Spawn() + ent.link = link + //For the link displayer + if link != nil then + ent:SetLink(link) + end +end + +function nz.Mapping.Functions.PlayerSpawn(pos) + + local ent = ents.Create("player_spawns") + pos.z = pos.z - ent:OBBMaxs().z + ent:SetPos( pos ) + ent:Spawn() + +end + +function nz.Mapping.Functions.WallBuy(pos, gun, price, angle) + + if weapons.Get(gun) != nil then + + local ent = ents.Create("wall_buys") + ent:SetAngles(angle) + pos.z = pos.z - ent:OBBMaxs().z + ent:SetWeapon(gun, price) + ent:SetPos( pos ) + ent:Spawn() + ent:PhysicsInit( SOLID_VPHYSICS ) + + local phys = ent:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + + else + print("SKIPPED: " .. gun .. ". Are you sure you have it installed?") + end + +end + +function nz.Mapping.Functions.PropBuy(pos,ang,model,flags) + local prop = ents.Create( "prop_buys" ) + prop:SetModel( model ) + prop:SetPos( pos ) + prop:SetAngles( ang ) + prop:Spawn() + prop:PhysicsInit( SOLID_VPHYSICS ) + + //REMINDER APPY FLAGS + if flags != nil then + nz.Doors.Functions.CreateLink( prop, flags ) + end + + local phys = prop:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end +end + +function nz.Mapping.Functions.Electric(pos,ang,model) + //THERE CAN ONLY BE ONE TRUE HERO + local prevs = ents.FindByClass("button_elec") + if prevs[1] != nil then + prevs[1]:Remove() + end + + local ent = ents.Create( "button_elec" ) + ent:SetPos( pos ) + ent:SetAngles( ang ) + ent:Spawn() + ent:PhysicsInit( SOLID_VPHYSICS ) + + local phys = ent:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end +end + +function nz.Mapping.Functions.BlockSpawn(pos,ang,model) + local block = ents.Create( "wall_block" ) + block:SetModel( model ) + block:SetPos( pos ) + block:SetAngles( ang ) + block:Spawn() + block:PhysicsInit( SOLID_VPHYSICS ) + + local phys = block:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end +end + +function nz.Mapping.Functions.BoxSpawn(pos,ang) + local box = ents.Create( "random_box_spawns" ) + box:SetPos( pos ) + box:SetAngles( ang ) + box:Spawn() + box:PhysicsInit( SOLID_VPHYSICS ) +end + +function nz.Mapping.Functions.PerkMachine(pos, ang, id) + local perkData = nz.Perks.Functions.Get(id) + + local perk = ents.Create("perk_machine") + perk:SetPerkID(id) + perk:TurnOff() + perk:SetPos(pos) + perk:SetAngles(ang) + perk:Spawn() + perk:Activate() + perk:PhysicsInit( SOLID_VPHYSICS ) + + local phys = perk:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end +end + +function nz.Mapping.Functions.BreakEntry(pos,ang) + local entry = ents.Create( "breakable_entry" ) + entry:SetPos( pos ) + entry:SetAngles( ang ) + entry:Spawn() + entry:PhysicsInit( SOLID_VPHYSICS ) + + local phys = entry:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end +end + +function nz.Mapping.Functions.EasterEgg(pos,ang,model) + local egg = ents.Create( "easter_egg" ) + egg:SetModel( model ) + egg:SetPos( pos ) + egg:SetAngles( ang ) + egg:Spawn() + + local phys = egg:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end +end + +//Physgun Hooks +function nz.Mapping.Functions.OnPhysgunPickup( ply, ent ) + local class = ent:GetClass() + if ( class == "prop_buys" or class == "wall_block" or class == "breakable_entry" ) then + //Ghost the entity so we can put them in walls. + local phys = ent:GetPhysicsObject() + phys:EnableCollisions(false) + end + +end + +function nz.Mapping.Functions.OnPhysgunDrop( ply, ent ) + local class = ent:GetClass() + if ( class == "prop_buys" or class == "wall_block" or class == "breakable_entry" ) then + //Unghost the entity so we can put them in walls. + local phys = ent:GetPhysicsObject() + phys:EnableCollisions(true) + end + +end + +hook.Add( "PhysgunPickup", "nz.OnPhysPick", nz.Mapping.Functions.OnPhysgunPickup ) +hook.Add( "PhysgunDrop", "nz.OnDrop", nz.Mapping.Functions.OnPhysgunDrop ) diff --git a/gamemode/mapping/sv_saveload.lua b/nzombies3/gamemode/mapping/sv_saveload.lua similarity index 57% rename from gamemode/mapping/sv_saveload.lua rename to nzombies3/gamemode/mapping/sv_saveload.lua index 307ef676..f71b68c1 100644 --- a/gamemode/mapping/sv_saveload.lua +++ b/nzombies3/gamemode/mapping/sv_saveload.lua @@ -1,59 +1,53 @@ -//Config Saver -nz.Mapping = {} -nz.Mapping.Functions = {} -nz.Mapping.LastSave = "Unsaved" +// + +nz.Mapping.Data.Version = 381 //Note to Ali; Any time you make an update to the way this is saved, increment this. function nz.Mapping.Functions.SaveConfig() + local main = {} + //Check if the nz folder exists if !file.Exists( "nz/", "DATA" ) then file.CreateDir( "nz" ) end - local wall_buys = {} - for k,v in pairs(ents.FindByClass("wall_buy")) do - table.insert(wall_buys, { - pos = v:GetPos(), - wep = v.WeaponGive, - price = v.Price, - angle = v:GetAngles( ), - }) - end - + + main.version = nz.Mapping.Data.Version + local zed_spawns = {} for k,v in pairs(ents.FindByClass("zed_spawns")) do table.insert(zed_spawns, { pos = v:GetPos(), - link = v.Link + link = v.link }) end - + local player_spawns = {} for k,v in pairs(ents.FindByClass("player_spawns")) do table.insert(player_spawns, { pos = v:GetPos(), }) end - - //Normal Map doors - local door_setup = {} - for k,v in pairs(nz.Doors.Data.LinkFlags) do - v = nz.Doors.Functions.doorIndexToEnt(k) - if v:IsDoor() and v:GetClass() != "wall_block_buy" then - door_setup[k] = { - flags = v.Data, - } - end - end - - local block_spawns = {} - for k,v in pairs(ents.FindByClass("wall_block")) do - table.insert(block_spawns, { + + local wall_buys = {} + for k,v in pairs(ents.FindByClass("wall_buys")) do + table.insert(wall_buys, { pos = v:GetPos(), + wep = v.WeaponGive, + price = v.Price, angle = v:GetAngles( ), + }) + end + + local buyableprop_spawns = {} + for k,v in pairs(ents.FindByClass("prop_buys")) do + table.insert(buyableprop_spawns, { + pos = v:GetPos(), + angle = v:GetAngles(), model = v:GetModel(), + flags = v.Data, }) end - + local elec_spawn = {} for k,v in pairs(ents.FindByClass("button_elec")) do table.insert(elec_spawn, { @@ -62,7 +56,16 @@ function nz.Mapping.Functions.SaveConfig() model = v:GetModel(), }) end - + + local block_spawns = {} + for k,v in pairs(ents.FindByClass("wall_block")) do + table.insert(block_spawns, { + pos = v:GetPos(), + angle = v:GetAngles( ), + model = v:GetModel(), + }) + end + local randombox_spawn = {} for k,v in pairs(ents.FindByClass("random_box_spawns")) do table.insert(randombox_spawn, { @@ -70,7 +73,7 @@ function nz.Mapping.Functions.SaveConfig() angle = v:GetAngles(), }) end - + local perk_machinespawns = {} for k,v in pairs(ents.FindByClass("perk_machine")) do table.insert(perk_machinespawns, { @@ -79,165 +82,210 @@ function nz.Mapping.Functions.SaveConfig() id = v:GetPerkID(), }) end - - local buyableblock_spawns = {} - for k,v in pairs(ents.FindByClass("wall_block_buy")) do - table.insert(buyableblock_spawns, { - pos = v:GetPos(), - angle = v:GetAngles(), - model = v:GetModel(), - flags = v.Data, + + //Normal Map doors + local door_setup = {} + for k,v in pairs(nz.Doors.Data.LinkFlags) do + v = nz.Doors.Functions.doorIndexToEnt(k) + if v:IsDoor() then + door_setup[k] = { + flags = v.Data, + } + end + end + + //barricades + local break_entry = {} + for k,v in pairs(ents.FindByClass("breakable_entry")) do + table.insert(break_entry, { + pos = v:GetPos(), + angle = v:GetAngles(), }) end - - local eggs = {} + + //Easter Eggs + local easter_eggs = {} for k,v in pairs(ents.FindByClass("easter_egg")) do - table.insert(eggs, { - pos = v:GetPos(), - angle = v:GetAngles( ), - model = v:GetModel(), + table.insert(easter_eggs, { + pos = v:GetPos(), + angle = v:GetAngles(), + model = v:GetModel(), }) end - - main["WallBuys"] = wall_buys + main["ZedSpawns"] = zed_spawns main["PlayerSpawns"] = player_spawns - main["DoorSetup"] = door_setup - main["BlockSpawns"] = block_spawns - main["BuyableBlockSpawns"] = buyableblock_spawns + main["WallBuys"] = wall_buys + main["BuyablePropSpawns"] = buyableprop_spawns main["ElecSpawns"] = elec_spawn + main["BlockSpawns"] = block_spawns main["RandomBoxSpawns"] = randombox_spawn main["PerkMachineSpawns"] = perk_machinespawns - main["EasterEggs"] = eggs - main["StartingWep"] = nz.Config.BaseStartingWeapons + main["DoorSetup"] = door_setup + main["BreakEntry"] = break_entry + main["EasterEggs"] = easter_eggs + file.Write( "nz/nz_"..game.GetMap( ).."_"..os.date("%H_%M_%j")..".txt", util.TableToJSON( main ) ) PrintMessage( HUD_PRINTTALK, "[NZ] Saved to garrysmod/data/nz/".."nz_"..game.GetMap( ).."_"..os.date("%H_%M_%j")..".txt" ) - nz.Mapping.LastSave = "nz/nz_"..game.GetMap( ).."_"..os.date("%H_%M_%j")..".txt" + end function nz.Mapping.Functions.ClearConfig() print("[NZ] Clearing current map") - - for k,v in pairs(ents.FindByClass("wall_buy")) do - v:Remove() - end - + for k,v in pairs(ents.FindByClass("zed_spawns")) do v:Remove() end - + for k,v in pairs(ents.FindByClass("player_spawns")) do v:Remove() end - - //Normal Map doors - for k,v in pairs(nz.Doors.Data.LinkFlags) do - nz.Doors.Functions.RemoveLink(k) + + for k,v in pairs(ents.FindByClass("wall_buys")) do + v:Remove() end - - for k,v in pairs(ents.FindByClass("wall_block")) do + + for k,v in pairs(ents.FindByClass("prop_buys")) do v:Remove() end - + for k,v in pairs(ents.FindByClass("button_elec")) do v:Remove() end - + + for k,v in pairs(ents.FindByClass("wall_block")) do + v:Remove() + end + for k,v in pairs(ents.FindByClass("random_box_spawns")) do v:Remove() end - + for k,v in pairs(ents.FindByClass("perk_machine")) do v:Remove() end - - for k,v in pairs(ents.FindByClass("wall_block_buy")) do - nz.Doors.Functions.RemoveLinkSpec( v ) + + //Normal Map doors + for k,v in pairs(nz.Doors.Data.LinkFlags) do + nz.Doors.Functions.RemoveMapDoorLink( k ) + end + + for k,v in pairs(ents.FindByClass("breakable_entry")) do v:Remove() end for k,v in pairs(ents.FindByClass("easter_egg")) do v:Remove() end - - nz.Rounds.Functions.SyncClients() - nz.Doors.Functions.SyncClients() + + //Sync + nz.Rounds.Functions.SendSync() + nz.Doors.Functions.SendSync() end function nz.Mapping.Functions.LoadConfig( name ) - local filepath = "nz/"..name..".txt" + + local filepath = "nz/"..name + if file.Exists( filepath, "DATA" ) then - nz.Mapping.LastSave = filepath print("[NZ] MAP CONFIG FOUND!") - - nz.Mapping.Functions.ClearConfig() - + + + local data = util.JSONToTable( file.Read( filepath, "DATA" ) ) - //Start sorting the data - for k,v in pairs(data.BuyableBlockSpawns) do - BuyableBlockSpawn(v.pos, v.angle, v.model, v.flags) + + local version = data.version + + //Check the version of the config. + if version == nil then + print("This map config is too out of date to be used. Sorry about that!") + return end - - for k,v in pairs(data.WallBuys) do - WeaponBuySpawn(v.pos,v.wep, v.price, v.angle) + + if version < nz.Mapping.Data.Version then + print("Warning: This map config was made with an older version of nZombies. After this has loaded, use the save command to save a newer version.") + end + + if version < 300 then + print("Warning: Inital Version: No changes have been made.") + end + + if version < 350 then + print("Warning: This map config does not contain any set barricades.") + end + + if version < 381 then + print("Warning: This map config does not contain any easter eggs.") end - + + nz.Mapping.Functions.ClearConfig() + + print("[NZ] Loading " .. filepath .. "...") + + + //Start sorting the data + for k,v in pairs(data.ZedSpawns) do - if v.link == nil then - ZedSpawn(v.pos, "0") - else - ZedSpawn(v.pos, v.link) - end + nz.Mapping.Functions.ZedSpawn(v.pos, v.link) end - + for k,v in pairs(data.PlayerSpawns) do - PlayerSpawn(v.pos) + nz.Mapping.Functions.PlayerSpawn(v.pos) end - - for k,v in pairs(data.DoorSetup) do - nz.Doors.Functions.CreateLink(k, v.flags) + + for k,v in pairs(data.WallBuys) do + nz.Mapping.Functions.WallBuy(v.pos,v.wep, v.price, v.angle) end - - for k,v in pairs(data.BlockSpawns) do - BlockSpawn(v.pos, v.angle, v.model) + + for k,v in pairs(data.BuyablePropSpawns) do + nz.Mapping.Functions.PropBuy(v.pos, v.angle, v.model, v.flags) end - + for k,v in pairs(data.ElecSpawns) do - ElecSpawn(v.pos, v.angle, v.model) + nz.Mapping.Functions.Electric(v.pos, v.angle, v.model) + end + + for k,v in pairs(data.BlockSpawns) do + nz.Mapping.Functions.BlockSpawn(v.pos, v.angle, v.model) end - + for k,v in pairs(data.RandomBoxSpawns) do - RandomBoxSpawn(v.pos, v.angle) + nz.Mapping.Functions.BoxSpawn(v.pos, v.angle) end for k,v in pairs(data.PerkMachineSpawns) do - PerkMachineSpawn(v.pos, v.angle, v.id) + nz.Mapping.Functions.PerkMachine(v.pos, v.angle, v.id) end - - for k,v in pairs(data.EasterEggs) do - EasterEggSpawn(v.pos, v.angle, v.model) + + //Normal Map doors + for k,v in pairs(data.DoorSetup) do + nz.Doors.Functions.CreateMapDoorLink(k, v.flags) end - - if data.StartingWep != nil then - print("CHANGING") - if nz.Config.CustomConfigStartingWeps then - nz.Config.BaseStartingWeapons = data.StartingWep + + if version >= 350 then + //Barricades + for k,v in pairs(data.BreakEntry) do + nz.Mapping.Functions.BreakEntry(v.pos, v.angle) end - else - print("NOT CHANGING") end - - nz.Rounds.Functions.SyncClients() - nz.Doors.Functions.SyncClients() - timer.Simple(20, function() print("SENDING DELAYED SYNC") nz.Rounds.Functions.SyncClients() nz.Doors.Functions.SyncClients() end) + + if version >= 381 then + //Easter Eggs + for k,v in pairs(data.EasterEggs) do + nz.Mapping.Functions.EasterEgg(v.pos, v.angle, v.model) + end + end + + print("[NZ] Finished loading map config.") else print(filepath) print("[NZ] Warning: NO MAP CONFIG FOUND! Make a config in game using the /create command, then use /save to save it all!") end + end hook.Add("Initialize", "nz_Loadmaps", function() timer.Simple(5, function() - nz.Mapping.Functions.LoadConfig("nz_"..game.GetMap()) + nz.Mapping.Functions.LoadConfig("nz_"..game.GetMap()..".txt") end) end) diff --git a/nzombies3/gamemode/mapping/sv_validation.lua b/nzombies3/gamemode/mapping/sv_validation.lua new file mode 100644 index 00000000..db8dc054 --- /dev/null +++ b/nzombies3/gamemode/mapping/sv_validation.lua @@ -0,0 +1,35 @@ +// + +function nz.Mapping.Functions.CheckSpawns() + + //Check Player spawns + if #ents.FindByClass("player_spawns") == 0 then + for k,v in pairs(player.GetAll()) do + nz.Rounds.Functions.UnReady(v, "You have been set to un-ready since the map does not have enough player spawns placed.") + end + return false + end + + //Check Zombie Spawns + if #ents.FindByClass("zed_spawns") == 0 then + for k,v in pairs(player.GetAll()) do + nz.Rounds.Functions.UnReady(v, "You have been set to un-ready since the map does not have enough zombie spawns placed.") + end + return false + end + + return true +end + +function nz.Mapping.Functions.CheckEnoughPlayerSpawns() + + //Check Player spawns + if #ents.FindByClass("player_spawns") < #player.GetAll() then + for k,v in pairs(player.GetAll()) do + nz.Rounds.Functions.UnReady(v, "You have been set to un-ready since the map does not have enough player spawns placed.") + end + return false + end + + return true +end \ No newline at end of file diff --git a/nzombies3/gamemode/misc/sh_constructor.lua b/nzombies3/gamemode/misc/sh_constructor.lua new file mode 100644 index 00000000..63407406 --- /dev/null +++ b/nzombies3/gamemode/misc/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Misc = {} +nz.Misc.Functions = {} +nz.Misc.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/misc/sh_weightedrandom.lua b/nzombies3/gamemode/misc/sh_weightedrandom.lua new file mode 100644 index 00000000..f984f79e --- /dev/null +++ b/nzombies3/gamemode/misc/sh_weightedrandom.lua @@ -0,0 +1,24 @@ +//http://snippets.luacode.org/snippets/Weighted_random_choice_104 + +local function weighted_total(choices) + local total = 0 + for choice, weight in pairs(choices) do + total = total + weight + end + return total +end + +local function weighted_random_choice( choices ) + local threshold = math.random(0, weighted_total(choices)) + local last_choice + for choice, weight in pairs(choices) do + threshold = threshold - weight + if threshold <= 0 then return choice end + last_choice = choice + end + return last_choice +end + +function nz.Misc.Functions.WeightedRandom(choices) + return weighted_random_choice(choices) +end \ No newline at end of file diff --git a/nzombies3/gamemode/misc/sv_autoreload.lua b/nzombies3/gamemode/misc/sv_autoreload.lua new file mode 100644 index 00000000..3a76d986 --- /dev/null +++ b/nzombies3/gamemode/misc/sv_autoreload.lua @@ -0,0 +1,17 @@ +function GM:OnReloaded( ) + print("Reloading Data!") + //Reload the data from the entities back into the tables + //Door data + for k,v in pairs(ents.GetAll()) do + if v:IsDoor() or v:IsBuyableProp() then + local data = v.Data + if data != nil then + nz.Doors.Functions.CreateLink(v, data) + end + end + end + + + nz.Players.Functions.FullSync( ply ) + +end \ No newline at end of file diff --git a/nzombies3/gamemode/misc/sv_chatcommands.lua b/nzombies3/gamemode/misc/sv_chatcommands.lua new file mode 100644 index 00000000..c58b889d --- /dev/null +++ b/nzombies3/gamemode/misc/sv_chatcommands.lua @@ -0,0 +1,105 @@ +//Chat Commands + +//Setup +nz.Misc.Data.ChatCommands = {} + +//Functions +function nz.Misc.Functions.NewChatCommand(text, func) + table.insert(nz.Misc.Data.ChatCommands, {text, func}) +end + +//Hooks +hook.Add( "PlayerSay", "chatCommand", function( ply, text, public ) + local text = string.lower(text) + for k,v in pairs(nz.Misc.Data.ChatCommands) do + if (string.sub(text, 1, string.len(v[1])) == v[1]) then + v[2](ply, text) + return false + end + end +end ) + +//Quick Function +NewChatCommand = nz.Misc.Functions.NewChatCommand + +// Actual Chat Commands + +NewChatCommand("/ready", function(ply, text) + nz.Rounds.Functions.ReadyUp(ply) +end) + +NewChatCommand("/unready", function(ply, text) + nz.Rounds.Functions.UnReady(ply) +end) + +NewChatCommand("/dropin", function(ply, text) + nz.Rounds.Functions.DropIn(ply) +end) + +NewChatCommand("/dropout", function(ply, text) + nz.Rounds.Functions.DropOut(ply) +end) + +NewChatCommand("/create", function(ply, text) + if ply:IsSuperAdmin() then + nz.Rounds.Functions.CreateMode() + end +end) + +NewChatCommand("/generate", function(ply, text) + if ply:IsSuperAdmin() then + if #ents.FindByClass("info_player_start") > 0 then + navmesh.BeginGeneration( ) + else + ply:PrintMessage( HUD_PRINTTALK, "[NZ] There were no walkable seeds found. Please stand on the ground, and use /forcegenerate." ) + end + end +end) + +NewChatCommand("/save", function(ply, text) + if ply:IsSuperAdmin() then + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + nz.Mapping.Functions.SaveConfig() + else + ply:PrintMessage( HUD_PRINTTALK, "[NZ] You can't save outside of create mode." ) + end + end +end) + +NewChatCommand("/forcegenerate", function(ply, text) + if ply:IsSuperAdmin() then + local ent = ents.Create("info_player_start") + ent:SetPos(ply:GetPos()) + ent:Spawn() + navmesh.BeginGeneration( ) + end +end) + +NewChatCommand("/load", function(ply, text) + if ply:IsSuperAdmin() then + if nz.Rounds.Data.CurrentState == ROUND_CREATE or nz.Rounds.Data.CurrentState == ROUND_INIT then + nz.Interfaces.Functions.SendInterface(ply, "ConfigLoader", {configs = file.Find( "nz/nz_"..game.GetMap( ).."*", "DATA" )}) + else + ply:PrintMessage( HUD_PRINTTALK, "[NZ] You can't load while playing!" ) + end + end +end) + +//Tests + +NewChatCommand("/spec", function(ply, text) + ply:PermSpec() +end) + +NewChatCommand("/soundcheck", function(ply, text) + if ply:IsSuperAdmin() then + nz.Notifications.Functions.PlaySound("nz/powerups/double_points.mp3", 1) + nz.Notifications.Functions.PlaySound("nz/powerups/insta_kill.mp3", 2) + nz.Notifications.Functions.PlaySound("nz/powerups/max_ammo.mp3", 2) + nz.Notifications.Functions.PlaySound("nz/powerups/nuke.mp3", 2) + + nz.Notifications.Functions.PlaySound("nz/round/round_start.mp3", 14) + nz.Notifications.Functions.PlaySound("nz/round/round_end.mp3", 9) + nz.Notifications.Functions.PlaySound("nz/round/game_over_4.mp3", 21) + end +end) diff --git a/nzombies3/gamemode/misc/sv_consolecommands.lua b/nzombies3/gamemode/misc/sv_consolecommands.lua new file mode 100644 index 00000000..099ddf3b --- /dev/null +++ b/nzombies3/gamemode/misc/sv_consolecommands.lua @@ -0,0 +1,39 @@ +//Chat Commands + +//Setup +nz.Misc.Data.ConsoleCommands = {} + +//Functions +function nz.Misc.Functions.NewConsoleCommand(text, func) + //For Future Use + table.insert(nz.Misc.Data.ConsoleCommands, {text, func}) + //Console Command usage + concommand.Add( text, func ) +end + +//Quick Function +NewConsoleCommand = nz.Misc.Functions.NewConsoleCommand + +// Actual Commands + +//Quick reload for dedicated severs +NewConsoleCommand("qr", function() + RunConsoleCommand("changelevel", game.GetMap()) +end) + +NewConsoleCommand("PrintWeps", function() + for k,v in pairs( weapons.GetList() ) do + print( v.ClassName ) + end +end) + +NewConsoleCommand("doorId", function() + local tr = util.TraceLine( util.GetPlayerTrace( player.GetByID(1) ) ) + if IsValid( tr.Entity ) then print( tr.Entity:doorIndex() ) end +end) + +NewConsoleCommand("test1", function() + nz.Doors.Functions.CreateMapDoorLink( 1236, "price=500,elec=0,link=1" ) + + timer.Simple(5, function() nz.Doors.Functions.RemoveMapDoorLink( 1236 ) end) +end) \ No newline at end of file diff --git a/nzombies3/gamemode/misc/sv_resources.lua b/nzombies3/gamemode/misc/sv_resources.lua new file mode 100644 index 00000000..8e74d81c --- /dev/null +++ b/nzombies3/gamemode/misc/sv_resources.lua @@ -0,0 +1,8 @@ +//Fonts (Since they don't work with workshop) +resource.AddFile( "resource/fonts/DK Umbilical Noose.ttf" ) + +//Content Pack +resource.AddWorkshop( "485777655" ) + +//FAS2 Base Weapons +resource.AddWorkshop( "180507408" ) diff --git a/nzombies3/gamemode/notifications/sh_constructor.lua b/nzombies3/gamemode/notifications/sh_constructor.lua new file mode 100644 index 00000000..3aad6e4a --- /dev/null +++ b/nzombies3/gamemode/notifications/sh_constructor.lua @@ -0,0 +1,10 @@ +//Main Tables +nz.Notifications = {} +nz.Notifications.Functions = {} +nz.Notifications.Data = {} + +//_ Variables +if CLIENT then + nz.Notifications.Data.SoundQueue = {} + nz.Notifications.Data.NextSound = CurTime() +end diff --git a/nzombies3/gamemode/notifications/sh_sounds.lua b/nzombies3/gamemode/notifications/sh_sounds.lua new file mode 100644 index 00000000..3ecbc4d6 --- /dev/null +++ b/nzombies3/gamemode/notifications/sh_sounds.lua @@ -0,0 +1,34 @@ +// + +if SERVER then + + function nz.Notifications.Functions.PlaySound(path, delay) + nz.Notifications.Functions.SendRequest("sound", {path = path, delay = delay}) + end + +end + +if CLIENT then + + function nz.Notifications.Functions.AddSoundToQueue(data) + table.insert(nz.Notifications.Data.SoundQueue, data) + end + + function nz.Notifications.Functions.SoundHandler() + //Check we're allowed to play the next sound + if CurTime() > nz.Notifications.Data.NextSound then + //Check the queue + if nz.Notifications.Data.SoundQueue[1] != nil then + local data = nz.Notifications.Data.SoundQueue[1] + table.remove(nz.Notifications.Data.SoundQueue, 1) + surface.PlaySound( data.path ) + nz.Notifications.Data.NextSound = CurTime() + data.delay + end + end + end + + timer.Create("nz.Sound.Handler", 1, 0, nz.Notifications.Functions.SoundHandler) +end + + + diff --git a/nzombies3/gamemode/notifications/sh_sync.lua b/nzombies3/gamemode/notifications/sh_sync.lua new file mode 100644 index 00000000..9fa46119 --- /dev/null +++ b/nzombies3/gamemode/notifications/sh_sync.lua @@ -0,0 +1,32 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Notifications.Request" ) + + function nz.Notifications.Functions.SendRequest(header, data) + net.Start( "nz.Notifications.Request" ) + net.WriteString( header ) + net.WriteTable( data ) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Notifications.Functions.ReceiveRequest( length ) + print("Received Notifications Request") + local header = net.ReadString() + local data = net.ReadTable() + + if header == "sound" then + nz.Notifications.Functions.AddSoundToQueue(data) + end + end + + //Receivers + net.Receive( "nz.Notifications.Request", nz.Notifications.Functions.ReceiveRequest ) +end \ No newline at end of file diff --git a/nzombies3/gamemode/perks/sh_constructor.lua b/nzombies3/gamemode/perks/sh_constructor.lua new file mode 100644 index 00000000..b5ed3a5d --- /dev/null +++ b/nzombies3/gamemode/perks/sh_constructor.lua @@ -0,0 +1,8 @@ +//Main Tables +nz.Perks = {} +nz.Perks.Functions = {} +nz.Perks.Data = {} + +//_ Variables + +nz.Perks.Data.Players = {} \ No newline at end of file diff --git a/nzombies3/gamemode/perks/sh_meta.lua b/nzombies3/gamemode/perks/sh_meta.lua new file mode 100644 index 00000000..8d7054cb --- /dev/null +++ b/nzombies3/gamemode/perks/sh_meta.lua @@ -0,0 +1,53 @@ +local playerMeta = FindMetaTable("Player") +if SERVER then + + function playerMeta:GivePerk(id) + local perkData = nz.Perks.Functions.Get(id) + if perkData == nil then return end + + local given = perkData.func(id, self) + + if given then + if nz.Perks.Data.Players[self] == nil then nz.Perks.Data.Players[self] = {} end + table.insert(nz.Perks.Data.Players[self], id) + + nz.Perks.Functions.SendSync() + else + //We didn't want to give them the perk for some reason, so lets back out and refund them. + self:GivePoints(perkData.price) + end + end + + function playerMeta:RemovePerk(id) + local perkData = nz.Perks.Functions.Get(id) + if perkData == nil then return end + + if nz.Perks.Data.Players[self] == nil then nz.Perks.Data.Players[self] = {} end + if self:HasPerk(id) then + table.RemoveByValue( nz.Perks.Data.Players[self], id ) + end + nz.Perks.Functions.SendSync() + end + + function playerMeta:RemovePerks() + nz.Perks.Data.Players[self] = {} + nz.Perks.Functions.SendSync() + end + +end + +function playerMeta:HasPerk(id) + if nz.Perks.Data.Players[self] == nil then nz.Perks.Data.Players[self] = {} end + if table.HasValue(nz.Perks.Data.Players[self], id) then + return true + end + return false +end + +function playerMeta:GetPerks(id) + if nz.Perks.Data.Players[self] == nil then nz.Perks.Data.Players[self] = {} end + if (self.Perks) then + return self.Perks + end + return false +end \ No newline at end of file diff --git a/nzombies3/gamemode/perks/sh_perks.lua b/nzombies3/gamemode/perks/sh_perks.lua new file mode 100644 index 00000000..ccc8176e --- /dev/null +++ b/nzombies3/gamemode/perks/sh_perks.lua @@ -0,0 +1,121 @@ +// + +function nz.Perks.Functions.NewPerk(id, data) + if SERVER then + //Sanitise any client data. + else + data.Func = nil + end + nz.Perks.Data[id] = data +end + +function nz.Perks.Functions.Get(id) + return nz.Perks.Data[id] +end + +function nz.Perks.Functions.GetList() + local tbl = {} + + for k,v in pairs(nz.Perks.Data) do + tbl[k] = v.name + end + + return tbl +end + +nz.Perks.Functions.NewPerk("jugg", { + name = "Juggernog", + off_model = "models/alig96/perks/jugg/jugg_off.mdl", + on_model = "models/alig96/perks/jugg/jugg_on.mdl", + price = 100, + func = function(self, ply) + ply:SetMaxHealth(200) + ply:SetHealth(200) + return true + end, +}) + +nz.Perks.Functions.NewPerk("dtap", { + name = "Double Tap", + off_model = "models/alig96/perks/doubletap/doubletap_off.mdl", + on_model = "models/alig96/perks/doubletap/doubletap_on.mdl", + price = 100, + func = function(self, ply) + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if nz.Weps.Functions.IsFAS2( v ) then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + local str = "" + for k,v in pairs(tbl) do + nz.Weps.Functions.ApplyDTap( ply, v ) + str = str .. v.ClassName .. ", " + end + ply:PrintMessage( HUD_PRINTTALK, "Double Tap Applied to: " .. str) + return true + else + ply:PrintMessage( HUD_PRINTTALK, "You don't have a weapon that is compatible with this perk. (Requires a FAS2 weapon)") + return false + end + end, +}) + +nz.Perks.Functions.NewPerk("revive", { + name = "Quick Revive", + off_model = "models/alig96/perks/revive/revive_off.mdl", + on_model = "models/alig96/perks/revive/revive_on.mdl", + price = 100, + func = function(self, ply) + print(self) + ply:PrintMessage( HUD_PRINTTALK, "This perk doesn't have any functionality yet.") + return false + end, +}) + +nz.Perks.Functions.NewPerk("sleight", { + name = "Sleight of Hand", + off_model = "models/alig96/perks/sleight/sleight_off.mdl", + on_model = "models/alig96/perks/sleight/sleight_on.mdl", + price = 100, + func = function(self, ply) + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if nz.Weps.Functions.IsFAS2( v ) then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + local str = "" + for k,v in pairs(tbl) do + nz.Weps.Functions.ApplySleight( ply, v ) + str = str .. v.ClassName .. ", " + end + ply:PrintMessage( HUD_PRINTTALK, "Sleight of Hand Applied to: " .. str) + return true + else + ply:PrintMessage( HUD_PRINTTALK, "You don't have a weapon that is compatible with this perk. (Requires a FAS2 weapon)") + return false + end + end, +}) + +nz.Perks.Functions.NewPerk("pap", { + name = "Pack-a-Punch", + off_model = "models/alig96/perks/packapunch/packapunch.mdl", //Find a new model. + on_model = "models/alig96/perks/packapunch/packapunch.mdl", + price = 100, + func = function(self, ply) + local wep = ply:GetActiveWeapon() + if wep.pap != true then + ply:PrintMessage( HUD_PRINTTALK, "Pack-a-Punch applied to: " .. wep.ClassName) + nz.Weps.Functions.ApplyPaP( ply, wep ) + timer.Simple(2, function() ply:RemovePerk("pap") end) + return true + else + ply:PrintMessage( HUD_PRINTTALK, "This weapon is already pap'd") + return false + end + end, +}) diff --git a/nzombies3/gamemode/perks/sh_sync.lua b/nzombies3/gamemode/perks/sh_sync.lua new file mode 100644 index 00000000..07a76e1c --- /dev/null +++ b/nzombies3/gamemode/perks/sh_sync.lua @@ -0,0 +1,29 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Perks.Sync" ) + + function nz.Perks.Functions.SendSync() + local data = table.Copy(nz.Perks.Data.Players) + + net.Start( "nz.Perks.Sync" ) + net.WriteTable( data ) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Perks.Functions.ReceiveSync( length ) + print("Received Player Perks Sync") + nz.Perks.Data.Players = net.ReadTable() + PrintTable(nz.Perks.Data.Players) + end + + //Receivers + net.Receive( "nz.Perks.Sync", nz.Perks.Functions.ReceiveSync ) +end \ No newline at end of file diff --git a/nzombies3/gamemode/player_class/sh_constructor.lua b/nzombies3/gamemode/player_class/sh_constructor.lua new file mode 100644 index 00000000..bfd0206f --- /dev/null +++ b/nzombies3/gamemode/player_class/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Players = {} +nz.Players.Functions = {} +nz.Players.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/player_class/sh_player_create.lua b/nzombies3/gamemode/player_class/sh_player_create.lua new file mode 100644 index 00000000..db005203 --- /dev/null +++ b/nzombies3/gamemode/player_class/sh_player_create.lua @@ -0,0 +1,36 @@ +DEFINE_BASECLASS( "player_default" ) + +local PLAYER = {} + +-- +-- See gamemodes/base/player_class/player_default.lua for all overridable variables +-- +PLAYER.WalkSpeed = 300 +PLAYER.RunSpeed = 600 +PLAYER.CanUseFlashlight = true + +function PLAYER:Init() + //Don't forget Colours + //This runs when the player is first brought into the game + //print("create") +end + +function PLAYER:Loadout() + + //Creation Tools + self.Player:Give( "weapon_physgun" ) + self.Player:Give( "nz_tool_zed_spawns" ) + self.Player:Give( "nz_tool_player_spawns" ) + self.Player:Give( "nz_tool_wall_buys" ) + self.Player:Give( "nz_tool_prop_modifier" ) + self.Player:Give( "nz_tool_door_locker" ) + self.Player:Give( "nz_tool_elec" ) + self.Player:Give( "nz_tool_block_spawns" ) + self.Player:Give( "nz_tool_random_box" ) + self.Player:Give( "nz_tool_perk_machine" ) + self.Player:Give( "nz_tool_barricades" ) + self.Player:Give( "nz_tool_ee" ) + +end + +player_manager.RegisterClass( "player_create", PLAYER, "player_default" ) diff --git a/nzombies3/gamemode/player_class/sh_player_ingame.lua b/nzombies3/gamemode/player_class/sh_player_ingame.lua new file mode 100644 index 00000000..742d5437 --- /dev/null +++ b/nzombies3/gamemode/player_class/sh_player_ingame.lua @@ -0,0 +1,55 @@ +DEFINE_BASECLASS( "player_default" ) + +local PLAYER = {} + +-- +-- See gamemodes/base/player_class/player_default.lua for all overridable variables +-- +PLAYER.WalkSpeed = 100 +PLAYER.RunSpeed = 200 +PLAYER.CanUseFlashlight = true + +function PLAYER:Init() + //Don't forget Colours + //This runs when the player is first brought into the game and when they die during a round and are brought back + +end + +function PLAYER:Loadout() + //Give ammo and guns + for k,v in pairs(nz.Config.BaseStartingWeapons) do + self.Player:Give( v ) + end + nz.Weps.Functions.GiveMaxAmmo(self.Player) + + if FAS2_Attachments != nil then + for k,v in pairs(FAS2_Attachments) do + self.Player:FAS2_PickUpAttachment(v.key) + end + end + +end +function PLAYER:Spawn() + + if !self.Player:CanAfford(nz.Config.BaseStartingPoints) then //Has less than 500 points + //Poor guy has no money, lets start him off + self.Player:SetPoints(nz.Config.BaseStartingPoints) + end + + //Reset their perks + self.Player:RemovePerks() + + local spawns = ents.FindByClass("player_spawns") + //Get player number + for k,v in pairs(player.GetAll()) do + if v == self.Player then + if spawns[k]:IsValid() then + v:SetPos(spawns[k]:GetPos()) + else + print("No spawn set for player: " .. v:Nick()) + end + end + end +end + +player_manager.RegisterClass( "player_ingame", PLAYER, "player_default" ) diff --git a/nzombies3/gamemode/player_class/sv_players.lua b/nzombies3/gamemode/player_class/sv_players.lua new file mode 100644 index 00000000..a365c9eb --- /dev/null +++ b/nzombies3/gamemode/player_class/sv_players.lua @@ -0,0 +1,49 @@ +// + +function nz.Players.Functions.PlayerNoClip( ply, desiredState ) + if ply:Alive() and nz.Rounds.Data.CurrentState == ROUND_CREATE then + return ply:IsSuperAdmin() + end +end + +function nz.Players.Functions.FullSync( ply ) + //Electric + nz.Elec.Functions.SendSync() + //PowerUps + nz.PowerUps.Functions.SendSync() + //Doors + nz.Doors.Functions.SendSync() + //Perks + nz.Perks.Functions.SendSync() + //Rounds + nz.Rounds.Functions.SendSync() + //Fog + nz.Fog.Functions.SendSync() +end + +function nz.Players.Functions.PlayerInitialSpawn( ply ) + timer.Simple(1, function() + //Fully Sync + nz.Players.Functions.FullSync( ply ) + end) +end + +function nz.Players.Functions.PlayerDisconnected( ply ) + nz.Rounds.Functions.DropOut(ply) +end + +function nz.Players.Functions.FriendlyFire( ply, ent ) + if ent:IsPlayer() then + if ply:Team() == ent:Team() then + return false + end + end +end + +function GM:PlayerNoClip( ply, desiredState ) + return nz.Players.Functions.PlayerNoClip(ply, desiredState) +end + +hook.Add( "PlayerInitialSpawn", "nz.PlayerInitialSpawn", nz.Players.Functions.PlayerInitialSpawn ) +hook.Add( "PlayerShouldTakeDamage", "nz.FriendlyFire", nz.Players.Functions.FriendlyFire ) +hook.Add( "PlayerDisconnected", "nz.PlayerDisconnected", nz.Players.Functions.PlayerDisconnected ) diff --git a/gamemode/points/sh_meta.lua b/nzombies3/gamemode/points/sh_points.lua similarity index 91% rename from gamemode/points/sh_meta.lua rename to nzombies3/gamemode/points/sh_points.lua index ef931c2c..93ee446b 100644 --- a/gamemode/points/sh_meta.lua +++ b/nzombies3/gamemode/points/sh_points.lua @@ -21,7 +21,8 @@ if (SERVER) then -- Quick function to set the money to the current amount plus an amount specified. function _PLAYER:GivePoints(amount) - if nz.Rounds.Effects["dp"] == true then + //If double points is on. + if nz.PowerUps.Functions.IsPowerupActive("dp") then amount = amount * 2 end self:SetPoints(self:GetPoints() + amount) @@ -32,4 +33,4 @@ if (SERVER) then //Changed to prevent double points from removing double the points. - Don't even think of changing this back Ali, Love Ali. self:SetPoints(self:GetPoints() - amount) end -end +end \ No newline at end of file diff --git a/nzombies3/gamemode/powerups/sh_constructor.lua b/nzombies3/gamemode/powerups/sh_constructor.lua new file mode 100644 index 00000000..fdb2baf7 --- /dev/null +++ b/nzombies3/gamemode/powerups/sh_constructor.lua @@ -0,0 +1,8 @@ +//Main Tables +nz.PowerUps = {} +nz.PowerUps.Functions = {} +nz.PowerUps.Data = {} + +//_ Variables + +nz.PowerUps.Data.ActivePowerUps = {} \ No newline at end of file diff --git a/nzombies3/gamemode/powerups/sh_powerups.lua b/nzombies3/gamemode/powerups/sh_powerups.lua new file mode 100644 index 00000000..e474de65 --- /dev/null +++ b/nzombies3/gamemode/powerups/sh_powerups.lua @@ -0,0 +1,143 @@ +// + +if SERVER then + function nz.PowerUps.Functions.Activate(id, ply) + local powerupData = nz.PowerUps.Functions.Get(id) + + if powerupData.duration != 0 then + //Activate for a certain time + nz.PowerUps.Data.ActivePowerUps[id] = CurTime() + powerupData.duration + //else + //Activate Once + + end + + //Notify + + powerupData.func(id, ply) + + //Sync + nz.PowerUps.Functions.SendSync() + end + + function nz.PowerUps.Functions.SpawnPowerUp(pos) + local choices = {} + local total = 0 + + //Chance it + for k,v in pairs(nz.PowerUps.Data) do + if k != "ActivePowerUps" then + choices[k] = v.chance + total = total + v.chance + end + end + + //Insert a blank // Change 100 to increase the blank + choices["null"] = 500 - total + + local id = nz.Misc.Functions.WeightedRandom(choices) + if id == "null" then return end // Back out + + //Spawn it + local powerupData = nz.PowerUps.Functions.Get(id) + + local pos = pos+Vector(0,0,50) + local ent = ents.Create("drop_powerup") + ent:SetPowerUp(id) + pos.z = pos.z - ent:OBBMaxs().z + ent:SetModel(powerupData.model) + ent:SetPos(pos) + ent:Spawn() + end + +end + +function nz.PowerUps.Functions.IsPowerupActive(id) + + local time = nz.PowerUps.Data.ActivePowerUps[id] + + if time != nil then + //Check if it is still within the time. + if CurTime() > time then + //Expired + nz.PowerUps.Data.ActivePowerUps[id] = nil + else + return true + end + end + + return false + +end + +function nz.PowerUps.Functions.AllActivePowerUps() + + return nz.PowerUps.Data.ActivePowerUps + +end + +function nz.PowerUps.Functions.NewPowerUp(id, data) + if SERVER then + //Sanitise any client data. + else + data.Func = nil + end + nz.PowerUps.Data[id] = data +end + +function nz.PowerUps.Functions.Get(id) + return nz.PowerUps.Data[id] +end + +//Double Points +nz.PowerUps.Functions.NewPowerUp("dp", { + name = "Double Points", + model = "models/props_c17/gravestone003a.mdl", + scale = 0.5, + chance = 5, + duration = 30, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/double_points.mp3", 1) + end), +}) + +//Max Ammo +nz.PowerUps.Functions.NewPowerUp("maxammo", { + name = "Max Ammo", + model = "models/Items/BoxSRounds.mdl", + scale = 1.5, + chance = 5, + duration = 0, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/max_ammo.mp3", 2) + //Give everyone ammo + for k,v in pairs(player.GetAll()) do + nz.Weps.Functions.GiveMaxAmmo(v) + end + end), +}) + +//Insta Kill +nz.PowerUps.Functions.NewPowerUp("insta", { + name = "Insta Kill", + model = "models/Gibs/HGIBS.mdl", + scale = 3, + chance = 5, + duration = 30, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/insta_kill.mp3", 1) + end), +}) + +//Nuke +nz.PowerUps.Functions.NewPowerUp("nuke", { + name = "Nuke", + model = "models/props_junk/watermelon01.mdl", + scale = 1.5, + chance = 5, + duration = 0, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/nuke.mp3", 1) + nz.PowerUps.Functions.Nuke() + end), +}) diff --git a/nzombies3/gamemode/powerups/sh_sync.lua b/nzombies3/gamemode/powerups/sh_sync.lua new file mode 100644 index 00000000..b2e58b73 --- /dev/null +++ b/nzombies3/gamemode/powerups/sh_sync.lua @@ -0,0 +1,29 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.PowerUps.Sync" ) + + function nz.PowerUps.Functions.SendSync() + local data = table.Copy(nz.PowerUps.Data.ActivePowerUps) + + net.Start( "nz.PowerUps.Sync" ) + net.WriteTable( data ) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.PowerUps.Functions.ReceiveSync( length ) + print("Received PowerUps Sync") + nz.PowerUps.Data.ActivePowerUps = net.ReadTable() + PrintTable(nz.PowerUps.Data.ActivePowerUps) + end + + //Receivers + net.Receive( "nz.PowerUps.Sync", nz.PowerUps.Functions.ReceiveSync ) +end \ No newline at end of file diff --git a/nzombies3/gamemode/powerups/sv_powerups.lua b/nzombies3/gamemode/powerups/sv_powerups.lua new file mode 100644 index 00000000..d133f4e6 --- /dev/null +++ b/nzombies3/gamemode/powerups/sv_powerups.lua @@ -0,0 +1,36 @@ +// + +function nz.PowerUps.Functions.Nuke() + //Kill them all + for k,v in pairs(nz.Config.ValidEnemies) do + for k2,enemy in pairs(ents.FindByClass(v)) do + if enemy:IsValid() then + local insta = DamageInfo() + insta:SetDamage(enemy:Health()) + insta:SetAttacker(Entity(0)) + insta:SetDamageType(DMG_BLAST_SURFACE) + //Delay so it doesn't "die" twice + timer.Simple(0.1, function() if enemy:IsValid() then enemy:TakeDamageInfo( insta ) end end) + end + end + end + + //Give the players a set amount of points + for k,v in pairs(player.GetAll()) do + if v:IsPlayer() then + v:GivePoints(500) + end + end +end + +function nz.PowerUps.Functions.CleanUp() + //Clear all powerups + for k,v in pairs(ents.FindByClass("drop_powerup")) do + v:Remove() + end + + //Turn off all modifiers + table.Empty(nz.PowerUps.Data.ActivePowerUps) + //Sync + nz.PowerUps.Functions.SendSync() +end \ No newline at end of file diff --git a/nzombies3/gamemode/props_menu/cl_menu.lua b/nzombies3/gamemode/props_menu/cl_menu.lua new file mode 100644 index 00000000..bd8a5ca9 --- /dev/null +++ b/nzombies3/gamemode/props_menu/cl_menu.lua @@ -0,0 +1,75 @@ + +function nz.PropsMenu.Functions.Create( ) + + //Create a Frame to contain everything. + nz.PropsMenu.Data.MainFrame = vgui.Create( "DFrame" ) + nz.PropsMenu.Data.MainFrame:SetTitle( "Props Menu" ) + nz.PropsMenu.Data.MainFrame:SetSize( 375, 240 ) + nz.PropsMenu.Data.MainFrame:Center() + nz.PropsMenu.Data.MainFrame:MakePopup() + nz.PropsMenu.Data.MainFrame:ShowCloseButton( false ) + nz.PropsMenu.Data.MainFrame:SetVisible( false ) + + local PropertySheet = vgui.Create( "DPropertySheet", nz.PropsMenu.Data.MainFrame ) + PropertySheet:SetPos( 10, 30 ) + PropertySheet:SetSize( 355, 200 ) + + //Loop to make all the tabs + local tabs = {} + tabs.Scrolls = {} + tabs.Lists = {} + + for k,v in pairs(nz.PropsMenu.Data.Categorys) do + tabs.Scrolls[k] = vgui.Create( "DScrollPanel", nz.PropsMenu.Data.MainFrame ) + tabs.Scrolls[k]:SetSize( 355, 200 ) + tabs.Scrolls[k]:SetPos( 10, 30 ) + + tabs.Lists[k] = vgui.Create( "DIconLayout", tabs.Scrolls[k] ) + tabs.Lists[k]:SetSize( 340, 200 ) + tabs.Lists[k]:SetPos( 0, 0 ) + tabs.Lists[k]:SetSpaceY( 5 ) //Sets the space in between the panels on the X Axis by 5 + tabs.Lists[k]:SetSpaceX( 5 ) //Sets the space in between the panels on the Y Axis by 5 + if v == true then v = nil end + PropertySheet:AddSheet( k, tabs.Scrolls[k], nil, false, false, v ) + end + + + + for k,v in pairs(nz.PropsMenu.Data.Models) do //Make a loop to create a bunch of panels inside of the DIconLayout + local ListItem = tabs.Lists[v[1]]:Add( "SpawnIcon" ) //Add DPanel to the DIconLayout + ListItem:SetSize( 40, 40 ) //Set the size of it + ListItem:SetModel(v[2]) + ListItem.Model = v[2] + ListItem.DoClick = function( item ) + nz.PropsMenu.Functions.Request(item.Model) + surface.PlaySound( "ui/buttonclickrelease.wav" ) + end + //You don't need to set the position, that is done automatically. + + end + +end + +function nz.PropsMenu.Functions.Open() + //Check if we're in create mode + if nz.Rounds.Data.CurrentState == ROUND_CREATE and LocalPlayer():IsSuperAdmin() then + if nz.PropsMenu.Data.MainFrame == nil then + nz.PropsMenu.Functions.Create() + end + + nz.PropsMenu.Data.MainFrame:SetVisible( true ) + end +end + +function nz.PropsMenu.Functions.Close() + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + if nz.PropsMenu.Data.MainFrame == nil then + nz.PropsMenu.Functions.Create() + end + + nz.PropsMenu.Data.MainFrame:SetVisible( false ) + end +end + +hook.Add( "OnSpawnMenuOpen", "OpenSpawnMenu", nz.PropsMenu.Functions.Open ) +hook.Add( "OnSpawnMenuClose", "CloseSpawnMenu", nz.PropsMenu.Functions.Close ) diff --git a/nzombies3/gamemode/props_menu/sh_constructor.lua b/nzombies3/gamemode/props_menu/sh_constructor.lua new file mode 100644 index 00000000..11c71a52 --- /dev/null +++ b/nzombies3/gamemode/props_menu/sh_constructor.lua @@ -0,0 +1,8 @@ +//Main Tables +nz.PropsMenu = {} +nz.PropsMenu.Functions = {} +nz.PropsMenu.Data = {} + +//sh_populate +nz.PropsMenu.Data.Models = {} +nz.PropsMenu.Data.Categorys = {} \ No newline at end of file diff --git a/nzombies3/gamemode/props_menu/sh_net.lua b/nzombies3/gamemode/props_menu/sh_net.lua new file mode 100644 index 00000000..1800e61a --- /dev/null +++ b/nzombies3/gamemode/props_menu/sh_net.lua @@ -0,0 +1,40 @@ +//Client Server Syncing + +if CLIENT then + + //Client to Server (Client) + function nz.PropsMenu.Functions.Request( model ) + net.Start( "nz.PropsMenu.Request" ) + net.WriteString( model ) + net.SendToServer() + end + +end + +if SERVER then + + //Client to Server (Server) + util.AddNetworkString( "nz.PropsMenu.Request" ) + + function nz.PropsMenu.Functions.HandleRequest( len, ply ) + local model = net.ReadString() + if nz.Rounds.Data.CurrentState == ROUND_CREATE then + print(ply:Nick() .. " requested prop " .. model) + if ply:IsSuperAdmin() then + local tr = util.GetPlayerTrace( ply ) + tr.mask = bit.bor( CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX ) + local trace = util.TraceLine( tr ) + + nz.Mapping.Functions.PropBuy(trace.HitPos,Angle(0,0,0),model) + //Since we're adding a prop, lets switch to the phys gun for convenience + ply:SelectWeapon( "weapon_physgun" ) + else + print("Denied request from " .. ply:Nick()) + end + end + end + + //Receivers + net.Receive( "nz.PropsMenu.Request", nz.PropsMenu.Functions.HandleRequest ) + +end diff --git a/nzombies3/gamemode/props_menu/sh_populate.lua b/nzombies3/gamemode/props_menu/sh_populate.lua new file mode 100644 index 00000000..196e73e5 --- /dev/null +++ b/nzombies3/gamemode/props_menu/sh_populate.lua @@ -0,0 +1,24 @@ +// + +function nz.PropsMenu.Functions.AddNewCategory( text, tooltip ) + if tooltip == nil then + tooltip = true + end + nz.PropsMenu.Data.Categorys[text] = tooltip +end + +function nz.PropsMenu.Functions.AddNewModel( cat, model ) + table.insert(nz.PropsMenu.Data.Models, {cat, model}) +end + +//QuickFunctions + +PropMenuAddCat = nz.PropsMenu.Functions.AddNewCategory +PropMenuAddModel = nz.PropsMenu.Functions.AddNewModel + +//Use +PropMenuAddCat("Gates") +PropMenuAddModel("Gates", "models/props_c17/fence03a.mdl") + +PropMenuAddCat("Scenery") +PropMenuAddModel("Scenery", "models/props_borealis/bluebarrel001.mdl") diff --git a/nzombies3/gamemode/random_box/sh_constructor.lua b/nzombies3/gamemode/random_box/sh_constructor.lua new file mode 100644 index 00000000..2ebe7ee2 --- /dev/null +++ b/nzombies3/gamemode/random_box/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.RandomBox = {} +nz.RandomBox.Functions = {} +nz.RandomBox.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/random_box/sv_random_box.lua b/nzombies3/gamemode/random_box/sv_random_box.lua new file mode 100644 index 00000000..f858a145 --- /dev/null +++ b/nzombies3/gamemode/random_box/sv_random_box.lua @@ -0,0 +1,62 @@ +// + +function nz.RandomBox.Functions.SpawnBox() + //Get all spawns + local all = ents.FindByClass("random_box_spawns") + local rand = table.Random(all) + + if rand != nil then + local box = ents.Create( "random_box" ) + box:SetPos( rand:GetPos() ) + box:SetAngles( rand:GetAngles() ) + box:Spawn() + box:PhysicsInit( SOLID_VPHYSICS ) + + local phys = box:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + else + print("No random box spawns have been set.") + end +end + +function nz.RandomBox.Functions.RemoveBox() + //Get all spawns + local all = ents.FindByClass("random_box") + //Loop just incase + for k,v in pairs(all) do + v:Remove() + end +end + +function nz.RandomBox.Functions.DecideWep(ply) + + local guns = {} + local blacklist = table.Copy(nz.Config.WeaponBlackList) + + //Add all our current guns to the black list + if ply:IsValid() then + for k,v in pairs( ply:GetWeapons() ) do + table.insert(blacklist, v.ClassName) + end + end + + //Add all guns with no model to the blacklist + for k,v in pairs( weapons.GetList() ) do + if !table.HasValue(blacklist, v.ClassName) then + if v.WorldModel == nil then + table.insert(blacklist, v.ClassName) + end + end + end + + //Add all guns to the guns table + for k,v in pairs( weapons.GetList() ) do + if !table.HasValue(blacklist, v.ClassName) then + table.insert(guns, v.ClassName) + end + end + + return table.Random(guns) +end diff --git a/nzombies3/gamemode/round_handler/sh_constructor.lua b/nzombies3/gamemode/round_handler/sh_constructor.lua new file mode 100644 index 00000000..3532bb29 --- /dev/null +++ b/nzombies3/gamemode/round_handler/sh_constructor.lua @@ -0,0 +1,21 @@ +//Main Tables +nz.Rounds = {} +nz.Rounds.Functions = {} +nz.Rounds.Data = {} + +//Round Variables +nz.Rounds.Data.CurrentState = ROUND_INIT +nz.Rounds.Data.CurrentRound = 0 + +//Misc +nz.Rounds.Data.CurrentPlayers = {} //No reason to be shared, but maybe in the future we will show the players clientside for scoreboard or smth +nz.Rounds.Elec = false + +if SERVER then + + //Round Variables + nz.Rounds.Data.KilledZombies = 0 + nz.Rounds.Data.ZombiesSpawned = 0 + nz.Rounds.Data.MaxZombies = 0 + nz.Rounds.Data.StartTime = CurTime() +end \ No newline at end of file diff --git a/nzombies3/gamemode/round_handler/sh_sync.lua b/nzombies3/gamemode/round_handler/sh_sync.lua new file mode 100644 index 00000000..ed0c30c0 --- /dev/null +++ b/nzombies3/gamemode/round_handler/sh_sync.lua @@ -0,0 +1,36 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Round.Sync" ) + + function nz.Rounds.Functions.SendSync() + net.Start( "nz.Round.Sync" ) + net.WriteString( nz.Rounds.Data.CurrentState ) + net.WriteString( nz.Rounds.Data.CurrentRound ) + net.Broadcast() + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Rounds.Functions.ReceiveSync( length ) + print("Received Round Sync") + nz.Rounds.Data.CurrentState = tonumber(net.ReadString()) + nz.Rounds.Data.CurrentRound = tonumber(net.ReadString()) + + //Quickly reset the electric value + if !(nz.Rounds.Data.CurrentState == ROUND_PREP or nz.Rounds.Data.CurrentState == ROUND_PROG) or (nz.Rounds.Data.CurrentRound <= 1) then + nz.Rounds.Data.Elec = false + end + end + + + //Receivers + net.Receive( "nz.Round.Sync", nz.Rounds.Functions.ReceiveSync ) + + +end \ No newline at end of file diff --git a/nzombies3/gamemode/round_handler/sv_handler.lua b/nzombies3/gamemode/round_handler/sv_handler.lua new file mode 100644 index 00000000..e8c12da3 --- /dev/null +++ b/nzombies3/gamemode/round_handler/sv_handler.lua @@ -0,0 +1,264 @@ +// + +function nz.Rounds.Functions.CheckPrerequisites() + + //If there is there is less than one player + if #player.GetAll() < 1 then + return //"Not enough players to start a game." + end + + //Check if zed/player spawns have been setup + if nz.Mapping.Functions.CheckSpawns() == false then + return "No Zombie/Player spawns have been set." + end + + //Check if we have enough player spawns + if nz.Mapping.Functions.CheckEnoughPlayerSpawns() == false then + return "Not enough player spawns have been set. We need " .. #player.GetAll() .. " but only have " .. #ents.FindByClass("player_spawns") .. "." + end + + //If enough players are ready + if nz.Rounds.Functions.CheckReady() == false then + return "Not enough players have readied up." + end + + + //All Checks have passed, lets go! + if nz.Rounds.Data.StartTime == nil then + nz.Rounds.Data.StartTime = CurTime() + 5 + print("All checks passed, starting in 5 seconds.") + PrintMessage( HUD_PRINTTALK, "5 seconds till start time." ) + end + + local str = "" + //Get the players that are playing + for k,v in pairs(player.GetAll()) do + if v.Ready == 1 and v:IsValid() then + str = str .. v:Nick() .. ", " + end + end + PrintMessage( HUD_PRINTTALK, "Players that will be playing: " .. str ) + + return true + +end + +function nz.Rounds.Functions.PrepareRound() + + //Main Behaviour + nz.Rounds.Data.CurrentState = ROUND_PREP + nz.Rounds.Functions.SendSync() + nz.Rounds.Data.CurrentRound = nz.Rounds.Data.CurrentRound + 1 + + nz.Rounds.Data.MaxZombies = nz.Curves.Data.SpawnRate[nz.Rounds.Data.CurrentRound] + nz.Rounds.Data.KilledZombies = 0 + nz.Rounds.Data.ZombiesSpawned = 0 + + //Notify + PrintMessage( HUD_PRINTTALK, "ROUND: "..nz.Rounds.Data.CurrentRound.." preparing" ) + hook.Run("nz.Round.Prep", nz.Rounds.Data.CurrentRound) + //Play the sound + if nz.Rounds.Data.CurrentRound == 1 then + nz.Notifications.Functions.PlaySound("nz/round/round_start.mp3", 1) + else + nz.Notifications.Functions.PlaySound("nz/round/round_end.mp3", 1) + end + + //Spawn all players + //Check config for dropins + //For now, only allow the players who started the game to spawn + for k,v in pairs(nz.Rounds.Data.CurrentPlayers) do + nz.Rounds.Functions.ReSpawn(v) + end + + //Heal + for k,v in pairs(nz.Rounds.Data.CurrentPlayers) do + v:SetHealth(v:GetMaxHealth()) + end + + //Start the next round + timer.Simple(nz.Config.PrepareTime, function() nz.Rounds.Functions.StartRound() end) + +end + +function nz.Rounds.Functions.StartRound() + + if nz.Rounds.Data.CurrentState != ROUND_GO then + //Main Behaviour + nz.Rounds.Data.CurrentState = ROUND_PROG + nz.Rounds.Functions.SendSync() + //Notify + PrintMessage( HUD_PRINTTALK, "ROUND: "..nz.Rounds.Data.CurrentRound.." started" ) + hook.Run("nz.Round.Start", nz.Rounds.Data.CurrentRound) + end + +end + +function nz.Rounds.Functions.ResetGame() + //Main Behaviour + nz.Rounds.Data.CurrentState = ROUND_INIT + nz.Rounds.Functions.SendSync() + //Notify + PrintMessage( HUD_PRINTTALK, "GAME READY!" ) + //Reset variables + nz.Rounds.Data.CurrentRound = 0 + + nz.Rounds.Data.KilledZombies = 0 + nz.Rounds.Data.ZombiesSpawned = 0 + nz.Rounds.Data.MaxZombies = 0 + + //Reset all player ready states + for k,v in pairs(player.GetAll()) do + nz.Rounds.Functions.UnReady(v) + end + //Remove all enemies + for k,v in pairs(nz.Config.ValidEnemies) do + for k2,v2 in pairs(ents.FindByClass(v)) do + v2:Remove() + end + end + //Empty the table of stored players + table.Empty(nz.Rounds.Data.CurrentPlayers) + //Reset the electricity + nz.Elec.Functions.Reset() + //Remove the random box + nz.RandomBox.Functions.RemoveBox() + + //Reset all perk machines + for k,v in pairs(ents.FindByClass("perk_machine")) do + v:TurnOff() + end + + for k,v in pairs(player.GetAll()) do + v:SetPoints(0) //Reset all player points + v:RemovePerks() //Remove all players perks + end + + //Clean up powerups + nz.PowerUps.Functions.CleanUp() + + //Reset easter eggs + nz.EE.Functions.Reset() + +end + +function nz.Rounds.Functions.EndRound() + if nz.Rounds.Data.CurrentState != ROUND_GO then + //Main Behaviour + nz.Rounds.Data.CurrentState = ROUND_GO + nz.Rounds.Functions.SendSync() + //Notify + PrintMessage( HUD_PRINTTALK, "GAME OVER!" ) + PrintMessage( HUD_PRINTTALK, "Restarting in 10 seconds!" ) + nz.Notifications.Functions.PlaySound("nz/round/game_over_4.mp3", 21) + timer.Simple(10, function() + nz.Rounds.Functions.ResetGame() + end) + else + //This if statement is to prevent the game from ending twice if all players die during preparing + end +end + +function nz.Rounds.Functions.CreateMode() + + if nz.Rounds.Data.CurrentState == ROUND_INIT then + PrintMessage( HUD_PRINTTALK, "The mode has been set to creative mode!" ) + nz.Rounds.Data.CurrentState = ROUND_CREATE + //We are in create + for k,v in pairs(player.GetAll()) do + if v:IsSuperAdmin() then + nz.Rounds.Functions.Create(v) + end + end + nz.Doors.Functions.LockAllDoors() + elseif nz.Rounds.Data.CurrentState == ROUND_CREATE then + PrintMessage( HUD_PRINTTALK, "The mode has been set to play mode!" ) + nz.Rounds.Data.CurrentState = ROUND_INIT + //We are in play mode + for k,v in pairs(player.GetAll()) do + v:SetAsSpec() + end + end + nz.Rounds.Functions.SendSync() +end + +function nz.Rounds.Functions.SetupGame() + + //Store a session of all our players + for k,v in pairs(player.GetAll()) do + if v:IsValid() and !v:IsPermSpec() then + nz.Rounds.Functions.AddPlayer(v) + end + v.Ready = 0 + v:SetFrags(0) //Reset all player kills + end + + nz.Doors.Functions.LockAllDoors() + + //Open all doors with no price and electricity requirement + for k,v in pairs(ents.GetAll()) do + if v:IsDoor() or v:IsBuyableProp() then + if v.price == 0 and v.elec == 0 then + nz.Doors.Functions.OpenDoor( v ) + end + end + //Setup barricades + if v:GetClass() == "breakable_entry" then + v:ResetPlanks() + end + end + + //Empty the link table + table.Empty(nz.Doors.Data.OpenedLinks) + + //All doors with Link 0 (No Link) + nz.Doors.Data.OpenedLinks[0] = true + nz.Doors.Functions.SendSync() + + //Spawn a random box + nz.RandomBox.Functions.SpawnBox() + //Clear the start time + nz.Rounds.Data.StartTime = nil + + +end + +function nz.Rounds.Functions.RoundHandler() + + //If the game hasn't been started yet + if nz.Rounds.Data.CurrentState == ROUND_INIT then + local pre = nz.Rounds.Functions.CheckPrerequisites() + if pre == true then + if CurTime() > nz.Rounds.Data.StartTime then + nz.Rounds.Functions.SetupGame() + nz.Rounds.Functions.PrepareRound() + end + else + //Reset the start timer + nz.Rounds.Data.StartTime = nil + // notify why, just print for now + if pre != nil then print(pre) end + return //Don't process any further than here + end + + elseif nz.Rounds.Data.CurrentState == ROUND_CREATE then + //Un-ready all players + for k,v in pairs(player.GetAll()) do + nz.Rounds.Functions.UnReady(v, "You have been set to un-ready since the game has been set to creative mode") + end + return //Don't process any further than here + end + + //If all players are dead, then end the game. + if !nz.Rounds.Functions.CheckAlive() and nz.Rounds.Functions.IsInGame() then + nz.Rounds.Functions.EndRound() + end + + //If we've killed all the zombies, then progress to the next level. + if (nz.Rounds.Data.KilledZombies == nz.Rounds.Data.MaxZombies) and nz.Rounds.Data.CurrentState == ROUND_PROG then + nz.Rounds.Functions.PrepareRound() + end + +end + +timer.Create("nz.Rounds.Handler", 1, 0, nz.Rounds.Functions.RoundHandler) diff --git a/nzombies3/gamemode/round_handler/sv_player.lua b/nzombies3/gamemode/round_handler/sv_player.lua new file mode 100644 index 00000000..60970b81 --- /dev/null +++ b/nzombies3/gamemode/round_handler/sv_player.lua @@ -0,0 +1,91 @@ +// + +//Player Functions + +function nz.Rounds.Functions.ReadyUp(ply) + if ply.Ready == nil then ply.Ready = 0 end + + if ply:IsPermSpec() then + ply:PrintMessage( HUD_PRINTTALK, "You can't ready up because you are a perm spectator!" ) + return + end + + if nz.Rounds.Data.CurrentState == ROUND_INIT then + if ply.Ready == 0 then + PrintMessage( HUD_PRINTTALK, ply:Nick().." is ready!" ) + ply.Ready = 1 + else + ply:PrintMessage( HUD_PRINTTALK, "You are already ready!" ) + end + elseif nz.Rounds.Data.CurrentState == ROUND_PROG or nz.Rounds.Data.CurrentState == ROUND_PREP then + ply:PrintMessage( HUD_PRINTTALK, "You can't ready up right now, use /dropin to spawn next round." ) + nz.Rounds.Functions.DropIn(ply) + end +end + +function nz.Rounds.Functions.DropIn(ply) + if nz.Config.AllowDropins == true and !table.HasValue(nz.Rounds.Data.CurrentPlayers, ply) then + PrintMessage( HUD_PRINTTALK, ply:Nick().." will be dropping in next round!" ) + nz.Rounds.Functions.AddPlayer(ply) + end +end + +function nz.Rounds.Functions.DropOut(ply) + if table.HasValue(nz.Rounds.Data.CurrentPlayers, ply) then + PrintMessage( HUD_PRINTTALK, ply:Nick().." has dropped out of the game!" ) + nz.Rounds.Functions.RemovePlayer(ply) + ply:KillSilent() + end +end + +function nz.Rounds.Functions.UnReady(ply, reason) + if ply.Ready == nil then ply.Ready = 0 end + if nz.Rounds.Data.CurrentState == ROUND_INIT then + if ply.Ready == 1 then + PrintMessage( HUD_PRINTTALK, ply:Nick().." is no longer ready!" ) + ply.Ready = 0 + if reason != nil then + ply:PrintMessage( HUD_PRINTTALK, reason ) + end + end + elseif nz.Rounds.Data.CurrentState == ROUND_PROG or nz.Rounds.Data.CurrentState == ROUND_PREP then + nz.Rounds.Functions.DropOut(ply) + end +end + +function nz.Rounds.Functions.ReSpawn(ply) + + if !ply:IsValid() then return end + if ply:IsPermSpec() then return end + + //Setup a player + ply:SetTeam( TEAM_PLAYERS ) + player_manager.SetPlayerClass( ply, "player_ingame" ) + if !ply:Alive() then + ply:Spawn() + end +end + +function nz.Rounds.Functions.AddPlayer(ply) + if ply:IsValid() then + table.insert(nz.Rounds.Data.CurrentPlayers, ply) + end +end + +function nz.Rounds.Functions.RemovePlayer(ply) + if table.HasValue(nz.Rounds.Data.CurrentPlayers, ply) then + table.RemoveByValue(nz.Rounds.Data.CurrentPlayers, ply) + end +end + +function nz.Rounds.Functions.Create(ply) + + //Setup a player + ply:SetTeam( TEAM_PLAYERS ) + player_manager.SetPlayerClass( ply, "player_create" ) + if !ply:Alive() then + ply:Spawn() + end + //SetPos + +end diff --git a/nzombies3/gamemode/round_handler/sv_special_rounds.lua b/nzombies3/gamemode/round_handler/sv_special_rounds.lua new file mode 100644 index 00000000..71402c58 --- /dev/null +++ b/nzombies3/gamemode/round_handler/sv_special_rounds.lua @@ -0,0 +1,10 @@ +hook.Add("nz.Round.Prog", "nz.Special.Zombies", function() + if nz.Rounds.Data.CurrentRound == 6 or nz.Rounds.Data.CurrentRound >= 18 then + nz.Fog.Functions.Enable( true ) + elseif nz.Rounds.Data.CurrentRound >= 18 then + nz.Fog.Functions.SetColor( Color(190, 60, 40) ) + nz.Fog.Functions.Enable( true ) + else + nz.Fog.Functions.Enable( false ) + end +end) diff --git a/nzombies3/gamemode/round_handler/sv_validation.lua b/nzombies3/gamemode/round_handler/sv_validation.lua new file mode 100644 index 00000000..fec89e7a --- /dev/null +++ b/nzombies3/gamemode/round_handler/sv_validation.lua @@ -0,0 +1,45 @@ +// + +function nz.Rounds.Functions.CheckReady() + + local count = 0 + local total = 0 + + //Get the total number of players that are willing + for k,v in pairs(player.GetAll()) do + if !v:IsPermSpec() then + total = total + 1 + end + end + //Get the total of ready players + for k,v in pairs(player.GetAll()) do + if v.Ready == 1 and v:IsValid() and !v:IsPermSpec() then + count = count + 1 + else + v.Ready = 0 + end + end + print("Waiting for players: " .. count .. " / " .. total) + if count / total < 0.66 then + return false + end + + return true + +end + +function nz.Rounds.Functions.CheckAlive() + + //Check alive players! + for k,v in pairs(team.GetPlayers(TEAM_PLAYERS)) do + if v:Alive() then + return true + end + end + + return false +end + +function nz.Rounds.Functions.IsInGame() + return (nz.Rounds.Data.CurrentState == ROUND_PROG or nz.Rounds.Data.CurrentState == ROUND_PREP) +end diff --git a/gamemode/shared.lua b/nzombies3/gamemode/shared.lua similarity index 77% rename from gamemode/shared.lua rename to nzombies3/gamemode/shared.lua index beb72b42..1dc25317 100644 --- a/gamemode/shared.lua +++ b/nzombies3/gamemode/shared.lua @@ -1,12 +1,11 @@ -GM.Name = "nZombies" +GM.Name = "nZombies 3" GM.Author = "N/A" GM.Email = "N/A" GM.Website = "N/A" ---Round ---0 = Initialize ---1 = Preparing ---2 = In Progress +// Constants \\ + +//Round Constants ROUND_INIT = 0 ROUND_PREP = 1 @@ -14,9 +13,12 @@ ROUND_PROG = 2 ROUND_CREATE = 3 ROUND_GO = 4 +//Team Constants + TEAM_SPECS = 1 TEAM_PLAYERS = 2 +//Setup Teams team.SetUp( TEAM_SPECS, "Spectators", Color( 255, 255, 255 ) ) team.SetUp( TEAM_PLAYERS, "Players", Color( 255, 0, 0 ) ) diff --git a/nzombies3/gamemode/spectator/sh_constructor.lua b/nzombies3/gamemode/spectator/sh_constructor.lua new file mode 100644 index 00000000..0ab01ca9 --- /dev/null +++ b/nzombies3/gamemode/spectator/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Spectator = {} +nz.Spectator.Functions = {} +nz.Spectator.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/spectator/sv_gm.lua b/nzombies3/gamemode/spectator/sv_gm.lua new file mode 100644 index 00000000..e3cdedc4 --- /dev/null +++ b/nzombies3/gamemode/spectator/sv_gm.lua @@ -0,0 +1,45 @@ +// + +//Gamemode Functions + +function nz.Spectator.Functions.InitialSpawn(ply) + + //Spectator Vars + if ply.SpecType == nil then + ply.SpecType = 4 + ply:Spectate( ply.SpecType ) + end + + timer.Simple(1, function() ply:SetAsSpec() end) + +end + +function nz.Spectator.Functions.OnDeath(ply) + if (nz.Rounds.Data.CurrentState == ROUND_CREATE) and (ply:IsSuperAdmin()) then + timer.Simple(1, function() ply:Spawn() end) + else + timer.Simple(1, function() ply:SetAsSpec() end) + end +end + +function nz.Spectator.Functions.DeathThink(ply) + + local livePlayers = team.GetPlayers( TEAM_PLAYERS ) + + if ply:KeyPressed( IN_JUMP ) then + ply.SpecType = ply.SpecType + 1 + if ply.SpecType > 6 then ply.SpecType = 4 end + ply:Spectate( ply.SpecType ) + elseif ply:KeyPressed( IN_ATTACK ) then + if !ply.SpecID then ply.SpecID = 1 end + ply.SpecID = ply.SpecID + 1 + if ply.SpecID > #livePlayers then ply.SpecID = 1 end + ply:SpectateEntity( livePlayers[ ply.SpecID ] ) + elseif ply:KeyPressed( IN_ATTACK2 ) then + if !ply.SpecID then ply.SpecID = 1 end + ply.SpecID = ply.SpecID - 1 + if ply.SpecID <= 0 then ply.SpecID = #livePlayers end + ply:SpectateEntity( livePlayers[ ply.SpecID ] ) + end + +end \ No newline at end of file diff --git a/nzombies3/gamemode/spectator/sv_override.lua b/nzombies3/gamemode/spectator/sv_override.lua new file mode 100644 index 00000000..ef33bb7b --- /dev/null +++ b/nzombies3/gamemode/spectator/sv_override.lua @@ -0,0 +1,39 @@ +//Get the meta Table +playerMeta = FindMetaTable( "Player" ) + +//Meta Functions +function playerMeta:IsSpec() + return nz.Spectator.Functions.IsSpec(self) +end + +function playerMeta:SetAsSpec() + nz.Spectator.Functions.SetAsSpec(self) +end + +function playerMeta:IsPermSpec() + return nz.Spectator.Functions.IsPermSpec(self) +end + +function playerMeta:PermSpec() + nz.Spectator.Functions.PermSpec(self) +end + +function playerMeta:SetAsPlayer() + nz.Spectator.Functions.SetAsPlayer(self) +end + +//Gamemode Overrides + +function GM:PlayerInitialSpawn( ply ) + nz.Spectator.Functions.InitialSpawn(ply) +end + +function GM:PlayerDeath( victim, weapon, killer ) + nz.Spectator.Functions.OnDeath(victim) +end + +function GM:PlayerDeathThink( ply ) + nz.Spectator.Functions.DeathThink(ply) +end + + diff --git a/nzombies3/gamemode/spectator/sv_player.lua b/nzombies3/gamemode/spectator/sv_player.lua new file mode 100644 index 00000000..7f4a9e20 --- /dev/null +++ b/nzombies3/gamemode/spectator/sv_player.lua @@ -0,0 +1,45 @@ +// + +//Spectator Functions + +function nz.Spectator.Functions.IsSpec(ply) + + if ply:Team() == TEAM_UNASSIGNED or ply:Team() == TEAM_SPECS then + return true + end + + return false + +end + +function nz.Spectator.Functions.SetAsSpec(ply) + + //Set them on to the spectator team + player_manager.SetPlayerClass( ply, "player_default" ) + ply:SetTeam( TEAM_SPECS ) + if ply:Alive() then + ply:KillSilent() + end + +end + +//Perm Spectator Functions +function nz.Spectator.Functions.IsPermSpec(ply) + if ply.specFlag == nil then + ply.specFlag = false + end + return ply.specFlag +end + +function nz.Spectator.Functions.PermSpec(ply) + if !ply:IsPermSpec() then + ply.specFlag = true + nz.Rounds.Functions.RemovePlayer(ply) + //Notify + PrintMessage( HUD_PRINTTALK, ply:Nick() .. " has been set to permanent spectator") + ply:SetAsSpec() + else + PrintMessage( HUD_PRINTTALK, ply:Nick() .. " is no longer a permanent spectator") + ply.specFlag = false + end +end \ No newline at end of file diff --git a/nzombies3/gamemode/weapons/sh_constructor.lua b/nzombies3/gamemode/weapons/sh_constructor.lua new file mode 100644 index 00000000..6b1a0d0f --- /dev/null +++ b/nzombies3/gamemode/weapons/sh_constructor.lua @@ -0,0 +1,6 @@ +//Main Tables +nz.Weps = {} +nz.Weps.Functions = {} +nz.Weps.Data = {} + +//_ Variables diff --git a/nzombies3/gamemode/weapons/sh_fas2.lua b/nzombies3/gamemode/weapons/sh_fas2.lua new file mode 100644 index 00000000..04b3b6d6 --- /dev/null +++ b/nzombies3/gamemode/weapons/sh_fas2.lua @@ -0,0 +1,80 @@ +function FAS2_PlayAnim(wep, anim, speed, cyc, time) + speed = speed and speed or 1 + cyc = cyc and cyc or 0 + time = time or 0 + + if type(anim) == "table" then + anim = table.Random(anim) + end + + anim = string.lower(anim) + + if wep.sleight == true then + if string.find(anim, "reload") != nil or string.find(anim, "insert") != nil then + speed = 2 + end + end + if wep.dtap == true then + if string.find(anim, "fire") != nil or string.find(anim, "cock") != nil or string.find(anim, "pump") != nil then + speed = 1.25 + end + end + + if game.SinglePlayer() then + if SERVER then + if wep.Sounds[anim] then + wep.CurSoundTable = wep.Sounds[anim] + wep.CurSoundEntry = 1 + wep.SoundSpeed = speed + wep.SoundTime = CurTime() + time + end + end + /*if wep.Sounds[anim] then + for k, v in pairs(wep.Sounds[anim]) do + timer.Simple(v.time, function() + if IsValid(ply) and ply:Alive() and IsValid(wep) and wep == ply:GetActiveWeapon() then + wep:EmitSound(v.sound, 70, 100) + end + end) + end + end + end*/ + else + if wep.Sounds[anim] then + wep.CurSoundTable = wep.Sounds[anim] + wep.CurSoundEntry = 1 + wep.SoundSpeed = speed + wep.SoundTime = CurTime() + time + end + + /*if wep.Sounds[anim] then + for k, v in pairs(wep.Sounds[anim]) do + timer.Simple(v.time, function() + wep:EmitSound(v.sound, 70, 100) + end) + end + end*/ + end + + if SERVER and game.SinglePlayer() then + ply = Entity(1) + + umsg.Start("FAS2ANIM", ply) + umsg.String(anim) + umsg.Float(speed) + umsg.Float(cyc) + umsg.End() + end + + if CLIENT then + vm = wep.Wep + + wep.CurAnim = string.lower(anim) + + if vm then + vm:SetCycle(cyc) + vm:SetSequence(anim) + vm:SetPlaybackRate(speed) + end + end +end diff --git a/nzombies3/gamemode/weapons/sh_wep_sync.lua b/nzombies3/gamemode/weapons/sh_wep_sync.lua new file mode 100644 index 00000000..9b4c01f8 --- /dev/null +++ b/nzombies3/gamemode/weapons/sh_wep_sync.lua @@ -0,0 +1,36 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Weps.Sync" ) + + function nz.Weps.Functions.SendSync( ply, data ) + net.Start( "nz.Weps.Sync" ) + net.WriteTable( data ) + net.Send( ply ) + end + +end + +if CLIENT then + + //Server to client (Client) + function nz.Weps.Functions.ReceiveSync( length ) + print("Received Weps Sync") + local data = net.ReadTable() + local wep = data.wep + data.wep = nil + if wep != nil then + if wep:IsValid() then + print("Applying data to: " .. wep.ClassName) + for k,v in pairs(data) do + wep[k] = v + end + end + end + end + + //Receivers + net.Receive( "nz.Weps.Sync", nz.Weps.Functions.ReceiveSync ) +end diff --git a/nzombies3/gamemode/weapons/sv_ammo.lua b/nzombies3/gamemode/weapons/sv_ammo.lua new file mode 100644 index 00000000..ebe77105 --- /dev/null +++ b/nzombies3/gamemode/weapons/sv_ammo.lua @@ -0,0 +1,43 @@ +//Functions +function nz.Weps.Functions.CalculateMaxAmmo(class) + local wep = weapons.Get(class) + local clip = wep.Primary.ClipSize + + return clip * 10 +end + +function nz.Weps.Functions.GiveMaxAmmoWep(ply, class) + + local wep = weapons.Get(class) + if wep == nil then return end + local ammo_type = wep.Primary.Ammo + local max_ammo = nz.Weps.Functions.CalculateMaxAmmo(class) + + local ply_weps = ply:GetWeapons() + local multi = 0 + + for k,v in pairs(ply_weps) do + local in_wep = weapons.Get(v:GetClass()) + if in_wep != nil then + if in_wep.Primary.Ammo == ammo_type then + multi = multi + 1 + end + end + end + + max_ammo = max_ammo * multi + + local curr_ammo = ply:GetAmmoCount( ammo_type ) + local give_ammo = max_ammo - curr_ammo + + //Just for display, since we're setting their ammo anyway + ply:GiveAmmo(give_ammo, ammo_type) + ply:SetAmmo(max_ammo, ammo_type) + +end + +function nz.Weps.Functions.GiveMaxAmmo(ply) + for k,v in pairs(ply:GetWeapons()) do + nz.Weps.Functions.GiveMaxAmmoWep(ply, v:GetClass()) + end +end diff --git a/nzombies3/gamemode/weapons/sv_weps.lua b/nzombies3/gamemode/weapons/sv_weps.lua new file mode 100644 index 00000000..2c1e47a0 --- /dev/null +++ b/nzombies3/gamemode/weapons/sv_weps.lua @@ -0,0 +1,113 @@ +// + +function nz.Weps.Functions.IsFAS2( wep ) + if wep.Category == "FA:S 2 Weapons" then + return true + end + + return false +end + +function nz.Weps.Functions.ApplySleight( ply, wep ) + if nz.Weps.Functions.IsFAS2( wep ) and wep.sleight != true then + print("Applying Sleight to: " .. wep.ClassName) + local data = {} + //Normal + data["ReloadTime"] = true + data["ReloadTime_Nomen"] = true + data["ReloadTime_Empty"] = true + data["ReloadTime_Empty_Nomen"] = true + //BiPod + data["ReloadTime_Bipod"] = true + data["ReloadTime_Bipod_Nomen"] = true + data["ReloadTime_Bipod_Empty"] = true + data["ReloadTime_Bipod_Empty_Nomen"] = true + for k,v in pairs(data) do + if wep[k] != nil then + local val = wep[k] / 2 + wep[k] = val + data[k] = val + else + data[k] = nil + end + end + //Attach the weapon to the data + data["wep"] = wep + wep["sleight"] = true + data["sleight"] = true + nz.Weps.Functions.SendSync( ply, data ) + end +end + +function nz.Weps.Functions.ApplyDTap( ply, wep ) + if nz.Weps.Functions.IsFAS2( wep ) and wep.dtap != true then + print("Applying Dtap to: " .. wep.ClassName) + local data = {} + //Normal + data["FireDelay"] = true + for k,v in pairs(data) do + if wep[k] != nil then + local val = wep[k] / 2 + wep[k] = val + data[k] = val + else + data[k] = nil + end + end + //Attach the weapon to the data + data["wep"] = wep + wep["dtap"] = true + data["dtap"] = true + nz.Weps.Functions.SendSync( ply, data ) + end +end + +function nz.Weps.Functions.ApplyPaP( ply, wep ) + if wep.pap != true then + print("Applying PaP to: " .. wep.ClassName) + ply:PrintMessage( HUD_PRINTTALK, "Damage: " .. ply:GetActiveWeapon().Damage .. " > ".. ply:GetActiveWeapon().Damage * 2) + local data = {} + //Normal + data["Damage"] = true + for k,v in pairs(data) do + if wep[k] != nil then + local val = wep[k] * 2 + wep[k] = val + data[k] = val + else + data[k] = nil + end + end + //Attach the weapon to the data + data["wep"] = wep + wep["pap"] = true + data["pap"] = true + nz.Weps.Functions.SendSync( ply, data ) + end +end + +function nz.Weps.Functions.OnWepCreated( ent ) + if ent:IsWeapon() and (nz.Rounds.Data.CurrentState == ROUND_PREP or nz.Rounds.Data.CurrentState == ROUND_PROG) then + timer.Simple(0.1, function() + local ply = ent.Owner + if ply:HasPerk("sleight") then + nz.Weps.Functions.ApplySleight( ply, ent ) + end + if ply:HasPerk("dtap") then + nz.Weps.Functions.ApplyDTap( ply, ent ) + end + if nz.Rounds.Functions.IsInGame() then + //Check if we should replace the players weapon. + if #ply:GetWeapons() > nz.Config.MaxWeps then + local active_wep = ply:GetActiveWeapon():GetClass() + timer.Simple(1, function() ply:StripWeapon(active_wep) end) + end + //Damn it FAS2 weps + timer.Simple(0.5, function() ply:SelectWeapon(ent:GetClass()) end) + timer.Simple(1, function() ply:SelectWeapon(ent:GetClass()) end) + end + end) + end +end + +hook.Add("OnEntityCreated", "nz.Weps.OnEntityCreated", nz.Weps.Functions.OnWepCreated) diff --git a/nzombies.txt b/nzombies3/nzombies3.txt similarity index 76% rename from nzombies.txt rename to nzombies3/nzombies3.txt index 1ed188c2..2a5005d0 100644 --- a/nzombies.txt +++ b/nzombies3/nzombies3.txt @@ -1,8 +1,8 @@ "nzombies" { "base" "base" - "title" "nZombies" - "version" "0.2" + "title" "nZombies 3" + "version" "3.0" "menusystem" "1" "author_name" "Alig96" diff --git a/version.txt b/version.txt deleted file mode 100644 index cd7da05e..00000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -210