diff --git a/README.md b/README.md index ae0d3efc..fa1cd554 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,105 @@ nZombies A GM13 Nazi Zombies style (WIP) gamemode -place in gamemodes/nzombies/ +Download folder and place it in garrysmod/garrysmod/addons +Make sure the structure has a path to addon.json like this: garrysmod/garrysmod/addons/nzombies/addon.json -I know the code is ugly. Planning on re-writing the whole thing soon. +Get the collection of weapon packs used by the official configs here: +http://steamcommunity.com/sharedfiles/filedetails/?id=673266588 + +If you have bugs, suggestions, or general improvements, open up an issue with the issue button at the top. If you want to help, feel free to create pull requests with your changes. If you have questions, add me on steam :) + +This is an edited version from Aligs original featuring these changes: + +- Revival System & Health + - You get downed by losing all HP + - CalcView low angle for being downed, screen slowly fades to black until you die + - Hold E on a downed friend to revive, 45 seconds without revival kills the downed player + - Quick Revive now works; 5 seconds to revive without, 2 seconds with + - Zombies ignore downed players + - Downed players also count as 'dead' towards ending the game + - Upon being downed, you equip a pistol if available + -(Planned: If no pistol, give starting pistol for the duration of being downed) + - Zombies now deal 50-70 damage, but you have health regen on your side! + - Revival progress bar + +- Navigation Locker Tool + - Lock Navmeshes or link them to doors! + - Zombies will not be able to pathfind through locked navmeshes + - Opening a linked door will unlock the navmesh it was tied to + - You need to be in a local server with sv_cheats to 1 to visualize them, however they still work without + - Only normal zombies can, but you can copy-paste the pathfinding check to any other NPC if needed + - Create NavGroups! + - Zombies cannot target players in different NavGroups than themselves (unless either one is in no group) + - If no players can be targeted, will target a spawnpoint marked with "Respawn from?" and respawn from it on arrival + - A tool for generating ladders in edit mode! + +- Additional Content + - All perks up until Black Ops 2 with all DLC working! + - A proper HUD! + - More Powerups + - Carpenter + - Fire Sale + - More sounds + - Buy sound + - Barrier repair sounds + - Random Box moving sounds + - Pack-a-Punch shoot sounds + - Perk Machine jingles + - More effects + - Damaged blood pulse overlay + - Pack-a-Punch weapon animations + - Perk Bottle Drinking animation + - Better editing + - Undo system + - Context Menu to quickly edit properties without equipping tool (Hold C) + - Many more props, light effects, sky/fog/sun editors, fire entites, and more ... + +- Map Settings tool! + - Decide which weapons the random box can spawn + - Set a SoundCloud link to the song to play on Easter Egg + - Decide starting weapon and points + +- Better Zombie AI (Thanks Lolle!) + - Zombies can now jump + - Zombies now know which navmeshes are locked to doors and won't path through them + - Zombies can now know if there are players in the same area as them + - Zombies can now go back to respawn if they can't get to any players + +- Easy mismatch correction system + - Loading configs using weapons you may not have installed creates an easy menu to replace them + - Applies to wall buys, random box list, perks (if scripted in), and more as new stuff is added + +- Weapon Carrying + - Max number weapons you can carry + - You swap weapons if the max has been reached + - You automatically equip newly gotten weapons + +- Door Changes + - func_* doors now actually trigger with E! + - Doors that still close with triggers or buttons will unlock and open again + - The only way to keep these doors open + - Otherwise Triggers will close it again and because we locked it, we can't reopen + - You can now lock buttons with a price (Say to trigger doors or elevators, or maybe even traps) + - Doors only lock if they have a price; doors without will force themselves to stay open when they try to close + - Doors can be set to "Repurchaseable" which will make them not lock (E.g. to use on Elevator buttons) + - Doors have "Purchaseable" option to completely disable E input (E.g. to use on doors that shouldn't lock but open by button) + +- Misc changes + - Speed Cola and Double Tap now works on all weapons! + - Wall Buy tool weapon selection is a dropdown of all available weapons instead of text field + - Sleight of Hand renamed to Speed Cola + - Set the prices of the perks to what they are in the real zombies game + - Enabled the Start Round sound on every round, like in the real game + - Random Box weapons float up with the right angle to match the box + - Random Box Weapons can now be picked up even with wierd models + - Zombies now correctly give 50 points for a kill and 100 for a headshot kill + - Point distribution works on hooks now, making it work for any NPC you add to ValidEnemies + - ValidEnemies table setup changed to allow more customizability + - Power Ups now just rotate and are golden + - Pack-a-Punch now a global hook, will work on all weapons + - Prop Search menu + + +- Workshop Release To-do list: + Check the Issues tab with the "Workshop Release" milestone. Feel free to discuss your opinion about the things in there, it would help greatly. diff --git a/addon.json b/addon.json new file mode 100644 index 00000000..89b3deb4 --- /dev/null +++ b/addon.json @@ -0,0 +1,11 @@ +{ + "title" : "nZombies 3", + "type" : "gamemode", + "tags" : [ "fun", "realism" ], + "ignore" : + [ + "*.psd", + "*.vcproj", + "*.svn*" + ] +} \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/chatcommand/sh_chatcommands.lua b/gamemodes/nzombies3/gamemode/chatcommand/sh_chatcommands.lua new file mode 100644 index 00000000..3236d750 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/chatcommand/sh_chatcommands.lua @@ -0,0 +1,9 @@ +chatcommand.Add("/cheats", function(ply, text) + if CLIENT then + if !IsValid(g_nz_cheats) then + g_nz_cheats = vgui.Create("NZCheatFrame") + else + g_nz_cheats:Remove() + end + end +end, false, "Opens the cheat panel.") diff --git a/gamemodes/nzombies3/gamemode/chatcommand/sh_constructor.lua b/gamemodes/nzombies3/gamemode/chatcommand/sh_constructor.lua new file mode 100644 index 00000000..fe31ef1c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/chatcommand/sh_constructor.lua @@ -0,0 +1,59 @@ +-- Chat Commands module +chatcommand = {} + +chatcommand.commands = {} + +-- Functions +--[[ chatcommand.Add + text [string]: The text you put in chat to trigger this command + func [function]: The function to run when the command is issued. It runs the function with the player as the first argument, then all arguments in the chat seperated by space + allowAll [boolean]: If set to true, will allow even non-admins to run this command + --]] + +--TODO add more descriptive table indices. +function chatcommand.Add(text, func, allowAll, usageHelp) + if usageHelp then + table.insert(chatcommand.commands, {text, func, allowAll and true or false, usageHelp}) + else + table.insert(chatcommand.commands, {text, func, allowAll and true or false}) + end +end + +-- Hooks +if SERVER then + local function commandListenerSV( ply, text, public ) + if text[1] == "/" then + text = string.lower(text) + for k,v in pairs(chatcommand.commands) do + if (string.sub(text, 1, string.len(v[1])) == v[1]) then + if !v[3] and !ply:IsSuperAdmin() then + ply:ChatPrint("NZ This command can only be used by administrators.") + return false + end + v[2](ply, string.Split(string.sub(text, string.len(v[1]) + 2), " ")) + return false + end + end + ply:ChatPrint("NZ No valid command exists with this name, try '/help' for a list of commands.") + end + end + hook.Add("PlayerSay", "nzChatCommand", commandListenerSV) +end + +if CLIENT then + local function commandListenerCL( ply, text, public, dead ) + if text[1] == "/" then + text = string.lower(text) + for k,v in pairs(chatcommand.commands) do + if (string.sub(text, 1, string.len(v[1])) == v[1]) then + if v[3] and !ply:IsSuperAdmin() then + return true + end + v[2](ply, string.Split(string.sub(text, string.len(v[1]) + 2), " ")) + return true + end + end + end + end + hook.Add("OnPlayerChat", "nzChatCommandClient", commandListenerCL) +end diff --git a/gamemodes/nzombies3/gamemode/chatcommand/sh_player.lua b/gamemodes/nzombies3/gamemode/chatcommand/sh_player.lua new file mode 100644 index 00000000..3ab16095 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/chatcommand/sh_player.lua @@ -0,0 +1,10 @@ +function player.GetByName(name) + name = string.lower(name) + for _,v in ipairs(player.GetHumans()) do + if string.find(string.lower(v:Nick()), name, 1, true) != nil then + return v + end + end + + return nil +end diff --git a/gamemodes/nzombies3/gamemode/chatcommand/sv_chatcommands.lua b/gamemodes/nzombies3/gamemode/chatcommand/sv_chatcommands.lua new file mode 100644 index 00000000..c355168f --- /dev/null +++ b/gamemodes/nzombies3/gamemode/chatcommand/sv_chatcommands.lua @@ -0,0 +1,237 @@ +-- Chat Commands + +chatcommand.Add("/help", function(ply, text) + ply:PrintMessage( HUD_PRINTTALK, "-----" ) + ply:PrintMessage( HUD_PRINTTALK, "NZ Available commands:" ) + ply:PrintMessage( HUD_PRINTTALK, "Arguments in [] are optional." ) + for _, cmd in pairs(chatcommand.commands) do + local cmdText = cmd[1] + if cmd[4] then + cmdText = cmdText .. " " .. cmd[4] + end + if cmd[3] or (!cmd[3] and ply:IsSuperAdmin()) then + ply:PrintMessage( HUD_PRINTTALK, cmdText ) + end + end + ply:PrintMessage( HUD_PRINTTALK, "-----" ) + ply:PrintMessage( HUD_PRINTTALK, "" ) +end, true, " Print this list.") + +chatcommand.Add("/ready", function(ply, text) + ply:ReadyUp() +end, true, " Mark yourself as ready.") + +chatcommand.Add("/unready", function(ply, text) + ply:UnReady() +end, true, " Mark yourself as unready.") + +chatcommand.Add("/dropin", function(ply, text) + ply:DropIn() +end, true, " Drop into the next round.") + +chatcommand.Add("/dropout", function(ply, text) + ply:DropOut() +end, true, " Drop out of the current round.") + +chatcommand.Add("/create", function(ply, text) + nzRound:Create() +end, false, " Respawn in creative mode.") + +chatcommand.Add("/generate", function(ply, text) + if navmesh.IsLoaded() then + ply:PrintMessage( HUD_PRINTTALK, "NZ Navmesh already exists, couldn't generate." ) + else + ply:PrintMessage( HUD_PRINTTALK, "NZ Starting Navmesh Generation, this may take a while." ) + navmesh.BeginGeneration() + --force generate + if !navmesh.IsGenerating() then + ply:PrintMessage( HUD_PRINTTALK, "NZ No walkable seeds found, forcing generation..." ) + local sPoint = GAMEMODE.SpawnPoints[ math.random( #GAMEMODE.SpawnPoints ) ] + local tr = util.TraceLine( { + start = sPoint:GetPos(), + endpos = sPoint:GetPos() - Vector( 0, 0, 100), + filter = sPoint + } ) + + local ent = ents.Create("info_player_start") + ent:SetPos( tr.HitPos ) + ent:Spawn() + navmesh.BeginGeneration() + end + + if !navmesh.IsGenerating() then + --Will not happen but jsut in case + ply:PrintMessage( HUD_PRINTTALK, "NZ Navmesh Generation failed! Please try this command again or generate the navmesh manually." ) + end + end +end, false, " Generate a new naviagtion mesh.") + +util.AddNetworkString("nz_SaveConfig") +chatcommand.Add("/save", function(ply, text) + if nzRound:InState( ROUND_CREATE ) then + -- nzMapping:SaveConfig() + net.Start("nz_SaveConfig") + net.Send(ply) + else + ply:PrintMessage( HUD_PRINTTALK, "NZ You can't save outside of create mode." ) + end +end, false, " Save your cahnges to a config.") + +chatcommand.Add("/load", function(ply, text) + if nzRound:InState( ROUND_CREATE) or nzRound:InState( ROUND_WAITING ) then + nz.Interfaces.Functions.SendInterface(ply, "ConfigLoader", {configs = file.Find( "nz/nz_*", "DATA" ), workshopconfigs = file.Find( "nz/nz_*", "LUA" ), officialconfigs = file.Find("gamemodes/nzombies3/officialconfigs/*", "GAME")}) + else + ply:PrintMessage( HUD_PRINTTALK, "NZ You can't load while playing!" ) + end +end, false, " Open the map config load dialog.") + +chatcommand.Add("/clean", function(ply, text) + if nzRound:InState( ROUND_CREATE) or nzRound:InState( ROUND_WAITING ) then + nzMapping:ClearConfig() + else + ply:PrintMessage( HUD_PRINTTALK, "NZ You can't clean while playing!" ) + end +end) + +-- Tests + +chatcommand.Add("/spectate", function(ply, text) + if !nzRound:InProgress() or nzRound:InState( ROUND_INIT ) then + ply:PrintMessage( HUD_PRINTTALK, "No round in progress, couldnt set you to spectator!" ) + elseif ply:IsReady() then + ply:UnReady() + ply:SetSpectator() + else + ply:SetSpectator() + end +end, true) + +chatcommand.Add("/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, true) + +--cheats +chatcommand.Add("/revive", function(ply, text) + local plyToRev = player.GetByName(text[1]) or ply + if IsValid(plyToRev) and !ply:GetNotDowned() then + plyToRev:RevivePlayer() + else + ply:ChatPrint("Player could not have been revived, are you sure he is downed?") + end +end, false, "[playerName] Revive yourself or another player.") + +chatcommand.Add("/givepoints", function(ply, text) + local plyToGiv = player.GetByName(text[1]) + local points + + if !plyToGiv then + points = tonumber(text[1]) + plyToGiv = ply + else + points = tonumber(text[2]) + end + + if IsValid(plyToGiv) and plyToGiv:Alive() and (plyToGiv:IsPlaying() or nzRound:InState(ROUND_CREATE)) then + if points then + plyToGiv:GivePoints(points) + else + ply:ChatPrint("No valid number provided.") + end + else + ply:ChatPrint("The player you have selected is either not valid or not alive.") + end +end, false, "[playerName] pointAmount Give points to yourself or another player.") + +chatcommand.Add("/giveweapon", function(ply, text) + local plyToGiv = player.GetByName(text[1]) + + local wep + + if !plyToGiv then + wep = weapons.Get(text[1]) + plyToGiv = ply + else + wep = weapons.Get(text[2]) + end + if IsValid(plyToGiv) and plyToGiv:Alive() and (plyToGiv:IsPlaying() or nzRound:InState(ROUND_CREATE)) then + if wep then + plyToGiv:Give(wep.ClassName) + else + ply:ChatPrint("No valid weapon provided.") + end + else + ply:ChatPrint("The player you have selected is either not valid or not alive.") + end +end, false, "[playerName] weaponName Give a weapon to yourself or another player.") + +chatcommand.Add("/giveperk", function(ply, text) + local plyToGiv = player.GetByName(text[1]) + + local perk + + if !plyToGiv then + perk = text[1] + plyToGiv = ply + else + perk = text[2] + end + if IsValid(plyToGiv) and plyToGiv:Alive() and (plyToGiv:IsPlaying() or nzRound:InState(ROUND_CREATE)) then + if nz.Perks.Functions.Get(perk) then + plyToGiv:GivePerk(perk) + else + ply:ChatPrint("No valid perk provided.") + end + else + ply:ChatPrint("They player you have selected is either not valid or not alive.") + end +end, false, "[playerName] perkID Give a perk to yourself or another player.") + +chatcommand.Add("/targetpriority", function(ply, text) + local plyToGiv + local strstart, strend = string.find(text[1], "entity(", 1, true) + if strstart then + local _, strstop = string.find(text[1], ")", strend, true) + local ent = string.sub(text[1], strend + 1, strstop - 1) + if ent and IsValid(Entity(ent)) then + plyToGiv = Entity(ent) + end + else + plyToGiv = player.GetByName(text[1]) + end + + local priority + + if !plyToGiv then + priority = tonumber(text[1]) + plyToGiv = ply + else + priority = tonumber(text[2]) + end + if IsValid(plyToGiv) and (!plyToGiv:IsPlayer() or (plyToGiv:Alive() and (plyToGiv:IsPlaying() or nzRound:InState(ROUND_CREATE)))) then + if priority then + plyToGiv:SetTargetPriority(priority) + else + ply:ChatPrint("No valid priority provided.") + end + else + ply:ChatPrint("They player you have selected is either not valid or not alive.") + end +end) + +chatcommand.Add("/activateelec", function(ply, text) + nzElec:Activate() +end) + +chatcommand.Add("/navflush", function(ply, text) + nz.Nav.Functions.FlushAllNavModifications() + PrintMessage(HUD_PRINTTALK, "Navlocks and Navgroups successfully flushed. Remember to redo them for best playing experience.") +end) diff --git a/nzombies3/gamemode/cl_init.lua b/gamemodes/nzombies3/gamemode/cl_init.lua similarity index 100% rename from nzombies3/gamemode/cl_init.lua rename to gamemodes/nzombies3/gamemode/cl_init.lua diff --git a/gamemodes/nzombies3/gamemode/class/sh_constructor.lua b/gamemodes/nzombies3/gamemode/class/sh_constructor.lua new file mode 100644 index 00000000..6b42113f --- /dev/null +++ b/gamemodes/nzombies3/gamemode/class/sh_constructor.lua @@ -0,0 +1,259 @@ +-- class.lua +-- Compatible with Lua 5.1 (not 5.0). +-- +--[[ + Usage: + -- Define a class A + A = class( + -- First parameter to class function is a table with properties and + -- constructor method. Error if not specified or not a table + -- + { + -- Define our properties. These are the values each new instance will start out with. + -- + a = 0; + b = 0; + c = 0; + -- Implement a constructor that will get called once for each instance and create/set + -- property values. You are responsible for ensuring the first parameter is the self + -- parameter as it will be invoked with the instanceObj when a new instance is created. + -- Defining functions here is kind of ugly as you have to use table name = value syntax + -- See __tostring example below for a better looking way to do it. + -- + constructor = function (self, a, b, c) + -- For each parameter specified, overwrite default value, otherwise keep default value + -- + self.a = a or self.a + self.b = b or self.b + self.c = c or self.c + end + -- Define any further class methods here. Again, you are responsible + -- for making sure the first parameter is the self parameter and calling + -- the method with the : syntax (e.g. instanceObj:method) so that Lua will + -- pass instanceObj as the first parameter to the method. + }, + -- Second parameter is an optional (non-nil) table that defines + -- static member variables. Error if specified and not a table. + -- + { + __class__name = "A" + }, + -- Third parameter is an optional (non-nil) table that defines + -- the base class. If present, this class will inherit, via copy, + -- the base classes properties and methods. Error if specified + -- and not a table created by the the class function + -- + nil + ) + -- Add a new property d to the class definition before we create any instances + -- + A.d = 0 + -- Implement a tostring method to return string representation of instance + -- Using classname: syntax allows a more natural definition and eliminates the + -- need to explicitly specify the self parameter + -- + function A:__tostring() + return "A: " .. self.a .. " B: " .. self.b .. " C: " .. self.c .. " D: " .. self.d + end + -- Implement a method to do a random calculation on the instance property values. + -- + function A:Step(amount) + self.a = self.b + (self.c * amount); + end + -- Create an instance of class A + test = A(1,2,3); + -- Display its value + print("test.tostring: " .. test.tostring(); + -- Call Step method to do a random calculation + test.Step(10); + -- Display its value to see what changed. + print("test.tostring: " .. test.tostring(); +]]-- + +function class(def, statics, base) + -- Error if def argument missing or is not a table + if not def or type(def) ~= 'table' then error("class definition missing or not a table") end + + -- Error if statics argument is not nil and not a table + if statics and type(statics) ~= 'table' then error("statics parameter specified but not a table") end + + -- Error if base argument not nil and not a table created by this function. + if base and (type(base) ~= 'table' or not isclass(base)) then error("base parameter specified but not a table created by class function") end + + -- Start with a table for this class. This will be the metatable for + -- all instances of this class and where all class methods and static properties + -- will be kept. Initially it has two slots, __class__ == true to indicate this + -- table represents a class created by this function and __base__, which if not + -- nil is a reference to a base class created by this function + -- + local c = {__base__ = base} + c.__class__ = c + + -- Local function that will be used to create an instance of the class + -- when the class is called + -- + local function create(class_tbl, ...) + -- Create an instance initialized with per instance properties + -- + local instanceObj = {} + + -- Shallow copy of any class instance property initializers into our copy + -- + for i,v in pairs(c.__initprops__) do + instanceObj[i] = v + end + + -- __index for each instance is the class object + -- + setmetatable(instanceObj, { __index = c }) + + -- If constructor key is not nil then it is this class's constructor + -- so call it with our arguments + -- + if instanceObj.constructor then + instanceObj:constructor(...) + end + + -- Return new instance of the class + -- + return instanceObj + end + + + -- Create a metatable for the class whose __index field is just the class + -- This will be the metatable for each new instance of this class created. + -- + local c_mt = { __call = create} + if base then + -- Redirect class metatable __index slot to base class if specified + -- + c_mt.__index = base + end + + -- If statics is specified, shallow copy of non-function slots to our class + -- + if statics then + for i,v in pairs(statics) do + if type(v) ~= 'function' then + -- Ignore functions in statics table as we only support + -- static properties. + -- + c[i] = v + else + -- Error if this happens? + error("function definitions not supported in statics table") + end + end + end + + -- Table for instance property initial values + -- + c.__initprops__ = {} + + -- Copy base class slots first if any so they will get overlayed + -- by class slots of the same key + -- + if base then + -- Copy instance property initializers from base class + -- + for i,v in pairs(base.__initprops__) do + c.__initprops__[i] = v + end + end + + -- Now copy slots from the definition passed in. For functions, + -- store shallow copy to our class table. For anything not a + -- function slot, shallow copy to c.__initprops__ table for use + -- when a new object of this class is instantiated. + -- + for i,v in pairs(def) do + if type(v) ~= 'function' then + c.__initprops__[i] = v + else + c[i] = v + end + end + + -- Define an__instanceof__ method to determine if an instance. + -- was derived from the passed class. Used to emulate Squirrel + -- instanceof binary operator + -- + c.__instanceof__ = function(instanceObj, classObj) + local c = getclass(instanceObj) + while c do + if c == classObj then return true end + c = c.__base__ + end + return false + end + + -- Define an __getclass__ method to emulate Squirrel 3 object.getclass() + -- + c.__getclass__ =function(instanceObj) + -- class object is __class__ slot of instance object's metatable + -- + local classObj = getmetatable(instanceObj).__index + + -- Sanity check the metatable is really a class object + -- we created. If so return it otherwise nil + -- + if isclass(classObj) then + return classObj + else + return nil + end + end + + -- Define a __getbase__ method to emulate Squirrel 3 object.getbase() + -- method. + -- + c.__getbase__ = function(classObj) + -- Sanity check the metatable is really a class object + -- we created. If so return it's __base__ property + -- otherwise nil + -- + if isclass(classObj) then + -- base class, if any, is stored in class __base__ slot + -- + return classObj.__base__ + else + return nil + end + end + + setmetatable(c, c_mt) + return c +end + +-- Implement Squirrel instanceof binary operator +-- +function instanceof(instanceObj, classObj) + c = rawget(getmetatable(instanceObj) or {}, "__index") + h = rawget(c or {}, "__instanceof__") + return h and h(instanceObj, classObj) or nil +end + + +-- Implement Squirrel getclass function +-- +function getclass(instanceObj) + c = rawget(getmetatable(instanceObj) or {}, "__index") + h = rawget(c or {}, "__getclass__") + return h and h(instanceObj) or nil +end + + +-- Implement Squirrel getbase function +-- +function getbase(instanceObj) + c = isclass(instanceObj) and instanceObj or rawget(getmetatable(instanceObj) or {}, "__index") + h = rawget(c or {}, "__getbase__") + return h and h(c) or nil +end + + +-- Implement isclass function +-- +function isclass(classObj) + return classObj and classObj.__class__ == classObj +end diff --git a/gamemodes/nzombies3/gamemode/config/sh_constructor.lua b/gamemodes/nzombies3/gamemode/config/sh_constructor.lua new file mode 100644 index 00000000..5c46365d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/config/sh_constructor.lua @@ -0,0 +1,251 @@ +-- Main Tables +nzConfig = nzConfig or {} +-- nzConfig.Functions = {} +-- nzConfig.Data = {} + +-- Defaults + +if not ConVarExists("nz_randombox_whitelist") then CreateConVar("nz_randombox_whitelist", 1, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE}) end +if not ConVarExists("nz_downtime") then CreateConVar("nz_downtime", 45, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_nav_grouptargeting") then CreateConVar("nz_nav_grouptargeting", 1, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_round_special_interval") then CreateConVar("nz_round_special_interval", 6, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_round_prep_time") then CreateConVar("nz_round_prep_time", 10, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_randombox_maplist") then CreateConVar("nz_randombox_maplist", 1, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_round_dropins_allow") then CreateConVar("nz_round_dropins_allow", 1, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_zombie_amount_base") then CreateConVar("nz_difficulty_zombie_amount_base", 5, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_zombie_amount_scale") then CreateConVar("nz_difficulty_zombie_amount_scale", 1.01, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_zombie_health_base") then CreateConVar("nz_difficulty_zombie_health_base", 75, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_zombie_health_scale") then CreateConVar("nz_difficulty_zombie_health_scale", 1.1, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_max_zombies_alive") then CreateConVar("nz_difficulty_max_zombies_alive", 35, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_barricade_planks_max") then CreateConVar("nz_difficulty_barricade_planks_max", 6, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_powerup_chance") then CreateConVar("nz_difficulty_powerup_chance", 2, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_difficulty_perks_max") then CreateConVar("nz_difficulty_perks_max", 4, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end +if not ConVarExists("nz_point_notification_clientside") then CreateConVar("nz_point_notification_clientside", 0, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_ARCHIVE, FCVAR_REPLICATED}) end + +-- Zombie table - Moved to shared area for client collision prediction (barricades) +nzConfig.ValidEnemies = { + ["nz_zombie_walker"] = { + -- Set to false to disable the spawning of this zombie + Valid = true, + -- Allow you to scale damage on a per-hitgroup basis + ScaleDMG = function(zombie, hitgroup, dmginfo) + -- Headshots for double damage + if hitgroup == HITGROUP_HEAD then dmginfo:ScaleDamage(2) end + end, + -- Function runs whenever the zombie is damaged (NOT when killed) + OnHit = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + -- If player is playing and is not downed, give points + if attacker:IsPlayer() and attacker:GetNotDowned() then + attacker:GivePoints(10) + end + end, + -- Function is run whenever the zombie is killed + OnKilled = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + if dmginfo:GetDamageType() == DMG_CLUB then + attacker:GivePoints(130) + elseif hitgroup == HITGROUP_HEAD then + attacker:GivePoints(100) + else + attacker:GivePoints(50) + end + end + end + }, + ["nz_zombie_special_burning"] = { + Valid = true, + ScaleDMG = function(zombie, hitgroup, dmginfo) + if hitgroup == HITGROUP_HEAD then dmginfo:ScaleDamage(2) end + end, + OnHit = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + attacker:GivePoints(10) + end + end, + OnKilled = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + if dmginfo:GetDamageType() == DMG_CLUB then + attacker:GivePoints(130) + elseif hitgroup == HITGROUP_HEAD then + attacker:GivePoints(100) + else + attacker:GivePoints(50) + end + end + end + }, + ["nz_zombie_special_dog"] = { + Valid = true, + SpecialSpawn = true, + ScaleDMG = function(zombie, hitgroup, dmginfo) + if hitgroup == HITGROUP_HEAD then dmginfo:ScaleDamage(2) end + end, + OnHit = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + attacker:GivePoints(10) + end + end, + OnKilled = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + if dmginfo:GetDamageType() == DMG_CLUB then + attacker:GivePoints(130) + elseif hitgroup == HITGROUP_HEAD then + attacker:GivePoints(100) + else + attacker:GivePoints(50) + end + end + end + }, + ["nz_zombie_boss_panzer"] = { + Valid = true, + SpecialSpawn = true, + ScaleDMG = function(zombie, hitgroup, dmginfo) + if hitgroup == HITGROUP_HEAD then dmginfo:ScaleDamage(2) end + end, + OnHit = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + attacker:GivePoints(10) + end + end, + OnKilled = function(zombie, dmginfo, hitgroup) + local attacker = dmginfo:GetAttacker() + if attacker:IsPlayer() and attacker:GetNotDowned() then + if dmginfo:GetDamageType() == DMG_CLUB then + attacker:GivePoints(130) + elseif hitgroup == HITGROUP_HEAD then + attacker:GivePoints(100) + else + attacker:GivePoints(50) + end + end + end + }, +} + +-- Random Box + +nzConfig.WeaponBlackList = {} +function nzConfig.AddWeaponToBlacklist( class, remove ) + nzConfig.WeaponBlackList[class] = remove and nil or true +end + +nzConfig.AddWeaponToBlacklist( "weapon_base" ) +nzConfig.AddWeaponToBlacklist( "weapon_fists" ) +nzConfig.AddWeaponToBlacklist( "weapon_flechettegun" ) +nzConfig.AddWeaponToBlacklist( "weapon_medkit" ) +nzConfig.AddWeaponToBlacklist( "weapon_dod_sim_base" ) +nzConfig.AddWeaponToBlacklist( "weapon_dod_sim_base_shot" ) +nzConfig.AddWeaponToBlacklist( "weapon_dod_sim_base_snip" ) +nzConfig.AddWeaponToBlacklist( "weapon_sim_admin" ) +nzConfig.AddWeaponToBlacklist( "weapon_sim_spade" ) +nzConfig.AddWeaponToBlacklist( "fas2_base" ) +nzConfig.AddWeaponToBlacklist( "fas2_ammobox" ) +nzConfig.AddWeaponToBlacklist( "fas2_ifak" ) +nzConfig.AddWeaponToBlacklist( "nz_multi_tool" ) +nzConfig.AddWeaponToBlacklist( "nz_grenade" ) +nzConfig.AddWeaponToBlacklist( "nz_perk_bottle" ) +nzConfig.AddWeaponToBlacklist( "nz_quickknife_crowbar" ) +nzConfig.AddWeaponToBlacklist( "nz_tool_base" ) +nzConfig.AddWeaponToBlacklist( "nz_one_inch_punch" ) -- Nope! You gotta give this with special map scripts + +nzConfig.AddWeaponToBlacklist( "cw_base" ) + +nzConfig.WeaponWhiteList = { + "fas2_", "m9k_", "cw_", +} + +if SERVER then + + nzConfig.RoundData = {} + --nzConfig.RoundData[1] = {["nz_zombie_walker"] = 100} + + --[[ + -- EXAMPLE of a round zombie config: + nzConfig.RoundData[ROUNDNUMBER] = { + -- define normal zombies and theri spawn chances + normalTypes = { + ["nz_zombie_walker"] = { + chance = 100, + }, + }, + -- (optional) how many normal zombies will spawn this wil overwrite the default curves + normalCount = 50, + + -- (optional) modify teh count witha function ratehr than a fixed amount + -- if both normalCount and normalCountMod are set the gamemode will ignore normalCount + normalCountMod = function(original) return orignal / 2 end, + + -- (optional) spawn delay + -- this will spawn the zombies in a 3 second intervall + normalDelay = 3, + + -- special zombies (different spawnpoint usually in front of barricades) + -- this will spawn 10 hellhounds in additon to the normal zombies + specialTypes = { + ["nz_zombie_special_dog"] = { + chance = 100, + }, + + }, + -- (optional) not required but recommended if this is not set teh zombie amount will be doubled + specialCount = 10 + -- (optional) flag this round as special (this will trigger fog etc.) + special = true + } + ]]-- + + nzConfig.RoundData[1] = { + normalTypes = { + ["nz_zombie_walker"] = { + chance = 100, + }, + }, + } + nzConfig.RoundData[2] = { + normalTypes = { + ["nz_zombie_walker"] = { + chance = 100, + }, + }, + } + nzConfig.RoundData[13] = { + normalTypes = { + ["nz_zombie_walker"] = { + chance = 80, + }, + ["nz_zombie_special_burning"] = { + chance = 20, + }, + }, + } + nzConfig.RoundData[14] = { + normalTypes = { + ["nz_zombie_walker"] = { + chance = 100, + }, + }, + } + nzConfig.RoundData[23] = { + normalTypes = { + ["nz_zombie_walker"] = { + chance = 90, + }, + ["nz_zombie_special_burning"] = { + chance = 10, + }, + }, + } + + -- Player Class + nzConfig.BaseStartingWeapons = {"fas2_glock20"} -- "fas2_p226", "fas2_ots33", "fas2_glock20" "weapon_pistol" + -- nzConfig.CustomConfigStartingWeps = true -- If this is set to false, the gamemode will avoid using custom weapons in configs + +end diff --git a/gamemodes/nzombies3/gamemode/curves/sh_constructor.lua b/gamemodes/nzombies3/gamemode/curves/sh_constructor.lua new file mode 100644 index 00000000..f8d92078 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/curves/sh_constructor.lua @@ -0,0 +1,36 @@ +if SERVER then + -- Main Tables + nzCurves = nzCurves or {} + + function nzCurves.GenerateHealthCurve(round) + return math.Round(GetConVar("nz_difficulty_zombie_health_base"):GetFloat()*math.pow(GetConVar("nz_difficulty_zombie_health_scale"):GetFloat(),round - 1)) + end + + function nzCurves.GenerateMaxZombies(round) + return math.Round(GetConVar("nz_difficulty_zombie_amount_base"):GetInt()*math.pow(round,GetConVar("nz_difficulty_zombie_amount_scale"):GetFloat())) + end + + function nzCurves.GenerateSpeedTable(round) + if !round then return {[50] = 100} end -- Default speed for any invalid round (Say, creative mode test zombies) + local tbl = {} + local range = 3 -- The range on either side of the tip (current round) of speeds in steps of "steps" + local min = 50 -- Minimum speed (Round 1) + local max = 300 -- Maximum speed + local maxround = 25 -- The round at which the 300 speed has its tip + local steps = ((max-min)/maxround) -- The different speed steps speed can exist in + + print("Generating round speeds with steps of "..steps.."...") + for i = -range, range do + local speed = (min - steps + steps*round) + (steps*i) + if speed >= min and speed <= max then + local chance = 100 - 10*math.abs(i)^2 + --print("Speed is "..speed..", with a chance of "..chance) + tbl[speed] = chance + elseif speed >= max then + tbl[max] = 100 + end + end + return tbl + end + +end diff --git a/gamemodes/nzombies3/gamemode/debugging/sh_constructor.lua b/gamemodes/nzombies3/gamemode/debugging/sh_constructor.lua new file mode 100644 index 00000000..b78ac46d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/debugging/sh_constructor.lua @@ -0,0 +1,23 @@ +NZ_DEBUG_LOGLEVEL_MAX = 3 +NZ_DEBUG_LOGLEVEL_INFO = 2 +NZ_DEBUG_LOGLEVEL_ERROR = 1 + +CreateConVar("nz_log_level", "0", FCVAR_ARCHIVE, "The nz log level.") + +-- Usage: Provide a loglevel and a comma seperated list of values +function DebugPrint(logLevel, ...) + local requiredLvl = GetConVar("nz_log_level"):GetInt() or 0 + if requiredLvl >= logLevel then + local arg = {...} + local result = "" + for i=1, #arg do + if istable(arg[i]) then + PrintTable(arg[i]) + else + result = result .. tostring(arg[i]) .. "\t" + end + end + print(result) + end + +end diff --git a/gamemodes/nzombies3/gamemode/display/cl_contextmenu.lua b/gamemodes/nzombies3/gamemode/display/cl_contextmenu.lua new file mode 100644 index 00000000..183e29cc --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_contextmenu.lua @@ -0,0 +1,234 @@ + +local PANEL = {} + +AccessorFunc( PANEL, "m_bHangOpen", "HangOpen" ) + +function PANEL:Init() + + -- + -- This makes it so that when you're hovering over this panel + -- you can `click` on the world. Your viewmodel will aim etc. + -- + self:SetWorldClicker( true ) + + self.Canvas = vgui.Create( "DCategoryList", self ) + self.m_bHangOpen = false + + --self.Canvas:EnableVerticalScrollbar( true ) + --self.Canvas:SetSpacing( 0 ) + --self.Canvas:SetPadding( 5 ) + --self.Canvas:SetDrawBackground( false ) + +end + + +function PANEL:Open() + + self:SetHangOpen( false ) + + if ( self:IsVisible() ) then return end + + CloseDermaMenus() + + self:MakePopup() + self:SetVisible( true ) + self:SetKeyboardInputEnabled( false ) + self:SetMouseInputEnabled( true ) + + RestoreCursorPosition() + + local bShouldShow = true; + + -- TODO: Any situation in which we shouldn't show the tool menu on the context menu? + + -- Set up the active panel.. + + self.Canvas:SetVisible( false ) + + self:InvalidateLayout( true ) + +end + + +function PANEL:Close( bSkipAnim ) + + if ( self:GetHangOpen() ) then + self:SetHangOpen( false ) + return + end + + RememberCursorPosition() + + CloseDermaMenus() + + self:SetKeyboardInputEnabled( false ) + self:SetMouseInputEnabled( false ) + + self:SetAlpha( 255 ) + self:SetVisible( false ) + self:RestoreControlPanel() + +end + + +function PANEL:PerformLayout() + + self:SetPos( 0, 0 ) + self:SetSize( ScrW(), ScrH() ) + + self.Canvas:SetWide( 311 ) + self.Canvas:SetPos( ScrW() - self.Canvas:GetWide() - 50, self.y ) + + self.Canvas:InvalidateLayout( true ) + +end + + +function PANEL:StartKeyFocus( pPanel ) + + self:SetKeyboardInputEnabled( true ) + self:SetHangOpen( true ) + +end + + +function PANEL:EndKeyFocus( pPanel ) + + self:SetKeyboardInputEnabled( false ) + +end + + +function PANEL:RestoreControlPanel() + +end + +-- +-- Note here: EditablePanel is important! Child panels won't be able to get +-- keyboard input if it's a DPanel or a Panel. You need to either have an EditablePanel +-- or a DFrame (which is derived from EditablePanel) as your first panel attached to the system. +-- +vgui.Register( "ContextMenu", PANEL, "EditablePanel" ) + + +function CreateContextMenu() + + if ( IsValid( g_ContextMenu ) ) then + g_ContextMenu:Remove() + g_ContextMenu = nil + end + + g_ContextMenu = vgui.Create( "ContextMenu" ) + g_ContextMenu:SetVisible( false ) + + menubar.Init() + -- + -- We're blocking clicks to the world - but we don't want to + -- so feed clicks to the proper functions.. + -- + g_ContextMenu.OnMousePressed = function( p, code ) + hook.Run( "GUIMousePressed", code, gui.ScreenToVector( gui.MousePos() ) ) + end + g_ContextMenu.OnMouseReleased = function( p, code ) + hook.Run( "GUIMouseReleased", code, gui.ScreenToVector( gui.MousePos() ) ) + end + + hook.Run( "ContextMenuCreated", g_ContextMenu ) + + + local IconLayout = g_ContextMenu:Add( "DIconLayout" ) + IconLayout:Dock( LEFT ) + IconLayout:SetWorldClicker( true ) + IconLayout:SetBorder( 8 ) + IconLayout:SetSpaceX( 8 ) + IconLayout:SetSpaceY( 8 ) + IconLayout:SetWide( 200 ) + IconLayout:SetLayoutDir( LEFT ) + + for k, v in pairs( list.Get( "DesktopWindows" ) ) do + + local icon = IconLayout:Add( "DButton" ) + icon:SetText( "" ) + icon:SetSize( 80, 82 ) + icon.Paint = function()end + + local label = icon:Add( "DLabel" ) + label:Dock( BOTTOM ) + label:SetText( v.title ) + label:SetContentAlignment( 5 ) + label:SetTextColor( Color( 255, 255, 255, 255 ) ) + label:SetExpensiveShadow( 1, Color( 0, 0, 0, 200 ) ) + + local image = icon:Add( "DImage" ) + image:SetImage( v.icon ) + image:SetSize( 64, 64 ) + image:Dock( TOP ) + image:DockMargin( 8, 0, 8, 0 ) + + icon.DoClick = function() + + -- + -- v might have changed using autorefresh so grab it again + -- + local newv = list.Get( "DesktopWindows" )[ k ] + + if ( v.onewindow ) then + if ( IsValid( icon.Window ) ) then icon.Window:Center() return end + end + + -- Make the window + icon.Window = g_ContextMenu:Add( "DFrame" ) + icon.Window:SetSize( newv.width, newv.height ) + icon.Window:SetTitle( newv.title ) + icon.Window:Center() + + newv.init( icon, icon.Window ) + + end + + end + +end + + +function GM:OnContextMenuOpen() + -- Let the gamemode decide whether we should open or not.. + --if ( !hook.Call( "ContextMenuOpen", GAMEMODE ) ) then return end + + if ( IsValid( g_ContextMenu ) && !g_ContextMenu:IsVisible() ) then + g_ContextMenu:Open() + menubar.ParentTo( g_ContextMenu ) + else + CreateContextMenu() + g_ContextMenu:Open() + menubar.ParentTo( g_ContextMenu ) + end + +end + + +function GM:OnContextMenuClose() + + if ( IsValid( g_ContextMenu ) ) then + g_ContextMenu:Close() + end + +end + +local function SpawnMenuKeyboardFocusOn( pnl ) + + if ( IsValid( g_ContextMenu ) && IsValid( pnl ) && pnl:HasParent( g_ContextMenu ) ) then + g_ContextMenu:StartKeyFocus( pnl ) + end + +end +hook.Add( "OnTextEntryGetFocus", "SpawnMenuKeyboardFocusOn", SpawnMenuKeyboardFocusOn ) + +local function SpawnMenuKeyboardFocusOff( pnl ) + + if ( IsValid( g_ContextMenu ) && IsValid( pnl ) && pnl:HasParent( g_ContextMenu ) ) then + g_ContextMenu:EndKeyFocus( pnl ) + end + +end +hook.Add( "OnTextEntryLoseFocus", "SpawnMenuKeyboardFocusOff", SpawnMenuKeyboardFocusOff ) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/display/cl_fonts.lua b/gamemodes/nzombies3/gamemode/display/cl_fonts.lua new file mode 100644 index 00000000..cf4b5ec5 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_fonts.lua @@ -0,0 +1,81 @@ +//Main Text +surface.CreateFont( "nz.display.hud.main", { + font = "DK Umbilical Noose", //Avenir Next + size = 48, + weight = 300, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.small", { + font = "DK Umbilical Noose", //Avenir Next + size = 28, + weight = 300, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.medium", { + font = "DK Umbilical Noose", //Avenir Next + size = 36, + weight = 300, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.points", { + font = "Default", + size = 20, + weight = 5000, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.ammo", { + font = "Calibri", + size = 60, + weight = 50, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.ammo2", { + font = "Calibri", + size = 40, + weight = 50, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.smaller", { + font = "DK Umbilical Noose", //Avenir Next + size = 18, + weight = 300, + antialias = true, +} ) + +surface.CreateFont( "nz.display.hud.rounds", { + font = "DK Umbilical Noose", //Avenir Next + size = 400, + weight = 30, + antialias = true, +} ) + +-- Rotated text function, as taken from the gmod wiki +local matscale = Vector(1,1,1) +function draw.TextRotatedScaled( text, x, y, color, font, ang, scaleX, scaleY ) + render.PushFilterMag( TEXFILTER.ANISOTROPIC ) + render.PushFilterMin( TEXFILTER.ANISOTROPIC ) + surface.SetFont( font ) + surface.SetTextColor( color ) + surface.SetTextPos( 0, 0 ) + local textWidth, textHeight = surface.GetTextSize( text ) + local rad = -math.rad( ang ) + x = x - ( math.cos( rad ) * textWidth / 2 + math.sin( rad ) * textHeight / 2 ) + y = y + ( math.sin( rad ) * textWidth / 2 + math.cos( rad ) * textHeight / 2 ) + local m = Matrix() + m:SetAngles( Angle( 0, ang, 0 ) ) + m:SetTranslation( Vector( x, y, 0 ) ) + matscale.x = scaleX + matscale.y = scaleY + m:Scale(matscale) + cam.PushModelMatrix( m ) + surface.DrawText( text ) + cam.PopModelMatrix() + render.PopFilterMag() + render.PopFilterMin() +end diff --git a/gamemodes/nzombies3/gamemode/display/cl_gamemodehooks.lua b/gamemodes/nzombies3/gamemode/display/cl_gamemodehooks.lua new file mode 100644 index 00000000..b2485fe4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_gamemodehooks.lua @@ -0,0 +1,17 @@ +function GM:ContextMenuOpen() + return nzRound:InState( ROUND_CREATE ) and LocalPlayer():IsAdmin() +end + +function GM:PopulateMenuBar(panel) + panel:Remove() + return false +end + +function GM:OnUndo( name, strCustomString ) + if ( !strCustomString ) then + notification.AddLegacy( "Undone "..name, NOTIFY_UNDO, 2 ) + else + notification.AddLegacy( strCustomString, NOTIFY_UNDO, 2 ) + end + surface.PlaySound( "buttons/button15.wav" ) +end diff --git a/gamemodes/nzombies3/gamemode/display/cl_hud.lua b/gamemodes/nzombies3/gamemode/display/cl_hud.lua new file mode 100644 index 00000000..76a87878 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_hud.lua @@ -0,0 +1,466 @@ +// +nzDisplay = {} + +local bloodline_points = Material("bloodline_score2.png", "unlitgeneric smooth") +local bloodline_gun = Material("cod_hud.png", "unlitgeneric smooth") + +--[[local bloodDecals = { + Material("decals/blood1"), + Material("decals/blood2"), + Material("decals/blood3"), + Material("decals/blood4"), + Material("decals/blood5"), + Material("decals/blood6"), + Material("decals/blood7"), + Material("decals/blood8"), + nil +}]] + +CreateClientConVar( "nz_hud_points_show_names", "1", true, false ) + +local function StatesHud() + if GetConVar("cl_drawhud"):GetBool() then + local text = "" + local font = "nz.display.hud.main" + local w = ScrW() / 2 + if nzRound:InState( ROUND_WAITING ) then + text = "Waiting for players. Type /ready to ready up." + font = "nz.display.hud.small" + elseif nzRound:InState( ROUND_CREATE ) then + text = "Creative Mode" + elseif nzRound:InState( 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 +end + +local tbl = {Entity(3), Entity(1), Entity(3), Entity(4), Entity(5),} + +local function ScoreHud() + if GetConVar("cl_drawhud"):GetBool() then + if nzRound:InProgress() then + + local scale = (ScrW() / 1920 + 1) / 2 + local offset = 0 + + for k,v in pairs(player.GetAll()) do + local hp = v:Health() + if hp == 0 then hp = "Dead" elseif Revive.Players[v:EntIndex()] then hp = "Downed" else hp = hp .. " HP" end + if v:GetPoints() >= 0 then + + local text = "" + local nameoffset = 0 + if GetConVar("nz_hud_points_show_names"):GetBool() then + local nick + if #v:Nick() >= 20 then + nick = string.sub(v:Nick(), 1, 20) -- limit name to 20 chars + else + nick = v:Nick() + end + text = nick + nameoffset = 10 + end + + local font = "nz.display.hud.small" + + surface.SetFont(font) + + local textW, textH = surface.GetTextSize(text) + + if LocalPlayer() == v then + offset = offset + textH + 5 -- change this if you change the size of nz.display.hud.medium + else + offset = offset + textH + end + + surface.SetDrawColor(200,200,200) + local index = v:EntIndex() + local color = player.GetColorByIndex(v:EntIndex()) + local blood = player.GetBloodByIndex(v:EntIndex()) + --for i = 0, 8 do + --surface.SetMaterial(bloodDecals[((index + i - 1) % #bloodDecals) + 1 ]) + surface.SetMaterial(blood) + surface.DrawTexturedRect(ScrW() - textW - 180, ScrH() - 275 * scale - offset, textW + 150, 45) + --end + --surface.DrawTexturedRect(ScrW() - 325*scale - numname * 10, ScrH() - 285*scale - (30*k), 250 + numname*10, 35) + if text then draw.SimpleText(text, font, ScrW() - textW - 60, ScrH() - 255 * scale - offset, color, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) end + if LocalPlayer() == v then + font = "nz.display.hud.medium" + end + draw.SimpleText(v:GetPoints(), font, ScrW() - textW - 60 - nameoffset, ScrH() - 255 * scale - offset, color, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER) + v.PointsSpawnPosition = {x = ScrW() - textW - 170, y = ScrH() - 255 * scale - offset} + end + end + end + end +end + +local function GunHud() + if GetConVar("cl_drawhud"):GetBool() then + if !LocalPlayer():IsNZMenuOpen() then + local wep = LocalPlayer():GetActiveWeapon() + local scale = ((ScrW()/1920)+1)/2 + + surface.SetMaterial(bloodline_gun) + surface.SetDrawColor(200,200,200) + surface.DrawTexturedRect(ScrW() - 630*scale, ScrH() - 225*scale, 600*scale, 225*scale) + if IsValid(wep) then + if wep:GetClass() == "nz_multi_tool" then + draw.SimpleTextOutlined(nz.Tools.ToolData[wep.ToolMode].displayname or wep.ToolMode, "nz.display.hud.small", ScrW() - 240*scale, ScrH() - 125*scale, Color(255,255,255,255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 2, Color(0,0,0)) + draw.SimpleTextOutlined(nz.Tools.ToolData[wep.ToolMode].desc or "", "nz.display.hud.smaller", ScrW() - 240*scale, ScrH() - 90*scale, Color(255,255,255,255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP, 2, Color(0,0,0)) + else + local name = wep:GetPrintName() + local clip = wep:Clip1() + if !name or name == "" then name = wep:GetClass() end + if wep.pap then + name = nz.Display_PaPNames[wep:GetClass()] or nz.Display_PaPNames[name] or "Upgraded "..name + end + if clip >= 0 then + draw.SimpleTextOutlined(name, "nz.display.hud.small", ScrW() - 390*scale, ScrH() - 120*scale, Color(255,255,255,255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 2, Color(0,0,0)) + draw.SimpleTextOutlined(clip, "nz.display.hud.ammo", ScrW() - 315*scale, ScrH() - 115*scale, Color(255,255,255,255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 2, Color(0,0,0)) + draw.SimpleTextOutlined("/"..LocalPlayer():GetAmmoCount(wep:GetPrimaryAmmoType()), "nz.display.hud.ammo2", ScrW() - 310*scale, ScrH() - 120*scale, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 2, Color(0,0,0)) + else + draw.SimpleTextOutlined(name, "nz.display.hud.small", ScrW() - 250*scale, ScrH() - 120*scale, Color(255,255,255,255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 2, Color(0,0,0)) + end + end + end + end + end +end + +local function PowerUpsHud() + if nzRound:InProgress() then + local font = "nz.display.hud.main" + local w = ScrW() / 2 + local offset = 40 + local c = 0 + for k,v in pairs(nzPowerUps.ActivePowerUps) do + if nzPowerUps:IsPowerupActive(k) then + local powerupData = nzPowerUps: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 + if !nzPowerUps.ActivePlayerPowerUps[LocalPlayer()] then nzPowerUps.ActivePlayerPowerUps[LocalPlayer()] = {} end + for k,v in pairs(nzPowerUps.ActivePlayerPowerUps[LocalPlayer()]) do + if nzPowerUps:IsPlayerPowerupActive(LocalPlayer(), k) then + local powerupData = nzPowerUps: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 nzDisplay.DrawLinks( ent, link ) + + local tbl = {} + //Check for zombie spawns + for k, v in pairs(ents.GetAll()) do + if v:IsBuyableProp() then + if nz.nzDoors.Data.BuyableProps[k] != nil then + if v.link == link then + table.insert(tbl, Entity(k)) + end + end + elseif v:IsDoor() then + if nz.nzDoors.Data.LinkFlags[v:doorIndex()] != nil then + if nz.nzDoors.Data.LinkFlags[v:doorIndex()].link == link then + table.insert(tbl, v) + end + end + elseif v:GetClass() == "nz_spawn_zombie_normal" 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 + +local PointsNotifications = {} +local function PointsNotification(ply, amount) + if !IsValid(ply) then return end + local data = {ply = ply, amount = amount, diry = math.random(-20, 20), time = CurTime()} + table.insert(PointsNotifications, data) + --PrintTable(data) +end + +net.Receive("nz_points_notification", function() + local amount = net.ReadInt(20) + local ply = net.ReadEntity() + + PointsNotification(ply, amount) +end) + +local function DrawPointsNotification() + + if GetConVar("nz_point_notification_clientside"):GetBool() then + for k,v in pairs(player.GetAll()) do + if v:GetPoints() >= 0 then + if !v.LastPoints then v.LastPoints = 0 end + if v:GetPoints() != v.LastPoints then + nz.Display.Functions.PointsNotification(v, v:GetPoints() - v.LastPoints) + v.LastPoints = v:GetPoints() + end + end + end + end + + local font = "nz.display.hud.points" + + for k,v in pairs(PointsNotifications) do + local fade = math.Clamp((CurTime()-v.time), 0, 1) + if !v.ply.PointsSpawnPosition then return end + if v.amount >= 0 then + draw.SimpleText(v.amount, font, v.ply.PointsSpawnPosition.x - 50*fade, v.ply.PointsSpawnPosition.y + v.diry*fade, Color(255,255,0,255-255*fade), TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER) + else + draw.SimpleText(v.amount, font, v.ply.PointsSpawnPosition.x - 50*fade, v.ply.PointsSpawnPosition.y + v.diry*fade, Color(255,0,0,255-255*fade), TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER) + end + if fade >= 1 then + table.remove(PointsNotifications, k) + end + end +end + +local perk_icons = { + ["jugg"] = Material("perk_icons/jugg.png", "smooth unlitgeneric"), + ["speed"] = Material("perk_icons/speed.png", "smooth unlitgeneric"), + ["dtap"] = Material("perk_icons/dtap.png", "smooth unlitgeneric"), + ["revive"] = Material("perk_icons/revive.png", "smooth unlitgeneric"), + ["dtap2"] = Material("perk_icons/dtap2.png", "smooth unlitgeneric"), + ["staminup"] = Material("perk_icons/staminup.png", "smooth unlitgeneric"), + ["phd"] = Material("perk_icons/phd.png", "smooth unlitgeneric"), + ["deadshot"] = Material("perk_icons/deadshot.png", "smooth unlitgeneric"), + ["mulekick"] = Material("perk_icons/mulekick.png", "smooth unlitgeneric"), + ["cherry"] = Material("perk_icons/cherry.png", "smooth unlitgeneric"), + ["tombstone"] = Material("perk_icons/tombstone.png", "smooth unlitgeneric"), + ["whoswho"] = Material("perk_icons/whoswho.png", "smooth unlitgeneric"), + ["vulture"] = Material("perk_icons/vulture.png", "smooth unlitgeneric"), + + -- Only used to see PaP through walls with Vulture Aid + ["pap"] = Material("vulture_icons/pap.png", "smooth unlitgeneric"), +} + +local function PerksHud() + local scale = (ScrW()/1920 + 1)/2 + local w = -20 + local size = 50 + for k,v in pairs(LocalPlayer():GetPerks()) do + surface.SetMaterial(perk_icons[v]) + surface.SetDrawColor(255,255,255) + surface.DrawTexturedRect(w + k*(size*scale + 10), ScrH() - 200, size*scale, size*scale) + end +end + +local vulture_textures = { + ["wall_buys"] = Material("vulture_icons/wall_buys.png", "smooth unlitgeneric"), + ["random_box"] = Material("vulture_icons/random_box.png", "smooth unlitgeneric"), + ["wunderfizz_machine"] = Material("vulture_icons/wunderfizz.png", "smooth unlitgeneric"), +} + +local function VultureVision() + if !LocalPlayer():HasPerk("vulture") then return end + local scale = (ScrW()/1920 + 1)/2 + + for k,v in pairs(ents.FindInSphere(LocalPlayer():GetPos(), 700)) do + local target = v:GetClass() + if vulture_textures[target] then + local data = v:WorldSpaceCenter():ToScreen() + if data.visible then + surface.SetMaterial(vulture_textures[target]) + surface.SetDrawColor(255,255,255,150) + surface.DrawTexturedRect(data.x - 15*scale, data.y - 15*scale, 30*scale, 30*scale) + end + elseif target == "perk_machine" then + local data = v:WorldSpaceCenter():ToScreen() + if data.visible then + surface.SetMaterial(perk_icons[v:GetPerkID()]) + surface.SetDrawColor(255,255,255,150) + surface.DrawTexturedRect(data.x - 15*scale, data.y - 15*scale, 30*scale, 30*scale) + end + end + end +end + +local round_white = 0 +local round_alpha = 255 +local round_num = 0 --nz.Rounds.Data.CurrentRound or 0 +local function RoundHud() + + local text = "" + local font = "nz.display.hud.rounds" + local w = 70 + local h = ScrH() - 30 + local round = round_num + local col = Color(200 + round_white*55, round_white, round_white,round_alpha) + if round < 11 then + for i = 1, round do + if i == 5 or i == 10 then + text = text.." " + else + text = text.."i" + end + end + if round >= 5 then + draw.TextRotatedScaled( "i", w + 100, h - 150, col, font, 60, 1, 1.7 ) + end + if round >= 10 then + draw.TextRotatedScaled( "i", w + 220, h - 150, col, font, 60, 1, 1.7 ) + end + else + text = round + end + draw.SimpleText(text, font, w, h, col, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM) + +end + +local roundchangeending = false +local prevroundspecial = false +local function StartChangeRound() + + print(nzRound:GetNumber(), nzRound:IsSpecial()) + + if nzRound:GetNumber() >= 1 then + if prevroundspecial then + surface.PlaySound("nz/round/special_round_end.wav") + else + surface.PlaySound("nz/round/round_end.mp3") + end + else + round_num = 0 + end + + roundchangeending = false + round_white = 0 + local round_charger = 0.25 + local alphafading = false + local haschanged = false + hook.Add("HUDPaint", "nz_roundnumWhiteFade", function() + if !alphafading then + round_white = math.Approach(round_white, round_charger > 0 and 255 or 0, round_charger*350*FrameTime()) + if round_white >= 255 and !roundchangeending then + alphafading = true + round_charger = -1 + elseif round_white <= 0 and roundchangeending then + hook.Remove("HUDPaint", "nz_roundnumWhiteFade") + end + else + round_alpha = math.Approach(round_alpha, round_charger > 0 and 255 or 0, round_charger*350*FrameTime()) + if round_alpha >= 255 then + if haschanged then + round_charger = -0.25 + alphafading = false + else + round_charger = -1 + end + elseif round_alpha <= 0 then + if roundchangeending then + round_num = nzRound:GetNumber() + round_charger = 0.5 + if nzRound:IsSpecial() then + surface.PlaySound("nz/round/special_round_start.wav") + prevroundspecial = true + else + surface.PlaySound("nz/round/round_start.mp3") + prevroundspecial = false + end + haschanged = true + else + round_charger = 1 + end + end + end + end) + +end + +local function EndChangeRound() + roundchangeending = true +end + +local grenade_icon = Material("grenade-256.png", "unlitgeneric smooth") +local function DrawGrenadeHud() + local num = LocalPlayer():GetAmmoCount("nz_grenade") + local numspecial = LocalPlayer():GetAmmoCount("nz_specialgrenade") + local scale = (ScrW()/1920 + 1)/2 + + --print(num) + if num > 0 then + surface.SetMaterial(grenade_icon) + surface.SetDrawColor(255,255,255) + for i = num, 1, -1 do + --print(i) + surface.DrawTexturedRect(ScrW() - 250*scale - i*10*scale, ScrH() - 90*scale, 30*scale, 30*scale) + end + end + if numspecial > 0 then + surface.SetMaterial(grenade_icon) + surface.SetDrawColor(255,100,100) + for i = numspecial, 1, -1 do + --print(i) + surface.DrawTexturedRect(ScrW() - 300*scale - i*10*scale, ScrH() - 90*scale, 30*scale, 30*scale) + end + end + --surface.DrawTexturedRect(ScrW()/2, ScrH()/2, 100, 100) +end + +//Hooks +hook.Add("HUDPaint", "pointsNotifcationHUD", DrawPointsNotification ) +hook.Add("HUDPaint", "roundHUD", StatesHud ) +hook.Add("HUDPaint", "scoreHUD", ScoreHud ) +hook.Add("HUDPaint", "gunHUD", GunHud ) +hook.Add("HUDPaint", "powerupHUD", PowerUpsHud ) +hook.Add("HUDPaint", "perksHUD", PerksHud ) +hook.Add("HUDPaint", "vultureVision", VultureVision ) +hook.Add("HUDPaint", "roundnumHUD", RoundHud ) +hook.Add("HUDPaint", "grenadeHUD", DrawGrenadeHud ) + +hook.Add("OnRoundPreperation", "BeginRoundHUDChange", StartChangeRound) +hook.Add("OnRoundStart", "EndRoundHUDChange", EndChangeRound) + +local blockedweps = { + ["nz_revive_morphine"] = true, + ["nz_packapunch_arms"] = true, + ["nz_perk_bottle"] = true, +} + +function GM:HUDWeaponPickedUp( wep ) + + if ( !IsValid( LocalPlayer() ) || !LocalPlayer():Alive() ) then return end + if ( !IsValid( wep ) ) then return end + if ( !isfunction( wep.GetPrintName ) ) then return end + if blockedweps[wep:GetClass()] then return end + + local pickup = {} + pickup.time = CurTime() + pickup.name = wep:GetPrintName() + pickup.holdtime = 5 + pickup.font = "DermaDefaultBold" + pickup.fadein = 0.04 + pickup.fadeout = 0.3 + pickup.color = Color( 255, 200, 50, 255 ) + + surface.SetFont( pickup.font ) + local w, h = surface.GetTextSize( pickup.name ) + pickup.height = h + pickup.width = w + + if ( self.PickupHistoryLast >= pickup.time ) then + pickup.time = self.PickupHistoryLast + 0.05 + end + + table.insert( self.PickupHistory, pickup ) + self.PickupHistoryLast = pickup.time + +end diff --git a/gamemodes/nzombies3/gamemode/display/cl_hudblock.lua b/gamemodes/nzombies3/gamemode/display/cl_hudblock.lua new file mode 100644 index 00000000..5938eca4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_hudblock.lua @@ -0,0 +1,11 @@ +local blockedhuds = { + ["CHudAmmo"] = true, + ["CHudSecondaryAmmo"] = true, + ["CHudBattery"] = true, +} + +hook.Add( "HUDShouldDraw", "HideHUD", function( name ) + if blockedhuds[name] then return false end + if name == "CHudWeaponSelection" then return !nzRound:InProgress() end -- Has it's own value + if name == "CHudHealth" then return !GetConVar("nz_bloodoverlay"):GetBool() end -- Same +end ) diff --git a/gamemodes/nzombies3/gamemode/display/cl_papnames.lua b/gamemodes/nzombies3/gamemode/display/cl_papnames.lua new file mode 100644 index 00000000..c2471498 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_papnames.lua @@ -0,0 +1,63 @@ +nz.Display_PaPNames = { + -- You can use both class names and display names, class names take priority but display names can apply to multiple weapons + ["fas2_glock20"] = "Glock-115c", + ["Ray Gun"] = "Porter's X2 Ray Gun", + ["Raygun"] = "Porter's X2 Ray Gun", + ["fas2_ak12"] = "AK-12EAPER", + ["fas2_ak47"] = "AK-4TW", + ["fas2_ak74"] = "AK74FU2", + ["fas2_an94"] = "Actuated Neutralizer 94000", + ["fas2_famas"] = "F4M3-A55", + ["fas2_g36c"] = "GL-HF36", + ["fas2_g3"] = "G3T-GUD", + ["fas2_deagle"] = "Desert Hawk", + ["fas2_galil"] = "Gabig", + ["fas2_uzi"] = "Uncle Gal", + ["fas2_ks23"] = "K1LL-ST34L", + ["fas2_mac11"] = "Big Mac", + ["fas2_m14"] = "M8-YUDODIZ", + ["fas2_m1911"] = "M9-K11L", + ["fas2_m21"] = "M21GHT", + ["fas2_m24"] = "M2ATH", + ["fas2_m3s90"] = "M30 Ultra 9000", + ["fas2_m4a1"] = "M4A115", + ["fas2_m82"] = "M8-U2", + ["fas2_mp5a5"] = "M115 A55", + ["fas2_mp5k"] = "M115 Kollider", + ["fas2_mp5sd6"] = "M115 S4D", + ["fas2_ots33"] = "Ostrich-33", + ["fas2_p226"] = "P-4U2", + ["fas2_pp19"] = "PP20 Buffalo", + ["fas2_ragingbull"] = "Furious Bull", + ["fas2_rem870"] = "REM-3MB3R M3", + ["fas2_rpk"] = "RPK-4TW", + ["fas2_rk95"] = "Sa-KO 9500", + ["fas2_sg550"] = "SG 11500", + ["fas2_sg552"] = "SG 11502", + ["fas2_sks"] = "Seeking Kill Steals", + ["fas2_sr25"] = "SR3KT", + + -- CW 2 weapons + ["cw_ak74"] = "AK-4TW", + ["cw_ar15"] = "All-Right15", + ["cw_auggsm"] = "AUG-SOM3", + ["cw_g3a3"] = "G3T-B3TTER", + ["cw_mp5"] = "MP115", + ["cw_deagle"] = "Desert Hawk", + ["cw_l115"] = "L-Emnt 115", + ["cw_lr300"] = "Liberator 115x2", + ["cw_mr96"] = "Mr.Rekker 96", + ["UMP45"] = "Unified Material Penetrator 4D5", + ["cw_c7a1"] = "C7-KILL7", + ["cw_kimber_kw"] = "Kimber Knight Warlord", + ["cw_mk11"] = "Mr.Kill 115", + ["cw_ppsh-41"] = "The Reaper", + ["cw_xm1014"] = "XTREME1015", + ["cw_dz_ru556"] = "Codename Rul3R-5000", + + +} + +function AddPackAPunchName(class, papname) -- The function also works with display names just like above + nz.Display_PaPNames[class] = papname +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/display/cl_player.lua b/gamemodes/nzombies3/gamemode/display/cl_player.lua new file mode 100644 index 00000000..fa7a91dc --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_player.lua @@ -0,0 +1,54 @@ +local playerColors = { + Color(239,154,154), + Color(244,143,177), + Color(159,168,218), + Color(129,212,250), + Color(128,203,196), + Color(165,214,167), + Color(230,238,156), + Color(255,241,118), + Color(255,224,130), + Color(255,171,145), + Color(161,136,127), + Color(224,224,224), + Color(144,164,174), + nil +} + +local blooddecals = { + Material("bloodline_score1.png", "unlitgeneric smooth"), + Material("bloodline_score2.png", "unlitgeneric smooth"), + Material("bloodline_score3.png", "unlitgeneric smooth"), + Material("bloodline_score4.png", "unlitgeneric smooth"), + nil +} + +--shuffle the colors on map start +local rand = math.random +local n = #playerColors + +while n > 2 do + + local k = rand(n) -- 1 <= k <= n + + playerColors[n], playerColors[k] = playerColors[k], playerColors[n] + n = n - 1 +end + +n = #blooddecals + +while n > 2 do + + local k = rand(n) -- 1 <= k <= n + + blooddecals[n], blooddecals[k] = blooddecals[k], blooddecals[n] + n = n - 1 +end + +function player.GetColorByIndex(index) + return playerColors[((index - 1) % #playerColors) + 1] +end + +function player.GetBloodByIndex(index) + return blooddecals[((index - 1) % #blooddecals) + 1] +end diff --git a/gamemodes/nzombies3/gamemode/display/cl_scoreboard.lua b/gamemodes/nzombies3/gamemode/display/cl_scoreboard.lua new file mode 100644 index 00000000..fafab66d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_scoreboard.lua @@ -0,0 +1,382 @@ + +surface.CreateFont( "ScoreboardDefault", { + font = "Helvetica", + size = 22, + weight = 800 +} ) + +surface.CreateFont( "ScoreboardDefaultTitle", { + font = "Helvetica", + size = 32, + weight = 800 +} ) + +local bloodline_scoreboard = Material("bloodline_scoreboard.png", "unlitgeneric smooth") + +-- +-- This defines a new panel type for the player row. The player row is given a player +-- and then from that point on it pretty much looks after itself. It updates player info +-- in the think function, and removes itself when the player leaves the server. +-- +local PLAYER_LINE = { + Init = function( self ) + + self.AvatarButton = self:Add( "DButton" ) + self.AvatarButton:Dock( LEFT ) + self.AvatarButton:SetSize( 32, 32 ) + self.AvatarButton.DoClick = function() self.Player:ShowProfile() end + + self.Avatar = vgui.Create( "AvatarImage", self.AvatarButton ) + self.Avatar:SetSize( 32, 32 ) + self.Avatar:SetMouseInputEnabled( false ) + + self.Name = self:Add( "DLabel" ) + self.Name:Dock( FILL ) + self.Name:SetFont( "ScoreboardDefault" ) + self.Name:SetTextColor( self.TextColor or Color(255, 255, 255) ) + + self.Mute = self:Add( "DImageButton" ) + self.Mute:SetSize( 32, 32 ) + self.Mute:Dock( RIGHT ) + + self.Ping = self:Add( "DLabel" ) + self.Ping:Dock( RIGHT ) + self.Ping:SetWidth( 50 ) + self.Ping:SetFont( "ScoreboardDefault" ) + self.Ping:SetTextColor( Color( 255, 255, 255 ) ) + self.Ping:SetContentAlignment( 5 ) + + self.Revives = self:Add( "DLabel" ) + self.Revives:Dock( RIGHT ) + self.Revives:SetWidth( 100 ) + self.Revives:SetFont( "ScoreboardDefault" ) + self.Revives:SetTextColor( self.TextColor or Color(255, 255, 255) ) + self.Revives:SetContentAlignment( 5 ) + + self.Downs = self:Add( "DLabel" ) + self.Downs:Dock( RIGHT ) + self.Downs:SetWidth( 100 ) + self.Downs:SetFont( "ScoreboardDefault" ) + self.Downs:SetTextColor( self.TextColor or Color(255, 255, 255) ) + self.Downs:SetContentAlignment( 5 ) + + self.Kills = self:Add( "DLabel" ) + self.Kills:Dock( RIGHT ) + self.Kills:SetWidth( 100 ) + self.Kills:SetFont( "ScoreboardDefault" ) + self.Kills:SetTextColor( self.TextColor or Color(255, 255, 255) ) + self.Kills:SetContentAlignment( 5 ) + + self.Points = self:Add( "DLabel" ) + self.Points:Dock( RIGHT ) + self.Points:SetWidth( 100 ) + self.Points:SetFont( "ScoreboardDefault" ) + self.Points:SetTextColor( self.TextColor or Color(255, 255, 255) ) + self.Points:SetContentAlignment( 5 ) + + self.Items = self:Add( "DPanel" ) + self.Items:Dock( RIGHT ) + self.Items:SetWidth( 175 ) + self.Items.Paint = function(pnl) + surface.SetDrawColor(255, 255, 255) + local num = 0 + for k,v in pairs(self.Player:GetCarryItems()) do + local item = nzItemCarry.Items[v] + if item and item.icon and item.icon != "" then + local x, y = pnl:GetPos() + surface.SetMaterial(item.icon) + surface.DrawTexturedRect(x - num*26, y + 6, 24, 24) + num = num + 1 + end + end + end + + self:Dock( TOP ) + self:SetSize( 32, 32) + self:DockMargin(5,0,5,0) + + end, + + Setup = function( self, pl ) + + self.Player = pl + + self.Avatar:SetPlayer( pl ) + + self:Think( self ) + + --local friend = self.Player:GetFriendStatus() + --MsgN( pl, " Friend: ", friend ) + + end, + + Think = function( self ) + + if ( !IsValid( self.Player ) ) then + self:SetZPos( 9999 ) -- Causes a rebuild + self:Remove() + return + end + + if ( self.TextColor == nil || self.TextColor != player.GetColorByIndex( self.Player:EntIndex() ) ) then + self.TextColor = player.GetColorByIndex( self.Player:EntIndex() ) + self.Name:SetTextColor( self.TextColor ) + self.Points:SetTextColor( self.TextColor ) + self.Revives:SetTextColor( self.TextColor ) + self.Ping:SetTextColor( self.TextColor ) + self.Downs:SetTextColor( self.TextColor ) + self.Kills:SetTextColor( self.TextColor ) + end + + if ( self.ZombieKills == nil || self.ZombieKills != self.Player:GetTotalKills() ) then + self.ZombieKills = self.Player:GetTotalKills() + self.Kills:SetText( self.ZombieKills ) + end + + if ( self.NumDowns == nil || self.Downs != self.Player:GetTotalDowns() ) then + self.NumDowns = self.Player:GetTotalDowns() + self.Downs:SetText( self.NumDowns ) + end + + if ( self.NumRevives == nil || self.NumRevives != self.Player:GetTotalRevives() ) then + self.NumRevives = self.Player:GetTotalRevives() + self.Revives:SetText( self.NumRevives ) + end + + if ( self.PName == nil || self.PName != self.Player:Nick() ) then + self.PName = self.Player:Nick() + self.Name:SetText( self.PName ) + end + + if ( self.NumPoints == nil || self.NumPoints != self.Player:GetPoints() ) then + self.NumPoints = self.Player:GetPoints() + self.Points:SetText( self.NumPoints ) + end + + if ( self.NumPing == nil || self.NumPing != self.Player:Ping() ) then + self.NumPing = self.Player:Ping() + self.Ping:SetText( self.NumPing ) + end + + -- + -- Change the icon of the mute button based on state + -- + if ( self.Muted == nil || self.Muted != self.Player:IsMuted() ) then + + self.Muted = self.Player:IsMuted() + if ( self.Muted ) then + self.Mute:SetImage( "icon32/muted.png" ) + else + self.Mute:SetImage( "icon32/unmuted.png" ) + end + + self.Mute.DoClick = function() self.Player:SetMuted( !self.Muted ) end + + end + + -- + -- Connecting players go at the very bottom + -- + if ( self.Player:Team() == TEAM_CONNECTING ) then + self:SetZPos( 2000 + self.Player:EntIndex() ) + return + end + + -- + -- This is what sorts the list. The panels are docked in the z order, + -- so if we set the z order according to kills they'll be ordered that way! + -- Careful though, it's a signed short internally, so needs to range between -32,768k and +32,767 + -- + self:SetZPos( ( self.NumPoints * -50 ) + self.NumPoints + self.Player:EntIndex() ) + + end, + + Paint = function( self, w, h ) + + if ( !IsValid( self.Player ) ) then + return + end + + -- + -- We draw our background a different colour based on the status of the player + -- + + --if ( !self.Player:Alive() ) then + --draw.RoundedBox( 4, 0, 0, w, h, Color( pColor[1] * 150, pColor[2] * 150, pColor[3] * 150, 255 ) ) + --return + --end + + --draw.RoundedBox( 4, 0, 0, w, h, Color( pColor[1] * 100 + 155, pColor[2] * 100 + 155, pColor[3] * 100 + 155, 255 ) ) + + surface.SetMaterial(player.GetBloodByIndex(self.Player:EntIndex())) + surface.SetDrawColor(200,200,200) + surface.DrawTexturedRect(0, 0, w, h) + + end +} + +-- +-- Convert it from a normal table into a Panel Table based on DPanel +-- +PLAYER_LINE = vgui.RegisterTable( PLAYER_LINE, "DPanel" ) + +-- +-- Here we define a new panel table for the scoreboard. It basically consists +-- of a header and a scrollpanel - into which the player lines are placed. +-- + +local SCORE_BOARD = { + Init = function( self ) + + self.Header = self:Add( "Panel" ) + self.Header:Dock( TOP ) + self.Header:SetHeight( 100 ) + + self.Name = self.Header:Add( "DLabel" ) + self.Name:SetFont( "nz.display.hud.main" ) + self.Name:SetTextColor( Color( 255, 255, 255, 255 ) ) + self.Name:Dock( TOP ) + self.Name:SetHeight( 40 ) + self.Name:SetContentAlignment( 5 ) + + self.Key = self:Add( "DPanel" ) + self.Key:Dock( TOP ) + self.Key:SetContentAlignment( 6 ) + self.Key:SetHeight( 20 ) + self.Key.Paint = function() end + + self.Mute = self.Key:Add( "DLabel" ) + self.Mute:Dock( RIGHT ) + self.Mute:SetWidth( 32 ) + self.Mute:SetFont( "ScoreboardDefault" ) + self.Mute:SetTextColor( Color( 255, 255, 255 ) ) + self.Mute:SetContentAlignment( 5 ) + self.Mute:SetText("") + + self.Ping = self.Key:Add( "DLabel" ) + self.Ping:Dock( RIGHT ) + self.Ping:SetWidth( 50 ) + self.Ping:SetFont( "ScoreboardDefault" ) + self.Ping:SetTextColor( Color( 255, 255, 255 ) ) + self.Ping:SetContentAlignment( 5 ) + self.Ping:SetText("Ping") + + self.Revives = self.Key:Add( "DLabel" ) + self.Revives:Dock( RIGHT ) + self.Revives:SetWidth( 100 ) + self.Revives:SetFont( "ScoreboardDefault" ) + self.Revives:SetTextColor( Color(255, 255, 255) ) + self.Revives:SetContentAlignment( 5 ) + self.Revives:SetText("Revives") + + self.Downs = self.Key:Add( "DLabel" ) + self.Downs:Dock( RIGHT ) + self.Downs:SetWidth( 100 ) + self.Downs:SetFont( "ScoreboardDefault" ) + self.Downs:SetTextColor( Color(255, 255, 255) ) + self.Downs:SetContentAlignment( 5 ) + self.Downs:SetText("Downs") + + self.Kills = self.Key:Add( "DLabel" ) + self.Kills:Dock( RIGHT ) + self.Kills:SetWidth( 100 ) + self.Kills:SetFont( "ScoreboardDefault" ) + self.Kills:SetTextColor( Color( 255, 255, 255, 255 ) ) + self.Kills:SetContentAlignment( 5 ) + self.Kills:SetText("Kills") + + self.Points = self.Key:Add( "DLabel" ) + self.Points:Dock( RIGHT ) + self.Points:SetWidth( 100 ) + self.Points:SetFont( "ScoreboardDefault" ) + self.Points:SetTextColor( Color( 255, 255, 255, 255 ) ) + self.Points:SetContentAlignment( 5 ) + self.Points:SetText("Points") + + + + --self.NumPlayers = self.Header:Add( "DLabel" ) + --self.NumPlayers:SetFont( "ScoreboardDefault" ) + --self.NumPlayers:SetTextColor( Color( 255, 255, 255, 255 ) ) + --self.NumPlayers:SetPos( 0, 100 - 30 ) + --self.NumPlayers:SetSize( 300, 30 ) + --self.NumPlayers:SetContentAlignment( 4 ) + + self.Scores = self:Add( "DScrollPanel" ) + self.Scores:Dock( FILL ) + + end, + + PerformLayout = function( self ) + + self:SetSize( 800, ScrH() - 200 ) + self:SetPos( ScrW() / 2 - 400, 100 ) + + end, + + Paint = function( self, w, h ) + + --DrawBlurRect( 0, 0, w, h ) + + end, + + Think = function( self, w, h ) + + self.Name:SetText( GetHostName() ) + + -- + -- Loop through each player, and if one doesn't have a score entry - create it. + -- + local plyrs = player.GetAll() + for id, pl in pairs( plyrs ) do + + if ( IsValid( pl.ScoreEntry ) ) then continue end + + pl.ScoreEntry = vgui.CreateFromTable( PLAYER_LINE, pl.ScoreEntry ) + pl.ScoreEntry:Setup( pl ) + + self.Scores:AddItem( pl.ScoreEntry ) + + end + + end +} + +SCORE_BOARD = vgui.RegisterTable( SCORE_BOARD, "EditablePanel" ) + +--[[--------------------------------------------------------- + Name: gamemode:ScoreboardShow( ) + Desc: Sets the scoreboard to visible +-----------------------------------------------------------]] +function GM:ScoreboardShow() + + if ( !IsValid( g_Scoreboard ) ) then + g_Scoreboard = vgui.CreateFromTable( SCORE_BOARD ) + end + + if ( IsValid( g_Scoreboard ) ) then + g_Scoreboard:Show() + g_Scoreboard:MakePopup() + g_Scoreboard:SetKeyboardInputEnabled( false ) + end + +end + +--[[--------------------------------------------------------- + Name: gamemode:ScoreboardHide( ) + Desc: Hides the scoreboard +-----------------------------------------------------------]] +function GM:ScoreboardHide() + + if ( IsValid( g_Scoreboard ) ) then + g_Scoreboard:Hide() + end + +end + +--[[--------------------------------------------------------- + Name: gamemode:HUDDrawScoreBoard( ) + Desc: If you prefer to draw your scoreboard the stupid way (without vgui) +-----------------------------------------------------------]] +function GM:HUDDrawScoreBoard() +end diff --git a/gamemodes/nzombies3/gamemode/display/cl_target.lua b/gamemodes/nzombies3/gamemode/display/cl_target.lua new file mode 100644 index 00000000..1821c4f3 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/cl_target.lua @@ -0,0 +1,257 @@ +// + +local traceents = { + ["wall_buys"] = function(ent) + local wepclass = ent:GetWepClass() + local price = ent:GetPrice() + local wep = weapons.Get(wepclass) + if !wep then return "INVALID WEAPON" end + local name = wep.PrintName + local ammo_price = math.Round((price - (price % 10))/2) + local text = "" + + if !LocalPlayer():HasWeapon( wepclass ) then + text = "Press E to buy " .. name .." for " .. price .. " points." + elseif string.lower(wep.Primary.Ammo) != "none" then + if LocalPlayer():GetWeapon( wepclass ).pap then + text = "Press E to buy " .. wep.Primary.Ammo .." Ammo refill for " .. 4500 .. " points." + else + text = "Press E to buy " .. wep.Primary.Ammo .." Ammo refill for " .. ammo_price .. " points." + end + else + text = "You already have this weapon." + end + + return text + end, + ["breakable_entry"] = function(ent) + if ent:GetHasPlanks() and ent:GetNumPlanks() < GetConVar("nz_difficulty_barricade_planks_max"):GetInt() then + local text = "Hold E to rebuild the barricade." + return text + end + end, + ["random_box"] = function(ent) + if !ent:GetOpen() then + local text = nzPowerUps:IsPowerupActive("firesale") and "Press E to buy a random weapon for 10 points." or "Press E to buy a random weapon for 950 points." + return text + end + end, + ["random_box_windup"] = function(ent) + if !ent:GetWinding() and ent:GetWepClass() != "nz_box_teddy" 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 + name = "Press E to take " .. name .. " from the box." + + return name + end + end, + ["perk_machine"] = function(ent) + local text = "" + if !ent:IsOn() then + text = "No Power." + elseif ent:GetBeingUsed() then + text = "Currently in use." + else + if ent:GetPerkID() == "pap" then + local wep = LocalPlayer():GetActiveWeapon() + if wep.pap then + if wep.Attachments and ((wep:IsCW2() and CustomizableWeaponry) or wep:IsFAS2()) then + text = "Press E to reroll attachments for 2000 points." + else + text = "This weapon is already upgraded." + end + else + text = "Press E to buy Pack-a-Punch for 5000 points." + end + else + local perkData = nz.Perks.Functions.Get(ent:GetPerkID()) + -- Its on + text = "Press E to buy " .. perkData.name .. " for " .. ent:GetPrice() .. " points." + -- Check if they already own it + if LocalPlayer():HasPerk(ent:GetPerkID()) then + text = "You already own this perk." + end + end + end + + return text + end, + ["player_spawns"] = function() if nzRound:InState( ROUND_CREATE ) then return "Player Spawn" end end, + ["nz_spawn_zombie_normal"] = function() if nzRound:InState( ROUND_CREATE ) then return "Zombie Spawn" end end, + ["nz_spawn_zombie_special"] = function() if nzRound:InState( ROUND_CREATE ) then return "Zombie Special Spawn" end end, + ["pap_weapon_trigger"] = function(ent) + local wepclass = ent:GetWepClass() + local wep = weapons.Get(wepclass) + local name = "UNKNOWN" + if wep != nil then + name = nz.Display_PaPNames[wepclass] or nz.Display_PaPNames[name] or "Upgraded "..wep.PrintName + end + name = "Press E to take " .. name .. " from the machine." + + return name + end, + ["wunderfizz_machine"] = function(ent) + local text = "" + if !ent:IsOn() then + text = "The Wunderfizz Orb is currently at another location." + elseif ent:GetBeingUsed() then + if ent:GetUser() == LocalPlayer() and ent:GetPerkID() != "" and !ent:GetIsTeddy() then + text = "Press E to take "..nz.Perks.Functions.Get(ent:GetPerkID()).name.." from Der Wunderfizz." + else + text = "Currently in use." + end + else + if #LocalPlayer():GetPerks() >= GetConVar("nz_difficulty_perks_max"):GetInt() then + text = "You cannot have more perks." + else + text = "Press E to buy Der Wunderfizz for " .. ent:GetPrice() .. " points." + end + end + + return text + end, +} + +local function GetTarget() + local tr = { + start = EyePos(), + endpos = EyePos() + LocalPlayer():GetAimVector()*150, + filter = LocalPlayer(), + } + local trace = util.TraceLine( tr ) + if (!trace.Hit) then return end + if (!trace.HitNonWorld) then return end + + --print(trace.Entity:GetClass()) + return trace.Entity +end + +local function GetDoorText( ent ) + local door_data = ent:GetDoorData() + local text = "" + + if door_data and tonumber(door_data.price) == 0 and nzRound:InState(ROUND_CREATE) then + if tobool(door_data.elec) then + text = "This door will open when electricity is turned on." + else + text = "This door will open on game start." + end + elseif door_data and tonumber(door_data.buyable) == 1 then + local price = tonumber(door_data.price) + local req_elec = tobool(door_data.elec) + local link = door_data.link + + if ent:IsLocked() then + if req_elec and !IsElec() then + text = "You must turn on the electricity first!" + elseif door_data.text then + text = door_data.text + elseif price != 0 then + --print("Still here", nz.nzDoors.Data.OpenedLinks[tonumber(link)]) + text = "Press E to open for " .. price .. " points." + end + end + elseif door_data and tonumber(door_data.buyable) != 1 and nzRound:InState( ROUND_CREATE ) then + text = "This door is locked and cannot be bought in-game." + --PrintTable(door_data) + end + + return text +end + +local function GetText( ent ) + + if !IsValid(ent) then return "" end + + local class = ent:GetClass() + local text = "" + + local neededcategory, deftext, hastext = ent:GetNWString("NZRequiredItem"), ent:GetNWString("NZText"), ent:GetNWString("NZHasText") + local itemcategory = ent:GetNWString("NZItemCategory") + + if neededcategory != "" then + local hasitem = LocalPlayer():HasCarryItem(neededcategory) + text = hasitem and hastext != "" and hastext or deftext + elseif deftext != "" then + text = deftext + elseif itemcategory != "" then + local item = nzItemCarry.Items[itemcategory] + local hasitem = LocalPlayer():HasCarryItem(itemcategory) + if hasitem then + text = item and item.hastext or "You already have this." + else + text = item and item.text or "Press E to pick up." + end + elseif ent:IsPlayer() then + if ent:GetNotDowned() then + text = ent:Nick() .. " - " .. ent:Health() .. " HP" + else + text = "Hold E to revive "..ent:Nick() + end + elseif ent:IsDoor() or ent:IsButton() or ent:GetClass() == "class C_BaseEntity" or ent:IsBuyableProp() then + text = GetDoorText(ent) + else + text = traceents[class] and traceents[class](ent) + end + + return text +end + +local function GetMapScriptEntityText() + local text = "" + + for k,v in pairs(ents.FindByClass("nz_script_triggerzone")) do + local dist = v:NearestPoint(EyePos()):Distance(EyePos()) + if dist <= 1 then + text = GetDoorText(v) + break + end + end + + return text +end + +local function DrawTargetID( text ) + + if !text then return end + + 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 = GetTarget() + + if ent != nil then + DrawTargetID(GetText(ent)) + else + DrawTargetID(GetMapScriptEntityText()) + end + +end diff --git a/gamemodes/nzombies3/gamemode/display/sh_properties.lua b/gamemodes/nzombies3/gamemode/display/sh_properties.lua new file mode 100644 index 00000000..eb76ef50 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/display/sh_properties.lua @@ -0,0 +1,271 @@ +properties.Add( "nz_remove", { + MenuLabel = "Remove", + Order = 1000, + MenuIcon = "icon16/delete.png", + + Filter = function( self, ent, ply ) -- A function that determines whether an entity is valid for this property + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + + return true + end, + Action = function( self, ent ) + + self:MsgStart() + net.WriteEntity( ent ) + self:MsgEnd() + + end, + + Receive = function( self, length, player ) + local ent = net.ReadEntity() + + if ( !IsValid( ent ) ) then return false end + if ( !IsValid( player ) ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( !player:IsAdmin() ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !self:Filter( ent, player ) ) then return false end + + -- Remove all constraints (this stops ropes from hanging around) + constraint.RemoveAll( ent ) + + -- Remove it properly in 1 second + timer.Simple( 1, function() if ( IsValid( ent ) ) then ent:Remove() print("Removed", ent) end end ) + + -- Make it non solid + ent:SetNotSolid( true ) + ent:SetMoveType( MOVETYPE_NONE ) + ent:SetNoDraw( true ) + + -- Send Effect + local ed = EffectData() + ed:SetEntity( ent ) + util.Effect( "entity_remove", ed, true, true ) + end +} ); + +properties.Add( "nz_editentity", { + MenuLabel = "Edit Properties..", + Order = 90010, + PrependSpacer = true, + MenuIcon = "icon16/pencil.png", + + Filter = function( self, ent, ply ) + + if ( !IsValid( ent ) ) then return false end + if ( !ent.Editable ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + + return true + + end, + + Action = function( self, ent ) + + local window = g_ContextMenu:Add( "DFrame" ) + window:SetSize( 320, 400 ) + window:SetTitle( tostring( ent ) ) + window:Center() + window:SetSizable( true ) + + local control = window:Add( "DEntityProperties" ) + control:SetEntity( ent ) + control:Dock( FILL ) + + control.OnEntityLost = function() + + window:Remove() + + end + end +} ); + +properties.Add( "nz_lock", { + MenuLabel = "Edit Lock..", + Order = 9001, + PrependSpacer = true, + MenuIcon = "icon16/lock_edit.png", + + Filter = function( self, ent, ply ) + + if ( !IsValid( ent ) ) then return false end + if !( ent:IsDoor() or ent:IsButton() or ent:IsBuyableProp() ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + + return true + + end, + + Action = function( self, ent ) + nz.Interfaces.Functions.DoorProps( {door = ent} ) + end +} ); + +properties.Add( "nz_unlock", { + MenuLabel = "Unlock", + Order = 9002, + PrependSpacer = false, + MenuIcon = "icon16/lock_delete.png", + + Filter = function( self, ent, ply ) + + if ( !IsValid( ent ) ) then return false end + if !( ent:IsDoor() or ent:IsButton() or ent:IsBuyableProp() ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + if ent:IsBuyableProp() then + if ( !nzDoors.PropDoors[ent:EntIndex()] ) then return false end + else + if ( !nzDoors.MapDoors[ent:DoorIndex()] ) then return false end + end + + return true + + end, + + Action = function( self, ent ) + + self:MsgStart() + net.WriteEntity( ent ) + self:MsgEnd() + + end, + + Receive = function( self, length, player ) + local ent = net.ReadEntity() + + if ( !IsValid( ent ) ) then return false end + if ( !IsValid( player ) ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( !player:IsAdmin() ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !self:Filter( ent, player ) ) then return false end + + nzDoors:RemoveLink( ent ) + + end +} ); + +properties.Add( "nz_editzspawn", { + MenuLabel = "Edit Spawnpoint..", + Order = 9003, + PrependSpacer = true, + MenuIcon = "icon16/link_edit.png", + + Filter = function( self, ent, ply ) + + if ( !IsValid( ent ) ) then return false end + if ( ent:GetClass() != "nz_spawn_zombie_normal" ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + + return true + + end, + + Action = function( self, ent ) + self:MsgStart() + net.WriteEntity( ent ) + self:MsgEnd() + end, + + Receive = function( self, length, player ) + local ent = net.ReadEntity() + + if ( !IsValid( ent ) ) then return false end + if ( !IsValid( player ) ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( !player:IsAdmin() ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !self:Filter( ent, player ) ) then return false end + + nz.Interfaces.Functions.SendInterface(player, "ZombLink", {ent = ent, link = ent.link, spawnable = ent.spawnable, respawnable = ent.respawnable}) + + end +} ); + +properties.Add( "nz_wepbuy", { + MenuLabel = "Edit Properties..", + Order = 9004, + PrependSpacer = true, + MenuIcon = "icon16/cart_edit.png", + + Filter = function( self, ent, ply ) + + if ( !IsValid( ent ) ) then return false end + if ( ent:GetClass() != "wall_buys" ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + + return true + + end, + + Action = function( self, ent ) + self:MsgStart() + net.WriteEntity( ent ) + self:MsgEnd() + end, + + Receive = function( self, length, player ) + local ent = net.ReadEntity() + + if ( !IsValid( ent ) ) then return false end + if ( !IsValid( player ) ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( !player:IsAdmin() ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !self:Filter( ent, player ) ) then return false end + + nz.Interfaces.Functions.SendInterface(player, "WepBuy", {vec = ent:GetPos(), ang = ent:GetAngles(), ent = ent}) + + end +} ); + +properties.Add( "nz_editperk", { + MenuLabel = "Edit Perk..", + Order = 9005, + PrependSpacer = true, + MenuIcon = "icon16/tag_blue_edit.png", + + Filter = function( self, ent, ply ) + + if ( !IsValid( ent ) ) then return false end + if ( ent:GetClass() != "perk_machine" ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !ply:IsAdmin() ) then return false end + + return true + + end, + + Action = function( self, ent ) + self:MsgStart() + net.WriteEntity( ent ) + self:MsgEnd() + end, + + Receive = function( self, length, player ) + local ent = net.ReadEntity() + + if ( !IsValid( ent ) ) then return false end + if ( !IsValid( player ) ) then return false end + if !nzRound:InState( ROUND_CREATE ) then return false end + if ( !player:IsAdmin() ) then return false end + if ( ent:IsPlayer() ) then return false end + if ( !self:Filter( ent, player ) ) then return false end + + nz.Interfaces.Functions.SendInterface(player, "PerkMachine", {ent = ent}) + + end +} ); diff --git a/gamemodes/nzombies3/gamemode/doors/sh_constructor.lua b/gamemodes/nzombies3/gamemode/doors/sh_constructor.lua new file mode 100644 index 00000000..0956417f --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sh_constructor.lua @@ -0,0 +1,2 @@ +-- Setup Doors module +nzDoors = nzDoors or {} diff --git a/gamemodes/nzombies3/gamemode/doors/sh_door_meta_accessors.lua b/gamemodes/nzombies3/gamemode/doors/sh_door_meta_accessors.lua new file mode 100644 index 00000000..aa963db8 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sh_door_meta_accessors.lua @@ -0,0 +1,137 @@ +local meta = FindMetaTable("Entity") + +nzDoors.MapDoors = nzDoors.MapDoors or {} +nzDoors.PropDoors = nzDoors.PropDoors or {} +nzDoors.OpenedLinks = nzDoors.OpenedLinks or {} + +function meta:IsLocked() + if self:IsBuyableProp() or self:IsScriptBuyable() then + return nzDoors.PropDoors[self:EntIndex()] and nzDoors.PropDoors[self:EntIndex()].locked or false + else + return nzDoors.MapDoors[self:DoorIndex()] and nzDoors.MapDoors[self:DoorIndex()].locked or false + end +end + +function meta:SetLocked( bool ) + if self:IsBuyableProp() or self:IsScriptBuyable() then + if !nzDoors.PropDoors[self:EntIndex()] then nzDoors.PropDoors[self:EntIndex()] = {} end + nzDoors.PropDoors[self:EntIndex()].locked = bool + else + if !nzDoors.MapDoors[self:DoorIndex()] then nzDoors.MapDoors[self:DoorIndex()] = {} end + nzDoors.MapDoors[self:DoorIndex()].locked = bool + end +end + +local validdoors = { + ["func_door"] = true, + ["func_door_rotating"] = true, + ["prop_door_rotating"] = true, + ["prop_dynamic"] = true, +} + +local scriptbuyables = { + ["nz_script_triggerzone"] = true, + ["nz_triggerbutton"] = true, +} + +function meta:IsDoor() + if not IsValid(self) then return false end + local class = self:GetClass() + + return validdoors[class] or false +end + +function meta:IsScriptBuyable() + if not IsValid(self) then return false end + local class = self:GetClass() + + return scriptbuyables[class] or false +end + +function meta:IsBuyableEntity() + return self:IsDoor() or self:IsBuyableProp() or self:IsButton() or self:IsScriptBuyable() or false +end + +function meta:IsButton() + if not IsValid(self) then return false end + local class = self:GetClass() + + if class == "func_button" or (CLIENT and class == "class C_BaseEntity") then + return true + end + return false +end + +function meta:IsBuyableProp() + if not IsValid(self) then return false end + return self:GetClass() == "prop_buys" +end + +function meta:IsPropDoorType() + return self:IsScriptBuyable() or self:IsBuyableProp() +end + +function meta:IsBuyableMapEntity() + return self:IsDoor() or self:IsButton() or self:IsBuyableProp() or self:IsScriptBuyable() or false +end + +function meta:DoorIndex() + if SERVER then + return self:CreatedByMap() and self:MapCreationID() or nil + else + -- Check the ED table + return nzDoors.MapCreationIndexTable[self:EntIndex()] or 0 + end +end + +function meta:GetDoorData() + if self:IsBuyableProp() or self:IsScriptBuyable() then + if !nzDoors.PropDoors[self:EntIndex()] then return nil end + return nzDoors.PropDoors[self:EntIndex()].flags + else + if !nzDoors.MapDoors[self:DoorIndex()] then return nil end + return nzDoors.MapDoors[self:DoorIndex()].flags + end +end + +function meta:SetDoorData( tbl ) + if self:IsBuyableProp() or self:IsScriptBuyable() then + if !nzDoors.PropDoors[self:EntIndex()] then nzDoors.PropDoors[self:EntIndex()] = {} end + nzDoors.PropDoors[self:EntIndex()].flags = tbl + else + if !nzDoors.MapDoors[self:DoorIndex()] then nzDoors.MapDoors[self:DoorIndex()] = {} end + nzDoors.MapDoors[self:DoorIndex()].flags = tbl + end +end + +function nzDoors:DoorIndexByID( id ) + if SERVER then + local ent = Entity(id) + return ent:CreatedByMap() and ent:MapCreationID() or nil + else + -- Check the ED table + return nzDoors.MapCreationIndexTable[id] or 0 + end +end + +function nzDoors:SetDoorDataByID( id, prop, tbl ) + if !tbl then return end + if prop then + if !self.PropDoors[id] then self.PropDoors[id] = {} end + self.PropDoors[id].flags = tbl + else + if !self.MapDoors[id] then self.MapDoors[id] = {} end + self.MapDoors[id].flags = tbl + end +end + +function nzDoors:SetLockedByID( id, prop, bool ) + if prop then + if !nzDoors.PropDoors[id] then nzDoors.PropDoors[id] = {} end + self.PropDoors[id].locked = bool + else + local index = nzDoors:DoorIndexByID( id ) + if !nzDoors.MapDoors[index] then nzDoors.MapDoors[index] = {} end + self.MapDoors[index].locked = bool + end +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/doors/sh_sync.lua b/gamemodes/nzombies3/gamemode/doors/sh_sync.lua new file mode 100644 index 00000000..ef56721d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sh_sync.lua @@ -0,0 +1,162 @@ +if SERVER then + util.AddNetworkString( "nzMapDoorCreation" ) + util.AddNetworkString( "nzPropDoorCreation" ) + util.AddNetworkString( "nzAllDoorsLocked" ) + util.AddNetworkString( "nzDoorOpened" ) + util.AddNetworkString( "nzClearDoorData" ) + + function nzDoors:SendMapDoorCreation( door, flags, id, ply ) + if IsValid(door) then + net.Start("nzMapDoorCreation") + net.WriteBool(true) + net.WriteInt(door:EntIndex(), 13) + net.WriteTable(flags or {}) + net.WriteInt(id or 0, 13) + return ply and net.Send(ply) or net.Broadcast() + end + end + + function nzDoors:SendPropDoorCreation( ent, flags, ply ) + if IsValid(ent) then + net.Start("nzPropDoorCreation") + net.WriteBool(true) + net.WriteInt(ent:EntIndex(), 13) + net.WriteTable(flags or {}) + return ply and net.Send(ply) or net.Broadcast() + end + end + + function nzDoors:SendMapDoorRemoval( door, ply ) + if IsValid(door) then + net.Start("nzMapDoorCreation") + net.WriteBool(false) + net.WriteInt(door:EntIndex(), 13) + return ply and net.Send(ply) or net.Broadcast() + end + end + + function nzDoors:SendPropDoorRemoval( ent, ply ) + if IsValid(ent) then + net.Start("nzPropDoorCreation") + net.WriteBool(false) + net.WriteInt(ent:EntIndex(), 13) + return ply and net.Send(ply) or net.Broadcast() + end + end + + function nzDoors:SendAllDoorsLocked( ply ) + net.Start("nzAllDoorsLocked") + return ply and net.Send(ply) or net.Broadcast() + end + + function nzDoors:SendDoorOpened( door, rebuyable, ply ) + net.Start("nzDoorOpened") + print(door:EntIndex(), door) + net.WriteBool(IsValid(door) and door:IsPropDoorType()) + net.WriteInt(door:EntIndex(), 13) + net.WriteBool(rebuyable and tobool(rebuyable) or false) + return ply and net.Send(ply) or net.Broadcast() + end + + function nzDoors.SendSync( ply ) + -- Clear all data first + if ply then + net.Start("nzClearDoorData") + net.Send(ply) + else + net.Start("nzClearDoorData") + net.Broadcast() + end + + -- Remove old doors + for k,v in pairs(nzDoors.MapDoors) do + nzDoors:SendMapDoorCreation( nzDoors:DoorIndexToEnt(k), v.flags, k, ply ) + if !v.locked then + nzDoors:SendDoorOpened( nzDoors:DoorIndexToEnt(k), ply ) + end + end + for k,v in pairs(nzDoors.PropDoors) do + nzDoors:SendPropDoorCreation( Entity(k), v.flags, ply ) + if !v.locked then + nzDoors:SendDoorOpened( Entity(k), ply ) + end + end + end + + FullSyncModules["Doors"] = nzDoors.SendSync + +end + +if CLIENT then + nzDoors.MapCreationIndexTable = nzDoors.MapCreationIndexTable or {} + nzDoors.DisplayLinks = nzDoors.DisplayLinks or {} + + local function ReceiveMapDoorCreation() + local bool = net.ReadBool() + local index = net.ReadInt(13) + -- True if door is created, false if removed + if bool then + local tbl = net.ReadTable() + nzDoors.MapCreationIndexTable[index] = net.ReadInt(13) + nzDoors:SetDoorDataByID( nzDoors.MapCreationIndexTable[index], false, tbl ) + nzDoors:SetLockedByID( index, false, true ) + --ent:SetDoorData(tbl) + -- We store the map creation ID in a table so we can access it universally + --ent:SetLocked(true) + else + --ent:SetDoorData(nil) + --nzDoors.MapCreationIndexTable[index] = nil + --ent:SetLocked(false) + nzDoors:SetDoorDataByID( nzDoors.MapCreationIndexTable[index], false, nil ) + nzDoors:SetLockedByID( index, false, false ) + end + end + net.Receive("nzMapDoorCreation", ReceiveMapDoorCreation) + + local function ReceivePropDoorCreation() + local bool = net.ReadBool() + local index = net.ReadInt(13) + --local ent = Entity(index) + -- True if door is created, false if removed + if bool then + local tbl = net.ReadTable() + nzDoors:SetDoorDataByID( index, true, tbl ) + nzDoors:SetLockedByID( index, true, true ) + --ent:SetDoorData(tbl) + --ent:SetLocked(true) + else + nzDoors:SetDoorDataByID( index, true, nil ) + nzDoors:SetLockedByID( index, true, false ) + --ent:SetDoorData(nil) + --ent:SetLocked(false) + end + end + net.Receive("nzPropDoorCreation", ReceivePropDoorCreation) + + local function ReceiveAllDoorsLocked() + for k,v in pairs(nzDoors.MapDoors) do + v.locked = true + end + for k,v in pairs(nzDoors.PropDoors) do + v.locked = true + end + end + net.Receive("nzAllDoorsLocked", ReceiveAllDoorsLocked) + + local function ReceiveDoorOpened() + local prop = net.ReadBool() + local index = net.ReadInt(13) + local rebuyable = net.ReadBool() + nzDoors:SetLockedByID( index, prop, rebuyable ) + --local door = Entity(index) + --door:SetLocked(false) + end + net.Receive("nzDoorOpened", ReceiveDoorOpened) + + local function ClearAllDoorData() + nzDoors.MapDoors = {} + nzDoors.PropDoors = {} + nzDoors.MapCreationIndexTable = {} + end + net.Receive("nzClearDoorData", ClearAllDoorData) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/doors/sv_door_meta_functions.lua b/gamemodes/nzombies3/gamemode/doors/sv_door_meta_functions.lua new file mode 100644 index 00000000..95cbdc0a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sv_door_meta_functions.lua @@ -0,0 +1,82 @@ +local meta = FindMetaTable("Entity") + +function meta:UnlockDoor() + if self:IsDoor() then + local data = self:GetDoorData() + if data.NextBuy and data.NextBuy > CurTime() then return end + print("Unlocking door ", self) + + self:Fire("unlock", "", 0) + self:Fire("Unlock", "", 0) + self:Fire("open", "", 0) //Seems like some doors wanted it capitalized + self:Fire("Open", "", 0) + + //Doors that can be rebought should not be locked - only use this on doors with buttons that should close again! + if tobool(data.rebuyable) then return end + + self:SetLocked(false) + + self:Fire("lock", "", 0) + self:Fire("Lock", "", 0) + self:SetKeyValue("wait",-1) + self:SetKeyValue("Wait",-1) + + //Dem sneaky doors keep closing themselves with their modern triggers - we gotta reopen! + self:Fire("addoutput", "onclose !self:open::0:-1,0,-1") + self:Fire("addoutput", "onclose !self:unlock::0:-1,0,-1") + + elseif self:IsBuyableProp() then + self:SetLocked(false) + self:BlockUnlock() + end +end + +function meta:UnlockButton(rebuyable) + if self:IsButton() then + print("Unlocked button", self) + --print(self) + --self:Fire("unlock") + self:Fire("Unlock") + --self:Fire("press") + self:Fire("Press") + --self:Fire("pressin") + self:Fire("PressIn") + --self:Fire("pressout") + self:Fire("PressOut") + + //Repurchasable buttons don't lock + if rebuyable then return end + + --self:Fire("lock") + self:Fire("Lock") + --self:SetKeyValue("wait",-1) + self:SetKeyValue("Wait",-1) + + self:SetLocked(false) + end +end + +function meta:LockButton() + if self:IsButton() then + self:SetLocked(true) + --self:Fire("lock", "", 0) + --self:Fire("Lock", "", 0) + end +end + +function meta:LockDoor() + if self:IsDoor() then + local data = self:GetDoorData() + print("Locked ", self) + self:SetLocked(true) + + if data.buyable and !tobool(data.buyable) then return end + + self:Fire("close", "", 0) + self:Fire("Close", "", 0) + self:Fire("lock", "", 0) + self:Fire("Lock", "", 0) + elseif self:IsBuyableProp() then + self:BlockLock() + end +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/doors/sv_doors.lua b/gamemodes/nzombies3/gamemode/doors/sv_doors.lua new file mode 100644 index 00000000..ce55fb7c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sv_doors.lua @@ -0,0 +1,128 @@ +function nzDoors:DoorToEntIndex(num) + local ent = ents.GetMapCreatedEntity(num) + + return IsValid(ent) and ent:EntIndex() or nil +end + +function nzDoors:DoorIndexToEnt(num) + if !num then return nil end + return ents.GetMapCreatedEntity(num) or NULL +end + +function nzDoors: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] + -- If buyable is not set on a door, we default to on + if !tbl["buyable"] and k == #ex then + tbl["buyable"] = "1" + end + end + + --PrintTable(tbl) + return tbl + +end + +function nzDoors:CreateLink( ent, flagsStr ) + -- First remove all links + --self:RemoveLink( ent ) + if ent:IsDoor() or ent:IsButton() then + self:CreateMapDoorLink( ent:DoorIndex(), flagsStr ) + elseif ent:IsBuyableProp() or ent:IsScriptBuyable() then + self:CreatePropDoorLink( ent, flagsStr ) + end +end + +function nzDoors:RemoveLink( ent, nohook ) + if ent:IsDoor() or ent:IsButton() then + self:RemoveMapDoorLink( ent:DoorIndex() ) + elseif ent:IsBuyableProp() then + self:RemovePropDoorLink( ent ) + end + if !nohook then + hook.Call("OnDoorUnlocked", self, ent) + end +end + +function nzDoors:CreateMapDoorLink( doorID, flagsStr ) + + local door = self:DoorIndexToEnt(doorID) + if !flagsStr then ErrorNoHalt("Door "..doorID.." doesn't have a flagsStr saved!") return end + local flagsTbl = self:ParseFlagString( flagsStr ) + + if IsValid(door) and (door:IsDoor() or door:IsButton()) then + -- Assign the flags to the door and the table + door:SetDoorData(flagsTbl) + door:SetLocked(true) + --self.MapDoors[doorID] = flagsTbl + + hook.Call("OnMapDoorLinkCreated", self, door, flagsTbl, doorID) + else + print("Error: " .. doorID .. " is not a door.") + end + +end + +function nzDoors:RemoveMapDoorLink( doorID ) + + local door = self:DoorIndexToEnt(doorID) + + if door:GetDoorData() then + if IsValid(door) and (door:IsDoor() or door:IsButton()) then + self.MapDoors[doorID] = nil + + hook.Call("OnMapDoorLinkRemoved", self, door, doorID) + else + print("Error: " .. doorID .. " is not a door. ") + end + end + +end + +function nzDoors:CreatePropDoorLink( ent, flagsStr ) + + local flagsTbl = self:ParseFlagString( flagsStr ) + + if IsValid(ent) and ent:IsBuyableProp() then + ent:SetDoorData(flagsTbl) + ent:SetLocked(true) + --self.PropDoors[ent:EntIndex()] = flagsTbl + + hook.Call("OnPropDoorLinkCreated", self, ent, flagsTbl) + else + --print("Error: " .. doorID .. " is not a door. ") + end + +end + +function nzDoors:RemovePropDoorLink( ent ) + + if IsValid(ent) and ent:IsBuyableProp() then + -- Total clear of the table + self.PropDoors[ent:EntIndex()] = nil + + hook.Call("OnPropDoorLinkRemoved", self, ent) + else + --print("Error: " .. doorID .. " is not a door. ") + end +end + +function nzDoors:DisplayDoorLinks( ent ) + if ent.link == nil then self.DisplayLinks[ent] = nil return end + + if self.DisplayLinks[ent] == nil then + self.DisplayLinks[ent] = ent.link + else + self.DisplayLinks[ent] = nil + end + self:SendSync() +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/doors/sv_gameplay.lua b/gamemodes/nzombies3/gamemode/doors/sv_gameplay.lua new file mode 100644 index 00000000..30d68244 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sv_gameplay.lua @@ -0,0 +1,151 @@ +function nzDoors:OpenDoor( ent, ply ) + local data = ent:GetDoorData() + local link = data.link + local rebuyable = data.rebuyable + + -- Open the door and any other door with the same link + if ent:IsScriptBuyable() then + ent.BuyFunction(ply) + if !tobool(rebuyable) then + ent:SetLocked(false) + end + elseif ent:IsButton() then + ent:UnlockButton(tobool(ent.rebuyable)) + else + ent:UnlockDoor() + end + + -- Merge Nav Groups + if ent.navgroup1 and ent.navgroup2 then + nz.Nav.Functions.MergeNavGroups(ent.navgroup1, ent.navgroup2) + end + if ent.linkedmeshes then + nz.Nav.Functions.OnNavMeshUnlocked(ent.linkedmeshes) + end + + -- Sync + if link != nil then + self.OpenedLinks[link] = true + end + hook.Call("OnDoorUnlocked", self, ent, link, rebuyable, ply) +end + +function nzDoors:OpenLinkedDoors( link, ply ) + -- Go through all the doors + for k,v in pairs(self.MapDoors) do + if v.flags then + local doorlink = v.flags.link + if doorlink and doorlink == link then + self:OpenDoor( self:DoorIndexToEnt(k), ply ) + end + end + end + + for k,v in pairs(self.PropDoors) do + if v.flags then + local doorlink = v.flags.link + if doorlink and doorlink == link then + self:OpenDoor( Entity(k), ply ) + end + end + end + + self.OpenedLinks[tonumber(link)] = true +end + +function nzDoors: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 + -- Only lock doors that have been assigned a price - Prop Dynamics may be tied to invisible func_doors + if self.MapDoors[v:DoorIndex()] or self.PropDoors[v:EntIndex()] then + v:SetUseType( SIMPLE_USE ) + v:LockDoor() + v:SetKeyValue("wait",-1) + print("Locked door ", v) + else + //Unlocked doors get an output which forces it to stay open once you open it + v:Fire("addoutput", "onclose !self:open::0:-1,0,-1") + v:Fire("addoutput", "onclose !self:unlock::0:-1,0,-1") + print("Added lock output to", v) + //They now get that output through OpenDoor too, but for safety + end + //Allow locking buttons + elseif v:IsButton() and self.MapDoors[v:DoorIndex()] then + v:ButtonLock() + v:SetUseType( SIMPLE_USE ) + end + end + self.OpenedLinks = {} + hook.Call("OnAllDoorsLocked", self) +end + +function nzDoors:BuyDoor( ply, ent ) + if ent.lasttime and ent.lasttime + 2 > CurTime() then return end + + local flags = ent:GetDoorData() + if !flags then return end + local price = tonumber(flags.price) + local req_elec = tonumber(flags.elec) or 0 + local link = flags.link + local buyable = flags.buyable or 1 + --print("Entity info buying ", ent, link, req_elec, price, buyable, ent:IsLocked()) + -- If it has a price and it can be bought + if price != nil and tonumber(buyable) == 1 then + if ply:CanAfford(price) and ent:IsLocked() 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 + self:OpenDoor( ent, ply ) + else + self:OpenLinkedDoors( link, ply ) + end + end + end + elseif price == nil and buyable == nil and !ent:IsBuyableProp() then + -- Doors that can be opened because the gamemode doesn't lock them, still need to try and lock upon opening. + -- Additionally, they get the OnClose output added, in case they can still close + ent:UnlockDoor() + end + + ent.lasttime = CurTime() +end + + +//Hooks + +function nzDoors.OnUseDoor( ply, ent ) + -- Downed players can't use anything! + if !ply:GetNotDowned() then return false end + + -- Players can't use stuff while using special weapons! (Perk bottles, knives, etc) + if IsValid(ply:GetActiveWeapon()) and ply:GetActiveWeapon():IsSpecial() then return false end + + if ent:IsBuyableEntity() then + if ent.buyable == nil or tobool(ent.buyable) then + nzDoors:BuyDoor( ply, ent ) + end + end +end +hook.Add( "PlayerUse", "nzPlayerBuyDoor", nzDoors.OnUseDoor ) + +function nzDoors.CheckUseDoor(ply, ent) + --print(ply, ent) + + local tr = util.QuickTrace(ply:EyePos(), ply:GetAimVector()*100, ply) + local door = tr.Entity + --print(door) + + if IsValid(door) and door:IsDoor() then + return door + else + for k,v in pairs(ents.FindInSphere(ply:EyePos(), 1)) do + if v:GetClass() == "nz_triggerzone" then + return v + end + end + end + +end +hook.Add("FindUseEntity", "nzCheckDoor", nzDoors.CheckUseDoor) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/doors/sv_hooks.lua b/gamemodes/nzombies3/gamemode/doors/sv_hooks.lua new file mode 100644 index 00000000..5e65f30d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/doors/sv_hooks.lua @@ -0,0 +1,27 @@ +function nzDoors:OnPlayerBuyDoor( ply, door ) + +end + +function nzDoors:OnAllDoorsLocked( ) + self:SendAllDoorsLocked() +end + +function nzDoors:OnDoorUnlocked( door, link, rebuyable, ply ) + self:SendDoorOpened( door, rebuyable ) +end + +function nzDoors:OnMapDoorLinkCreated( door, flags, id ) + self:SendMapDoorCreation(door, flags, id) +end + +function nzDoors:OnMapDoorLinkRemoved( door, id ) + self:SendMapDoorRemoval(door) +end + +function nzDoors:OnPropDoorLinkCreated( ent, flags ) + self:SendPropDoorCreation( ent, flags ) +end + +function nzDoors:OnPropDoorLinkRemoved( ent ) + self:SendPropDoorRemoval( ent ) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/easter_eggs/cl_ee.lua b/gamemodes/nzombies3/gamemode/easter_eggs/cl_ee.lua new file mode 100644 index 00000000..58916ea5 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/easter_eggs/cl_ee.lua @@ -0,0 +1,93 @@ +if not ConVarExists("nz_eastereggsongs") then CreateClientConVar("nz_eastereggsongs", "1") end + +cvars.AddChangeCallback("nz_eastereggsongs", function( convar_name, value_old, value_new ) + local old, new = tobool(value_old), tobool(value_new) + if old != new then + if new then + EasterEggData.ParseSong(play) + else + EasterEggData.StopSong() + EasterEggData.AudioChannel = nil + end + end +end) + +EasterEggData = EasterEggData or {} +EasterEggData.AudioChannel = EasterEggData.AudioChannel or nil + +net.Receive("EasterEggSong", function() + EasterEggData.PlaySong() +end) + +net.Receive("EasterEggSongPreload", function() + timer.Simple(1, function() + EasterEggData.ParseSong() + end) +end) + +net.Receive("EasterEggSongStop", function() + EasterEggData.StopSong() +end) + +function EasterEggData.ParseSong(play) + if !GetConVar("nz_eastereggsongs"):GetBool() then + print("Prevented loading the Easter Egg song because you have nz_eastereggsongs to 0") + return + end + + if !nzMapping.Settings.eeurl then return end + local url = string.lower(nzMapping.Settings.eeurl) + if url == nil or url == "" then return end + + local soundcloud = string.find(url, "soundcloud.com/") + if !soundcloud then print("Easter Egg Song currently only supports Soundcloud. Make sure you use the full URL to the song.") return end + + http.Fetch( "http://api.soundcloud.com/resolve?url="..url.."&client_id=d8e0407577f7fc8475978904ef89b1f7", + function( body, len, headers, code ) + if body then + local _, streamstart = string.find(body, '"stream_url":"') + if !streamstart then print("This Soundcloud song does not have allow streaming.") return end + local streamend = string.find(body, '","', streamstart + 1) + local stream = string.sub(body, streamstart + 1, streamend - 1) + if stream then + if play then + EasterEggData.PlaySong(stream.."?client_id=d8e0407577f7fc8475978904ef89b1f7") + else + EasterEggData.PreloadSong(stream.."?client_id=d8e0407577f7fc8475978904ef89b1f7") + end + else + print("This Soundcloud song does not have allow streaming.") + end + return end + end, + function( error ) + Error( "Failed to fetch song! Error: " .. error ) + end ) +end + +function EasterEggData.PlaySong(url) + -- We have a preloaded channel + if IsValid(EasterEggData.AudioChannel) then + EasterEggData.AudioChannel:Play() + print("Playing easter egg song!") + -- We need to instantly play the given link + elseif url then + --print("Playing!") + sound.PlayURL( url, "", function(channel) EasterEggData.AudioChannel = channel end) + print("Easter egg song was not preloaded, will play through streaming.") + -- No link and no preload, parse the link and loopback to above + else + EasterEggData.ParseSong(true) + end +end + +function EasterEggData.StopSong() + if IsValid(EasterEggData.AudioChannel) then + EasterEggData.AudioChannel:Stop() + end +end + +function EasterEggData.PreloadSong(song) + sound.PlayURL( song, "noplay noblock", function(channel) EasterEggData.AudioChannel = channel end) + print("Successfully preloaded easter egg song") +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/easter_eggs/sh_constructor.lua b/gamemodes/nzombies3/gamemode/easter_eggs/sh_constructor.lua new file mode 100644 index 00000000..2dd7ea23 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/easter_eggs/sh_constructor.lua @@ -0,0 +1,7 @@ +//Main Tables +nzEE = nzEE or {} +nzEE.Data = nzEE.Data or {} +nzEE.Major = nzEE.Major or {} + +nzEE.Data.EggCount = 0 +nzEE.Data.MaxEggCount = 0 diff --git a/gamemodes/nzombies3/gamemode/easter_eggs/sh_major_ee.lua b/gamemodes/nzombies3/gamemode/easter_eggs/sh_major_ee.lua new file mode 100644 index 00000000..62f077d4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/easter_eggs/sh_major_ee.lua @@ -0,0 +1,80 @@ + +if SERVER then + + nzEE.Major.Steps = nzEE.Major.Steps or {} + nzEE.Major.CurrentStep = nzEE.Major.CurrentStep or 1 + + function nzEE.Major:AddStep(func, step) + if step and tonumber(step) then + nzEE.Major.Steps[step] = func + else + table.insert(nzEE.Major.Steps, func) + end + end + + function nzEE.Major:SetCurrentStep(step) + nzEE.Major.CurrentStep = step + end + + function nzEE.Major:CompleteStep(step, ...) + if nzEE.Major.CurrentStep == step then + if nzEE.Major.Steps[step] then + print("Completed step "..step) + local args = {...} + nzEE.Major.Steps[step](args) -- Varargs passable if you call Complete Step with more stuff + end + nzEE.Major.CurrentStep = nzEE.Major.CurrentStep + 1 + end + end + + util.AddNetworkString("nzMajorEEEndScreen") + + function nzEE.Major:Win(message) + if message then + net.Start("nzMajorEEEndScreen") + net.WriteString(message) + net.Broadcast() + end + -- Set round state to Game Over + nzRound:SetState( ROUND_GO ) + --Notify with chat message + PrintMessage( HUD_PRINTTALK, "GAME OVER!" ) + PrintMessage( HUD_PRINTTALK, "Restarting in 10 seconds!" ) + timer.Simple(10, function() + nzRound:ResetGame() + end) + + hook.Call( "OnRoundEnd", nzRound ) + end + + function nzEE.Major:Reset() + nzEE.Major.CurrentStep = 1 + end + + function nzEE.Major:Cleanup() + nzEE.Major.CurrentStep = 1 + nzEE.Major.Steps = {} + end + +end + +if CLIENT then + + local function ShowWinText() + local msg = net.ReadString() + + local w = ScrW() / 2 + local h = ScrH() / 2 + local font = "DermaLarge" + + hook.Add("HUDPaint", "DrawEEEndScreen", function() + draw.SimpleText(msg, font, w, h, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + if !nzRound:InState( ROUND_GO ) then + hook.Remove("HUDPaint", "DrawEEEndScreen") + end + end) + end + net.Receive("nzMajorEEEndScreen", ShowWinText) + + +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/easter_eggs/sv_ee.lua b/gamemodes/nzombies3/gamemode/easter_eggs/sv_ee.lua new file mode 100644 index 00000000..85d08354 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/easter_eggs/sv_ee.lua @@ -0,0 +1,52 @@ +// + +function nzEE:Reset() + -- Reset the counter of eggs + self.Data.EggCount = 0 + self.Data.MaxEggCount = 0 + + -- Reset all easter eggs + for k,v in pairs(ents.FindByClass("easter_egg")) do + v.Used = false + end + hook.Call("nz.EE.EasterEggStop") +end + +function nzEE:ActivateEgg( ent ) + + ent.Used = true + ent:EmitSound("WeaponDissolve.Dissolve", 100, 100) + + self.Data.EggCount = self.Data.EggCount + 1 + + if self.Data.MaxEggCount == 0 then + self.Data.MaxEggCount = #ents.FindByClass("easter_egg") + end + + -- What we should do when we have all the eggs + if self.Data.EggCount == self.Data.MaxEggCount then + print("All easter eggs found yay!") + hook.Call( "nz.EE.EasterEgg" ) + end +end + +util.AddNetworkString("EasterEggSong") +util.AddNetworkString("EasterEggSongPreload") +util.AddNetworkString("EasterEggSongStop") + +hook.Add("nz.EE.EasterEgg", "PlayEESong", function() + net.Start("EasterEggSong") + net.Broadcast() +end) + +hook.Add("nz.EE.EasterEggStop", "StopEESong", function() + net.Start("EasterEggSongStop") + net.Broadcast() +end) + +hook.Add("PlayerFullyInitialized", "PreloadEESongSpawn", function(ply) + -- Send players the map settings - this will trigger the preload client-side + net.Start("nzMapping.SyncSettings") + net.WriteTable(nzMapping.Settings) + net.Send(ply) +end) diff --git a/gamemodes/nzombies3/gamemode/effects/sh_constructor.lua b/gamemodes/nzombies3/gamemode/effects/sh_constructor.lua new file mode 100644 index 00000000..acaf0ac3 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/effects/sh_constructor.lua @@ -0,0 +1 @@ +nzEffects = nzEffects or {} diff --git a/gamemodes/nzombies3/gamemode/effects/sv_tesla.lua b/gamemodes/nzombies3/gamemode/effects/sv_tesla.lua new file mode 100644 index 00000000..88e3f1ad --- /dev/null +++ b/gamemodes/nzombies3/gamemode/effects/sv_tesla.lua @@ -0,0 +1,83 @@ +--Name: Tesla Effect using point_tesla +--Author: Lolle +-- +-- +--Arguments: +-- +--Data Table: +-- +--pos: vector required +-- +--ent: entity required +-- +--radius: float or string def: 50 +-- +--beamcountMin : integer or string def:20 +--beamcountMax : integer or string def:35 +-- +--color: string "r g b" def: 255 255 255 +-- +--texture: string (path to .vmt relative to materials) def: effects/tool_tracer.vmt +-- +--turnOn: boolean def: false (true will periodically emit lightnigs) +-- +--Interval, how often arcs will be emitted (only makes sense with higher dieTime and turnOn = true) +--intervalMin: float (seconds) or string def: 0.5 +--intervalMax: float (seconds) or string def: 0.5 +-- +--dieTime: float (seconds) def: 3 (use nil or false to prevent removal) +-- +--thickMin: float or string def:5 (lighnting thickness) +--thickMax: float or string def 15 +-- +--MakeSure to adjust the dieTime atleast to lifetimeMax*2 +--lifetimeMin: float or string def: 0.3 (lighnting lifetime) +--lifetimeMax: float or string def: 0.55 +-- +--sound: string def: weapons/physcannon/superphys_small_zap1.wav (sound to play on emit) +--Return: +-- +--Returns wether the effect could be created or not +--returns: boolean +-- + +function nzEffects:Tesla( data ) + + local tesla = ents.Create("point_tesla") + + if not IsValid( tesla ) then return false end + tesla:SetPos( data.pos ) + tesla:SetParent( data.ent ) + tesla:SetOwner( data.ent ) + + tesla:SetKeyValue("texture", data.texture and tostring(data.texture) or "trails/electric.vmt") + tesla:SetKeyValue("m_iszSpriteName", "sprites/physbeam.vmt") + tesla:SetKeyValue("m_Color", data.color and tostring(data.color) or "255 255 255") + tesla:SetKeyValue("m_flRadius", data.radius and tostring(data.radius) or "50") + tesla:SetKeyValue("interval_min", data.intevalMin and tostring(data.intervalMin) or "0.5") + tesla:SetKeyValue("interval_max", data.intervalMax and tostring(data.intervalMax) or "0.5") + tesla:SetKeyValue("beamcount_min", data.beamcountMin and tostring(data.beamcountMin) or "20") + tesla:SetKeyValue("beamcount_max", data.beamcountMax and tostring(data.beamcountMax) or "35") + tesla:SetKeyValue("thick_min", data.thickMin and tostring(data.thickMin) or "5") + tesla:SetKeyValue("thick_max", data.thickMax and tostring(data.thickMax) or "15") + tesla:SetKeyValue("lifetime_min", data.lifetimeMin and tostring(data.lifetimeMin) or "0.3") + tesla:SetKeyValue("lifetime_max", data.lifetimeMax and tostring(data.lifetimeMax) or "0.55") + tesla:SetKeyValue("m_SoundName", data.sound and tostring(data.sound) or tostring("weapons/physcannon/superphys_small_zap" .. math.random(1,4) .. ".wav")) + + tesla:Spawn() + tesla:Activate() + + if data.turnOn then + tesla:Fire("TurnOn", "", 0) + else + --emit one spark + tesla:Fire("DoSpark", "", 0) + end + + if data.dieTime then + SafeRemoveEntityDelayed( tesla, data.dieTime or 3 ) + end + + return true + +end diff --git a/gamemodes/nzombies3/gamemode/electricity/sh_constructor.lua b/gamemodes/nzombies3/gamemode/electricity/sh_constructor.lua new file mode 100644 index 00000000..74ab548b --- /dev/null +++ b/gamemodes/nzombies3/gamemode/electricity/sh_constructor.lua @@ -0,0 +1,11 @@ +-- Main Tables +nzElec = nzElec or {} + +-- Variables +nzElec.Active = false + +function nzElec.IsOn() + return nzElec.Active +end + +IsElec = nzElec.IsOn diff --git a/gamemodes/nzombies3/gamemode/electricity/sh_sync.lua b/gamemodes/nzombies3/gamemode/electricity/sh_sync.lua new file mode 100644 index 00000000..e7eae144 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/electricity/sh_sync.lua @@ -0,0 +1,44 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.nzElec.Sync" ) + util.AddNetworkString( "nz.nzElec.Sound" ) + + function nzElec:SendSync(ply) + net.Start( "nz.nzElec.Sync" ) + net.WriteBool(self.Active) + return IsValid(ply) and net.Send(ply) or net.Broadcast() + end + + FullSyncModules["Elec"] = function(ply) + nzElec:SendSync(ply) + end + +end + +if CLIENT then + + //Server to client (Client) + local function ReceiveSync( length ) + local active = net.ReadBool() + nzElec.Active = active + end + + local function RecievePowerSound() + local on = net.ReadBool() + print(on) + if on then + surface.PlaySound("nz/machines/power_up.wav") + else + surface.PlaySound("nz/machines/power_down.wav") + end + end + + //Receivers + net.Receive( "nz.nzElec.Sync", ReceiveSync ) + net.Receive( "nz.nzElec.Sound", RecievePowerSound ) + + +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/electricity/sv_elec.lua b/gamemodes/nzombies3/gamemode/electricity/sv_elec.lua new file mode 100644 index 00000000..1dee4574 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/electricity/sv_elec.lua @@ -0,0 +1,72 @@ +// + +function nzElec:Activate(nochat) + + if self.Active then return end -- We don't wanna turn it on twice + + self.Active = true + self:SendSync() + + -- Open all doors with no price and electricity requirement + for k,v in pairs(ents.GetAll()) do + if v:IsBuyableEntity() then + local data = v:GetDoorData() + if data then + if tonumber(data.price) == 0 and tobool(data.elec) == true then + nzDoors:OpenDoor( v ) + end + end + end + end + + -- Turn on all perk machines + for k,v in pairs(ents.FindByClass("perk_machine")) do + v:TurnOn() + end + + local wund = ents.FindByClass("wunderfizz_machine") + local machine = wund[math.random(#wund)] + if IsValid(machine) then machine:TurnOn() end + + -- Inform players + if !nochat then + PrintMessage(HUD_PRINTTALK, "[NZ] Electricity is on!") + net.Start("nz.nzElec.Sound") + net.WriteBool(true) + net.Broadcast() + end + + for k,v in pairs(ents.FindByClass("nz_electricity")) do + v:Fire("OnElectricityOn") + end + + hook.Call("ElectricityOn") + +end + +function nzElec:Reset(nochat) + + if !self.Active then return end -- No need to turn it off again + + self.Active = false + -- Reset the button aswell + local prevs = ents.FindByClass("power_box") + for k,v in pairs(prevs) do + v:SetSwitch(false) + end + + self:SendSync() + + if !nochat then + net.Start("nz.nzElec.Sound") + net.WriteBool(false) + net.Broadcast() + end + + for k,v in pairs(ents.FindByClass("nz_electricity")) do + v:Fire("OnElectricityOff") + end + + hook.Call("ElectricityOff") + +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/enemies/sh_constructor.lua b/gamemodes/nzombies3/gamemode/enemies/sh_constructor.lua new file mode 100644 index 00000000..3da3e606 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/enemies/sh_constructor.lua @@ -0,0 +1,5 @@ +if SERVER then + + nzEnemies = nzEnemies or {} + +end diff --git a/gamemodes/nzombies3/gamemode/enemies/sh_ent_ext.lua b/gamemodes/nzombies3/gamemode/enemies/sh_ent_ext.lua new file mode 100644 index 00000000..5036c70c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/enemies/sh_ent_ext.lua @@ -0,0 +1,45 @@ +TARGET_PRIORITY_NONE = 0 +TARGET_PRIORITY_PLAYER = 1 +TARGET_PRIORITY_SPECIAL = 2 +TARGET_PRIORITY_MAX = 2 +-- Someone could add a new priority level by doing this: +-- TARGET_PRIORITY_CUSTOM = TARGET_PRIORITY_MAX + 1 +-- TARGET_PRIORITY_MAX = TARGET_PRIORITY_MAX + 1 +-- would be limited to 7 custom levels before overwritting TARGET_PRIORITY_ALWAYS, which shoiuld be enough. +TARGET_PRIORITY_ALWAYS = 10 --make this entity a global target (not recommended) + +--WARNING HTIS IS ONLY PARTIALLY SHARED its not recommended to use it clientside. + +local meta = FindMetaTable("Entity") + +function meta:GetTargetPriority() + return self.iTargetPriority or TARGET_PRIORITY_NONE +end + +function meta:SetTargetPriority(value) + self.iTargetPriority = value +end + +function meta:SetDefaultTargetPriority() + if self:IsPlayer() then + if self:GetNotDowned() and self:IsPlaying() then + self:SetTargetPriority(TARGET_PRIORITY_PLAYER) + else + self:SetTargetPriority(TARGET_PRIORITY_NONE) + end + else + self:SetTargetPriority(TARGET_PRIORITY_NONE) -- By default all entities are non-targetable + end +end + +if SERVER then + function UpdateAllZombieTargets(target) + if IsValid(target) then + for k,v in pairs(ents.GetAll()) do + if nzConfig.ValidEnemies[v:GetClass()] then + v:SetTarget(target) + end + end + end + end +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/enemies/sv_enemies.lua b/gamemodes/nzombies3/gamemode/enemies/sv_enemies.lua new file mode 100644 index 00000000..a11ff6a1 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/enemies/sv_enemies.lua @@ -0,0 +1,10 @@ +function nzEnemies:TotalAlive() + local c = 0 + + -- Count + for k,v in pairs(nzConfig.ValidEnemies) do + c = c + #ents.FindByClass(k) + end + + return c +end diff --git a/gamemodes/nzombies3/gamemode/enemies/sv_hooks.lua b/gamemodes/nzombies3/gamemode/enemies/sv_hooks.lua new file mode 100644 index 00000000..efdef85e --- /dev/null +++ b/gamemodes/nzombies3/gamemode/enemies/sv_hooks.lua @@ -0,0 +1,76 @@ +function nzEnemies:OnEnemyKilled(enemy, attacker, dmginfo, hitgroup) + -- Prevent multiple "dyings" by making sure the zombie has not already been "killed" + if enemy.MarkedForDeath then return end + + if attacker:IsPlayer() then + --attacker:GivePoints(90) + attacker:AddFrags(1) + if attacker:HasPerk("vulture") then + if math.random(10) == 1 then + local drop = ents.Create("drop_vulture") + drop:SetPos(enemy:GetPos() + Vector(0,0,50)) + drop:Spawn() + end + end + end + + -- Run special on-killed function if it has any + nzConfig.ValidEnemies[enemy:GetClass()].OnKilled(enemy, dmginfo, hitgroup) + + if nzRound:InProgress() then + nzRound:SetZombiesKilled( nzRound:GetZombiesKilled() + 1 ) + + -- Chance a powerup spawning + if !nzPowerUps:IsPowerupActive("insta") and IsValid(enemy) then -- Don't spawn powerups during instakill + if math.random(1, 100 / GetConVar("nz_difficulty_powerup_chance"):GetFloat()) == 1 then -- 1 in 100 chance - you can change this in config + nzPowerUps:SpawnPowerUp(enemy:GetPos()) + end + end + + print("Killed Enemy: " .. nzRound:GetZombiesKilled() .. "/" .. nzRound:GetZombiesMax() ) + if nzRound:IsSpecial() and nzRound:GetZombiesKilled() >= nzRound:GetZombiesMax() then + nzPowerUps:SpawnPowerUp(enemy:GetPos(), "maxammo") + end + end + -- Prevent this function from running on this zombie again + enemy.MarkedForDeath = true +end + +function GM:EntityTakeDamage(zombie, dmginfo) + + -- Who's Who clones can't take damage! + if zombie:GetClass() == "whoswho_downed_clone" then return true end + + if !dmginfo:GetAttacker():IsPlayer() then return end + if IsValid(zombie) and nzConfig.ValidEnemies[zombie:GetClass()] and nzConfig.ValidEnemies[zombie:GetClass()].Valid then + local hitgroup = util.QuickTrace( dmginfo:GetDamagePosition( ), dmginfo:GetDamagePosition( ) ).HitGroup + + if nzPowerUps:IsPowerupActive("insta") then + dmginfo:SetDamage(zombie:Health()) + nzEnemies:OnEnemyKilled(zombie, dmginfo:GetAttacker(), dmginfo, hitgroup) + return end + + + nzConfig.ValidEnemies[zombie:GetClass()].ScaleDMG(zombie, hitgroup, dmginfo) + + -- Pack-a-Punch doubles damage + if dmginfo:GetAttacker():GetActiveWeapon().pap then dmginfo:ScaleDamage(2) end + + if zombie:Health() > dmginfo:GetDamage() then + if zombie.HasTakenDamageThisTick then return end + nzConfig.ValidEnemies[zombie:GetClass()].OnHit(zombie, dmginfo, hitgroup) + zombie.HasTakenDamageThisTick = true + -- Prevent multiple damages in one tick (FA:S 2 Bullet penetration makes them hit 1 zombie 2-3 times per bullet) + timer.Simple(0, function() if IsValid(zombie) then zombie.HasTakenDamageThisTick = false end end) + else + nzEnemies:OnEnemyKilled(zombie, dmginfo:GetAttacker(), dmginfo, hitgroup) + end + end +end + +local function OnRagdollCreated( ent ) + if ( ent:GetClass() == "prop_ragdoll" ) then + ent:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + end +end +hook.Add("OnEntityCreated", "nz.Enemies.OnEntityCreated", OnRagdollCreated) diff --git a/gamemodes/nzombies3/gamemode/enemies/sv_spawner.lua b/gamemodes/nzombies3/gamemode/enemies/sv_spawner.lua new file mode 100644 index 00000000..13803368 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/enemies/sv_spawner.lua @@ -0,0 +1,142 @@ +-- Class for spawning zombies. This can be used t create different Spawners for different spawnpoints. +-- Warning! Creating multiple instances of this class for the same spawnpoint entity will overwrite prior instances. +-- Author: Lolle + +if Spawner == nil then + Spawner = class({ + -- CONSTRUCTOR + -- sPointClass: The class of spawnpoints this spawner will create entities from. + -- A spawnpoint class should only be used by one spawner at a time. + -- data: information about the entities that are spawned, required are a entity class and chance. + -- zombiesToSpawn: the amount of zombies this type of spawner will spawn in total. + -- spawnDelay: delays the next spawn by the amont set in this value + -- roundNum: the round this spawner was created (after this round teh spawn will be removed) + constructor = function(self, spointClass, data, zombiesToSpawn, spawnDelay, roundNum) + self.sSpointClass = spointClass or "nz_spawn_zombie_normal" + self.tData = data or {["nz_zombie_walker"] = {chance = 100}} + self.iZombiesToSpawn = zombiesToSpawn or 5 + self.tSpawns = ents.FindByClass(self.sSpointClass) + self.tValidSpawns = {} + self:SetDelay(spawnDelay or 0.25) + self:SetNextSpawn(CurTime()) + self:SetZombieData(self.tData) + -- not really sure if this is 100% unique but for our purpose it will be enough + self.sUniqueName = self.sSpointClass .. "." .. CurTime() + self.iRoundNumber = roundNum or nzRound:GetNumber() + self:Activate() + end + }) +end + +AccessorFunc(Spawner, "dDelay", "Delay", FORCE_NUMBER) +AccessorFunc(Spawner, "dNextSpawn", "NextSpawn", FORCE_NUMBER) + +function Spawner:Activate() + for _, spawn in pairs(self.tSpawns) do + spawn:SetSpawner(self) + end + -- curently does the costly zombie distribution 3 seconds can be lowered (without any problems) + timer.Create("nzZombieSpawnThink" .. self.sUniqueName, 3, 0, function() self:Update() end) +end + +function Spawner:DecrementZombiesToSpawn() + self.iZombiesToSpawn = self.iZombiesToSpawn - 1 +end + +function Spawner:IncrementZombiesToSpawn() + self.iZombiesToSpawn = self.iZombiesToSpawn + 1 +end + +function Spawner:GetZombiesToSpawn() + return self.iZombiesToSpawn +end + +function Spawner:SetZombiesToSpawn(value) + self.iZombiesToSpawn = value +end + +function Spawner:GetSpawns() + return self.tSpawns +end + +function Spawner:GetData() + return self.tData +end + +function Spawner:Update() + -- garbage collect the spawner object if a round is over + if (self.iRoundNumber != nzRound:GetNumber() or nzRound:InState(ROUND_GO)) and timer.Exists("nzZombieSpawnThink" .. self.sUniqueName) then + self:Remove() + end + + self:UpdateWeights() + self:UpdateValidSpawns() +end + +function Spawner:UpdateWeights() + local plys = player.GetAllTargetable() + for _, spawn in pairs(self.tSpawns) do + -- reset + spawn:SetSpawnWeight(0) + for _, ply in pairs(plys) do + local dist = spawn:GetPos():Distance(ply:GetPos()) + spawn:SetSpawnWeight(spawn:GetSpawnWeight() + dist) + end + spawn:SetSpawnWeight(spawn:GetSpawnWeight() / #plys) + end +end + +function Spawner:UpdateValidSpawns() + + -- reset + self.tValidSpawns = {} + + local average = self:GetAverageWeight() + for _, spawn in pairs(self.tSpawns) do + -- reset the zombiesToSpawn value on every Spawnpoint + spawn:SetZombiesToSpawn(0) + if spawn:GetSpawnWeight() <= average then + if spawn.link == nil or nzDoors.OpenedLinks[tonumber(spawn.link)] then + table.insert(self.tValidSpawns, spawn) + end + end + end + table.sort(self.tValidSpawns, function(a, b) return a:GetSpawnWeight() < b:GetSpawnWeight() end ) + + -- distri bute zombies to spawn on to the valid spawnpoints + local zombiesToSpawn = self.iZombiesToSpawn / 2 + local totalDistributed = 0 + for k, vspawn in pairs(self.tValidSpawns) do + if k < #self.tValidSpawns then + vspawn:SetZombiesToSpawn(math.ceil(zombiesToSpawn)) + totalDistributed = totalDistributed + math.ceil(zombiesToSpawn) + zombiesToSpawn = math.floor(zombiesToSpawn / 2) + else + -- add the remaining zombies to the last spawn in list + vspawn:SetZombiesToSpawn(self.iZombiesToSpawn - totalDistributed) + end + end +end + +function Spawner:GetAverageWeight() + local sum = 0 + for _, spawn in pairs(self.tSpawns) do + sum = sum + spawn:GetSpawnWeight() + end + return sum / #self.tSpawns +end + +function Spawner:GetValidSpawns() + return self.tValidSpawns +end + +function Spawner:SetZombieData(data) + for _, spawn in pairs(self.tSpawns) do + spawn:SetZombieData(data) + end +end + +function Spawner:Remove() + timer.Remove("nzZombieSpawnThink" .. self.sUniqueName) + self = nil +end diff --git a/gamemodes/nzombies3/gamemode/function_override/sh_constructor.lua b/gamemodes/nzombies3/gamemode/function_override/sh_constructor.lua new file mode 100644 index 00000000..e69de29b diff --git a/gamemodes/nzombies3/gamemode/function_override/sh_meta.lua b/gamemodes/nzombies3/gamemode/function_override/sh_meta.lua new file mode 100644 index 00000000..d71836e2 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/function_override/sh_meta.lua @@ -0,0 +1,231 @@ +local playerMeta = FindMetaTable("Player") +local wepMeta = FindMetaTable("Weapon") + +if SERVER then + + function ReplaceReloadFunction(wep) + //Either not a weapon, doesn't have a reload function, or is FAS2 + if wep:NZPerkSpecialTreatment() then return end + local oldreload = wep.Reload + if !oldreload then return end + + --print("Weapon reload modified") + + wep.Reload = function() + if wep.ReloadFinish and wep.ReloadFinish > CurTime() then return end + local ply = wep.Owner + if ply:HasPerk("speed") then + --print("Hasd perk") + local cur = wep:Clip1() + if cur >= wep:GetMaxClip1() then return end + local give = wep:GetMaxClip1() - cur + if give > ply:GetAmmoCount(wep:GetPrimaryAmmoType()) then + give = ply:GetAmmoCount(wep:GetPrimaryAmmoType()) + end + if give <= 0 then return end + --print(give) + + wep:SendWeaponAnim(ACT_VM_RELOAD) + oldreload(wep) + local rtime = wep:SequenceDuration(wep:SelectWeightedSequence(ACT_VM_RELOAD))/2 + wep:SetPlaybackRate(2) + ply:GetViewModel():SetPlaybackRate(2) + + local nexttime = CurTime() + rtime + + wep:SetNextPrimaryFire(nexttime) + wep:SetNextSecondaryFire(nexttime) + wep.ReloadFinish = nexttime + + timer.Simple(rtime, function() + if IsValid(wep) and ply:GetActiveWeapon() == wep then + wep:SetPlaybackRate(1) + ply:GetViewModel():SetPlaybackRate(1) + wep:SendWeaponAnim(ACT_VM_IDLE) + wep:SetClip1(give + cur) + ply:RemoveAmmo(give, wep:GetPrimaryAmmoType()) + wep:SetNextPrimaryFire(0) + wep:SetNextSecondaryFire(0) + end + end) + else + oldreload(wep) + end + end + end + hook.Add("WeaponEquip", "ModifyWeaponReloads", ReplaceReloadFunction) + + function ReplacePrimaryFireCooldown(wep) + local oldfire = wep.PrimaryAttack + if !oldfire then return end + + --print("Weapon fire modified") + + wep.PrimaryAttack = function() + oldfire(wep) + + //FAS2 weapons have built-in DTap functionality + if wep:IsFAS2() then return end + //With double tap, reduce the delay for next primary fire to 2/3 + if wep.Owner:HasPerk("dtap") or wep.Owner:HasPerk("dtap2") then + local delay = (wep:GetNextPrimaryFire() - CurTime())*0.80 + wep:SetNextPrimaryFire(CurTime() + delay) + end + end + end + hook.Add("WeaponEquip", "ModifyWeaponNextFires", ReplacePrimaryFireCooldown) + + function ReplaceAimDownSight(wep) + local oldfire = wep.SecondaryAttack + if !oldfire then return end + + --print("Weapon fire modified") + + wep.SecondaryAttack = function() + oldfire(wep) + //With deadshot, aim at the head of the entity aimed at + if wep.Owner:HasPerk("deadshot") then + local tr = wep.Owner:GetEyeTrace() + local ent = tr.Entity + if IsValid(ent) and nzConfig.ValidEnemies[ent:GetClass()] then + local head = ent:LookupBone("ValveBiped.Bip01_Neck1") + if head then + local headpos,headang = ent:GetBonePosition(head) + wep.Owner:SetEyeAngles((headpos - wep.Owner:GetShootPos()):Angle()) + end + end + end + end + end + hook.Add("WeaponEquip", "ModifyAimDownSights", ReplaceAimDownSight) + + hook.Add("DoAnimationEvent", "ReloadCherry", function(ply, event, data) + --print(ply, event, data) + if event == PLAYERANIMEVENT_RELOAD then + if ply:HasPerk("cherry") then + local wep = ply:GetActiveWeapon() + if IsValid(wep) and wep:Clip1() < wep:GetMaxClip1() then + local pct = 1 - (wep:Clip1()/wep:GetMaxClip1()) + local pos, ang = ply:GetPos() + ply:GetAimVector()*10 + Vector(0,0,50), ply:GetAimVector() + nzEffects:Tesla( { + pos = ply:GetPos() + Vector(0,0,50), + ent = ply, + turnOn = true, + dieTime = 1, + lifetimeMin = 0.05*pct, + lifetimeMax = 0.1*pct, + intervalMin = 0.01, + intervalMax = 0.02, + }) + --print(pct) + local zombies = ents.FindInSphere(ply:GetPos(), 250*pct) + local d = DamageInfo() + d:SetDamage( 100*pct ) + d:SetDamageType( DMG_SHOCK ) + d:SetAttacker(ply) + d:SetInflictor(ply) + + for k,v in pairs(zombies) do + if nzConfig.ValidEnemies[v:GetClass()] then + v:TakeDamageInfo(d) + end + end + end + end + end + end) + + function GM:GetFallDamage( ply, speed ) + local dmg = speed / 10 + if ply:HasPerk("phd") and dmg >= 50 then + if ply:Crouching() then + local zombies = ents.FindInSphere(ply:GetPos(), 250) + for k,v in pairs(zombies) do + if nzConfig.ValidEnemies[v:GetClass()] then + v:TakeDamage(150, ply, ply) + end + end + local pos = ply:GetPos() + local effectdata = EffectData() + effectdata:SetOrigin( pos ) + util.Effect( "HelicopterMegaBomb", effectdata ) + ply:EmitSound("phx/explode0"..math.random(0, 6)..".wav") + end + return 0 + end + return ( dmg ) + end + + local oldsetwep = playerMeta.SetActiveWeapon + function playerMeta:SetActiveWeapon(wep) + local oldwep = self:GetActiveWeapon() + if IsValid(oldwep) and !oldwep:IsSpecial() then + self.NZPrevWep = oldwep + end + oldsetwep(self, wep) + end + +else + + --[[ Manual speedup of the reload function on FAS2 weapons - seemed like the original solution broke along the way + function ReplaceReloadFunction(wep) + print(wep, "HUKDAHD1") + if wep:IsFAS2() then + print(wep, "HUKDAHD2") + local oldreload = wep.Reload + if !oldreload then return end + print(wep, "HUKDAHD3") + wep.Reload = function() + print(wep, "HUKDAHD4") + oldreload(wep) + if LocalPlayer():HasPerk("speed") then + wep.Wep:SetPlaybackRate(2) + end + end + print(wep, "HUKDAHD5") + end + end + hook.Add("HUDWeaponPickedUp", "ModifyFAS2WeaponReloads", ReplaceReloadFunction)]] + +end + +local olddefreload = wepMeta.DefaultReload +function wepMeta:DefaultReload(act) + if IsValid(self.Owner) and self.Owner:HasPerk("speed") then return end + olddefreload(self, act) +end + +function GM:EntityFireBullets(ent, data) + + //Fire the PaP shooting sound if the weapon is PaP'd + --print(wep, wep.pap) + if ent:IsPlayer() and IsValid(ent:GetActiveWeapon()) and ent:GetActiveWeapon().pap then + wep:EmitSound("nz/effects/pap_shoot_glock20.wav", 105, 100) + end + + //Perform a trace that filters out wall blocks + local tr = util.TraceLine({ + start = data.Src, + endpos = data.Src + (data.Dir*data.Distance), + filter = function(ent) + if ent:GetClass() == "wall_block" then + return false + else + return true + end + end + }) + + --PrintTable(tr) + + //If we hit anything, move the source of the bullets up to that point + if tr.Hit and tr.HitPos then + data.Src = tr.HitPos - data.Dir*5 + if ent:IsPlayer() and ent:HasPerk("dtap2") then + data.Num = data.Num * 2 + end + return true + elseif ent:IsPlayer() and ent:HasPerk("dtap2") then + data.Num = data.Num * 2 + end +end diff --git a/gamemodes/nzombies3/gamemode/init.lua b/gamemodes/nzombies3/gamemode/init.lua new file mode 100644 index 00000000..97c8032c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/init.lua @@ -0,0 +1,15 @@ +local plyMeta = FindMetaTable("Player") +FullSyncModules = {} + +function plyMeta:SendFullSync() + -- Modules add their own fullsync functions into this table + for k,v in pairs(FullSyncModules) do + v(self) + end +end + +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/gamemodes/nzombies3/gamemode/interfaces/sh_constructor.lua similarity index 100% rename from nzombies3/gamemode/interfaces/sh_constructor.lua rename to gamemodes/nzombies3/gamemode/interfaces/sh_constructor.lua diff --git a/gamemodes/nzombies3/gamemode/interfaces/sh_int_configloader.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_configloader.lua new file mode 100644 index 00000000..5a4b5a7d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_configloader.lua @@ -0,0 +1,228 @@ +// + +if SERVER then + util.AddNetworkString("nz_ChangeLevel") + net.Receive("nz_ChangeLevel", function(len, ply) + if ply:IsSuperAdmin() then + RunConsoleCommand("changelevel", net.ReadString()) + end + end) + + function nz.Interfaces.Functions.ConfigLoaderHandler( ply, data ) + if ply:IsSuperAdmin() then + nzMapping:LoadConfig( data.config, ply ) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.ConfigLoader( data ) + local configs = {} + local selectedconfig + local hoveredpanel + + if data.officialconfigs then + for k,v in pairs(data.officialconfigs) do + local name = string.Explode(";", v) + local map, configname = name[1], name[2] + if name[2] then + local config = {} + config.map = string.sub(map, 4) + config.name = string.sub(configname, 0, #configname-4) + config.config = v + config.official = true + table.insert(configs, config) + end + end + end + if data.configs then + for k,v in pairs(data.configs) do + local name = string.Explode(";", v) + local map, configname = name[1], name[2] + if name[2] then + local config = {} + config.map = string.sub(map, 4) + config.name = string.sub(configname, 0, #configname-4) + config.config = v + table.insert(configs, config) + end + end + end + if data.workshopconfigs then + for k,v in pairs(data.workshopconfigs) do + local name = string.Explode(";", v) + local map, configname = name[1], name[2] + if name[2] then + local config = {} + config.map = string.sub(map, 4) + config.name = string.sub(configname, 0, #configname-4) + config.config = v + config.workshop = true + table.insert(configs, config) + end + end + end + + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 400, 500 ) + DermaPanel:SetTitle( "Load a config" ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local SubmitButton = vgui.Create( "DButton", DermaPanel ) + SubmitButton:SetText( "Click a config to load" ) + SubmitButton:SetPos( 10, 460 ) + SubmitButton:SetSize( 380, 30 ) + SubmitButton.DoClick = function(self) + if selectedconfig != nil and selectedconfig != "" then + if string.find(self:GetText(), "Change map to") then + net.Start("nz_ChangeLevel") + net.WriteString(string.sub(string.Explode(";", selectedconfig)[1], 4)) + net.SendToServer() + elseif string.find(self:GetText(), "This map is not installed") then + chat.AddText("This map cannot be loaded as it is not installed") + elseif selectedconfig and selectedconfig != "" then + nz.Interfaces.Functions.SendRequests( "ConfigLoader", {config = selectedconfig} ) + DermaPanel:Close() + end + end + end + + local sheet = vgui.Create("DPropertySheet", DermaPanel) + sheet:SetPos(5, 30) + sheet:SetSize(390, 420) + + local ConfigsScroll = vgui.Create("DScrollPanel", sheet) + ConfigsScroll:SetPos(5, 5) + ConfigsScroll:SetSize(380, 420) + sheet:AddSheet("Configs", ConfigsScroll, "icon16/brick.png") + + local OldConfigs = vgui.Create("DListView", sheet) + OldConfigs:SetPos(175, 350) + OldConfigs:SetSize(250, 100) + OldConfigs:SetMultiSelect(false) + OldConfigs:AddColumn("Name") + if data.configs then + for k,v in pairs(data.configs) do + OldConfigs:AddLine(v) + end + end + if data.workshopconfigs then + for k,v in pairs(data.workshopconfigs) do + OldConfigs:AddLine(v) + end + end + if data.officialconfigs then + for k,v in pairs(data.officialconfigs) do + OldConfigs:AddLine(v) + end + end + OldConfigs.OnRowSelected = function(self, index, row) + selectedconfig = row:GetValue(1) + SubmitButton:SetText( " Load config\nWarning: May not work properly without changing map" ) + end + sheet:AddSheet("All config files", OldConfigs, "icon16/database_table.png") + + local ConfigList = vgui.Create("DListLayout", ConfigsScroll) + ConfigList:SetPos(0,150) + ConfigList:SetSize(370, 420) + ConfigList:SetPaintBackground(true) + ConfigList:SetBackgroundColor(Color(255,255,255)) + + local CurMapConfigList = vgui.Create("DListLayout", ConfigsScroll) + CurMapConfigList:SetPos(0,0) + CurMapConfigList:SetSize(370, 120) + CurMapConfigList:SetPaintBackground(true) + CurMapConfigList:SetBackgroundColor(Color(255,255,255)) + + for k,v in pairs(configs) do + local config = vgui.Create("DPanel", v.map == game.GetMap() and CurMapConfigList or ConfigList) + config:SetPos(0,0) + config:SetSize(380, 50) + config:SetPaintBackground(true) + config.Paint = function(self, w, h) + if selectedconfig == v.config then + surface.SetDrawColor(200,200,255) + elseif hoveredpanel == k then + surface.SetDrawColor(230,230,255) + else + surface.SetDrawColor(255,255,255) + end + self:DrawFilledRect() + end + --config:SetBackgroundColor(ColorRand()) + + local mapicon = "nzmapicons/"..string.StripExtension(v.config)..".png" + if ( Material(mapicon):IsError() ) then mapicon = "maps/thumb/" .. v.map .. ".png" end + if ( Material(mapicon):IsError() ) then mapicon = "maps/" .. v.map .. ".png" end + if ( Material(mapicon):IsError() ) then mapicon = "noicon.png" end + + local map = vgui.Create("DImage", config) + map:SetPos(5, 5) + map:SetSize(40, 40) + map:SetImage(mapicon) + + local configname = vgui.Create("DLabel", config) + configname:SetText(v.name) + configname:SetTextColor(Color(20, 20, 20)) + configname:SizeToContents() + configname:SetPos(70, 18) + + local mapname = vgui.Create("DLabel", config) + mapname:SetText(v.map) + mapname:SetTextColor(Color(20, 20, 20)) + mapname:SizeToContents() + mapname:SetPos(180, 18) + + local mapstatus = vgui.Create("DLabel", config) + local status = file.Find("maps/"..v.map..".bsp", "GAME")[1] and true or false + mapstatus:SetText(status and "Map installed" or "Map not installed" ) + mapstatus:SetTextColor(status and Color(20, 200, 20) or Color(200, 20, 20)) + mapstatus:SizeToContents() + mapstatus:SetPos(360 - mapstatus:GetWide(), 12) + + local configlocation = vgui.Create("DLabel", config) + configlocation:SetText(v.workshop and "Workshop" or v.official and "Official" or "Local") + configlocation:SetTextColor(v.workshop and Color(150, 20, 100) or v.official and Color(255,0,0) or Color(20, 20, 200)) + configlocation:SizeToContents() + configlocation:SetPos(360 - configlocation:GetWide(), 26) + + local click = vgui.Create("DButton", config) + click:SetText("") + click:SetPos(0,0) + click:SetSize(380, 50) + click.Paint = function(self) + if self:IsHovered() then hoveredpanel = k end + end + click.DoClick = function(self) + selectedconfig = v.config + if game.GetMap() != v.map then + SubmitButton:SetText(status and "Change map to "..v.map or "This map is not installed") + else + SubmitButton:SetText( "Load config" ) + end + -- Doesn't work? :/ + OldConfigs:SelectItem(nil) + end + + end + + local curmapcount = table.Count(CurMapConfigList:GetChildren()) + if curmapcount <= 0 then + local txtpnl = vgui.Create("DPanel", CurMapConfigList) + txtpnl:SetSize(380,50) + + local txt = vgui.Create("DLabel", txtpnl) + txt:SetText("No configs found for the current map.") + txt:SizeToContents() + txt:Center() + txt:SetTextColor(Color(0,0,0)) + curmapcount = 1 + end + ConfigList:SetPos(0,curmapcount*50 + 20) + end +end diff --git a/gamemodes/nzombies3/gamemode/interfaces/sh_int_configsaver.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_configsaver.lua new file mode 100644 index 00000000..c7887e41 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_configsaver.lua @@ -0,0 +1,52 @@ +// + +if SERVER then + function nz.Interfaces.Functions.ConfigSaverHandler( ply, data ) + if ply:IsSuperAdmin() then + nzMapping:SaveConfig( data.name ) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.ConfigSaver() + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 120 ) + DermaPanel:SetTitle( "Save config" ) + DermaPanel:SetVisible( true ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:MakePopup() + DermaPanel:Center() + + local WarnText = vgui.Create("DLabel", DermaPanel) + WarnText:SetSize(280, 20) + WarnText:SetPos(10, 50) + WarnText:SetText("") + WarnText:SetTextColor( Color(150,0,0) ) + + local TextEntry = vgui.Create("DTextEntry", DermaPanel) + TextEntry:SetPos(10, 30) + TextEntry:SetSize(280, 20) + TextEntry.OnChange = function(self) + if string.find(self:GetValue(), ";") then + WarnText:SetText("The name cannot contain ';'!") + else + WarnText:SetText("") + end + end + + local DermaButton = vgui.Create( "DButton", DermaPanel ) + DermaButton:SetText( "Save" ) + DermaButton:SetPos( 10, 80 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + local name = TextEntry:GetValue() + nz.Interfaces.Functions.SendRequests( "ConfigSaver", {name = name} ) + end + end + + net.Receive("nz_SaveConfig", nz.Interfaces.Functions.ConfigSaver) + +end diff --git a/gamemodes/nzombies3/gamemode/interfaces/sh_int_door.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_door.lua new file mode 100644 index 00000000..6d8f8c9d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_door.lua @@ -0,0 +1,137 @@ +// + +if SERVER then + function nz.Interfaces.Functions.DoorPropsHandler( ply, data ) + if ply:IsSuperAdmin() then + PrintTable(data) + nzDoors: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 + valz["Row5"] = 1 + valz["Row6"] = 0 + + valz["Row7"] = "" + valz["Row8"] = "" + + local door_data = nil + + //Check if the ent has flags already + if ent:IsDoor() or ent:IsButton() then + door_data = nzDoors.MapDoors[ent:DoorIndex()].flags + elseif ent:IsBuyableProp() then + door_data = nzDoors.PropDoors[ent:EntIndex()].flags + 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 + valz["Row5"] = door_data.buyable + valz["Row6"] = door_data.rebuyable + + if door_data.navgroup1 != nil then + valz["Row7"] = door_data.navgroup1 + end + if door_data.navgroup2 != nil then + valz["Row8"] = door_data.navgroup2 + end + name = "Modifying Door Flag" + end + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 280 ) + 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, 260 ) + 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 Row5 = DProperties:CreateRow( "Door Settings", "Purchaseable?" ) + Row5:Setup( "Boolean" ) + Row5:SetValue( valz["Row5"] ) + Row5.DataChanged = function( _, val ) valz["Row5"] = val end + local Row6 = DProperties:CreateRow( "Door Settings", "Rebuyable?" ) + Row6:Setup( "Boolean" ) + Row6:SetValue( valz["Row6"] ) + Row6.DataChanged = function( _, val ) valz["Row6"] = val end + + local Row7 = DProperties:CreateRow( "Nav Group Merging", "Group 1 ID" ) + Row7:Setup( "Generic" ) + Row7:SetValue( valz["Row7"] ) + Row7.DataChanged = function( _, val ) valz["Row7"] = val end + local Row8 = DProperties:CreateRow( "Nav Group Merging", "Group 2 ID" ) + Row8:Setup( "Generic" ) + Row8:SetValue( valz["Row8"] ) + Row8.DataChanged = function( _, val ) valz["Row8"] = val end + + local DermaButton = vgui.Create( "DButton" ) + DermaButton:SetParent( DermaPanel ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 10, 240 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + local function compileString(price, elec, flag, buyable, rebuyable, navgroup1, navgroup2) + local str = "price="..price..",elec="..elec + if flag != false then + str = str..",link="..flag + end + str = str..",buyable="..buyable + str = str..",rebuyable="..rebuyable + if navgroup1 and navgroup1 != "" then + str = str..",navgroup1="..navgroup1 + end + if navgroup2 and navgroup2 != "" then + str = str..",navgroup2="..navgroup2 + 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, valz["Row5"], valz["Row6"], valz["Row7"], valz["Row8"]) + 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/gamemodes/nzombies3/gamemode/interfaces/sh_int_perkmachine.lua similarity index 100% rename from nzombies3/gamemode/interfaces/sh_int_perkmachine.lua rename to gamemodes/nzombies3/gamemode/interfaces/sh_int_perkmachine.lua diff --git a/gamemodes/nzombies3/gamemode/interfaces/sh_int_player_handler.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_player_handler.lua new file mode 100644 index 00000000..250bf290 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_player_handler.lua @@ -0,0 +1,92 @@ +// + +if SERVER then + function nz.Interfaces.Functions.PlayerHandlerHandler( ply, data ) + if ply:IsSuperAdmin() then + nzMapping:PlayerHandler(data.vec, data.ang, data.startwep, data.startpoints, data.numweps, data.eeurl, data.keep, ply) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.PlayerHandler( data ) + + local valz = {} + valz["Row1"] = "weapon_class" + valz["Row2"] = 500 + valz["Row3"] = 2 + valz["Row4"] = "URL" + + //If we already have on and we reload on it + if data.keep and IsValid(ents.FindByClass("player_handler")[1]) then + local phandler = ents.FindByClass("player_handler")[1] + valz["Row1"] = phandler:GetStartWep() + valz["Row2"] = phandler:GetStartPoints() + valz["Row3"] = phandler:GetNumWeps() + valz["Row4"] = phandler:GetEEURL() + end + + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 180 ) + DermaPanel:SetTitle( "Player Handler" ) + 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", "Starting Weapon" ) + Row1:Setup( "Combo" ) + for k,v in pairs(weapons.GetList()) do + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.PrintName or v.ClassName, v.ClassName, false) + end + + if data.keep and IsValid(ents.FindByClass("player_handler")[1]) then + local wep = weapons.Get(ents.FindByClass("player_handler")[1]:GetStartWep()) + Row1:AddChoice(wep.PrintName and wep.PrintName != "" and wep.PrintName or wep.ClassName, wep.ClassName, true) + end + + Row1.DataChanged = function( _, val ) valz["Row1"] = val end + + local Row2 = DProperties:CreateRow( "Weapon Settings", "Starting Points" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val end + + local Row3 = DProperties:CreateRow( "Weapon Settings", "Max Weapons" ) + Row3:Setup( "Integer" ) + Row3:SetValue( valz["Row3"] ) + Row3.DataChanged = function( _, val ) valz["Row3"] = val end + + local Row4 = DProperties:CreateRow( "Weapon Settings", "Easter Egg Song URL" ) + Row4:Setup( "Generic" ) + 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() + + //Check the weapon class is fine first + if weapons.Get( valz["Row1"] ) != nil then + data.startwep = valz["Row1"] + data.startpoints = valz["Row2"] + data.numweps = valz["Row3"] + data.eeurl = valz["Row4"] + PrintTable(data) + nz.Interfaces.Functions.SendRequests( "PlayerHandler", data ) + + DermaPanel:Close() + end + + end + end +end diff --git a/gamemodes/nzombies3/gamemode/interfaces/sh_int_rbox_handler.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_rbox_handler.lua new file mode 100644 index 00000000..720a00e0 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_rbox_handler.lua @@ -0,0 +1,77 @@ +// + +if SERVER then + function nz.Interfaces.Functions.RBoxHandlerHandler( ply, data ) + if ply:IsSuperAdmin() then + nzMapping:RBoxHandler(data.vec, data.classes, data.ang, data.keep, ply) + end + end +end + +if CLIENT then + + //Create the Panel so we can reopen it + function nz.Interfaces.Functions.CreateRBoxHandlerPanel() + local wepz = {} + + local DermaPanel = vgui.Create( "DFrame" ) + DermaPanel:SetPos( 100, 100 ) + DermaPanel:SetSize( 300, 350 ) + DermaPanel:SetTitle( "Handle Random Box Weapons" ) + DermaPanel:SetVisible( false ) + DermaPanel:SetDraggable( true ) + DermaPanel:ShowCloseButton( true ) + DermaPanel:SetDeleteOnClose(false) + + local DProperties = vgui.Create( "DProperties", DermaPanel ) + DProperties:SetSize( 280, 280 ) + DProperties:SetPos( 10, 30 ) + + for k,v in pairs(weapons.GetList()) do + local Row = DProperties:CreateRow( "Weapon Settings", "Weapon #"..k ) + Row:Setup( "Combo" ) + Row:AddChoice(" Select ...", nil) + for k,v in pairs(weapons.GetList()) do + Row:AddChoice(v.PrintName and v.PrintName != "" and v.PrintName or v.ClassName, v.ClassName, false) + end + + Row.DataChanged = function( _, val ) + wepz[k] = val + PrintTable(wepz) + end + end + + return DermaPanel, wepz + end + + //Reloading on a handler doesn't actually load its data - it just reopens the last panel + local DermaPanel, wepz = nz.Interfaces.Functions.CreateRBoxHandlerPanel() + + function nz.Interfaces.Functions.RBoxHandler( data ) + + //Recreate the list if Reload was not fired on the handler + if !data.keep then + DermaPanel, wepz = nz.Interfaces.Functions.CreateRBoxHandlerPanel() + end + + DermaPanel:SetVisible(true) + DermaPanel:MakePopup() + DermaPanel:Center() + + local DermaButton = vgui.Create( "DButton" ) + DermaButton:SetParent( DermaPanel ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 10, 315 ) + DermaButton:SetSize( 280, 30 ) + DermaButton.DoClick = function() + + data.classes = wepz + --data.keep = data.keep + PrintTable(data) + nz.Interfaces.Functions.SendRequests( "RBoxHandler", data ) + + DermaPanel:Hide() + + end + end +end diff --git a/gamemodes/nzombies3/gamemode/interfaces/sh_int_weps.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_weps.lua new file mode 100644 index 00000000..17cf892c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_weps.lua @@ -0,0 +1,78 @@ +// + +if SERVER then + function nz.Interfaces.Functions.WepBuyHandler( ply, data ) + if ply:IsSuperAdmin() then + data.ent = data.ent or NULL + nzMapping:WallBuy(data.vec, data.class, tonumber(data.price), data.ang, data.ent, ply) + end + end +end + +if CLIENT then + function nz.Interfaces.Functions.WepBuy( data ) + + local valz = {} + valz["Row1"] = "weapon_class" + valz["Row2"] = 500 + + if data.ent then + valz["Row1"] = data.ent:GetWepClass() + valz["Row2"] = data.ent:GetPrice() + end + + 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 Row1 = DProperties:CreateRow( "Weapon Settings", "Weapon Class" ) + Row1:Setup( "Combo" ) + for k,v in pairs(weapons.GetList()) do + if v.Category and v.Category != "" then + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.Category.. " - "..v.PrintName or v.ClassName, v.ClassName, false) + else + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.PrintName or v.ClassName, v.ClassName, false) + end + end + 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/gamemodes/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua new file mode 100644 index 00000000..d07b3976 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua @@ -0,0 +1,90 @@ +// + +if SERVER then + function nz.Interfaces.Functions.ZombLinkHandler( ply, data ) + if ply:IsSuperAdmin() then + PrintTable(data) + data.ent.link = data.link + data.ent.respawnable = data.respawnable + data.ent.spawnable = data.spawnable + //For the link displayer + if data.link then + data.ent:SetLink(data.link) + end + 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 + valz["Row3"] = 1 + valz["Row4"] = 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 + if data.spawnable != 1 or data.respawnable != 1 then + valz["Row3"] = data.spawnable + valz["Row4"] = data.respawnable + 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 Row3 = DProperties:CreateRow( "Zombie Spawn", "Spawnable at?" ) + Row3:Setup( "Boolean" ) + Row3:SetValue( valz["Row3"] ) + Row3.DataChanged = function( _, val ) valz["Row3"] = val end + local Row4 = DProperties:CreateRow( "Zombie Spawn", "Respawn from?" ) + 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 str="nil" + if valz["Row1"] == 0 then + str=nil + else + str=valz["Row2"] + end + data.link = str + data.spawnable = valz["Row3"] + data.respawnable = valz["Row4"] + nz.Interfaces.Functions.SendRequests( "ZombLink", data ) + + DermaPanel:Close() + end + end +end diff --git a/nzombies3/gamemode/interfaces/sh_sync.lua b/gamemodes/nzombies3/gamemode/interfaces/sh_sync.lua similarity index 100% rename from nzombies3/gamemode/interfaces/sh_sync.lua rename to gamemodes/nzombies3/gamemode/interfaces/sh_sync.lua diff --git a/gamemodes/nzombies3/gamemode/itemcarrying/cl_hud.lua b/gamemodes/nzombies3/gamemode/itemcarrying/cl_hud.lua new file mode 100644 index 00000000..1fc4894a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/itemcarrying/cl_hud.lua @@ -0,0 +1,39 @@ +local function DrawItemCarryHud() + + local scale = (ScrW()/1920 + 1)/2 + local ply = LocalPlayer() + surface.SetDrawColor(255,255,255) + local num = 0 + for k,v in pairs(ply:GetCarryItems()) do + local item = nzItemCarry.Items[v] + if item and item.icon then + surface.SetMaterial(item.icon) + surface.DrawTexturedRect(ScrW() - 400*scale - num*32*scale, ScrH() - 90*scale, 30*scale, 30*scale) + num = num + 1 + end + end + --[[local num = LocalPlayer():GetAmmoCount("nz_grenade") + local numspecial = LocalPlayer():GetAmmoCount("nz_specialgrenade") + local scale = (ScrW()/1920 + 1)/2 + + --print(num) + if num > 0 then + surface.SetMaterial(grenade_icon) + surface.SetDrawColor(255,255,255) + for i = num, 1, -1 do + --print(i) + surface.DrawTexturedRect(ScrW() - 250*scale - i*10*scale, ScrH() - 90*scale, 30*scale, 30*scale) + end + end + if numspecial > 0 then + surface.SetMaterial(grenade_icon) + surface.SetDrawColor(255,100,100) + for i = numspecial, 1, -1 do + --print(i) + surface.DrawTexturedRect(ScrW() - 300*scale - i*10*scale, ScrH() - 90*scale, 30*scale, 30*scale) + end + end + --surface.DrawTexturedRect(ScrW()/2, ScrH()/2, 100, 100)]] +end + +hook.Add("HUDPaint", "itemcarryHUD", DrawItemCarryHud ) diff --git a/gamemodes/nzombies3/gamemode/itemcarrying/sh_constructor.lua b/gamemodes/nzombies3/gamemode/itemcarrying/sh_constructor.lua new file mode 100644 index 00000000..98fae692 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/itemcarrying/sh_constructor.lua @@ -0,0 +1,107 @@ +//Main Tables +nzItemCarry = nzItemCarry or {} +nzItemCarry.Items = nzItemCarry.Items or {} +nzItemCarry.Players = nzItemCarry.Players or {} + +if SERVER then + local baseitem = { + id = nil, + items = {}, + text = nil, -- Nil makes default texts + hastext = nil, + icon = "", + shared = false, + dropondowned = true, + dropfunction = function(self, ply) + --if ply:IsCarryingItem( + end, + resetfunction = function() end, + condition = function(self, ply) + return true + end, + pickupfunction = function(self, ply, ent) + ply:GiveCarryItem(self.id) + ent:Remove() + end, + } + + -- Functions to call during runtime + local nzItemMeta = { + -- Adds an entity so it can be picked up + RegisterEntity = function(self, ent) + if !table.HasValue(self.items, ent) then + -- First check if it already belongs somewhere + local id = ent:GetNWString("NZItemCategory") + if id != "" then + local item = nzItemCarry.Items[id] + -- If so, remove it from there + if item and item.items and table.HasValue(item.items, ent) then + table.RemoveByValue(item.items, ent) + end + end + -- Now add it to the new category + ent:SetNWString("NZItemCategory", self.id) + table.insert(self.items, ent) + end + end, + -- Sets the text displayed when looking at an entity with this + SetText = function(self, text) + self.text = text + end, + -- Sets the text to be displayed when looking at it while you already have it + SetHasText = function(self, text) + self.hastext = text + end, + -- Sets the icon displayed on the HUD and scoreboard + SetIcon = function(self, iconpath) + self.icon = iconpath + end, + -- Sets whether all players "has" the item when it is picked up + SetShared = function(self, bool) + self.shared = bool + end, + -- Sets whether to run the Drop Function when a player is downed with the item + SetDropOnDowned = function(self, bool) + self.dropondowned = bool + end, + -- Sets the function to run when downed; has 1 argument: The player getting downed + SetDropFunction = function(self, func) + self.dropfunction = func + end, + -- Sets the function to run to reset; happens when a player disconnects without Drop On Downed on or when self:Reset() is called + SetResetFunction = function(self, func) + self.resetfunction = func + end, + -- Sets the function to determine if a player can pick it up; return true to allow + -- It will always be blocked if the player is already carrying this category + SetCondition = function(self, func) + self.condition = func + end, + -- Sets the function to be run when picked up; has 2 arguments: The player picking it up, the entity being used + SetPickupFunction = function(self, func) + self.pickupfunction = func + end, + -- Sets the function to reset the item(s). Typically used to respawn them back at the original spot + Reset = function(self) + self:resetfunction() + end, + -- Returns a table of all entities registered in this category + GetEntities = function(self) + return self.items + end, + -- Call this to send the info to clients; do this after all changes + Update = function(self) + nzItemCarry:SendObjectCreated(self.id) + end, + } + nzItemMeta.__index = nzItemMeta + + function nzItemCarry:CreateCategory(id) + local tbl = table.Copy(baseitem) + tbl.id = id + setmetatable(tbl, nzItemMeta) + self.Items[id] = tbl + + return self.Items[id] + end +end diff --git a/gamemodes/nzombies3/gamemode/itemcarrying/sh_meta.lua b/gamemodes/nzombies3/gamemode/itemcarrying/sh_meta.lua new file mode 100644 index 00000000..d40424c8 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/itemcarrying/sh_meta.lua @@ -0,0 +1,73 @@ +local playerMeta = FindMetaTable("Player") +if SERVER then + + function playerMeta:GiveCarryItem(id, alloverride) + if !nzItemCarry.Players[self] then nzItemCarry.Players[self] = {} end + if nzItemCarry.Items[id].shared and !alloverride then -- If shared, give to all players + for k,v in pairs(player.GetAllPlaying()) do + if !table.HasValue(nzItemCarry.Players[v], id) then + table.insert(nzItemCarry.Players[v], id) + end + end + nzItemCarry:SendPlayerItem() + else + if !table.HasValue(nzItemCarry.Players[self], id) then + table.insert(nzItemCarry.Players[self], id) + nzItemCarry:SendPlayerItem(self) + end + end + end + + function playerMeta:RemoveCarryItem(id, alloverride) + if !nzItemCarry.Players[self] then nzItemCarry.Players[self] = {} end + if nzItemCarry.Items[id].shared and !alloverride then -- If shared, remove from all players + for k,v in pairs(player.GetAllPlaying()) do + if table.HasValue(nzItemCarry.Players[v], id) then + table.RemoveByValue(nzItemCarry.Players[v], id) + end + end + nzItemCarry:SendPlayerItem() + else + if table.HasValue(nzItemCarry.Players[self], id) then + table.RemoveByValue(nzItemCarry.Players[self], id) + nzItemCarry:SendPlayerItem(self) + end + end + end + +end + +function playerMeta:HasCarryItem(id) + if !nzItemCarry.Players[self] then nzItemCarry.Players[self] = {} end + return table.HasValue(nzItemCarry.Players[self], id) +end + +function playerMeta:GetCarryItems() + if !nzItemCarry.Players[self] then nzItemCarry.Players[self] = {} end + return nzItemCarry.Players[self] +end + +-- On player downed +hook.Add("PlayerDowned", "nzDropCarryItems", function(ply) + for k,v in pairs(ply:GetCarryItems()) do + local item = nzItemCarry.Items[v] + if item.dropondowned and item.dropfunction then + item:dropfunction(ply) + ply:RemoveCarryItem(v) + end + end +end) + +-- Players disconnecting/dropping out need to reset the item so it isn't lost forever +hook.Add("OnPlayerDropOut", "nzResetCarryItems", function(ply) + for k,v in pairs(ply:GetCarryItems()) do + local item = nzItemCarry.Items[v] + if item.dropondowned and item.dropfunction then + item:dropfunction(ply) + else + item:resetfunction() + end + end + nzItemCarry.Players[ply] = nil + nzItemCarry:SendPlayerItem() -- No arguments for full sync, cleans the table of this disconnected player +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/itemcarrying/sh_sync.lua b/gamemodes/nzombies3/gamemode/itemcarrying/sh_sync.lua new file mode 100644 index 00000000..06262bb2 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/itemcarrying/sh_sync.lua @@ -0,0 +1,99 @@ +-- Client Server Syncing + +if SERVER then + + -- Server to client (Server) + util.AddNetworkString( "nzItemCarryUpdate" ) + util.AddNetworkString( "nzItemCarryPlayers" ) + util.AddNetworkString( "nzItemCarryPlayersFull" ) + util.AddNetworkString( "nzItemCarryClean" ) + + function nzItemCarry:SendObjectCreated(id, receiver) + if !id then return end + local data = nzItemCarry.Items[id] + local tbl = { + id = data.id, + text = data.text, + hastext = data.hastext, + icon = data.icon, + } + + net.Start( "nzItemCarryUpdate" ) + net.WriteString(id) + net.WriteTable(tbl) + return receiver and net.Send(receiver) or net.Broadcast() + end + + function nzItemCarry:SendPlayerItem(ply, receiver) + if IsValid(ply) then + local data = nzItemCarry.Players[ply] + net.Start( "nzItemCarryPlayers" ) + net.WriteEntity(ply) + net.WriteTable( data ) + return receiver and net.Send(receiver) or net.Broadcast() + else + local data = nzItemCarry.Players + net.Start( "nzItemCarryPlayersFull" ) + net.WriteTable( data ) + return receiver and net.Send(receiver) or net.Broadcast() + end + end + + function nzItemCarry:CleanUp() + nzItemCarry.Items = {} + nzItemCarry.Players = {} + + net.Start( "nzItemCarryClean" ) + net.Broadcast() + end + + FullSyncModules["ItemCarry"] = function(ply) + for k,v in pairs(nzItemCarry.Items) do + nzItemCarry:SendObjectCreated(k, ply) + end + nzItemCarry:SendPlayerItem(nil, ply) -- No specific target, all players + end + +end + +if CLIENT then + + -- Server to client (Client) + local function ReceiveItemObject( length ) + local id = net.ReadString() + local data = net.ReadTable() + + -- Precache the material here + print(data.icon) + if data.icon and data.icon != "" then data.icon = Material(data.icon) end + + nzItemCarry.Items[id] = data + PrintTable(nzItemCarry.Items[id]) + end + + local function ReceiveItemPlayer( length ) + local ply = net.ReadEntity() + local data = net.ReadTable() + + nzItemCarry.Players[ply] = data + PrintTable(nzItemCarry.Players[ply]) + end + + local function ReceiveItemPlayerFull( length ) + local data = net.ReadTable() + + nzItemCarry.Players = data + PrintTable(nzItemCarry.Players) + end + + local function ReceiveItemCleanup( length ) + nzItemCarry.Players = {} + nzItemCarry.Items = {} + end + + -- Receivers + net.Receive( "nzItemCarryUpdate", ReceiveItemObject ) + net.Receive( "nzItemCarryPlayers", ReceiveItemPlayer ) + net.Receive( "nzItemCarryPlayersFull", ReceiveItemPlayerFull ) + net.Receive( "nzItemCarryClean", ReceiveItemCleanup ) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/itemcarrying/sv_gameplay.lua b/gamemodes/nzombies3/gamemode/itemcarrying/sv_gameplay.lua new file mode 100644 index 00000000..46607541 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/itemcarrying/sv_gameplay.lua @@ -0,0 +1,31 @@ + +function nzItemCarry.OnPlayerPickItemUp( ply, ent ) + -- Downed players can't pick up anything! + if !ply:GetNotDowned() then return false end + + -- Players can't pick stuff up while using special weapons! (Perk bottles, knives, etc) + if IsValid(ply:GetActiveWeapon()) and ply:GetActiveWeapon():IsSpecial() then return false end + + -- Used in map scripting + if ent.OnUsed and type(ent.OnUsed) == "function" then + ent:OnUsed(ply) + end + + local category = ent:GetNWString("NZItemCategory") + if category != "" then + local item = nzItemCarry.Items[category] + if item.pickupfunction and item:condition(ply) then -- If it has a pickup function and it is allowed in this case + --print("allowed") + item:pickupfunction(ply, ent) + end + end +end +hook.Add( "PlayerUse", "nzPlayerPickupItems", nzItemCarry.OnPlayerPickItemUp ) + +function nzItemCarry.RemoveItemsOnRemoved( ent ) + local item = nzItemCarry.Items[ent:GetNWString("NZItemCategory")] + if item and item.items and table.HasValue(item.items, ent) then + table.RemoveByValue(item.items, ent) + end +end +hook.Add( "EntityRemoved", "nzItemCarryRemoveItems", nzItemCarry.RemoveItemsOnRemoved ) \ No newline at end of file diff --git a/nzombies3/gamemode/loader.lua b/gamemodes/nzombies3/gamemode/loader.lua similarity index 98% rename from nzombies3/gamemode/loader.lua rename to gamemodes/nzombies3/gamemode/loader.lua index ab2ad076..0ebef107 100644 --- a/nzombies3/gamemode/loader.lua +++ b/gamemodes/nzombies3/gamemode/loader.lua @@ -1,7 +1,7 @@ //Load all our files in to the respective realms //Main Tables -nz = {} +nz = nz or {} local gmfolder = "nzombies3" @@ -13,13 +13,13 @@ 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 @@ -39,29 +39,26 @@ function AutoInclude(name, dir) 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/gamemodes/nzombies3/gamemode/mainmenu/cl_cheats.lua b/gamemodes/nzombies3/gamemode/mainmenu/cl_cheats.lua new file mode 100644 index 00000000..f7ff6e5d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mainmenu/cl_cheats.lua @@ -0,0 +1,231 @@ +local CheatFrame = {} + +function CheatFrame:Init() + self:SetTitle("Cheats") + self:MakePopup(true) + self:SetSize( 524, 256 ) + self:SetPos( ScrW() / 2 - 256, ScrH() / 2 - 128 ) + self:SetVisible( true ) + + local list = vgui.Create("NZCheatList", self) + list:Dock(FILL) + list:SetSize(200,200) + list:AddCheat("Give Points", "/givepoints", "Player", "Number") + list:AddCheat("Give Weapon", "/giveweapon", "Player", "Weapon") + list:AddCheat("Give Perk", "/giveperk", "Player", "Perk") + list:AddCheat("Activate electricity", "/activateelec") + list:AddCheat("Revive", "/revive", "Player") + list:AddCheat("Target Priority", "/targetpriority", "PlayerEntity", "Priority") +end + +vgui.Register( "NZCheatFrame", CheatFrame, "DFrame") + + + +local CheatList = {} + +function CheatList:AddCheat(label, command, input1, input2, input3) + local panel = vgui.Create("DPanel", self) + panel.Paint = function() return end + local cheatLabel = vgui.Create("DLabel", panel) + cheatLabel:SetWide(128) + cheatLabel:SetText(label) + + if input1 then + + input1 = vgui.Create("NZCheatInput" .. input1, panel) + input1:SetPos(128,0) + + if input2 then + + input2 = vgui.Create("NZCheatInput" .. input2, panel) + input2:SetPos(256,0) + + end + + end + + local cheatSubmit = vgui.Create("DButton", panel) + cheatSubmit:SetSize(128, 24) + cheatSubmit:SetPos(384,0) + cheatSubmit:SetText("Submit") + --[[function cheatSubmit:Think() + if input1 and input1:GetCheatData() and input1:GetCheatData() != "" then + if input2 and input2:GetCheatData() and input2:GetCheatData() != "" then + cheatSubmit:SetConsoleCommand("say", command .. " " .. input1:GetCheatData() .. " " .. input2:GetCheatData()) + else + cheatSubmit:SetConsoleCommand( "say", command .. " " .. input1:GetCheatData() ) + end + else + cheatSubmit:SetConsoleCommand("say", command) + end + end]] + cheatSubmit.DoClick = function() + if input1 and input1:GetCheatData() and input1:GetCheatData() != "" then + if input2 and input2:GetCheatData() and input2:GetCheatData() != "" then + RunConsoleCommand("say", command .. " " .. input1:GetCheatData() .. " " .. input2:GetCheatData()) + else + RunConsoleCommand( "say", command .. " " .. input1:GetCheatData() ) + end + else + RunConsoleCommand("say", command) + end + end + + self:Add(panel) +end + +function CheatList:Paint() + return +end + +vgui.Register( "NZCheatList", CheatList, "DListLayout") + + + +local CheatInputPlayer = {} + +AccessorFunc(CheatInputPlayer, "sCheatData", "CheatData", FORCE_STRING) + +function CheatInputPlayer:Init() + self:SetValue("Player") + self:SetWide(128) + self:SetTall(24) + for _,ply in pairs(player.GetAll()) do + self:AddChoice(ply:Nick()) + end +end + +function CheatInputPlayer:OnSelect(index, value, data) + self:SetCheatData(value) +end + +vgui.Register("NZCheatInputPlayer", CheatInputPlayer, "DComboBox") + + + +local CheatInputNumber = {} + +AccessorFunc(CheatInputNumber, "fCheatData", "CheatData", FORCE_STRING) + +function CheatInputNumber:Init() + self:SetText("Number") + self:SetEditable(true) + self:SetWide(128) + self:SetTall(24) +end + +function CheatInputNumber:Think() + self:SetCheatData(self:GetText()) +end + +vgui.Register("NZCheatInputNumber", CheatInputNumber, "DTextEntry") + + + +local CheatInputText = {} + +AccessorFunc(CheatInputText, "sCheatData", "CheatData", FORCE_STRING) + +function CheatInputText:Init() + self:SetText("Text") + self:SetEditable(true) + self:SetWide(128) + self:SetTall(24) +end + +function CheatInputText:Think() + self:SetCheatData(self:GetText()) +end + +vgui.Register("NZCheatInputText", CheatInputText, "DTextEntry") + + + +local CheatInputWeapon = {} + +AccessorFunc(CheatInputWeapon, "sCheatData", "CheatData", FORCE_STRING) + +function CheatInputWeapon:Init() + self:SetValue("Weapon") + self:SetWide(128) + self:SetTall(24) + for _,wep in pairs(weapons.GetList()) do + self:AddChoice(wep.ClassName) + end +end + +function CheatInputWeapon:OnSelect(index, value, data) + self:SetCheatData(value) +end + +vgui.Register("NZCheatInputWeapon", CheatInputWeapon, "DComboBox") + + + +local CheatInputPerk = {} + +AccessorFunc(CheatInputPerk, "iCheatData", "CheatData", FORCE_STRING) + +function CheatInputPerk:Init() + self:SetValue("Perk") + self:SetWide(128) + self:SetTall(24) + for id, perk in pairs(nz.Perks.Data) do + self:AddChoice(perk.name, id) + end +end + +function CheatInputPerk:OnSelect(index, value, data) + self:SetCheatData(data) +end + +vgui.Register("NZCheatInputPerk", CheatInputPerk, "DComboBox") + +local CheatInputPriority = {} + +AccessorFunc(CheatInputPriority, "iCheatData", "CheatData", FORCE_STRING) + +function CheatInputPriority:Init() + self:SetValue("Target") + self:SetWide(128) + self:SetTall(24) + + self:AddChoice("None (0)", "0") + self:AddChoice("Player (1)", "1") + self:AddChoice("Special (2)", "2") + self:AddChoice("Max (3)", "3") + self:AddChoice("Always (10)", "10") +end + +function CheatInputPriority:OnSelect(index, value, data) + self:SetCheatData(data) +end + +vgui.Register("NZCheatInputPriority", CheatInputPriority, "DComboBox") + + +local CheatInputPlayerEntity = {} + +AccessorFunc(CheatInputPlayerEntity, "sCheatData", "CheatData", FORCE_STRING) + +function CheatInputPlayerEntity:Init() + self:SetValue("Entity") + self:SetWide(128) + self:SetTall(24) + for _,ply in pairs(player.GetAll()) do + self:AddChoice(ply:Nick()) + end + local ent = LocalPlayer():GetEyeTrace().Entity + if IsValid(ent) then + self:AddChoice("Entity ["..ent:EntIndex().."] ["..ent:GetClass().."]", "entity("..ent:EntIndex()..")") + else + self:AddChoice("Look at an entity to target that.", "") + end +end + +function CheatInputPlayerEntity:OnSelect(index, value, data) + self:SetCheatData(data or value) +end + +vgui.Register("NZCheatInputPlayerEntity", CheatInputPlayerEntity, "DComboBox") diff --git a/gamemodes/nzombies3/gamemode/mainmenu/cl_player.lua b/gamemodes/nzombies3/gamemode/mainmenu/cl_player.lua new file mode 100644 index 00000000..9b86d892 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mainmenu/cl_player.lua @@ -0,0 +1,5 @@ +local plyMeta = FindMetaTable("Player") + +function plyMeta:IsNZMenuOpen() + return IsValid(g_Settings) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/mainmenu/cl_vgui.lua b/gamemodes/nzombies3/gamemode/mainmenu/cl_vgui.lua new file mode 100644 index 00000000..8a857cb9 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mainmenu/cl_vgui.lua @@ -0,0 +1,397 @@ +surface.CreateFont( "pier_large", { + font = "PierSans-Regular", + size = 48, + antialias = true, +} ) + +surface.CreateFont( "pier_medium", { + font = "PierSans-Regular", + size = 24, + antialias = true, +} ) + +surface.CreateFont( "pier_small", { + font = "PierSans-Regular", + size = 16, + antialias = true, +} ) + +local MenuFrame = {} + +AccessorFunc( MenuFrame, "fLastSpawnSwitch", "LastSpawnSwitch", FORCE_NUMBER ) + +function MenuFrame:Init() + self:SetSize(ScrW(), ScrH()) + self:SetPos( 0, 0 ) + gui.EnableScreenClicker( true ) + + self.ToolBar = vgui.Create( "NZMainMenuToolBar", self ) + self.Content = vgui.Create( "NZMainMenuContent", self ) + self.PlayerList = vgui.Create( "NZMainMenuPlayerList", self ) + + self.CameraPos = LocalPlayer():GetPos() + Vector( 30, 30, 30 ) + self:SetLastSpawnSwitch( CurTime() ) + +end + +function MenuFrame:Think() + local ply = LocalPlayer() + if ply:Alive() then return end + if self:GetLastSpawnSwitch() + 15 < CurTime() then + local sPoints = ents.FindByClass( "player_spawns" ) + if sPoints then + local sPoint = sPoints[ math.random( #sPoints ) ] + if IsValid( sPoint ) then + ply:SetPos( sPoint:GetPos() ) + self.CameraPos = LocalPlayer():GetPos() + Vector( 20, 20, 40 ) + self:SetLastSpawnSwitch( CurTime() ) + end + end + end + local vec1 = self.CameraPos + local vec2 = ply:GetPos() + Vector( 0, 0, 20 ) + local ang = ( vec2 - vec1 ):Angle() + ang:RotateAroundAxis( Vector( 0, 0, 1), math.sin( CurTime()/20 ) * 360 ) + ply:SetEyeAngles( ang ) +end + +function MenuFrame:Paint() + --Derma_DrawBackgroundBlur( self, self.startTime ) + return +end + +--It's not actually a frame but whatever +vgui.Register( "NZMainMenuFrame", MenuFrame, "DPanel") + + +local MenuToolBar = {} + +function MenuToolBar:Init() + self:SetSize( ScrW(), 80 ) + self:SetPos( 0, 0 ) + + self.Logo = vgui.Create( "DLabel", self ) + self.Logo:SetPos( 14, 14 ) + self.Logo:SetFont( "nz.display.hud.main" ) + self.Logo:SetColor( Color( 255, 255, 255 ) ) + self.Logo:SetText( "NZombies" ) + self.Logo:SizeToContents() + + self.Entries = {} + + local ready = self:AddEntry( "READY", "large", "say", "/ready" ) + function ready:Think() + if nzRound:InProgress() then + if LocalPlayer():Alive() then + self:SetText( "DROPOUT" ) + self:SetConsoleCommand( "say", "/dropout" ) + else + self:SetText( "DROPIN" ) + self:SetConsoleCommand( "say", "/dropin" ) + end + else + if LocalPlayer():IsReady() then + self:SetText( "UNREADY" ) + else + self:SetText( "READY" ) + end + self.DoClick = function() + if LocalPlayer():IsReady() then + RunConsoleCommand( "say", "/unready" ) + else + RunConsoleCommand( "say", "/ready" ) + end + --RunConsoleCommand( "nz_settings" ) + end + end + end + + local spectate = self:AddEntry( "SPECTATE", "medium", "say", "/spectate" ) + + self:AddEntry( "WORKSHOP PAGE", "medium", function() gui.OpenURL( "http://steamcommunity.com" ) end ) + + --Settings Button / Close button + if LocalPlayer():IsSuperAdmin() then + self.SettingsButton = vgui.Create( "DImageButton", self ) + self.SettingsButton:SetImage( "icon_settings.png" ) + self.SettingsButton:SetPos( ScrW() - 60, 20 ) + self.SettingsButton:SetSize( 40, 40 ) + self.SettingsButton:SetContentAlignment( 5 ) + function self.SettingsButton:Paint( w, h ) + + end + + AccessorFunc( self.SettingsButton, "bSettingsMenuOpen", "SettingsMenuOpen", FORCE_BOOL ) + + function self.SettingsButton:DoClick() + if !self:GetSettingsMenuOpen() then + self.SettingsMenu = vgui.Create( "NZMainMenuSettingsPanel", self:GetParent():GetParent() ) --Parent to mainframe + self:SetSettingsMenuOpen( true ) + self:SetColor( Color( 85, 85, 85, 255 ) ) + else + self.SettingsMenu:Remove() + self:SetSettingsMenuOpen( false ) + self:SetColor( Color( 255, 255, 255, 255 ) ) + end + end + + else + --Show close icon if user not superadmin + self.CloseButton = vgui.Create( "DImageButton", self ) + self.CloseButton:SetImage( "icon_close.png" ) + self.CloseButton:SetPos( ScrW() - 60, 20 ) + self.CloseButton:SetSize( 40, 40 ) + self.CloseButton:SetContentAlignment( 5 ) + self.CloseButton:SetConsoleCommand( "nz_settings" ) + function self.CloseButton:Paint( w, h ) + + end + end + +end + +function MenuToolBar:Paint( w, h ) + draw.RoundedBox( 0, 0, 0, w, h, Color( 130, 45, 45, 255 ) ) + --draw.RoundedBox( 0, 0, h-5, w, 5, Color( 255, 255, 255, 255 ) ) +end + +--[[function MenuToolBar:Think() + local nextPos = 320 + local temp = self.Entries + for i = #self.Entries, 1, -1 do + self.Entries[i]:SizeToContentsX() + for j = #self.Entries, i, -1 do + if i == j then break end + nextPos = nextPos + self.Entries[j]:GetWide() + 30 + end + self.Entries[i]:SetPos( nextPos, 20 ) + nextPos = 320 + end +end]] + +function MenuToolBar:AddEntry( lbl, fontSize, cmd, args ) + local entry = vgui.Create( "NZMainMenuToolBarEntry", self ) + if fontSize == "large" then + entry:SetFont( "pier_large" ) + elseif fontSize == "medium" then + entry:SetFont( "pier_medium" ) + else + entry:SetFont( "pier_small" ) + end + local nextPos = 300 + for _, v in pairs( self.Entries ) do + nextPos = nextPos + v:GetWide() + 30 + end + entry:SetPos( nextPos, 0 ) + entry:SetTall( self:GetTall() ) + if isfunction( cmd ) then + entry.DoClick = cmd + elseif isstring( cmd ) then + entry:SetConsoleCommand( cmd, args ) + end + entry:SetText( lbl ) + entry:SetContentAlignment( 5 ) + --entry:SizeToContentsX() + + table.insert( self.Entries, 1, entry ) + + return self.Entries[ 1 ] +end + +vgui.Register( "NZMainMenuToolBar", MenuToolBar, "DPanel") + + +local MenuToolBarEntry = {} + +function MenuToolBarEntry:Init() + self:SetSize( 260, 60 ) + self:SetFont( "pier_large" ) + self:SetContentAlignment( 5 ) + self:SetTextColor( Color( 255, 255, 255 ) ) +end + +function MenuToolBarEntry:Paint() + +end + +vgui.Register( "NZMainMenuToolBarEntry", MenuToolBarEntry, "DButton") + + +local MenuSettingsPanel = {} + +function MenuSettingsPanel:Init() + self:SetPos( ScrW() - 256, 80 ) + self:SetSize( 256, 256) + self.List = vgui.Create( "NZMainMenuSettingsList", self ) +end + +function MenuSettingsPanel:Paint( w, h ) + draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255, 255 ) ) +end + +vgui.Register( "NZMainMenuSettingsPanel", MenuSettingsPanel, "DScrollPanel" ) + +local MenuSettingsList = {} + +function MenuSettingsList:Init() + self:SetWide( 256 ) + local btnMode = self:AddButton( "Creative Mode", function() RunConsoleCommand( "say", "/create" ) RunConsoleCommand( "nz_settings" ) end ) + function btnMode:Think() + if player_manager.GetPlayerClass( LocalPlayer() ) == "player_create" then + self:SetText( "Return to Survival Mode") + else + self:SetText( "Creative Mode") + end + end + self:AddButton( "Load Map config", "say", "/load" ) + self:AddButton( "Save Map config", "say", "/save" ) + self:AddButton( "Generate Navmesh", "say", "/generate" ) + self:AddButton( "Cheats (Beta)", "say", "/cheats" ) +end + +function MenuSettingsList:AddButton( lbl, cmd, args ) + local button = vgui.Create( "DButton", self ) + if isfunction( cmd ) then + button.DoClick = cmd + elseif isstring( cmd ) then + button:SetConsoleCommand( cmd, args ) + end + button:SetText( lbl ) + button:SetFont( "pier_small" ) + button:SetTall( 42 ) + + function button:Paint( w, h ) + + end + + return self:Add( button ) +end + +vgui.Register( "NZMainMenuSettingsList", MenuSettingsList, "DListLayout" ) + + +local MenuContent = {} + +function MenuContent:Init() + self.Layouts = {} + self.ActiveLayout = "main" + self:SetSize(ScrW(), ScrH() - 80 ) + self:SetPos( 0, 80 ) + + --Main Page of the menu + local mainLayout = vgui.Create( "NZMainMenuContentLayout" ) + + self:AddLayout( "main", mainLayout ) + + --Set Active page to main on Init + self:SetActiveLayout( "main" ) + +end + +function MenuContent:SetActiveLayout( name ) + self:GetActiveLayout():SetVisible( false ) + self.ActiveLayout = name + self:GetActiveLayout():SetVisible( true ) +end + +function MenuContent:GetActiveLayout() + return self.Layouts[ self.ActiveLayout ] +end + +function MenuContent:Paint() + return +end + +function MenuContent:AddLayout( name, layout ) + layout:SetParent( self ) + self.Layouts[name] = layout +end + +vgui.Register( "NZMainMenuContent", MenuContent, "DPanel") + + +local MenuContentLayout = {} + +function MenuContentLayout:Init() + self.Panels = {} + self:SetSize( 768, 512 ) + self:SetPos( ScrW() / 2 - 384, ScrH() / 2 - 320 ) + self:SetVisible( false ) +end + +function MenuContentLayout:GetPanels() + return self.Panels +end + +function MenuContentLayout:Paint() + return +end + +function MenuContentLayout:AddPanel( pnl, startGridX, startGridY, gridSizeX, gridSizeY ) + local gridSize = 128 + pnl:SetParent( self ) + pnl:SetPos( gridSize * ( startGridX - 1 ), gridSize * (startGridY - 1) ) + pnl:SetSize( gridSize * gridSizeX, gridSize * gridSizeY ) + table.insert( self.Panels, pnl ) +end + +vgui.Register( "NZMainMenuContentLayout", MenuContentLayout, "DPanel") + +local PlayerList = {} + +function PlayerList:Init() + self:SetPos(100, 200) + self:SetSize(500, 800) +end + +local bloodline_points = Material("bloodline_score.png", "unlitgeneric smooth") +function PlayerList:Paint(w, h) + local c = 0 + local n = #player.GetAllReady() + for _,ply in pairs( player.GetAll() ) do + if IsValid(ply) then + local text = "" + surface.SetMaterial(bloodline_points) + surface.SetDrawColor(200,0,0) + surface.DrawTexturedRect(0, h / 2 - n * 17.5 + 35 * c, 300, 40) + if ply:IsReady() then text = "Ready" else + if nzRound:InState(ROUND_CREATE) and ply:Alive() then + text = "In Creative" + else + text = "Not ready" + end + end + draw.SimpleText(ply:Nick() .. " - " .. text, "nz.display.hud.small", 25, h / 2 - n * 17.5 + 35 * c + 15, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) + c = c + 1 + end + end + return +end + +vgui.Register( "NZMainMenuPlayerList", PlayerList, "DPanel") + + +local function showSettings(ply, cmd, args) + if ( !IsValid( g_Settings ) ) then + g_Settings = vgui.Create("NZMainMenuFrame") + g_Settings:SetVisible(false) -- use the visible bool as toggle indicator TODO: this is bullshit since we are removing the menu anyways + end + + if ( IsValid( g_Settings ) ) then + if g_Settings:IsVisible() then + g_Settings:Hide() + gui.EnableScreenClicker( false ) + g_Settings:SetVisible(false) + g_Settings:Remove() + else + g_Settings:Show() + gui.EnableScreenClicker( true ) + g_Settings:SetVisible(true) + end + end +end +concommand.Add("nz_settings", showSettings) + +hook.Add("InitPostEntity", "AutoOpenMenu", function() + LocalPlayer():ConCommand("nz_settings") +end) diff --git a/gamemodes/nzombies3/gamemode/mainmenu/sv_controls.lua b/gamemodes/nzombies3/gamemode/mainmenu/sv_controls.lua new file mode 100644 index 00000000..3c4157f9 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mainmenu/sv_controls.lua @@ -0,0 +1,5 @@ +function GM:ShowHelp( ply ) + if IsValid( ply ) then + ply:ConCommand("nz_settings") + end +end diff --git a/gamemodes/nzombies3/gamemode/mapping/sh_constructor.lua b/gamemodes/nzombies3/gamemode/mapping/sh_constructor.lua new file mode 100644 index 00000000..a40615da --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sh_constructor.lua @@ -0,0 +1,7 @@ +-- Setup round module +nzMapping = nzMapping or {} + +-- Variables +nzMapping.Settings = nzMapping.Settings or {} +nzMapping.MarkedProps = nzMapping.MarkedProps or {} +nzMapping.ScriptHooks = nzMapping.ScriptHooks or {} diff --git a/gamemodes/nzombies3/gamemode/mapping/sh_mapscripthandler.lua b/gamemodes/nzombies3/gamemode/mapping/sh_mapscripthandler.lua new file mode 100644 index 00000000..cecc8f78 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sh_mapscripthandler.lua @@ -0,0 +1,129 @@ +if SERVER then + util.AddNetworkString("NZMapScript") + util.AddNetworkString("NZMapScriptUnload") + function nzMapping:LoadScript( name ) + + self:UnloadScript() -- For safety + + local filePath = "nzmapscripts/" .. string.StripExtension(name) .. ".lua" + + if !file.Exists( filePath, "LUA") then + PrintMessage(HUD_PRINTTALK, "Attempted to load non-existant map script: "..filePath) + return false + end + + self.ScriptHooks = include( filePath ) + self.ScriptPath = filePath + + + for k,v in pairs(self.ScriptHooks) do + if type(v) == "function" then + hook.Add(k, "nzmapscript"..k, v) + end + end + + if self.ScriptHooks.ClientSideSend then + AddCSLuaFile( filePath ) + timer.Simple(1, function() + net.Start("NZMapScript") + net.WriteString(filePath) + net.Broadcast() + end) + end + + --[[hook.Add("OnRoundInit", "nzmapscriptinit", hooks.RoundInit) + hook.Add("OnRoundStart", "nzmapscriptstart", hooks.RoundStart) + hook.Add("OnRoundThink", "nzmapscriptthink", hooks.RoundThink) + hook.Add("OnRoundEnd", "nzmapscriptend", hooks.RoundEnd)]] + + if self.ScriptHooks.ScriptLoad then + self.ScriptHooks.ScriptLoad() + end + + PrintMessage(HUD_PRINTTALK, "Successfully loaded map script: "..filePath) + return true + + end + + function nzMapping:UnloadScript() + if !self.ScriptHooks then return end + + for k,v in pairs(self.ScriptHooks) do + if type(v) == "function" then + hook.Remove(k, "nzmapscript"..k) + end + end + + if self.ScriptHooks.ClientSideSend then + net.Start("NZMapScriptUnload") + net.Broadcast() + end + + --[[hook.Remove("OnRoundInit", "nzmapscriptinit") + hook.Remove("OnRoundStart", "nzmapscriptstart") + hook.Remove("OnRoundThink", "nzmapscriptthink") + hook.Remove("OnRoundEnd", "nzmapscriptend")]] + + if self.ScriptHooks.ScriptUnload then + self.ScriptHooks.ScriptUnload() + end + + self.ScriptHooks = nil + + -- Clean up all items + nzItemCarry:CleanUp() + + end + + hook.Add("PlayerInitialSpawn", "SendMapScriptSpawn", function(ply) + if nzMapping.ScriptHooks and nzMapping.ScriptHooks.ClientSideSend then + timer.Simple(1, function() + net.Start("NZMapScript") + net.WriteString(nzMapping.ScriptPath) + net.Broadcast() + end) + end + end) +end + +if CLIENT then + + net.Receive("NZMapScript", function() + local path = net.ReadString() + print(path) + + if !file.Exists( path, "LUA") then return end + + nzMapping.ScriptHooks = include( path ) + + PrintTable(nzMapping.ScriptHooks) + + for k,v in pairs(nzMapping.ScriptHooks) do + if isfunction(v) then + hook.Add(k, "nzmapscript"..k, v) + end + end + + if nzMapping.ScriptHooks.ScriptLoad then + nzMapping.ScriptHooks.ScriptLoad() + end + end) + + net.Receive("NZMapScriptUnload", function() + if !nzMapping.ScriptHooks then return end + + for k,v in pairs(nzMapping.ScriptHooks) do + if isfunction(v) then + hook.Remove(k, "nzmapscript"..k) + end + end + + if nzMapping.ScriptHooks.ScriptUnload then + nzMapping.ScriptHooks.ScriptUnload() + end + + nzMapping.ScriptHooks = nil + nzMapping.ScriptPath = nil + end) + +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/mapping/sh_mismatch.lua b/gamemodes/nzombies3/gamemode/mapping/sh_mismatch.lua new file mode 100644 index 00000000..bb5dc06c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sh_mismatch.lua @@ -0,0 +1,529 @@ +nzMapping.Mismatch = nzMapping.Mismatch or {} +nzMapping.MismatchData = nzMapping.MismatchData or {} + +if SERVER then + util.AddNetworkString("nzMappingMismatchData") + util.AddNetworkString("nzMappingMismatchEnd") + + net.Receive("nzMappingMismatchData", function(len, ply) + if !ply:IsSuperAdmin() then + print(ply:Nick() .. " tried to correct map data. You need to be a super admin to do this.") + return + end + local id = net.ReadString() + local data = net.ReadTable() + nzMapping.Mismatch[id].Correct(data) + end) + +else + net.Receive("nzMappingMismatchData", function() + local id = net.ReadString() + local data = net.ReadTable() + nzMapping.MismatchData[id] = data + end) + + net.Receive("nzMappingMismatchEnd", function() + OpenMismatchInterface() + end) + + function OpenMismatchInterface() + local frame = vgui.Create("DFrame") + frame:SetSize(400, 500) + frame:Center() + frame:SetTitle("Config Loading Mismatch!") + frame:MakePopup() + + local sheet = vgui.Create("DPropertySheet", frame) + sheet:SetPos(5, 25) + sheet:SetSize(390, 435) + sheet.sheets = {} + + frame.OnClose = function() + local corrected = nil + for k,v in pairs(sheet.sheets) do + v.ReturnCorrectedData() + corrected = true + end + if corrected then + chat.AddText("Applied default actions on the rest of the mismatches, some entities may have disappeared.") + end + end + + for k,v in pairs(nzMapping.MismatchData) do + if table.Count(v) > 0 then + local panel = nzMapping.Mismatch[k].Interface(sheet) + local info = sheet:AddSheet(k, panel) + --table.insert(sheet.sheets, {tab = info.Tab, panel = info.Panel, name = tab.Name}) + sheet.sheets[info.Tab] = info.Panel + end + end + + sheet.CloseTabAndOpenNew = function(update) + local tab = sheet:GetActiveTab() + local panel = sheet.sheets[tab] + if update then + panel.ReturnCorrectedData() + end + + local newtab = table.GetKeys(sheet.sheets)[1] + if newtab == tab then newtab = table.GetKeys(sheet.sheets)[2] end + if !IsValid(newtab) then + sheet.sheets[tab] = nil + frame:Close() + chat.AddText("Remember to re-save the cleaned config if you don't want to go through this every time.") + return + end + sheet:SetActiveTab(newtab) + + timer.Simple(0.1, function() + if IsValid(tab) then + sheet.sheets[tab] = nil + sheet:CloseTab(tab) + end + end) + end + + local submit = vgui.Create("DButton", frame) + submit:SetText("Submit Changes") + submit:SetSize(200, 30) + submit:SetPos(90, 465) + submit:CenterHorizontal() + submit.DoClick = function() + sheet.CloseTabAndOpenNew(true) + end + end +end + +function CreateMismatchCheck(id, sv_check, cl_interface, sv_correct) + -- Create tables for storing it + nzMapping.Mismatch[id] = nzMapping.Mismatch[id] or {} + nzMapping.MismatchData[id] = nzMapping.MismatchData[id] or {} + + if SERVER then + nzMapping.Mismatch[id].Check = sv_check + nzMapping.Mismatch[id].Correct = sv_correct + else + nzMapping.Mismatch[id].Interface = cl_interface + end +end + +function nzMapping:CheckMismatch( loader ) + if !IsValid(loader) then return end + local faults = nil + + for k,v in pairs(self.Mismatch) do + local data = self.Mismatch[k].Check() -- Run the check function and save the data + if data and table.Count(data) > 0 then -- Empty tables don't get sent, no errors + net.Start("nzMappingMismatchData") + net.WriteString(k) + net.WriteTable(data) + net.Send(loader) + faults = true + end + end + + if faults then -- No need to send if there's nothing wrong + net.Start("nzMappingMismatchEnd") -- Mark the end of all data so the client can compile it all + net.Send(loader) + end +end + +CreateMismatchCheck("Wall Buys", function() + local tbl = {} + for k,v in pairs(ents.FindByClass("wall_buys")) do + if !weapons.Get(v:GetWepClass()) then + print("Wall Buy has non-existant weapon class: " .. v:GetWepClass() .. "!") + tbl[v:GetWepClass()] = true + end + end + + return tbl -- Return the data you want to send to the client + +end, function(frame) + + local pnl = vgui.Create("DPanel", frame) + pnl:SetPos(5, 5) + pnl:SetSize(380, 425) + + local properties = vgui.Create("DProperties", pnl) + properties:SetPos(0, 0) + properties:SetSize(380, 420) + + for k,v in pairs(nzMapping.MismatchData["Wall Buys"]) do + local choice = properties:CreateRow( "Missing Weapons", k ) + choice:Setup( "Combo", {} ) + choice:AddChoice( " Remove ...", "nz_removeweapon", true ) + nzMapping.MismatchData["Wall Buys"][k] = "nz_removeweapon" + for _, v2 in pairs(weapons.GetList()) do + if v2.Category and v2.Category != "" then + choice:AddChoice(v2.PrintName and v2.PrintName != "" and v2.Category.. " - "..v2.PrintName or v2.ClassName, v2.ClassName, false) + else + choice:AddChoice(v2.PrintName and v2.PrintName != "" and v2.PrintName or v2.ClassName, v2.ClassName, false) + end + end + choice.DataChanged = function(self, val) + nzMapping.MismatchData["Wall Buys"][k] = val + end + end + + pnl.ReturnCorrectedData = function() -- Add the function to the returned panel so we can access it outside + net.Start("nzMappingMismatchData") + net.WriteString("Wall Buys") + net.WriteTable(nzMapping.MismatchData["Wall Buys"]) + net.SendToServer() + nzMapping.MismatchData["Wall Buys"] = nil -- Clear the data + end + + return pnl -- Return it to add it the the sheets + +end, function( data ) + for k,v in pairs(ents.FindByClass("wall_buys")) do + local new = data[v:GetWepClass()] + if new then + if new == "nz_removeweapon" then + v:Remove() + else + v:GetWepClass(new) + end + end + end + + nzMapping.MismatchData["Wall Buys"] = nil -- Clear the data +end) + +CreateMismatchCheck("Perks", function() + local tbl = {} + for k,v in pairs(ents.FindByClass("perk_machine")) do + if !nz.Perks.Functions.Get(v:GetPerkID()) then + print("Perk with non-existant perk: " .. v:GetPerkID() .. "!") + tbl[v:GetPerkID()] = true + end + end + + return tbl -- Return the data you want to send to the client + +end, function(frame) + + local pnl = vgui.Create("DPanel", frame) + pnl:SetPos(5, 5) + pnl:SetSize(380, 425) + + local properties = vgui.Create("DProperties", pnl) + properties:SetPos(0, 0) + properties:SetSize(380, 420) + + for k,v in pairs(nzMapping.MismatchData["Perks"]) do + local choice = properties:CreateRow( "Invalid Perks", k ) + choice:Setup( "Combo", {} ) + choice:AddChoice( " Remove ...", "nz_removeperk", true ) + nzMapping.MismatchData["Perks"][k] = "nz_removeperk" + for k2, v2 in pairs(weapons.GetList()) do + choice:AddChoice(v2.name or k2, k2, false) + end + choice.DataChanged = function(self, val) + nzMapping.MismatchData["Petks"][k] = val + end + end + + pnl.ReturnCorrectedData = function() + net.Start("nzMappingMismatchData") + net.WriteString("Perks") + net.WriteTable(nzMapping.MismatchData["Perks"]) + net.SendToServer() + nzMapping.MismatchData["Perks"] = nil -- Clear the data + end + + return pnl + +end, function( data ) + for k,v in pairs(ents.FindByClass("perk_machine")) do + local new = data[v:GetPerkID()] + if new then + if new == "nz_removeperk" then + v:Remove() + else + v:SetPerkID(new) + v:Update() -- Update model and perk values + end + end + end + + nzMapping.MismatchData["Perks"] = nil -- Clear the data +end) + +CreateMismatchCheck("Map Settings", function() + local tbl = {} + local settings = nzMapping.Settings + + if !weapons.Get(settings.startwep) then tbl["startwep"] = settings.startwep end + -- Later add stuff like model packs, special round entity types etc. + + return tbl + + end, function(frame) + + local pnl = vgui.Create("DPanel", frame) + pnl:SetPos(5, 5) + pnl:SetSize(380, 425) + + local properties = vgui.Create("DProperties", pnl) + properties:SetPos(0, 0) + properties:SetSize(380, 420) + + local tbl = nzMapping.MismatchData["Map Settings"] + + if tbl.startwep then + local choice = properties:CreateRow( "Invalid Map Settings", "Start Weapon" ) + choice:Setup( "Combo", {} ) + for k,v2 in pairs(weapons.GetList()) do + choice:AddChoice(v2.PrintName and v2.PrintName != "" and v2.PrintName or v2.ClassName, v2.ClassName, false) + end + choice.DataChanged = function(self, val) + nzMapping.MismatchData["Map Settings"]["startwep"] = val + end + end + + pnl.ReturnCorrectedData = function() + net.Start("nzMappingMismatchData") + net.WriteString("Map Settings") + net.WriteTable(nzMapping.MismatchData["Map Settings"]) + net.SendToServer() + nzMapping.MismatchData["Map Settings"] = nil + end + + return pnl + + end, function( data ) + + if data.startwep then + nzMapping.Settings.startwep = data.startwep + end + + for k,v in pairs(player.GetAll()) do + nzMapping:SendMapData(ply) -- Update the data to players + end + + nzMapping.MismatchData["Map Settings"] = nil +end) + +CreateMismatchCheck("Map Script", function() + local tbl = {} + if tobool(nzMapping.Settings.script) then tbl["script"] = true end + --if true then tbl["script"] = true end + + return tbl + + end, function(frame) + + local pnl = vgui.Create("DPanel", frame) + pnl:SetPos(5, 5) + pnl:SetSize(380, 425) + + local txt = vgui.Create("DLabel", pnl) + txt:SetText("Map Script Load") + txt:SetFont("DermaLarge") + txt:SetTextColor(Color(75,75,75)) + txt:SizeToContents() + txt:SetPos(0, 30) + txt:CenterHorizontal() + + local txt2 = vgui.Create("DLabel", pnl) + txt2:SetText("This config is attempting to load a lua script along with it.") + txt2:SetTextColor(Color(75,75,75)) + txt2:SetFont("Trebuchet18") + txt2:SizeToContents() + txt2:SetPos(0, 70) + txt2:CenterHorizontal() + + local txt3 = vgui.Create("DLabel", pnl) + txt3:SetText("Lua scripts can be potentially dangerous as they can do") + txt3:SetTextColor(Color(75,75,75)) + txt3:SetFont("Trebuchet18") + txt3:SizeToContents() + txt3:SetPos(0, 90) + txt3:CenterHorizontal() + + local txt4 = vgui.Create("DLabel", pnl) + txt4:SetText("anything any other addon or gamemode could potentially do.") + txt4:SetTextColor(Color(75,75,75)) + txt4:SetFont("Trebuchet18") + txt4:SizeToContents() + txt4:SetPos(0, 100) + txt4:CenterHorizontal() + + local txt5 = vgui.Create("DLabel", pnl) + txt5:SetText("including kicking, banning, saving data, and more.") + txt5:SetTextColor(Color(175,75,75)) + txt5:SetFont("Trebuchet18") + txt5:SizeToContents() + txt5:SetPos(0, 110) + txt5:CenterHorizontal() + + local txt6 = vgui.Create("DLabel", pnl) + txt6:SetText("However map scripts is what allows special events,") + txt6:SetTextColor(Color(75,75,75)) + txt6:SetFont("Trebuchet18") + txt6:SizeToContents() + txt6:SetPos(0, 130) + txt6:CenterHorizontal() + + local txt7 = vgui.Create("DLabel", pnl) + txt7:SetText("objectives, or whole easter eggs to be coded directly.") + txt7:SetTextColor(Color(75,75,75)) + txt7:SetFont("Trebuchet18") + txt7:SizeToContents() + txt7:SetPos(0, 140) + txt7:CenterHorizontal() + + local txt8 = vgui.Create("DLabel", pnl) + txt8:SetText("Load scripts from configs you trust or have verified yourself.") + txt8:SetTextColor(Color(75,75,75)) + txt8:SetFont("Trebuchet18") + txt8:SizeToContents() + txt8:SetPos(0, 160) + txt8:CenterHorizontal() + + local txt9 = vgui.Create("DLabel", pnl) + txt9:SetText("This config claims to do the following:") + txt9:SetTextColor(Color(75,75,75)) + txt9:SetFont("Trebuchet18") + txt9:SizeToContents() + txt9:SetPos(0, 190) + txt9:CenterHorizontal() + + local txt10 = vgui.Create("DLabel", pnl) + txt10:SetSize(350, 100) + txt10:SetWrap(true) + txt10:SetText(nzMapping.Settings.scriptinfo or "- no description -") + txt10:SetTextColor(Color(75,175,75)) + txt10:SetFont("Trebuchet18") + txt10:SetPos(0, 210) + txt10:CenterHorizontal() + + local txt11 = vgui.Create("DLabel", pnl) + txt11:SetText("Load Script?") + txt11:SetTextColor(Color(75,75,75)) + txt11:SetFont("Trebuchet18") + txt11:SizeToContents() + txt11:SetPos(0, 320) + txt11:CenterHorizontal() + + local yes = vgui.Create("DButton", pnl) + yes:SetText("Yes") + yes:SetSize(75, 20) + yes:SetPos(100, 340) + yes.DoClick = function() + net.Start("nzMappingMismatchData") + net.WriteString("Map Script") + net.WriteTable({load = true}) + net.SendToServer() + nzMapping.MismatchData["Map Script"] = nil + frame:CloseTabAndOpenNew() + end + + local no = vgui.Create("DButton", pnl) + no:SetText("No") + no:SetSize(75, 20) + no:SetPos(200, 340) + no.DoClick = function() + net.Start("nzMappingMismatchData") + net.WriteString("Map Script") + net.WriteTable({load = false}) + net.SendToServer() + nzMapping.MismatchData["Map Script"] = nil + frame:CloseTabAndOpenNew() + end + + local txt12 = vgui.Create("DLabel", pnl) + txt12:SetText("Clicking submit or closing will make it not load.") + txt12:SetTextColor(Color(75,75,75)) + txt12:SetFont("Trebuchet18") + txt12:SizeToContents() + txt12:SetPos(0, 380) + txt12:CenterHorizontal() + + pnl.ReturnCorrectedData = function() -- In this case, just a default action + net.Start("nzMappingMismatchData") + net.WriteString("Map Script") + net.WriteTable({load = false}) + net.SendToServer() + nzMapping.MismatchData["Map Script"] = nil + end + + return pnl + + end, function( data ) + + if data.load then + nzMapping:LoadScript(nzMapping.CurrentConfig) + end + + nzMapping.MismatchData["Map Script"] = nil +end) + +CreateMismatchCheck("Random Box Weapons", function() + local tbl = {} + if nzMapping.Settings.rboxweps and table.Count(nzMapping.Settings.rboxweps) > 0 then + for k,v in pairs(nzMapping.Settings.rboxweps) do + if !weapons.Get(v) then + print("Random Box has non-existant weapon class: " .. v .. "!") + tbl[v] = true + end + end + end + + return tbl -- Return the data you want to send to the client + +end, function(frame) + + local pnl = vgui.Create("DPanel", frame) + pnl:SetPos(5, 5) + pnl:SetSize(380, 425) + + local properties = vgui.Create("DProperties", pnl) + properties:SetPos(0, 0) + properties:SetSize(380, 420) + + for k,v in pairs(nzMapping.MismatchData["Random Box Weapons"]) do + local choice = properties:CreateRow( "Missing Box Weapons", k ) + choice:Setup( "Combo", {} ) + choice:AddChoice( " Remove ...", "nz_removeweapon", true ) + nzMapping.MismatchData["Random Box Weapons"][k] = "nz_removeweapon" + for _, v2 in pairs(weapons.GetList()) do + if v2.Category and v2.Category != "" then + choice:AddChoice(v2.PrintName and v2.PrintName != "" and v2.Category.. " - "..v2.PrintName or v2.ClassName, v2.ClassName, false) + else + choice:AddChoice(v2.PrintName and v2.PrintName != "" and v2.PrintName or v2.ClassName, v2.ClassName, false) + end + end + choice.DataChanged = function(self, val) + nzMapping.MismatchData["Random Box Weapons"][k] = val + end + end + + pnl.ReturnCorrectedData = function() -- Add the function to the returned panel so we can access it outside + net.Start("nzMappingMismatchData") + net.WriteString("Random Box Weapons") + net.WriteTable(nzMapping.MismatchData["Random Box Weapons"]) + net.SendToServer() + nzMapping.MismatchData["Random Box Weapons"] = nil -- Clear the data + end + + return pnl -- Return it to add it the the sheets + +end, function( data ) + if nzMapping.Settings.rboxweps and table.Count(nzMapping.Settings.rboxweps) > 0 then + for k,v in pairs(nzMapping.Settings.rboxweps) do + local new = data[v] + if new then + if new == "nz_removeweapon" then + table.RemoveByValue(nzMapping.Settings.rboxweps, v) + else + nzMapping.Settings.rboxweps[table.KeyFromValue(nzMapping.Settings.rboxweps, v)] = new + end + end + end + end + + nzMapping.MismatchData["Wall Buys"] = nil -- Clear the data +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/mapping/sh_sync.lua b/gamemodes/nzombies3/gamemode/mapping/sh_sync.lua new file mode 100644 index 00000000..9ee1f448 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sh_sync.lua @@ -0,0 +1,82 @@ +if SERVER then + util.AddNetworkString( "nzMapping.SyncSettings" ) + + local function receiveMapData(len, ply) + local tbl = net.ReadTable() + PrintTable(tbl) + + if tbl.startwep then + nzMapping.Settings.startwep = weapons.Get(tbl.startwep) and tbl.startwep or nz.Config.BaseStartingWeapons[1] + end + if tbl.startpoints then + nzMapping.Settings.startpoints = tonumber(tbl.startpoints) and tbl.startpoints or 500 + end + if tbl.numweps then + nzMapping.Settings.numweps = tonumber(tbl.numweps) and tbl.numweps or 2 + end + if tbl.eeurl then + nzMapping.Settings.eeurl = tbl.eeurl and tbl.eeurl or nil + end + if tbl.script then + nzMapping.Settings.script = tbl.script and tbl.script or nil + end + if tbl.scriptinfo then + nzMapping.Settings.scriptinfo = tbl.scriptinfo and tbl.scriptinfo or nil + end + if tbl.rboxweps then + nzMapping.Settings.rboxweps = tbl.rboxweps and tbl.rboxweps[1] and tbl.rboxweps or nil + end + if tbl.wunderfizzperks then + nzMapping.Settings.wunderfizzperks = tbl.wunderfizzperks and tbl.wunderfizzperks[1] and tbl.wunderfizzperks or nil + end + + for k,v in pairs(player.GetAll()) do + nzMapping:SendMapData(ply) + end + + -- nzMapping.Settings = tbl + end + net.Receive( "nzMapping.SyncSettings", receiveMapData ) + + function nzMapping:SendMapData(ply) + net.Start("nzMapping.SyncSettings") + net.WriteTable(self.Settings) + net.Send(ply) + end +end + +if CLIENT then + local function cleanUpMap() + game.CleanUpMap() + end + + net.Receive("nzCleanUp", cleanUpMap ) + + local function receiveMapData() + local oldeeurl = nzMapping.Settings.eeurl or "" + nzMapping.Settings = net.ReadTable() + + if !EEAudioChannel or (oldeeurl != nzMapping.Settings.eeurl and nzMapping.Settings.eeurl) then + EasterEggData.ParseSong() + end + + -- Precache all random box weapons in the list + if nzMapping.Settings.rboxweps then + for k,v in pairs(nzMapping.Settings.rboxweps) do + local wep = weapons.Get(v) + if wep and (wep.WM or wep.WorldModel) then + util.PrecacheModel(wep.WM or wep.WorldModel) + end + end + end + end + net.Receive( "nzMapping.SyncSettings", receiveMapData ) + + function nzMapping:SendMapData( data ) + if data then + net.Start("nzMapping.SyncSettings") + net.WriteTable(data) + net.SendToServer() + end + end +end diff --git a/gamemodes/nzombies3/gamemode/mapping/sv_mapping.lua b/gamemodes/nzombies3/gamemode/mapping/sv_mapping.lua new file mode 100644 index 00000000..b3ca1b2e --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sv_mapping.lua @@ -0,0 +1,432 @@ +// + +function nzMapping:ZedSpawn(pos, link, respawnable, ply) + + local ent = ents.Create("nz_spawn_zombie_normal") + pos.z = pos.z - ent:OBBMaxs().z + ent:SetPos( pos ) + ent:Spawn() + ent.link = tonumber(link) + //For the link displayer + if link != nil then + ent:SetLink(link) + end + + if ply then + undo.Create( "Zombie Spawnpoint" ) + undo.SetPlayer( ply ) + undo.AddEntity( ent ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return ent +end + +function nzMapping:ZedSpecialSpawn(pos, link, ply) + + local ent = ents.Create("nz_spawn_zombie_special") + pos.z = pos.z - ent:OBBMaxs().z + ent:SetPos( pos ) + ent:Spawn() + ent.link = tonumber(link) + //For the link displayer + if link != nil then + ent:SetLink(link) + end + + if ply then + undo.Create( "Special Zombie Spawnpoint" ) + undo.SetPlayer( ply ) + undo.AddEntity( ent ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return ent +end + +function nzMapping:PlayerSpawn(pos, ply) + + local ent = ents.Create("player_spawns") + pos.z = pos.z - ent:OBBMaxs().z + ent:SetPos( pos ) + ent:Spawn() + + if ply then + undo.Create( "Player Spawnpoint" ) + undo.SetPlayer( ply ) + undo.AddEntity( ent ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return ent + +end + +function nzMapping:EasterEgg(pos, ang, model, ply) + 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 + + if ply then + undo.Create( "Easter Egg" ) + undo.SetPlayer( ply ) + undo.AddEntity( egg ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return egg +end + +function nzMapping:WallBuy(pos, gun, price, angle, oldent, ply, flipped) + + if IsValid(oldent) then oldent:Remove() end + + local ent = ents.Create("wall_buys") + ent:SetAngles(angle) + pos.z = pos.z - ent:OBBMaxs().z + ent:SetPos( pos ) + ent:SetWeapon(gun, price) + ent:Spawn() + --ent:PhysicsInit( SOLID_VPHYSICS ) + + local phys = ent:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + + if flipped != nil then + ent:SetFlipped(flipped) + end + + if ply then + undo.Create( "Wall Gun" ) + undo.SetPlayer( ply ) + undo.AddEntity( ent ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return ent + +end + +function nzMapping:PropBuy(pos, ang, model, flags, ply) + 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 + nzDoors:CreateLink( prop, flags ) + end + + local phys = prop:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + + if ply then + undo.Create( "Prop" ) + undo.SetPlayer( ply ) + undo.AddEntity( prop ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return prop +end + +function nzMapping:Electric(pos, ang, model, ply) + --THERE CAN ONLY BE ONE TRUE HERO + local prevs = ents.FindByClass("power_box") + if prevs[1] != nil then + prevs[1]:Remove() + end + + local ent = ents.Create( "power_box" ) + ent:SetPos( pos ) + ent:SetAngles( ang ) + ent:Spawn() + ent:PhysicsInit( SOLID_VPHYSICS ) + + local phys = ent:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + + if ply then + undo.Create( "Power Switch" ) + undo.SetPlayer( ply ) + undo.AddEntity( ent ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return ent +end + +function nzMapping:BlockSpawn(pos, ang, model, ply) + 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 + + if ply then + undo.Create( "Invisible Block" ) + undo.SetPlayer( ply ) + undo.AddEntity( block ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return block +end + +function nzMapping:BoxSpawn(pos, ang, ply) + local box = ents.Create( "random_box_spawns" ) + box:SetPos( pos ) + box:SetAngles( ang ) + box:Spawn() + box:PhysicsInit( SOLID_VPHYSICS ) + + if ply then + undo.Create( "Random Box Spawnpoint" ) + undo.SetPlayer( ply ) + undo.AddEntity( box ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return box +end + +function nzMapping:PerkMachine(pos, ang, id, ply) + if id == "wunderfizz" then + local perk = ents.Create("wunderfizz_machine") + perk:SetPos(pos) + perk:SetAngles(ang) + perk:Spawn() + perk:Activate() + perk:PhysicsInit( SOLID_VPHYSICS ) + perk:TurnOff() + + local phys = perk:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + + if ply then + undo.Create( "Der Wunderfizz" ) + undo.SetPlayer( ply ) + undo.AddEntity( perk ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return perk + else + 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 + + if ply then + undo.Create( "Perk Machine" ) + undo.SetPlayer( ply ) + undo.AddEntity( perk ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return perk + end +end + +function nzMapping:BreakEntry(pos, ang, planks, jump, ply) + local planks = planks + if planks == nil then planks = true else planks = tobool(planks) end + local jump = jump + if jump == nil then jump = false else jump = tobool(jump) end + + local entry = ents.Create( "breakable_entry" ) + entry:SetPos( pos ) + entry:SetAngles( ang ) + entry:SetHasPlanks(planks) + entry:SetTriggerJumps(jump) + entry:Spawn() + entry:PhysicsInit( SOLID_VPHYSICS ) + + local phys = entry:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + + if ply then + undo.Create( "Barricade" ) + undo.SetPlayer( ply ) + undo.AddEntity( entry ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return entry +end + +function nzMapping:SpawnEffect( pos, ang, model, ply ) + + local e = ents.Create("nz_prop_effect") + e:SetModel(model) + e:SetPos(pos) + e:SetAngles( ang ) + e:Spawn() + e:Activate() + if ( !IsValid( e ) ) then return end + + if ply then + undo.Create( "Effect" ) + undo.SetPlayer( ply ) + undo.AddEntity( e ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return e + +end + +function nzMapping:CleanUpMap() + game.CleanUpMap(false, { + "breakable_entry", + "breakable_entry_plank", + "button_elec", + "perk_machine", + "player_spawns", + "prop_buys", + "random_box_spawns", + "wall_block", + "wall_buys", + "nz_spawn_zombie", + "nz_spawn_zombie_normal", + "nz_spawn_zombie_special", + "easter_egg", + "edit_fog", + "edit_fog_special", + "edit_sky", + "edit_sun", + "nz_prop_effect", + "nz_prop_effect_attachment", + "nz_fire_effect", + "edit_color", + "power_box", + "invis_wall", + "wunderfizz_machine", + }) + + -- Gotta reset the doors and other entites' values! + for k,v in pairs(nzDoors.MapDoors) do + local door = nzDoors:DoorIndexToEnt(k) + door:SetLocked(true) + if door:IsDoor() then + door:LockDoor() + elseif door:IsButton() then + door:LockButton() + end + end + + -- Reset bought status on wall buys + for k,v in pairs(ents.FindByClass("wall_buys")) do + v:SetBought(false) + end + + if self.MarkedProps then + if !nzRound:InState( ROUND_CREATE ) then + for k,v in pairs(self.MarkedProps) do + local ent = ents.GetMapCreatedEntity(k) + if IsValid(ent) then ent:Remove() end + end + else + for k,v in pairs(self.MarkedProps) do + local ent = ents.GetMapCreatedEntity(k) + if IsValid(ent) then ent:SetColor(Color(200,0,0)) end + end + end + end +end + +function nzMapping:SpawnEntity(pos, ang, ent, ply) + local entity = ents.Create( ent ) + entity:SetPos( pos ) + entity:SetAngles( ang ) + entity:Spawn() + entity:PhysicsInit( SOLID_VPHYSICS ) + + table.insert(nz.QMenu.Data.SpawnedEntities, entity) + + if ply then + undo.Create( "Entity" ) + undo.SetPlayer( ply ) + undo.AddEntity( entity ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return entity +end + +function nzMapping:CreateInvisibleWall(vec1, vec2, ply) + local wall = ents.Create( "invis_wall" ) + wall:SetPos( vec1 ) -- Later we might make the position the center + --wall:SetAngles( ang ) + --wall:SetMinBound(vec1) -- Just the position for now + wall:SetMaxBound(vec2) + wall:Spawn() + wall:PhysicsInitBox( Vector(0,0,0), vec2 ) + + local phys = wall:GetPhysicsObject() + if IsValid(phys) then + phys:EnableMotion(false) + end + + if ply then + undo.Create( "Invis Wall" ) + undo.SetPlayer( ply ) + undo.AddEntity( wall ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end + return wall +end + +//Physgun Hooks +local ghostentities = { + ["prop_buys"] = true, + ["wall_block"] = true, + ["breakable_entry"] = true, + ["invis_wall"] = true, + --["wall_buys"] = true, +} +local function onPhysgunPickup( ply, ent ) + local class = ent:GetClass() + if ghostentities[class] then + //Ghost the entity so we can put them in walls. + local phys = ent:GetPhysicsObject() + phys:EnableCollisions(false) + end + +end + +local function onPhysgunDrop( ply, ent ) + local class = ent:GetClass() + if ghostentities[class] 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", onPhysgunPickup ) +hook.Add( "PhysgunDrop", "nz.OnDrop", onPhysgunDrop ) diff --git a/gamemodes/nzombies3/gamemode/mapping/sv_saveload.lua b/gamemodes/nzombies3/gamemode/mapping/sv_saveload.lua new file mode 100644 index 00000000..fef2c78b --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sv_saveload.lua @@ -0,0 +1,513 @@ +nzMapping.Version = 400 --Note to Ali; Any time you make an update to the way this is saved, increment this. + +function nzMapping:SaveConfig(name) + + local main = {} + + --Check if the nz folder exists + if !file.Exists( "nz/", "DATA" ) then + file.CreateDir( "nz" ) + end + + main.version = self.Version + + local easter_eggs = {} + for _, v in pairs(ents.FindByClass("easter_egg")) do + table.insert(easter_eggs, { + pos = v:GetPos(), + angle = v:GetAngles(), + model = v:GetModel(), + }) + end + + local zed_spawns = {} + for _, v in pairs(ents.FindByClass("nz_spawn_zombie_normal")) do + table.insert(zed_spawns, { + pos = v:GetPos(), + link = v.link, + respawnable = v.respawnable + }) + end + + local zed_special_spawns = {} + for _, v in pairs(ents.FindByClass("nz_spawn_zombie_special")) do + table.insert(zed_special_spawns, { + pos = v:GetPos(), + link = v.link + }) + end + + local player_spawns = {} + for _, v in pairs(ents.FindByClass("player_spawns")) do + table.insert(player_spawns, { + pos = v:GetPos(), + }) + end + + local wall_buys = {} + for _, v in pairs(ents.FindByClass("wall_buys")) do + table.insert(wall_buys, { + pos = v:GetPos(), + wep = v.WeaponGive, + price = v.Price, + angle = v:GetAngles(), + flipped = v:GetFlipped(), + }) + end + + local buyableprop_spawns = {} + for _, v in pairs(ents.FindByClass("prop_buys")) do + + -- Convert the table to a flag string - if it even has any + local data = v:GetDoorData() + local flagstr + if data then + flagstr = "" + for k2, v2 in pairs(data) do + flagstr = flagstr .. k2 .."=" .. v2 .. "," + end + flagstr = string.Trim(flagstr, ",") + end + + table.insert(buyableprop_spawns, { + pos = v:GetPos(), + angle = v:GetAngles(), + model = v:GetModel(), + flags = flagstr, + }) + end + + local prop_effects = {} + for _, v in pairs(ents.FindByClass("nz_prop_effect")) do + table.insert(prop_effects, { + pos = v:GetPos(), + angle = v:GetAngles(), + model = v.AttachedEntity:GetModel(), + }) + end + + local elec_spawn = {} + for _, v in pairs(ents.FindByClass("power_box")) do + table.insert(elec_spawn, { + pos = v:GetPos(), + angle = v:GetAngles( ), + }) + end + + local block_spawns = {} + for _, 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 _, v in pairs(ents.FindByClass("random_box_spawns")) do + table.insert(randombox_spawn, { + pos = v:GetPos(), + angle = v:GetAngles(), + }) + end + + local perk_machinespawns = {} + for _, v in pairs(ents.FindByClass("perk_machine")) do + table.insert(perk_machinespawns, { + pos = v:GetPos(), + angle = v:GetAngles(), + id = v:GetPerkID(), + }) + end + + local wunderfizz_machines = {} + for _, v in pairs(ents.FindByClass("wunderfizz_machine")) do + table.insert(wunderfizz_machines, { + pos = v:GetPos(), + angle = v:GetAngles(), + }) + end + + //Normal Map doors + local door_setup = {} + for k,v in pairs(nzDoors.MapDoors) do + local flags = "" + for k2, v2 in pairs(v.flags) do + flags = flags .. k2 .. "=" .. v2 .. "," + end + flags = string.Trim(flags, ",") + door = nzDoors:DoorIndexToEnt(k) + if door:IsDoor() then + door_setup[k] = { + flags = flags, + } + --print(door.Data) + end + end + --PrintTable(door_setup) + + --barricades + local break_entry = {} + for _, v in pairs(ents.FindByClass("breakable_entry")) do + table.insert(break_entry, { + pos = v:GetPos(), + angle = v:GetAngles(), + planks = v:GetHasPlanks(), + jump = v:GetTriggerJumps(), + }) + end + + local special_entities = {} + for k, v in pairs(nz.QMenu.Data.SpawnedEntities) do + if IsValid(v) then + table.insert(special_entities, duplicator.CopyEntTable(v)) + else + nz.QMenu.Data.SpawnedEntities[k] = nil + end + end + --PrintTable(special_entities) + + -- Store all invisible walls with their boundaries and angles + local invis_walls = {} + for _, v in pairs(ents.FindByClass("invis_wall")) do + table.insert(invis_walls, { + pos = v:GetPos(), + maxbound = v:GetMaxBound(), + }) + end + + main["ZedSpawns"] = zed_spawns + main["ZedSpecialSpawns"] = zed_special_spawns + main["PlayerSpawns"] = player_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["DoorSetup"] = door_setup + main["BreakEntry"] = break_entry + main["EasterEggs"] = easter_eggs + main["PropEffects"] = prop_effects + main["SpecialEntities"] = special_entities + main["InvisWalls"] = invis_walls + main["WunderfizzMachines"] = wunderfizz_machines + + --We better clear the merges in case someone played around with them in create mode (lua_run) + nz.Nav.ResetNavGroupMerges() + main["NavTable"] = nz.Nav.Data + main["NavGroups"] = nz.Nav.NavGroups + main["NavGroupIDs"] = nz.Nav.NavGroupIDs + + --Save this map's configuration + main["MapSettings"] = self.Settings + main["RemoveProps"] = self.MarkedProps + + local configname + if name and name != "" then + configname = "nz/nz_" .. game.GetMap() .. ";" .. name .. ".txt" + else + configname = "nz/nz_" .. game.GetMap() .. ";" .. os.date("%H_%M_%j") .. ".txt" + end + + file.Write( configname, util.TableToJSON( main ) ) + PrintMessage( HUD_PRINTTALK, "[NZ] Saved to garrysmod/data/" .. configname) + +end + +function nzMapping:ClearConfig() + print("[NZ] Clearing current map") + + -- ALWAYS do this first! + nzMapping:UnloadScript() + + --Entities to clear: + local entClasses = { + ["nz_spawn_zombie_normal"] = true, + ["nz_spawn_zombie_special"] = true, + ["player_spawns"] = true, + ["wall_buys"] = true, + ["prop_buys"] = true, + ["button_elec"] = true, + ["wall_block"] = true, + ["random_box_spawns"] = true, + ["perk_machine"] = true, + ["easter_egg"] = true, + ["nz_prop_effect"] = true, + ["breakable_entry"] = true, + ["edit_fog"] = true, + ["edit_fog_special"] = true, + ["edit_sky"] = true, + ["edit_color"] = true, + ["edit_sun"] = true, + ["nz_triggerzone"] = true, + ["power_box"] = true, + ["invis_wall"] = true, + ["nz_script_triggerzone"] = true, + ["nz_script_prop"] = true, + ["wunderfizz_machine"] = true, + ["wunderfizz_windup"] = true, + } + + --jsut loop once over all entities isntead of seperate findbyclass calls + for k,v in pairs(ents.GetAll()) do + if entClasses[v:GetClass()] then + v:Remove() + end + end + + --Normal Map doors + for k,v in pairs(nzDoors.MapDoors) do + nzDoors:RemoveMapDoorLink( k ) + end + + --Reset Navigation table + for k,v in pairs(nz.Nav.Data) do + navmesh.GetNavAreaByID(k):SetAttributes(v.prev) + end + nz.Nav.Data = {} + + --Specially spawned entities + for k,v in pairs(nz.QMenu.Data.SpawnedEntities) do + if IsValid(v) then + v:Remove() + end + end + + nz.QMenu.Data.SpawnedEntities = {} + + nzMapping.Settings = {} + nzMapping.MarkedProps = {} + + nzDoors.MapDoors = {} + nzDoors.PropDoors = {} + + -- Sync + FullSyncModules["Round"]() + + -- Clear all door data + net.Start("nzClearDoorData") + net.Broadcast() + + -- Clear out the item objects creating with this config (if any) + nzItemCarry:CleanUp() + + nzMapping.CurrentConfig = nil + + nzMapping:CleanUpMap() +end + +function nzMapping:LoadConfig( name, loader ) + + local filepath = "nz/" .. name + local location = "DATA" + + if string.GetExtensionFromFilename(name) == "lua" then + if file.Exists("gamemodes/nzombies3/officialconfigs/"..name, "GAME") then + location, filepath = "GAME", "gamemodes/nzombies3/officialconfigs/"..name + else + location = "LUA" + end + end + + if file.Exists( filepath, location )then + print("[NZ] MAP CONFIG FOUND!") + + -- Load a lua file for a specific map + -- Make sure all hooks are removed before adding the new ones + nzMapping:UnloadScript() + + local data = util.JSONToTable( file.Read( filepath, location ) ) + + 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 + + if version < nzMapping.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 + + self:ClearConfig() + + print("[NZ] Loading " .. filepath .. "...") + + + //Start sorting the data + + if data.ZedSpawns then + for k,v in pairs(data.ZedSpawns) do + nzMapping:ZedSpawn(v.pos, v.link, v.respawnable) + end + end + + if data.ZedSpecialSpawns then + for k,v in pairs(data.ZedSpecialSpawns) do + nzMapping:ZedSpecialSpawn(v.pos, v.link) + end + end + + if data.PlayerSpawns then + for k,v in pairs(data.PlayerSpawns) do + nzMapping:PlayerSpawn(v.pos) + end + end + + if data.WallBuys then + for k,v in pairs(data.WallBuys) do + nzMapping:WallBuy(v.pos,v.wep, v.price, v.angle, nil, nil, v.flipped) + end + end + + if data.BuyablePropSpawns then + for k,v in pairs(data.BuyablePropSpawns) do + nzMapping:PropBuy(v.pos, v.angle, v.model, v.flags) + end + end + + if data.ElecSpawns then + for k,v in pairs(data.ElecSpawns) do + nzMapping:Electric(v.pos, v.angle) + end + end + + if data.BlockSpawns then + for k,v in pairs(data.BlockSpawns) do + nzMapping:BlockSpawn(v.pos, v.angle, v.model) + end + end + + if data.RandomBoxSpawns then + for k,v in pairs(data.RandomBoxSpawns) do + nzMapping:BoxSpawn(v.pos, v.angle) + end + end + + if data.PerkMachineSpawns then + for k,v in pairs(data.PerkMachineSpawns) do + nzMapping:PerkMachine(v.pos, v.angle, v.id) + end + end + + if data.EasterEggs then + for k,v in pairs(data.EasterEggs) do + nzMapping:EasterEgg(v.pos, v.angle, v.model) + end + end + + if data.WunderfizzMachines then + for k,v in pairs(data.WunderfizzMachines) do + nzMapping:PerkMachine(v.pos, v.angle, "wunderfizz") + end + end + + //Normal Map doors + if data.DoorSetup then + for k,v in pairs(data.DoorSetup) do + --print(v.flags) + nzDoors:CreateMapDoorLink(k, v.flags) + end + end + + //Barricades + if data.BreakEntry then + for k,v in pairs(data.BreakEntry) do + nzMapping:BreakEntry(v.pos, v.angle, v.planks, v.jump) + end + end + + //NavTable saved + if data.NavTable then + nz.Nav.Data = data.NavTable + //Re-enable navmesh visualization + for k,v in pairs(nz.Nav.Data) do + local navarea = navmesh.GetNavAreaByID(k) + if v.link then + navarea:SetAttributes(NAV_MESH_STOP) + else + navarea:SetAttributes(NAV_MESH_AVOID) + end + end + end + + if data.NavGroups then + nz.Nav.NavGroups = data.NavGroups + end + if data.NavGroupIDs then + nz.Nav.NavGroupIDs = data.NavGroupIDs + end + + if data.PropEffects then + for k,v in pairs(data.PropEffects) do + nzMapping:SpawnEffect(v.pos, v.angle, v.model) + end + end + + if data.SpecialEntities then + for k,v in pairs(data.SpecialEntities) do + PrintTable(v) + local ent = duplicator.CreateEntityFromTable(Entity(1), v) + table.insert(nz.QMenu.Data.SpawnedEntities, ent) + end + end + + if data.MapSettings then + nzMapping.Settings = data.MapSettings + for k,v in pairs(player.GetAll()) do + nzMapping:SendMapData(v) + end + end + + if data.RemoveProps then + nzMapping.MarkedProps = data.RemoveProps + if !nzRound:InState( ROUND_CREATE ) then + for k,v in pairs(nzMapping.MarkedProps) do + local ent = ents.GetMapCreatedEntity(k) + if IsValid(ent) then ent:Remove() end + end + else + for k,v in pairs(nzMapping.MarkedProps) do + local ent = ents.GetMapCreatedEntity(k) + if IsValid(ent) then ent:SetColor(Color(200,0,0)) end + end + end + end + + if data.InvisWalls then + for k,v in pairs(data.InvisWalls) do + nzMapping:CreateInvisibleWall(v.pos, v.maxbound) + end + end + + -- Generate all auto navmesh merging so we don't have to save that manually + nz.Nav.Functions.AutoGenerateAutoMergeLinks() + + nzMapping:CheckMismatch( loader ) + + -- Set the current config name, we will use this to load scripts via mismatch window + nzMapping.CurrentConfig = name + + 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() + nzMapping:LoadConfig("nz_"..game.GetMap()..".txt") + end) +end) diff --git a/gamemodes/nzombies3/gamemode/mapping/sv_validation.lua b/gamemodes/nzombies3/gamemode/mapping/sv_validation.lua new file mode 100644 index 00000000..276cc3af --- /dev/null +++ b/gamemodes/nzombies3/gamemode/mapping/sv_validation.lua @@ -0,0 +1,24 @@ +function nzMapping:CheckSpawns() + + --Check Player spawns + if #ents.FindByClass("player_spawns") == 0 then + return false + end + + --Check Zombie Spawns + if #ents.FindByClass("nz_spawn_zombie_*") == 0 then + return false + end + + return true +end + +function nzMapping:CheckEnoughPlayerSpawns() + + //Check Player spawns + if #ents.FindByClass("player_spawns") < #player.GetAll() then + return false + end + + return true +end diff --git a/gamemodes/nzombies3/gamemode/misc/cl_precache.lua b/gamemodes/nzombies3/gamemode/misc/cl_precache.lua new file mode 100644 index 00000000..42b20653 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/misc/cl_precache.lua @@ -0,0 +1,47 @@ + +-- Zombies +util.PrecacheModel("models/nz_zombie/zombie_rerig_animated.mdl") +util.PrecacheModel("models/nz_zombie/zombie_hellhound.mdl") + +-- Perk machines +util.PrecacheModel("models/alig96/perks/cherry/cherry.mdl") +util.PrecacheModel("models/alig96/perks/deadshot/deadshot.mdl") +util.PrecacheModel("models/alig96/perks/doubletap/doubletap_off.mdl") +util.PrecacheModel("models/alig96/perks/doubletap/doubletap_on.mdl") +util.PrecacheModel("models/alig96/perks/doubletap2/doubletap2.mdl") +util.PrecacheModel("models/alig96/perks/jugg/jugg_off.mdl") +util.PrecacheModel("models/alig96/perks/jugg/jugg_on.mdl") +util.PrecacheModel("models/alig96/perks/mulekick/mulekick.mdl") +util.PrecacheModel("models/alig96/perks/packapunch/packapunch.mdl") +util.PrecacheModel("models/alig96/perks/phd/phdflopper.mdl") +util.PrecacheModel("models/alig96/perks/revive/revive_off.mdl") +util.PrecacheModel("models/alig96/perks/revive/revive_on.mdl") +util.PrecacheModel("models/alig96/perks/speed/speed_off.mdl") +util.PrecacheModel("models/alig96/perks/speed/speed_on.mdl") +util.PrecacheModel("models/alig96/perks/staminup/staminup.mdl") +util.PrecacheModel("models/alig96/perks/tombstone/tombstone.mdl") +util.PrecacheModel("models/alig96/perks/vulture/vultureaid.mdl") +util.PrecacheModel("models/alig96/perks/whoswho/whoswho.mdl") + +-- Mysery box, teddy and other props +util.PrecacheModel("models/hoff/props/mysterybox/box.mdl") +util.PrecacheModel("models/hoff/props/mysterybox/box1.mdl") +util.PrecacheModel("models/hoff/props/mysterybox/box2.mdl") +util.PrecacheModel("models/hoff/props/teddy_bear/teddy_bear.mdl") +util.PrecacheModel("models/nzprops/monkey_bomb.mdl") +util.PrecacheModel("models/nzprops/power_lever.mdl") +util.PrecacheModel("models/nzprops/power_lever_handle.mdl") +util.PrecacheModel("models/nzprops/power_lever_short.mdl") + +-- Powerups +util.PrecacheModel("models/nzpowerups/carpenter.mdl") +util.PrecacheModel("models/nzpowerups/nuke.mdl") +util.PrecacheModel("models/nzpowerups/x2.mdl") +util.PrecacheModel("models/nzpowerups/insta.mdl") + +-- Viewmodels +util.PrecacheModel("models/weapons/c_perk_bottle.mdl") +util.PrecacheModel("models/weapons/c_monkey_bomb.mdl") +util.PrecacheModel("models/weapons/c_bowie_knife.mdl") +util.PrecacheModel("models/weapons/c_revive_morphine.mdl") +util.PrecacheModel("models/weapons/c_packapunch_arms.mdl") \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/misc/sh_constructor.lua b/gamemodes/nzombies3/gamemode/misc/sh_constructor.lua new file mode 100644 index 00000000..a10adbd2 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/misc/sh_constructor.lua @@ -0,0 +1,2 @@ +-- Main Tables +nzMisc = nzMisc or {} diff --git a/gamemodes/nzombies3/gamemode/misc/sh_playerinit.lua b/gamemodes/nzombies3/gamemode/misc/sh_playerinit.lua new file mode 100644 index 00000000..95bbb7ef --- /dev/null +++ b/gamemodes/nzombies3/gamemode/misc/sh_playerinit.lua @@ -0,0 +1,12 @@ +if SERVER then + util.AddNetworkString("nz_PlayerInit") + net.Receive("nz_PlayerInit", function(len, ply) + hook.Call("PlayerFullyInitialized", nil, ply) + end) +else + hook.Add("InitPostEntity", "PlayerFullyInitialized", function() + net.Start("nz_PlayerInit") + net.SendToServer() + end) + +end diff --git a/gamemodes/nzombies3/gamemode/misc/sh_weightedrandom.lua b/gamemodes/nzombies3/gamemode/misc/sh_weightedrandom.lua new file mode 100644 index 00000000..9f5a7c6f --- /dev/null +++ b/gamemodes/nzombies3/gamemode/misc/sh_weightedrandom.lua @@ -0,0 +1,40 @@ +-- http://snippets.luacode.org/snippets/Weighted_random_choice_104 + +-- Modified to allow special weight keys + +local function weighted_total( choices, weightkey ) + local total = 0 + if weightkey then + for choice, weight in pairs(choices) do + total = total + weight[weightkey] + end + else + for choice, weight in pairs(choices) do + total = total + weight + end + end + return total +end + +local function weighted_random_choice( choices, weightkey ) + local threshold = math.random(0, weighted_total( choices, weightkey )) + local last_choice + if weightkey then + for choice, weight in pairs(choices) do + threshold = threshold - weight[weightkey] + if threshold <= 0 then return choice end + last_choice = choice + end + else + for choice, weight in pairs(choices) do + threshold = threshold - weight + if threshold <= 0 then return choice end + last_choice = choice + end + end + return last_choice +end + +function nzMisc.WeightedRandom( choices, weightkey ) + return weighted_random_choice( choices, weightkey ) +end diff --git a/nzombies3/gamemode/misc/sv_autoreload.lua b/gamemodes/nzombies3/gamemode/misc/sv_autoreload.lua similarity index 87% rename from nzombies3/gamemode/misc/sv_autoreload.lua rename to gamemodes/nzombies3/gamemode/misc/sv_autoreload.lua index 3a76d986..949ddd10 100644 --- a/nzombies3/gamemode/misc/sv_autoreload.lua +++ b/gamemodes/nzombies3/gamemode/misc/sv_autoreload.lua @@ -6,7 +6,7 @@ function GM:OnReloaded( ) if v:IsDoor() or v:IsBuyableProp() then local data = v.Data if data != nil then - nz.Doors.Functions.CreateLink(v, data) + nz.nzDoors.Functions.CreateLink(v, data) end end end diff --git a/gamemodes/nzombies3/gamemode/misc/sv_consolecommands.lua b/gamemodes/nzombies3/gamemode/misc/sv_consolecommands.lua new file mode 100644 index 00000000..e49db897 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/misc/sv_consolecommands.lua @@ -0,0 +1,84 @@ +-- Actual Commands + +-- Quick reload for dedicated severs +concommand.Add("nz_qr", function() + RunConsoleCommand("changelevel", game.GetMap()) +end) + +concommand.Add( "nz_print_weps", function() + for k,v in pairs( weapons.GetList() ) do + print( v.ClassName ) + end +end) + +concommand.Add("nz_door_id", function() + local tr = util.TraceLine( util.GetPlayerTrace( player.GetByID(1) ) ) + if IsValid( tr.Entity ) then print( tr.Entity:doorIndex() ) end +end) + +concommand.Add("nz_test1", function() + nz.nzDoors.Functions.CreateMapDoorLink( 1236, "price=500,elec=0,link=1" ) + + timer.Simple(5, function() nz.nzDoors.Functions.RemoveMapDoorLink( 1236 ) end) +end) + +concommand.Add("nz_forceround", function(ply, cmd, args, argStr) + if !IsValid(ply) or ply:IsSuperAdmin() then + local round = args[1] and tonumber(args[1]) or nil + local nokill = args[2] and tobool(args[2]) or false + + if !nokill then + nz.PowerUps.Functions.Nuke(nil, true) -- Nuke kills them all, no points, no position delay + end + + if round then + nzRound:SetNumber( round - 1 ) + local specint = GetConVar("nz_round_special_interval"):GetInt() or 6 + nzRound:SetNextSpecialRound( math.ceil(round/specint)*specint) + end + nzRound:Prepare() + end +end) + +-- Isn't used anywhere, marked for removal +function lmne(name, find, listall) + if !IsValid(ply) or ply:IsSuperAdmin() then + if name then + local tbl = {} + if find then + for k,v in pairs(ents.GetAll()) do + if v:GetName() != "" and string.find(string.lower(v:GetName()), string.lower(name)) then + table.insert(tbl, v) + print(v:GetName(),"\t\t\t",v) + end + end + else + tbl = ents.FindByName(name) + end + if !listall then + return tbl[1] + else + return tbl + end + else + local tbl = {} + for k,v in pairs(ents.GetAll()) do + if v:GetName() != "" then + table.insert(tbl, v) + print(v:GetName(),"\t\t\t",v) + end + end + return tbl + end + end +end + +concommand.Add("printeyeentityinfo", function(ply, cmd, args, argstr) + if !ply:IsSuperAdmin() then return end + local ent = ply:GetEyeTrace().Entity + if IsValid(ent) then + local pos = ent:GetPos() + local ang = ent:GetAngles() + print("{pos = Vector("..math.Round(pos.x)..", "..math.Round(pos.y)..", "..math.Round(pos.z).."), ang = Angle("..math.Round(ang[1])..", "..math.Round(ang[2])..", "..math.Round(ang[3])..")}") + end +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/misc/sv_resources.lua b/gamemodes/nzombies3/gamemode/misc/sv_resources.lua new file mode 100644 index 00000000..72cd5473 --- /dev/null +++ b/gamemodes/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/gamemodes/nzombies3/gamemode/navigation/sh_constructor.lua b/gamemodes/nzombies3/gamemode/navigation/sh_constructor.lua new file mode 100644 index 00000000..c3f154e0 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/navigation/sh_constructor.lua @@ -0,0 +1,202 @@ +//Main Tables +nz.Nav = nz.Nav or {} +nz.Nav.Functions = nz.Nav.Functions or {} +nz.Nav.Data = nz.Nav.Data or {} +nz.Nav.NavGroups = nz.Nav.NavGroups or {} +nz.Nav.NavGroupIDs = nz.Nav.NavGroupIDs or {} + +//Reset navmesh attributes so they don't accidentally save +function GM:ShutDown() + for k,v in pairs(nz.Nav.Data) do + navmesh.GetNavAreaByID(k):SetAttributes(v.prev) + end +end + +function IsNavApplicable(ent) + // All classes that can be linked with navigation + if !IsValid(ent) then return false end + if (ent:IsDoor() or ent:IsBuyableProp() or ent:IsButton()) and ent:GetDoorData().link then + return true + else + return false + end +end + +local NavFloodSelectedSet = {} +local NavFloodAlreadySelected = {} + +function FloodSelectNavAreas(area) + //Clear tables to be ready for a new selection + NavFloodSelectedSet = {} + NavFloodAlreadySelected = {} + + //Start off on the current area + AddFloodSelectedToSet(area) + + return NavFloodSelectedSet +end + +function AddFloodSelectedToSet(area) + //Prevent locked or door-linked navmeshes from being selected + if nz.Nav.Data[area:GetID()] then return end + + //Add it to the table and make sure it doesn't get reached again + NavFloodAlreadySelected[area:GetID()] = true + table.insert(NavFloodSelectedSet, area) + + //Loop through adjacent areas and do the same thing + for k,v in pairs(area:GetAdjacentAreas()) do + if !NavFloodAlreadySelected[v:GetID()] and v:IsConnected(area) then + AddFloodSelectedToSet(v) + end + end +end + +function nz.Nav.Functions.AddNavGroupIDToArea(area, id) + local id = string.lower(id) + + //Set the areas ID to the given one + nz.Nav.NavGroups[area:GetID()] = id + + //Create the entire group in the index table if it isn't already there + if !nz.Nav.NavGroupIDs[id] then + nz.Nav.NavGroupIDs[id] = {[id] = true} + end +end + +function nz.Nav.Functions.RemoveNavGroupArea(area, deletegroup) + //Remove the entire group from the index table + if deletegroup and nz.Nav.NavGroupIDs[nz.Nav.NavGroups[area:GetID()]] then + nz.Nav.NavGroupIDs[nz.Nav.NavGroups[area:GetID()]] = nil + end + + //Remove the group data behind the area itself + nz.Nav.NavGroups[area:GetID()] = nil +end + +function nz.Nav.Functions.MergeNavGroups(id1, id2) + if !id1 or !nz.Nav.NavGroupIDs[id1] then Error("MergeNavGroups called with invalid id1!") return end + if !id2 or !nz.Nav.NavGroupIDs[id2] then Error("MergeNavGroups called with invalid id2!") return end + + local tbl = {} + for k,v in pairs(nz.Nav.NavGroupIDs[id1]) do + tbl[k] = true + end + for k,v in pairs(nz.Nav.NavGroupIDs[id2]) do + tbl[k] = true + end + tbl[id1] = true + tbl[id2] = true + + for k,v in pairs(tbl) do + nz.Nav.NavGroupIDs[k] = tbl + end +end + +function nz.Nav.Functions.GetNavGroup(area) + if type(area) != "CNavArea" then area = navmesh.GetNearestNavArea(area:GetPos()) end + return nz.Nav.NavGroupIDs[nz.Nav.NavGroups[area:GetID()]] +end + +function nz.Nav.Functions.GetNavGroupID(area) + if type(area) != "CNavArea" then area = navmesh.GetNearestNavArea(area:GetPos()) end + return nz.Nav.NavGroups[area:GetID()] +end + +function nz.Nav.Functions.IsInSameNavGroup(ent1, ent2) + local area1 = nz.Nav.NavGroups[navmesh.GetNearestNavArea(ent1:GetPos()):GetID()] + if !area1 then return true end + + local area2 = nz.Nav.NavGroups[navmesh.GetNearestNavArea(ent2:GetPos()):GetID()] + if !area2 then return true end + + return nz.Nav.NavGroupIDs[area1][area2] or false +end + +function nz.Nav.Functions.IsPosInSameNavGroup(pos1, pos2) + local area1 = nz.Nav.NavGroups[navmesh.GetNearestNavArea(pos1):GetID()] + if !area1 then return true end + + local area2 = nz.Nav.NavGroups[navmesh.GetNearestNavArea(pos2):GetID()] + if !area2 then return true end + + return nz.Nav.NavGroupIDs[area1][area2] or false +end + +function nz.Nav.ResetNavGroupMerges() + local tbl = table.GetKeys(nz.Nav.NavGroupIDs) + nz.Nav.NavGroupIDs = {} + for k,v in pairs(tbl) do + nz.Nav.NavGroupIDs[v] = {[v] = true} + end +end + +function nz.Nav.GenerateCleanGroupIDList() + //Something to use in case everything messes up - loops through all saved navmeshes and adds them to the index list + nz.Nav.NavGroupIDs = {} + for k,v in pairs(nz.Nav.NavGroups) do + nz.Nav.NavGroupIDs[v] = {[v] = true} + end +end + +function nz.Nav.Functions.CreateAutoMergeLink(door, id) + if !door:IsDoor() and !door:IsBuyableProp() and !door:IsButton() then return end + if door.linkedmeshes then + if !table.HasValue(door.linkedmeshes, id) then + table.insert(door.linkedmeshes, id) + end + else + door.linkedmeshes = {} + table.insert(door.linkedmeshes, id) + end +end + +function nz.Nav.Functions.UnlinkAutoMergeLink(door) + if !door:IsDoor() and !door:IsBuyableProp() and !door:IsButton() then return end + if door.linkedmeshes then + door.linkedmeshes = nil + end +end + +function nz.Nav.Functions.AutoGenerateAutoMergeLinks() + for k,v in pairs(nz.Nav.Data) do + if v.link then + for k2,v2 in pairs(ents.GetAll()) do + if v2:IsDoor() or v2:IsBuyableProp() or v2:IsButton() then + if v2.link == v.link then + nz.Nav.Functions.CreateAutoMergeLink(v2, k) + print("Linked navmesh "..k.." to door", v2) + end + end + end + end + end +end + +function nz.Nav.Functions.OnNavMeshUnlocked(areaids) + local tbl = {} + + for k,v in pairs(areaids) do + local area = navmesh.GetNavAreaByID(v) + for k2,v2 in pairs(area:GetAdjacentAreas()) do + local group = nz.Nav.NavGroups[v2:GetID()] + if group then + tbl[group] = true + end + end + end + + local prev_group = nil + for k,v in pairs(tbl) do + if prev_group then + nz.Nav.Functions.MergeNavGroups(k, prev_group) + end + prev_group = k + end +end + +function nz.Nav.Functions.FlushAllNavModifications() + nz.Nav.Data = {} + nz.Nav.NavGroups = {} + nz.Nav.NavGroupIDs = {} +end \ No newline at end of file diff --git a/nzombies3/gamemode/notifications/sh_constructor.lua b/gamemodes/nzombies3/gamemode/notifications/sh_constructor.lua similarity index 100% rename from nzombies3/gamemode/notifications/sh_constructor.lua rename to gamemodes/nzombies3/gamemode/notifications/sh_constructor.lua diff --git a/nzombies3/gamemode/notifications/sh_sounds.lua b/gamemodes/nzombies3/gamemode/notifications/sh_sounds.lua similarity index 100% rename from nzombies3/gamemode/notifications/sh_sounds.lua rename to gamemodes/nzombies3/gamemode/notifications/sh_sounds.lua diff --git a/nzombies3/gamemode/notifications/sh_sync.lua b/gamemodes/nzombies3/gamemode/notifications/sh_sync.lua similarity index 100% rename from nzombies3/gamemode/notifications/sh_sync.lua rename to gamemodes/nzombies3/gamemode/notifications/sh_sync.lua diff --git a/gamemodes/nzombies3/gamemode/nzombies.fgd b/gamemodes/nzombies3/gamemode/nzombies.fgd new file mode 100644 index 00000000..26fd1f2d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/nzombies.fgd @@ -0,0 +1,12 @@ +@include "base.fgd" + +@PointClass base(Targetname, Origin, Angles) = nz_electricity : + "Fires outputs when electricity is turned on or off, and can also turn it on or off itself." +[ + input TurnElectricityOn(void) : "Turns on electricity. Pass 1 to make it silent." + input TurnElectricityOff(void) : "Turns off electricity. Pass 1 to make it silent." + + output OnInitialized(void) : "Fires when the entity is created in nZombies. You can use this to turn off the lights only in this gamemode." + output OnElectricityOn(void) : "Fires when the electricity is turned on." + output OnElectricityOff(void) : "Fires when the electricity is turned off." +] \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/perks/sh_constructor.lua b/gamemodes/nzombies3/gamemode/perks/sh_constructor.lua new file mode 100644 index 00000000..d78e0a78 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/perks/sh_constructor.lua @@ -0,0 +1,8 @@ +//Main Tables +nz.Perks = nz.Perks or {} +nz.Perks.Functions = {} +nz.Perks.Data = nz.Perks.Data or {} + +//_ Variables + +nz.Perks.Data.Players = nz.Perks.Data.Players or {} \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/perks/sh_meta.lua b/gamemodes/nzombies3/gamemode/perks/sh_meta.lua new file mode 100644 index 00000000..bb3259c5 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/perks/sh_meta.lua @@ -0,0 +1,84 @@ +local playerMeta = FindMetaTable("Player") +if SERVER then + + function playerMeta:GivePerk(id, machine) + if self:HasPerk(id) then return end + local perkData = nz.Perks.Functions.Get(id) + if perkData == nil then return false end + + local given = perkData.func(id, self, machine) + + 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 + + return given + 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 + perkData.lostfunc(id, self) + table.RemoveByValue( nz.Perks.Data.Players[self], id ) + end + nz.Perks.Functions.SendSync() + end + + function playerMeta:RemovePerks() + if nz.Perks.Data.Players[self] then + for k,v in pairs(nz.Perks.Data.Players[self]) do + local perkData = nz.Perks.Functions.Get(v) + if perkData then perkData.lostfunc(v, self) end + end + end + nz.Perks.Data.Players[self] = {} + nz.Perks.Functions.SendSync() + end + + function playerMeta:GiveRandomPerk(maponly) + local tbl = {} + for k,v in pairs(nz.Perks.Data) do + if !self:HasPerk(k) and k != "pap" and k != "Players" then + if maponly then + for k2,v2 in pairs(ents.FindByClass("perk_machine")) do + if v2:GetPerkID() == k then + table.insert(tbl, k) + break + end + end + else + table.insert(tbl, k) + end + end + end + --PrintTable(tbl) + if tbl[1] then + self:GivePerk(table.Random(tbl)) + end + 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() + if nz.Perks.Data.Players[self] == nil then nz.Perks.Data.Players[self] = {} end + local tbl = table.Copy(nz.Perks.Data.Players[self]) + if table.HasValue(tbl, "pap") then table.RemoveByValue(tbl, "pap") end + return tbl +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/perks/sh_perks.lua b/gamemodes/nzombies3/gamemode/perks/sh_perks.lua new file mode 100644 index 00000000..7743d25b --- /dev/null +++ b/gamemodes/nzombies3/gamemode/perks/sh_perks.lua @@ -0,0 +1,390 @@ +// + +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.GetByName(name) + for _, perk in pairs(nz.Perks.Data) do + if perk.name == name then + return perk + end + end + + return nil +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 = 2500, + func = function(self, ply, machine) + ply:SetMaxHealth(250) + ply:SetHealth(250) + return true + end, + lostfunc = function(self, ply) + ply:SetMaxHealth(100) + if ply:Health() > 100 then ply:SetHealth(100) end + 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 = 2000, + func = function(self, ply, machine) + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if v:IsFAS2() then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + for k,v in pairs(tbl) do + nz.Weps.Functions.ApplyDTap( ply, v ) + end + end + return true + end, + lostfunc = function(self, ply) + if !ply:HasPerk("dtap2") then + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if v:IsFAS2() then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + for k,v in pairs(tbl) do + nz.Weps.Functions.RemoveDTap( ply, v ) + end + end + 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 = 1500, + func = function(self, ply, machine) + if #player.GetAllPlaying() <= 1 then + if !ply.SoloRevive or ply.SoloRevive < 3 then + ply:ChatPrint("You got Quick Revive (Solo)!") + else + ply:ChatPrint("You can only get Quick Revive Solo 3 times.") + return false + end + end + --ply:PrintMessage( HUD_PRINTTALK, "You've got Quick Revive!") + return true + end, + lostfunc = function(self, ply) + + end, +}) + +nz.Perks.Functions.NewPerk("speed", { + name = "Speed Cola", + off_model = "models/alig96/perks/speed/speed_off.mdl", + on_model = "models/alig96/perks/speed/speed_on.mdl", + price = 3000, + func = function(self, ply, machine) + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if v:NZPerkSpecialTreatment() then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + --local str = "" + for k,v in pairs(tbl) do + nz.Weps.Functions.ApplySpeed( ply, v ) + --str = str .. v.ClassName .. ", " + end + --ply:PrintMessage( HUD_PRINTTALK, "Speed Cola Applied to: " .. str) + --[[else + ply:PrintMessage( HUD_PRINTTALK, "You don't have a weapon that is compatible with this perk. (Requires a FAS2 weapon)") + return false]] + end + return true + end, + lostfunc = function(self, ply) + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if v:NZPerkSpecialTreatment() then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + for k,v in pairs(tbl) do + nz.Weps.Functions.RemoveSpeed( ply, v ) + end + 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 = 0, + func = function(self, ply, machine) + local wep = ply:GetActiveWeapon() + if (!wep.pap or (wep:IsCW2() and CustomizableWeaponry)) and !machine:GetBeingUsed() then + local reroll = (wep.pap and wep.Attachments and ((wep:IsCW2() and CustomizableWeaponry) or wep:IsFAS2()) and true or false) + local cost = reroll and 2000 or 5000 + + if !ply:CanAfford(cost) then return end + ply:TakePoints(cost) + + machine:SetBeingUsed(true) + machine:EmitSound("nz/machines/pap_up.wav") + local class = wep:GetClass() + + wep:Remove() + local wep = ents.Create("pap_weapon_fly") + wep:SetPos(machine:GetPos() + machine:GetAngles():Forward()*30 + machine:GetAngles():Up()*25 + machine:GetAngles():Right()*-3) + wep:SetAngles(machine:GetAngles() + Angle(0,90,0)) + wep.WepClass = class + wep:Spawn() + local weapon = weapons.Get(class) + local model = weapon and weapon.WM or weapon.WorldModel or "models/weapons/w_rif_ak47.mdl" + if !util.IsValidModel(model) then model = "models/weapons/w_rif_ak47.mdl" end + wep:SetModel(model) + wep.machine = machine + wep.Owner = ply + wep:SetMoveType( MOVETYPE_FLY ) + + --wep:SetNotSolid(true) + --wep:SetGravity(0.000001) + --wep:SetCollisionBounds(Vector(0,0,0), Vector(0,0,0)) + timer.Simple(0.5, function() + if IsValid(wep) then + wep:SetLocalVelocity(machine:GetAngles():Forward()*-30) + end + end) + timer.Simple(1.8, function() + if IsValid(wep) then + wep:SetMoveType(MOVETYPE_NONE) + wep:SetLocalVelocity(Vector(0,0,0)) + end + end) + timer.Simple(3, function() + if IsValid(wep) then + machine:EmitSound("nz/machines/pap_ready.wav") + wep:SetCollisionBounds(Vector(0,0,0), Vector(0,0,0)) + wep:SetMoveType(MOVETYPE_FLY) + wep:SetGravity(0.000001) + wep:SetLocalVelocity(machine:GetAngles():Forward()*30) + --print(machine:GetAngles():Forward()*30, wep:GetVelocity()) + wep:CreateTriggerZone(reroll) + --print(reroll) + end + end) + timer.Simple(4.2, function() + if IsValid(wep) then + --print("YDA") + --print(wep:GetMoveType()) + --print(machine:GetAngles():Forward()*30, wep:GetVelocity()) + wep:SetMoveType(MOVETYPE_NONE) + wep:SetLocalVelocity(Vector(0,0,0)) + end + end) + timer.Simple(10, function() + if IsValid(wep) then + wep:SetMoveType(MOVETYPE_FLY) + wep:SetLocalVelocity(machine:GetAngles():Forward()*-2) + end + end) + timer.Simple(25, function() + if IsValid(wep) then + wep:Remove() + machine:SetBeingUsed(false) + end + end) + + --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 Pack-a-Punched") + return false + end + end, + lostfunc = function(self, ply) + + end, +}) + +nz.Perks.Functions.NewPerk("dtap2", { + name = "Double Tap II", + off_model = "models/alig96/perks/doubletap2/doubletap2_off.mdl", + on_model = "models/alig96/perks/doubletap2/doubletap2.mdl", + price = 2000, + func = function(self, ply, machine) + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if v:IsFAS2() then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + for k,v in pairs(tbl) do + nz.Weps.Functions.ApplyDTap( ply, v ) + end + end + return true + end, + lostfunc = function(self, ply) + if !ply:HasPerk("dtap") then + local tbl = {} + for k,v in pairs(ply:GetWeapons()) do + if v:IsFAS2() then + table.insert(tbl, v) + end + end + if tbl[1] != nil then + for k,v in pairs(tbl) do + nz.Weps.Functions.RemoveDTap( ply, v ) + end + end + end + end, +}) + +nz.Perks.Functions.NewPerk("staminup", { + name = "Stamin-Up", + off_model = "models/alig96/perks/staminup/staminup_off.mdl", + on_model = "models/alig96/perks/staminup/staminup.mdl", + price = 2000, + func = function(self, ply, machine) + ply:SetRunSpeed(350) + ply:SetMaxRunSpeed( 350 ) + ply:SetStamina( 200 ) + ply:SetMaxStamina( 200 ) + return true + end, + lostfunc = function(self, ply) + ply:SetRunSpeed(300) + ply:SetMaxRunSpeed( 300 ) + ply:SetStamina( 100 ) + ply:SetMaxStamina( 100 ) + end, +}) + +nz.Perks.Functions.NewPerk("phd", { + name = "PhD Flopper", + off_model = "models/alig96/perks/phd/phdflopper_off.mdl", + on_model = "models/alig96/perks/phd/phdflopper.mdl", + price = 2000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + end, +}) + +nz.Perks.Functions.NewPerk("deadshot", { + name = "Deadshot Daiquiri", + off_model = "models/alig96/perks/deadshot/deadshot_off.mdl", + on_model = "models/alig96/perks/deadshot/deadshot.mdl", + price = 2000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + end, +}) + +nz.Perks.Functions.NewPerk("mulekick", { + name = "Mule Kick", + off_model = "models/alig96/perks/mulekick/mulekick_off.mdl", + on_model = "models/alig96/perks/mulekick/mulekick.mdl", + price = 4000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + for k,v in pairs(ply:GetWeapons()) do + if v:GetNWInt("SwitchSlot") == 3 then + ply:StripWeapon(v:GetClass()) + end + end + end, +}) + +nz.Perks.Functions.NewPerk("tombstone", { + name = "Tombstone Soda", + off_model = "models/alig96/perks/tombstone/tombstone_off.mdl", + on_model = "models/alig96/perks/tombstone/tombstone.mdl", + price = 2000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + end, +}) + +nz.Perks.Functions.NewPerk("whoswho", { + name = "Who's Who", + off_model = "models/alig96/perks/whoswho/whoswho_off.mdl", + on_model = "models/alig96/perks/whoswho/whoswho.mdl", + price = 2000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + end, +}) + +nz.Perks.Functions.NewPerk("cherry", { + name = "Electric Cherry", + off_model = "models/alig96/perks/cherry/cherry_off.mdl", + on_model = "models/alig96/perks/cherry/cherry.mdl", + price = 2000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + end, +}) + +nz.Perks.Functions.NewPerk("vulture", { + name = "Vulture Aid Elixir", + off_model = "models/alig96/perks/vulture/vultureaid_off.mdl", + on_model = "models/alig96/perks/vulture/vultureaid.mdl", + price = 3000, + func = function(self, ply, machine) + return true + end, + lostfunc = function(self, ply) + end, +}) + +nz.Perks.Functions.NewPerk("wunderfizz", { + name = "Der Wunderfizz", -- Nothing more is needed, it is specially handled +}) diff --git a/nzombies3/gamemode/perks/sh_sync.lua b/gamemodes/nzombies3/gamemode/perks/sh_sync.lua similarity index 100% rename from nzombies3/gamemode/perks/sh_sync.lua rename to gamemodes/nzombies3/gamemode/perks/sh_sync.lua diff --git a/gamemodes/nzombies3/gamemode/perks/sv_solorevive.lua b/gamemodes/nzombies3/gamemode/perks/sv_solorevive.lua new file mode 100644 index 00000000..35f53199 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/perks/sv_solorevive.lua @@ -0,0 +1,29 @@ +function nz.Perks.Functions.UpdateQuickRevive() + if #player.GetAllPlaying() <= 1 then + for k,v in pairs(ents.FindByClass("perk_machine")) do + if v:GetPerkID() == "revive" then + v:SetPrice(500) -- Price is 500 for Solo variant and always on + v:TurnOn() + end + end + else + for k,v in pairs(ents.FindByClass("perk_machine")) do + if v:GetPerkID() == "revive" then + v:SetPrice(1500) -- Reset to default 1500 and turn off if power is not on + if !IsElec() then + v:TurnOff() + else + v:TurnOn() + end + end + end + end +end + +hook.Add("OnPlayerDropIn", "UpdateRevive", function() + nz.Perks.Functions.UpdateQuickRevive() +end) + +hook.Add("OnPlayerDropOut", "UpdateRevive", function() + nz.Perks.Functions.UpdateQuickRevive() +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/player_class/sh_constructor.lua b/gamemodes/nzombies3/gamemode/player_class/sh_constructor.lua new file mode 100644 index 00000000..887828d4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/player_class/sh_constructor.lua @@ -0,0 +1,28 @@ +//Main Tables +nz.Players = {} +nz.Players.Functions = {} +nz.Players.Data = {} + +//_ Variables + +//Stops players from moving if downed +hook.Add( "SetupMove", "FreezePlayersDowned", function( ply, mv, cmd ) + if !ply:GetNotDowned() then + mv:SetUpSpeed( 0 ) + cmd:SetUpMove( 0 ) + mv:SetSideSpeed( 0 ) + cmd:SetSideMove( 0 ) + mv:SetForwardSpeed( 0 ) + cmd:SetForwardMove( 0 ) + if cmd:KeyDown( IN_JUMP ) then + cmd:RemoveKey( IN_JUMP ) + end + if cmd:KeyDown( IN_DUCK ) then + cmd:RemoveKey( IN_DUCK ) + end + end +end ) + +hook.Add("PlayerSpawn", "SetupHands", function(ply) + ply:SetupHands() +end) diff --git a/gamemodes/nzombies3/gamemode/player_class/sh_player_create.lua b/gamemodes/nzombies3/gamemode/player_class/sh_player_create.lua new file mode 100644 index 00000000..ffe20338 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/player_class/sh_player_create.lua @@ -0,0 +1,38 @@ +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:SetupDataTables() + self.Player:NetworkVar("Bool", 0, "UsingSpecialWeapon") +end + +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_multi_tool" ) + +end + +function PLAYER:Spawn() + -- if we are in create or debuging make zombies target us + if nzRound:InState(ROUND_CREATE) or GetConVar( "nz_zombie_debug" ):GetBool() then --TODO this is bullshit? + self.Player:SetTargetPriority(TARGET_PRIORITY_PLAYER) + end + self.Player:SetUsingSpecialWeapon(false) +end + +player_manager.RegisterClass( "player_create", PLAYER, "player_default" ) diff --git a/gamemodes/nzombies3/gamemode/player_class/sh_player_ingame.lua b/gamemodes/nzombies3/gamemode/player_class/sh_player_ingame.lua new file mode 100644 index 00000000..2c638b2a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/player_class/sh_player_ingame.lua @@ -0,0 +1,78 @@ +DEFINE_BASECLASS( "player_default" ) + +local PLAYER = {} + +-- +-- See gamemodes/base/player_class/player_default.lua for all overridable variables +-- +PLAYER.WalkSpeed = 200 +PLAYER.RunSpeed = 300 +PLAYER.CanUseFlashlight = true + +function PLAYER:SetupDataTables() + self.Player:NetworkVar("Bool", 0, "UsingSpecialWeapon") +end + +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 + + if nzMapping.Settings.startwep then + self.Player:Give( nzMapping.Settings.startwep ) + else + -- A setting does not exist, give default starting weapons + for k,v in pairs(nzConfig.BaseStartingWeapons) do + self.Player:Give( v ) + end + end + nz.Weps.Functions.GiveMaxAmmo(self.Player) + + if !GetConVar("nz_papattachments"):GetBool() and FAS2_Attachments != nil then + for k,v in pairs(FAS2_Attachments) do + self.Player:FAS2_PickUpAttachment(v.key) + end + end + self.Player:Give("nz_quickknife_crowbar") + self.Player:Give("nz_grenade") + +end +function PLAYER:Spawn() + + if nzMapping.Settings.startpoints then + if !self.Player:CanAfford(nzMapping.Settings.startpoints) then + self.Player:SetPoints(nzMapping.Settings.startpoints) + end + else + if !self.Player:CanAfford(500) then -- Has less than 500 points + -- Poor guy has no money, lets start him off + self.Player:SetPoints(500) + end + end + + -- Reset their perks + self.Player:RemovePerks() + + -- activate zombie targeting + self.Player:SetTargetPriority(TARGET_PRIORITY_PLAYER) + + local spawns = ents.FindByClass("player_spawns") + -- Get player number + for k,v in pairs(player.GetAll()) do + if v == self.Player then + if IsValid(spawns[k]) then + v:SetPos(spawns[k]:GetPos()) + else + print("No spawn set for player: " .. v:Nick()) + end + end + end + + self.Player:SetUsingSpecialWeapon(false) +end + +player_manager.RegisterClass( "player_ingame", PLAYER, "player_default" ) diff --git a/gamemodes/nzombies3/gamemode/player_class/sv_healthregen.lua b/gamemodes/nzombies3/gamemode/player_class/sv_healthregen.lua new file mode 100644 index 00000000..a750d33d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/player_class/sv_healthregen.lua @@ -0,0 +1,21 @@ +local HealthRegen = { + Amount = 1, + Delay = 2, + Rate = 0.05 +} + +hook.Add( "Think", "RegenHealth", function() + for k,v in pairs( player.GetAll() ) do + + if v:Alive() and v:GetNotDowned() and v:Health() < v:GetMaxHealth() and (!v.lastregen or CurTime() > v.lastregen + HealthRegen.Rate) and (!v.lasthit or CurTime() > v.lasthit + HealthRegen.Delay) then + v.lastregen = CurTime() + v:SetHealth( math.Clamp(v:Health() + HealthRegen.Amount, 0, v:GetMaxHealth() ) ) + end + end +end ) + +hook.Add( "EntityTakeDamage", "PreventHealthRegen", function(ent, dmginfo) + if ent:IsPlayer() and ent:GetNotDowned() then + ent.lasthit = CurTime() + end +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/player_class/sv_players.lua b/gamemodes/nzombies3/gamemode/player_class/sv_players.lua new file mode 100644 index 00000000..90b7855c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/player_class/sv_players.lua @@ -0,0 +1,69 @@ +// + +function nz.Players.Functions.PlayerNoClip( ply, desiredState ) + -- We hardcode the "knife" special weapons category to be called from noclip + local wep = ply:GetSpecialWeaponFromCategory( "knife" ) + if IsValid(wep) and !ply:GetUsingSpecialWeapon() then + nzSpecialWeapons.Weapons[wep:GetClass()].use(ply, wep) + end + + if ply:Alive() and nzRound:InState( ROUND_CREATE ) then + return ply:IsSuperAdmin() + end +end + +function nz.Players.Functions.FullSync( ply ) + --Electric + --nzElec:SendSync() + --PowerUps + --nzPowerUps:SendSync() + --Doors + --nzDoors.SendSync( ply ) + --Perks + nz.Perks.Functions.SendSync() + --Rounds + --nzRound:SendSync( ply ) --handled differently since feb 2016 + --Revival System + --nz.Revive.Functions.SendSync() -- Now sends full sync using the module below + + -- A full sync module using the new rewrites + if IsValid(ply) then + ply:SendFullSync() + end +end + +local function initialSpawn( ply ) + timer.Simple(1, function() + -- Fully Sync + nz.Players.Functions.FullSync( ply ) + end) +end + +local function playerLeft( ply ) + -- this was previously hooked to PlayerDisconnected + -- it will now detect leaving players via entity removed, to take kicking banning etc into account. + if ply:IsPlayer() then + ply:DropOut() + end +end + +local function friendlyFire( ply, ent ) + if !ply:GetNotDowned() then return false end + if ent:IsPlayer() then + if ent == ply then + -- You can damage yourself, although PhD prevents this + if ply:HasPerk("phd") then return false else return true end + else + --Friendly fire is disabled for all other players TODO make hardcore setting? + return false + end + end +end + +function GM:PlayerNoClip( ply, desiredState ) + return nz.Players.Functions.PlayerNoClip(ply, desiredState) +end + +hook.Add( "PlayerInitialSpawn", "nzPlayerInitialSpawn", initialSpawn ) +hook.Add( "PlayerShouldTakeDamage", "nzFriendlyFire", friendlyFire ) +hook.Add( "EntityRemoved", "nzPlayerLeft", playerLeft ) diff --git a/gamemodes/nzombies3/gamemode/player_class/sv_sprint.lua b/gamemodes/nzombies3/gamemode/player_class/sv_sprint.lua new file mode 100644 index 00000000..dd451e6a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/player_class/sv_sprint.lua @@ -0,0 +1,70 @@ +local plymeta = FindMetaTable( "Player" ) + +AccessorFunc( plymeta, "fStamina", "Stamina", FORCE_NUMBER ) +AccessorFunc( plymeta, "fMaxStamina", "MaxStamina", FORCE_NUMBER ) +AccessorFunc( plymeta, "fLastStaminaRecover", "LastStaminaRecover", FORCE_NUMBER ) +AccessorFunc( plymeta, "fLastStaminaLoss", "LastStaminaLoss", FORCE_NUMBER ) +AccessorFunc( plymeta, "fStaminaLossAmount", "StaminaLossAmount", FORCE_NUMBER ) +AccessorFunc( plymeta, "fStaminaRecoverAmount", "StaminaRecoverAmount", FORCE_NUMBER ) +AccessorFunc( plymeta, "fMaxRunSpeed", "MaxRunSpeed", FORCE_NUMBER ) +AccessorFunc( plymeta, "bSprinting", "Sprinting", FORCE_BOOL ) + +function plymeta:IsSprinting() + return self:GetSprinting() +end + +hook.Add( "PlayerSpawn", "PlayerSprintSpawn", function( ply ) + + ply:SetSprinting( false ) + ply:SetStamina( 100 ) + ply:SetMaxStamina( 100 ) + + --The rate is fixed on 0.05 seconds + ply:SetStaminaLossAmount( 2 ) + ply:SetStaminaRecoverAmount( 4 ) + + ply:SetLastStaminaLoss( 0 ) + ply:SetLastStaminaRecover( 0 ) + + -- Delay this a bit - it seems like it takes the old sprint speed from last round state (Creative speed) + timer.Simple(0.1, function() if IsValid(ply) then ply:SetMaxRunSpeed( ply:GetRunSpeed() ) end end) + --print(player_manager.GetPlayerClass(ply)) + +end ) + + +hook.Add( "Think", "PlayerSprint", function() + if !nzRound:InState( ROUND_CREATE ) then + for _, ply in pairs( player.GetAll() ) do + if ply:Alive() and ply:GetNotDowned() and ply:IsSprinting() and ply:GetStamina() >= 0 and ply:GetLastStaminaLoss() + 0.05 <= CurTime() then + ply:SetStamina( math.Clamp( ply:GetStamina() - ply:GetStaminaLossAmount(), 0, ply:GetMaxStamina() ) ) + ply:SetLastStaminaLoss( CurTime() ) + + -- Delay the recovery a bit, you can't sprint instantly after + ply:SetLastStaminaRecover( CurTime() + 0.75 ) + + if ply:GetStamina() == 0 then + ply:SetRunSpeed( ply:GetWalkSpeed() ) + ply:SetSprinting( false ) + end + elseif ply:Alive() and ply:GetNotDowned() and !ply:IsSprinting() and ply:GetStamina() < ply:GetMaxStamina() and ply:GetLastStaminaRecover() + 0.05 <= CurTime() then + ply:SetStamina( math.Clamp( ply:GetStamina() + ply:GetStaminaRecoverAmount(), 0, ply:GetMaxStamina() ) ) + ply:SetLastStaminaRecover( CurTime() ) + end + --print( ply:GetStamina() ) + end + end +end ) + +hook.Add( "KeyPress", "OnSprintKeyPressed", function( ply, key ) + if !nzRound:InState( ROUND_CREATE ) and ( key == IN_SPEED ) then + ply:SetSprinting( true ) + end +end ) + +hook.Add( "KeyRelease", "OnSprintKeyReleased", function( ply, key ) + if !nzRound:InState( ROUND_CREATE ) and ( key == IN_SPEED ) then + ply:SetSprinting( false ) + ply:SetRunSpeed( ply:GetMaxRunSpeed() ) + end +end ) diff --git a/gamemodes/nzombies3/gamemode/points/sh_points.lua b/gamemodes/nzombies3/gamemode/points/sh_points.lua new file mode 100644 index 00000000..17aa9261 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/points/sh_points.lua @@ -0,0 +1,54 @@ +local _PLAYER = FindMetaTable("Player") + +function _PLAYER:GetPoints() + return self:GetNWInt("points") or 0 +end + +function _PLAYER:HasPoints(amount) + return self:GetPoints() >= amount +end + +function _PLAYER:CanAfford(amount) + return (self:GetPoints() - amount) >= 0 +end + + +if (SERVER) then + util.AddNetworkString("nz_points_notification") + -- Sets the character's amount of currency to a specific value. + function _PLAYER:SetPoints(amount) + amount = math.Round(amount, 2) + if !GetConVar("nz_point_notification_clientside"):GetBool() then + local num = amount - self:GetPoints() + if num != 0 then -- 0 points doesn't get sent + net.Start("nz_points_notification") + net.WriteInt(num, 20) + net.WriteEntity(self) + net.Broadcast() + end + end + self:SetNWInt("points", amount) + end + + -- Quick function to set the money to the current amount plus an amount specified. + function _PLAYER:GivePoints(amount) + //If double points is on. + if nzPowerUps:IsPowerupActive("dp") then + amount = amount * 2 + end + self:SetPoints(self:GetPoints() + amount) + end + + -- Takes away a certain amount by inverting the amount specified. + function _PLAYER:TakePoints(amount, nosound) + //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) + if !nosound then + self:EmitSound("nz/effects/buy.wav") + end + + -- If you have a clone like this, it tracks money spent which will be refunded on revival + if self.WhosWhoMoney then self.WhosWhoMoney = self.WhosWhoMoney + amount end + end + +end diff --git a/gamemodes/nzombies3/gamemode/powerups/sh_constructor.lua b/gamemodes/nzombies3/gamemode/powerups/sh_constructor.lua new file mode 100644 index 00000000..6b8b3d3b --- /dev/null +++ b/gamemodes/nzombies3/gamemode/powerups/sh_constructor.lua @@ -0,0 +1,7 @@ +-- Main Tables +nzPowerUps = nzPowerUps or {} +nzPowerUps.Data = nzPowerUps.Data or {} + +-- Tables storing the active powerups and their expiration time +nzPowerUps.ActivePowerUps = nzPowerUps.ActivePowerUps or {} +nzPowerUps.ActivePlayerPowerUps = nzPowerUps.ActivePlayerPowerUps or {} \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/powerups/sh_powerups.lua b/gamemodes/nzombies3/gamemode/powerups/sh_powerups.lua new file mode 100644 index 00000000..2c8d0787 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/powerups/sh_powerups.lua @@ -0,0 +1,233 @@ +-- + +if SERVER then + + local plyMeta = FindMetaTable("Player") + + function plyMeta:GivePowerUp(id, duration) + if !nzPowerUps.ActivePlayerPowerUps[self] then nzPowerUps.ActivePlayerPowerUps[self] = {} end + nzPowerUps.ActivePlayerPowerUps[self][id] = CurTime() + duration + end + + function nzPowerUps:Activate(id, ply) + local powerupData = self:Get(id) + + if !powerupData.global then + if powerupData.duration != 0 then + ply:GivePowerUp(id, powerupData.duration) + end + self:SendPlayerSync(ply) -- Sync this player's powerups + else + if powerupData.duration != 0 then + -- Activate for a certain time + self.ActivePowerUps[id] = CurTime() + powerupData.duration + --else + -- Activate Once + + end + -- Sync to everyone + self:SendSync() + end + + -- Notify + ply:EmitSound("nz/powerups/power_up_grab.wav") + powerupData.func(id, ply) + end + + function nzPowerUps:SpawnPowerUp(pos, specific) + local choices = {} + local total = 0 + + -- Chance it + if !specific then + for k,v in pairs(self.Data) do + if k != "ActivePowerUps" then + choices[k] = v.chance + total = total + v.chance + end + end + end + + local id = specific and specific or nzMisc.WeightedRandom(choices) + if !id or id == "null" then return end -- Back out + + -- Spawn it + local powerupData = self: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:SetAngles(powerupData.angle) + ent:Spawn() + ent:EmitSound("nz/powerups/power_up_spawn.wav") + end + +end + +function nzPowerUps:IsPowerupActive(id) + + local time = self.ActivePowerUps[id] + + if time != nil then + -- Check if it is still within the time. + if CurTime() > time then + -- Expired + self.ActivePowerUps[id] = nil + else + return true + end + end + + return false + +end + +function nzPowerUps:IsPlayerPowerupActive(ply, id) + + local time = self.ActivePlayerPowerUps[ply][id] + + if time then + -- Check if it is still within the time. + if CurTime() > time then + -- Expired + self.ActivePlayerPowerUps[ply][id] = nil + else + return true + end + end + + return false + +end + +function nzPowerUps:AllActivePowerUps() + + return self.ActivePowerUps + +end + +function nzPowerUps:NewPowerUp(id, data) + if SERVER then + -- Sanitise any client data. + else + data.Func = nil + end + self.Data[id] = data +end + +function nzPowerUps:Get(id) + return self.Data[id] +end + +-- Double Points +nzPowerUps:NewPowerUp("dp", { + name = "Double Points", + model = "models/nzpowerups/x2.mdl", + global = true, -- Global means it will appear for any player and will refresh its own time if more + angle = Angle(25,0,0), + scale = 1, + chance = 5, + duration = 30, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/double_points.mp3", 1) + end), +}) + +-- Max Ammo +nzPowerUps:NewPowerUp("maxammo", { + name = "Max Ammo", + model = "models/Items/BoxSRounds.mdl", + global = true, + angle = Angle(0,0,25), + 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 +nzPowerUps:NewPowerUp("insta", { + name = "Insta Kill", + model = "models/nzpowerups/insta.mdl", + global = true, + angle = Angle(0,0,0), + scale = 1, + chance = 5, + duration = 30, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/insta_kill.mp3", 1) + end), +}) + +-- Nuke +nzPowerUps:NewPowerUp("nuke", { + name = "Nuke", + model = "models/nzpowerups/nuke.mdl", + global = true, + angle = Angle(10,0,0), + scale = 1, + chance = 5, + duration = 0, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/nuke.wav", 1) + nzPowerUps:Nuke(ply:GetPos()) + end), +}) + +-- Fire Sale +nzPowerUps:NewPowerUp("firesale", { + name = "Fire Sale", + model = "models/nzpowerups/firesale.mdl", + global = true, + angle = Angle(45,0,0), + scale = 0.75, + chance = 1, + duration = 30, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/fire_sale_announcer.wav", 1) + nzPowerUps:FireSale() + end), +}) + +-- Carpenter +nzPowerUps:NewPowerUp("carpenter", { + name = "Carpenter", + model = "models/nzpowerups/carpenter.mdl", + global = true, + angle = Angle(45,0,0), + scale = 1, + chance = 5, + duration = 0, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/carpenter.wav", 0) + nz.Notifications.Functions.PlaySound("nz/powerups/carp_loop.wav", 1) + nzPowerUps:Carpenter() + end), +}) + +-- Zombie Blood +nzPowerUps:NewPowerUp("zombieblood", { + name = "Zombie Blood", + model = "models/nzpowerups/zombieblood.mdl", + global = false, -- Only applies to the player picking it up and time is handled individually per player + angle = Angle(0,0,0), + scale = 1, + chance = 2, + duration = 30, + func = (function(self, ply) + nz.Notifications.Functions.PlaySound("nz/powerups/zombie_blood.wav", 1) + ply:SetTargetPriority(TARGET_PRIORITY_NONE) + end), + expirefunc = function(self, ply) -- ply is only passed if the powerup is non-global + ply:SetTargetPriority(TARGET_PRIORITY_PLAYER) + end, +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/powerups/sh_sync.lua b/gamemodes/nzombies3/gamemode/powerups/sh_sync.lua new file mode 100644 index 00000000..f921e460 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/powerups/sh_sync.lua @@ -0,0 +1,78 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nzPowerUps.Sync" ) + util.AddNetworkString( "nzPowerUps.SyncPlayer" ) + util.AddNetworkString( "nzPowerUps.Nuke" ) -- See the nuke function in sv_powerups + + function nzPowerUps:SendSync(receiver) + local data = table.Copy(self.ActivePowerUps) + + net.Start( "nzPowerUps.Sync" ) + net.WriteTable( data ) + return IsValid(receiver) and net.Send(receiver) or net.Broadcast() + end + + function nzPowerUps:SendPlayerSync(ply, receiver) + if !self.ActivePlayerPowerUps[ply] then self.ActivePlayerPowerUps[ply] = {} end + local data = table.Copy(self.ActivePlayerPowerUps[ply]) + + net.Start( "nzPowerUps.SyncPlayer" ) + net.WriteEntity(ply) + net.WriteTable( data ) + return IsValid(receiver) and net.Send(receiver) or net.Broadcast() + end + + FullSyncModules["PowerUps"] = function(ply) + nzPowerUps:SendSync(ply) + for k,v in pairs(player.GetAll()) do + nzPowerUps:SendPlayerSync(v, ply) + end + end + +end + +if CLIENT then + + //Server to client (Client) + local function ReceivePowerupSync( length ) + print("Received PowerUps Sync") + nzPowerUps.ActivePowerUps = net.ReadTable() + PrintTable(nzPowerUps.ActivePowerUps) + end + + local function ReceivePowerupPlayerSync( length ) + print("Received PowerUps Player Sync") + local ply = net.ReadEntity() + nzPowerUps.ActivePlayerPowerUps[ply] = net.ReadTable() + PrintTable(nzPowerUps.ActivePlayerPowerUps) + end + + local function ReceiveNukeEffect() + local fade = 0 + local rising = true + hook.Add("RenderScreenspaceEffects", "DrawNukeEffect", function() + if rising then + fade = fade + 2000*FrameTime() + if fade >= 1000 then + fade = 255 + rising = false + end + else + fade = fade - 100*FrameTime() + if fade <= 0 then + hook.Remove("RenderScreenspaceEffects", "DrawNukeEffect") + end + end + surface.SetDrawColor(255,255,255,fade) + surface.DrawRect(-ScrW(),-ScrH(),ScrW()*2,ScrH()*2) + end) + end + + //Receivers + net.Receive( "nzPowerUps.Sync", ReceivePowerupSync ) + net.Receive( "nzPowerUps.SyncPlayer", ReceivePowerupPlayerSync ) + net.Receive( "nzPowerUps.Nuke", ReceiveNukeEffect ) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/powerups/sv_powerups.lua b/gamemodes/nzombies3/gamemode/powerups/sv_powerups.lua new file mode 100644 index 00000000..31055550 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/powerups/sv_powerups.lua @@ -0,0 +1,149 @@ +-- + +hook.Add("Think", "CheckActivePowerups", function() + for k,v in pairs(nzPowerUps.ActivePowerUps) do + if CurTime() >= v then + local func = nzPowerUps:Get(k).expirefunc + if func then func(id) end + nzPowerUps.ActivePowerUps[k] = nil + nzPowerUps:SendSync() + end + end + for k,v in pairs(nzPowerUps.ActivePlayerPowerUps) do + for id, time in pairs(v) do + if CurTime() >= time then + local func = nzPowerUps:Get(id).expirefunc + if func then func(id, k) end + nzPowerUps.ActivePlayerPowerUps[k][id] = nil + nzPowerUps:SendPlayerSync(k) + end + end + end +end) + +function nzPowerUps:Nuke(pos, nopoints, noeffect) + -- Kill them all + local highesttime = 0 + if pos and type(pos) == "Vector" then + for k,v in pairs(ents.GetAll()) do + if nzConfig.ValidEnemies[v:GetClass()] then + if IsValid(v) then + v:SetBlockAttack(true) -- They cannot attack now! + local insta = DamageInfo() + insta:SetDamage(v:Health()) + insta:SetAttacker(Entity(0)) + insta:SetDamageType(DMG_BLAST_SURFACE) + -- Delay the death by the distance from the position in milliseconds + local time = v:GetPos():Distance(pos)/1000 + if time > highesttime then highesttime = time end + timer.Simple(time, function() if IsValid(v) then v:TakeDamageInfo( insta ) end end) + end + end + end + else + for k,v in pairs(ents.GetAll()) do + if nzConfig.ValidEnemies[v:GetClass()] then + if IsValid(v) then + local insta = DamageInfo() + insta:SetDamage(v:Health()) + insta:SetAttacker(Entity(0)) + insta:SetDamageType(DMG_BLAST_SURFACE) + timer.Simple(0.1, function() if IsValid(v) then v:TakeDamageInfo( insta ) end end) + end + end + end + end + + -- Give the players a set amount of points + if !nopoints then + timer.Simple(highesttime, function() + if nzRound:InProgress() then -- Only if the game is still going! + for k,v in pairs(player.GetAll()) do + if v:IsPlayer() then + v:GivePoints(400) + end + end + end + end) + end + + if !noeffect then + net.Start("nzPowerUps.Nuke") + net.Broadcast() + end +end + +-- Add the sound so we can stop it again +sound.Add( { + name = "nz_firesale_jingle", + channel = CHAN_STATIC, + volume = 1.0, + level = 75, + pitch = { 100, 100 }, + sound = "nz/randombox/fire_sale.wav" +} ) + +function nzPowerUps:FireSale() + --print("Running") + -- Get all spawns + local all = ents.FindByClass("random_box_spawns") + + for k,v in pairs(all) do + if !v.HasBox then + if v != nil and !v.HasBox then + local box = ents.Create( "random_box" ) + box:SetPos( v:GetPos() ) + box:SetAngles( v:GetAngles() ) + box:Spawn() + --box:PhysicsInit( SOLID_VPHYSICS ) + box.SpawnPoint = v + v.FireSaleBox = box + + local phys = box:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + else + print("No random box spawns have been set.") + end + end + end + + for k,v in pairs(ents.FindByClass("random_box")) do + v:EmitSound("nz_firesale_jingle") + end +end + +function nzPowerUps:CleanUp() + -- Clear all powerups + for k,v in pairs(ents.FindByClass("drop_powerup")) do + v:Remove() + end + + -- Turn off all modifiers + table.Empty(self.ActivePowerUps) + -- Sync + self:SendSync() +end + +function nzPowerUps:Carpenter(nopoints) + -- Repair them all + for k,v in pairs(ents.FindByClass("breakable_entry")) do + if v:IsValid() then + for i=1, GetConVar("nz_difficulty_barricade_planks_max"):GetInt() do + if i > #v.Planks then + v:AddPlank() + end + end + end + end + + -- Give the players a set amount of points + if !nopoints then + for k,v in pairs(player.GetAll()) do + if v:IsPlayer() then + v:GivePoints(200) + end + end + end +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/q_menu/cl_menu.lua b/gamemodes/nzombies3/gamemode/q_menu/cl_menu.lua new file mode 100644 index 00000000..c3b0968e --- /dev/null +++ b/gamemodes/nzombies3/gamemode/q_menu/cl_menu.lua @@ -0,0 +1,344 @@ + +function nz.QMenu.Functions.CreatePropsMenu( ) + + //Create a Frame to contain everything. + nz.QMenu.Data.MainFrame = vgui.Create( "DFrame" ) + nz.QMenu.Data.MainFrame:SetTitle( "Props Menu" ) + nz.QMenu.Data.MainFrame:SetSize( 475, 340 ) + nz.QMenu.Data.MainFrame:Center() + nz.QMenu.Data.MainFrame:SetPopupStayAtBack(true) + nz.QMenu.Data.MainFrame:MakePopup() + nz.QMenu.Data.MainFrame:ShowCloseButton( true ) + nz.QMenu.Data.MainFrame:SetVisible( false ) + + local PropertySheet = vgui.Create( "DPropertySheet", nz.QMenu.Data.MainFrame ) + PropertySheet:SetPos( 10, 30 ) + PropertySheet:SetSize( 455, 300 ) + + //Loop to make all the tabs + local tabs = {} + tabs.Scrolls = {} + tabs.Lists = {} + + for k,v in pairs(nz.QMenu.Data.Categories) do + tabs.Scrolls[k] = vgui.Create( "DScrollPanel", nz.QMenu.Data.MainFrame ) + tabs.Scrolls[k]:SetSize( 455, 300 ) + tabs.Scrolls[k]:SetPos( 10, 30 ) + + tabs.Lists[k] = vgui.Create( "DIconLayout", tabs.Scrolls[k] ) + tabs.Lists[k]:SetSize( 440, 300 ) + 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 + + tabs.Scrolls["Entities"] = vgui.Create( "DScrollPanel", nz.QMenu.Data.MainFrame ) + tabs.Scrolls["Entities"]:SetSize( 455, 300 ) + tabs.Scrolls["Entities"]:SetPos( 10, 30 ) + + tabs.Lists["Entities"] = vgui.Create( "DIconLayout", tabs.Scrolls["Entities"] ) + tabs.Lists["Entities"]:SetSize( 440, 300 ) + tabs.Lists["Entities"]:SetPos( 0, 0 ) + tabs.Lists["Entities"]:SetSpaceY( 5 ) + tabs.Lists["Entities"]:SetSpaceX( 5 ) + PropertySheet:AddSheet( "Entities", tabs.Scrolls["Entities"], nil, false, false, v ) + + tabs.Scrolls["Search"] = vgui.Create( "DPanel", nz.QMenu.Data.MainFrame ) + tabs.Scrolls["Search"]:SetSize( 455, 300 ) + tabs.Scrolls["Search"]:SetPos( 10, 30 ) + + tabs.Scrolls["Search"].Warn = vgui.Create( "DLabel", tabs.Scrolls["Search"] ) + tabs.Scrolls["Search"].Warn:SetSize( 420, 20 ) + tabs.Scrolls["Search"].Warn:SetPos( 60, 5 ) + tabs.Scrolls["Search"].Warn:SetTextColor( Color(0,0,0) ) + tabs.Scrolls["Search"].Warn:SetText("Warning: May cause severe lag and/or crash. Be sure to save first.") + + tabs.Scrolls["Search"].Search = vgui.Create( "DTextEntry", tabs.Scrolls["Search"] ) + tabs.Scrolls["Search"].Search:SetSize( 420, 20 ) + tabs.Scrolls["Search"].Search:SetPos( 10, 25 ) + tabs.Scrolls["Search"].Search.OnEnter = function() tabs.Scrolls["Search"]:RefreshResults() end + tabs.Scrolls["Search"].Search:SetTooltip("Press Enter to search/update results") + + tabs.Scrolls["Search"].Content = vgui.Create( "DScrollPanel", tabs.Scrolls["Search"] ) + tabs.Scrolls["Search"].Content:SetSize( 430, 210 ) + tabs.Scrolls["Search"].Content:SetPos( 0, 50 ) + + tabs.Lists["Search"] = vgui.Create( "DIconLayout", tabs.Scrolls["Search"].Content ) + tabs.Lists["Search"]:SetSize( 440, 210 ) + tabs.Lists["Search"]:SetPos( 10, 00 ) + tabs.Lists["Search"]:SetSpaceY( 5 ) + tabs.Lists["Search"]:SetSpaceX( 5 ) + + function tabs.Scrolls.Search:RefreshResults() + --print(self.Search:GetText(), "Refresh") + if ( self.Search:GetText() == "" ) then return end + local pnl = tabs.Lists["Search"] + pnl:Clear() + local results = search.GetResults( self.Search:GetText() ) + --PrintTable(results) + for k,v in pairs(results) do + local ListItem = pnl:Add( "SpawnIcon" ) + ListItem:SetSize( 45, 45 ) + ListItem:SetModel(v) + ListItem.Model = v + ListItem.DoClick = function( item ) + nz.QMenu.Functions.Request(item.Model) + surface.PlaySound( "ui/buttonclickrelease.wav" ) + end + end + end + + PropertySheet:AddSheet( "Search", tabs.Scrolls["Search"], "icon16/magnifier.png", false, false, v ) + + hook.Add( "SearchUpdate", "SearchUpdate", function() + if ( !tabs.Scrolls["Search"]:IsVisible() ) then return end + tabs.Scrolls["Search"]:RefreshResults() + end) + + for k,v in pairs(nz.QMenu.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( 48, 48 ) //Set the size of it + ListItem:SetModel(v[2]) + ListItem.Model = v[2] + ListItem.DoClick = function( item ) + nz.QMenu.Functions.Request(item.Model) + surface.PlaySound( "ui/buttonclickrelease.wav" ) + end + //You don't need to set the position, that is done automatically. + + end + + for k,v in pairs(nz.QMenu.Data.Entities) do //Make a loop to create a bunch of panels inside of the DIconLayout + local ListItem = tabs.Lists["Entities"]:Add( "DImageButton" ) //Add DPanel to the DIconLayout + ListItem:SetSize( 48, 48 ) //Set the size of it + ListItem:SetImage(v[2]) + ListItem.Entity = v[1] + ListItem.DoClick = function( item ) + nz.QMenu.Functions.Request(item.Entity, true) + surface.PlaySound( "ui/buttonclickrelease.wav" ) + end + ListItem:SetTooltip(v[3] or v[1]) + //You don't need to set the position, that is done automatically. + + end + +end + +function nz.QMenu.Functions.CreateToolsMenu( ) + + //Create a Frame to contain everything. + nz.QMenu.Data.MainFrame = vgui.Create( "DFrame" ) + --nz.QMenu.Data.MainFrame:SetTitle( "Tools Menu" ) + nz.QMenu.Data.MainFrame:SetSize( 465, 300 ) + nz.QMenu.Data.MainFrame:Center() + nz.QMenu.Data.MainFrame:MakePopup() + nz.QMenu.Data.MainFrame:ShowCloseButton( true ) + nz.QMenu.Data.MainFrame:SetTitle("") + nz.QMenu.Data.MainFrame.Paint = function(self, w, h) end + nz.QMenu.Data.MainFrame.ToolMode = true + nz.QMenu.Data.MainFrame:MakePopup() + + local ToolPanel = vgui.Create("DFrame", nz.QMenu.Data.MainFrame ) + ToolPanel:SetPos( 305, 25 ) + ToolPanel:SetSize( 155, 260 ) + ToolPanel:SetZPos(-30) + ToolPanel:ShowCloseButton(false) + ToolPanel:SetDraggable(false) + ToolPanel:SetTitle("Tool List") + + local ToolInterface = vgui.Create("DFrame", nz.QMenu.Data.MainFrame ) + ToolInterface:SetPos( 0, 0 ) + ToolInterface:SetSize( 310, 300 ) + ToolInterface:ShowCloseButton(false) + ToolInterface:SetDraggable(true) + ToolInterface:SetTitle(nz.Tools.ToolData[LocalPlayer():GetActiveWeapon().ToolMode or "default"].displayname) + + local FrameMerge = vgui.Create("DPanel", nz.QMenu.Data.MainFrame ) + FrameMerge:SetPos( 308, 49 ) + FrameMerge:SetSize( 4, 235 ) + FrameMerge.Paint = function(self, w, h) + surface.SetDrawColor(96, 100, 103) + surface.DrawRect(0, 0, w, h) + end + + local ToolList = vgui.Create( "DScrollPanel", nz.QMenu.Data.MainFrame ) + ToolList:SetPos( 305, 58 ) + ToolList:SetSize( 150, 220 ) + + local ToolData = vgui.Create("DPanel", ToolInterface ) + ToolData:SetPos( 5, 30 ) + ToolData:SetSize( 300, 265 ) + + //Loop to make all the tabs + local tabs = {} + tabs.Tools = {} + local curtool = nil + local numtools = 0 + + local function RebuildToolInterface(id) + --print(ToolData.interface) + if nz.Tools.ToolData[id] then + if ToolData.interface then ToolData.interface:Remove() end + ToolData.interface = nz.Tools.ToolData[id].interface(ToolData, nz.Tools.SavedData[id]) + + if tabs.Tools[curtool] then tabs.Tools[curtool]:SetBackgroundColor( Color(150, 150, 150) ) end + if tabs.Tools[id] then tabs.Tools[id]:SetBackgroundColor( Color(255, 255, 255) ) end + ToolInterface:SetTitle(nz.Tools.ToolData[id or "default"].displayname) + curtool = id + + if !IsValid(ToolData.interface) then + ToolData.interface = vgui.Create("DLabel", ToolData) + ToolData.interface:SetText("This tool does not have any properties.") + ToolData.interface:SetFont("Trebuchet18") + ToolData.interface:SetTextColor( Color(50, 50, 50) ) + ToolData.interface:SizeToContents() + ToolData.interface:Center() + return end + end + end + + local function RebuildToolList() + for k,v in pairs(tabs.Tools) do + v:Remove() + numtools = 0 + end + local tbl = {} + + -- Create a new cloned table that we can sort by weight + for k,v in pairs(nz.Tools.ToolData) do + if !nz.Tools.SavedData[k] then + nz.Tools.SavedData[k] = v.defaultdata + end + local num = table.insert(tbl, v) + tbl[num].id = k + end + table.SortByMember(tbl, "weight", true) + + for k,v in pairs(tbl) do + if v.condition(LocalPlayer():GetActiveWeapon(), LocalPlayer()) then + tabs.Tools[v.id] = vgui.Create("DPanel", ToolList) + tabs.Tools[v.id]:SetSize(145, 20) + tabs.Tools[v.id]:SetPos(0, 0 + numtools*22) + tabs.Tools[v.id]:SetZPos(30000) + if LocalPlayer():GetActiveWeapon().ToolMode and LocalPlayer():GetActiveWeapon().ToolMode == k then + tabs.Tools[v.id]:SetBackgroundColor( Color(255, 255, 255) ) + RebuildToolInterface(v.id) + else + tabs.Tools[v.id]:SetBackgroundColor( Color(150, 150, 150) ) + end + + local icon = vgui.Create("DImage", tabs.Tools[v.id]) + icon:SetImage(v.icon) + icon:SetPos(3,3) + icon:SizeToContents() + + local tooltext = vgui.Create("DLabel", tabs.Tools[v.id]) + tooltext:SetText(v.displayname) + tooltext:SetTextColor( Color(10, 10, 10) ) + tooltext:SetPos(24,3) + tooltext:SizeToContents() + + local toolbutton = vgui.Create("DButton", tabs.Tools[v.id]) + toolbutton:SetPos(0,0) + toolbutton:SetSize(145, 20) + toolbutton:SetText("") + toolbutton.Paint = function() end + toolbutton.DoClick = function() + local wep = LocalPlayer():GetActiveWeapon() + if wep and wep:GetClass() == "nz_multi_tool" then + LocalPlayer():GetActiveWeapon():SwitchTool(v.id) + RebuildToolInterface(v.id) + end + end + + numtools = numtools + 1 + end + end + end + RebuildToolList() + RebuildToolInterface(LocalPlayer():GetActiveWeapon().ToolMode or "default") + + ToolInterface.OnFocusChanged = function(self, bool) + if bool then + //Keep the design here, the buttons are supposed to leak into the main frame + self:SetZPos(-10) + end + end + + local advanced = vgui.Create("DCheckBoxLabel", ToolInterface) + advanced:SetPos(200, 6) + advanced:SetText("Advanced Mode") + advanced:SetValue(nz.Tools.Advanced) + advanced:SizeToContents() + advanced.OnChange = function(self) + nz.Tools.Advanced = self:GetChecked() + RebuildToolList() + RebuildToolInterface(LocalPlayer():GetActiveWeapon().ToolMode or "default") + end + +end + +function nz.QMenu.Functions.Open() + //Check if we're in create mode + if nzRound:InState( ROUND_CREATE ) and LocalPlayer():IsSuperAdmin() then + if !IsValid(nz.QMenu.Data.MainFrame) then + if IsValid(LocalPlayer():GetActiveWeapon()) and LocalPlayer():GetActiveWeapon():GetClass() == "nz_multi_tool" then + nz.QMenu.Functions.CreateToolsMenu() + else + nz.QMenu.Functions.CreatePropsMenu() + end + end + + //If the toolgun is equipped and the menu isn't the toolmenu or vice versa, recreate + if IsValid(LocalPlayer():GetActiveWeapon()) and LocalPlayer():GetActiveWeapon():GetClass() == "nz_multi_tool" and !nz.QMenu.Data.MainFrame.ToolMode then + nz.QMenu.Data.MainFrame:Remove() + nz.QMenu.Functions.CreateToolsMenu() + elseif IsValid(LocalPlayer():GetActiveWeapon()) and LocalPlayer():GetActiveWeapon():GetClass() != "nz_multi_tool" and nz.QMenu.Data.MainFrame.ToolMode then + nz.QMenu.Data.MainFrame:Remove() + nz.QMenu.Functions.CreatePropsMenu() + end + + nz.QMenu.Data.MainFrame:SetVisible( true ) + end +end + +local textentryfocus = false + +function nz.QMenu.Functions.Close() + + //We don't want to close if we're currently typing + if textentryfocus then return end + + if !IsValid(nz.QMenu.Data.MainFrame) then + if IsValid(LocalPlayer():GetActiveWeapon()) and LocalPlayer():GetActiveWeapon():GetClass() == "nz_multi_tool" then + nz.QMenu.Functions.CreateToolsMenu() + else + nz.QMenu.Functions.CreatePropsMenu() + end + end + + nz.QMenu.Data.MainFrame:SetVisible( false ) + nz.QMenu.Data.MainFrame:KillFocus() + nz.QMenu.Data.MainFrame:SetKeyboardInputEnabled(false) + textentryfocus = false +end + +hook.Add( "OnSpawnMenuOpen", "OpenSpawnMenu", nz.QMenu.Functions.Open ) +hook.Add( "OnSpawnMenuClose", "CloseSpawnMenu", nz.QMenu.Functions.Close ) + +hook.Add( "OnTextEntryGetFocus", "StartTextFocus", function(panel) + textentryfocus = true + if IsValid(nz.QMenu.Data.MainFrame) then + nz.QMenu.Data.MainFrame:SetKeyboardInputEnabled(true) + end +end ) +hook.Add( "OnTextEntryLoseFocus", "EndTextFocus", function(panel) + textentryfocus = false + TextEntryLoseFocus() + if IsValid(nz.QMenu.Data.MainFrame) then + nz.QMenu.Data.MainFrame:KillFocus() + nz.QMenu.Data.MainFrame:SetKeyboardInputEnabled(false) + end +end ) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/q_menu/cl_search_models.lua b/gamemodes/nzombies3/gamemode/q_menu/cl_search_models.lua new file mode 100644 index 00000000..8a11b720 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/q_menu/cl_search_models.lua @@ -0,0 +1,63 @@ + +-- A copy paste of the sandbox one, but only for mdoels + +local function GetAllFiles( tab, folder, extension, path ) + + local files, folders = file.Find( folder .. "/*", path ) + + for k, v in pairs( files ) do + + if ( v:EndsWith( extension ) ) then + table.insert( tab, (folder .. v):lower() ) + end + + end + + for k, v in pairs( folders ) do + timer.Simple( k * 0.1, function() + GetAllFiles( tab, folder .. v .. "/", extension, path ) + end ) + end + + if ( folder == "models/" ) then + hook.Run( "SearchUpdate" ) + end + +end + + +local model_list = nil +-- +-- Model Search +-- +search.AddProvider( function( str ) + + str = str:PatternSafe() + + if ( model_list == nil ) then + + model_list = {} + GetAllFiles( model_list, "models/", ".mdl", "GAME" ) + timer.Simple( 1, function() hook.Run( "SearchUpdate" ) end ) + + end + + local list = {} + + for k, v in pairs( model_list ) do + + if ( v:find( str ) ) then + + if ( IsUselessModel( v ) ) then continue end + + table.insert( list, v ) + + end + + if ( #list >= 128 ) then break end + + end + + return list + +end ); \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/q_menu/sh_constructor.lua b/gamemodes/nzombies3/gamemode/q_menu/sh_constructor.lua new file mode 100644 index 00000000..0cee549c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/q_menu/sh_constructor.lua @@ -0,0 +1,11 @@ +//Main Tables +nz.QMenu = {} +nz.QMenu.Functions = {} +nz.QMenu.Data = {} + +nz.QMenu.Data.SpawnedEntities = {} + +//sh_populate +nz.QMenu.Data.Models = {} +nz.QMenu.Data.Categories = {} +nz.QMenu.Data.Entities = {} \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/q_menu/sh_net.lua b/gamemodes/nzombies3/gamemode/q_menu/sh_net.lua new file mode 100644 index 00000000..1f49d692 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/q_menu/sh_net.lua @@ -0,0 +1,50 @@ +//Client Server Syncing + +if CLIENT then + + //Client to Server (Client) + function nz.QMenu.Functions.Request( model, entity ) + local entity = entity or false + net.Start( "nz.QMenu.Request" ) + net.WriteString( model ) + net.WriteBool( entity ) + net.SendToServer() + end + +end + +if SERVER then + + //Client to Server (Server) + util.AddNetworkString( "nz.QMenu.Request" ) + + function nz.QMenu.Functions.HandleRequest( len, ply ) + local model = net.ReadString() + local entity = net.ReadBool() + if nzRound:InState( 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 ) + if entity then + nzMapping:SpawnEntity(trace.HitPos, Angle(0,0,0), model, ply) + else + if util.IsValidProp(model) then + nzMapping:PropBuy(trace.HitPos, Angle(0,0,0), model, nil, ply) + else + nzMapping:SpawnEffect(trace.HitPos, Angle(0,0,0), model, ply) + end + end + //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.QMenu.Request", nz.QMenu.Functions.HandleRequest ) + +end diff --git a/gamemodes/nzombies3/gamemode/q_menu/sh_populate.lua b/gamemodes/nzombies3/gamemode/q_menu/sh_populate.lua new file mode 100644 index 00000000..a76b0543 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/q_menu/sh_populate.lua @@ -0,0 +1,312 @@ +// + +function nz.QMenu.Functions.AddNewCategory( text, tooltip ) + if tooltip == nil then + tooltip = true + end + nz.QMenu.Data.Categories[text] = tooltip +end + +function nz.QMenu.Functions.AddNewModel( cat, model ) + table.insert(nz.QMenu.Data.Models, {cat, model}) +end + +function nz.QMenu.Functions.AddNewEntity( ent, icon, name ) + table.insert(nz.QMenu.Data.Entities, {ent, icon, name}) +end + +//QuickFunctions + +PropMenuAddCat = nz.QMenu.Functions.AddNewCategory +PropMenuAddModel = nz.QMenu.Functions.AddNewModel +PropMenuAddEntity = nz.QMenu.Functions.AddNewEntity + +//Use +PropMenuAddCat("Light Effects") +PropMenuAddModel("Light Effects", "models/effects/vol_light.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light01.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light02.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light128x128.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light128x256.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light128x384.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light128x512.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light256x512.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light64x128.mdl") +PropMenuAddModel("Light Effects", "models/effects/vol_light64x256.mdl") +PropMenuAddModel("Light Effects", "models/effects/lightshaft/lightshaft_2fortspawnext.mdl") +PropMenuAddModel("Light Effects", "models/effects/lightshaft/lightshaft_window01.mdl") +PropMenuAddModel("Light Effects", "models/lostcoast/effects/vollight_stainedglass.mdl") +PropMenuAddModel("Light Effects", "models/props/cs_militia/bridgelight.mdl") + +PropMenuAddCat("Gates") +PropMenuAddModel("Gates", "models/props_c17/fence03a.mdl") +PropMenuAddModel("Gates", "models/props_c17/fence02b.mdl") +PropMenuAddModel("Gates", "models/props_c17/fence01b.mdl") +PropMenuAddModel("Gates", "models/props_c17/gate_door01a.mdl") +PropMenuAddModel("Gates", "models/props_c17/gate_door02a.mdl") +PropMenuAddModel("Gates", "models/props_building_details/Storefront_Template001a_Bars.mdl") +PropMenuAddModel("Gates", "models/props_borealis/borealis_door001a.mdl") +PropMenuAddModel("Gates", "models/props_wasteland/interior_fence001g.mdl") +PropMenuAddModel("Gates", "models/props_wasteland/interior_fence002d.mdl") +PropMenuAddModel("Gates", "models/props_wasteland/wood_fence01a.mdl") +PropMenuAddModel("Gates", "models/props_lab/blastdoor001a.mdl") +PropMenuAddModel("Gates", "models/props_lab/blastdoor001b.mdl") +PropMenuAddModel("Gates", "models/props_lab/blastdoor001c.mdl") +PropMenuAddModel("Gates", "models/props_wasteland/wood_fence02a.mdl") +PropMenuAddModel("Gates", "models/props_wasteland/prison_celldoor001b.mdl") +PropMenuAddModel("Gates", "models/props_interiors/ElevatorShaft_Door01a.mdl") + +PropMenuAddModel("Gates", "models/props_debris/metal_panel01a.mdl") +PropMenuAddModel("Gates", "models/props_debris/metal_panel02a.mdl") +PropMenuAddModel("Gates", "models/props_doors/door03_slotted_left.mdl") +PropMenuAddModel("Gates", "models/props_interiors/VendingMachineSoda01a_door.mdl") +PropMenuAddModel("Gates", "models/props_wasteland/interior_fence002e.mdl") +PropMenuAddModel("Gates", "models/props_interiors/refrigeratorDoor01a.mdl") +PropMenuAddModel("Gates", "models/props_c17/door01_left.mdl") +PropMenuAddModel("Gates", "models/props_c17/door02_double.mdl") +PropMenuAddModel("Gates", "models/props_c17/gravestone_coffinpiece001a.mdl") +PropMenuAddModel("Gates", "models/props_c17/gravestone_coffinpiece002a.mdl") +PropMenuAddModel("Gates", "models/props_junk/TrashDumpster02b.mdl") + +PropMenuAddCat("Scenery") +PropMenuAddModel("Scenery", "models/props_borealis/bluebarrel001.mdl") +PropMenuAddModel("Scenery", "models/props_interiors/Furniture_shelf01a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/TrashDumpster02.mdl") +PropMenuAddModel("Scenery", "models/props_interiors/VendingMachineSoda01a.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/laundry_dryer001.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/laundry_dryer002.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/kitchen_stove002a.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/controlroom_storagecloset001b.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/medbridge_post01.mdl") +PropMenuAddModel("Scenery", "models/props_c17/signpole001.mdl") + +PropMenuAddModel("Scenery", "models/props_trainstation/traincar_seats001.mdl") +PropMenuAddModel("Scenery", "models/props_vehicles/carparts_door01a.mdl") +PropMenuAddModel("Scenery", "models/props_lab/securitybank.mdl") +PropMenuAddModel("Scenery", "models/props_lab/reciever_cart.mdl") +PropMenuAddModel("Scenery", "models/props_lab/crematorcase.mdl") +PropMenuAddModel("Scenery", "models/props_lab/corkboard002.mdl") +PropMenuAddModel("Scenery", "models/props_lab/corkboard001.mdl") +PropMenuAddModel("Scenery", "models/props_lab/Cleaver.mdl") +PropMenuAddModel("Scenery", "models/props_lab/cactus.mdl") +PropMenuAddModel("Scenery", "models/props_trainstation/payphone001a.mdl") +PropMenuAddModel("Scenery", "models/props_lab/workspace003.mdl") +PropMenuAddModel("Scenery", "models/props_lab/workspace004.mdl") +PropMenuAddModel("Scenery", "models/props_lab/workspace002.mdl") +PropMenuAddModel("Scenery", "models/props_lab/workspace001.mdl") +PropMenuAddModel("Scenery", "models/props_lab/tpplugholder.mdl") +PropMenuAddModel("Scenery", "models/props_lab/tpplugholder_single.mdl") +PropMenuAddModel("Scenery", "models/props_lab/tpplug.mdl") +PropMenuAddModel("Scenery", "models/props_lab/servers.mdl") +PropMenuAddModel("Scenery", "models/props_vehicles/carparts_tire01a.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_monitorbay.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_interface001.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_intmonitor001.mdl") +PropMenuAddModel("Scenery", "models/props_combine/CombineThumper002.mdl") +PropMenuAddModel("Scenery", "models/props_combine/CombineThumper001a.mdl") +PropMenuAddModel("Scenery", "models/props_combine/breendesk.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_barricade_short02a.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_bridge_b.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_fence01a.mdl") +PropMenuAddModel("Scenery", "models/props_combine/combine_fence01b.mdl") +PropMenuAddModel("Scenery", "models/props_combine/weaponstripper.mdl") + +PropMenuAddEntity("edit_fog", "entities/edit_fog.png", "Base Fog Editor") +PropMenuAddEntity("edit_fog_special", "entities/edit_fog.png", "Special Round Fog Editor") +PropMenuAddEntity("edit_sky", "entities/edit_sky.png", "Sky Editor") +PropMenuAddEntity("edit_sun", "entities/edit_sun.png", "Sun Editor") +PropMenuAddEntity("edit_color", "gmod/demo.png", "Color Correction Editor") +PropMenuAddEntity("nz_fire_effect", "icon16/fire.png", "Fire Effect") + +PropMenuAddModel("Scenery", "models/nzprops/zombies_power_lever.mdl") +PropMenuAddModel("Scenery", "models/nzprops/zombies_power_lever_handle.mdl") +PropMenuAddModel("Scenery", "models/nzprops/zombies_power_lever_short.mdl") + +--Random Assortment of Crap (Thanks to Logan) +PropMenuAddModel("Scenery", "models/props_c17/canister01a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/canister02a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/canister_propane01a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/bench01a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/chair02a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/concrete_barrier001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureChair001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureCouch001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureCouch002a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureCupboard001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureDrawer001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureDrawer002a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureDresser001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureFridge001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureRadiator001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureShelf001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/furnitureStove001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/FurnitureWashingmachine001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/gravestone_cross001b.mdl") +PropMenuAddModel("Scenery", "models/props_c17/gravestone_statue001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/Lockers001a.mdl") +PropMenuAddModel("Scenery", "models/props_c17/oildrum001.mdl") +PropMenuAddModel("Scenery", "models/props_c17/shelfunit01a.mdl") +PropMenuAddModel("Scenery", "models/props_combine/breenchair.mdl") +PropMenuAddModel("Scenery", "models/props_interiors/Furniture_Couch01a.mdl") +PropMenuAddModel("Scenery", "models/props_interiors/Furniture_Couch02a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/MetalBucket02a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/metalgascan.mdl") +PropMenuAddModel("Scenery", "models/props_junk/PushCart01a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/sawblade001a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/TrashBin01a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/TrashDumpster01a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/wood_crate001a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/wood_crate002a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/wood_pallet001a.mdl") +PropMenuAddModel("Scenery", "models/props_lab/filecabinet02.mdl") +PropMenuAddModel("Scenery", "models/props_trainstation/trashcan_indoor001a.mdl") +PropMenuAddModel("Scenery", "models/props_trainstation/trashcan_indoor001b.mdl") +PropMenuAddModel("Scenery", "models/props_vehicles/tire001a_tractor.mdl") +PropMenuAddModel("Scenery", "models/props_vehicles/tire001b_truck.mdl") +PropMenuAddModel("Scenery", "models/props_vehicles/tire001c_car.mdl") +PropMenuAddModel("Scenery", "models/props_vehicles/apc_tire001.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/barricade001a.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/barricade002a.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/cargo_container01.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/cargo_container01b.mdl") +PropMenuAddModel("Scenery", "models/props_wasteland/laundry_washer003.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage128_composite001a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage128_composite001b.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage128_composite001c.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage128_composite001d.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage256_composite001a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage256_composite001b.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage256_composite002a.mdl") +PropMenuAddModel("Scenery", "models/props_junk/garbage256_composite002b.mdl") + +--Destoyed boats/vehicles +PropMenuAddCat("Vehicles") +PropMenuAddModel("Vehicles", "models/props_canal/boat001a.mdl") +PropMenuAddModel("Vehicles", "models/props_canal/boat001b.mdl") +PropMenuAddModel("Vehicles", "models/props_canal/boat002b.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car002a_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car001b_hatchback.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car001a_hatchback.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/apc001.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car002b_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car003a_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car003b_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car004a_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car004b_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car005a_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/car005b_physics.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/tanker001a.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/generatortrailer01.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/trailer002a.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/truck001a.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/truck002a_cab.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/truck003a.mdl") +PropMenuAddModel("Vehicles", "models/props_vehicles/van001a_physics.mdl") + +--Foliage +PropMenuAddCat("Foliage") +PropMenuAddModel("Foliage", "models/props_foliage/tree_springers_01a-lod.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_springers_01a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_springers_card_01_skybox.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/bramble001a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/cattails.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/driftwood_01a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/driftwood_02a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/driftwood_03a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/driftwood_clump_01a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/driftwood_clump_02a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/driftwood_clump_03a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/ivy_01.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/oak_tree01.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/shrub_01a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_cliff_01a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_cliff_02a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_deciduous_01a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_deciduous_03a.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_deciduous_03b.mdl") +PropMenuAddModel("Foliage", "models/props_foliage/tree_poplar_01.mdl") + +PropMenuAddCat("Wall Pieces") +PropMenuAddModel("Wall Pieces", "models/props_debris/plaster_wall001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/plaster_wall002a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed06b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed07b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed05a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/tile_wall001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/tile_wall001a_base.mdl") +PropMenuAddModel("Wall Pieces", "models/lostcoast/props_monastery/destroyed_walls02.mdl") +PropMenuAddModel("Wall Pieces", "models/lostcoast/props_monastery/destroyed_walls03.mdl") +PropMenuAddModel("Wall Pieces", "models/props_buildings/collapsedbuilding01awall.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_section128wall001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_section128wall001b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_section128wall001c.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_section128wall002a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_wall01a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_wall02a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/tile_wall001a_core.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/wall001a_base.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed01a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed02a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed03a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/walldestroyed08a.mdl") +PropMenuAddModel("Wall Pieces", "models/props/cs_militia/bathroomwallhole01_tile.mdl") +PropMenuAddModel("Wall Pieces", "models/props/cs_militia/bathroomwallhole01_wood_broken_01.mdl") +PropMenuAddModel("Wall Pieces", "models/props/cs_militia/bathroomwallhole01_wood_broken.mdl") +PropMenuAddModel("Wall Pieces", "models/props/cs_militia/wallconcretehole.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenexterior001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenexterior001b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenexterior001c.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenexterior002a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenexterior002b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenexterior002c.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_spawnhole001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_spawnplug001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_wall01a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/concrete_wall02a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/destroyedceiling01a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/destroyedceiling01b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/destroyedceiling01c.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/destroyedceiling01d.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/broken_floor001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/broken_pile001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_short01a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_short02a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_short03a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_short04a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_tall01a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_tall02a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_tall03a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/barricade_tall04a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenwindow001a.mdl") +PropMenuAddModel("Wall Pieces", "models/props_debris/building_brokenwindow001b.mdl") +PropMenuAddModel("Wall Pieces", "models/props_unique/zombiebreakwallcoreframe01_dm.mdl") + +PropMenuAddCat("Apocalyptic") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/barbwire_blockade.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/barbwire_long.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/barbwire_gate.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/barbwire_tube.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/sandbag_blockade.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse01.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse02.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse03.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse04.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse04stick.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse05.mdl") +PropMenuAddModel("Apocalyptic", "models/nzprops/origins/originscorpse05stick.mdl") +PropMenuAddModel("Apocalyptic", "models/props_unique/wooden_barricade.mdl") +PropMenuAddModel("Apocalyptic", "models/props_wasteland/barricade002a.mdl") +PropMenuAddModel("Apocalyptic", "models/props_wasteland/barricade001a.mdl") +PropMenuAddModel("Apocalyptic", "models/props_c17/concrete_barrier001a.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_barrier001_128_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_barrier001_96_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_phx/construct/concrete_barrier00.mdl") +PropMenuAddModel("Apocalyptic", "models/props_phx/construct/concrete_barrier01.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/barricade_razorwire001_128_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_block001_128_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_wall001_140_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/police_barrier001_128_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/traffic_barrier001.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_barrier001_96_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_barrier001_96_reference.mdl") +PropMenuAddModel("Apocalyptic", "models/props_fortifications/concrete_barrier001_96_reference.mdl") \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/ragdoll/cl_zombieargs.lua b/gamemodes/nzombies3/gamemode/ragdoll/cl_zombieargs.lua new file mode 100644 index 00000000..b6e03034 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/ragdoll/cl_zombieargs.lua @@ -0,0 +1,15 @@ +function GM:CreateClientsideRagdoll( ent, ragdoll ) + local dTime = math.random( 30, 60 ) + timer.Simple( dTime, function() + if IsValid(ragdoll) then + ragdoll:SetCollisionGroup(COLLISION_GROUP_NONE) + ragdoll:SetMoveType( MOVETYPE_NOCLIP ) + timer.Create( "nz.despawn.ragdolll." .. ragdoll:EntIndex(), 0.05, 100, function() + if IsValid(ragdoll) then + ragdoll:SetPos( ragdoll:GetPos() - Vector(0,0,0.4) ) + end + end) + end + end) + SafeRemoveEntityDelayed( ragdoll, dTime + 6 ) +end diff --git a/gamemodes/nzombies3/gamemode/random_box/sh_constructor.lua b/gamemodes/nzombies3/gamemode/random_box/sh_constructor.lua new file mode 100644 index 00000000..cb336c3c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/random_box/sh_constructor.lua @@ -0,0 +1 @@ +nzRandomBox = nzRandomBox or {} diff --git a/gamemodes/nzombies3/gamemode/random_box/sv_random_box.lua b/gamemodes/nzombies3/gamemode/random_box/sv_random_box.lua new file mode 100644 index 00000000..b41e7577 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/random_box/sv_random_box.lua @@ -0,0 +1,100 @@ +-- + +function nzRandomBox.Spawn(exclude) + --Get all spawns + local all = ents.FindByClass("random_box_spawns") + if IsValid(exclude) then + table.RemoveByValue(all, exclude) + --print("Excluded ", exclude) + if table.Count(all) <= 0 then + all = {exclude} -- Should there be nothing left, reuse the old excluded one + end + end + + local rand = all[ math.random( #all ) ] + + if rand != nil and !rand.HasBox then + local box = ents.Create( "random_box" ) + box:SetPos( rand:GetPos() ) + box:SetAngles( rand:GetAngles() ) + box:Spawn() + --box:PhysicsInit( SOLID_VPHYSICS ) + box.SpawnPoint = rand + rand.HasBox = true + + local phys = box:GetPhysicsObject() + if phys:IsValid() then + phys:EnableMotion(false) + end + else + print("No random box spawns have been set.") + end +end + +function nzRandomBox.Remove() + --Get all spawns + local all = ents.FindByClass("random_box") + --Loop just incase + for k,v in pairs(all) do + v.SpawnPoint.HasBox = false + v:Remove() + end +end + +function nzRandomBox.DecideWep(ply) + + local teddychance = math.random(1, 15) + if teddychance <= 1 and !nzPowerUps:IsPowerupActive("firesale") and table.Count(ents.FindByClass("random_box_spawns")) > 1 then + return "nz_box_teddy" + end + + local guns = {} + local blacklist = table.Copy(nzConfig.WeaponBlackList) + + --Add all our current guns to the black list + if IsValid(ply) and ply:IsPlayer() then + for k,v in pairs( ply:GetWeapons() ) do + if v.ClassName then + blacklist[v.ClassName] = true + end + end + end + + --Add all guns with no model or wonder weapons that are out to the blacklist + for k,v in pairs( weapons.GetList() ) do + if !blacklist[v.ClassName] then + if v.WorldModel == nil or nz.Weps.Functions.IsWonderWeaponOut(v.ClassName) then + blacklist[v.ClassName] = true + end + end + end + + if GetConVar("nz_randombox_maplist"):GetBool() and nzMapping.Settings.rboxweps then + for k,v in pairs(nzMapping.Settings.rboxweps) do + if !blacklist[v] then + table.insert(guns, v) + end + end + elseif GetConVar("nz_randombox_whitelist"):GetBool() then + -- Load only weapons that have a prefix from the whitelist + for k,v in pairs( weapons.GetList() ) do + if !blacklist[v.ClassName] and !v.NZPreventBox then + for k2,v2 in pairs(nzConfig.WeaponWhiteList) do + if string.sub(v.ClassName, 1, #v2) == v2 then + table.insert(guns, v.ClassName) + break + end + end + end + end + else + -- No weapon list and not using whitelist only, add all guns + for k,v in pairs( weapons.GetList() ) do + if !blacklist[v.ClassName] and !v.NZPreventBox then + table.insert(guns, v.ClassName) + end + end + end + + return table.Random(guns) +end diff --git a/gamemodes/nzombies3/gamemode/revive_system/cl_view.lua b/gamemodes/nzombies3/gamemode/revive_system/cl_view.lua new file mode 100644 index 00000000..17413dd7 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/cl_view.lua @@ -0,0 +1,268 @@ +//Useful ToScreen replacement for better directional +function XYCompassToScreen(pos, boundary) + local boundary = boundary or 0 + local eyedir = EyeVector() + local w = ScrW() - boundary + local h = ScrH() - boundary + local dir = (pos - EyePos()):GetNormalized() + dir = Vector(dir.x, dir.y, 0) + eyedir = Vector(eyedir.x, eyedir.y, 0) + + eyedir:Rotate(Angle(0,-90,0)) + local newdirx = eyedir:Dot(dir) + --draw.SimpleText(newdirx, "nz.display.hud.small", ScrW()/2, ScrH() - 50, Color(255, 255, 255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + + return ScrW()/2 + (newdirx*w/2), math.Clamp(pos:ToScreen().y, boundary, h) +end + +local tab = { + [ "$pp_colour_addr" ] = 0, + [ "$pp_colour_addg" ] = 0, + [ "$pp_colour_addb" ] = 0, + [ "$pp_colour_brightness" ] = 0, + [ "$pp_colour_contrast" ] = 1, + [ "$pp_colour_colour" ] = 0, + [ "$pp_colour_mulr" ] = 0, + [ "$pp_colour_mulg" ] = 0, + [ "$pp_colour_mulb" ] = 0 +} +local fade = 1 + +local mat_revive = Material("materials/revive.png", "unlitgeneric smooth") + +function Revive:ResetColorFade() + tab = { + [ "$pp_colour_addr" ] = 0, + [ "$pp_colour_addg" ] = 0, + [ "$pp_colour_addb" ] = 0, + [ "$pp_colour_brightness" ] = 0, + [ "$pp_colour_contrast" ] = 1, + [ "$pp_colour_colour" ] = 0, + [ "$pp_colour_mulr" ] = 0, + [ "$pp_colour_mulg" ] = 0, + [ "$pp_colour_mulb" ] = 0 + } + fade = 1 + + --print("Color reset!") +end + +local function CalcDownView(ply, pos, ang, fov, znear, zfar) + if Revive.Players[LocalPlayer():EntIndex()] then + local pos = pos + Vector(0,0,-30) + local ang = ang + Angle(0,0,20) + + return {origin = pos, angles = ang, fov = fov, znear = znear, zfar = zfar, drawviewer = false } + end +end + +local function CalcDownViewmodelView(wep, vm, oldpos, oldang, pos, ang) + if Revive.Players[LocalPlayer():EntIndex()] then + local oldpos = oldpos + Vector(0,0,-30) + local oldang = oldang + Angle(0,0,20) + + return oldpos, oldang + end +end + +local function DrawColorModulation() + if Revive.Players[LocalPlayer():EntIndex()] then + local fadeadd = ((1/GetConVar("nz_downtime"):GetFloat()) * FrameTime()) * -1 //Change 45 to the revival time + tab[ "$pp_colour_colour" ] = math.Approach(tab[ "$pp_colour_colour" ], 0, fadeadd) + tab[ "$pp_colour_addr" ] = math.Approach(tab[ "$pp_colour_addr" ], 0.5, fadeadd *-0.5) + tab[ "$pp_colour_mulr" ] = math.Approach(tab[ "$pp_colour_mulr" ], 1, -fadeadd) + tab[ "$pp_colour_mulg" ] = math.Approach(tab[ "$pp_colour_mulg" ], 0, fadeadd) + tab[ "$pp_colour_mulb" ] = math.Approach(tab[ "$pp_colour_mulb" ], 0, fadeadd) + + --print(fadeadd, tab[ "$pp_colour_colour" ], tab[ "$pp_colour_brightness" ]) + DrawColorModify(tab) + end +end + +function surface.DrawTexturedRectRotatedPoint( x, y, w, h, rot, x0, y0 ) + + local c = math.cos( math.rad( rot ) ) + local s = math.sin( math.rad( rot ) ) + + local newx = y0 * s - x0 * c + local newy = y0 * c + x0 * s + + surface.DrawTexturedRectRotated( x + newx, y + newy, w, h, rot ) + +end + +local function DrawDownedPlayers() + + for k,v in pairs(Revive.Players) do + local ply = Entity(k) + if IsValid(ply) then -- If they're outside PVS, don't draw the icon at all + if ply == LocalPlayer() then return end + local posxy = (ply:GetPos() + Vector(0,0,35)):ToScreen() + local dir = ((ply:GetPos() + Vector(0,0,35)) - EyeVector()*2):GetNormal():ToScreen() + --print(posxy["x"], posxy["y"], posxy["visible"]) + + if posxy.x - 35 < 60 or posxy.x - 35 > ScrW()-130 or posxy.y - 50 < 60 or posxy.y - 50 > ScrH()-110 then + posxy.x, posxy.y = XYCompassToScreen((ply:GetPos() + Vector(0,0,35)), 60) + end + + surface.SetMaterial(mat_revive) + if v.ReviveTime then + surface.SetDrawColor(255, 255, 255) + else + surface.SetDrawColor(255, 150 - (CurTime() - v.DownTime)*(150/GetConVar("nz_downtime"):GetFloat()), 0) + end + + --draw.SimpleText(v.ReviveTime and "REVIVING" or "DOWNED", font, posxy["x"], posxy["y"] + 10, v.ReviveTime and Color(255,255,255) or Color(200, 0, 0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) + --draw.SimpleText(k:Nick(), font2, posxy["x"], posxy["y"] - 20, v.ReviveTime and Color(255,255,255) or Color(200, 0, 0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) + + surface.DrawTexturedRect(posxy.x - 35, posxy.y - 50, 70, 50) + end + end +end + +local function DrawRevivalProgress() + local tr = util.QuickTrace(LocalPlayer():EyePos(), LocalPlayer():GetAimVector()*100, LocalPlayer()) + local dply = tr.Entity + local id = dply:EntIndex() + + local revtime = LocalPlayer():HasPerk("revive") and 2 or 4 + + if IsValid(dply) and Revive.Players[id] and Revive.Players[id].RevivePlayer == LocalPlayer() then + surface.SetDrawColor(0,0,0) + surface.DrawRect(ScrW()/2 - 150, ScrH() - 300, 300, 20) + + surface.SetDrawColor(255,255,255) + surface.DrawRect(ScrW()/2 - 145, ScrH() - 295, 290 * (CurTime()-Revive.Players[id].ReviveTime)/revtime, 10) + end +end + +local function DrawDownedNotify() + + if !LocalPlayer():GetNotDowned() then + local text = "YOU NEED HELP!" + local font = "nz.display.hud.main" + local rply = Revive.Players[LocalPlayer():EntIndex()].RevivePlayer + + if IsValid(rply) and rply:IsPlayer() then + text = rply:Nick().." is reviving you!" + end + draw.SimpleText(text, font, ScrW() / 2, ScrH() * 0.9, Color(200, 0, 0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + end + +end + +function Revive:DownedHeadsUp(ply, text) + Revive.Notify[ply] = {time = CurTime(), text = text} + --PrintTable(Revive.Notify[ply]) +end + +local function DrawDownedHeadsUp() + local font = "nz.display.hud.small" + local h = 40 + local offset = 20 + local max = 2 + local c = 0 + --table.SortByMember(nz.Revive.Data.Notify, "time") + + for k,v in pairs(Revive.Notify) do + local fade = math.Clamp(CurTime() - v.time - 5, 0, 1) + local status = v.text or "needs to be revived!" + draw.SimpleText(k:Nick().." "..status, font, ScrW()/2, ScrH() - h - offset * c, Color(255, 255, 255,255-(255*fade)), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + if fade >= 1 then Revive.Notify[k] = nil end + c = c + 1 + end +end + +CreateClientConVar("nz_bloodoverlay", 1, true, false) + +local blood_overlay = Material("materials/overlay_low_health.png", "unlitgeneric smooth") +local bloodpulse = true --if true, going up +local pulse = 0 +local function DrawDamagedOverlay() + if GetConVar("nz_bloodoverlay"):GetBool() and LocalPlayer():Alive() then + local fade = (math.Clamp(LocalPlayer():Health()/LocalPlayer():GetMaxHealth(), 0.2, 0.5)-0.2)/0.3 + local fade2 = 1 - math.Clamp(LocalPlayer():Health()/LocalPlayer():GetMaxHealth(), 0, 0.5)/0.5 + + surface.SetMaterial(blood_overlay) + surface.SetDrawColor(255,255,255,255-fade*255) + surface.DrawTexturedRect( -10, -10, ScrW()+20, ScrH()+20) + + if fade2 > 0 then + if bloodpulse then + pulse = math.Approach(pulse, 255, math.Clamp(pulse, 1, 50)*FrameTime()*100) + if pulse >= 255 then bloodpulse = false end + else + if pulse <= 0 then bloodpulse = true end + pulse = math.Approach(pulse, 0, -255*FrameTime()) + end + surface.SetDrawColor(255,255,255,pulse*fade2) + surface.DrawTexturedRect( -10, -10, ScrW()+20, ScrH()+20) + end + end +end + +local function DrawTombstoneNotify() + local font = "nz.display.hud.small" + + if LocalPlayer():GetDownedWithTombstone() then + local text = "Hold E to feed the zombies" + draw.SimpleText(text, font, ScrW()/2, ScrH() - 320, Color(255, 255, 255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + end +end + +local tombstonetime = nil +local senttombstonerequest = false + +local function DrawTombstoneProgress() + if LocalPlayer():GetDownedWithTombstone() then + + local killtime = 1 + + if LocalPlayer():KeyDown(IN_USE) then + if !tombstonetime then + tombstonetime = CurTime() + end + + local pct = math.Clamp((CurTime()-tombstonetime)/killtime, 0, 1) + + surface.SetDrawColor(0,0,0) + surface.DrawRect(ScrW()/2 - 150, ScrH() - 300, 300, 20) + + surface.SetDrawColor(255,255,255) + surface.DrawRect(ScrW()/2 - 145, ScrH() - 295, 290 * pct, 10) + if pct >= 1 and !senttombstonerequest then + net.Start("nz_TombstoneSuicide") + net.SendToServer() + senttombstonerequest = true + end + else + tombstonetime = nil + senttombstonerequest = false + end + end +end + +local whoswhoactive = false +net.Receive("nz_WhosWhoActive", function() + whoswhoactive = net.ReadBool() +end) +local whoswhomat = "models/shadertest/shader4" + +local function DrawWhosWhoOverlay() + if whoswhoactive then + DrawMaterialOverlay(whoswhomat, 0.03) + end +end + +//Hooks +hook.Add("CalcView", "CalcDownedView", CalcDownView ) +hook.Add("CalcViewModelView", "CalcDownedViewmodelView", CalcDownViewmodelView ) +hook.Add("RenderScreenspaceEffects", "DrawColorModulation", DrawColorModulation) +hook.Add("HUDPaint", "DrawDamageOverlay", DrawDamagedOverlay) +hook.Add("HUDPaint", "DrawDownedPlayers", DrawDownedPlayers ) +hook.Add("HUDPaint", "DrawDownedNotify", DrawDownedNotify ) +hook.Add("HUDPaint", "DrawRevivalProgress", DrawRevivalProgress ) +hook.Add("HUDPaint", "DrawDownedPlayersNotify", DrawDownedHeadsUp ) +hook.Add("HUDPaint", "DrawTombstoneNotify", DrawTombstoneNotify ) +hook.Add("HUDPaint", "DrawTombstoneProgress", DrawTombstoneProgress ) +hook.Add("RenderScreenspaceEffects", "DrawWhosWhoOverlay", DrawWhosWhoOverlay ) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/revive_system/sh_constructor.lua b/gamemodes/nzombies3/gamemode/revive_system/sh_constructor.lua new file mode 100644 index 00000000..469b31b1 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/sh_constructor.lua @@ -0,0 +1,9 @@ +-- Main Tables +Revive = Revive or {} + +-- Variables +Revive.Players = {} + +if CLIENT then + Revive.Notify = {} +end diff --git a/gamemodes/nzombies3/gamemode/revive_system/sh_meta.lua b/gamemodes/nzombies3/gamemode/revive_system/sh_meta.lua new file mode 100644 index 00000000..911cbb57 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/sh_meta.lua @@ -0,0 +1,175 @@ +local playerMeta = FindMetaTable("Player") +if SERVER then + + function playerMeta:DownPlayer() + local id = self:EntIndex() + self:AnimRestartGesture(GESTURE_SLOT_GRENADE, ACT_HL2MP_SIT_PISTOL) + + Revive.Players[id] = {} + Revive.Players[id].DownTime = CurTime() + + -- downed players are not targeted + self:SetTargetPriority(TARGET_PRIORITY_NONE) + self:SetHealth(100) + + if self:HasPerk("whoswho") then + self.HasWhosWho = true + timer.Simple(5, function() + -- If you choose to use Tombstone within these seconds, you won't make a clone and will get Who's Who back from Tombstone + if IsValid(self) and !self:GetNotDowned() then + print("Should've respawned by now") + Revive:CreateWhosWhoClone(self) + Revive:RespawnWithWhosWho(self) + end + end) + end + if self:HasPerk("tombstone") then + Revive.Players[id].tombstone = true + end + if #player.GetAllPlaying() <= 1 and self:HasPerk("revive") and (!self.SoloRevive or self.SoloRevive < 3) then + self.SoloRevive = self.SoloRevive and self.SoloRevive + 1 or 1 + self.DownedWithSoloRevive = true + self:StartRevive(self) + timer.Simple(8, function() + if IsValid(self) and !self:GetNotDowned() then + self:RevivePlayer(self) + end + end) + print(self, "Downed with solo revive") + end + + self.OldPerks = nz.Perks.Data.Players[self] or {} + + self:RemovePerks() + + self.DownPoints = math.Round(self:GetPoints()*0.05, -1) + if self.DownPoints >= self:GetPoints() then + self:SetPoints(0) + else + self:TakePoints(self.DownPoints, true) + end + + hook.Call("PlayerDowned", Revive, self) + + -- Equip the first pistol found in inventory - unless a pistol is already equipped + local wep = self:GetActiveWeapon() + if IsValid(wep) and wep:GetHoldType() == "pistol" or wep:GetHoldType() == "duel" or wep.HoldType == "pistol" or wep.HoldType == "duel" then + return + end + for k,v in pairs(self:GetWeapons()) do + if v:GetHoldType() == "pistol" or v:GetHoldType() == "duel" or v.HoldType == "pistol" or v.HoldType == "duel" then + self:SelectWeapon(v:GetClass()) + --print("Equipped "..v.ClassName.."!") + return + end + end + end + + function playerMeta:RevivePlayer(revivor, nosync) + local id = self:EntIndex() + if !Revive.Players[id] then return end + self:AnimResetGestureSlot(GESTURE_SLOT_GRENADE) + Revive.Players[id] = nil + if !nosync then + hook.Call("PlayerRevived", Revive, self, revivor) + end + self:SetTargetPriority(TARGET_PRIORITY_PLAYER) + self.HasWhosWho = nil + if IsValid(revivor) and revivor:IsPlayer() then + if self.DownPoints then + revivor:GivePoints(self.DownPoints) + end + revivor:StripWeapon("nz_revive_morphine") -- Remove the viewmodel again + end + self.DownPoints = nil + self.HasWhosWho = nil + self.DownedWithSoloRevive = nil + end + + function playerMeta:StartRevive(revivor, nosync) + local id = self:EntIndex() + if !Revive.Players[id] then return end -- Not even downed + if Revive.Players[id].ReviveTime then return end -- Already being revived + + Revive.Players[id].ReviveTime = CurTime() + Revive.Players[id].RevivePlayer = revivor + revivor.Reviving = self + + print("Started revive", self, revivor) + + if revivor:GetNotDowned() then -- You can revive yourself while downed with Solo Quick Revive + revivor:Give("nz_revive_morphine") -- Give them the viewmodel + end + + if !nosync then hook.Call("PlayerBeingRevived", Revive, self, revivor) end + end + + function playerMeta:StopRevive(nosync) + local id = self:EntIndex() + if !Revive.Players[id] then return end -- Not even downed + + local revivor = Revive.Players[id].RevivePlayer + if IsValid(revivor) then + revivor:StripWeapon("nz_revive_morphine") -- Remove the revivors viewmodel + end + + Revive.Players[id].ReviveTime = nil + Revive.Players[id].RevivePlayer = nil + + print("Stopped revive", self) + + if !nosync then hook.Call("PlayerNoLongerBeingRevived", Revive, self) end + end + + function playerMeta:KillDownedPlayer(silent, nosync, nokill) + local id = self:EntIndex() + if !Revive.Players[id] then return end + + local revivor = Revive.Players[id].RevivePlayer + if IsValid(revivor) then -- This shouldn't happen as players can't die if they are currently being revived + revivor:StripWeapon("nz_revive_morphine") -- Remove the revivors if someone was reviving viewmodel + end + + Revive.Players[id] = nil + if !nokill then + if silent then + self:KillSilent() + else + self:Kill() + end + end + if !nosync then hook.Call("PlayerKilled", Revive, self) end + self.HasWhosWho = nil + self.DownPoints = nil + self.DownedWithSoloRevive = nil + for k,v in pairs(player.GetAllPlayingAndAlive()) do + v:TakePoints(math.Round(v:GetPoints()*0.1, -1), true) + end + end + +end + +function playerMeta:GetNotDowned() + local id = self:EntIndex() + if Revive.Players[id] then + return false + else + return true + end +end + +function playerMeta:GetDownedWithTombstone() + local id = self:EntIndex() + if Revive.Players[id] then + return Revive.Players[id].tombstone or false + else + return false + end +end + +-- We overwrite the shoot pos function here so we can set it to the lower angle when downed +local oldshootpos = playerMeta.GetShootPos +function playerMeta:GetShootPos() + if self:GetNotDowned() then return oldshootpos(self) end + return oldshootpos(self) + Vector(0,0,-30) +end diff --git a/gamemodes/nzombies3/gamemode/revive_system/sh_playerdeath.lua b/gamemodes/nzombies3/gamemode/revive_system/sh_playerdeath.lua new file mode 100644 index 00000000..c7e61ef5 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/sh_playerdeath.lua @@ -0,0 +1,42 @@ + +function Revive.DoPlayerDeath(ply, dmg) + + if IsValid(ply) and ply:IsPlayer() then + if ply:Health() - dmg:GetDamage() <= 0 then + local allow = hook.Call("PlayerShouldTakeDamage", nil, ply, dmg:GetAttacker()) + --print(allow, "Allowed or not") + if allow != false then -- Only false should prevent it (not nil) + if ply:GetNotDowned() then + print(ply:Nick() .. " got downed!") + ply:DownPlayer() + --ply:SetMaxHealth(100) -- failsafe for Jugg not resetting + return true + else + ply:KillDownedPlayer() -- Kill them if they are already downed + end + end + elseif !ply:GetNotDowned() then + return true -- Downed players cannot take non-fatal damage + end + end + +end + +function Revive.PostPlayerDeath(ply) + -- Performs all the resetting functions without actually killing the player + if !ply:GetNotDowned() then ply:KillDownedPlayer(nil, false, true) end +end + +local function HandleKillCommand(ply) + if ply:GetNotDowned() then + ply:DownPlayer() + else + ply:KillDownedPlayer() + end + return false +end + +//Hooks +hook.Add("EntityTakeDamage", "nzDownKilledPlayers", Revive.DoPlayerDeath) +hook.Add("PostPlayerDeath", "nzPlayerDeathRevivalReset", Revive.PostPlayerDeath) +hook.Add("CanPlayerSuicide", "nzSuicideDowning", HandleKillCommand) diff --git a/gamemodes/nzombies3/gamemode/revive_system/sh_revival.lua b/gamemodes/nzombies3/gamemode/revive_system/sh_revival.lua new file mode 100644 index 00000000..7650d7ac --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/sh_revival.lua @@ -0,0 +1,185 @@ +// +if SERVER then + hook.Add("Think", "CheckDownedPlayersTime", function() + for k,v in pairs(Revive.Players) do + //The time it takes for a downed player to die - Prevent dying if being revived + if CurTime() - v.DownTime >= GetConVar("nz_downtime"):GetFloat() and !v.ReviveTime then + Entity(k):KillDownedPlayer() + end + end + end) +end + +function Revive.HandleRevive(ply, ent) + --print(ply, ent) + + //Make sure other downed players can't revive other downed players next to them + if !Revive.Players[ply:EntIndex()] then + + local tr = util.QuickTrace(ply:EyePos(), ply:GetAimVector()*100, ply) + local dply = tr.Entity + --print(dply) + + if IsValid(dply) and (dply:IsPlayer() or dply:GetClass() == "whoswho_downed_clone") then + local id = dply:EntIndex() + if Revive.Players[id] then + if !Revive.Players[id].RevivePlayer then + dply:StartRevive(ply) + end + + -- print(CurTime() - Revive.Players[id].ReviveTime) + + if ply:HasPerk("revive") and CurTime() - Revive.Players[id].ReviveTime >= 2 //With quick-revive + or CurTime() - Revive.Players[id].ReviveTime >= 4 then //4 is the time it takes to revive + dply:RevivePlayer(ply) + ply.Reviving = nil + end + end + else + if IsValid(ply.Reviving) and ply.Reviving != dply then -- Holding E on another player or no player + local id = ply.Reviving:EntIndex() + if Revive.Players[id] then + if Revive.Players[id].ReviveTime then + --ply:SetMoveType(MOVETYPE_WALK) + ply.Reviving:StopRevive() + ply.Reviving = nil + end + end + end + end + + -- When a player stops reviving + if !ply:KeyDown(IN_USE) then -- If you have an old revival target + if IsValid(ply.Reviving) and (ply.Reviving:IsPlayer() or ply.Reviving:GetClass() == "whoswho_downed_clone") then + local id = ply.Reviving:EntIndex() + if Revive.Players[id] then + if Revive.Players[id].ReviveTime then + --ply:SetMoveType(MOVETYPE_WALK) + ply.Reviving:StopRevive() + ply.Reviving = nil + --nz.Revive.Functions.SendSync() + end + end + end + end + + end +end + +//Hooks +hook.Add("FindUseEntity", "CheckRevive", Revive.HandleRevive) + +if SERVER then + util.AddNetworkString("nz_TombstoneSuicide") + + net.Receive("nz_TombstoneSuicide", function(len, ply) + if ply:GetDownedWithTombstone() then + local tombstone = ents.Create("drop_tombstone") + tombstone:SetPos(ply:GetPos() + Vector(0,0,50)) + tombstone:Spawn() + local weps = {} + for k,v in pairs(ply:GetWeapons()) do + table.insert(weps, {class = v:GetClass(), pap = v.pap}) + end + local perks = ply.OldPerks + + tombstone.OwnerData.weps = weps + tombstone.OwnerData.perks = perks + + ply:KillDownedPlayer() + tombstone:SetPerkOwner(ply) + end + end) +end + +if SERVER then + util.AddNetworkString("nz_WhosWhoActive") +end + +function Revive:CreateWhosWhoClone(ply, pos) + local pos = pos or ply:GetPos() + + local wep = IsValid(ply:GetActiveWeapon()) and ply:GetActiveWeapon():GetClass() != "nz_perk_bottle" and ply:GetActiveWeapon():GetClass() or ply.oldwep or nil + + local who = ents.Create("whoswho_downed_clone") + who:SetPos(pos) + who:SetAngles(ply:GetAngles()) + who:Spawn() + who:GiveWeapon(wep) + who:SetPerkOwner(ply) + who:SetModel(ply:GetModel()) + who.OwnerData.perks = ply.OldPerks or ply:GetPerks() + local weps = {} + for k,v in pairs(ply:GetWeapons()) do + table.insert(weps, {class = v:GetClass(), pap = v.pap, speed = v.speed, dtap = v.dtap}) + end + who.OwnerData.weps = weps + + timer.Simple(0.1, function() + if IsValid(who) then + local id = who:EntIndex() + self.Players[id] = {} + self.Players[id].DownTime = CurTime() + + hook.Call("PlayerDowned", Revive, who) + end + end) + + ply.WhosWhoClone = who + ply.WhosWhoMoney = 0 + + net.Start("nz_WhosWhoActive") + net.WriteBool(true) + net.Send(ply) +end + +function Revive:RespawnWithWhosWho(ply, pos) + local pos = pos or nil + + if !pos then + local spawns = {} + local plypos = ply:GetPos() + local maxdist = 1500^2 + local mindist = 500^2 + + local available = ents.FindByClass("zed_special_spawns") + if IsValid(available[1]) then + for k,v in pairs(available) do + local dist = plypos:DistToSqr(v:GetPos()) + if v.link == nil or nzDoors.OpenedLinks[tonumber(v.link)] then -- Only for rooms that are opened (using links) + if dist < maxdist and dist > mindist then -- Within the range we set above + if v:IsSuitable() then -- And nothing is blocking it + table.insert(spawns, v) + end + end + end + end + if !IsValid(spawns[1]) then + for k,v in pairs(available) do -- Retry, but without the range check (just use all of them) + local dist = plypos:DistToSqr(v:GetPos()) + if v.link == nil or nzDoors.OpenedLinks[tonumber(v.link)] then + if v:IsSuitable() then + table.insert(spawns, v) + end + end + end + end + if !IsValid(spawns[1]) then -- Still no open linked ones?! Spawn at a random player spawnpoint + local pspawns = ents.FindByClass("player_spawns") + pos = pspawns[math.random(#pspawns)]:GetPos() + else + pos = spawns[math.random(#spawns)]:GetPos() + end + else + -- There exists no special spawnpoints - Use regular player spawns + local pspawns = ents.FindByClass("player_spawns") + pos = pspawns[math.random(#pspawns)]:GetPos() + end + end + ply:RevivePlayer() + ply:StripWeapons() + player_manager.RunClass(ply, "Loadout") -- Rearm them + + ply:SetPos(pos) + +end diff --git a/gamemodes/nzombies3/gamemode/revive_system/sh_sync.lua b/gamemodes/nzombies3/gamemode/revive_system/sh_sync.lua new file mode 100644 index 00000000..05a595e2 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/sh_sync.lua @@ -0,0 +1,129 @@ +//Client Server Syncing + +if SERVER then + + util.AddNetworkString( "nzRevivePlayerFull" ) + util.AddNetworkString( "nzRevivePlayerDowned" ) + util.AddNetworkString( "nzRevivePlayerRevived" ) + util.AddNetworkString( "nzRevivePlayerBeingRevived" ) + util.AddNetworkString( "nzRevivePlayerKilled" ) + + + function Revive:SendPlayerFullData(ply, receiver) + local data = table.Copy(self.Players[ply:EntIndex()]) + + net.Start( "nzRevivePlayerFull" ) + net.WriteInt(ply:EntIndex(), 13) + net.WriteTable( data ) + return receiver and net.Send(receiver) or net.Broadcast() + end + + function Revive:SendPlayerDowned(ply, receiver) + net.Start( "nzRevivePlayerDowned" ) + net.WriteInt(ply:EntIndex(), 13) + return receiver and net.Send(receiver) or net.Broadcast() + end + + function Revive:SendPlayerRevived(ply, receiver) + net.Start( "nzRevivePlayerRevived" ) + net.WriteInt(ply:EntIndex(), 13) + return receiver and net.Send(receiver) or net.Broadcast() + end + + function Revive:SendPlayerBeingRevived(ply, revivor, receiver) + net.Start( "nzRevivePlayerBeingRevived" ) + net.WriteInt(ply:EntIndex(), 13) + if IsValid(revivor) then + net.WriteBool(true) + net.WriteInt(revivor:EntIndex(), 13) + else -- No valid revivor means the player stopped being revived + net.WriteBool(false) + end + return receiver and net.Send(receiver) or net.Broadcast() + end + + function Revive:SendPlayerKilled(ply, receiver) + net.Start( "nzRevivePlayerKilled" ) + net.WriteInt(ply:EntIndex(), 13) + return receiver and net.Send(receiver) or net.Broadcast() + end + + FullSyncModules["Revive"] = function(ply) + for k,v in pairs(player.GetAll()) do + if !v:GetNotDowned() then -- Player needs to be downed + Revive:SendPlayerFullData(v, ply) + end + end + end +end + +if CLIENT then + + local function ReceivePlayerDowned() + local id = net.ReadInt(13) + Revive.Players[id] = Revive.Players[id] or {} + Revive.Players[id].DownTime = CurTime() + local ply = Entity(id) + if IsValid(ply) and ply:IsPlayer() then + ply:AnimRestartGesture(GESTURE_SLOT_GRENADE, ACT_HL2MP_SIT_PISTOL) + Revive:DownedHeadsUp(ply, "needs to be revived!") + end + end + + local function ReceivePlayerRevived() + local id = net.ReadInt(13) + Revive.Players[id] = nil + local ply = Entity(id) + if IsValid(ply) and ply:IsPlayer() then + ply:AnimResetGestureSlot(GESTURE_SLOT_GRENADE) + if ply == LocalPlayer() then Revive:ResetColorFade() end + Revive:DownedHeadsUp(ply, "has been revived!") + end + end + + local function ReceivePlayerBeingRevived() + local id = net.ReadInt(13) + local bool = net.ReadBool() + if bool then + local revivor = Entity(net.ReadInt(13)) + Revive.Players[id] = Revive.Players[id] or {} + if !Revive.Players[id].ReviveTime then + Revive.Players[id].ReviveTime = CurTime() + Revive.Players[id].RevivePlayer = revivor + end + else + Revive.Players[id] = Revive.Players[id] or {} + Revive.Players[id].ReviveTime = nil + Revive.Players[id].RevivePlayer = nil + end + end + + local function ReceivePlayerKilled() + local id = net.ReadInt(13) + Revive.Players[id] = nil + local ply = Entity(id) + if IsValid(ply) and ply:IsPlayer() then + ply:AnimResetGestureSlot(GESTURE_SLOT_GRENADE) + if ply == LocalPlayer() then Revive:ResetColorFade() end + Revive:DownedHeadsUp(ply, "has died!") + end + end + + local function ReceiveFullPlayerSync() + local id = net.ReadInt(13) + local data = net.ReadTable() + Revive.Players[id] = data + local ply = Entity(id) + if IsValid(ply) and ply:IsPlayer() then + ply:AnimRestartGesture(GESTURE_SLOT_GRENADE, ACT_HL2MP_SIT_PISTOL) + Revive:DownedHeadsUp(ply, "has been downed!") + end + end + + //Receivers + net.Receive( "nzRevivePlayerDowned", ReceivePlayerDowned ) + net.Receive( "nzRevivePlayerRevived", ReceivePlayerRevived ) + net.Receive( "nzRevivePlayerBeingRevived", ReceivePlayerBeingRevived ) + net.Receive( "nzRevivePlayerKilled", ReceivePlayerKilled ) + net.Receive( "nzRevivePlayerFull", ReceiveFullPlayerSync ) +end diff --git a/gamemodes/nzombies3/gamemode/revive_system/sv_hooks.lua b/gamemodes/nzombies3/gamemode/revive_system/sv_hooks.lua new file mode 100644 index 00000000..f11fc33a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/revive_system/sv_hooks.lua @@ -0,0 +1,20 @@ +function Revive:PlayerDowned( ply ) + self:SendPlayerDowned( ply ) +end + +function Revive:PlayerRevived( ply ) + self:SendPlayerRevived( ply ) +end + +function Revive:PlayerBeingRevived( ply, revivor ) + self:SendPlayerBeingRevived( ply, revivor ) +end + +function Revive:PlayerNoLongerBeingRevived( ply ) + self:SendPlayerBeingRevived( ply ) -- No second argument means no revivor +end + + +function Revive:PlayerKilled( ply ) + self:SendPlayerKilled( ply ) +end diff --git a/gamemodes/nzombies3/gamemode/round/cl_fog.lua b/gamemodes/nzombies3/gamemode/round/cl_fog.lua new file mode 100644 index 00000000..b9c2f450 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/cl_fog.lua @@ -0,0 +1,126 @@ +local fade +local fadetime = 5 + +local fogstart = fogstart or 50 +local fogend = fogend or 1000 +local fogdensity = fogdensity or 0 +local fogcolor = fogcolor or Vector(0.4,0.7,0.8) + +local tfogstart = tfogstart or 50 +local tfogend = tfogend or 1000 +local tfogdensity = tfogdensity or 0 +local tfogcolor = tfogcolor or Vector(0.4,0.7,0.8) + +local ofogstart = fogstart +local ofogend = fogend +local ofogdensity = fogdensity +local ofogcolor = fogcolor + +local specialfog = false +local foginit = false + +function nzRound:EnableSpecialFog( bool ) + local ent = ents.FindByClass("edit_fog")[1] + local ent_special = ents.FindByClass("edit_fog_special")[1] + + hook.Remove("Think", "nzFogThink") + + if bool and (!specialfog or !foginit) then + if IsValid(ent_special) then + tfogstart = ent_special:GetFogStart() + tfogend = ent_special:GetFogEnd() + tfogdensity = ent_special:GetDensity() + tfogcolor = ent_special:GetFogColor() + else + tfogstart = 50 + tfogend = 1000 + tfogdensity = 0.9 + tfogcolor = Vector(0.4,0.7,0.8) + end + specialfog = true + elseif specialfog or !foginit then + if IsValid(ent) then + tfogstart = ent:GetFogStart() + tfogend = ent:GetFogEnd() + tfogdensity = ent:GetDensity() + tfogcolor = ent:GetFogColor() + else + tfogstart = 50 + tfogend = 1000 + tfogdensity = 0 + tfogcolor = Vector(0.4,0.7,0.8) + end + specialfog = false + end + -- Changed to always true because we now have defaults that apply if the entities don't exist + if true then --IsValid(ent) or IsValid(ent_special) then + fade = 0 + ofogstart = fogstart + ofogend = fogend + ofogdensity = fogdensity + ofogcolor = fogcolor + hook.Add("Think", "nzFogFade", nzFogFade) + hook.Add("SetupWorldFog", "nzWorldFog", nzSetupWorldFog) + hook.Add("SetupSkyboxFog", "nzSkyboxFog", nzSetupSkyFog) + foginit = true + else + hook.Remove("SetupWorldFog", "nzWorldFog") + hook.Remove("SetupSkyboxFog", "nzSkyboxFog") + foginit = false + end +end + +function nzFogFade() + fade = math.Approach(fade, 1, FrameTime()/fadetime) + fogstart = Lerp(fade, ofogstart, tfogstart) + fogend = Lerp(fade, ofogend, tfogend) + fogdensity = Lerp(fade, ofogdensity, tfogdensity) + fogcolor = LerpVector(fade, ofogcolor, tfogcolor) + + if fade >= 1 then + hook.Remove("Think", "nzFogFade") + hook.Add("Think", "nzFogThink", nzFogThink) + end +end + +function nzFogThink() + local ent + if specialfog then + ent = ents.FindByClass("edit_fog_special")[1] + else + ent = ents.FindByClass("edit_fog")[1] + end + --print(ent) + if IsValid(ent) then + fogstart = ent:GetFogStart() + fogend = ent:GetFogEnd() + fogdensity = ent:GetDensity() + fogcolor = ent:GetFogColor() + end +end + +function nzSetupWorldFog() + + render.FogMode( 1 ) + render.FogStart( fogstart ) + render.FogEnd( fogend ) + render.FogMaxDensity( fogdensity ) + + render.FogColor( fogcolor.x * 255, fogcolor.y * 255, fogcolor.z * 255 ) + + return true + +end + +function nzSetupSkyFog( skyboxscale ) + + render.FogMode( 1 ) + render.FogStart( fogstart * skyboxscale ) + render.FogEnd( fogend * skyboxscale ) + render.FogMaxDensity( fogdensity ) + + render.FogColor( fogcolor.x * 255, fogcolor.y * 255, fogcolor.z * 255 ) + + return true + +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/round/cl_round.lua b/gamemodes/nzombies3/gamemode/round/cl_round.lua new file mode 100644 index 00000000..43593f75 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/cl_round.lua @@ -0,0 +1,37 @@ +function nzRound:GetEndTime() + return GetGlobalFloat( "gwEndTime", 0 ) +end + +function nzRound:StateChange( old, new ) + if new == ROUND_WAITING then + hook.Call( "OnRoundWating", nzRound ) + elseif new == ROUND_INIT then + hook.Call( "OnRoundInit", nzRound ) + elseif new == ROUND_PREP then + hook.Call( "OnRoundPreperation", nzRound ) + elseif new == ROUND_PROG then + hook.Call( "OnRoundStart", nzRound ) + elseif new == ROUND_GO then + hook.Call( "OnRoundEnd", nzRound ) + end +end + +function nzRound:OnRoundPreperation() + if !self:IsSpecial() then + self:EnableSpecialFog(false) + end +end + +function nzRound:OnRoundStart() + if self:IsSpecial() then + self:EnableSpecialFog(true) + else + self:EnableSpecialFog(false) + end +end + +net.Receive("nz_hellhoundround", function() + if net.ReadBool() then + surface.PlaySound("nz/round/dog_start.wav") + end +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/round/cl_round_meta.lua b/gamemodes/nzombies3/gamemode/round/cl_round_meta.lua new file mode 100644 index 00000000..8651c34e --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/cl_round_meta.lua @@ -0,0 +1,16 @@ +function nzRound:GetState() return self.State end +function nzRound:SetState( state ) self.State = state end + +function nzRound:GetNumber() return self.Number or 0 end +function nzRound:SetNumber( num ) self.Number = num end + +function nzRound:IsSpecial() return self.SpecialRound or false end +function nzRound:SetSpecial( bool ) self.SpecialRound = bool end + +function nzRound:InState( state ) + return nzRound:GetState() == state +end + +function nzRound:InProgress() + return nzRound:GetState() == ROUND_PREP or nzRound:GetState() == ROUND_PROG +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/round/sh_constructor.lua b/gamemodes/nzombies3/gamemode/round/sh_constructor.lua new file mode 100644 index 00000000..5bfc48b6 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sh_constructor.lua @@ -0,0 +1,2 @@ +-- Setup round module +nzRound = nzRound or {} diff --git a/gamemodes/nzombies3/gamemode/round/sh_player.lua b/gamemodes/nzombies3/gamemode/round/sh_player.lua new file mode 100644 index 00000000..745e868b --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sh_player.lua @@ -0,0 +1,67 @@ +local plyMeta = FindMetaTable( "Player" ) + +AccessorFunc( plyMeta, "bReady", "Ready", FORCE_BOOL ) +function plyMeta:IsReady() return self:GetReady() end + +AccessorFunc( plyMeta, "bPlaying", "Playing", FORCE_BOOL ) +function plyMeta:IsPlaying() return self:GetPlaying() end + +function plyMeta:IsSpectating() return self:Team() == TEAM_SPECTATOR end + +local player = player + +--player.utils +function player.GetAllReady() + local result = {} + for _, ply in pairs( player.GetAll() ) do + if ply:IsReady() then + table.insert( result, ply ) + end + end + + return result +end + +function player.GetAllPlaying() + local result = {} + for _, ply in pairs( player.GetAll() ) do + if ply:IsPlaying() then + table.insert( result, ply ) + end + end + + return result +end + +function player.GetAllPlayingAndAlive() + local result = {} + for _, ply in pairs( player.GetAllPlaying() ) do + if ply:Alive() and (ply:GetNotDowned() or ply.HasWhosWho or ply.DownedWithSoloRevive) then -- Who's Who will respawn the player, don't end yet + table.insert( result, ply ) + end + end + + return result +end + +function player.GetAllNonSpecs() + local result = {} + for _, ply in pairs( player.GetAll() ) do + if ply:Team() != TEAM_SPECTATOR then + table.insert( result, ply ) + end + end + + return result +end + +function player.GetAllTargetable() + local result = {} + for _, ply in pairs(player.GetAll()) do + if ply:GetTargetPriority() > 0 then + table.insert( result, ply ) + end + end + + return result +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/round/sh_sync.lua b/gamemodes/nzombies3/gamemode/round/sh_sync.lua new file mode 100644 index 00000000..080b8383 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sh_sync.lua @@ -0,0 +1,109 @@ +if SERVER then + util.AddNetworkString( ", nzRoundNumber" ) + util.AddNetworkString( ", nzRoundState" ) + util.AddNetworkString( ", nzRoundSpecial" ) + util.AddNetworkString( "nzPlayerReadyState" ) + util.AddNetworkString( "nzPlayerPlayingState" ) + + function nzRound:SendNumber( number, ply ) + + net.Start( ", nzRoundNumber" ) + net.WriteUInt( number or 0, 16 ) + return ply and net.Send( ply ) or net.Broadcast() + + end + + function nzRound:SendState( state, ply ) + + net.Start( ", nzRoundState" ) + net.WriteUInt( state or ROUND_WAITING, 3 ) + return ply and net.Send( ply ) or net.Broadcast() + + end + + function nzRound:SendSpecialRound( bool, ply ) + + net.Start( ", nzRoundSpecial" ) + net.WriteBool( bool or false ) + return ply and net.Send( ply ) or net.Broadcast() + + end + + function nzRound:SendReadyState( ply, state, recieverPly ) + + net.Start( "nzPlayerReadyState" ) + net.WriteEntity( ply ) + net.WriteBool( state ) + return recieverPly and net.Send( recieverPly ) or net.Broadcast() + + end + + function nzRound:SendPlayingState( ply, state, recieverPly ) + + net.Start( "nzPlayerPlayingState" ) + net.WriteEntity( ply ) + net.WriteBool( state ) + return recieverPly and net.Send( recieverPly ) or net.Broadcast() + + end + + function nzRound:SendSync(ply) + self:SendNumber( self:GetNumber(), ply ) + self:SendSpecialRound( self:IsSpecial(), ply) + self:SendState(self:GetState(), ply) + + for _, v in pairs(player.GetAll()) do + self:SendReadyState(v, v:GetReady(), ply) + self:SendPlayingState(v, v:GetPlaying(), ply) + end + + self:SetEndTime( self:GetEndTime() ) + + end + + FullSyncModules["Round"] = function(ply) + nzRound:SendSync(ply) + end +end + +if CLIENT then + local function receiveRoundState() + local old = nzRound:GetState() + new = net.ReadUInt( 3 ) + + nzRound:SetState( new ) + + if old != new then + nzRound:StateChange( old, new ) + end + end + net.Receive( ", nzRoundState", receiveRoundState ) + + + local function receiveRoundNumber() + nzRound:SetNumber( net.ReadUInt( 16 ) ) + end + net.Receive( ", nzRoundNumber", receiveRoundNumber) + + local function receiveSpecialRound() + nzRound:SetSpecial( net.ReadBool() ) + end + net.Receive( ", nzRoundSpecial", receiveSpecialRound ) + + + local function receivePlayerReadyState() + local ply = net.ReadEntity() + if IsValid(ply) then + ply:SetReady( net.ReadBool() ) + end + end + net.Receive( "nzPlayerReadyState", receivePlayerReadyState ) + + local function receivePlayerPlayingState() + local ply = net.ReadEntity() + if IsValid(ply) then + ply:SetPlaying( net.ReadBool() ) + end + end + net.Receive( "nzPlayerPlayingState", receivePlayerPlayingState ) +end diff --git a/gamemodes/nzombies3/gamemode/round/sv_hooks.lua b/gamemodes/nzombies3/gamemode/round/sv_hooks.lua new file mode 100644 index 00000000..70b7e6a3 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sv_hooks.lua @@ -0,0 +1,30 @@ +function nzRound:OnPlayerReady( ply ) + + self:SendReadyState( ply, true ) + + --Start Round if we have enough players + if self:InState( ROUND_WAITING ) and #player.GetAllReady() > #player.GetAllNonSpecs() / 3 then + self:Init() + end + +end + +function nzRound:OnPlayerUnReady( ply ) + + self:SendReadyState( ply, false ) + +end + +function nzRound:OnPlayerDropIn( ply ) + + self:SendPlayingState( ply, true ) + self:SendReadyState( ply, true ) + +end + +function nzRound:OnPlayerDropOut( ply ) + + self:SendPlayingState( ply, false ) + self:SendReadyState( ply, false ) + +end diff --git a/gamemodes/nzombies3/gamemode/round/sv_player.lua b/gamemodes/nzombies3/gamemode/round/sv_player.lua new file mode 100644 index 00000000..faba56a9 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sv_player.lua @@ -0,0 +1,106 @@ +local plyMeta = FindMetaTable( "Player" ) + +function plyMeta:ReadyUp() + + if !navmesh.IsLoaded() then + PrintMessage( HUD_PRINTTALK, "Can't ready you up, because the map has not Navmesh loaded. Use the settings menu to generate a rough Navmesh or use tools in sandbox to make a proper one.") + return false + end + + if nzMapping:CheckSpawns() == false then + PrintMessage( HUD_PRINTTALK, "Can't ready you up, because no Zombie/Player spawns have been set.") + return false + end + + --Check if we have enough player spawns + if nzMapping:CheckEnoughPlayerSpawns() == false then + PrintMessage( HUD_PRINTTALK, "Can't ready you up, because not enough player spawns have been set. We need " .. #player.GetAll() .. " but only have " .. #ents.FindByClass("player_spawns") .. "." ) + return false + end + + if nzRound:InState( ROUND_WAITING ) or nzRound:InState( ROUND_INIT ) then + if !self:IsReady() then + PrintMessage( HUD_PRINTTALK, self:Nick() .. " is ready!" ) + self:SetReady( true ) + self:SetTeam(TEAM_PLAYERS) + hook.Call( "OnPlayerReady", nzRound, self ) + else + self:PrintMessage( HUD_PRINTTALK, "You are already ready!" ) + end + elseif nzRound:InProgress() then + if self:IsPlaying() then + self:PrintMessage( HUD_PRINTTALK, "You are already playing!" ) + else + self:PrintMessage( HUD_PRINTTALK, "Round in progress you will be dropped into next round if possible." ) + self:DropIn() + end + end + + return true + +end + +function plyMeta:UnReady() + if nzRound:InState( ROUND_WAITING ) then + if self:IsReady() then + PrintMessage( HUD_PRINTTALK, self:Nick() .. " is no longer ready!" ) + self:SetReady( false ) + hook.Call( "OnPlayerUnReady", nzRound, self ) + end + end + if nzRound:InProgress() then + self:DropOut() + end +end + +function plyMeta:DropIn() + if GetConVar("nz_round_dropins_allow"):GetBool() == true and !self:IsPlaying() then + self:SetReady( true ) + self:SetPlaying( true ) + self:SetTeam( TEAM_PLAYERS ) + hook.Call( "OnPlayerDropIn", nzRound, self ) + if nzRound:GetNumber() == 1 and nzRound:InState(ROUND_PREP) then + PrintMessage( HUD_PRINTTALK, self:Nick() .. " is dropping in!" ) + self:ReSpawn() + else + PrintMessage( HUD_PRINTTALK, self:Nick() .. " will be dropping in next round!" ) + end + else + self:PrintMessage( HUD_PRINTTALK, "You are already in queue or dropins are not allowed on this Server." ) + end +end + +function plyMeta:DropOut() + if self:IsPlaying() then + PrintMessage( HUD_PRINTTALK, self:Nick().." has dropped out of the game!" ) + self:SetReady( false ) + self:SetPlaying( false ) + self:RevivePlayer() + self:KillSilent() + self:SetTargetPriority(TARGET_PRIORITY_NONE) + hook.Call( "OnPlayerDropOut", nzRound, self ) + end +end + +function plyMeta:ReSpawn() + + --Setup a player + player_manager.SetPlayerClass( self, "player_ingame" ) + if !self:Alive() then + self:Spawn() + end + +end + +function plyMeta:GiveCreativeMode() + + player_manager.SetPlayerClass( self, "player_create" ) + if !self:Alive() then + self:Spawn() + end + +end + +function plyMeta:IsInCreative() + return player_manager.GetPlayerClass( self ) == "player_create" +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/round/sv_round.lua b/gamemodes/nzombies3/gamemode/round/sv_round.lua new file mode 100644 index 00000000..9f4e9039 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sv_round.lua @@ -0,0 +1,405 @@ +function GM:InitPostEntity() + + nzRound:Waiting() + +end + +function nzRound:Waiting() + + self:SetState( ROUND_WAITING ) + hook.Call( "OnRoundWating", nzRound ) + +end + +function nzRound:Init() + + timer.Simple( 5, function() self:SetupGame() self:Prepare() end ) + self:SetState( ROUND_INIT ) + self:SetEndTime( CurTime() + 5 ) + PrintMessage( HUD_PRINTTALK, "5 seconds till start time." ) + hook.Call( "OnRoundInit", nzRound ) + +end + +function nzRound:Prepare() + + -- Set special for the upcoming round during prep, that way clients have time to fade the fog in + self:SetSpecial( self:MarkedForSpecial( self:GetNumber() + 1 ) ) + self:SetState( ROUND_PREP ) + self:IncrementNumber() + + self:SetZombieHealth( nzCurves.GenerateHealthCurve(self:GetNumber()) ) + self:SetZombiesMax( nzCurves.GenerateMaxZombies(self:GetNumber()) ) + + self:SetZombieSpeeds( nzCurves.GenerateSpeedTable(self:GetNumber()) ) + + self:SetZombiesKilled( 0 ) + + --Notify + PrintMessage( HUD_PRINTTALK, "ROUND: " .. self:GetNumber() .. " preparing" ) + hook.Call( "OnRoundPreperation", nzRound, self:GetNumber() ) + --Play the sound + + --Spawn all players + --Check config for dropins + --For now, only allow the players who started the game to spawn + for _, ply in pairs( player.GetAllPlaying() ) do + ply:ReSpawn() + end + + -- Setup the spawners after all players have been spawned + + -- Reset and remove the old spawners + if self:GetSpecialSpawner() then + self:GetSpecialSpawner():Remove() + self:SetSpecialSpawner(nil) + end + + if self:GetNormalSpawner() then + self:GetNormalSpawner():Remove() + self:SetNormalSpawner(nil) + end + + -- Prioritize any configs (useful for mapscripts) + if nzConfig.RoundData[ self:GetNumber() ] then + local roundData = nzConfig.RoundData[ self:GetNumber() ] + + --normal spawner + local normalCount = 0 + + -- only setup a spawner if we have zombie data + if roundData.normalTypes then + if roundData.normalCountMod then + local mod = roundData.normalCountMod + normalCount = mod(self:GetZombiesMax()) + elseif roundData.normalCount then + normalCount = roundData.normalCount + else + normalCount = self:GetZombiesMax() + end + + local normalData = roundData.normalTypes + local normalSpawner = Spawner("nz_spawn_zombie_normal", normalData, normalCount, roundData.normalDelay or 0.25) + + -- save the spawner to access data + self:SetNormalSpawner(normalSpawner) + end + + -- special spawner + local specialCount = 0 + + -- only setup a spawner if we have zombie data + if roundData.specialTypes then + if roundData.specialCountMod then + local mod = roundData.specialCountMod + specialCount = mod(self:GetZombiesMax()) + elseif roundData.specialCount then + specialCount = roundData.specialCount + else + specialCount = self:GetZombiesMax() + end + + local specialData = roundData.specialTypes + local specialSpawner = Spawner("nz_spawn_zombie_special", specialData, specialCount, roundData.specialDelay or 0.25) + + -- save the spawner to access data + self:SetSpecialSpawner(specialSpawner) + end + + -- update the zombiesmax (for win detection) + self:SetZombiesMax(normalCount + specialCount) + + + -- else if no data was set continue with the gamemodes default spawning + -- if the round is special use the gamemodes default special round (Hellhounds) + elseif self:IsSpecial() then + -- only setup a special spawner + self:SetZombiesMax(math.floor(self:GetZombiesMax() / 2)) -- Half the amount of special zombies + local specialSpawner = Spawner("nz_spawn_zombie_special", {["nz_zombie_special_dog"] = {chance = 100}}, self:GetZombiesMax(), 2) + + -- save the spawner to access data + self:SetSpecialSpawner(specialSpawner) + + -- else just do regular walker spawning + else + local normalSpawner = Spawner("nz_spawn_zombie_normal", {["nz_zombie_walker"] = {chance = 100}}, self:GetZombiesMax()) + + -- after round 20 spawn some hellhounds aswell (half of the round number 21: 10, 22: 11, 23: 11, 24: 12 ...) + if self:GetNumber() > 20 then + local amount = math.floor(self:GetNumber() / 2) + local specialSpawner = Spawner("nz_spawn_zombie_special", {["nz_zombie_special_dog"] = {chance = 100}}, amount, 2) + + self:SetSpecialSpawner(specialSpawner) + self:SetZombiesMax(self:GetZombiesMax() + amount) + end + + -- save the spawner to access data + self:SetNormalSpawner(normalSpawner) + end + + --Heal + --[[for _, ply in pairs( player.GetAllPlaying() ) do + ply:SetHealth( ply:GetMaxHealth() ) + end]] + + --Set this to reset the overspawn debug message status + CurRoundOverSpawned = false + + --Start the next round + timer.Simple(GetConVar("nz_round_prep_time"):GetFloat(), function() self:Start() end ) + + if self:IsSpecial() then + self:SetNextSpecialRound( self:GetNumber() + GetConVar("nz_round_special_interval"):GetInt() ) + end + +end + +local CurRoundOverSpawned = false + +function nzRound:Start() + + self:SetState( ROUND_PROG ) + local spawner = self:GetNormalSpawner() + if spawner then + spawner:SetNextSpawn( CurTime() + 3 ) -- Delay zombie spawning by 3 seconds + end + + local specialspawner = self:GetSpecialSpawner() + if self:IsSpecial() and specialspawner and specialspawner:GetData()["nz_zombie_special_dog"] then -- If we got a dog special round + specialspawner:SetNextSpawn( CurTime() + 6 ) -- Delay spawning even furhter + timer.Simple(3, function() + nzRound:CallHellhoundRound() -- Play the sound + end) + end + + --Notify + PrintMessage( HUD_PRINTTALK, "ROUND: " .. self:GetNumber() .. " started" ) + hook.Call("OnRoundStart", nzRound, self:GetNumber() ) + --nz.Notifications.Functions.PlaySound("nz/round/round_start.mp3", 1) + + timer.Create( "NZRoundThink", 0.1, 0, function() self:Think() end ) + + nz.Weps.DoRoundResupply() +end + +function nzRound:Think() + hook.Call( "OnRoundThink", self ) + --If all players are dead, then end the game. + if #player.GetAllPlayingAndAlive() < 1 then + self:End() + timer.Remove( "NZRoundThink" ) + return -- bail + end + + --If we've killed all the spawned zombies, then progress to the next level. + local numzombies = nzEnemies:TotalAlive() + + -- failsafe temporary until i can identify the issue (why are not all zombies spawned and registered) + local zombiesToSpawn + if self:GetNormalSpawner() then + zombiesToSpawn = self:GetNormalSpawner():GetZombiesToSpawn() + end + + if self:GetSpecialSpawner() then + if zombiesToSpawn then + zombiesToSpawn = zombiesToSpawn + self:GetSpecialSpawner():GetZombiesToSpawn() + else + zombiesToSpawn = self:GetSpecialSpawner():GetZombiesToSpawn() + end + end + + -- this will trigger if no more zombies will spawn, but more a re required to end a round + if zombiesToSpawn == 0 and self:GetZombiesKilled() + numzombies < self:GetZombiesMax() then + if self:GetNormalSpawner() then + self:GetNormalSpawner():SetZombiesToSpawn(self:GetZombiesMax() - (self:GetZombiesKilled() + numzombies)) + DebugPrint(2, "Spawned additional normal zombies because the wave was underspawning.") + elseif self:GetSpecialSpawner() then + self:GetSpecialSpawner():SetZombiesToSpawn(self:GetZombiesMax() - (self:GetZombiesKilled() + numzombies)) + DebugPrint(2, "Spawned additional special zombies because the wave was underspawning.") + end + end + + if ( self:GetZombiesKilled() >= self:GetZombiesMax() ) then + if numzombies <= 0 then + self:Prepare() + timer.Remove( "NZRoundThink" ) + end + end +end + +function nzRound:ResetGame() + --Main Behaviour + nzDoors:LockAllDoors() + self:SetState( ROUND_WAITING ) + --Notify + PrintMessage( HUD_PRINTTALK, "GAME READY!" ) + --Reset variables + self:SetNumber( 0 ) + + self:SetZombiesKilled( 0 ) + self:SetZombiesMax( 0 ) + + --Reset all player ready states + for _, ply in pairs( player.GetAllReady() ) do + ply:UnReady() + end + + --Reset all downed players' downed status + for k,v in pairs( player.GetAll() ) do + v:KillDownedPlayer( true ) + v.SoloRevive = nil -- Reset Solo Revive counter + end + + --Remove all enemies + for k,v in pairs( nzConfig.ValidEnemies ) do + for k2, v2 in pairs( ents.FindByClass( k ) ) do + v2:Remove() + end + end + + --Resets all active palyers playing state + for _, ply in pairs( player.GetAllPlaying() ) do + ply:SetPlaying( false ) + end + + --Reset the electricity + nzElec:Reset(true) + + --Remove the random box + nzRandomBox.Remove() + + --Reset all perk machines + for k,v in pairs(ents.FindByClass("perk_machine")) do + v:TurnOff() + end + + for _, ply in pairs(player.GetAll()) do + ply:SetPoints(0) --Reset all player points + ply:RemovePerks() --Remove all players perks + end + + --Clean up powerups + nzPowerUps:CleanUp() + + --Reset easter eggs + nzEE:Reset() + nzEE.Major:Reset() + + --Reset merged navigation groups + nz.Nav.ResetNavGroupMerges() + +end + +function nzRound:End() + --Main Behaviour + self:SetState( ROUND_GO ) + --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() + self:ResetGame() + end) + + hook.Call( "OnRoundEnd", nzRound ) +end + +function nzRound:Create() + + if self:InState( ROUND_WAITING ) then + PrintMessage( HUD_PRINTTALK, "The mode has been set to creative mode!" ) + self:SetState( ROUND_CREATE ) + --We are in create + for _, ply in pairs( player.GetAll() ) do + if ply:IsSuperAdmin() then + ply:GiveCreativeMode() + end + if ply:IsReady() then + ply:SetReady( false ) + end + end + + nzMapping:CleanUpMap() + + --Re-enable navmesh visualization + for k,v in pairs(nz.Nav.Data) do + local navarea = navmesh.GetNavAreaByID(k) + if v.link then + navarea:SetAttributes(NAV_MESH_STOP) + else + navarea:SetAttributes(NAV_MESH_AVOID) + end + end + + elseif self:InState( ROUND_CREATE ) then + PrintMessage( HUD_PRINTTALK, "The mode has been set to play mode!" ) + self:SetState( ROUND_WAITING ) + --We are in play mode + for k,v in pairs(player.GetAll()) do + v:SetSpectator() + end + end +end + +function nzRound:SetupGame() + + self:SetNumber( 0 ) + + -- Store a session of all our players + for _, ply in pairs(player.GetAll()) do + if ply:IsValid() and ply:IsReady() then + ply:SetPlaying( true ) + end + ply:SetFrags( 0 ) --Reset all player kills + end + + nzMapping:CleanUpMap() + nzDoors:LockAllDoors() + + -- Reset navigation attributes so they don't save into the actual .nav file. + for k,v in pairs(nz.Nav.Data) do + navmesh.GetNavAreaByID(k):SetAttributes(v.prev) + end + + -- Open all doors with no price and electricity requirement + for k,v in pairs(ents.GetAll()) do + if v:IsBuyableEntity() then + local data = v:GetDoorData() + if data then + if tonumber(data.price) == 0 and tobool(data.elec) == false then + nzDoors:OpenDoor( v ) + end + end + end + -- Setup barricades + if v:GetClass() == "breakable_entry" then + v:ResetPlanks() + end + end + + -- Empty the link table + table.Empty(nzDoors.OpenedLinks) + + -- All doors with Link 0 (No Link) + nzDoors.OpenedLinks[0] = true + --nz.nzDoors.Functions.SendSync() + + -- Spawn a random box + nzRandomBox.Spawn() + + local power = ents.FindByClass("power_box") + if !IsValid(power[1]) then -- No power switch D: + nzElec:Activate(true) -- Silently turn on the power + else + nzElec:Reset() -- Reset with no value to play the power down sound + end + + nz.Perks.Functions.UpdateQuickRevive() + + nzRound:SetNextSpecialRound( GetConVar("nz_round_special_interval"):GetInt() ) + + nzEE.Major:Reset() + + hook.Call( "OnGameBegin", nzRound ) + +end diff --git a/gamemodes/nzombies3/gamemode/round/sv_round_meta.lua b/gamemodes/nzombies3/gamemode/round/sv_round_meta.lua new file mode 100644 index 00000000..8ae32004 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sv_round_meta.lua @@ -0,0 +1,125 @@ +--pool network strings +util.AddNetworkString( ", nzRoundNumber" ) +util.AddNetworkString( ", nzRoundState" ) +util.AddNetworkString( ", nzRoundSpecial" ) +util.AddNetworkString( "nzPlayerReadyState" ) +util.AddNetworkString( "nzPlayerPlayingState" ) + +function nzRound:GetZombiesKilled() + return self.ZombiesKilled +end +function nzRound:SetZombiesKilled( num ) + self.ZombiesKilled = num +end + +function nzRound:GetZombiesMax() + return self.ZombiesMax +end +function nzRound:SetZombiesMax( num ) + self.ZombiesMax = num +end + +function nzRound:GetZombieHealth() + return self.ZombieHealth +end +function nzRound:SetZombieHealth( num ) + self.ZombieHealth = num +end + +function nzRound:GetNormalSpawner() + return self.hNormalSpawner +end + +function nzRound:SetNormalSpawner(spawner) + self.hNormalSpawner = spawner +end + +function nzRound:GetSpecialSpawner() + return self.hSpecialSpawner +end + +function nzRound:SetSpecialSpawner(spawner) + self.hSpecialSpawner = spawner +end + +function nzRound:GetZombieSpeeds() + return self.ZombieSpeeds +end +function nzRound:SetZombieSpeeds( tbl ) + self.ZombieSpeeds = tbl +end + +function nzRound:SetGlobalZombieData( tbl ) + self:SetZombiesMax(tbl.maxzombies or 5) + self:SetZombieHealth(tbl.health or 75) + self:SetSpecial(tbl.special or false) +end + +function nzRound:InState( state ) + return self:GetState() == state +end + +function nzRound:IsSpecial() + return self.SpecialRound or false +end + +function nzRound:SetSpecial( bool ) + self.SpecialRound = bool or false + self:SendSpecialRound( self.SpecialRound ) +end + +function nzRound:InProgress() + return self:GetState() == ROUND_PREP or self:GetState() == ROUND_PROG +end + +function nzRound:SetState( state ) + + self.RoundState = state + + self:SendState( state ) + +end + +function nzRound:GetState() + + return self.RoundState + +end + +function nzRound:SetNumber( number ) + self.Number = number + + self:SendNumber( number ) + +end + +function nzRound:IncrementNumber() + + self:SetNumber( self:GetNumber() + 1 ) + +end + +function nzRound:GetNumber() + + return self.Number + +end + +function nzRound:SetEndTime( time ) + + SetGlobalFloat( "nzEndTime", time ) + +end + +function nzRound:GetEndTime( time ) + + GetGlobalFloat( "nzEndTime" ) + +end + +function nzRound:GetNextSpawnTime() + return self.NextSpawnTime or 0 +end +function nzRound:SetNextSpawnTime( time ) + self.NextSpawnTime = time +end diff --git a/gamemodes/nzombies3/gamemode/round/sv_special_round.lua b/gamemodes/nzombies3/gamemode/round/sv_special_round.lua new file mode 100644 index 00000000..b250320b --- /dev/null +++ b/gamemodes/nzombies3/gamemode/round/sv_special_round.lua @@ -0,0 +1,18 @@ +function nzRound:SetNextSpecialRound( num ) + self.NextSpecialRound = num +end + +function nzRound:GetNextSpecialRound() + return self.NextSpecialRound +end + +function nzRound:MarkedForSpecial( num ) + return (self.NextSpecialRound == num or (nzConfig.RoundData[ num ] and nzConfig.RoundData[ num ].special)) or false +end + +util.AddNetworkString("nz_hellhoundround") +function nzRound:CallHellhoundRound() + net.Start("nz_hellhoundround") + net.WriteBool(true) + net.Broadcast() +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/scoring/sh_player.lua b/gamemodes/nzombies3/gamemode/scoring/sh_player.lua new file mode 100644 index 00000000..25a0cdf3 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/scoring/sh_player.lua @@ -0,0 +1,37 @@ +local meta = FindMetaTable("Player") + +function meta:GetTotalKills() + return self:GetNWInt("iZombiesKilled", 0) +end + +function meta:SetTotalKills(value) + self:SetNWInt("iZombiesKilled", value) +end + +function meta:IncrementTotalKills() + self:SetTotalKills(self:GetTotalKills() + 1) +end + +function meta:GetTotalDowns() + return self:GetNWInt("iTotalDowns", 0) +end + +function meta:SetTotalDowns(value) + self:SetNWInt("iTotalDowns", value) +end + +function meta:IncrementTotalDowns() + self:SetTotalDowns(self:GetTotalDowns() + 1) +end + +function meta:GetTotalRevives() + return self:GetNWInt("iTotalRevieves", 0) +end + +function meta:SetTotalRevives(value) + self:SetNWInt("iTotalRevieves", value) +end + +function meta:IncrementTotalRevives() + self:SetTotalRevives(self:GetTotalRevives() + 1) +end diff --git a/gamemodes/nzombies3/gamemode/scoring/sv_update.lua b/gamemodes/nzombies3/gamemode/scoring/sv_update.lua new file mode 100644 index 00000000..29a8dcef --- /dev/null +++ b/gamemodes/nzombies3/gamemode/scoring/sv_update.lua @@ -0,0 +1,18 @@ +function GM:OnZombieKilled(zombie, dmgInfo) + local attacker = dmgInfo:GetAttacker() + if IsValid(attacker) and attacker:IsPlayer() then + attacker:IncrementTotalKills() + end +end + +hook.Add("PlayerRevived", "nzupdateReviveScore", function(ply, revivor) + if IsValid(revivor) and revivor:IsPlayer() then + revivor:IncrementTotalRevives() + end +end ) + +hook.Add("PlayerDowned", "nzupdateDownedScore", function(ply) + if IsValid(ply) and ply:IsPlayer() then + ply:IncrementTotalRevives() + end +end ) diff --git a/gamemodes/nzombies3/gamemode/shared.lua b/gamemodes/nzombies3/gamemode/shared.lua new file mode 100644 index 00000000..7d22946c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/shared.lua @@ -0,0 +1,24 @@ +GM.Name = "nZombies 3" +GM.Author = "Alig96, Zet0r, Lolle" +GM.Email = "N/A" +GM.Website = "N/A" + +-- Constants -- + +--Round Constants + +ROUND_WAITING = 0 +ROUND_INIT = 1 +ROUND_PREP = 2 +ROUND_PROG = 3 +ROUND_CREATE = 4 +ROUND_GO = 5 + +--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/gamemodes/nzombies3/gamemode/special_weapons/sh_constructor.lua b/gamemodes/nzombies3/gamemode/special_weapons/sh_constructor.lua new file mode 100644 index 00000000..3a21f92a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/special_weapons/sh_constructor.lua @@ -0,0 +1,6 @@ +-- Setup Doors module +nzSpecialWeapons = nzSpecialWeapons or {} + +nzSpecialWeapons.Categories = nzSpecialWeapons.Categories or {} +nzSpecialWeapons.Weapons = nzSpecialWeapons.Weapons or {} +nzSpecialWeapons.Keys = nzSpecialWeapons.Keys or {} diff --git a/gamemodes/nzombies3/gamemode/special_weapons/sh_functions.lua b/gamemodes/nzombies3/gamemode/special_weapons/sh_functions.lua new file mode 100644 index 00000000..b45db394 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/special_weapons/sh_functions.lua @@ -0,0 +1,26 @@ +function nzSpecialWeapons:CreateCategory(id, bind, useammo) + self.Categories[id] = { + bind = bind, + --use = useFunc + } + if useammo then + game.AddAmmoType( { + name = "nz_"..id, + } ) + end + self.Keys[bind] = id +end + +function nzSpecialWeapons:AddWeapon( wepclass, id, use, equip, maxammo ) + self.Weapons[wepclass] = {id = id, use = use, equip = equip, maxammo = maxammo} +end + +hook.Add("KeyPress", "SpecialWeaponsUsage", function(ply, key) + local id = nzSpecialWeapons.Keys[key] + if id and ply:GetNotDowned() then -- Can't use grenades and stuff while downed + local wep = ply:GetSpecialWeaponFromCategory( id ) + if IsValid(wep) and !ply:GetUsingSpecialWeapon() and nzSpecialWeapons.Weapons[wep:GetClass()].use then + nzSpecialWeapons.Weapons[wep:GetClass()].use(ply, wep) + end + end +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/special_weapons/sh_meta_functions.lua b/gamemodes/nzombies3/gamemode/special_weapons/sh_meta_functions.lua new file mode 100644 index 00000000..79e9fe99 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/special_weapons/sh_meta_functions.lua @@ -0,0 +1,72 @@ +local wep = FindMetaTable("Weapon") +local ply = FindMetaTable("Player") + +function wep:IsSpecial() + return nzSpecialWeapons.Weapons[self:GetClass()] and true or false +end + +function wep:GetSpecialCategory() + return nzSpecialWeapons.Weapons[self:GetClass()].id +end + +function ply:GetSpecialWeaponFromCategory( id ) + if !self.NZSpecialWeapons then self.NZSpecialWeapons = {} end + return self.NZSpecialWeapons[id] or nil +end + +function ply:EquipPreviousWeapon() + if IsValid(self.NZPrevWep) then -- If the previously used weapon is valid, use that + self:SelectWeapon(self.NZPrevWep:GetClass()) + else + for k,v in pairs(self:GetWeapons()) do -- And pick the first one that isn't special + if !v:IsSpecial() then self:SelectWeapon(v:GetClass()) return end + end + self:SetActiveWeapon(nil) + end +end + +-- Prevent players from manually switching to the weapon if it is special - it is handled by the bind +function GM:PlayerSwitchWeapon(ply, oldwep, newwep) + -- In case a player is trying to switch both to and from a non-special weapon, but their status is stuck to true + if IsValid(ply) and ply:GetUsingSpecialWeapon() and (!IsValid(oldwep) or !oldwep:IsSpecial()) and !newwep:IsSpecial() then + -- It should never happen as a player shouldn't be able to use non-special weapons with the status on, but it may get stuck + ply:SetUsingSpecialWeapon(false) + print(ply:Nick().."'s UsingSpecialWeapon status was true but he isn't equipped with a special weapon and isn't trying to. Resetting ...") + end + if IsValid(oldwep) and IsValid(newwep) then + if (!ply:GetUsingSpecialWeapon() and newwep:IsSpecial()) or (ply:GetUsingSpecialWeapon() and oldwep:IsSpecial()) then return true end + if oldwep != newwep and !oldwep:IsSpecial() then + ply.NZPrevWep = oldwep + end + end +end + +if SERVER then + function ply:AddSpecialWeapon(wep) + if !self.NZSpecialWeapons then self.NZSpecialWeapons = {} end + local id = wep:GetSpecialCategory() + self.NZSpecialWeapons[id] = wep + nzSpecialWeapons:SendSpecialWeaponAdded(self, wep, id) + if nzSpecialWeapons.Weapons[wep:GetClass()].equip then + nzSpecialWeapons.Weapons[wep:GetClass()].equip(self, wep) + end + end + + -- This hook only works server-side + hook.Add("WeaponEquip", "SetSpecialWeapons", function(wep) + if wep:IsSpecial() then + -- 0 second timer for the next tick where wep's owner is valid + timer.Simple(0, function() + local ply = wep:GetOwner() + if IsValid(ply) then + local oldwep = ply:GetSpecialWeaponFromCategory( wep:GetSpecialCategory() ) + print(wep, oldwep) + if IsValid(oldwep) then + ply:StripWeapon(oldwep:GetClass()) + end + ply:AddSpecialWeapon(wep) + end + end) + end + end) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/special_weapons/sh_specialweapons.lua b/gamemodes/nzombies3/gamemode/special_weapons/sh_specialweapons.lua new file mode 100644 index 00000000..cfbcc2aa --- /dev/null +++ b/gamemodes/nzombies3/gamemode/special_weapons/sh_specialweapons.lua @@ -0,0 +1,72 @@ + +-- Crowbar test melee weapon +nzSpecialWeapons:CreateCategory("knife", 0) +nzSpecialWeapons:CreateCategory("specialgrenade", IN_GRENADE2, true) +nzSpecialWeapons:CreateCategory("grenade", IN_GRENADE1, true) +nzSpecialWeapons:CreateCategory("display", 0) + +nzSpecialWeapons:AddWeapon( "nz_quickknife_crowbar", "knife", function(ply, wep) + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SetActiveWeapon(wep) + timer.Simple(0.05, function() + if IsValid(ply) then + ply:ConCommand("+attack") + timer.Simple(0.1, function() + if IsValid(ply) then + ply:ConCommand("-attack") + end + end) + end + end) + timer.Simple(0.5, function() + if IsValid(ply) then + ply:SetUsingSpecialWeapon(false) + ply:EquipPreviousWeapon() + end + end) + end +end, function(ply, wep) +end) + +nzSpecialWeapons:AddWeapon( "nz_grenade", "grenade", function(ply) -- Use function + if SERVER then + if ply:GetAmmoCount("nz_grenade") <= 0 then return end + ply:SetUsingSpecialWeapon(true) + ply:SelectWeapon("nz_grenade") + timer.Simple(0.5, function() + if IsValid(ply) then + local wep = ply:GetActiveWeapon() + wep:ThrowGrenade(1000) + ply:SetAmmo(ply:GetAmmoCount("nz_grenade") - 1, "nz_grenade") + end + end) + timer.Simple(1, function() + if IsValid(ply) then + ply:SetUsingSpecialWeapon(false) + ply:SetActiveWeapon(nil) + ply:EquipPreviousWeapon() + end + end) + else + local wep = LocalPlayer():GetWeapon("nz_grenade") + wep:StartGrenadeModel() + timer.Simple(0.5, function() + if IsValid(wep) then + wep:EndGrenadeModel() + end + end) + end +end, function(ply) -- Equip Function + --ply:SetAmmo(4, "nz_grenade") +end, function(ply) -- Max Ammo function + ply:SetAmmo(4, "nz_grenade") +end) + +-- Does nothing, just needs to count as special +nzSpecialWeapons:AddWeapon( "nz_perk_bottle", "display", nil, function(ply, wep) + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SelectWeapon("nz_perk_bottle") + end +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/special_weapons/sh_sync.lua b/gamemodes/nzombies3/gamemode/special_weapons/sh_sync.lua new file mode 100644 index 00000000..3b1be55c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/special_weapons/sh_sync.lua @@ -0,0 +1,42 @@ +if SERVER then + util.AddNetworkString("nzSendSpecialWeapon") + + function nzSpecialWeapons:SendSpecialWeaponAdded(ply, wep, id) + timer.Simple(0.1, function() + if IsValid(ply) then + net.Start("nzSendSpecialWeapon") + net.WriteString(id) + net.WriteBool(true) + net.WriteEntity(wep) + net.Send(ply) + end + end) + end + + function nzSpecialWeapons:SendSpecialWeaponRemoved(ply, id) + timer.Simple(0.1, function() + if IsValid(ply) then + net.Start("nzSendSpecialWeapon") + net.WriteString(id) + net.WriteBool(false) + net.Send(ply) + end + end) + end +end + +if CLIENT then + local function ReceiveSpecialWeaponAdded() + if !LocalPlayer().NZSpecialWeapons then LocalPlayer().NZSpecialWeapons = {} end + local id = net.ReadString() + local bool = net.ReadBool() + + if bool then + local ent = net.ReadEntity() + LocalPlayer().NZSpecialWeapons[id] = ent + else + LocalPlayer().NZSpecialWeapons[id] = nil + end + end + net.Receive("nzSendSpecialWeapon", ReceiveSpecialWeaponAdded) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/spectator/sv_override.lua b/gamemodes/nzombies3/gamemode/spectator/sv_override.lua new file mode 100644 index 00000000..92924bb0 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/spectator/sv_override.lua @@ -0,0 +1,52 @@ +--Gamemode Overrides + +function GM:PlayerInitialSpawn( ply ) + timer.Simple( 0, function() ply:SetSpectator() end ) +end + +function GM:PlayerDeath( ply, wep, killer ) + ply:SetSpectator() + ply:SetTargetPriority(TARGET_PRIORITY_NONE) +end + +function GM:PlayerDeathThink( ply ) + + -- Allow players in creative mode to respawn + if ply:IsSuperAdmin() and nzRound:InState( ROUND_CREATE ) then + if ply:KeyDown(IN_JUMP) or ply:KeyDown(IN_ATTACK) then + ply:Spawn() + return true + end + end + + local players = player.GetAllPlayingAndAlive() + + if ply:KeyPressed( IN_RELOAD ) then + ply:SetSpectatingType( ply:GetSpectatingType() + 1 ) + if ply:GetSpectatingType() > 5 then + ply:SetSpectatingType( 4 ) + ply:SetupHands(players[ ply:GetSpectatingID() ]) + end + ply:Spectate( ply:GetSpectatingType() ) + elseif ply:KeyPressed( IN_ATTACK ) then + ply:SetSpectatingID( ply:GetSpectatingID() + 1 ) + if ply:GetSpectatingID() > #players then ply:SetSpectatingID( 1 ) end + ply:SpectateEntity( players[ ply:GetSpectatingID() ] ) + elseif ply:KeyPressed( IN_ATTACK2 ) then + ply:SetSpectatingID( ply:GetSpectatingID() - 1 ) + if ply:GetSpectatingID() <= 0 then ply:SetSpectatingID( #players ) end + ply:SpectateEntity( players[ ply:GetSpectatingID() ] ) + end +end + +local function disableDeadUse( ply, ent ) + if !ply:Alive() then return false end +end + +hook.Add( "PlayerUse", "disableDeadUse", disableDeadUse) + +local function disableDeadPickups( ply, ent ) + if !ply:Alive() then return false end +end + +hook.Add( "AllowPlayerPickup", "disableDeadPickups", disableDeadPickups) diff --git a/gamemodes/nzombies3/gamemode/spectator/sv_player.lua b/gamemodes/nzombies3/gamemode/spectator/sv_player.lua new file mode 100644 index 00000000..c2e2db0d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/spectator/sv_player.lua @@ -0,0 +1,15 @@ +--Get the meta Table +local plyMeta = FindMetaTable( "Player" ) +--accessors +AccessorFunc( plyMeta, "iSpectatingID", "SpectatingID", FORCE_NUMBER ) +AccessorFunc( plyMeta, "iSpectatingType", "SpectatingType", FORCE_NUMBER ) + +function plyMeta:SetSpectator() + if self:Alive() then + self:KillSilent() + end + self:SetTeam( TEAM_SPECTATOR ) + self:SetSpectatingType( OBS_MODE_CHASE ) + self:Spectate( self:GetSpectatingType() ) + self:SetSpectatingID( 1 ) +end diff --git a/gamemodes/nzombies3/gamemode/tools/sh_constructor.lua b/gamemodes/nzombies3/gamemode/tools/sh_constructor.lua new file mode 100644 index 00000000..d290e676 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_constructor.lua @@ -0,0 +1,10 @@ +//Main Tables +nz.Tools = {} +nz.Tools.Functions = {} +nz.Tools.ToolData = {} + +//Variables +if CLIENT then + nz.Tools.Advanced = nz.Tools.Advanced or false + nz.Tools.SavedData = {} +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_meta.lua b/gamemodes/nzombies3/gamemode/tools/sh_meta.lua new file mode 100644 index 00000000..e431516a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_meta.lua @@ -0,0 +1,15 @@ +local playerMeta = FindMetaTable("Player") + +function playerMeta:SetNZToolData( data ) + self.NZToolData = nil + if data then + self.NZToolData = data + end +end + +function playerMeta:SetActiveNZTool( tool ) + local wep = self:GetActiveWeapon() + if IsValid(wep) and wep:GetClass() == "nz_multi_tool" then + wep.ToolMode = tool + end +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_sync.lua b/gamemodes/nzombies3/gamemode/tools/sh_sync.lua new file mode 100644 index 00000000..e8668894 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_sync.lua @@ -0,0 +1,76 @@ +//Client Server Syncing + +if SERVER then + + //Server to client (Server) + util.AddNetworkString( "nz.Tools.Sync" ) + util.AddNetworkString( "nz.Tools.Update" ) + + function nz.Tools.Functions.SendSync() + + end + + function nz.Tools.Functions.ReceiveData(len, ply) + if !IsValid(ply) then return end + local id = net.ReadString() + local wep = ply:GetActiveWeapon() + + //Call holster on the old tool + if nz.Tools.ToolData[wep.ToolMode] then + nz.Tools.ToolData[wep.ToolMode].OnHolster(wep, ply, ply.NZToolData) + end + + ply:SetActiveNZTool( id ) + //Only read the data if the tool has any - as shown by the bool + if net.ReadBool() then + ply:SetNZToolData( net.ReadTable() ) + end + + //Then call equip on the new one + if nz.Tools.ToolData[id] then + nz.Tools.ToolData[id].OnEquip(wep, ply, ply.NZToolData) + end + end + net.Receive( "nz.Tools.Update", nz.Tools.Functions.ReceiveData ) +end + +if CLIENT then + + //Client to server + function nz.Tools.Functions.SendData( data, tool, savedata ) + if data then + net.Start("nz.Tools.Update") + net.WriteString(tool) + //Let the server know we're also sending a table of data + net.WriteBool(true) + net.WriteTable(data) + net.SendToServer() + else + //This tool doesn't have any data + net.Start("nz.Tools.Update") + net.WriteString(tool) + net.WriteBool(false) + net.SendToServer() + end + + //Always save on submit - if a special table of savedata is provided, use that + if savedata then + nz.Tools.Functions.SaveData( savedata, tool ) + else + nz.Tools.Functions.SaveData( data, tool ) + end + end + + function nz.Tools.Functions.SaveData( data, tool ) + nz.Tools.SavedData[tool] = nil + nz.Tools.SavedData[tool] = data + end + + //Server to client (Client) + function nz.Tools.Functions.ReceiveSync( length ) + + end + + //Receivers + net.Receive( "nz.Tools.Sync", nz.Perks.Functions.ReceiveSync ) +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools.lua new file mode 100644 index 00000000..ebedc535 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools.lua @@ -0,0 +1,63 @@ +// + +function nz.Tools.Functions.CreateTool(id, serverdata, clientdata) + if SERVER then + nz.Tools.ToolData[id] = serverdata + else + nz.Tools.ToolData[id] = clientdata + end +end + +function nz.Tools.Functions.Get(id) + return nz.Tools.ToolData[id] +end + +function nz.Tools.Functions.GetList() + local tbl = {} + + for k,v in pairs(nz.Tools.ToolData) do + tbl[k] = v.displayname + end + + return tbl +end + +nz.Tools.Functions.CreateTool("default", { + displayname = "Multitool", + desc = "Hold Q to pick a tool to use", + condition = function(wep, ply) + return false + end, + + PrimaryAttack = function(wep, ply, tr, data) + end, + + SecondaryAttack = function(wep, ply, tr, data) + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Multitool", + desc = "Hold Q to pick a tool to use", + condition = function(wep, ply) + return false + end, + interface = function(frame, data) + local text = vgui.Create("DLabel", frame) + text:SetText("Select a tool in the list to the left.") + text:SetFont("Trebuchet18") + text:SetTextColor( Color(50, 50, 50) ) + text:SizeToContents() + text:Center() + + return text + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_barricade.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_barricade.lua new file mode 100644 index 00000000..e00973b6 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_barricade.lua @@ -0,0 +1,65 @@ +nz.Tools.Functions.CreateTool("barricade", { + displayname = "Barricade Creator", + desc = "LMB: Place Barricade, RMB: Remove Barricade", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:BreakEntry(tr.HitPos + Vector(0,0,45), Angle(0,(tr.HitPos - ply:GetPos()):Angle()[2],0), data.planks, data.jump, ply) + end, + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "breakable_entry" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Barricade Creator", + desc = "LMB: Place Barricade, RMB: Remove Barricade", + icon = "icon16/door.png", + weight = 7, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local valz = {} + valz["Row1"] = data.planks + valz["Row2"] = data.jump + + local function UpdateData() + data.planks = valz["Row1"] + data.jump = valz["Row2"] + + PrintTable(data) + + nz.Tools.Functions.SendData(data, "barricade") + end + + local DProperties = vgui.Create( "DProperties", frame ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 10 ) + + local Row1 = DProperties:CreateRow( "Barricade", "Has Planks?" ) + Row1:Setup( "Boolean" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val UpdateData() end + local Row2 = DProperties:CreateRow( "Barricade", "Jump Animations?" ) + Row2:Setup( "Boolean" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val UpdateData() end + + return DProperties + end, + defaultdata = { + planks = 1, + jump = 0, + } +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_block.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_block.lua new file mode 100644 index 00000000..d826ef0d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_block.lua @@ -0,0 +1,74 @@ +nz.Tools.Functions.CreateTool("block", { + displayname = "Invisible Block Spawner", + desc = "LMB: Create Invisible Block, RMB: Remove Invisible Block, R: Change Model", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:BlockSpawn(tr.HitPos,Angle(90,(tr.HitPos - ply:GetPos()):Angle()[2] + 90,90), data.model, ply) + end, + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "wall_block" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "wall_block" then + tr.Entity:SetModel(data.model) + end + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Invisible Block Spawner", + desc = "LMB: Create Invisible Block, RMB: Remove Invisible Block, R: Change Model", + icon = "icon16/shading.png", + weight = 15, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local Scroll = vgui.Create( "DScrollPanel", frame ) + Scroll:SetSize( 280, 300 ) + Scroll:SetPos( 10, 10 ) + + local List = vgui.Create( "DIconLayout", Scroll ) + List:SetSize( 340, 200 ) + List:SetPos( 0, 0 ) + List:SetSpaceY( 5 ) + List:SetSpaceX( 5 ) + + local function UpdateData() + nz.Tools.Functions.SendData( {model = data.model}, "block", {model = data.model}) + end + + local models = util.KeyValuesToTable((file.Read("settings/spawnlist/default/023-general.txt", "MOD"))) + + for k,v in pairs(models["contents"]) do + if v.model then + local Blockmodel = List:Add( "SpawnIcon" ) + Blockmodel:SetSize( 40, 40 ) + Blockmodel:SetModel(v.model) + Blockmodel.DoClick = function() + data.model = v.model + UpdateData() + end + Blockmodel.Paint = function(self) + if data.model == v.model then + surface.SetDrawColor(0,0,200) + self:DrawOutlinedRect() + end + end + end + end + + return Scroll + end, + defaultdata = { + model = "models/hunter/plates/plate2x2.mdl" + }, +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_door.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_door.lua new file mode 100644 index 00000000..9432b9d4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_door.lua @@ -0,0 +1,158 @@ +nz.Tools.Functions.CreateTool("door", { + displayname = "Door Locker", + desc = "LMB: Apply Door Data, RMB: Remove Door Data, C: Change Properties", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + PrintTable(data) + local ent = tr.Entity + if !IsValid(ent) then return end + if ent:IsDoor() or ent:IsBuyableProp() or ent:IsButton() then + nzDoors:CreateLink(ent, data.flags) + else + ply:ChatPrint("That is not a valid door.") + end + end, + SecondaryAttack = function(wep, ply, tr, data) + local ent = tr.Entity + if !IsValid(ent) then return end + if ent:IsDoor() or ent:IsBuyableProp() or ent:IsButton() then + nz.Nav.Functions.UnlinkAutoMergeLink(ent) + nzDoors:RemoveLink(ent) + end + end, + Reload = function(wep, ply, tr, data) + local ent = tr.Entity + if !IsValid(ent) then return end + if ent:IsDoor() or ent:IsBuyableProp() or ent:IsButton() then + nzDoors:DisplayDoorLinks(ent) + end + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Door Locker", + desc = "LMB: Apply Door Data, RMB: Remove Door Data, C: Change Properties", + icon = "icon16/lock.png", + weight = 3, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local valz = {} + valz["Row1"] = data.flag + valz["Row2"] = data.link + valz["Row3"] = data.price + valz["Row4"] = data.elec + valz["Row5"] = data.buyable + valz["Row6"] = data.rebuyable + + valz["Row7"] = data.navgroup1 + valz["Row8"] = data.navgroup2 + + local function UpdateData() + local function compileString(price, elec, flag, buyable, rebuyable, navgroup1, navgroup2) + local str = "price="..price..",elec="..elec + if flag then + str = str..",link="..flag + end + str = str..",buyable="..buyable + str = str..",rebuyable="..rebuyable + if navgroup1 and navgroup1 != "" then + str = str..",navgroup1="..navgroup1 + end + if navgroup2 and navgroup2 != "" then + str = str..",navgroup2="..navgroup2 + end + return str + end + local flag = false + if valz["Row1"] == 1 then + flag = valz["Row2"] + end + local flagString = compileString(valz["Row3"], valz["Row4"], flag, valz["Row5"], valz["Row6"], valz["Row7"], valz["Row8"]) + print(flagString) + + nz.Tools.Functions.SendData( {flags = flagString}, "door", { + flag = valz["Row1"], + link = valz["Row2"], + price = valz["Row3"], + elec = valz["Row4"], + buyable = valz["Row5"], + rebuyable = valz["Row6"], + navgroup1 = valz["Row7"], + navgroup2 = valz["Row8"], + }) + end + + -- We call it immediately as it would otherwise auto-send our table to the server, not the compiled string + UpdateData() + + local DProperties = vgui.Create( "DProperties", frame ) + DProperties:SetSize( 280, 260 ) + DProperties:SetPos( 10, 10 ) + + local Row1 = DProperties:CreateRow( "Door Settings", "Enable Flag?" ) + Row1:Setup( "Boolean" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val UpdateData() end + local Row2 = DProperties:CreateRow( "Door Settings", "Flag" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val UpdateData() end + local Row3 = DProperties:CreateRow( "Door Settings", "Price" ) + Row3:Setup( "Integer" ) + Row3:SetValue( valz["Row3"] ) + Row3.DataChanged = function( _, val ) valz["Row3"] = val UpdateData() end + local Row4 = DProperties:CreateRow( "Door Settings", "Requires Electricity?" ) + Row4:Setup( "Boolean" ) + Row4:SetValue( valz["Row4"] ) + Row4.DataChanged = function( _, val ) valz["Row4"] = val UpdateData() end + + if nz.Tools.Advanced then + local Row5 = DProperties:CreateRow( "Advanced Door Settings", "Purchaseable?" ) + Row5:Setup( "Boolean" ) + Row5:SetValue( valz["Row5"] ) + Row5.DataChanged = function( _, val ) valz["Row5"] = val UpdateData() end + local Row6 = DProperties:CreateRow( "Advanced Door Settings", "Rebuyable?" ) + Row6:Setup( "Boolean" ) + Row6:SetValue( valz["Row6"] ) + Row6.DataChanged = function( _, val ) valz["Row6"] = val UpdateData() end + + local Row7 = DProperties:CreateRow( "Nav Group Merging", "Group 1 ID" ) + Row7:Setup( "Generic" ) + Row7:SetValue( valz["Row7"] ) + Row7.DataChanged = function( _, val ) valz["Row7"] = val UpdateData() end + local Row8 = DProperties:CreateRow( "Nav Group Merging", "Group 2 ID" ) + Row8:Setup( "Generic" ) + Row8:SetValue( valz["Row8"] ) + Row8.DataChanged = function( _, val ) valz["Row8"] = val UpdateData() end + else + local text = vgui.Create("DLabel", DProperties) + text:SetText("Enable Advanced Mode for more options.") + text:SetFont("Trebuchet18") + text:SetTextColor( Color(50, 50, 50) ) + text:SizeToContents() + text:Center() + end + + return DProperties + end, + defaultdata = { + flags = "flag=0,price=1000,elec=0,buyable=1,rebuyable=0", + flag = 0, + link = 1, + price = 1000, + elec = 0, + buyable = 1, + rebuyable = 0, + + navgroup1 = "", + navgroup2 = "", + } +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_ee.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_ee.lua new file mode 100644 index 00000000..f0b208d4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_ee.lua @@ -0,0 +1,36 @@ +nz.Tools.Functions.CreateTool("ee", { + displayname = "Easter Egg Placer", + desc = "LMB: Easter Egg, RMB: Remove Easter Egg, Use Player Handler to select song", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:EasterEgg(tr.HitPos, Angle(0,0,0), "models/props_lab/huladoll.mdl", ply) + end, + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "easter_egg" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Easter Egg Placer", + desc = "LMB: Easter Egg, RMB: Remove Easter Egg, Use Player Handler to select song", + icon = "icon16/music.png", + weight = 20, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_elec.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_elec.lua new file mode 100644 index 00000000..a8e6f219 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_elec.lua @@ -0,0 +1,38 @@ +nz.Tools.Functions.CreateTool("elec", { + displayname = "Electricity Switch Placer", + desc = "LMB: Place Electricity Switch, RMB: Remove Switch", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:Electric(tr.HitPos + tr.HitNormal*5, tr.HitNormal:Angle(), nil, ply) + end, + + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "power_box" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Electricity Switch Placer", + desc = "LMB: Place Electricity Switch, RMB: Remove Switch", + icon = "icon16/lightning.png", + weight = 8, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_inviswall.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_inviswall.lua new file mode 100644 index 00000000..3344430d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_inviswall.lua @@ -0,0 +1,124 @@ +local mat = Material("color") +local white = Color(255,150,0,50) +local point1, point2, height + +if SERVER then + util.AddNetworkString("nz_InvisWallCreation") + + net.Receive("nz_InvisWallCreation", function(len, ply) + if !ply:IsInCreative() then return end + local vec1 = net.ReadVector() + local vec2 = net.ReadVector() + + nzMapping:CreateInvisibleWall(vec1, vec2, ply) + end) +end + +nz.Tools.Functions.CreateTool("inviswall", { + displayname = "Invisible Wall Creator", + desc = "LMB: Set Corners, RMB: Remove Invisible Wall at spot, R: Reset corners", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + + end, + SecondaryAttack = function(wep, ply, tr, data) + local walls = ents.FindInSphere(tr.HitPos, 5) + for k,v in pairs(walls) do + if v:GetClass() == "invis_wall" then v:Remove() end + end + end, + Reload = function(wep, ply, tr, data) + + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Invisible Wall Creator", + desc = "LMB: Set Corners, RMB: Remove Invisible Wall at spot, R: Reset corners", + icon = "icon16/shape_handles.png", + weight = 16, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + end, + PrimaryAttack = function(wep, ply, tr, data) + local pos = tr.HitPos + if !pos then return end + + if !point1 then + point1 = pos + elseif !point2 then + point2 = Vector(pos.x - point1.x, pos.y - point1.y, point1.z) + elseif !height then + height = pos.z - point1.z + net.Start("nz_InvisWallCreation") + net.WriteVector(point1) + net.WriteVector(Vector(point2.x, point2.y, height)) + net.SendToServer() + point1 = nil + point2 = nil + height = nil + end + end, + Reload = function() + point1 = nil + point2 = nil + height = nil + end, + interface = function(frame, data) + local pnl = vgui.Create("DPanel", frame) + pnl:Dock(FILL) + + local chk = vgui.Create("DCheckBoxLabel", pnl) + chk:SetPos( 85, 50 ) + chk:SetText( "Draw Invisible Walls" ) + chk:SetTextColor( Color(50,50,50) ) + chk:SetConVar( "nz_drawinviswalls" ) + chk:SetValue( GetConVar("nz_drawinviswalls"):GetBool() ) + chk:SizeToContents() + + local textw = vgui.Create("DLabel", pnl) + textw:SetText("Warning: Rotating Invis Walls does not work") + textw:SetFont("Trebuchet18") + textw:SetTextColor( Color(150, 50, 50) ) + textw:SizeToContents() + textw:SetPos(30, 70) + + local textw2 = vgui.Create("DLabel", pnl) + textw2:SetText("correctly at the moment and will not save!") + textw2:SetFont("Trebuchet18") + textw2:SetTextColor( Color(150, 50, 50) ) + textw2:SizeToContents() + textw2:SetPos(32, 80) + + return pnl + end, + drawhud = function() + cam.Start3D() + render.SetMaterial(mat) + local x = point1 or nil + local y + if x then + if point2 then + if height then + y = Vector(point2.x, point2.y, height) + else + y = Vector(point2.x, point2.y, LocalPlayer():GetEyeTrace().HitPos.z - point1.z) + end + else + y = Vector(LocalPlayer():GetEyeTrace().HitPos.x - point1.x, LocalPlayer():GetEyeTrace().HitPos.y - point1.y, 0) + end + end + if x and y then + render.DrawBox(x, Angle(0,0,0), Vector(0,0,0), y, white, true) + end + cam.End3D() + end, +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_nav.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_nav.lua new file mode 100644 index 00000000..fcda71f3 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_nav.lua @@ -0,0 +1,351 @@ +nz.Tools.Functions.CreateTool("navedit", { + displayname = "Navmesh Editor", + desc = "Q: Select edit mode", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + if data.Primary then + RunConsoleCommand(data.Primary) + end + end, + + SecondaryAttack = function(wep, ply, tr, data) + if data.Secondary then + RunConsoleCommand(data.Secondary) + end + end, + Reload = function(wep, ply, tr, data) + if data.Reload then + RunConsoleCommand(data.Reload) + else + RunConsoleCommand("nav_mark") + end + end, + OnEquip = function(wep, ply, data) + if wep.Owner:IsListenServerHost() then + RunConsoleCommand("nav_edit", 1) + end + end, + OnHolster = function(wep, ply, data) + if SERVER and wep.Owner:IsListenServerHost() then + RunConsoleCommand("nav_edit", 0) + end + end +}, { + displayname = "Navmesh Editor", + desc = "Q: Select edit mode", + icon = "icon16/map.png", + weight = 39, + condition = function(wep, ply) + return nz.Tools.Advanced and game.SinglePlayer() + end, + interface = function(frame, data) + + local cont = vgui.Create("DScrollPanel", frame) + cont:Dock(FILL) + + --command and mode declaration + + local modes = { + ["Change Attributes"] = { + Primary = "nav_jump", + PrimaryDesc = "Toggle jumping", + Secondary = "nav_no_jump", + SecondaryDesc = "Toggle no jumping" + }, + ["Delete Area"] = { + Primary = "nav_delete", + PrimaryDesc = "Delete Area" + }, + ["Corners"] = { + Primary = "nav_corner_place_on_ground", + PrimaryDesc = "Lower corner to ground" + }, + ["Edit Area"] = { + Primary = "nav_split", + PrimaryDesc = "Split an area at the white line", + Secondary = "nav_merge", + SecondaryDesc = "Merge 2 areas" + }, + ["Create Areas"] = { + Primary = "nav_begin_area", + PrimaryDesc = "Begin area creation", + Secondary = "nav_end_area", + SecondaryDesc = "End area creation" + }, + ["Connect Areas"] = { + Primary = "nav_connect", + PrimaryDesc = "Add a 1-way connection", + Secondary = "nav_disconnect", + SecondaryDesc = "Remove a connection" + }, + ["Ladder"] = { + Primary = "nav_build_ladder", + PrimaryDesc = "Build a navmesh for a ladder" + }, + ["Splice"] = { + Primary = "nav_splice", + PrimaryDesc = "Splice 2 areas together", + Secondary = "nav_split", + SecondaryDesc = "Split an area at the white line", + } + } + + local commands = { + ["Build Ladder"] = "nav_build_ladder", + ["Toggle jump area"] = "nav_jump", + ["Toggle no jump area"] = "nav_no_jump", + ["Begin Area Creation"] = "nav_begin_area", + ["End Area Creation"] = "nav_end_area", + ["Merge Areas"] = "nav_merge", + ["Place Corner on Ground"] = "nav_corner_place_on_ground", + ["Connect Areas"] = "nav_connect", + ["Disconnect Areas"] = "nav_disconnect", + ["Delete Area"] = "nav_delete", + ["Split Area"] = "nav_split", + ["Mark Area"] = "nav_mark", + } + + --update helper + + local function UpdateData() + nz.Tools.Functions.SendData( data, "navedit" ) + end + + local function UpdateDesc() + local result = "" + if data.PrimaryDesc then + result = "LMB: " .. data.PrimaryDesc + end + if data.SecondaryDesc then + if result != "" then + result = result .. ", " + end + result = result .. "RMB: " .. data.SecondaryDesc + end + if data.ReloadDesc then + if result != "" then + result = result .. ", " + end + result = result .. "R: " .. data.ReloadDesc + else + if result != "" then + result = result .. ", " + end + result = result .. "R: Mark area" + end + nz.Tools.ToolData["navedit"].desc = result + end + + --"basic" stuff + + local basicCat = vgui.Create( "DCollapsibleCategory", cont ) + basicCat:SetExpanded( 1 ) + basicCat:SetLabel( "Basics" ) + basicCat:Dock(TOP) + + local basic = vgui.Create("DListLayout", cont) + basic:Dock(TOP) + basic:DockMargin(5,5,5,5) + + local modePnl = basic:Add( "DPanel" ) + modePnl:Dock(TOP) + + local modeLbl = modePnl:Add( "DLabel" ) + modeLbl:SetText("Select edit mode:") + modeLbl:SetDark(true) + modeLbl.Paint = function() end + modeLbl:Dock(LEFT) + modeLbl:SizeToContents() + + local mode = modePnl:Add( "DComboBox" ) + mode:Dock(TOP) + for k,v in pairs(modes) do + mode:AddChoice(k,v) + end + mode:AddChoice("Custom") + + -- custom mode + + local custom = basic:Add( "DPanel" ) + custom:Dock(TOP) + custom:SetVisible(false) + + local primCust = custom:Add( "DComboBox" ) + primCust:Dock(LEFT) + for k,v in pairs(commands) do + primCust:AddChoice(v, k) + end + primCust:SetValue("Primary") + + local secCust = custom:Add( "DComboBox" ) + secCust:Dock(LEFT) + for k,v in pairs(commands) do + secCust:AddChoice(v, k) + end + secCust:SetValue("Secondary") + + local reCust = custom:Add( "DComboBox" ) + reCust:Dock(LEFT) + for k,v in pairs(commands) do + reCust:AddChoice(v, k) + end + reCust:SetValue("Reload") + + local subCust = custom:Add( "DButton" ) + subCust:Dock(LEFT) + subCust:SetText("Submit") + function subCust:DoClick() + if primCust:GetValue() != "Primary" then + data.Primary, data.PrimaryDesc = primCust:GetSelected() + end + if secCust:GetValue() != "Secondary" then + data.Secondary, data.SecondaryDesc = secCust:GetSelected() + end + if reCust:GetValue() != "Reload" then + data.Reload, data.ReloadDesc = reCust:GetSelected() + end + UpdateDesc() + UpdateData() + end + + -- end custom mode + + -- basic settings + local settingsPnl = basic:Add( "DListLayout" ) + settingsPnl:Dock(TOP) + settingsPnl:DockMargin(0,10,0,0) + + local settingsLbl = settingsPnl:Add( "DLabel" ) + settingsLbl:SetText("Settings:") + settingsLbl:SetDark(true) + settingsLbl.Paint = function() end + settingsLbl:Dock(TOP) + settingsLbl:SetContentAlignment(5) + + local snapGrid = settingsPnl:Add("DNumSlider") + snapGrid:Dock(TOP) + snapGrid:SetText("Snap to Grid") + snapGrid:SetMin(0) + snapGrid:SetMax(2) + snapGrid:SetDecimals(0) + snapGrid:SetDark(true) + snapGrid:SetConVar("nav_snap_to_grid") + + local showInfo = settingsPnl:Add("DNumSlider") + showInfo:Dock(TOP) + showInfo:SetText("Display area info (sec)") + showInfo:SetMin(0) + showInfo:SetMax(60) + showInfo:SetDecimals(1) + showInfo:SetDark(true) + showInfo:SetConVar("nav_show_area_info") + + local cvars = { + ["Place created areas on ground"] = "nav_create_place_on_ground", + ["Place splitted areas on ground"] = "nav_split_place_on_ground", + ["Show Compass"] = "nav_show_compass" + } + + for k,v in pairs(cvars) do + local cvar = settingsPnl:Add( "DCheckBoxLabel" ) + cvar:SetConVar(v) + cvar:SetText(k) + cvar:SizeToContents() + cvar:SetDark(true) + cvar:Dock(TOP) + end + + -- end settings + + function mode:OnSelect(index, name, val) + if name == "Custom" then + custom:SetVisible(true) + else + custom:SetVisible(false) + data.Primary = val.Primary + data.Secondary = val.Secondary + data.PrimaryDesc = val.PrimaryDesc + data.SecondaryDesc = val.SecondaryDesc + UpdateDesc() + UpdateData() + end + end + + basicCat:SetContents(basic) + + --danger zone + + local dangerCat = vgui.Create( "DCollapsibleCategory", cont ) + dangerCat:SetExpanded( 1 ) + dangerCat:SetLabel( "Danger Zone" ) + dangerCat:Dock(TOP) + + local danger = vgui.Create("DListLayout", cont) + danger:Dock(TOP) + danger:DockMargin(5,5,5,5) + + local innerPnl = danger:Add("DPanel") + innerPnl:Dock(TOP) + + local save = innerPnl:Add("DButton") + save:Dock(FILL) + save:SetText("Save") + save:SetConsoleCommand("nav_save") + save:SizeToContents() + + local gen = innerPnl:Add("DButton") + gen:Dock(LEFT) + gen:SetText("Generate") + gen:SizeToContents() + gen:DockPadding(5,0,5,0) + gen:SetConsoleCommand("say", "/generate") + + local analyze = innerPnl:Add("DButton") + analyze:Dock(RIGHT) + analyze:SetText("Analyze") + analyze:SizeToContents() + analyze:DockPadding(5,0,5,0) + analyze:SetConsoleCommand("nav_analyze") + + local quick = danger:Add("DCheckBoxLabel") + quick:SetConVar("nav_quicksave") + quick:SetText("Enable quicksave") + quick:SizeToContents() + quick:SetDark(true) + quick:Dock(TOP) + quick:DockMargin(0,10,0,0) + + dangerCat:SetContents(danger) + + + -- end danger zone + + --"advanced" stuff + + local advCat = vgui.Create( "DCollapsibleCategory", cont ) + advCat:SetExpanded( 0 ) + advCat:SetLabel( "Quick Commands" ) + advCat:Dock(TOP) + + local adv = vgui.Create("DListLayout", cont) + adv:Dock(TOP) + + for k,v in pairs(commands) do + local btn = vgui.Create("DButton") + btn:SetText(k) + btn:Dock(TOP) + btn:DockMargin(5,5,5,0) + btn:SetConsoleCommand(v) + adv:Add(btn) + end + + advCat:SetContents(adv) + + return cont + end, + defaultdata = { + } +}) diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_navgroup.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_navgroup.lua new file mode 100644 index 00000000..cf35794d --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_navgroup.lua @@ -0,0 +1,253 @@ +if SERVER then + util.AddNetworkString("nz_NavMeshGrouping") + util.AddNetworkString("nz_NavMeshGroupRequest") + + net.Receive("nz_NavMeshGroupRequest", function(len, ply) + if !IsValid(ply) or !ply:IsSuperAdmin() then return end + + local delete = net.ReadBool() + local data = net.ReadTable() + + //Reselect all areas from the seed provided + local areas = FloodSelectNavAreas(navmesh.GetNavAreaByID(data.areaid)) + + if delete then + for k,v in pairs(areas) do + //Remove nav area from group - add true to delete the group ID as well + nz.Nav.Functions.RemoveNavGroupArea(v, true) + end + else + for k,v in pairs(areas) do + //Set their ID in the table + nz.Nav.Functions.AddNavGroupIDToArea(v, data.id) + end + end + end) +else + net.Receive("nz_NavMeshGrouping", function() + + local data = net.ReadTable() + + local frame = vgui.Create("DFrame") + frame:SetPos( 100, 100 ) + frame:SetSize( 300, 450 ) + frame:SetTitle( "Nav Mesh Grouping" ) + frame:SetVisible( true ) + frame:SetDraggable( false ) + frame:ShowCloseButton( true ) + frame:MakePopup() + frame:Center() + + local numareas = vgui.Create( "DLabel", frame ) + numareas:SetPos( 10, 30 ) + numareas:SetSize( frame:GetWide() - 10, 10) + numareas:SetText( data.num.." areas selected" ) + + local map = vgui.Create("DPanel", frame) + map:SetPos( 25, 50 ) + map:SetSize( 250, 250 ) + map:SetVisible( true ) + map.Paint = function(self, w, h) + local posx, posy = frame:GetPos() + cam.Start2D() + render.RenderView({ + origin = LocalPlayer():GetPos()+Vector(0,0,7000), + angles = Angle(90,0,0), + aspectratio = 1, + x = posx + 12, + y = posy + 100, + w = 275, + h = 275, + dopostprocess = false, + drawhud = false, + drawviewmodel = false, + viewmodelfov = 0, + fov = 90, + ortho = false, + znear = 0, + zfar = 10000, + }) + cam.End2D() + end + + local DProperties = vgui.Create( "DProperties", frame ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 50 ) + + local Row1 = DProperties:CreateRow( "Nav Group", "ID" ) + Row1:Setup( "Integer" ) + Row1:SetValue( data.id ) + Row1.DataChanged = function( _, val ) data.id = val end + + local Submit = vgui.Create( "DButton", frame ) + Submit:SetText( "Submit" ) + Submit:SetPos( 10, 410 ) + Submit:SetSize( 280, 30 ) + Submit.DoClick = function() + net.Start("nz_NavMeshGroupRequest") + net.WriteBool(false) + net.WriteTable(data) + net.SendToServer() + frame:Close() + end + + local Delete = vgui.Create( "DButton", frame ) + Delete:SetText( "Delete Group" ) + Delete:SetPos( 10, 380 ) + Delete:SetSize( 280, 20 ) + Delete.DoClick = function() + net.Start("nz_NavMeshGroupRequest") + net.WriteBool(true) + net.WriteTable(data) + net.SendToServer() + frame:Close() + end + end) +end + +nz.Tools.Functions.CreateTool("navgroup", { + displayname = "Nav Grouping Tool", + desc = "LMB: Create/Edit Nav Groups", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + local nav = navmesh.GetNearestNavArea(tr.HitPos) + local areas = FloodSelectNavAreas(nav) + + net.Start("nz_NavMeshGrouping") + net.WriteTable({num = #areas, areaid = nav:GetID(), id = nz.Nav.NavGroups[nav:GetID()] or ""}) + net.Send(ply) + end, + + SecondaryAttack = function(wep, ply, tr, data) + end, + + Reload = function(wep, ply, tr, data) + end, + + OnEquip = function(wep, ply, data) + if wep.Owner:IsListenServerHost() and GetConVar("sv_cheats"):GetBool() then + RunConsoleCommand("nav_edit", 1) + end + end, + + OnHolster = function(wep, ply, data) + if SERVER and wep.Owner:IsListenServerHost() and GetConVar("sv_cheats"):GetBool() then + RunConsoleCommand("nav_edit", 0) + end + end + +}, { + displayname = "Nav Grouping Tool", + desc = "LMB: Create/Edit Nav Groups", + icon = "icon16/chart_organisation.png", + weight = 45, + condition = function(wep, ply) + //Client needs advanced editing on to see the tool + return nz.Tools.Advanced + end, + interface = function(frame, data) + local panel = vgui.Create("DPanel", frame) + panel:SetSize(frame:GetSize()) + + local textw = vgui.Create("DLabel", panel) + textw:SetText("You need to be in a listen/local server to be") + textw:SetFont("Trebuchet18") + textw:SetTextColor( Color(150, 50, 50) ) + textw:SizeToContents() + textw:SetPos(0, 20) + textw:CenterHorizontal() + + local textw2 = vgui.Create("DLabel", panel) + textw2:SetText("able to see the Navmeshes!") + textw2:SetFont("Trebuchet18") + textw2:SetTextColor( Color(150, 50, 50) ) + textw2:SizeToContents() + textw2:SetPos(0, 30) + textw2:CenterHorizontal() + + local textw3 = vgui.Create("DLabel", panel) + textw3:SetText("The tool can still be used blindly") + textw3:SetFont("Trebuchet18") + textw3:SetTextColor( Color(50, 50, 50) ) + textw3:SizeToContents() + textw3:SetPos(0, 40) + textw3:CenterHorizontal() + + local text = vgui.Create("DLabel", panel) + text:SetText("Click on the ground to open") + text:SetFont("Trebuchet18") + text:SetTextColor( Color(50, 50, 50) ) + text:SizeToContents() + text:SetPos(0, 80) + text:CenterHorizontal() + + local text2 = vgui.Create("DLabel", panel) + text2:SetText("the Nav Grouping Interface of that area.") + text2:SetFont("Trebuchet18") + text2:SetTextColor( Color(50, 50, 50) ) + text2:SizeToContents() + text2:SetPos(0, 90) + text2:CenterHorizontal() + + local text3 = vgui.Create("DLabel", panel) + text3:SetText("Nav Groups are flood-selected but will") + text3:SetFont("Trebuchet18") + text3:SetTextColor( Color(50, 50, 50) ) + text3:SizeToContents() + text3:SetPos(0, 110) + text3:CenterHorizontal() + + local text4 = vgui.Create("DLabel", panel) + text4:SetText("be blocked by locked Navmeshes.") + text4:SetFont("Trebuchet18") + text4:SetTextColor( Color(50, 50, 50) ) + text4:SizeToContents() + text4:SetPos(0, 120) + text4:CenterHorizontal() + + local text5 = vgui.Create("DLabel", panel) + text5:SetText("Zombies can't target players in different") + text5:SetFont("Trebuchet18") + text5:SetTextColor( Color(50, 50, 50) ) + text5:SizeToContents() + text5:SetPos(0, 170) + text5:CenterHorizontal() + + local text6 = vgui.Create("DLabel", panel) + text6:SetText("navgroups unless one of them is in no navgroup.") + text6:SetFont("Trebuchet18") + text6:SetTextColor( Color(50, 50, 50) ) + text6:SizeToContents() + text6:SetPos(0, 180) + text6:CenterHorizontal() + + local text7 = vgui.Create("DLabel", panel) + text7:SetText("Use this in maps with completely seperate") + text7:SetFont("Trebuchet18") + text7:SetTextColor( Color(50, 50, 50) ) + text7:SizeToContents() + text7:SetPos(0, 200) + text7:CenterHorizontal() + + local text8 = vgui.Create("DLabel", panel) + text8:SetText("areas such as elevator-based maps.") + text8:SetFont("Trebuchet18") + text8:SetTextColor( Color(50, 50, 50) ) + text8:SizeToContents() + text8:SetPos(0, 210) + text8:CenterHorizontal() + + local text9 = vgui.Create("DLabel", panel) + text9:SetText("Use doors to merge groups.") + text9:SetFont("Trebuchet18") + text9:SetTextColor( Color(50, 50, 50) ) + text9:SizeToContents() + text9:SetPos(0, 230) + text9:CenterHorizontal() + + return panel + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_navlock.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_navlock.lua new file mode 100644 index 00000000..3982d856 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_navlock.lua @@ -0,0 +1,165 @@ +nz.Tools.Functions.CreateTool("navlock", { + displayname = "Nav Locker Tool", + desc = "LMB: Connect doors and navmeshes, RMB: Lock/Unlock navmeshes", + condition = function(wep, ply) + //Serverside doesn't need to block + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + local pos = tr.HitPos + if tr.HitWorld or wep.Owner:KeyDown(IN_SPEED) then + if !IsValid(wep.Ent1) then wep.Owner:ChatPrint("You need to mark a door first to link an area.") return end + local navarea = navmesh.GetNearestNavArea(pos) + local id = navarea:GetID() + + nz.Nav.Data[id] = { + prev = navarea:GetAttributes(), + locked = true, + link = wep.Ent1:GetDoorData().link + } + //Purely to visualize, resets when game begins or shuts down + navarea:SetAttributes(NAV_MESH_STOP) + + wep.Owner:ChatPrint("Navmesh ["..id.."] locked to door "..wep.Ent1:GetClass().."["..wep.Ent1:EntIndex().."] with link ["..wep.Ent1:GetDoorData().link.."]!") + wep.Ent1:SetMaterial( "" ) + nz.Nav.Functions.CreateAutoMergeLink(wep.Ent1, id) + wep.Ent1 = nil + return end + + local ent = tr.Entity + if !IsNavApplicable(ent) then + wep.Owner:ChatPrint("Only buyable props, doors, and buyable buttons with LINKS can be linked to navareas.") + return end + + if IsValid(wep.Ent1) and wep.Ent1 != ent then + wep.Ent1:SetMaterial( "" ) + end + + wep.Ent1 = ent + ent:SetMaterial( "hunter/myplastic.vtf" ) + end, + SecondaryAttack = function(wep, ply, tr, data) + if(!tr.HitPos)then return false end + local pos = tr.HitPos + local navarea = navmesh.GetNearestNavArea(pos) + local navid = navarea:GetID() + + if nz.Nav.Data[navid] then + navarea:SetAttributes(nz.Nav.Data[navid].prev) + wep.Owner:ChatPrint("Navmesh ["..navid.."] unlocked!") + nz.Nav.Data[navid] = nil + return end + + nz.Nav.Data[navid] = { + prev = navarea:GetAttributes(), + locked = true, + link = nil + } + + navarea:SetAttributes(NAV_MESH_AVOID) + wep.Owner:ChatPrint("Navmesh ["..navid.."] locked!") + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + if wep.Owner:IsListenServerHost() then + RunConsoleCommand("nav_edit", 1) + RunConsoleCommand("nav_quicksave", 0) + end + end, + OnHolster = function(wep, ply, data) + if SERVER and wep.Owner:IsListenServerHost() then + RunConsoleCommand("nav_edit", 0) + end + return true + end +}, { + displayname = "Nav Locker Tool", + desc = "LMB: Connect doors and navmeshes, RMB: Lock/Unlock navmeshes", + icon = "icon16/arrow_switch.png", + weight = 40, + condition = function(wep, ply) + //Client needs advanced editing on to see the tool + return nz.Tools.Advanced + end, + interface = function(frame, data) + local panel = vgui.Create("DPanel", frame) + panel:SetSize(frame:GetSize()) + + local textw = vgui.Create("DLabel", panel) + textw:SetText("You need to be in a listen/local server to be") + textw:SetFont("Trebuchet18") + textw:SetTextColor( Color(150, 50, 50) ) + textw:SizeToContents() + textw:SetPos(0, 20) + textw:CenterHorizontal() + + local textw2 = vgui.Create("DLabel", panel) + textw2:SetText("able to see the Navmeshes!") + textw2:SetFont("Trebuchet18") + textw2:SetTextColor( Color(150, 50, 50) ) + textw2:SizeToContents() + textw2:SetPos(0, 30) + textw2:CenterHorizontal() + + local textw3 = vgui.Create("DLabel", panel) + textw3:SetText("The tool can still be used blindly") + textw3:SetFont("Trebuchet18") + textw3:SetTextColor( Color(50, 50, 50) ) + textw3:SizeToContents() + textw3:SetPos(0, 40) + textw3:CenterHorizontal() + + local text = vgui.Create("DLabel", panel) + text:SetText("Right click on the ground to lock a Navmesh") + text:SetFont("Trebuchet18") + text:SetTextColor( Color(50, 50, 50) ) + text:SizeToContents() + text:SetPos(0, 80) + text:CenterHorizontal() + + local text2 = vgui.Create("DLabel", panel) + text2:SetText("Left click a door to mark the door") + text2:SetFont("Trebuchet18") + text2:SetTextColor( Color(50, 50, 50) ) + text2:SizeToContents() + text2:SetPos(0, 120) + text2:CenterHorizontal() + + local text3 = vgui.Create("DLabel", panel) + text3:SetText("then left click the ground to link") + text3:SetFont("Trebuchet18") + text3:SetTextColor( Color(50, 50, 50) ) + text3:SizeToContents() + text3:SetPos(0, 130) + text3:CenterHorizontal() + + local text4 = vgui.Create("DLabel", panel) + text4:SetText("the Navmesh with the door") + text4:SetFont("Trebuchet18") + text4:SetTextColor( Color(50, 50, 50) ) + text4:SizeToContents() + text4:SetPos(0, 140) + text4:CenterHorizontal() + + local text5 = vgui.Create("DLabel", panel) + text5:SetText("Zombies can't pathfind through locked Navmeshes") + text5:SetFont("Trebuchet18") + text5:SetTextColor( Color(50, 50, 50) ) + text5:SizeToContents() + text5:SetPos(0, 180) + text5:CenterHorizontal() + + local text6 = vgui.Create("DLabel", panel) + text6:SetText("unless their door link is opened") + text6:SetFont("Trebuchet18") + text6:SetTextColor( Color(50, 50, 50) ) + text6:SizeToContents() + text6:SetPos(0, 190) + text6:CenterHorizontal() + + return panel + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_perk.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_perk.lua new file mode 100644 index 00000000..1bba2b91 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_perk.lua @@ -0,0 +1,51 @@ +nz.Tools.Functions.CreateTool("perk", { + displayname = "Perk Machine Placer", + desc = "LMB: Place Perk Machine, RMB: Remove Perk Machine, C: Change Perk", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:PerkMachine(tr.HitPos, Angle(0,(ply:GetPos() - tr.HitPos):Angle()[2],0), data.perk, ply) + end, + + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "perk_machine" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Perk Machine Placer", + desc = "LMB: Place Perk Machine, RMB: Remove Perk Machine, C: Change Perk", + icon = "icon16/drink.png", + weight = 6, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + + local choices = vgui.Create( "DComboBox", frame ) + choices:SetPos( 10, 10 ) + choices:SetSize( 280, 30 ) + choices:SetValue( nz.Perks.Functions.Get(data.perk).name ) + for k,v in pairs(nz.Perks.Functions.GetList()) do + choices:AddChoice( v, k ) + end + choices.OnSelect = function( panel, index, value, id ) + data.perk = id + nz.Tools.Functions.SendData( data, "perk" ) + end + + return choices + end, + defaultdata = {perk = "jugg"}, +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_propremover.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_propremover.lua new file mode 100644 index 00000000..2dced2e4 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_propremover.lua @@ -0,0 +1,71 @@ +nz.Tools.Functions.CreateTool("propremover", { + displayname = "Prop Remover Tool", + desc = "LMB: Mark Prop for Removal, RMB: Unmark Prop", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + local ent = tr.Entity + local id = ent:MapCreationID() + if IsValid(ent) and ent != Entity(0) and id != -1 then + ply:ChatPrint("Marked "..ent:GetClass().." ["..ent:EntIndex().."] for removal.") + ent:SetColor(Color(200,0,0)) + nzMapping.MarkedProps[id] = true + end + end, + SecondaryAttack = function(wep, ply, tr, data) + local ent = tr.Entity + local id = ent:MapCreationID() + if IsValid(ent) and ent != Entity(0) and id != -1 then + ply:ChatPrint("Unarked "..ent:GetClass().." ["..ent:EntIndex().."] for removal.") + ent:SetColor(Color(255,255,255)) + nzMapping.MarkedProps[id] = nil + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + end, + OnHolster = function(wep, ply, data) + end +}, { + displayname = "Prop Remover Tool", + desc = "LMB: Mark Prop for Removal, RMB: Unmark Prop", + icon = "icon16/cancel.png", + weight = 35, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local panel = vgui.Create("DPanel", frame) + panel:SetSize(frame:GetSize()) + + local textw = vgui.Create("DLabel", panel) + textw:SetText("This tool marks props to be removed in-game.") + textw:SetFont("Trebuchet18") + textw:SetTextColor( Color(50, 50, 50) ) + textw:SizeToContents() + textw:SetPos(0, 80) + textw:CenterHorizontal() + + local textw2 = vgui.Create("DLabel", panel) + textw2:SetText("It will only apply once a game begins") + textw2:SetFont("Trebuchet18") + textw2:SetTextColor( Color(50, 50, 50) ) + textw2:SizeToContents() + textw2:SetPos(0, 100) + textw2:CenterHorizontal() + + local textw3 = vgui.Create("DLabel", panel) + textw3:SetText("and will reset when entering Creative Mode.") + textw3:SetFont("Trebuchet18") + textw3:SetTextColor( Color(50, 50, 50) ) + textw3:SizeToContents() + textw3:SetPos(0, 110) + textw3:CenterHorizontal() + + return panel + end, + //defaultdata = {} +}) diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_pspawn.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_pspawn.lua new file mode 100644 index 00000000..dfaa22f9 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_pspawn.lua @@ -0,0 +1,34 @@ +nz.Tools.Functions.CreateTool("pspawn", { + displayname = "Player Spawn Creator", + desc = "LMB: Place Spawnpoint, RMB: Remove Spawnpoint", + condition = function(wep, ply) + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:PlayerSpawn(tr.HitPos, ply) + end, + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "player_spawns" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Player Spawn Creator", + desc = "LMB: Place Spawnpoint, RMB: Remove Spawnpoint", + icon = "icon16/user.png", + weight = 2, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_rbox.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_rbox.lua new file mode 100644 index 00000000..ca02a5d2 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_rbox.lua @@ -0,0 +1,38 @@ +nz.Tools.Functions.CreateTool("rbox", { + displayname = "Random Box Spawnpoint", + desc = "LMB: Place Random Box Spawnpoint, RMB: Remove Random Box Spawnpoint", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + nzMapping:BoxSpawn(tr.HitPos, Angle(0,(tr.HitPos - ply:GetPos()):Angle()[2] - 90,0), ply) + end, + + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "random_box_spawns" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Random Box Spawnpoint", + desc = "LMB: Place Random Box Spawnpoint, RMB: Remove Random Box Spawnpoint", + icon = "icon16/briefcase.png", + weight = 4, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_settings.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_settings.lua new file mode 100644 index 00000000..a0114959 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_settings.lua @@ -0,0 +1,457 @@ +nz.Tools.Functions.CreateTool("settings", { + displayname = "Map Settings", + desc = "Use the Tool Interface and press Submit to save changes", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + end, + SecondaryAttack = function(wep, ply, tr, data) + end, + Reload = function(wep, ply, tr, data) + end, + OnEquip = function(wep, ply, data) + end, + OnHolster = function(wep, ply, data) + end +}, { + displayname = "Map Settings", + desc = "Use the Tool Interface and press Submit to save changes", + icon = "icon16/cog.png", + weight = 25, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local data = table.Copy(nzMapping.Settings) + local valz = {} + valz["Row1"] = data.startwep or "Select ..." + valz["Row2"] = data.startpoints or 500 + valz["Row3"] = data.maxwep or 2 + valz["Row4"] = data.eeurl or "" + valz["Row5"] = data.script or false + valz["Row6"] = data.scriptinfo or "" + valz["RBoxWeps"] = data.RBoxWeps or {} + + local sheet = vgui.Create( "DPropertySheet", frame ) + sheet:SetSize( 280, 250 ) + sheet:SetPos( 10, 10 ) + + local DProperties = vgui.Create( "DProperties", DProperySheet ) + DProperties:SetSize( 280, 250 ) + DProperties:SetPos( 0, 0 ) + sheet:AddSheet( "Map Properties", DProperties, "icon16/cog.png") + + local Row1 = DProperties:CreateRow( "Map Settings", "Starting Weapon" ) + Row1:Setup( "Combo" ) + for k,v in pairs(weapons.GetList()) do + if v.Category and v.Category != "" then + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.Category.. " - "..v.PrintName or v.ClassName, v.ClassName, false) + else + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.PrintName or v.ClassName, v.ClassName, false) + end + end + if data.startwep then + local wep = weapons.Get(data.startwep) + if !wep then wep = weapons.Get(nzConfig.BaseStartingWeapons[1]) end + if wep.Category and wep.Category != "" then + Row1:AddChoice(wep.PrintName and wep.PrintName != "" and wep.Category.. " - "..wep.PrintName or wep.ClassName, wep.ClassName, false) + else + Row1:AddChoice(wep.PrintName and wep.PrintName != "" and wep.PrintName or wep.ClassName, wep.ClassName, false) + end + end + + Row1.DataChanged = function( _, val ) valz["Row1"] = val end + + local Row2 = DProperties:CreateRow( "Map Settings", "Starting Points" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val end + + local Row3 = DProperties:CreateRow( "Map Settings", "Max Weapons" ) + Row3:Setup( "Integer" ) + Row3:SetValue( valz["Row3"] ) + Row3.DataChanged = function( _, val ) valz["Row3"] = val end + + local Row4 = DProperties:CreateRow( "Map Settings", "Easter Egg Song URL" ) + Row4:Setup( "Generic" ) + Row4:SetValue( valz["Row4"] ) + Row4.DataChanged = function( _, val ) valz["Row4"] = val end + Row4:SetTooltip("Add a link to a SoundCloud track to play this when all easter eggs have been found") + + if nz.Tools.Advanced then + local Row5 = DProperties:CreateRow( "Map Settings", "Includes Map Script?" ) + Row5:Setup( "Boolean" ) + Row5:SetValue( valz["Row5"] ) + Row5.DataChanged = function( _, val ) valz["Row5"] = val end + Row5:SetTooltip("Loads a .lua file with the same name as the config .txt from /lua/nzmapscripts - for advanced developers.") + + local Row6 = DProperties:CreateRow( "Map Settings", "Script Description" ) + Row6:Setup( "Generic" ) + Row6:SetValue( valz["Row6"] ) + Row6.DataChanged = function( _, val ) valz["Row6"] = val end + Row6:SetTooltip("Sets the description displayed when attempting to load the script.") + end + + local function UpdateData() + if !weapons.Get( valz["Row1"] ) then data.startwep = nil else data.startwep = valz["Row1"] end + if !tonumber(valz["Row2"]) then data.startpoints = 500 else data.startpoints = tonumber(valz["Row2"]) end + if !tonumber(valz["Row3"]) then data.numweps = 2 else data.numweps = tonumber(valz["Row3"]) end + if !valz["Row4"] or valz["Row4"] == "" then data.eeurl = nil else data.eeurl = valz["Row4"] end + if !valz["Row5"] then data.script = nil else data.script = valz["Row5"] end + if !valz["Row6"] or valz["Row6"] == "" then data.scriptinfo = nil else data.scriptinfo = valz["Row6"] end + if !valz["RBoxWeps"] or !valz["RBoxWeps"][1] then data.rboxweps = nil else data.rboxweps = valz["RBoxWeps"] end + if !valz["WMPerks"] or !valz["WMPerks"][1] then data.wunderfizzperks = nil else data.wunderfizzperks = valz["WMPerks"] end + PrintTable(data) + + nzMapping:SendMapData( data ) + end + + local DermaButton = vgui.Create( "DButton", DProperties ) + DermaButton:SetText( "Submit" ) + DermaButton:SetPos( 0, 180 ) + DermaButton:SetSize( 260, 30 ) + DermaButton.DoClick = UpdateData + + if nz.Tools.Advanced then + local weplist = {} + local numweplist = 0 + + local rboxpanel = vgui.Create("DPanel", sheet) + sheet:AddSheet( "Random Box Weapons", rboxpanel, "icon16/box.png") + rboxpanel.Paint = function() return end + + local rbweplist = vgui.Create("DScrollPanel", rboxpanel) + rbweplist:SetPos(0, 0) + rbweplist:SetSize(265, 150) + rbweplist:SetPaintBackground(true) + rbweplist:SetBackgroundColor( Color(200, 200, 200) ) + + local function InsertWeaponToList(name, class) + if IsValid(weplist[class]) then return end + weplist[class] = vgui.Create("DPanel", rbweplist) + weplist[class]:SetSize(265, 16) + weplist[class]:SetPos(0, numweplist*16) + table.insert(valz["RBoxWeps"], class) + + local dname = vgui.Create("DLabel", weplist[class]) + dname:SetText(name) + dname:SetTextColor(Color(50, 50, 50)) + dname:SetPos(5, 0) + dname:SetSize(250, 16) + local ddelete = vgui.Create("DImageButton", weplist[class]) + ddelete:SetImage("icon16/delete.png") + ddelete:SetPos(235, 0) + ddelete:SetSize(16, 16) + ddelete.DoClick = function() + if table.HasValue(valz["RBoxWeps"], class) then table.RemoveByValue(valz["RBoxWeps"], class) end + weplist[class]:Remove() + weplist[class] = nil + local num = 0 + for k,v in pairs(weplist) do + v:SetPos(0, num*16) + num = num + 1 + end + numweplist = numweplist - 1 + end + + numweplist = numweplist + 1 + end + + if nzMapping.Settings.rboxweps then + for k,v in pairs(nzMapping.Settings.rboxweps) do + local wep = weapons.Get(v) + if wep.Category and wep.Category != "" then + InsertWeaponToList(wep.PrintName and wep.PrintName != "" and wep.PrintName.." ["..wep.Category.."]" or v, v) + else + InsertWeaponToList(wep.PrintName and wep.PrintName != "" and wep.PrintName.." [No Category]" or v, v) + end + end + else + for k,v in pairs(weapons.GetList()) do + -- By default, add all weapons that have print names unless they are blacklisted + if v.PrintName and v.PrintName != "" and !nzConfig.WeaponBlackList[v.ClassName] and v.PrintName != "Scripted Weapon" and !v.NZPreventBox then + if v.Category and v.Category != "" then + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." ["..v.Category.."]" or v.ClassName, v.ClassName) + else + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." [No Category]" or v.ClassName, v.ClassName) + end + end + -- The rest are still available in the dropdown + end + end + + local wepentry = vgui.Create( "DComboBox", rboxpanel ) + wepentry:SetPos( 0, 155 ) + wepentry:SetSize( 146, 20 ) + wepentry:SetValue( "Weapon ..." ) + for k,v in pairs(weapons.GetList()) do + if v.Category and v.Category != "" then + wepentry:AddChoice(v.PrintName and v.PrintName != "" and v.Category.. " - "..v.PrintName or v.ClassName, v.ClassName, false) + else + wepentry:AddChoice(v.PrintName and v.PrintName != "" and v.PrintName or v.ClassName, v.ClassName, false) + end + end + wepentry.OnSelect = function( panel, index, value ) + end + + local wepadd = vgui.Create( "DButton", rboxpanel ) + wepadd:SetText( "Add" ) + wepadd:SetPos( 150, 155 ) + wepadd:SetSize( 53, 20 ) + wepadd.DoClick = function() + local v = weapons.Get(wepentry:GetOptionData(wepentry:GetSelectedID())) + if v.Category and v.Category != "" then + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." ["..v.Category.."]" or v.ClassName, v.ClassName) + else + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." [No Category]" or v.ClassName, v.ClassName) + end + wepentry:SetValue( "Weapon..." ) + end + + local wepmore = vgui.Create( "DButton", rboxpanel ) + wepmore:SetText( "More ..." ) + wepmore:SetPos( 207, 155 ) + wepmore:SetSize( 53, 20 ) + wepmore.DoClick = function() + local morepnl = vgui.Create("DFrame") + morepnl:SetSize(300, 170) + morepnl:SetTitle("More weapon options ...") + morepnl:Center() + morepnl:SetDraggable(true) + morepnl:ShowCloseButton(true) + morepnl:MakePopup() + + local morecat = vgui.Create("DComboBox", morepnl) + morecat:SetSize(150, 20) + morecat:SetPos(10, 30) + local cattbl = {} + for k,v in pairs(weapons.GetList()) do + if v.Category and v.Category != "" then + if !cattbl[v.Category] then + morecat:AddChoice(v.Category, v.Category, false) + cattbl[v.Category] = true + end + end + end + morecat:AddChoice(" Category ...", nil, true) + + local morecatadd = vgui.Create("DButton", morepnl) + morecatadd:SetText( "Add all" ) + morecatadd:SetPos( 165, 30 ) + morecatadd:SetSize( 60, 20 ) + morecatadd.DoClick = function() + local cat = morecat:GetOptionData(morecat:GetSelectedID()) + if cat and cat != "" then + for k,v in pairs(weapons.GetList()) do + if v.Category and v.Category == cat and !nzConfig.WeaponBlackList[v.ClassName] and !v.NZPreventBox then + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." ["..v.Category.."]" or v.ClassName, v.ClassName) + end + end + end + end + + local morecatdel = vgui.Create("DButton", morepnl) + morecatdel:SetText( "Remove all" ) + morecatdel:SetPos( 230, 30 ) + morecatdel:SetSize( 60, 20 ) + morecatdel.DoClick = function() + local cat = morecat:GetOptionData(morecat:GetSelectedID()) + if cat and cat != "" then + for k,v in pairs(weplist) do + local wep = weapons.Get(k) + if wep.Category and wep.Category == cat then + if table.HasValue(valz["RBoxWeps"], k) then table.RemoveByValue(valz["RBoxWeps"], k) end + weplist[k]:Remove() + weplist[k] = nil + local num = 0 + for k,v in pairs(weplist) do + v:SetPos(0, num*16) + num = num + 1 + end + numweplist = numweplist - 1 + end + end + end + end + + local moreprefix = vgui.Create("DComboBox", morepnl) + moreprefix:SetSize(150, 20) + moreprefix:SetPos(10, 60) + local prefixtbl = {} + for k,v in pairs(weapons.GetList()) do + local prefix = string.sub(v.ClassName, 0, string.find(v.ClassName, "_")) + if prefix and !prefixtbl[prefix] then + moreprefix:AddChoice(prefix, prefix, false) + prefixtbl[prefix] = true + end + end + moreprefix:AddChoice(" Prefix ...", nil, true) + + local moreprefixadd = vgui.Create("DButton", morepnl) + moreprefixadd:SetText( "Add all" ) + moreprefixadd:SetPos( 165, 60 ) + moreprefixadd:SetSize( 60, 20 ) + moreprefixadd.DoClick = function() + local prefix = moreprefix:GetOptionData(moreprefix:GetSelectedID()) + if prefix and prefix != "" then + for k,v in pairs(weapons.GetList()) do + local wepprefix = string.sub(v.ClassName, 0, string.find(v.ClassName, "_")) + if wepprefix and wepprefix == prefix and !nzConfig.WeaponBlackList[v.ClassName] and !v.NZPreventBox then + if v.Category and v.Category != "" then + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." ["..v.Category.."]" or v.ClassName, v.ClassName) + else + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." [No Category]" or v.ClassName, v.ClassName) + end + end + end + end + end + + local moreprefixdel = vgui.Create("DButton", morepnl) + moreprefixdel:SetText( "Remove all" ) + moreprefixdel:SetPos( 230, 60 ) + moreprefixdel:SetSize( 60, 20 ) + moreprefixdel.DoClick = function() + local prefix = moreprefix:GetOptionData(moreprefix:GetSelectedID()) + if prefix and prefix != "" then + for k,v in pairs(weplist) do + local wepprefix = string.sub(k, 0, string.find(k, "_")) + if wepprefix and wepprefix == prefix then + if table.HasValue(valz["RBoxWeps"], k) then table.RemoveByValue(valz["RBoxWeps"], k) end + weplist[k]:Remove() + weplist[k] = nil + local num = 0 + for k,v in pairs(weplist) do + v:SetPos(0, num*16) + num = num + 1 + end + numweplist = numweplist - 1 + end + end + end + end + + local removeall = vgui.Create("DButton", morepnl) + removeall:SetText( "Remove all" ) + removeall:SetPos( 10, 100 ) + removeall:SetSize( 140, 25 ) + removeall.DoClick = function() + for k,v in pairs(weplist) do + if table.HasValue(valz["RBoxWeps"], k) then table.RemoveByValue(valz["RBoxWeps"], k) end + weplist[k]:Remove() + weplist[k] = nil + numweplist = 0 + end + end + + local addall = vgui.Create("DButton", morepnl) + addall:SetText( "Add all" ) + addall:SetPos( 150, 100 ) + addall:SetSize( 140, 25 ) + addall.DoClick = function() + for k,v in pairs(weplist) do + if table.HasValue(valz["RBoxWeps"], k) then table.RemoveByValue(valz["RBoxWeps"], k) end + weplist[k]:Remove() + weplist[k] = nil + numweplist = 0 + end + for k,v in pairs(weapons.GetList()) do + -- By default, add all weapons that have print names unless they are blacklisted + if v.PrintName and v.PrintName != "" and !nzConfig.WeaponBlackList[v.ClassName] and v.PrintName != "Scripted Weapon" and !v.NZPreventBox then + if v.Category and v.Category != "" then + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." ["..v.Category.."]" or v.ClassName, v.ClassName) + else + InsertWeaponToList(v.PrintName and v.PrintName != "" and v.PrintName.." [No Category]" or v.ClassName, v.ClassName) + end + end + -- The same reset as when no random box list exists on server + end + end + + local reload = vgui.Create("DButton", morepnl) + reload:SetText( "Reload from server" ) + reload:SetPos( 10, 130 ) + reload:SetSize( 280, 25 ) + reload.DoClick = function() + -- Remove all and insert from random box list + for k,v in pairs(weplist) do + if table.HasValue(valz["RBoxWeps"], k) then table.RemoveByValue(valz["RBoxWeps"], k) end + weplist[k]:Remove() + weplist[k] = nil + numweplist = 0 + end + if nzMapping.Settings.rboxweps then + for k,v in pairs(nzMapping.Settings.rboxweps) do + local wep = weapons.Get(v) + if wep.Category and wep.Category != "" then + InsertWeaponToList(wep.PrintName and wep.PrintName != "" and wep.PrintName.." ["..wep.Category.."]" or v, v) + else + InsertWeaponToList(wep.PrintName and wep.PrintName != "" and wep.PrintName.." [No Category]" or v, v) + end + end + end + end + end + + local DermaButton2 = vgui.Create( "DButton", rboxpanel ) + DermaButton2:SetText( "Submit" ) + DermaButton2:SetPos( 0, 180 ) + DermaButton2:SetSize( 260, 30 ) + DermaButton2.DoClick = UpdateData + + local perklist = {} + + local perkpanel = vgui.Create("DPanel", sheet) + sheet:AddSheet( "Wunderfizz Perks", perkpanel, "icon16/drink.png") + perkpanel.Paint = function() return end + + local perklistpnl = vgui.Create("DScrollPanel", perkpanel) + perklistpnl:SetPos(0, 0) + perklistpnl:SetSize(265, 250) + perklistpnl:SetPaintBackground(true) + perklistpnl:SetBackgroundColor( Color(200, 200, 200) ) + + local perkchecklist = vgui.Create( "DIconLayout", perklistpnl ) + perkchecklist:SetSize( 265, 250 ) + perkchecklist:SetPos( 0, 0 ) + perkchecklist:SetSpaceY( 5 ) + perkchecklist:SetSpaceX( 5 ) + + for k,v in pairs(nz.Perks.Functions.GetList()) do + if k != "wunderfizz" and k != "pap" then + local perkitem = perkchecklist:Add( "DPanel" ) + perkitem:SetSize( 130, 20 ) + + local check = perkitem:Add("DCheckBox") + check:SetPos(2,2) + local has = nzMapping.Settings.wunderfizzperks and table.HasValue(nzMapping.Settings.wunderfizzperks, k) or 1 + check:SetValue(has) + if has then perklist[k] = true else perklist[k] = nil end + check.OnChange = function(self, val) + if val then perklist[k] = true else perklist[k] = nil end + nzMapping:SendMapData( {wunderfizzperks = perklist} ) + end + + local name = perkitem:Add("DLabel") + name:SetTextColor(Color(50,50,50)) + name:SetSize(105, 20) + name:SetPos(20,1) + name:SetText(v) + end + end + else + local text = vgui.Create("DLabel", DProperties) + text:SetText("Enable Advanced Mode for more options.") + text:SetFont("Trebuchet18") + text:SetTextColor( Color(50, 50, 50) ) + text:SizeToContents() + text:SetPos(0, 140) + text:CenterHorizontal() + end + + return sheet + end, + //defaultdata = {} +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_testzombie.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_testzombie.lua new file mode 100644 index 00000000..5107a3f9 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_testzombie.lua @@ -0,0 +1,111 @@ +nz.Tools.Functions.CreateTool("testzombie", { + displayname = "Spawn Test Zombie", + desc = "LMB: Create a test zombie, RMB: Remove test zombie", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + data = data or {speed = 51, type = "nz_zombie_walker"} + PrintTable(data) + local z = ents.Create(data.type) + z:SetPos(tr.HitPos) + z:SetHealth(100) + local oldinit = z.StatsInitialize + z.StatsInitialize = function(self) + oldinit(z) + self:SetRunSpeed(data.speed) + end + z:Spawn() + z:SetRunSpeed(data.speed) + + undo.Create( "Test Zombie" ) + undo.SetPlayer( ply ) + undo.AddEntity( z ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + end, + + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "nz_zombie_walker" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Nothing + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Spawn Test Zombie", + desc = "LMB: Create a test zombie, RMB: Remove test zombie", + icon = "icon16/user_green.png", + weight = 400, + condition = function(wep, ply) + return nz.Tools.Advanced + end, + interface = function(frame, data) + + local pnl = vgui.Create("DPanel", frame) + pnl:Dock(FILL) + + local txt = vgui.Create("DLabel", pnl) + txt:SetText("Zombie Speed") + txt:SizeToContents() + txt:SetTextColor(Color(0,0,0)) + txt:SetPos(120, 30) + + local slider = vgui.Create("DNumberScratch", pnl) + slider:SetSize(100, 20) + slider:SetPos(130, 50) + slider:SetMin(0) + slider:SetMax(300) + slider:SetValue(data.speed) + + local num = vgui.Create("DNumberWang", pnl) + num:SetValue(data.speed) + num:SetMinMax(0, 300) + num:SetPos(90, 50) + + local txt2 = vgui.Create("DLabel", pnl) + txt2:SetText("Zombie Type") + txt2:SizeToContents() + txt2:SetTextColor(Color(0,0,0)) + txt2:SetPos(120, 90) + + local drop = vgui.Create("DComboBox", pnl) + drop:SetPos(50, 110) + drop:SetSize(200, 20) + for k,v in pairs(nzConfig.ValidEnemies) do + drop:AddChoice(k, k, data.type == k and true or false) + end + + local function UpdateData() + nz.Tools.Functions.SendData( data, "testzombie" ) + end + + slider.OnValueChanged = function(self, val) + data.speed = val + num:SetValue(val) + UpdateData() + end + num.OnValueChanged = function(self, val) + data.speed = val + slider:SetValue(val) + UpdateData() + end + drop.OnSelect = function(self, index, val, id) + data.type = id + UpdateData() + end + + return pnl + end, + defaultdata = { + speed = 51, + type = "nz_zombie_walker", + } +}) diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_wallbuy.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_wallbuy.lua new file mode 100644 index 00000000..c5f6bb22 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_wallbuy.lua @@ -0,0 +1,80 @@ +nz.Tools.Functions.CreateTool("wallbuy", { + displayname = "Weapon Buy Placer", + desc = "LMB: Place Weapon Buy, RMB: Remove Weapon Buy, R: Rotate, C: Change Properties", + condition = function(wep, ply) + return true + end, + + PrimaryAttack = function(wep, ply, tr, data) + local ang = tr.HitNormal:Angle() + ang:RotateAroundAxis(tr.HitNormal:Angle():Up()*-1, 90) + nzMapping:WallBuy(tr.HitPos + tr.HitNormal*0.5, data.class, tonumber(data.price), ang, nil, ply) + end, + + SecondaryAttack = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "wall_buys" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + if IsValid(tr.Entity) and tr.Entity:GetClass() == "wall_buys" then + tr.Entity:ToggleRotate() + end + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Weapon Buy Placer", + desc = "LMB: Place Weapon Buy, RMB: Remove Weapon Buy, R: Rotate, C: Change Properties", + icon = "icon16/cart.png", + weight = 5, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local valz = {} + valz["Row1"] = data.class + valz["Row2"] = data.price + + local function UpdateData() + //Check the weapon class is fine first + if weapons.Get( valz["Row1"] ) then + data.class = valz["Row1"] + data.price = tostring(valz["Row2"]) + nz.Tools.Functions.SendData( data, "wallbuy" ) + else + ErrorNoHalt("NZ: This weapon class is not valid!") + end + end + + local DProperties = vgui.Create( "DProperties", frame ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 10 ) + + local Row1 = DProperties:CreateRow( "Weapon Settings", "Weapon Class" ) + Row1:Setup( "Combo" ) + for k,v in pairs(weapons.GetList()) do + if v.Category and v.Category != "" then + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.Category.. " - "..v.PrintName or v.ClassName, v.ClassName, false) + else + Row1:AddChoice(v.PrintName and v.PrintName != "" and v.PrintName or v.ClassName, v.ClassName, false) + end + end + Row1.DataChanged = function( _, val ) valz["Row1"] = val UpdateData() end + + local Row2 = DProperties:CreateRow( "Weapon Settings", "Price" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val UpdateData() end + + return DProperties + end, + defaultdata = { + class = "weapon_class", + price = 500, + } +}) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_zspawn.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_zspawn.lua new file mode 100644 index 00000000..e159106c --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_zspawn.lua @@ -0,0 +1,105 @@ +nz.Tools.Functions.CreateTool("zspawn", { + displayname = "Zombie Spawn Creator", + desc = "LMB: Place Spawnpoint, RMB: Remove Spawnpoint, R: Apply New Properties", + condition = function(wep, ply) + //Function to check whether a player can access this tool - always accessible + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + //Create a new spawnpoint and set its data to the guns properties + local ent = nzMapping:ZedSpawn(tr.HitPos, nil, nil, ply) + + ent.flag = data.flag + if tobool(data.flag) and ent.link != "" then + ent.link = data.link + end + ent.respawnable = data.respawnable + ent.spawnable = data.spawnable + + //For the link displayer + if data.link then + ent:SetLink(data.link) + end + end, + SecondaryAttack = function(wep, ply, tr, data) + //Remove entity if it is a zombie spawnpoint + if IsValid(tr.Entity) and tr.Entity:GetClass() == "nz_spawn_zombie_normal" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + //Target the entity and change its data + local ent = tr.Entity + if IsValid(ent) and ent:GetClass() == "nz_spawn_zombie_normal" then + ent.link = data.link + ent.respawnable = data.respawnable + ent.spawnable = data.spawnable + + //For the link displayer + if data.link then + ent:SetLink(data.link) + end + end + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { //Switch on to the client table (interfaces, defaults, HUD elements) + displayname = "Zombie Spawn Creator", + desc = "LMB: Place Spawnpoint, RMB: Remove Spawnpoint, R: Apply New Properties", + icon = "icon16/user_green.png", + weight = 1, + condition = function(wep, ply) + //Function to check whether a player can access this tool - always accessible + return true + end, + interface = function(frame, data) + local valz = {} + valz["Row1"] = data.flag + valz["Row2"] = data.link + valz["Row3"] = data.spawnable + valz["Row4"] = data.respawnable + + local function UpdateData() + local str="nil" + if valz["Row1"] == 0 then + str=nil + data.flag = 0 + else + str=valz["Row2"] + data.flag = 1 + end + data.link = str + data.spawnable = valz["Row3"] + data.respawnable = valz["Row4"] + + PrintTable(data) + + nz.Tools.Functions.SendData(data, "zspawn") + end + + local DProperties = vgui.Create( "DProperties", frame ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 10 ) + + local Row1 = DProperties:CreateRow( "Zombie Spawn", "Enable Flag?" ) + Row1:Setup( "Boolean" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val UpdateData() end + local Row2 = DProperties:CreateRow( "Zombie Spawn", "Flag" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val UpdateData() end + + return DProperties + end, + defaultdata = { + flag = 0, + link = 1, + spawnable = 1, + respawnable = 1, + } +}) diff --git a/gamemodes/nzombies3/gamemode/tools/sh_tools_zspecialspawn.lua b/gamemodes/nzombies3/gamemode/tools/sh_tools_zspecialspawn.lua new file mode 100644 index 00000000..8550e20f --- /dev/null +++ b/gamemodes/nzombies3/gamemode/tools/sh_tools_zspecialspawn.lua @@ -0,0 +1,110 @@ +nz.Tools.Functions.CreateTool("zspecialspawn", { + displayname = "Special Spawn Creator", + desc = "LMB: Place Spawnpoint, RMB: Remove Spawnpoint, R: Apply New Properties", + condition = function(wep, ply) + -- Function to check whether a player can access this tool - always accessible + return true + end, + PrimaryAttack = function(wep, ply, tr, data) + -- Create a new spawnpoint and set its data to the guns properties + local ent = nzMapping:ZedSpecialSpawn(tr.HitPos, nil, ply) + + ent.flag = data.flag + if tobool(data.flag) and ent.link != "" then + ent.link = data.link + end + + -- For the link displayer + if data.link then + ent:SetLink(data.link) + end + end, + SecondaryAttack = function(wep, ply, tr, data) + -- Remove entity if it is a zombie spawnpoint + if IsValid(tr.Entity) and tr.Entity:GetClass() == "nz_spawn_zombie_special" then + tr.Entity:Remove() + end + end, + Reload = function(wep, ply, tr, data) + -- Target the entity and change its data + local ent = tr.Entity + if IsValid(ent) and ent:GetClass() == "nz_spawn_zombie_special" then + ent.link = data.link + -- For the link displayer + if data.link then + ent:SetLink(data.link) + end + end + end, + OnEquip = function(wep, ply, data) + + end, + OnHolster = function(wep, ply, data) + + end +}, { + displayname = "Special Spawn Creator", + desc = "LMB: Place Spawnpoint, RMB: Remove Spawnpoint, R: Apply New Properties", + icon = "icon16/user_red.png", + weight = 2, + condition = function(wep, ply) + return true + end, + interface = function(frame, data) + local valz = {} + valz["Row1"] = data.flag + valz["Row2"] = data.link + + local function UpdateData() + local str="nil" + if valz["Row1"] == 0 then + str=nil + data.flag = 0 + else + str=valz["Row2"] + data.flag = 1 + end + data.link = str + + PrintTable(data) + + nz.Tools.Functions.SendData(data, "zspecialspawn") + end + + local DProperties = vgui.Create( "DProperties", frame ) + DProperties:SetSize( 280, 180 ) + DProperties:SetPos( 10, 10 ) + + local Row1 = DProperties:CreateRow( "Zombie Spawn", "Enable Flag?" ) + Row1:Setup( "Boolean" ) + Row1:SetValue( valz["Row1"] ) + Row1.DataChanged = function( _, val ) valz["Row1"] = val UpdateData() end + local Row2 = DProperties:CreateRow( "Zombie Spawn", "Flag" ) + Row2:Setup( "Integer" ) + Row2:SetValue( valz["Row2"] ) + Row2.DataChanged = function( _, val ) valz["Row2"] = val UpdateData() end + + local text = vgui.Create("DLabel", DProperties) + text:SetText("Special Spawnpoints apply to Hellhounds") + text:SetFont("Trebuchet18") + text:SetTextColor( Color(50, 50, 50) ) + text:SizeToContents() + text:Center() + + local text2 = vgui.Create("DLabel", DProperties) + text2:SetText("and for respawning with Who's Who") + text2:SetFont("Trebuchet18") + text2:SetPos(0, 95) + text2:SetTextColor( Color(50, 50, 50) ) + text2:SizeToContents() + text2:CenterHorizontal() + + return DProperties + end, + defaultdata = { + flag = 0, + link = 1, + spawnable = 1, + respawnable = 1, + } +}) diff --git a/gamemodes/nzombies3/gamemode/weapons/cl_wepswitch.lua b/gamemodes/nzombies3/gamemode/weapons/cl_wepswitch.lua new file mode 100644 index 00000000..8940d450 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/cl_wepswitch.lua @@ -0,0 +1,69 @@ +local plyMeta = FindMetaTable( "Player" ) +AccessorFunc( plyMeta, "iLastWeaponSlot", "LastWeaponSlot", FORCE_NUMBER) +AccessorFunc( plyMeta, "iCurrentWeaponSlot", "CurrentWeaponSlot", FORCE_NUMBER) +function plyMeta:SelectWeapon( class ) + if ( !self:HasWeapon( class ) ) then return end + self.DoWeaponSwitch = self:GetWeapon( class ) + print(self.DoWeaponSwitch) +end + +function GM:CreateMove( cmd ) + if ( IsValid( LocalPlayer().DoWeaponSwitch ) ) then + cmd:SelectWeapon( LocalPlayer().DoWeaponSwitch ) + + if ( LocalPlayer():GetActiveWeapon() == LocalPlayer().DoWeaponSwitch ) then + LocalPlayer():SetCurrentWeaponSlot(LocalPlayer():GetActiveWeapon():GetNWInt("SwitchSlot", 1)) + LocalPlayer().DoWeaponSwitch = nil + end + end +end + +function GM:PlayerBindPress( ply, bind, pressed ) + if nzRound:InProgress() then + if !ply:GetCurrentWeaponSlot() then ply:SetCurrentWeaponSlot(ply:GetActiveWeapon():GetNWInt("SwitchSlot", 1)) end + local slot + local curslot = ply:GetCurrentWeaponSlot() or 1 + if ( string.find( bind, "slot1" ) ) then slot = 1 end + if ( string.find( bind, "slot2" ) ) then slot = 2 end + if ( string.find( bind, "slot3" ) ) then slot = 3 end + if ( string.find( bind, "invnext" ) ) then + slot = curslot + 1 + if (ply:HasPerk("mulekick") and slot > 3) or (!ply:HasPerk("mulekick") and slot > 2) then + slot = 1 + end + end + if ( string.find( bind, "invprev" ) ) then + slot = curslot - 1 + if slot < 1 then + slot = ply:HasPerk("mulekick") and 3 or 2 + end + end + if !nzRound:InState(ROUND_CREATE) and (bind == "+menu" and pressed ) then slot = ply:GetLastWeaponSlot() or 1 end + if slot then + ply:SetLastWeaponSlot( ply:GetActiveWeapon():GetNWInt( "SwitchSlot", 1) ) + if slot == 3 then + for k,v in pairs( ply:GetWeapons() ) do + if v:GetNWInt( "SwitchSlot" ) == slot then + ply:SelectWeapon( v:GetClass() ) + return true + end + end + slot = 1 + for k,v in pairs( ply:GetWeapons() ) do + if v:GetNWInt( "SwitchSlot" ) == slot then + ply:SelectWeapon( v:GetClass() ) + return true + end + end + else + for k,v in pairs( ply:GetWeapons() ) do + if v:GetNWInt( "SwitchSlot" ) == slot then + ply:SelectWeapon( v:GetClass() ) + return true + end + end + end + end + if ( string.find( bind, "slot" ) ) then return true end + end +end diff --git a/nzombies3/gamemode/weapons/sh_constructor.lua b/gamemodes/nzombies3/gamemode/weapons/sh_constructor.lua similarity index 100% rename from nzombies3/gamemode/weapons/sh_constructor.lua rename to gamemodes/nzombies3/gamemode/weapons/sh_constructor.lua diff --git a/gamemodes/nzombies3/gamemode/weapons/sh_fas2.lua b/gamemodes/nzombies3/gamemode/weapons/sh_fas2.lua new file mode 100644 index 00000000..8c9e3c53 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sh_fas2.lua @@ -0,0 +1,257 @@ +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.Owner:HasPerk("speed") then + if string.find(anim, "reload") != nil or string.find(anim, "insert") != nil then + speed = speed * 1.33 -- For some reason this fits perfectly to a double reload speed? + end + end + if wep.Owner:HasPerk("dtap") or wep.Owner:HasPerk("dtap2") then + if string.find(anim, "fire") != nil or string.find(anim, "cock") != nil or string.find(anim, "pump") != nil then + speed = speed * 1.33 + 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) + --print(vm:SequenceDuration(vm:LookupSequence(anim))/speed) + --print(LocalPlayer():GetActiveWeapon():GetNextPrimaryFire() - CurTime()) + vm:SetPlaybackRate(speed) + end + end +end + +if CLIENT then + -- A copy using a slightly different usermessage. This one generates the missing tables (which would otherwise require the C-menu) + local function FAS2_Attach(um) + local group = um:ReadShort() + local att = um:ReadString() + local wep = um:ReadEntity() + + ply = LocalPlayer() + + if IsValid(wep) and wep.IsFAS2Weapon then + t = wep.Attachments[group] + + t.active = att + if !t.last then t.last = {} end + t.last[att] = true + t2 = FAS2_Attachments[att] + + if t2.aimpos then + wep.AimPos = wep[t2.aimpos] + wep.AimAng = wep[t2.aimang] + wep.AimPosName = t2.aimpos + wep.AimAngName = t2.aimang + end + + if t.lastdeattfunc then + t.lastdeattfunc(ply, wep) + end + + if t2.clattfunc then + t2.clattfunc(ply, wep) + end + + t.lastdeattfunc = t2.cldeattfunc + + wep:AttachBodygroup(att) + surface.PlaySound("cstm/attach.wav") + end + end + usermessage.Hook("FAS2_ATTACHPAP", FAS2_Attach) +end + +hook.Add("InitPostEntity", "ReplaceCW2BaseFunctions", function() + local cw2 = weapons.Get("cw_base") + if cw2 then + cw2.beginReload = function(self) + mag = self:Clip1() + local CT = CurTime() + + local hasspeed = self.Owner:HasPerk("speed") + + if self.ShotgunReload then + local time = CT + self.ReloadStartTime / self.ReloadSpeed + if hasspeed then time = time / 2 end + + self.WasEmpty = mag == 0 + self.ReloadDelay = time + self:SetNextPrimaryFire(time) + self:SetNextSecondaryFire(time) + self.GlobalDelay = time + self.ShotgunReloadState = 1 + + self:sendWeaponAnim("reload_start", hasspeed and self.ReloadSpeed * 2 or self.ReloadSpeed) + else + local reloadTime = nil + local reloadHalt = nil + + if mag == 0 then + if self.Chamberable then + self.Primary.ClipSize = self.Primary.ClipSize_Orig + end + + reloadTime = self.ReloadTime_Empty + reloadHalt = self.ReloadHalt_Empty + else + reloadTime = self.ReloadTime + reloadHalt = self.ReloadHalt + + if self.Chamberable then + self.Primary.ClipSize = self.Primary.ClipSize_Orig + 1 + end + end + + reloadTime = reloadTime / self.ReloadSpeed + reloadHalt = reloadHalt / self.ReloadSpeed + + if hasspeed then + reloadTime = reloadTime / 2 + reloadHalt = reloadHalt / 2 + end + + self.ReloadDelay = CT + reloadTime + self:SetNextPrimaryFire(CT + reloadHalt) + self:SetNextSecondaryFire(CT + reloadHalt) + self.GlobalDelay = CT + reloadHalt + + if self.reloadAnimFunc then + self:reloadAnimFunc(mag) + else + if self.Animations.reload_empty and mag == 0 then + self:sendWeaponAnim("reload_empty", hasspeed and self.ReloadSpeed * 2 or self.ReloadSpeed) + else + self:sendWeaponAnim("reload", hasspeed and self.ReloadSpeed * 2 or self.ReloadSpeed) + end + end + end + + CustomizableWeaponry.callbacks.processCategory(self, "beginReload", mag == 0) + + self.Owner:SetAnimation(PLAYER_RELOAD) + end + + cw2.playFireAnim = function(self) + if (self.dt.State == CW_AIMING and not self.ADSFireAnim) or (self.dt.BipodDeployed and not self.BipodFireAnim) then + return + end + + if self.dt.State ~= CW_AIMING and (not self.LuaViewmodelRecoilOverride and self.LuaViewmodelRecoil) then + return + end + + if self:Clip1() - self.AmmoPerShot <= 0 and self.Animations.fire_dry then + if self.Owner:HasPerk("dtap") or self.Owner:HasPerk("dtap2") then + self:sendWeaponAnim("fire_dry", 1.66) + else + self:sendWeaponAnim("fire_dry") + end + else + if self.Owner:HasPerk("dtap") or self.Owner:HasPerk("dtap2") then + self:sendWeaponAnim("fire", 1.66) + else + self:sendWeaponAnim("fire") + end + end + end + weapons.Register(cw2, "cw_base") + + -- We overwrite this slowdown function from CW2 here to take our sprinting system into account + -- But only if the cw2 weapon is even existant + local MaxRunSpeed = debug.getregistry().Player.GetMaxRunSpeed + function CW_Move(ply, m) + local maxspeed + if MaxRunSpeed then -- If the GetMaxRunSpeed function exists (server side) + maxspeed = MaxRunSpeed(ply) + else + local class = player_manager.GetPlayerClass(ply) -- Else, get the player class + if class then -- If it exists, get the class table's RunSpeed value + maxspeed = baseclass.Get(class).RunSpeed + else + maxspeed = ply:GetRunSpeed() -- Otherwise, just set to normal run speed + end + end + if !maxspeed then maxspeed = 300 end -- Fallback + if ply:Crouching() then + m:SetMaxSpeed(ply:GetWalkSpeed() * ply:GetCrouchedWalkSpeed()) + else + wep = ply:GetActiveWeapon() + + if IsValid(wep) and wep.CW20Weapon then + if wep.dt and wep.dt.State == CW_AIMING then + m:SetMaxSpeed((ply:GetWalkSpeed() - wep.SpeedDec) * 0.75) + else + m:SetMaxSpeed(maxspeed - wep.SpeedDec) + end + else + m:SetMaxSpeed(maxspeed) + end + --print(m:GetMaxSpeed()) + end + end + hook.Add("Move", "CW_Move", CW_Move) + + end + +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/weapons/sh_wep_sync.lua b/gamemodes/nzombies3/gamemode/weapons/sh_wep_sync.lua new file mode 100644 index 00000000..edef763a --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sh_wep_sync.lua @@ -0,0 +1,49 @@ +//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 + if wep != nil then + if IsValid(wep) then + --print(wep) + print("Applying data to: " .. wep:GetClass()) + for k,v in pairs(data.wepdata) do + wep[k] = v + --print(wep, wep.pap) + end + if data.primarydata then + for k,v in pairs(data.primarydata) do + wep.Primary[k] = v + end + end + if data.secondarydata then + for k,v in pairs(data.secondarydata) do + wep.Secondary[k] = v + end + end + PrintTable(data) + if data.pap then timer.Simple(0.1, function() wep.pap = true end) end + end + end + end + + //Receivers + net.Receive( "nz.Weps.Sync", nz.Weps.Functions.ReceiveSync ) +end diff --git a/gamemodes/nzombies3/gamemode/weapons/sh_weps.lua b/gamemodes/nzombies3/gamemode/weapons/sh_weps.lua new file mode 100644 index 00000000..e4df5a23 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sh_weps.lua @@ -0,0 +1,25 @@ +local wepMeta = FindMetaTable("Weapon") + +function wepMeta:NZPerkSpecialTreatment( ) + if self:IsFAS2() or self:IsCW2() then + return true + end + + return false +end + +function wepMeta:IsFAS2() + if self.Category == "FA:S 2 Weapons" or self.Base == "fas2_base" then + return true + end + + return false +end + +function wepMeta:IsCW2() + if self.Category == "CW 2.0" or self.Base == "cw_base" then + return true + end + + return false +end \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/weapons/sv_ammo.lua b/gamemodes/nzombies3/gamemode/weapons/sv_ammo.lua new file mode 100644 index 00000000..aa8eaaeb --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sv_ammo.lua @@ -0,0 +1,53 @@ +//Functions +function nz.Weps.Functions.CalculateMaxAmmo(class, pap) + local wep = weapons.Get(class) + local clip = wep.Primary.ClipSize + + if pap then + return math.Round((clip *1.5)/5)* 5 * 10 + else + return clip * 10 + end +end + +function nz.Weps.Functions.GiveMaxAmmoWep(ply, class, papoverwrite) + + 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, (IsValid(ply:GetWeapon(class)) and ply:GetWeapon(class).pap) or papoverwrite) + + 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 + if !v:IsSpecial() then + nz.Weps.Functions.GiveMaxAmmoWep(ply, v:GetClass()) + else + if nzSpecialWeapons.Weapons[v:GetClass()].maxammo then + nzSpecialWeapons.Weapons[v:GetClass()].maxammo(ply, v) + end + end + end +end diff --git a/gamemodes/nzombies3/gamemode/weapons/sv_roundresupply.lua b/gamemodes/nzombies3/gamemode/weapons/sv_roundresupply.lua new file mode 100644 index 00000000..ca036993 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sv_roundresupply.lua @@ -0,0 +1,17 @@ +nz.Weps.RoundResupply = {} + +function nz.Weps.AddAmmoToRoundResupply(ammo, count, max) + nz.Weps.RoundResupply[ammo] = {count = count, max = max} +end + +function nz.Weps.DoRoundResupply() + for k,v in pairs(player.GetAllPlaying()) do + for k2,v2 in pairs(nz.Weps.RoundResupply) do + local give = math.Clamp(v2.max - v:GetAmmoCount(k2), 0, v2.count) + v:GiveAmmo(give, k2, true) + end + end +end + +-- Standard grenades +nz.Weps.AddAmmoToRoundResupply("nz_grenade", 2, 4) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/weapons/sv_weps.lua b/gamemodes/nzombies3/gamemode/weapons/sv_weps.lua new file mode 100644 index 00000000..2ba41fa1 --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sv_weps.lua @@ -0,0 +1,442 @@ +function nz.Weps.Functions.ApplySpeed( ply, wep ) + --print(ply, wep, wep.speed) + if wep:IsFAS2() and wep.speed != true then + print("Applying Speed to: " .. wep.ClassName) + local data = {} + data.wepdata = {} + //Normal + data.wepdata["ReloadTime"] = 2 + data.wepdata["ReloadTime_Nomen"] = 2 + data.wepdata["ReloadTime_Empty"] = 2 + data.wepdata["ReloadTime_Empty_Nomen"] = 2 + //BiPod + data.wepdata["ReloadTime_Bipod"] = 2 + data.wepdata["ReloadTime_Bipod_Nomen"] = 2 + data.wepdata["ReloadTime_Bipod_Empty"] = 2 + data.wepdata["ReloadTime_Bipod_Empty_Nomen"] = 2 + //Shotguns + data.wepdata["ReloadStartTime"] = 2 + data.wepdata["ReloadStartTime_Nomen"] = 2 + data.wepdata["ReloadEndTime"] = 2 + data.wepdata["ReloadEndTime_Nomen"] = 2 + data.wepdata["ReloadAbortTime"] = 2 + data.wepdata["ReloadAdvanceTimeEmpty"] = 2 + data.wepdata["ReloadAdvanceTimeEmpty_Nomen"] = 2 + data.wepdata["ReloadAdvanceTimeLast"] = 2 + data.wepdata["ReloadAdvanceTimeLast_Nomen"] = 2 + data.wepdata["InsertTime"] = 2 + data.wepdata["InsertTime_Nomen"] = 2 + data.wepdata["InsertEmpty"] = 2 + data.wepdata["InsertEmpty_Nomen"] = 2 + + local oldtbl = {} + for k,v in pairs(data.wepdata) do + if wep[k] != nil then + local val = wep[k] / v + local old = wep[k] + -- Save the old so we can remove it later + wep["old_"..k] = old + wep[k] = val + data.wepdata[k] = val + oldtbl["old_"..k] = old + --print(k, wep[k], old) + else + data.wepdata[k] = nil + end + end + -- Attach the old values to the data + for k,v in pairs(oldtbl) do + data.wepdata[k] = v + end + -- Attach the weapon to the data + data["wep"] = wep + wep["speed"] = true + data.wepdata["speed"] = true + nz.Weps.Functions.SendSync( ply, data ) + end +end + +function nz.Weps.Functions.ApplyDTap( ply, wep ) + if wep:IsFAS2() and wep.dtap != true then + print("Applying Dtap to: " .. wep.ClassName) + local data = {} + data.wepdata = {} + //Normal + data.wepdata["FireDelay"] = 1.2 + //Shotgun Cocking and Sniper Bolting + data.wepdata["CockTime"] = 1.5 + data.wepdata["CockTime_Nomen"] = 1.5 + data.wepdata["CockTime_Bipod"] = 1.5 + data.wepdata["CockTime_Bipod_Nomen"] = 1.5 + + local oldtbl = {} + for k,v in pairs(data.wepdata) do + if wep[k] != nil then + local val = wep[k] / v + local old = wep[k] + wep["old_"..k] = old + wep[k] = val + data.wepdata[k] = val + oldtbl["old_"..k] = old + else + data.wepdata[k] = nil + end + end + for k,v in pairs(oldtbl) do + data.wepdata[k] = v + end + //Attach the weapon to the data + data["wep"] = wep + wep["dtap"] = true + data.wepdata["dtap"] = true + nz.Weps.Functions.SendSync( ply, data ) + end +end + +function nz.Weps.Functions.RemoveSpeed( ply, wep ) + if wep:IsFAS2() and wep.speed then + print("Removing Speed from: " .. wep.ClassName) + local data = {} + data.wepdata = {} + //Normal + data.wepdata["ReloadTime"] = true + data.wepdata["ReloadTime_Nomen"] = true + data.wepdata["ReloadTime_Empty"] = true + data.wepdata["ReloadTime_Empty_Nomen"] = true + //BiPod + data.wepdata["ReloadTime_Bipod"] = true + data.wepdata["ReloadTime_Bipod_Nomen"] = true + data.wepdata["ReloadTime_Bipod_Empty"] = true + data.wepdata["ReloadTime_Bipod_Empty_Nomen"] = true + //Shotguns + data.wepdata["ReloadStartTime"] = true + data.wepdata["ReloadStartTime_Nomen"] = true + data.wepdata["ReloadEndTime"] = true + data.wepdata["ReloadEndTime_Nomen"] = true + data.wepdata["ReloadAbortTime"] = true + data.wepdata["ReloadAdvanceTimeEmpty"] = true + data.wepdata["ReloadAdvanceTimeEmpty_Nomen"] = true + data.wepdata["ReloadAdvanceTimeLast"] = true + data.wepdata["ReloadAdvanceTimeLast_Nomen"] = true + data.wepdata["InsertTime"] = true + data.wepdata["InsertTime_Nomen"] = true + data.wepdata["InsertEmpty"] = true + data.wepdata["InsertEmpty_Nomen"] = true + for k,v in pairs(data.wepdata) do + if wep[k] != nil then + wep[k] = wep["old_"..k] + data.wepdata[k] = wep[k] + else + data.wepdata[k] = nil + end + end + //Attach the weapon to the data + data["wep"] = wep + wep["speed"] = nil + data.wepdata["speed"] = nil + nz.Weps.Functions.SendSync( ply, data ) + end +end + +function nz.Weps.Functions.RemoveDTap( ply, wep ) + if wep:IsFAS2() and wep.dtap then + print("Removing Dtap from: " .. wep.ClassName) + local data = {} + data.wepdata = {} + //Normal + data.wepdata["FireDelay"] = true + //Shotgun Cocking and Sniper Bolting + data.wepdata["CockTime"] = true + data.wepdata["CockTime_Nomen"] = true + data.wepdata["CockTime_Bipod"] = true + data.wepdata["CockTime_Bipod_Nomen"] = true + for k,v in pairs(data.wepdata) do + if wep[k] != nil then + wep[k] = wep["old_"..k] + data.wepdata[k] = wep[k] + else + data.wepdata[k] = nil + end + end + //Attach the weapon to the data + data["wep"] = wep + wep["dtap"] = nil + data.wepdata["dtap"] = nil + nz.Weps.Functions.SendSync( ply, data ) + end +end + +-- A copy of the FAS2 function, slightly modified to not require the costumization menu +local function AttachFAS2Attachment(ply, wep, group, att) + if not (IsValid(ply) and ply:Alive() and ply:IsPlaying()) then + return + end + + if not IsValid(wep) or not wep.IsFAS2Weapon then + return + end + + ply:FAS2_PickUpAttachment(att, false) -- Silently add the attachment + + if not group or not att or not wep.Attachments or wep.NoAttachmentMenu or not table.HasValue(ply.FAS2Attachments, att) then + return + end + + t = wep.Attachments[group] + + if t then + found = false + + for k, v in pairs(t.atts) do + if v == att then + found = true + end + end + + if t.lastdeattfunc then + t.lastdeattfunc(ply, wep) + t.lastdeattfunc = nil + end + + if found then + t.last = att + + t2 = FAS2_Attachments[att] + + if t2.attfunc then + t2.attfunc(ply, wep) + end + + if t2.deattfunc then + t.lastdeattfunc = t2.deattfunc + end + + umsg.Start("FAS2_ATTACHPAP", ply) + umsg.Short(group) + umsg.String(att) + umsg.Entity(wep) + umsg.End() + end + end +end + +function nz.Weps.Functions.ApplyPaP( ply, wep ) + if wep.pap != true then + print("Applying PaP to: " .. wep.ClassName) + --wep:SetMaterial("models/XQM/LightLineRed_tool.vtf") + + //Call OnPaP function for specially coded weapons + if wep.OnPaP then wep:OnPaP() end + + local data = {} + data.wepdata = {} + data.primarydata = {} + //Attach the weapon to the data + data["wep"] = wep + wep["pap"] = true + data.wepdata["pap"] = true + + if wep.Primary and wep.Primary.ClipSize > 0 then + local newammo = wep.Primary.ClipSize + (wep.Primary.ClipSize*0.5) + newammo = math.Round(newammo/5)*5 + if newammo <= 0 then newammo = 2 end + wep.Primary.ClipSize = newammo + data.primarydata = {} + data.primarydata.ClipSize = newammo + wep:SetClip1(newammo) + + if wep:IsCW2() then + wep.Primary.ClipSize_Orig = newammo + wep.Primary.ClipSize_ORIG_REAL = newammo + + -- Random attachments + if GetConVar("nz_papattachments"):GetBool() and wep.Attachments then + for k,v in pairs(wep.Attachments) do + if string.lower(v.header) != "magazine" and string.lower(v.header) != "mag" then -- Mag can't be edited + local atts = {} + for k2,v2 in pairs(v.atts) do -- List all missing attachments + if !CustomizableWeaponry:hasAttachment(wep.Owner, v2) then + table.insert(atts, v2) + end + end + if #atts > 0 then + local newatt = math.random(#atts) + CustomizableWeaponry:giveAttachment(wep.Owner, atts[newatt]) + wep:attach(k, newatt - 1) + if atts[newatt] then + print(wep.Owner:Nick().." has Pack-a-Punched and gotten attachment "..atts[newatt]) + end + end + end + end + end + elseif wep:IsFAS2() then + -- Random attachments + if GetConVar("nz_papattachments"):GetBool() and wep.Attachments then + for k,v in pairs(wep.Attachments) do + if string.lower(v.header) != "magazine" and string.lower(v.header) != "mag" then -- Mag can't be edited + local atts = {} + for k2,v2 in pairs(v.atts) do -- List all missing attachments + if !table.HasValue(ply.FAS2Attachments, v2) then + table.insert(atts, v2) + end + end + if #atts > 0 then + local newatt = atts[math.random(#atts)] + AttachFAS2Attachment(ply, wep, k, newatt) + if atts[newatt] then + print(wep.Owner:Nick().." has Pack-a-Punched and gotten attachment "..atts[newatt]) + end + end + end + end + end + end + end + nz.Weps.Functions.SendSync( ply, data ) + else + -- Reroll attachments by buying again + if GetConVar("nz_papattachments"):GetBool() and wep.Attachments then + if wep:IsCW2() then + for k,v in pairs(wep.Attachments) do + if string.lower(v.header) != "magazine" and string.lower(v.header) != "mag" then -- Mag can't be edited + local atts = table.Copy(v.atts) + for k,v in pairs(atts) do -- Remove all already owned attachments + if CustomizableWeaponry:hasAttachment(wep.Owner, v) then + atts[k] = nil + end + end + if #atts > 0 then + local newatt = math.random(#atts) + CustomizableWeaponry:giveAttachment(wep.Owner, atts[newatt]) + wep:attach(k, newatt - 1) + --print(k, newatt-1, atts[newatt]) + --print("Here's the table:") + --PrintTable(atts) + --print("------- End of table --------") + if atts[newatt] then + print(wep.Owner:Nick().." has Pack-a-Punched and gotten attachment "..atts[newatt]) + end + end + end + end + elseif wep:IsFAS2() then + for k,v in pairs(wep.Attachments) do + if string.lower(v.header) != "magazine" and string.lower(v.header) != "mag" then -- Mag can't be edited + local atts = {} + for k2,v2 in pairs(v.atts) do -- List all missing attachments + if !table.HasValue(ply.FAS2Attachments, v2) then + table.insert(atts, v2) + end + end + if #atts > 0 then + local newatt = atts[math.random(#atts)] + AttachFAS2Attachment(ply, wep, k, newatt) + if atts[newatt] then + print(wep.Owner:Nick().." has Pack-a-Punched and gotten attachment "..atts[newatt]) + end + end + end + end + end + end + end +end +if not ConVarExists("nz_papattachments") then CreateConVar("nz_papattachments", 1, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_NOTIFY}, "Whether Pack-a-Punching a CW2.0 weapon will attach random attachments for each category. Will also strip players of attachments at the beginning of the game.") end + +hook.Add("PlayerSpawn", "RemoveCW2Attachments", function(ply) + if GetConVar("nz_papattachments"):GetBool() and CustomizableWeaponry then + for k,v in pairs(ply.CWAttachments) do + CustomizableWeaponry:removeAttachment(ply, k) + end + end +end) + +--hook.Add("OnEntityCreated", "nz.Weps.OnEntityCreated", nz.Weps.Functions.OnWepCreated) +function GetPriorityWeaponSlot(ply) + if ply:HasPerk("mulekick") then + for i = 1, 3 do + local exists = false + for k,v in pairs(ply:GetWeapons()) do + if !exists and v:GetNWInt("SwitchSlot") == i then + exists = true + end + end + if !exists then return i end + end + else + for i = 1, 2 do + local exists = false + for k,v in pairs(ply:GetWeapons()) do + if !exists and v:GetNWInt("SwitchSlot") == i then + exists = true + end + end + if !exists then return i end + end + end + return ply:GetActiveWeapon():GetNWInt("SwitchSlot", 1), true +end + +local function OnWeaponAdded( weapon ) + + if !weapon:IsSpecial() then + weapon.Weight = 10000 + -- 0 seconds timer for the next tick, where the weapon's owner will be valid + timer.Simple(0, function() + local ply = weapon:GetOwner() + if !nzRound:InState( ROUND_CREATE ) then + + --[[if ply:HasPerk("mulekick") then + if GetNumberNonSpecialWeapons(ply) > 3 then + weapon:SetNWInt( "SwitchSlot", ply:GetActiveWeapon():GetNWInt( "SwitchSlot", 1) ) + print(weapon, 1, "Stage 2") + ply:StripWeapon( ply:GetActiveWeapon():GetClass() ) + else + weapon:SetNWInt( "SwitchSlot", GetPriorityWeaponSlot(ply) ) + print(weapon, 1, "Stage 3") + end + else + if GetNumberNonSpecialWeapons(ply) > 2 then + weapon:SetNWInt( "SwitchSlot", ply:GetActiveWeapon():GetNWInt( "SwitchSlot", 1) ) + print(weapon, 1, "Stage 4") + ply:StripWeapon( ply:GetActiveWeapon():GetClass() ) + elseif GetNumberNonSpecialWeapons(ply) == 1 then + weapon:SetNWInt( "SwitchSlot", 1 ) + print(weapon, 1, "Stage 5") + else + weapon:SetNWInt( "SwitchSlot", 2 ) + print(weapon, 2, "Stage 6", GetNumberNonSpecialWeapons(ply)) + end + end]] + + local slot, exists = GetPriorityWeaponSlot(ply) + if exists then ply:StripWeapon( ply:GetActiveWeapon():GetClass() ) end + weapon:SetNWInt( "SwitchSlot", slot ) + + weapon.Weight = 10000 + ply:SelectWeapon(weapon:GetClass()) + timer.Simple(0, function() + if IsValid(ply) then + if ply:HasPerk("speed") then + nz.Weps.Functions.ApplySpeed( ply, weapon ) + end + if ply:HasPerk("dtap") or ply:HasPerk("dtap2") then + nz.Weps.Functions.ApplyDTap( ply, weapon ) + end + ply:SelectWeapon(weapon:GetClass()) + end + weapon.Weight = 0 + end) + end + end) + end + +end + +--Hooks +hook.Add("WeaponEquip", "nzOnWeaponAdded", OnWeaponAdded) + +hook.Add("PlayerCanPickupWeapon", "PreventWhosWhoWeapons", function(ply, wep) + if IsValid(wep:GetOwner()) and wep:GetOwner():GetClass() == "whoswho_downed_clone" then return false end +end) \ No newline at end of file diff --git a/gamemodes/nzombies3/gamemode/weapons/sv_wonderweapons.lua b/gamemodes/nzombies3/gamemode/weapons/sv_wonderweapons.lua new file mode 100644 index 00000000..4177454e --- /dev/null +++ b/gamemodes/nzombies3/gamemode/weapons/sv_wonderweapons.lua @@ -0,0 +1,65 @@ +local wonderweapons = {} + +-- Wonder Weapon system does NOT apply to weapons like Monkey Bombs or Ray Gun +-- ONLY to those that you can only have 1 of at a time + +function nz.Weps.Functions.AddWonderWeapon(class) + wonderweapons[class] = true +end + +function nz.Weps.Functions.RemoveWonderWeapon(class) + wonderweapons[class] = nil +end + +function nz.Weps.Functions.IsWonderWeapon(class) + return wonderweapons[class] or false +end + +function nz.Weps.Functions.GetHeldWonderWeapons(ply) -- No arguments means all players + local tbl = {} + if IsValid(ply) and ply:IsPlayer() then + for k,v in pairs(ply:GetWeapons()) do + if wonderweapons[v:GetClass()] then + table.insert(tbl, v:GetClass()) + end + end + else + for k,v in pairs(player.GetAll()) do + for k2,v2 in pairs(v:GetWeapons()) do + if wonderweapons[v2:GetClass()] then + table.insert(tbl, v2:GetClass()) + end + end + end + end + + return tbl +end + +function nz.Weps.Functions.IsWonderWeaponOut(class, ignorewonder) + if (wonderweapons[class] or ignorewonder) then + for k,v in pairs(player.GetAll()) do + for k2,v2 in pairs(v:GetWeapons()) do + local vclass = v2:GetClass() + if vclass == class then + return true + end + end + end + + for k,v in pairs(ents.FindByClass("random_box_windup")) do -- We also gotta check active random boxes + if v:GetWepClass() == class then + return true + end + end + end + return false +end + +-- Now let's add some! +nz.Weps.Functions.AddWonderWeapon("freeze_gun") +nz.Weps.Functions.AddWonderWeapon("wunderwaffe") +nz.Weps.Functions.AddWonderWeapon("weapon_hoff_thundergun") +nz.Weps.Functions.AddWonderWeapon("weapon_teslagun") + +-- More wonder weapons should be added by map scripts for their map - if you think you have one that should officially apply to all maps, add me \ No newline at end of file diff --git a/gamemodes/nzombies3/nzombies3.txt b/gamemodes/nzombies3/nzombies3.txt new file mode 100644 index 00000000..5e725c56 --- /dev/null +++ b/gamemodes/nzombies3/nzombies3.txt @@ -0,0 +1,139 @@ +"nzombies" +{ + "base" "base" + "title" "nZombies 3" + "version" "3.0" + "menusystem" "1" + "maps" "^nz_" + + "author_name" "Alig96, Zet0r, Lolle" + "author_email" "" + + "icon" "" + "info" "" + "hide" "0" + + "settings" + { + 1 + { + "name" "nz_downtime" + "text" "Bleedout Time" + "help" "How long time in seconds until you die from not being revived while downed." + "type" "Numeric" + "default" "45" + } + 2 + { + "name" "nz_randombox_maplist" + "text" "Use maps Weapon List" + "help" "Whether to replace the white- and blacklist with the config's Map Settings list - turn off to always use the above lists" + "type" "CheckBox" + "default" "1" + } + 3 + { + "name" "nz_nav_grouptargeting" + "text" "Use navgroups if available" + "help" "Whether zombies and spawnpoints will check if Nav Group IDs are the same as their target player's before spawning" + "type" "CheckBox" + "default" "1" + } + 4 + { + "name" "nz_round_special_interval" + "text" "Special round interval." + "help" "How often a special round should occur." + "type" "Numeric" + "default" "6" + } + 5 + { + "name" "nz_round_prep_time" + "text" "Round preparation duration" + "help" "The duration of a rounds preperation phase.." + "type" "Numeric" + "default" "10" + } + 6 + { + "name" "nz_round_dropins_allow" + "text" "Allow dropins" + "help" "Allow player droppins after a round." + "type" "CheckBox" + "default" "1" + } + 7 + { + "name" "nz_difficulty_zombie_amount_base" + "text" "Base Zombie amount" + "help" "The base amount of zombies." + "type" "Numeric" + "default" "5" + } + 8 + { + "name" "nz_difficulty_zombie_amount_scale" + "text" "Zombie amount scale" + "help" "How much the Zombie amount increases each round." + "type" "Numeric" + "default" "1.01" + } + 9 + { + "name" "nz_difficulty_zombie_health_base" + "text" "Base Zombie health" + "help" "The base health of the zombies." + "type" "Numeric" + "default" "75" + } + 10 + { + "name" "nz_difficulty_zombie_health_scale" + "text" "Zombie health scale" + "help" "How much the Zombie health increases each round." + "type" "Numeric" + "default" "1.1" + } + 11 + { + "name" "nz_difficulty_max_zombies_alive" + "text" "Maximum zombies" + "help" "The maximum amount of zombies alive at a time." + "type" "Numeric" + "default" "35" + } + 12 + { + "name" "nz_difficulty_barricade_planks_max" + "text" "Barricade plank amount" + "help" "The maximum amount of planks on a barricade." + "type" "Numeric" + "default" "6" + } + 13 + { + "name" "nz_difficulty_powerup_chance" + "text" "Powerup drop chance in %" + "help" "The chance of a powerup beeing dropped after a zobmies death." + "type" "Numeric" + "default" "2" + } + 14 + { + "name" "nz_difficulty_perks_max" + "text" "Maximum buyable perks" + "help" "The max perks you can BUY (You can get more in other ways)" + "type" "Numeric" + "default" "4" + } + 15 + { + "name" "nz_point_notification_clientside" + "text" "Client Side point difference calculation" + "help" "Might improve server peformance a little, but its not recommended." + "type" "CheckBox" + "default" "0" + } + } +} diff --git a/gamemodes/nzombies3/officialconfigs/nz_ttt_kosovos;Breakout.lua b/gamemodes/nzombies3/officialconfigs/nz_ttt_kosovos;Breakout.lua new file mode 100644 index 00000000..8730007c --- /dev/null +++ b/gamemodes/nzombies3/officialconfigs/nz_ttt_kosovos;Breakout.lua @@ -0,0 +1 @@ +{"ZedSpecialSpawns":[{"pos":"[3395.0276 -1032.6082 24.0313]"},{"pos":"[3760.5569 -1301.8813 24.0313]"},{"pos":"[3965.1033 -948.7398 23.0313]"},{"pos":"[4176.3213 -629.6224 152.0313]"},{"pos":"[4170.2998 -1412.3809 152.0313]"},{"link":1,"pos":"[3096.0422 -619.104 0.0313]"},{"link":1,"pos":"[3089.0381 -314.9153 0.0313]"},{"link":1,"pos":"[3125.335 4.944 0.0313]"},{"link":1,"pos":"[3412.3394 -42.5497 0.0313]"},{"link":1,"pos":"[3689.9319 233.4661 160.0313]"},{"link":2,"pos":"[3920.0791 145.2381 160.0313]"},{"link":2,"pos":"[3370.6287 660.0214 160.0313]"},{"link":2,"pos":"[3767.0447 859.4314 160.0313]"},{"link":2,"pos":"[4143.2144 876.6133 160.0313]"},{"link":2,"pos":"[4535.938 337.7188 160.0313]"},{"link":2,"pos":"[4360.981 340.5414 160.0313]"},{"link":2,"pos":"[4126.1719 534.1306 160.0313]"},{"link":2,"pos":"[4792.1836 14.7885 160.0313]"},{"link":3,"pos":"[4901.5493 -413.9255 160.0313]"},{"link":3,"pos":"[4399.1387 -610.7266 160.0313]"},{"link":5,"pos":"[5224.2495 -1907.0853 -95.9688]"},{"link":5,"pos":"[5247.0957 -1187.9369 -95.9687]"},{"link":5,"pos":"[4934.0356 -1609.2739 -31.9688]"},{"link":5,"pos":"[4670.5049 -1501.2646 -31.9688]"},{"link":5,"pos":"[4423.8389 -1307.3948 -31.9688]"},{"link":4,"pos":"[4598.9443 -607.3469 160.0313]"},{"link":4,"pos":"[4898.4678 -425.9684 160.0313]"},{"link":3,"pos":"[4675.0083 -137.8932 160.0313]"},{"link":3,"pos":"[4583.9551 135.117 160.0313]"},{"link":3,"pos":"[4117.2651 358.9526 160.0313]"},{"link":3,"pos":"[4535.9458 718.4626 160.0313]"},{"link":3,"pos":"[4152.167 812.8559 160.0313]"},{"link":3,"pos":"[3680.7686 627.1187 160.0313]"},{"link":3,"pos":"[3918.1521 158.185 160.0313]"},{"link":3,"pos":"[3915.8005 -311.0944 160.0313]"},{"link":2,"pos":"[3435.105 -47.2271 0.0313]"},{"link":2,"pos":"[3430.4646 221.7128 136.0313]"}],"NavTable":{"956":{"prev":128,"locked":true},"958":{"prev":24577,"locked":true},"953":{"prev":128,"locked":true},"954":{"prev":128,"locked":true},"932":{"prev":128,"locked":true},"930":{"prev":128,"locked":true},"940":{"prev":128,"locked":true},"2088":{"prev":128,"locked":true},"2096":{"prev":0,"locked":true},"913":{"prev":16,"link":"2","locked":true},"298":{"prev":128,"locked":true},"922":{"prev":128,"locked":true},"900":{"prev":0,"locked":true},"144":{"prev":16,"link":"5","locked":true},"1314":{"prev":16,"link":"1","locked":true},"643":{"prev":0,"locked":true},"638":{"prev":0,"locked":true},"390":{"prev":16,"link":"1","locked":true},"1272":{"prev":0,"locked":true},"2097":{"prev":0,"locked":true},"2085":{"prev":24576,"locked":true},"1260":{"prev":16,"link":"4","locked":true},"864":{"prev":24576,"locked":true},"923":{"prev":128,"locked":true},"919":{"prev":128,"locked":true},"2087":{"prev":24576,"locked":true},"979":{"prev":128,"locked":true},"976":{"prev":128,"locked":true},"975":{"prev":128,"locked":true},"931":{"prev":128,"locked":true},"957":{"prev":128,"locked":true},"2025":{"prev":1,"locked":true},"1965":{"prev":0,"locked":true},"1963":{"prev":0,"locked":true},"1667":{"prev":16,"link":"1","locked":true},"960":{"prev":24577,"locked":true},"176":{"prev":16,"link":"3","locked":true},"1966":{"prev":0,"locked":true},"2026":{"prev":1,"locked":true},"1450":{"prev":24576,"locked":true},"974":{"prev":128,"locked":true},"648":{"prev":0,"locked":true},"1964":{"prev":0,"locked":true},"977":{"prev":128,"locked":true},"955":{"prev":128,"locked":true}},"version":400,"DoorSetup":{"2113":{"flags":"link=1,buyable=1,price=500,elec=0,rebuyable=0"},"1682":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"},"1836":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"},"1676":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"},"1685":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"},"2195":{"flags":"link=1,buyable=1,price=500,elec=0,rebuyable=0"},"2196":{"flags":"link=1,buyable=1,price=500,elec=0,rebuyable=0"},"2197":{"flags":"link=2,buyable=1,price=1000,elec=0,rebuyable=0"},"1431":{"flags":"link=4,buyable=1,price=500,elec=0,rebuyable=0"},"1856":{"flags":"link=1,buyable=1,price=500,elec=0,rebuyable=0"},"1677":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"},"1684":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"},"1683":{"flags":"rebuyable=1,price=1000,elec=0,buyable=0"}},"NavGroups":[],"InvisWalls":[{"maxbound":"[-9.6563 53.5938 175.9375]","pos":"[4036.0938 -1395.3438 152.0313]"},{"maxbound":"[-341.8438 -2.3438 175.9375]","pos":"[4036.0313 -1341.6563 152.0313]"},{"maxbound":"[336.7188 5.5 175.9375]","pos":"[3696.9688 -1266.4375 152.0313]"},{"maxbound":"[5.1875 570.2188 175.9375]","pos":"[4033.7188 -1266.25 152.0313]"},{"maxbound":"[4.5 517.125 175.9375]","pos":"[4109.8125 -1267.8125 152.0313]"},{"maxbound":"[51.875 -3.125 175.9375]","pos":"[4110 -751 152.0313]"},{"maxbound":"[-1.9063 -75.6875 175.9375]","pos":"[4162.0625 -751.5313 152.0313]"},{"maxbound":"[-1 -112.125 220.1563]","pos":"[4161.4375 -830.3125 107.7813]"},{"maxbound":"[0.4063 -190.4688 175.9375]","pos":"[4214.0313 -752.6875 152.0313]"},{"maxbound":"[1.8438 -82.5313 240.625]","pos":"[4213.9688 -860.375 87.3125]"},{"maxbound":"[-2.5 -73.0625 159.9375]","pos":"[4034.875 -1446.875 152.0313]"},{"maxbound":"[-7.1563 222.75 125.8438]","pos":"[3491.6563 -1519.9688 24.0938]"},{"maxbound":"[-128.3125 -7.5 125.9375]","pos":"[3487.9688 -1295.625 24.0313]"},{"maxbound":"[62.1563 -125.8438 292.9375]","pos":"[3353.0313 -1305.5313 -142.9688]"},{"maxbound":"[-88.8125 2.2188 255.2188]","pos":"[3543.2188 -880.1875 72.7188]"},{"maxbound":"[-81.5 -2.1875 255.5625]","pos":"[3542.5313 -823.5625 72.375]"},{"maxbound":"[-91.0938 95.3438 255.9375]","pos":"[3118.125 280.0625 0.0313]"},{"maxbound":"[-56.4375 -43.3438 255.9375]","pos":"[3083.4688 260 0]"},{"maxbound":"[-5.4688 147 84.1875]","pos":"[4473.875 292.9375 195.75]"},{"maxbound":"[207.375 -6.875 87.9375]","pos":"[4248.5625 219.7813 192.0313]"},{"maxbound":"[7.5313 207.6875 87.9375]","pos":"[4612.0625 232.25 192.0313]"},{"maxbound":"[147.4688 -7.5313 95.9375]","pos":"[4248.4688 75.4375 192.0313]"},{"maxbound":"[-132.5 5.7188 87.8438]","pos":"[3743.9688 692.4375 192.0938]"},{"maxbound":"[148.7813 -7.2813 95.9375]","pos":"[3624.5625 555.7813 192.0313]"},{"maxbound":"[-145.4063 7.4063 95.9375]","pos":"[4839.5313 212.0625 192.0313]"},{"maxbound":"[-6.7813 -148.2813 95.9375]","pos":"[4027.625 933.8125 192.0313]"}],"BuyablePropSpawns":[{"pos":"[3870.9773 -750.3015 78.5465]","angle":"{-0 -85.7752 0}","model":"models/props_c17/fence03a.mdl"},{"pos":"[4115.7378 -728.7572 78.0443]","angle":"{-0 -86.6843 0}","model":"models/props_c17/fence03a.mdl"},{"pos":"[4299.8159 -1131.6956 30.4173]","angle":"{0.0069 0.4548 0.0091}","model":"models/props_wasteland/interior_fence002d.mdl","flags":"price=1250,buyable=1,link=5,elec=1,rebuyable=0"},{"pos":"[2909.6924 -371.4893 -1.1449]","angle":"{-0 -0.7919 0}","model":"models/props_wasteland/medbridge_post01.mdl"},{"pos":"[2915.5754 -280.0517 -2.6775]","angle":"{0 -1.0557 0}","model":"models/props_wasteland/medbridge_post01.mdl"},{"pos":"[3700.0435 -40.1522 196.0614]","angle":"{-0 -0.8031 0}","model":"models/props_c17/fence03a.mdl","flags":"link=2,buyable=1,price=1000,elec=0,rebuyable=0"},{"pos":"[4737.5601 -333.0396 201.6394]","angle":"{-0 -45.2899 0}","model":"models/props_wasteland/interior_fence002d.mdl","flags":"price=1250,buyable=1,link=3,elec=0,rebuyable=0"},{"pos":"[4103.7041 226.011 159.09]","angle":"{-0 90.6595 0}","model":"models/props_interiors/power_outlet_campground.mdl"},{"pos":"[4046.6985 225.4895 156.2779]","angle":"{-0 87.4918 0}","model":"models/props_c17/powerbox_damaged.mdl"},{"pos":"[3447.8127 -1248.144 -126.2949]","angle":"{0 -90 -0}","model":"models/props_wasteland/interior_fence001g.mdl","flags":"rebuyable=0,price=0,elec=1,buyable=1"},{"pos":"[2879.5825 -1177.0906 -138.2236]","angle":"{0 -0.462 0}","model":"models/props_wasteland/prison_celldoor001b.mdl"},{"pos":"[3328.2949 -1318.5757 54.6491]","angle":"{0 0.5986 -45}","model":"models/props_interiors/vendingmachinesoda01a.mdl"},{"pos":"[3268.73 -1272.5822 36.6522]","angle":"{-90 1.1887 180}","model":"models/props_wasteland/kitchen_stove002a.mdl"}],"SpecialEntities":[],"RandomBoxSpawns":[{"angle":"{0.0058 90.0482 0.1327}","pos":"[4051.3127 572.4468 160.585]"},{"angle":"{-0.0341 -134.4137 0.2524}","pos":"[4986.3809 -489.6053 160.4918]"},{"angle":"{0.021 89.8578 0.9451}","pos":"[2965.1812 -607.348 0.4114]"},{"angle":"{-0.2212 -0.0118 0.5276}","pos":"[3438.7952 76.5239 0.6067]"},{"angle":"{-0.0281 -179.9038 -0.1444}","pos":"[3379.2966 563.4102 158.6511]"},{"angle":"{0.1602 -90.0318 0.3818}","pos":"[5480.6387 -1605.9019 -95.3769]"}],"ElecSpawns":[{"angle":"{-0.0255 89.8586 0.015}","pos":"[4077.1973 229.4271 163.1157]"}],"WallBuys":[{"angle":"{0 540 0}","pos":"[3627.9512 -496.0313 53.137]","flipped":true,"price":500,"wep":"fas2_m1911"},{"angle":"{0 270 0}","pos":"[3264.0313 -1136.0227 75.5429]","flipped":true,"price":500,"wep":"fas2_m21"},{"angle":"{360 360 0}","pos":"[3106.9619 -757.9688 53.3728]","flipped":true,"price":1500,"wep":"fas2_m3s90"},{"angle":"{0 495 0}","pos":"[4975.8389 -327.8833 211.9781]","flipped":true,"price":1500,"wep":"fas2_rem870"},{"angle":"{0 360 0}","pos":"[3879.9221 704.0313 213.5464]","flipped":true,"price":2000,"wep":"fas2_galil"},{"angle":"{0 360 0}","pos":"[3550.2466 -255.9688 48.1052]","flipped":true,"price":1200,"wep":"fas2_uzi"},{"angle":"{0 90 -0}","pos":"[3983.9688 -85.2869 212.6242]","flipped":true,"price":1500,"wep":"fas2_mp5sd6"},{"angle":"{0 450 0}","pos":"[4463.9688 557.1966 208.4649]","flipped":true,"price":2500,"wep":"fas2_ak47"},{"angle":"{0 270 0}","pos":"[4325.0313 -1371.6563 21.8379]","flipped":true,"price":2500,"wep":"fas2_m4a1"},{"angle":"{-0 90 0}","pos":"[4510.4688 -1191.0785 23.6308]","flipped":true,"price":3000,"wep":"nz_bowie_knife"}],"NavGroupIDs":[],"ZedSpawns":[{"pos":"[3378.6511 -1420.2484 152.0313]","respawnable":1},{"link":1,"pos":"[2858.7395 -329.153 0.0313]","respawnable":1},{"link":1,"pos":"[3758.1418 -176.9213 0.0313]","respawnable":1},{"link":2,"pos":"[3659.0007 377.9841 160.0313]","respawnable":1},{"link":2,"pos":"[3326.7317 897.1509 160.0313]","respawnable":1},{"link":2,"pos":"[4258.5825 -28.1977 160.0313]","respawnable":1},{"link":2,"pos":"[4669.6821 523.2048 160.0313]","respawnable":1},{"link":3,"pos":"[4575.0073 -388.5615 160.0313]","respawnable":1},{"link":4,"pos":"[4516.2627 -426.3439 160.0313]","respawnable":1},{"link":3,"pos":"[4760.3521 302.3774 160.0313]","respawnable":1},{"link":3,"pos":"[4314.0835 8.7103 160.0313]","respawnable":1},{"link":3,"pos":"[3777.6355 403.2165 160.0313]","respawnable":1},{"link":3,"pos":"[3275.1726 884.158 160.0313]","respawnable":1},{"link":2,"pos":"[3781.4849 -122.4101 0.0312]","respawnable":1},{"link":1,"pos":"[2826.8967 -323.936 0.0313]","respawnable":1},{"link":5,"pos":"[5058.98 -2051.4473 -95.9688]","respawnable":1},{"link":5,"pos":"[5201.209 -2051.4448 -95.9688]","respawnable":1},{"link":5,"pos":"[5320.3564 -2042.6355 -95.9688]","respawnable":1},{"link":5,"pos":"[5442.6704 -2048.7363 -95.9688]","respawnable":1},{"link":5,"pos":"[5337.1509 -907.6223 -95.9688]","respawnable":1},{"link":5,"pos":"[5243.0708 -917.9886 -95.9688]","respawnable":1},{"link":5,"pos":"[5083.9888 -914.8188 -95.9688]","respawnable":1},{"link":5,"pos":"[5455.228 -1028.1593 -47.9688]","respawnable":1},{"pos":"[3298.2686 -849.1125 168.0313]","respawnable":1}],"BreakEntry":[{"angle":"{0 -179.3022 0}","pos":"[3543.2385 -851.7187 79.4422]"},{"angle":"{-0 -179.7996 0}","pos":"[3694.7334 -1304.0496 205.2053]"},{"angle":"{-0 -179.9262 0}","pos":"[3713.9233 -1419.2626 79.5503]"},{"angle":"{-0 178.3213 0}","pos":"[2915.3916 -326.207 50.1391]"},{"angle":"{0 0.2184 -0}","pos":"[3648.2207 -68.8773 42.0366]"},{"angle":"{0 -2.6861 0}","pos":"[3642.0178 -12.3905 43.8755]"},{"angle":"{-0 -88.2574 0}","pos":"[3802.73 558.0977 202.3794]"},{"angle":"{0 91.1665 -0}","pos":"[3375.1809 764.2844 210.1646]"},{"angle":"{-0 -90.765 0}","pos":"[4424.9878 78.3327 212.9015]"},{"angle":"{0 90.767 -0}","pos":"[4662.0107 206.5172 209.4586]"},{"angle":"{0 90.5413 -0}","pos":"[4633.2002 -543.4717 208.616]"}],"PlayerSpawns":[{"pos":"[3701.0566 -1146.4681 23.0313]"},{"pos":"[3841.6365 -1153.5814 23.0313]"},{"pos":"[3914.4963 -980.9344 23.0313]"},{"pos":"[3828.9316 -891.1439 23.0313]"},{"pos":"[3721.7539 -876.3463 25.0313]"},{"pos":"[3625.4585 -904.9734 23.0313]"},{"pos":"[3612.9338 -1044.7297 23.0313]"},{"pos":"[3926.7446 -1088.3309 23.0313]"},{"pos":"[3998.7029 -916.5186 24.0313]"}],"PerkMachineSpawns":[{"angle":"{0 -89.9261 0}","pos":"[4166.0044 -520.5506 152.0313]","id":"revive"},{"angle":"{0.0046 179.7652 -0.2692}","pos":"[4273.3418 927.4385 160.5491]","id":"jugg"},{"angle":"{1.0721 -89.6979 -0.0347}","pos":"[4363.3745 668.2178 160.4515]","id":"speed"},{"angle":"{-0.4237 -90.9021 -0.1978}","pos":"[4345.3755 -488.4611 158.5645]","id":"deadshot"},{"angle":"{-0.9461 2.9004 -0.0243}","pos":"[4509.6504 -68.8665 159.8929]","id":"whoswho"},{"angle":"{-0 0 0.0001}","pos":"[2539.3401 799.7473 -1680.3997]","id":"pap"},{"angle":"{0.0555 -179.997 0.0445}","pos":"[5478.9067 -1786.9187 -96.0252]","id":"tombstone"},{"angle":"{0.067 179.8578 0}","pos":"[5477.6548 -1433.6165 -95.4346]","id":"cherry"}],"BlockSpawns":[{"angle":"{90 -90.2505 180}","model":"models/hunter/plates/plate2x2.mdl","pos":"[2870.2966 -295.1663 0.0313]"},{"angle":"{90 87.8536 180}","model":"models/hunter/plates/plate2x2.mdl","pos":"[2864.73 -353.6593 0.0313]"},{"angle":"{-0.5616 30.0792 89.1158}","model":"models/hunter/plates/plate1x2.mdl","pos":"[3231.854 443.4987 180.0088]"},{"angle":"{90 -178.4622 180}","model":"models/hunter/plates/plate2x3.mdl","pos":"[3601.52 -210.4269 65.7153]"},{"angle":"{88.3762 -47.567 3.2533}","model":"models/hunter/plates/plate1x1.mdl","pos":"[3620.1108 -121.4807 63.7302]"},{"angle":"{90 0.9383 180}","model":"models/hunter/plates/plate1x1.mdl","pos":"[3478.0168 -220.8691 41.0492]"},{"angle":"{90 88.5847 180}","model":"models/hunter/plates/plate1x1.mdl","pos":"[3452.502 -198.5208 30.7089]"},{"angle":"{90 89.9994 180}","model":"models/hunter/plates/plate1x1.mdl","pos":"[3687.1843 -1386.4001 88.9011]"},{"angle":"{90 -89.9999 180}","model":"models/hunter/plates/plate1x1.mdl","pos":"[3691.3154 -1453.3566 94.5264]"},{"angle":"{90 -179.9999 180}","model":"models/hunter/plates/plate2x5.mdl","pos":"[3713.3611 -638.2825 175.6803]"}],"RemoveProps":[],"PropEffects":[],"MapSettings":{"startpoints":500,"rboxweps":["fas2_ks23","gdcw_raygun","cw_c7a1","fas2_an94","fas2_sg552","fas2_famas","fas2_m3s90","fas2_m21","fas2_mac11","fas2_glock20","fas2_mp5sd6","fas2_m79","fas2_m4a1","cw_auggsm","fas2_rpk","cw_xm1014","fas2_rk95","fas2_m67","fas2_m14","fas2_p226","cw_mr96","fas2_g3","fas2_ak12","cw_g3a3","cw_l115","nz_monkey_bomb","fas2_m1911","fas2_m24","cw_ws_mosin","cw_dz_ru556","fas2_ots33","fas2_mp5a5","fas2_ragingbull","fas2_ak74","cw_ppsh-41","fas2_deagle","cw_lr300","fas2_mp5k","cw_ak74","fas2_uzi","fas2_toz34","fas2_sr25","fas2_sks","fas2_galil","fas2_sg550","cw_mp5","cw_ar15","fas2_ak47","cw_mk11","fas2_dv2","fas2_g36c","cw_deagle","fas2_pp19","fas2_rem870","fas2_m82"],"startwep":"fas2_glock20","scriptinfo":"Adds Pack-a-Punch Objective","numweps":2,"script":1,"eeurl":"https://soundcloud.com/darkwebside/115-elena-siegman-call-of-duty"},"EasterEggs":[{"angle":"{0 0 0}","model":"models/props_lab/huladoll.mdl","pos":"[4220.1348 -1480.2666 24.0313]"},{"angle":"{0 0 0}","model":"models/props_lab/huladoll.mdl","pos":"[4596.1392 -247.5583 181.3079]"},{"angle":"{0 0 0}","model":"models/props_lab/huladoll.mdl","pos":"[2995.5229 -172.7378 0.0312]"}]} \ No newline at end of file diff --git a/lua/effects/lightning_aura/init.lua b/lua/effects/lightning_aura/init.lua new file mode 100644 index 00000000..b37c2e34 --- /dev/null +++ b/lua/effects/lightning_aura/init.lua @@ -0,0 +1,165 @@ + +--EFFECT.MatCenter = Material( "lightning.png", "unlitgeneric smooth" ) +EFFECT.MatEdge = Material( "effects/tool_tracer" ) +EFFECT.MatCenter = Material( "sprites/physbeama" ) +EFFECT.MatGlow1 = Material( "sprites/physg_glow1" ) +EFFECT.MatGlow2 = Material( "sprites/physg_glow2" ) +EFFECT.MatGlowCenter = Material( "sprites/glow04_noz" ) + +--[[--------------------------------------------------------- + Init( data table ) +-----------------------------------------------------------]] +function EFFECT:Init( data ) + + self.Size = data:GetScale() or 1 + self.MaxArcs = 2 + self.Parent = data:GetEntity() + self.Frequency = data:GetMagnitude()/10 or 0.01 + self.Pos = self.Parent:WorldSpaceCenter() + self.Parent.LightningAura = true -- Set this to false to kill the effect + + self.Alpha = 255 + self.Life = 0 + self.NextArc = 0 + self.Arcs = {} + self.Queue = 1 + + self:SetRenderBoundsWS( self.Pos, self.Pos, Vector(100,100,100) ) + +end + +--[[--------------------------------------------------------- + THINK +-----------------------------------------------------------]] +function EFFECT:Think() + + if IsValid(self.Parent) then + self.Pos = self.Parent:WorldSpaceCenter() + end + + self.Life = self.Life + FrameTime() + --self.Alpha = 255 * ( 1 - self.Life ) + + if self.NextArc <= self.Life then + + local size = #self.Arcs + --add a arc to the array + while self.Arcs[size] do + size = size + 1 + end + self.Arcs[size] = self:GenerateArc(self.Pos + AngleRand():Forward()*10*self.Size, self.Pos + AngleRand():Forward()*10*self.Size, 0.01, 4) + self.NextArc = self.NextArc + self.Frequency + + if size >= self.MaxArcs then + local i = 1 + while not self.Arcs[i] and i <= size do + i = i + 1 + end + self.Arcs[i] = nil + end + end + + return IsValid(self.Parent) and self.Parent.LightningAura +end + +function EFFECT:GenerateArc(startPos, endPos, branchChance, detail) + -- MidPoint Displacement for arc lines + local points = {} + local maxPoints = 2^detail + + if maxPoints % 2 != 0 then + maxPoints = maxPoints + 1 + end + + points[0] = startPos + + local randVec = VectorRand() * 10 + + randVec.z = math.Clamp(randVec.z, 0, 10) + + points[maxPoints] = endPos + randVec + + local i = 1 + + while i < maxPoints do + local j = (maxPoints / i) / 2 + while j < maxPoints do + points[j] = ((points[j - (maxPoints / i) / 2] + points[j + (maxPoints / i) / 2]) / 2); + points[j] = points[j] + VectorRand() * 10 + if math.Rand(0,1) < branchChance then + points[#points + 1] = self:GenerateArc(points[j], points[j] + Vector(math.random(-50 * branchChance, 50 * branchChance), math.random(-50 * branchChance, 50 * branchChance), math.random(-50 * branchChance, 10 * branchChance)), branchChance/1.3, detail) + end + j = j + maxPoints / i + end + i = i * 2 + end + + points.size = math.random(1,3)*self.Size + points.color = Color(200, 240, math.random(230, 255), math.random(200, 255)) + points.dietime = CurTime() + 0.07 + + return points +end + +--[[--------------------------------------------------------- + Draw the effect +-----------------------------------------------------------]] +function EFFECT:Render() + + if ( self.Alpha < 1 ) then return end + + render.SetMaterial( self.MatCenter ) + + for _, arc in pairs(self.Arcs) do + if arc.dietime <= CurTime() then + self.Arcs[_] = nil + else + self:RenderArc(arc) + end + end + + render.SetMaterial( self.MatEdge ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc, true) + end + + render.SetMaterial( self.MatGlow1 ) + render.DrawSprite( self.Pos, math.random(40,120)*self.Size, math.random(40,120)*self.Size, Color(math.random(50,150),math.random(100,200),255,math.random(100,200))) + + if math.random(0,10) == 0 then + render.SetMaterial( self.MatGlow2 ) + render.DrawSprite( self.Pos, math.random(20,60)*self.Size, math.random(40,120)*self.Size, Color(math.random(50,150),math.random(100,200),255,math.random(100,200))) + end + + render.SetMaterial( self.MatGlowCenter ) + render.DrawSprite( self.Pos, math.random(15,40)*self.Size, math.random(15,40)*self.Size, Color(math.random(50,150),math.random(100,200),255,math.random(200,250))) + + if !self.Parent:GetNoDraw() then + self.Parent:DrawModel() -- Always draw the model in front + end +end + +function EFFECT:RenderArc(arc, edge) + for j = 1, #arc - 1 do + + if istable(arc[j]) then + self:RenderArc(arc[j]) + elseif !istable(arc[j+1]) then + + local texcoord = math.Rand( 0, 1 ) + + local startPos = arc[j] + local endPos = arc[j + 1] + + render.DrawBeam( + startPos, + endPos, + (edge and arc.size*3 or arc.size), + texcoord, + texcoord + ((startPos - endPos):Length() / 128), + arc.color + ) + end + end +end diff --git a/lua/effects/lightning_prespawn/init.lua b/lua/effects/lightning_prespawn/init.lua new file mode 100644 index 00000000..2a8b8834 --- /dev/null +++ b/lua/effects/lightning_prespawn/init.lua @@ -0,0 +1,161 @@ +--Name: Lightning strike using midpoint displacement +--Author: Lolle + +--EFFECT.MatCenter = Material( "lightning.png", "unlitgeneric smooth" ) +EFFECT.MatEdge = Material( "effects/tool_tracer" ) +EFFECT.MatCenter = Material( "sprites/physbeama" ) +EFFECT.MatGlow1 = Material( "sprites/physg_glow1_noz" ) +EFFECT.MatGlow2 = Material( "sprites/physg_glow2_noz" ) +EFFECT.MatGlowCenter = Material( "sprites/glow04_actual_noz" ) + +--[[--------------------------------------------------------- + Init( data table ) +-----------------------------------------------------------]] +function EFFECT:Init( data ) + + self.Pos = data:GetOrigin() + VectorRand() * 10 + self.Duration = data:GetMagnitude() or 2 + self.Count = self.Duration * 40 + self.MaxArcs = 2 + self.Radius = 30 + self.Parent = data:GetEntity() + + self.Alpha = 255 + self.Life = 0 + self.NextArc = 0 + self.Arcs = {} + self.Queue = 1 + + self:SetRenderBoundsWS( self.Pos, self.Pos, Vector(100,100,100) ) + + sound.Play("nz/hellhound/spawn/prespawn.wav", self.Pos, 100, 100, 1) + +end + +--[[--------------------------------------------------------- + THINK +-----------------------------------------------------------]] +function EFFECT:Think() + + if IsValid(self.Parent) then + self.Pos = self.Parent:GetPos() + end + + self.Life = self.Life + FrameTime() + --self.Alpha = 255 * ( 1 - self.Life ) + + if self.NextArc <= self.Life and self.Life <= self.Duration - self.Duration * 0.25 then + + local size = #self.Arcs + --add a arc to the array + while self.Arcs[size] do + size = size + 1 + end + self.Arcs[size] = self:GenerateArc(self.Pos + AngleRand():Forward()*100, self.Pos + AngleRand():Forward()*100, 0.1, 4) + self.NextArc = self.NextArc + 0.1 + + if size >= self.MaxArcs then + local i = 1 + while not self.Arcs[i] and i <= size do + i = i + 1 + end + self.Arcs[i] = nil + end + end + + return ( self.Life < self.Duration ) +end + +function EFFECT:GenerateArc(startPos, endPos, branchChance, detail) + -- MidPoint Displacement for arc lines + local points = {} + local maxPoints = 2^detail + + if maxPoints % 2 != 0 then + maxPoints = maxPoints + 1 + end + + points[0] = startPos + + local randVec = VectorRand() * 10 + + randVec.z = math.Clamp(randVec.z, 0, 10) + + points[maxPoints] = endPos + randVec + + local i = 1 + + while i < maxPoints do + local j = (maxPoints / i) / 2 + while j < maxPoints do + points[j] = ((points[j - (maxPoints / i) / 2] + points[j + (maxPoints / i) / 2]) / 2); + points[j] = points[j] + VectorRand() * 10 + if math.Rand(0,1) < branchChance then + points[#points + 1] = self:GenerateArc(points[j], points[j] + Vector(math.random(-50 * branchChance, 50 * branchChance), math.random(-50 * branchChance, 50 * branchChance), math.random(-50 * branchChance, 10 * branchChance)), branchChance/1.3, detail) + end + j = j + maxPoints / i + end + i = i * 2 + end + + points.size = math.random(2,10) + points.color = Color(200, 240, math.random(230, 255), math.random(200, 255)) + + return points +end + +--[[--------------------------------------------------------- + Draw the effect +-----------------------------------------------------------]] +function EFFECT:Render() + + if ( self.Alpha < 1 ) then return end + + render.SetMaterial( self.MatCenter ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc) + end + + render.SetMaterial( self.MatEdge ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc, true) + end + + render.SetMaterial( self.MatGlow1 ) + render.DrawSprite( self.Pos + Vector(0,0,30), math.random(200,600), math.random(200,600), Color(255,255,255,math.random(0,100))) + + if math.random(0,10) == 0 then + render.SetMaterial( self.MatGlow2 ) + render.DrawSprite( self.Pos + Vector(0,0,30), math.random(200,600), math.random(200,600), Color(255,255,255,math.random(0,200))) + end + + render.SetMaterial( self.MatGlowCenter ) + render.DrawSprite( self.Pos + Vector(0,0,30), math.random(75,200), math.random(75,200), Color(255,255,255,math.random(200,250))) + +end + +function EFFECT:RenderArc(arc, edge) + for j = 1, #arc - 1 do + + if istable(arc[j]) then + self:RenderArc(arc[j]) + elseif !istable(arc[j+1]) then + + local texcoord = math.Rand( 0, 1 ) + + local startPos = arc[j] + local endPos = arc[j + 1] + + render.DrawBeam( + startPos, + endPos, + edge and arc.size*3 or arc.size, + texcoord, + texcoord + ((startPos - endPos):Length() / 128), + arc.color + ) + end + end +end diff --git a/lua/effects/lightning_strike/init.lua b/lua/effects/lightning_strike/init.lua new file mode 100644 index 00000000..9ebcdb28 --- /dev/null +++ b/lua/effects/lightning_strike/init.lua @@ -0,0 +1,164 @@ +--Name: Lightning strike using midpoint displacement +--Author: Lolle + +--EFFECT.MatCenter = Material( "lightning.png", "unlitgeneric smooth" ) +EFFECT.MatEdge = Material( "effects/tool_tracer" ) +EFFECT.MatCenter = Material( "sprites/physbeama" ) +EFFECT.MatGlow = Material( "sprites/glow04_actual_noz" ) + +--[[--------------------------------------------------------- + Init( data table ) +-----------------------------------------------------------]] +function EFFECT:Init( data ) + + self.StartPos = data:GetStart() + self.EndPos = data:GetOrigin() + VectorRand() * 10 + self.Duration = data:GetMagnitude() or 10 + self.Count = self.Duration * 40 + self.MaxArcs = 5 + self.Radius = 30 + + self.Flash = DynamicLight( LocalPlayer():EntIndex() ) + + self.Flash.pos = self.EndPos + self.Flash.r = 255 + self.Flash.g = 255 + self.Flash.b = 255 + self.Flash.brightness = 2 + self.Flash.Decay = 200 + self.Flash.Size = 1500 + self.Flash.style = 6 + self.Flash.DieTime = CurTime() + 0.2 + + + self.Alpha = 255 + self.Life = 0 + self.NextArc = 0 + self.Arcs = {} + self.Queue = 1 + + self:SetRenderBoundsWS( self.StartPos, self.EndPos ) + + sound.Play("nz/hellhound/spawn/strike.wav", self.EndPos, 100, 100, 1) + +end + +--[[--------------------------------------------------------- + THINK +-----------------------------------------------------------]] +function EFFECT:Think() + + + self.Life = self.Life + FrameTime() + --self.Alpha = 255 * ( 1 - self.Life ) + + if self.NextArc <= self.Life and self.Life <= self.Duration - self.Duration * 0.25 then + + local size = #self.Arcs + --add a arc to the array + while self.Arcs[size] do + size = size + 1 + end + self.Arcs[size] = self:GenerateArc(self.StartPos, self.EndPos, 0.1, 4) + self.NextArc = self.NextArc + 0.05 + + if size >= self.MaxArcs then + local i = 1 + while not self.Arcs[i] and i <= size do + i = i + 1 + end + self.Arcs[i] = nil + end + end + + return ( self.Life < self.Duration ) +end + +function EFFECT:GenerateArc(startPos, endPos, branchChance, detail) + -- MidPoint Displacement for arc lines + local points = {} + local maxPoints = 2^detail + + if maxPoints % 2 != 0 then + maxPoints = maxPoints + 1 + end + + points[0] = startPos + + local randVec = VectorRand() * 10 + + randVec.z = math.Clamp(randVec.z, 0, 10) + + points[maxPoints] = endPos + randVec + + local i = 1 + + while i < maxPoints do + local j = (maxPoints / i) / 2 + while j < maxPoints do + points[j] = ((points[j - (maxPoints / i) / 2] + points[j + (maxPoints / i) / 2]) / 2); + points[j] = points[j] + VectorRand() * 25 + if math.Rand(0,1) < branchChance then + points[#points + 1] = self:GenerateArc(points[j], points[j] + Vector(math.random(-5000 * branchChance, 5000 * branchChance), math.random(-5000 * branchChance, 5000 * branchChance), math.random(-5000 * branchChance, 100 * branchChance)), branchChance/1.3, detail) + end + j = j + maxPoints / i + end + i = i * 2 + end + + points.size = math.random(10,30) + points.color = Color(200, 240, math.random(230, 255), math.random(200, 255)) + + return points +end + +--[[--------------------------------------------------------- + Draw the effect +-----------------------------------------------------------]] +function EFFECT:Render() + + if ( self.Alpha < 1 ) then return end + + render.SetMaterial( self.MatCenter ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc) + end + + render.SetMaterial( self.MatEdge ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc, true) + end + + render.SetMaterial( self.MatGlow ) + + render.DrawSprite( self.EndPos + Vector(0,0,30), math.random(400,1000), math.random(400,1000), Color(255,255,255,math.random(0,250))) + + util.ScreenShake( EyePos(), 0.5, 1, 0.1, 10 ) + +end + +function EFFECT:RenderArc(arc, edge) + for j = 1, #arc - 1 do + + if istable(arc[j]) then + self:RenderArc(arc[j]) + elseif !istable(arc[j+1]) then + + local texcoord = math.Rand( 0, 1 ) + + local startPos = arc[j] + local endPos = arc[j + 1] + + render.DrawBeam( + startPos, + endPos, + edge and arc.size*1.5 or arc.size, + texcoord, + texcoord + ((startPos - endPos):Length() / 128), + arc.color + ) + end + end +end diff --git a/lua/effects/lightning_strike_wunderfizz/init.lua b/lua/effects/lightning_strike_wunderfizz/init.lua new file mode 100644 index 00000000..e96a6e7a --- /dev/null +++ b/lua/effects/lightning_strike_wunderfizz/init.lua @@ -0,0 +1,162 @@ +--Name: Lightning strike using midpoint displacement +--Author: Lolle + +--EFFECT.MatCenter = Material( "lightning.png", "unlitgeneric smooth" ) +EFFECT.MatEdge = Material( "effects/tool_tracer" ) +EFFECT.MatCenter = Material( "sprites/physbeama" ) +EFFECT.MatGlow = Material( "sprites/glow04_actual_noz" ) + +--[[--------------------------------------------------------- + Init( data table ) +-----------------------------------------------------------]] +function EFFECT:Init( data ) + + self.StartPos = data:GetStart() + self.EndPos = data:GetOrigin() + VectorRand() * 10 + self.Duration = data:GetMagnitude() or 10 + self.Count = self.Duration * 10 + self.MaxArcs = 4 + self.Radius = 30 + + self.Flash = DynamicLight( LocalPlayer():EntIndex() ) + + self.Flash.pos = self.EndPos + self.Flash.r = 255 + self.Flash.g = 255 + self.Flash.b = 255 + self.Flash.brightness = 2 + self.Flash.Decay = 200 + self.Flash.Size = 1500 + self.Flash.style = 6 + self.Flash.DieTime = CurTime() + 0.2 + + + self.Alpha = 255 + self.Life = 0 + self.NextArc = 0 + self.Arcs = {} + self.Queue = 1 + + self:SetRenderBoundsWS( self.StartPos, self.EndPos ) + + sound.Play("nz/hellhound/spawn/strike.wav", self.StartPos, 100, 100, 1) + +end + +--[[--------------------------------------------------------- + THINK +-----------------------------------------------------------]] +function EFFECT:Think() + + + self.Life = self.Life + FrameTime() + --self.Alpha = 255 * ( 1 - self.Life ) + + if self.NextArc <= self.Life and self.Life <= self.Duration - self.Duration * 0.25 then + + local size = #self.Arcs + --add a arc to the array + while self.Arcs[size] do + size = size + 1 + end + self.Arcs[size] = self:GenerateArc(self.StartPos, self.EndPos, 0.1, 4) + self.NextArc = self.NextArc + 0.1 + + if size >= self.MaxArcs then + local i = 1 + while not self.Arcs[i] and i <= size do + i = i + 1 + end + self.Arcs[i] = nil + end + end + + return ( self.Life < self.Duration ) +end + +function EFFECT:GenerateArc(startPos, endPos, branchChance, detail) + -- MidPoint Displacement for arc lines + local points = {} + local maxPoints = 2^detail + + if maxPoints % 2 != 0 then + maxPoints = maxPoints + 1 + end + + points[0] = startPos + + local randVec = VectorRand() * 10 + + randVec.z = math.Clamp(randVec.z, 0, 10) + + points[maxPoints] = endPos + randVec + + local i = 1 + + while i < maxPoints do + local j = (maxPoints / i) / 2 + while j < maxPoints do + points[j] = ((points[j - (maxPoints / i) / 2] + points[j + (maxPoints / i) / 2]) / 2); + points[j] = points[j] + VectorRand() * 25 + if math.Rand(0,1) < branchChance then + points[#points + 1] = self:GenerateArc(points[j], points[j] + Vector(math.random(-5000 * branchChance, 5000 * branchChance), math.random(-5000 * branchChance, 5000 * branchChance), math.random(-5000 * branchChance, 100 * branchChance)), branchChance/1.3, detail) + end + j = j + maxPoints / i + end + i = i * 2 + end + + points.size = math.random(10,30) + points.color = Color(200, 240, math.random(230, 255), math.random(200, 255)) + + return points +end + +--[[--------------------------------------------------------- + Draw the effect +-----------------------------------------------------------]] +function EFFECT:Render() + + if ( self.Alpha < 1 ) then return end + + render.SetMaterial( self.MatCenter ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc) + end + + render.SetMaterial( self.MatEdge ) + + for _, arc in pairs(self.Arcs) do + self:RenderArc(arc, true) + end + + render.SetMaterial( self.MatGlow ) + + render.DrawSprite( self.EndPos + Vector(0,0,30), math.random(100,400), math.random(100,400), Color(255,255,255,math.random(0,200))) + +end + +function EFFECT:RenderArc(arc, edge) + for j = 1, #arc - 1 do + + if istable(arc[j]) then + self:RenderArc(arc[j]) + elseif !istable(arc[j+1]) then + + local texcoord = math.Rand( 0, 1 ) + + local startPos = arc[j] + local endPos = arc[j + 1] + + render.DrawBeam( + startPos, + endPos, + edge and arc.size*1.5 or arc.size, + texcoord, + texcoord + ((startPos - endPos):Length() / 128), + arc.color + ) + end + end +end diff --git a/lua/effects/one_inch_punch_blow/init.lua b/lua/effects/one_inch_punch_blow/init.lua new file mode 100644 index 00000000..975b9db3 --- /dev/null +++ b/lua/effects/one_inch_punch_blow/init.lua @@ -0,0 +1,66 @@ +local particles = { + Model("particle/particle_ring_wave_8"), +} + +local delay = 0.05 +local amount = 3 + +--Main function +function EFFECT:Init(data) + --Create particle emitter + local emitter = ParticleEmitter(data:GetOrigin()) + local bone = math.Round(data:GetMagnitude()) + local num = 0 + timer.Create("one_inch_punch_effect", delay, amount, function() + if IsValid(LocalPlayer()) and LocalPlayer():GetActiveWeapon():GetClass() == "nz_one_inch_punch" then + num = num + 1 + local pos = LocalPlayer():GetViewModel():GetBoneMatrix(bone):GetTranslation() + local particle = emitter:Add( table.Random(particles), pos ) + if (particle) then + particle:SetVelocity(LocalPlayer():GetVelocity()) + particle:SetLifeTime(0) + particle:SetDieTime(1.1) + particle:SetColor(200,200,200) + particle:SetLighting(false) + particle:SetStartAlpha(100) + particle:SetEndAlpha(0) + + local Size = math.Rand(5,10) + particle:SetStartSize(Size) + particle:SetEndSize(Size) + particle:SetRoll(math.Rand(-360, 360)) + particle:SetRollDelta(math.Rand(-2, 2)) + particle:SetAirResistance(math.Rand(200, 400)) + particle:SetGravity( Vector(0, 0, 0) ) + particle:SetCollide(false) + particle:SetBounce(0.42) + --particle:SetLighting(1) + end + + if num >= amount then + emitter:Finish() + timer.Destroy("one_inch_punch_effect") + end + else + emitter:Finish() + timer.Destroy("one_inch_punch_effect") + end + end) +end + +function EFFECT:Think() + if !self.NextParticle or self.NextParticle < CurTime() then + + self.NextParticle = CurTime() + delay + end + if self.KillTime and self.KillTime < CurTime() then + print("Done") + emitter:Finish() + return false + end + self:NextThink(CurTime()) +end + +--Not used +function EFFECT:Render() +end \ No newline at end of file diff --git a/lua/effects/panzer_land_dust/init.lua b/lua/effects/panzer_land_dust/init.lua new file mode 100644 index 00000000..d3e03b72 --- /dev/null +++ b/lua/effects/panzer_land_dust/init.lua @@ -0,0 +1,46 @@ +AddCSLuaFile() + +EFFECT.Mat = { + Model("particle/particle_smokegrenade"), + Model("particle/particle_noisesphere") +} + +function EFFECT:Init( data ) + local pos = data:GetOrigin() + local duration = data:GetMagnitude() + local em = ParticleEmitter( pos ) + for i = 0, 20 do + local p = em:Add( self.Mat[math.random(#self.Mat)] , pos ) + if p then + p:SetColor(math.random(100,120), math.random(100,150), math.random(150,170)) + p:SetStartAlpha(255) + p:SetEndAlpha(150) + local vel = VectorRand() * math.Rand(50,300) + vel.z = 0 + p:SetVelocity(vel) + p:SetLifeTime(0) + + p:SetDieTime(math.Rand(duration + 0.75, duration + 1.5)) + + p:SetStartSize(math.random(45, 50)) + p:SetEndSize(math.random(20, 30)) + p:SetRoll(math.random(-180, 180)) + p:SetRollDelta(math.Rand(-0.1, 0.1)) + p:SetAirResistance(100) + + p:SetCollide(true) + p:SetBounce(0.4) + + p:SetLighting(false) + end + end + em:Finish() +end + +function EFFECT:Think() + return false +end + +function EFFECT:Render() + return false +end diff --git a/lua/effects/powerup_glow/init.lua b/lua/effects/powerup_glow/init.lua new file mode 100644 index 00000000..03de612c --- /dev/null +++ b/lua/effects/powerup_glow/init.lua @@ -0,0 +1,53 @@ +function EFFECT:Init( data ) + + local vOffset = data:GetOrigin() + + local NumParticles = 1 + + local emitter = ParticleEmitter( vOffset ) + + for i=0, NumParticles do + + local particle = emitter:Add( "sprites/physg_glow1", vOffset ) + if (particle) then + + particle:SetVelocity( Vector(0,0,0) ) + particle:SetColor(math.random(50,100), math.random(200,255), math.random(100,150)) + + particle:SetLifeTime( 0 ) + particle:SetDieTime( 0.3 ) + + particle:SetStartAlpha( 100 ) + particle:SetEndAlpha( 0 ) + + particle:SetStartSize( 25 ) + particle:SetEndSize( 25 ) + + particle:SetRoll( math.Rand(0, 36)*10 ) + --particle:SetRollDelta( math.Rand(-200, 200) ) + + particle:SetAirResistance( 400 ) + + particle:SetGravity( Vector( 0, 0, 0 ) ) + + end + + end + + emitter:Finish() + +end + + +--[[--------------------------------------------------------- + THINK +-----------------------------------------------------------]] +function EFFECT:Think( ) + return false +end + +--[[--------------------------------------------------------- + Draw the effect +-----------------------------------------------------------]] +function EFFECT:Render() +end diff --git a/lua/effects/vulture_gascloud/init.lua b/lua/effects/vulture_gascloud/init.lua new file mode 100644 index 00000000..2a2a481a --- /dev/null +++ b/lua/effects/vulture_gascloud/init.lua @@ -0,0 +1,49 @@ +local gasparticles = { + Model("particle/particle_smokegrenade"), + Model("particle/particle_noisesphere") +} + +--Main function +function EFFECT:Init(data) + --Create particle emitter + local emitter = ParticleEmitter(data:GetOrigin()) + --Amount of particles to create + for i=0, 16 do + --Safeguard + if !emitter then return end + + local Pos = (data:GetOrigin() + Vector( math.Rand(-5,5), math.Rand(-5,5), math.Rand(-5,5) )) + local particle = emitter:Add( table.Random(gasparticles), Pos ) + if (particle) then + particle:SetVelocity(VectorRand() * math.Rand(100,200)) + particle:SetLifeTime(0) + particle:SetDieTime(math.Rand(4, 6)) + particle:SetColor(100,255,150) + particle:SetLighting(false) + particle:SetStartAlpha(255) + particle:SetEndAlpha(0) + + local Size = math.Rand(10,20) + particle:SetStartSize(Size) + particle:SetEndSize(Size) + particle:SetRoll(math.Rand(-360, 360)) + particle:SetRollDelta(math.Rand(-0.21, 0.21)) + particle:SetAirResistance(math.Rand(520,620)) + particle:SetGravity( Vector(0, 0, 0) ) + particle:SetCollide(false) + particle:SetBounce(0.42) + particle:SetLighting(1) + end + end + --We're done with this emitter + emitter:Finish() +end + +--Kill effect +function EFFECT:Think() +return false +end + +--Not used +function EFFECT:Render() +end \ No newline at end of file diff --git a/lua/effects/zombie_soul/init.lua b/lua/effects/zombie_soul/init.lua new file mode 100644 index 00000000..3802b9a2 --- /dev/null +++ b/lua/effects/zombie_soul/init.lua @@ -0,0 +1,54 @@ +function EFFECT:Init( data ) + + self.Start = data:GetOrigin() + self.Catcher = data:GetEntity() + self.ParticleDelay = 0.1 + self.MoveSpeed = 50 + self.DistToCatch = 100 -- Squared (10) + + self.NextParticle = CurTime() + + self.Emitter = ParticleEmitter( self.Start ) + + print(self.Emitter, self.NextParticle, self, self.Catcher) + +end + + +--[[--------------------------------------------------------- + THINK +-----------------------------------------------------------]] +function EFFECT:Think( ) + if CurTime() >= self.NextParticle then + local particle = self.Emitter:Add("sprites/glow04_noz", self.Emitter:GetPos()) + if (particle) then + particle:SetVelocity( Vector(0,0,0) ) + particle:SetColor(math.random(200,255), math.random(100,200), math.random(100,150)) + particle:SetLifeTime( 0 ) + particle:SetDieTime( 0.3 ) + particle:SetStartAlpha( 255 ) + particle:SetEndAlpha( 0 ) + particle:SetStartSize( 25 ) + particle:SetEndSize( 25 ) + particle:SetRoll( math.Rand(0, 36)*10 ) + --particle:SetRollDelta( math.Rand(-200, 200) ) + particle:SetAirResistance( 400 ) + particle:SetGravity( Vector( 0, 0, 0 ) ) + + self.NextParticle = CurTime() + self.ParticleDelay + end + end + self.Emitter:SetPos( (self.Catcher:GetPos()-self.Emitter:GetPos()):GetNormal() * self.MoveSpeed * FrameTime() + self.Emitter:GetPos() ) + if self.Emitter:GetPos():DistToSqr(self.Catcher:GetPos()) <= self.DistToCatch then + self.Catcher:CollectSoul() + return false + else + return true + end +end + +--[[--------------------------------------------------------- + Draw the effect +-----------------------------------------------------------]] +function EFFECT:Render() +end diff --git a/lua/effects/zombie_spawn_dust/init.lua b/lua/effects/zombie_spawn_dust/init.lua new file mode 100644 index 00000000..ab7b976b --- /dev/null +++ b/lua/effects/zombie_spawn_dust/init.lua @@ -0,0 +1,46 @@ +AddCSLuaFile() + +EFFECT.Mat = { + Model("particle/particle_smokegrenade"), + Model("particle/particle_noisesphere") +} + +function EFFECT:Init( data ) + local pos = data:GetOrigin() + local duration = data:GetMagnitude() + local em = ParticleEmitter( pos ) + for i = 0, 20 do + local p = em:Add( self.Mat[math.random(#self.Mat)] , pos ) + if p then + p:SetColor(math.random(30,60), math.random(40,70), math.random(0,50)) + p:SetStartAlpha(255) + p:SetEndAlpha(150) + local vel = VectorRand() * math.Rand(40,70) + vel.z = 0 + p:SetVelocity(vel) + p:SetLifeTime(0) + + p:SetDieTime(math.Rand(duration + 0.75, duration + 1.5)) + + p:SetStartSize(math.random(45, 50)) + p:SetEndSize(math.random(20, 30)) + p:SetRoll(math.random(-180, 180)) + p:SetRollDelta(math.Rand(-0.1, 0.1)) + p:SetAirResistance(100) + + p:SetCollide(true) + p:SetBounce(0.4) + + p:SetLighting(false) + end + end + em:Finish() +end + +function EFFECT:Think() + return false +end + +function EFFECT:Render() + return false +end diff --git a/lua/entities/base_edit.lua b/lua/entities/base_edit.lua new file mode 100644 index 00000000..840396b4 --- /dev/null +++ b/lua/entities/base_edit.lua @@ -0,0 +1,49 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_anim" ) + +ENT.PrintName = "" +ENT.Author = "" +ENT.Contact = "" +ENT.Purpose = "" +ENT.Instructions = "" + +ENT.Spawnable = false +ENT.AdminOnly = false +ENT.Editable = true + +function ENT:Initialize() + + if ( CLIENT ) then return end + + self:SetModel( "models/MaxOfS2D/cube_tool.mdl" ) + self:PhysicsInit( SOLID_VPHYSICS ) + self:SetUseType( ONOFF_USE ) + +end + +function ENT:SpawnFunction( ply, tr, ClassName ) + + if ( !tr.Hit ) then return end + + local SpawnPos = tr.HitPos + tr.HitNormal * 10 + local SpawnAng = ply:EyeAngles() + SpawnAng.p = 0 + SpawnAng.y = SpawnAng.y + 180 + + local ent = ents.Create( ClassName ) + ent:SetPos( SpawnPos ) + ent:SetAngles( SpawnAng ) + ent:Spawn() + ent:Activate() + + return ent + +end + + +function ENT:EnableForwardArrow() + + self:SetBodygroup( 1, 1 ) + +end diff --git a/lua/entities/breakable_entry/shared.lua b/lua/entities/breakable_entry/shared.lua new file mode 100644 index 00000000..7cb44e30 --- /dev/null +++ b/lua/entities/breakable_entry/shared.lua @@ -0,0 +1,132 @@ +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(true) + end +end + +function ENT:SetupDataTables() + + self:NetworkVar( "Int", 0, "NumPlanks" ) + self:NetworkVar( "Bool", 0, "HasPlanks" ) + self:NetworkVar( "Bool", 1, "TriggerJumps" ) + +end + +function ENT:AddPlank(nosound) + if !self:GetHasPlanks() then return end + self:SpawnPlank() + self:SetNumPlanks( (self:GetNumPlanks() or 0) + 1 ) + if !nosound then + self:EmitSound("nz/effects/board_slam_0"..math.random(0,5)..".wav") + end +end + +function ENT:RemovePlank() + + local plank = table.Random(self.Planks) + if plank != nil then + table.RemoveByValue(self.Planks, plank) + self:SetNumPlanks( self:GetNumPlanks() - 1 ) + --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(nosoundoverride) + for i=1, GetConVar("nz_difficulty_barricade_planks_max"):GetInt() do + self:RemovePlank() + end + if self:GetHasPlanks() then + for i=1, GetConVar("nz_difficulty_barricade_planks_max"):GetInt() do + self:AddPlank(!nosoundoverride) + end + end +end + +function ENT:Use( activator, caller ) + if CurTime() > self.NextPlank then + if self:GetHasPlanks() and self:GetNumPlanks() < GetConVar("nz_difficulty_barricade_planks_max"):GetInt() then + self:AddPlank() + activator:GivePoints(10) + activator:EmitSound("nz/effects/repair_ching.wav") + self.NextPlank = CurTime() + 1 + end + end +end + +function ENT:SpawnPlank() + //Spawn + local angs = {-60,-70,60,70} + local plank = ents.Create("breakable_entry_plank") + local min = self:GetTriggerJumps() and 0 or -45 + plank:SetPos( self:GetPos()+Vector(0,0, math.random( min, 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 + +function ENT:Touch(ent) + if self:GetTriggerJumps() and self:GetNumPlanks() == 0 then + if ent.TriggerBarricadeJump then ent:TriggerBarricadeJump() end + end +end + +hook.Add("ShouldCollide", "zCollisionHook", function(ent1, ent2) + if ent1:GetClass() == "breakable_entry" and (nzConfig.ValidEnemies[ent2:GetClass()]) then + if IsValid(ent1) and !ent1:GetTriggerJumps() and ent1:GetNumPlanks() == 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 (nzConfig.ValidEnemies[ent1:GetClass()]) then + if IsValid(ent2) and !ent2:GetTriggerJumps() and ent2:GetNumPlanks() == 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 nzRound:InState( ROUND_CREATE ) then + self:DrawModel() + end + end +end diff --git a/nzombies3/entities/entities/breakable_entry_plank/shared.lua b/lua/entities/breakable_entry_plank/shared.lua similarity index 100% rename from nzombies3/entities/entities/breakable_entry_plank/shared.lua rename to lua/entities/breakable_entry_plank/shared.lua diff --git a/lua/entities/button_elec/shared.lua b/lua/entities/button_elec/shared.lua new file mode 100644 index 00000000..91c2b59f --- /dev/null +++ b/lua/entities/button_elec/shared.lua @@ -0,0 +1,57 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "button_elec" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "Switch" ) + +end + +function ENT:Initialize() + if SERVER then + self:SetModel( "models/MaxOfS2D/button_01.mdl" ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetUseType( ONOFF_USE ) + self:SetSwitch(false) + else + self.PosePosition = 0 + end +end + +function ENT:Use( activator ) + + if ( !activator:IsPlayer() ) then return end + if !IsElec() and nzRound:InProgress() then + self:SetSwitch(true) + nz.nzElec.Functions.Activate() + end + +end + +if CLIENT then + + function ENT:Think() + + local TargetPos = 0.0; + + if ( self:GetSwitch() ) then TargetPos = 1.0; end + + self.PosePosition = math.Approach( self.PosePosition, TargetPos, FrameTime() * 5.0 ) + + self:SetPoseParameter( "switch", self.PosePosition ) + self:InvalidateBoneCache() + + end + + function ENT:Draw() + self:DrawModel() + end +end \ No newline at end of file diff --git a/lua/entities/drop_bloodmoney/shared.lua b/lua/entities/drop_bloodmoney/shared.lua new file mode 100644 index 00000000..81c9a47c --- /dev/null +++ b/lua/entities/drop_bloodmoney/shared.lua @@ -0,0 +1,78 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "drop_powerups" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "Points" ) + +end + +function ENT:Initialize() + + self:SetModel("models/nzpowerups/bloodmoney.mdl") + --self:PhysicsInit(SOLID_VPHYSICS) + self:PhysicsInitSphere(50, "default_silent") + self:SetMoveType(MOVETYPE_NONE) + self:SetSolid(SOLID_NONE) + if SERVER then + self:SetTrigger(true) + self:SetUseType(SIMPLE_USE) + else + self.NextParticle = CurTime() + end + self:UseTriggerBounds(true, 0) + self:SetMaterial("models/shiny.vtf") + self:SetColor( Color(255,200,0) ) + --self:SetTrigger(true) + + timer.Create( self:EntIndex().."_deathtimer", 30, 1, function() + if IsValid(self) then + timer.Destroy(self:EntIndex().."_deathtimer") + if SERVER then + self:Remove() + end + end + end) +end + +if SERVER then + function ENT:StartTouch(hitEnt) + if (hitEnt:IsValid() and hitEnt:IsPlayer()) then + hitEnt:GivePoints(self:GetPoints()) + self:Remove() + end + end +end + +if CLIENT then + --local glow = Material ( "sprites/glow04_noz" ) + --local col = Color(0,200,255,255) + + local particledelay = 0.1 + + function ENT:Draw() + if CurTime() > self.NextParticle then + local effectdata = EffectData() + effectdata:SetOrigin( self:GetPos() ) + util.Effect( "powerup_glow", effectdata ) + self.NextParticle = CurTime() + particledelay + end + self:DrawModel() + end + + function ENT:Think() + if !self:GetRenderAngles() then self:SetRenderAngles(self:GetAngles()) end + self:SetRenderAngles(self:GetRenderAngles()+(Angle(0,50,0)*FrameTime())) + end + + --[[hook.Add( "PreDrawHalos", "drop_powerups_halos", function() + halo.Add( ents.FindByClass( "drop_powerup" ), Color( 0, 255, 0 ), 2, 2, 2 ) + end )]] +end \ No newline at end of file diff --git a/lua/entities/drop_powerup/shared.lua b/lua/entities/drop_powerup/shared.lua new file mode 100644 index 00000000..54f7453d --- /dev/null +++ b/lua/entities/drop_powerup/shared.lua @@ -0,0 +1,80 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "drop_powerups" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "PowerUp" ) + +end + +function ENT:Initialize() + + //self:SetPowerUp("dp") + self:SetModelScale(nzPowerUps:Get(self:GetPowerUp()).scale, 0) + + --self:PhysicsInit(SOLID_VPHYSICS) + self:PhysicsInitSphere(50, "default_silent") + self:SetMoveType(MOVETYPE_NONE) + self:SetSolid(SOLID_NONE) + if SERVER then + self:SetTrigger(true) + self:SetUseType(SIMPLE_USE) + else + self.NextParticle = CurTime() + end + self:UseTriggerBounds(true, 0) + self:SetMaterial("models/shiny.vtf") + self:SetColor( Color(255,200,0) ) + --self:SetTrigger(true) + + timer.Create( self:EntIndex().."_deathtimer", 30, 1, function() + if IsValid(self) then + timer.Destroy(self:EntIndex().."_deathtimer") + if SERVER then + self:Remove() + end + end + end) +end + +if SERVER then + function ENT:StartTouch(hitEnt) + if (hitEnt:IsValid() and hitEnt:IsPlayer()) then + nzPowerUps:Activate(self:GetPowerUp(), hitEnt) + self:Remove() + end + end +end + +if CLIENT then + --local glow = Material ( "sprites/glow04_noz" ) + --local col = Color(0,200,255,255) + + local particledelay = 0.1 + + function ENT:Draw() + if CurTime() > self.NextParticle then + local effectdata = EffectData() + effectdata:SetOrigin( self:GetPos() ) + util.Effect( "powerup_glow", effectdata ) + self.NextParticle = CurTime() + particledelay + end + self:DrawModel() + end + + function ENT:Think() + if !self:GetRenderAngles() then self:SetRenderAngles(self:GetAngles()) end + self:SetRenderAngles(self:GetRenderAngles()+(Angle(0,50,0)*FrameTime())) + end + + --[[hook.Add( "PreDrawHalos", "drop_powerups_halos", function() + halo.Add( ents.FindByClass( "drop_powerup" ), Color( 0, 255, 0 ), 2, 2, 2 ) + end )]] +end \ No newline at end of file diff --git a/lua/entities/drop_tombstone/shared.lua b/lua/entities/drop_tombstone/shared.lua new file mode 100644 index 00000000..5b547032 --- /dev/null +++ b/lua/entities/drop_tombstone/shared.lua @@ -0,0 +1,89 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "drop_tombstone" +ENT.Author = "Zet0r" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "Entity", 0, "PerkOwner" ) + +end + +function ENT:Initialize() + + self:SetModel("models/props_c17/gravestone003a.mdl") + + --self:PhysicsInit(SOLID_VPHYSICS) + self:PhysicsInitSphere(50, "default_silent") + self:SetMoveType(MOVETYPE_NONE) + self:SetSolid(SOLID_NONE) + if SERVER then + self:SetTrigger(true) + end + self:UseTriggerBounds(true, 0) + self:DrawShadow(false) + self:SetMaterial("models/shiny.vtf") + self:SetColor( Color(255,200,0) ) + + self.OwnerData = {} + + if SERVER then + self:SetUseType(SIMPLE_USE) + end + + timer.Create( self:EntIndex().."_deathtimer", 100, 1, function() + if self:IsValid() then + timer.Destroy(self:EntIndex().."_deathtimer") + if SERVER then + self:Remove() + end + end + end) +end + +if SERVER then + function ENT:StartTouch(hitEnt) + --print("Collided") + if (hitEnt:IsValid() and hitEnt:IsPlayer() and hitEnt == self:GetPerkOwner()) then + --PrintTable(self.OwnerData) + + -- Weapons are completely replaced + ply:StripWeapons() + for k,v in pairs(self.OwnerData.weps) do + local wep = hitEnt:Give(v.class) + if v.pap then + nz.Weps.Functions.ApplyPaP( hitEnt, wep ) + end + end + for k,v in pairs(self.OwnerData.perks) do + if v != "tombstone" then + hitEnt:GivePerk(v) + end + end + nz.Weps.Functions.GiveMaxAmmo(hitEnt) + + timer.Destroy(self:EntIndex().."_deathtimer") + self:Remove() + end + end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end + + function ENT:Think() + if !self:GetRenderAngles() then self:SetRenderAngles(self:GetAngles()) end + self:SetRenderAngles(self:GetRenderAngles()+(Angle(0,50,0)*FrameTime())) + end + + hook.Add( "PreDrawHalos", "drop_powerups_halos", function() + halo.Add( ents.FindByClass( "drop_powerup" ), Color( 0, 255, 0 ), 2, 2, 2 ) + end ) +end \ No newline at end of file diff --git a/lua/entities/drop_vulture/shared.lua b/lua/entities/drop_vulture/shared.lua new file mode 100644 index 00000000..cb4cb0dc --- /dev/null +++ b/lua/entities/drop_vulture/shared.lua @@ -0,0 +1,142 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "drop_vulture" +ENT.Author = "Zet0r" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "DropType" ) + +end + +local vulturedrops = { + ["points"] = { + id = "points", + model = Model("models/props_junk/garbage_bag001a.mdl"), + effect = function(ply) + ply:GivePoints(math.random(5,20)) + return true + end, + timer = 30, + draw = function(self) + self:DrawModel() + end, + initialize = function(self) + + end, + }, + ["ammo"] = { + id = "ammo", + model = Model("models/items/357ammo.mdl"), + effect = function(ply) + local wep = ply:GetActiveWeapon() + if IsValid(wep) then + local max = nz.Weps.Functions.CalculateMaxAmmo(wep:GetClass()) + local give = max/math.Rand(9,11) + local ammo = wep.Primary.Ammo + local cur = ply:GetAmmoCount(ammo) + + --print(give, max, cur) + + if cur + give > max then give = max - cur end + if give <= 0 then return false end + ply:GiveAmmo(give, ammo) + return true + end + end, + timer = 30, + draw = function(self) + self:DrawModel() + end, + initialize = function(self) + + end, + }, + ["gas"] = { + id = "gas", + model = Model(""), + effect = function(ply) + ply:SetTargetPriority(TARGET_PRIORITY_NONE) + timer.Simple(3, function() + if IsValid(ply) then + ply:SetDefaultTargetPriority() + end + end) + end, + timer = 5, + draw = function(self) + + end, + initialize = function(self) + local sfx = EffectData() + sfx:SetOrigin(self:GetPos()) + util.Effect("vulture_gascloud",sfx) + end, + }, +} + +function ENT:Initialize() + + -- Random chance of any + if SERVER then + self:SetDropType(table.Random(vulturedrops).id) + end + self:SetModel(vulturedrops[self:GetDropType()].model) + + self:PhysicsInitSphere(50, "default_silent") + self:SetMoveType(MOVETYPE_NONE) + self:SetSolid(SOLID_NONE) + if SERVER then + self:SetTrigger(true) + self:SetUseType(SIMPLE_USE) + end + self:UseTriggerBounds(true, 0) + self:SetMaterial("models/shiny.vtf") + self:SetColor( Color(255,200,0) ) + self:DrawShadow(false) + self.DeathTimer = 30 + + timer.Create( self:EntIndex().."_deathtimer", vulturedrops[self:GetDropType()].timer, 1, function() + if IsValid(self) then + timer.Destroy(self:EntIndex().."_deathtimer") + if SERVER then + self:Remove() + end + end + end) + + vulturedrops[self:GetDropType()].initialize(self) +end + +if SERVER then + function ENT:StartTouch(hitEnt) + if (hitEnt:IsValid() and hitEnt:IsPlayer()) then + if hitEnt:HasPerk("vulture") then + -- The return value indicate whether to consume the drop or not + if vulturedrops[self:GetDropType()].effect(hitEnt) then + self:Remove() + end + end + end + end +end + +if CLIENT then + function ENT:Draw() + vulturedrops[self:GetDropType()].draw(self) + end + + function ENT:Think() + if !self:GetRenderAngles() then self:SetRenderAngles(self:GetAngles()) end + self:SetRenderAngles(self:GetRenderAngles()+(Angle(0,50,0)*FrameTime())) + end + + hook.Add( "PreDrawHalos", "drop_powerups_halos", function() + halo.Add( ents.FindByClass( "drop_powerup" ), Color( 0, 255, 0 ), 2, 2, 2 ) + end ) +end diff --git a/lua/entities/easter_egg/shared.lua b/lua/entities/easter_egg/shared.lua new file mode 100644 index 00000000..2fc48f6a --- /dev/null +++ b/lua/entities/easter_egg/shared.lua @@ -0,0 +1,34 @@ +ENT.Type = "anim" + +ENT.PrintName = "easter_egg" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + + +AddCSLuaFile() + + + +function ENT:Initialize() + + self:SetModel( "models/props_lab/huladoll.mdl" ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + self.Used = false + if SERVER then + self:SetUseType(SIMPLE_USE) + end +end + +function ENT:Use( activator, caller ) + if !self.Used and nzRound:InProgress() then + nzEE:ActivateEgg( self ) + end +end + +function ENT:Draw() + self:DrawModel() +end diff --git a/lua/entities/edit_color.lua b/lua/entities/edit_color.lua new file mode 100644 index 00000000..af3a40ff --- /dev/null +++ b/lua/entities/edit_color.lua @@ -0,0 +1,84 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_edit" ) + +ENT.Spawnable = true +ENT.AdminOnly = true + +ENT.PrintName = "Color Correction Editor" +ENT.Category = "Editors" + +function ENT:Initialize() + + BaseClass.Initialize( self ) + + --self:SetMaterial( Material("gmod/demo.png", "noclamp smooth") ) + + -- There can only be one! + if IsValid(ents.FindByClass("edit_color")[1]) and ents.FindByClass("edit_color")[1] != self then ents.FindByClass("edit_color")[1]:Remove() end + + if ( CLIENT ) then + hook.Add( "RenderScreenspaceEffects", self, self.DrawColorCorretion ) + end + +end + +function ENT:SetupDataTables() + + self:NetworkVar( "Float", 0, "AddRed", { KeyName = "addred", Edit = { type = "Float", min = -1, max = 1, order = 1 } } ); + self:NetworkVar( "Float", 1, "AddGreen", { KeyName = "addgreen", Edit = { type = "Float", min = -1, max = 1, order = 2 } } ); + self:NetworkVar( "Float", 2, "AddBlue", { KeyName = "addblue", Edit = { type = "Float", min = -1, max = 1, order = 3 } } ); + + self:NetworkVar( "Float", 3, "Brightness", { KeyName = "brightness", Edit = { type = "Float", min = -2, max = 2, order = 4 } } ); + self:NetworkVar( "Float", 4, "Contrast", { KeyName = "contrast", Edit = { type = "Float", min = 0, max = 2, order = 5 } } ); + self:NetworkVar( "Float", 5, "Colour", { KeyName = "colour", Edit = { type = "Float", min = -10, max = 10, order = 6 } } ); + + self:NetworkVar( "Float", 6, "MulRed", { KeyName = "mulred", Edit = { type = "Float", min = -1, max = 1, order = 7 } } ); + self:NetworkVar( "Float", 7, "MulGreen", { KeyName = "mulgreen", Edit = { type = "Float", min = -1, max = 1, order = 8 } } ); + self:NetworkVar( "Float", 8, "MulBlue", { KeyName = "mulblue", Edit = { type = "Float", min = -1, max = 1, order = 9 } } ); + + -- + -- TODO: Should skybox fog be edited seperately? + -- + + if ( SERVER ) then + + -- defaults + self:SetAddRed( 0.0 ) + self:SetAddGreen( 0.0 ) + self:SetAddBlue( 0.05 ) + + self:SetBrightness( 0 ) + self:SetContrast( 1.2 ) + self:SetColour( 2 ) + + self:SetMulRed( 0 ) + self:SetMulGreen( 0 ) + self:SetMulBlue( 0.02 ) + + end + +end + +function ENT:DrawColorCorretion() + local tbl = { + [ "$pp_colour_addr" ] = self:GetAddRed(), + [ "$pp_colour_addg" ] = self:GetAddGreen(), + [ "$pp_colour_addb" ] = self:GetAddGreen(), + [ "$pp_colour_brightness" ] = self:GetBrightness(), + [ "$pp_colour_contrast" ] = self:GetContrast(), + [ "$pp_colour_colour" ] = self:GetColour(), + [ "$pp_colour_mulr" ] = self:GetMulRed(), + [ "$pp_colour_mulg" ] = self:GetMulGreen(), + [ "$pp_colour_mulb" ] = self:GetMulBlue() + } + + DrawColorModify(tbl) +end + +-- +-- This edits something global - so always network - even when not in PVS +-- +function ENT:UpdateTransmitState() + return TRANSMIT_ALWAYS +end diff --git a/lua/entities/edit_dynlight.lua b/lua/entities/edit_dynlight.lua new file mode 100644 index 00000000..2e956fda --- /dev/null +++ b/lua/entities/edit_dynlight.lua @@ -0,0 +1,110 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_edit" ) + +ENT.Spawnable = true +ENT.AdminOnly = true + +ENT.PrintName = "Dynamic Light" +ENT.Category = "Editors" + +function ENT:Initialize() + + BaseClass.Initialize( self ) + + --self:SetMaterial( Material("gmod/demo.png", "noclamp smooth") ) + + local Radius = 6 + local min = Vector( 1, 1, 1 ) * Radius * -0.5 + local max = Vector( 1, 1, 1 ) * Radius * 0.5 + + if ( SERVER ) then + + self:SetModel( "models/props_junk/watermelon01.mdl" ) + + -- Don't use the model's physics - create a box instead + self:PhysicsInitBox( min, max ) + + -- Set up our physics object here + local phys = self:GetPhysicsObject() + if ( IsValid( phys ) ) then + phys:Wake() + phys:EnableGravity( false ) + phys:EnableDrag( false ) + end + + self:DrawShadow( false ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + + else + + self.GripMaterial = Material( "sprites/grip" ) + + -- Get the attached entity so that clientside functions like properties can interact with it + local tab = ents.FindByClassAndParent( "prop_dynamic", self ) + if ( tab && IsValid( tab[ 1 ] ) ) then self.AttachedEntity = tab[ 1 ] end + + end + +end + +function ENT:SetupDataTables() + + self:NetworkVar( "Int", 0, "Brightness", { KeyName = "brightness", Edit = { type = "Int", min = 0, max = 5, order = 1 } } ) + self:NetworkVar( "Vector", 0, "LightColor", { KeyName = "color", Edit = { type = "VectorColor", order = 2 } } ) + self:NetworkVar( "Int", 1, "Size", { KeyName = "size", Edit = { type = "Int", min = 0, max = 1000, order = 3 } } ) + + self:NetworkVar( "Int", 0, "Style", { KeyName = "style", Edit = { type = "Int", min = 0, max = 12, order = 4 } } ) + + if ( SERVER ) then + + -- defaults + self:SetLightColor( Vector(1, 1, 1) ) -- White + self:SetBrightness( 2 ) + self:SetSize(256) + self:SetStyle(0) -- Standard bright all the time + + end + +end + +if CLIENT then + function ENT:Draw() + local size = self:GetSize() + if !self.LightSize or self.LightSize != size then + self:SetRenderBounds(Vector(-size, -size, -size), Vector(size, size, size)) + self.LightSize = size + end + local color = self:GetLightColor() * 255 + local brightness = self:GetBrightness() + local style = self:GetStyle() + local dlight = DynamicLight( self:EntIndex() ) + if ( dlight ) then + dlight.pos = self:GetPos() + dlight.r = color[1] + dlight.g = color[2] + dlight.b = color[3] + dlight.brightness = brightness + dlight.Decay = 1000 + dlight.Size = size + dlight.DieTime = CurTime() + 1 + dlight.Style = style + end + + if !Round:InState( ROUND_CREATE ) then return end + + -- Don't draw the grip if there's no chance of us picking it up + local ply = LocalPlayer() + local wep = ply:GetActiveWeapon() + if ( !IsValid( wep ) ) then return end + + local weapon_name = wep:GetClass() + + if ( weapon_name != "weapon_physgun" && weapon_name != "weapon_physcannon" && weapon_name != "gmod_tool" ) then + return + end + + render.SetMaterial( self.GripMaterial ) + render.DrawSprite( self:GetPos(), 16, 16, color_white ) + end +end diff --git a/lua/entities/edit_fog.lua b/lua/entities/edit_fog.lua new file mode 100644 index 00000000..e2d6c613 --- /dev/null +++ b/lua/entities/edit_fog.lua @@ -0,0 +1,56 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_edit" ) + +ENT.Spawnable = true +ENT.AdminOnly = true + +ENT.PrintName = "Fog Editor" +ENT.Category = "Editors" + +function ENT:Initialize() + + BaseClass.Initialize( self ) + + self:SetMaterial( "gmod/edit_fog" ) + + -- There can only be one! + if IsValid(ents.FindByClass("edit_fog")[1]) and ents.FindByClass("edit_fog")[1] != self then ents.FindByClass("edit_fog")[1]:Remove() end + + if ( CLIENT ) then + nzRound:EnableSpecialFog( false ) + end + +end + +function ENT:SetupDataTables() + + self:NetworkVar( "Float", 0, "FogStart", { KeyName = "fogstart", Edit = { type = "Float", min = 0, max = 100000, order = 1 } } ); + self:NetworkVar( "Float", 1, "FogEnd", { KeyName = "fogend", Edit = { type = "Float", min = 0, max = 100000, order = 2 } } ); + self:NetworkVar( "Float", 2, "Density", { KeyName = "density", Edit = { type = "Float", min = 0, max = 1, order = 3 } } ); + + self:NetworkVar( "Vector", 0, "FogColor", { KeyName = "fogcolor", Edit = { type = "VectorColor", order = 3 } } ); + + -- + -- TODO: Should skybox fog be edited seperately? + -- + + if ( SERVER ) then + + -- defaults + self:SetFogStart( 0.0 ) + self:SetFogEnd( 10000 ) + self:SetDensity( 0.9 ) + self:SetFogColor( Vector( 0.6, 0.7, 0.8 ) ) + + end + +end + +-- +-- This edits something global - so always network - even when not in PVS +-- +function ENT:UpdateTransmitState() + + return TRANSMIT_ALWAYS +end diff --git a/lua/entities/edit_fog_special.lua b/lua/entities/edit_fog_special.lua new file mode 100644 index 00000000..59f378ca --- /dev/null +++ b/lua/entities/edit_fog_special.lua @@ -0,0 +1,58 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_edit" ) + +ENT.Spawnable = false +ENT.AdminOnly = false + +ENT.PrintName = "Fog Editor for Special Rounds" +ENT.Category = "Editors" + +function ENT:Initialize() + + BaseClass.Initialize( self ) + + self:SetMaterial( "gmod/edit_fog" ) + + -- There can only be one! + if IsValid(ents.FindByClass("edit_fog_special")[1]) and ents.FindByClass("edit_fog_special")[1] != self then ents.FindByClass("edit_fog_special")[1]:Remove() end + + if ( CLIENT ) then + if nzRound:InState( ROUND_CREATE ) or nzRound:IsSpecial() then + --self:HookFogHooks() + end + end + +end + +function ENT:SetupDataTables() + + self:NetworkVar( "Float", 0, "FogStart", { KeyName = "fogstart", Edit = { type = "Float", min = 0, max = 100000, order = 1 } } ); + self:NetworkVar( "Float", 1, "FogEnd", { KeyName = "fogend", Edit = { type = "Float", min = 0, max = 100000, order = 2 } } ); + self:NetworkVar( "Float", 2, "Density", { KeyName = "density", Edit = { type = "Float", min = 0, max = 1, order = 3 } } ); + + self:NetworkVar( "Vector", 0, "FogColor", { KeyName = "fogcolor", Edit = { type = "VectorColor", order = 3 } } ); + + -- + -- TODO: Should skybox fog be edited seperately? + -- + + if ( SERVER ) then + + -- defaults + self:SetFogStart( 0.0 ) + self:SetFogEnd( 10000 ) + self:SetDensity( 0.9 ) + self:SetFogColor( Vector( 0.6, 0.7, 0.8 ) ) + + end + +end + +-- +-- This edits something global - so always network - even when not in PVS +-- +function ENT:UpdateTransmitState() + + return TRANSMIT_ALWAYS +end diff --git a/lua/entities/edit_sky.lua b/lua/entities/edit_sky.lua new file mode 100644 index 00000000..e2e5d182 --- /dev/null +++ b/lua/entities/edit_sky.lua @@ -0,0 +1,100 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_edit" ) + +ENT.Spawnable = true +ENT.AdminOnly = true + +ENT.PrintName = "Sky Editor" +ENT.Category = "Editors" + +local oldsky + +function ENT:Initialize() + + BaseClass.Initialize( self ) + self:SetMaterial( "gmod/edit_sky" ) + + + + -- + -- Over-ride the sky controller with this. + -- + if ( CLIENT ) then + + if ( IsValid( g_SkyPaint ) ) then + -- TODO: Copy settings from `current` sky to here. + end + + g_SkyPaint = self + else + + if !oldsky then oldsky = GetConVar("sv_skyname"):GetString() end + print(oldsky) + RunConsoleCommand("sv_skyname", "painted") + if !IsValid(ents.FindByClass("env_skypaint")[1]) then + local ent = ents.Create("env_skypaint") + ent:Spawn() + end + + end + +end + +function ENT:Think() + + -- + -- Find an env_sun - if we don't already have one. + -- + if ( SERVER && self.EnvSun == nil ) then + + -- so this closure only gets called once - even if it fails + self.EnvSun = false; + + local list = ents.FindByClass( "env_sun" ) + if ( #list > 0 ) then + self.EnvSun = list[1] + end + + end + + -- + -- If we have a sun - force our sun normal to its value + -- + if ( SERVER && IsValid( self.EnvSun ) ) then + + local vec = self.EnvSun:GetInternalVariable( "m_vDirection" ); + + if ( isvector( vec ) ) then + self:SetSunNormal( vec ) + end + + end + +end + +-- +-- This needs to be a 1:1 copy of env_skypaint +-- +function ENT:SetupDataTables() + + local SetupDataTables = scripted_ents.GetMember( "env_skypaint", "SetupDataTables" ) + SetupDataTables( self ) + +end + +function ENT:OnRemove() + if SERVER then + if oldsky and #ents.FindByClass("edit_sky") <= 0 then + RunConsoleCommand("sv_skyname", oldsky) + end + end +end + +-- +-- This edits something global - so always network - even wjen not in PVS +-- +function ENT:UpdateTransmitState() + + return TRANSMIT_ALWAYS +end diff --git a/lua/entities/edit_sun.lua b/lua/entities/edit_sun.lua new file mode 100644 index 00000000..7747105e --- /dev/null +++ b/lua/entities/edit_sun.lua @@ -0,0 +1,102 @@ + +AddCSLuaFile() +DEFINE_BASECLASS( "base_edit" ) + +ENT.Spawnable = true +ENT.AdminOnly = true + +ENT.PrintName = "Sun Editor" +ENT.Category = "Editors" + +function ENT:Initialize() + + BaseClass.Initialize( self ) + self:EnableForwardArrow() + + self:SetMaterial( "gmod/edit_sun" ) + + if ( SERVER ) then + + -- + -- Notify us when the entity angle changes, so we can update the sun entity + -- + self:AddCallback( "OnAngleChange", self.OnAngleChange ) + + + -- + -- Find an env_sun entity + -- + local list = ents.FindByClass( "env_sun" ) + if ( #list > 0 ) then + self.EnvSun = list[1] + end + + end + +end + +function ENT:SetupDataTables() + + self:NetworkVar( "Float", 0, "SunSize", { KeyName = "sunsize", Edit = { type = "Float", min = 0, max = 100, order = 1 } } ); + self:NetworkVar( "Float", 1, "OverlaySize", { KeyName = "overlaysize", Edit = { type = "Float", min = 0, max = 200, order = 2 } } ); + self:NetworkVar( "Vector", 0, "SunColor", { KeyName = "suncolor", Edit = { type = "VectorColor", order = 3 } } ); + self:NetworkVar( "Vector", 1, "OverlayColor", { KeyName = "overlaycolor", Edit = { type = "VectorColor", order = 4 } } ); + + + + if ( SERVER ) then + + -- defaults + self:SetSunSize( 20 ) + self:SetOverlaySize( 20 ) + self:SetOverlayColor( Vector( 1, 1, 1 ) ) + self:SetSunColor( Vector( 1, 1, 1 ) ) + + -- call this function when something changes these variables + self:NetworkVarNotify( "SunSize", self.OnVariableChanged ); + self:NetworkVarNotify( "OverlaySize", self.OnVariableChanged ); + self:NetworkVarNotify( "SunColor", self.OnVariableChanged ); + self:NetworkVarNotify( "OverlayColor", self.OnVariableChanged ); + + end + +end + +-- +-- Callback - serverside - added in :Initialize +-- +function ENT:OnAngleChange( newang ) + + if ( IsValid( self.EnvSun ) ) then + self.EnvSun:SetKeyValue( "sun_dir", tostring( newang:Forward() ) ); + end + +end + + +-- +-- Update all the variables on the sun, from our variables in this entity +-- +function ENT:OnVariableChanged() + + if ( !IsValid( self.EnvSun ) ) then return end + + self.EnvSun:SetKeyValue( "size", self:GetSunSize() ); + self.EnvSun:SetKeyValue( "overlaysize", self:GetOverlaySize() ); + + local vec = self:GetOverlayColor() + self.EnvSun:SetKeyValue( "overlaycolor", Format( "%i %i %i", vec.x * 255, vec.y * 255, vec.z * 255 ) ); + + local vec = self:GetSunColor() + self.EnvSun:SetKeyValue( "suncolor", Format( "%i %i %i", vec.x * 255, vec.y * 255, vec.z * 255 ) ); + + +end + +-- +-- This edits something global - so always network - even when not in PVS +-- +function ENT:UpdateTransmitState() + + return TRANSMIT_ALWAYS +end diff --git a/lua/entities/invis_wall/shared.lua b/lua/entities/invis_wall/shared.lua new file mode 100644 index 00000000..c000da40 --- /dev/null +++ b/lua/entities/invis_wall/shared.lua @@ -0,0 +1,40 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "invis_wall" +ENT.Author = "Zet0r" +ENT.Contact = "youtube.com/Zet0r" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + -- Min bound is for now just the position + --self:NetworkVar("Vector", 0, "MinBound") + self:NetworkVar("Vector", 0, "MaxBound") +end + +function ENT:Initialize() + --self:SetMoveType( MOVETYPE_NONE ) + self:DrawShadow( false ) + self:SetRenderMode( RENDERMODE_TRANSCOLOR ) + --self:SetCustomCollisionCheck(true) + --self:SetFilter(true, true) +end + + +if not ConVarExists("nz_drawinviswalls") then CreateClientConVar("nz_drawinviswalls", "1") end + +local mat = Material("color") +local white = Color(255,150,0,30) + +if CLIENT then + function ENT:Draw() + if ConVarExists("nz_drawinviswalls") and GetConVar("nz_drawinviswalls"):GetBool() and nzRound:InState( ROUND_CREATE ) then + cam.Start3D() + render.SetMaterial(mat) + render.DrawBox(self:GetPos(), self:GetAngles(), Vector(0,0,0), self:GetMaxBound(), white, true) + cam.End3D() + end + end +end diff --git a/lua/entities/nz_electricity.lua b/lua/entities/nz_electricity.lua new file mode 100644 index 00000000..a892e716 --- /dev/null +++ b/lua/entities/nz_electricity.lua @@ -0,0 +1,27 @@ + +ENT.Type = "point" +ENT.Base = "base_point" + +-- An entity to be used in Hammer that can turn the electricity on or off, and will fire outputs when this happens. +-- To use it, grab the nzombies.fgd from the gamemode and import it into Hammer. + +function ENT:Initialize() + -- Calling this when the entity is created so you can turn off the lights only if the gamemode is nZombies. + if engine.ActiveGamemode() == "nzombies3" then + self:TriggerOutput("OnInitialized", self) + end +end + +function ENT:KeyValue(k, v) + +end + +function ENT:AcceptInput(name, activator, caller, data) + if name == "TurnElectricityOn" then + nzElec:Activate(data == "1") + return true + elseif name == "TurnElectricityOff" then + nzElec:Reset(data == "1") + return true + end +end \ No newline at end of file diff --git a/lua/entities/nz_fire_effect.lua b/lua/entities/nz_fire_effect.lua new file mode 100644 index 00000000..b9c30041 --- /dev/null +++ b/lua/entities/nz_fire_effect.lua @@ -0,0 +1,168 @@ + +AddCSLuaFile() +ENT.Type = "anim" + +ENT.PrintName = "" +ENT.Author = "" +ENT.Contact = "" +ENT.Purpose = "" +ENT.Instructions = "" +ENT.Spawnable = false +ENT.AdminOnly = false +ENT.Editable = false + +ENT.PrintName = "Fire Effect" +ENT.Category = "Editors" + +function ENT:Initialize() + + --BaseClass.Initialize( self ) + + //Set it up just like a prop_effect + local Radius = 6 + local min = Vector( 1, 1, 1 ) * Radius * -0.5 + local max = Vector( 1, 1, 1 ) * Radius * 0.5 + + if ( SERVER ) then + + self:SetModel( "models/props_junk/watermelon01.mdl" ) + + -- Don't use the model's physics - create a box instead + self:PhysicsInitBox( min, max ) + + -- Set up our physics object here + local phys = self:GetPhysicsObject() + if ( IsValid( phys ) ) then + phys:Wake() + phys:EnableGravity( false ) + phys:EnableDrag( false ) + end + + self:CreateFire() + + self:DrawShadow( false ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + + else + + self.GripMaterial = Material( "sprites/grip" ) + + -- Get the attached entity so that clientside functions like properties can interact with it + local tab = ents.FindByClassAndParent( "prop_dynamic", self ) + if ( tab && IsValid( tab[ 1 ] ) ) then self.AttachedEntity = tab[ 1 ] end + + end + + -- Set collision bounds exactly + self:SetCollisionBounds( min, max ) + +end + +function ENT:CreateFire() + self.FireEffect = ents.Create("env_fire") + self.FireEffect:SetPos( self:GetPos() ) + self.FireEffect:SetParent( self ) + self.FireEffect:Spawn() + self.FireEffect:Activate() + self.FireEffect:Fire("StartFire") + self.FireEffect:SetKeyValue("spawnflags", "1") + --print(self.FireEffect) +end + +function ENT:Draw() + + if !nzRound:InState( ROUND_CREATE ) then return end + + -- Don't draw the grip if there's no chance of us picking it up + local ply = LocalPlayer() + local wep = ply:GetActiveWeapon() + if ( !IsValid( wep ) ) then return end + + local weapon_name = wep:GetClass() + + if ( weapon_name != "weapon_physgun" && weapon_name != "weapon_physcannon" && weapon_name != "gmod_tool" ) then + return + end + + render.SetMaterial( self.GripMaterial ) + render.DrawSprite( self:GetPos(), 16, 16, color_white ) + +end + +function ENT:PhysicsUpdate( physobj ) + + if ( CLIENT ) then return end + + -- Don't do anything if the player isn't holding us + if ( !self:IsPlayerHolding() && !self:IsConstrained() ) then + + physobj:SetVelocity( Vector( 0, 0, 0 ) ) + physobj:Sleep() + + end + +end + +if SERVER then + hook.Add("PostCleanupMap", "RestoreFireEffects", function() + for k,v in pairs(ents.FindByClass("nz_fire_effect")) do + v:CreateFire() + end + end) +end + + + // Doesn't work :( +--[[function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "On", { KeyName = "on", Edit = { type = "Boolean", order = 1 } } ); + self:NetworkVar( "Int", 0, "Size", { KeyName = "size", Edit = { type = "Int", min = 0, max = 1000, order = 2 } } ); + self:NetworkVar( "Float", 0, "DmgMultiplier", { KeyName = "dmgmultiplier", Edit = { type = "Float", min = 0, max = 10, order = 3 } } ); + self:NetworkVar( "Bool", 1, "Glow", { KeyName = "glow", Edit = { type = "Boolean", order = 4 } } ); + self:NetworkVar( "Bool", 2, "Smoke", { KeyName = "smoke", Edit = { type = "Boolean", order = 5 } } ); + + self:SetOn(true) + self:SetGlow(true) + self:SetSmoke(true) + + if SERVER then + self:NetworkVarNotify( "Glow", self.OnVarChanged ) + self:NetworkVarNotify( "DmgMultiplier", self.OnVarChanged ) + self:NetworkVarNotify( "Size", self.OnVarChanged ) + self:NetworkVarNotify( "On", self.OnVarChanged ) + self:NetworkVarNotify( "Smoke", self.OnVarChanged ) + end + +end + +function ENT:OnVarChanged(name, old, new) + if name == "On" then + if new then + self.FireEffect:Fire("StartFire") + else + self.FireEffect:Fire("Extinguish") + end + elseif name == "Size" then + self.FireEffect:SetKeyValue("firesize", tostring(new)) + elseif name == "DmgMultiplier" then + self.FireEffect:SetKeyValue("damage scale", tostring(new)) + elseif name == "Glow" then + if new then + self:SetKeyValue("spawnflags", tostring(1 + 32 + (!self:GetSmoke() and 2 or 0))) + else + self:SetKeyValue("spawnflags", tostring(1 + (!self:GetSmoke() and 2 or 0))) + end + elseif name == "Smoke" then + if new then + self:SetKeyValue("spawnflags", tostring(1 + 2 + (!self:GetGlow() and 32 or 0))) + print(1 + 2 + (!self:GetGlow() and 32 or 0)) + else + self:SetKeyValue("spawnflags", tostring(1 + (!self:GetGlow() and 32 or 0))) + end + end +end]] + +function ENT:UpdateTransmitState() + return TRANSMIT_PVS +end + diff --git a/lua/entities/nz_fraggrenade.lua b/lua/entities/nz_fraggrenade.lua new file mode 100644 index 00000000..bccdb378 --- /dev/null +++ b/lua/entities/nz_fraggrenade.lua @@ -0,0 +1,72 @@ +ENT.Type = "anim" +ENT.Base = "base_entity" +ENT.PrintName = "Frag Grenade" +ENT.Author = "Zet0r" + +ENT.Spawnable = false +ENT.AdminSpawnable = false + +if SERVER then + AddCSLuaFile("nz_fraggrenade.lua") +end + +function ENT:Initialize() + if SERVER then + self:SetModel("models/weapons/w_eq_fraggrenade_thrown.mdl") + self:PhysicsInitSphere(2, "metal_bouncy") + self:SetMoveType(MOVETYPE_VPHYSICS) + self:SetCollisionGroup(COLLISION_GROUP_NONE) + self:SetSolid(SOLID_VPHYSICS) + phys = self:GetPhysicsObject() + + if phys and phys:IsValid() then + phys:Wake() + end + end +end + + +function ENT:PhysicsCollide(data, physobj) + if SERVER then + local vel = physobj:GetVelocity():Length() + if vel > 100 then + self:EmitSound("weapons/hegrenade/he_bounce-1.wav", 75, 100) + end + + local LastSpeed = math.max( data.OurOldVelocity:Length(), data.Speed ) + local NewVelocity = physobj:GetVelocity() + NewVelocity:Normalize() + + LastSpeed = math.max( NewVelocity:Length(), LastSpeed ) + + local TargetVelocity = NewVelocity * LastSpeed * 0.6 + + physobj:SetVelocity( TargetVelocity ) + self:SetLocalAngularVelocity( AngleRand() ) + end +end + +function ENT:SetExplosionTimer( time ) + + SafeRemoveEntityDelayed( self, time +1 ) --fallback + + timer.Simple(time, function() + if IsValid(self) then + local pos = self:GetPos() + local owner = self:GetOwner() + + util.BlastDamage(self, owner, pos, 400, 150) + + fx = EffectData() + fx:SetOrigin(pos) + fx:SetMagnitude(1) + util.Effect("Explosion", fx) + + self:Remove() + end + end) +end + +function ENT:Draw() + self:DrawModel() +end diff --git a/lua/entities/nz_monkeybomb.lua b/lua/entities/nz_monkeybomb.lua new file mode 100644 index 00000000..1942a214 --- /dev/null +++ b/lua/entities/nz_monkeybomb.lua @@ -0,0 +1,117 @@ +ENT.Type = "anim" +ENT.Base = "base_entity" +ENT.PrintName = "Monkey Bomb" +ENT.Author = "Zet0r" + +ENT.Spawnable = false +ENT.AdminSpawnable = false + +ENT.ExplosionSounds = { + "nz/monkey/voice_explosion/explo_vox_00.wav", + "nz/monkey/voice_explosion/explo_vox_01.wav", + "nz/monkey/voice_explosion/explo_vox_02.wav", + "nz/monkey/voice_explosion/explo_vox_03.wav", + "nz/monkey/voice_explosion/explo_vox_04.wav", + "nz/monkey/voice_explosion/explo_vox_05.wav", + "nz/monkey/voice_explosion/explo_vox_06.wav", + "nz/monkey/voice_explosion/explo_vox_07.wav", + "nz/monkey/voice_explosion/explo_vox_08.wav", + "nz/monkey/voice_explosion/explo_vox_09.wav", + "nz/monkey/voice_explosion/explo_vox_10.wav", + "nz/monkey/voice_explosion/explo_vox_11.wav", +} + +if SERVER then + AddCSLuaFile() +end + +function ENT:Initialize() + if SERVER then + self:SetModel("models/nzprops/monkey_bomb.mdl") -- Change later + self:PhysicsInitSphere(1, "metal_bouncy") + self:SetMoveType(MOVETYPE_VPHYSICS) + self:SetCollisionGroup(COLLISION_GROUP_NONE) + self:SetSolid(SOLID_VPHYSICS) + phys = self:GetPhysicsObject() + + if phys and phys:IsValid() then + phys:Wake() + end + end +end + + +function ENT:PhysicsCollide(data, physobj) + if SERVER then + local vel = physobj:GetVelocity():Length() + if vel > 100 then + self:EmitSound("nz/monkey/voice_bounce/land_0"..math.random(0,3)..".wav", 75, 100) + end + + local LastSpeed = math.max( data.OurOldVelocity:Length(), data.Speed ) + local NewVelocity = physobj:GetVelocity() + NewVelocity:Normalize() + + LastSpeed = math.max( NewVelocity:Length(), LastSpeed ) + + local TargetVelocity = NewVelocity * LastSpeed * 0.75 + + physobj:SetVelocity( TargetVelocity ) + + if vel < 100 then + self:SetMoveType(MOVETYPE_NONE) + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + self:ResetSequence("anim_play") + self:SetExplosionTimer(8) + end + end +end + +function ENT:SetExplosionTimer( time ) + + -- Make Zombies target this over players + self:SetTargetPriority(TARGET_PRIORITY_SPECIAL) + + UpdateAllZombieTargets(self) + + SafeRemoveEntityDelayed( self, time +1 ) --fallback + + self:EmitSound("nz/monkey/music/song"..math.random(1,3)..".wav", 100) + self.NextCymbal = CurTime() + + timer.Simple(time - 1.5, function() + if IsValid(self) then + local sound = self.ExplosionSounds[math.random(1,#self.ExplosionSounds)] + self:EmitSound(sound, 85) + end + end) + + timer.Simple(time, function() + if IsValid(self) then + local pos = self:GetPos() + local owner = self:GetOwner() + + util.BlastDamage(self, owner, pos, 400, 200) + + fx = EffectData() + fx:SetOrigin(pos) + fx:SetMagnitude(1) + util.Effect("Explosion", fx) + + self:Remove() + end + end) +end + +function ENT:Draw() + self:DrawModel() +end + +function ENT:Think() + if SERVER then + if self.NextCymbal and self.NextCymbal < CurTime() then + self:EmitSound("nz/monkey/cymbals/monk_cymb_m.wav") + self.NextCymbal = CurTime() + 0.2 + end + end +end \ No newline at end of file diff --git a/lua/entities/nz_prop_effect.lua b/lua/entities/nz_prop_effect.lua new file mode 100644 index 00000000..2df03b34 --- /dev/null +++ b/lua/entities/nz_prop_effect.lua @@ -0,0 +1,160 @@ + +AddCSLuaFile() + +if ( CLIENT ) then + CreateConVar( "cl_draweffectrings", "1", 0, "Should the effect green rings be visible?" ) +end + +ENT.Type = "anim" + +ENT.PrintName = "" +ENT.Author = "" +ENT.Contact = "" +ENT.Purpose = "" +ENT.Instructions = "" +ENT.Spawnable = false +ENT.AdminOnly = false + +--[[--------------------------------------------------------- + Name: Initialize +-----------------------------------------------------------]] +function ENT:Initialize() + + local Radius = 6 + local min = Vector( 1, 1, 1 ) * Radius * -0.5 + local max = Vector( 1, 1, 1 ) * Radius * 0.5 + + if ( SERVER ) then + + self.AttachedEntity = ents.Create( "nz_prop_effect_attachment" ) + self.AttachedEntity:SetModel( self:GetModel() ) + self.AttachedEntity:SetAngles( self:GetAngles() ) + self.AttachedEntity:SetPos( self:GetPos() ) + self.AttachedEntity:SetSkin( self:GetSkin() ) + self.AttachedEntity:Spawn() + self.AttachedEntity:SetParent( self.Entity ) + self.AttachedEntity:DrawShadow( false ) + + self:SetModel( "models/props_junk/watermelon01.mdl" ) + + self:DeleteOnRemove( self.AttachedEntity ) + + -- Don't use the model's physics - create a box instead + self:PhysicsInitBox( min, max ) + + -- Set up our physics object here + local phys = self:GetPhysicsObject() + if ( IsValid( phys ) ) then + phys:Wake() + phys:EnableGravity( false ) + phys:EnableDrag( false ) + end + + self:DrawShadow( false ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + + else + + self.GripMaterial = Material( "sprites/grip" ) + + -- Get the attached entity so that clientside functions like properties can interact with it + local tab = ents.FindByClassAndParent( "nz_prop_effect_attachment", self ) + if ( tab && IsValid( tab[ 1 ] ) ) then self.AttachedEntity = tab[ 1 ] end + + end + + -- Set collision bounds exactly + self:SetCollisionBounds( min, max ) + +end + + +--[[--------------------------------------------------------- + Name: Draw +-----------------------------------------------------------]] +function ENT:Draw() + + if !nzRound:InState( ROUND_CREATE ) then return end + + -- Don't draw the grip if there's no chance of us picking it up + local ply = LocalPlayer() + local wep = ply:GetActiveWeapon() + if ( !IsValid( wep ) ) then return end + + local weapon_name = wep:GetClass() + + if ( weapon_name != "weapon_physgun" && weapon_name != "weapon_physcannon" && weapon_name != "gmod_tool" ) then + return + end + + render.SetMaterial( self.GripMaterial ) + render.DrawSprite( self:GetPos(), 16, 16, color_white ) + +end + + +--[[--------------------------------------------------------- + Name: PhysicsUpdate +-----------------------------------------------------------]] +function ENT:PhysicsUpdate( physobj ) + + if ( CLIENT ) then return end + + -- Don't do anything if the player isn't holding us + if ( !self:IsPlayerHolding() && !self:IsConstrained() ) then + + physobj:SetVelocity( Vector( 0, 0, 0 ) ) + physobj:Sleep() + + end + +end + + +--[[--------------------------------------------------------- + Name: Called after entity 'copy' +-----------------------------------------------------------]] +function ENT:OnEntityCopyTableFinish( tab ) + + -- We need to store the model of the attached entity + -- Not the one we have here. + tab.Model = self.AttachedEntity:GetModel() + + -- Store the attached entity's table so we can restore it after being pasted + tab.AttachedEntityInfo = table.Copy( duplicator.CopyEntTable( self.AttachedEntity ) ) + tab.AttachedEntityInfo.Pos = nil -- Don't even save angles and position, we are a parented entity + tab.AttachedEntityInfo.Angle = nil + + -- Do NOT store the attached entity itself in our table! + -- Otherwise, if we copy-paste the prop with the duplicator, its AttachedEntity value will point towards the original prop's attached entity instead, and that'll break stuff + tab.AttachedEntity = nil + +end + + +--[[--------------------------------------------------------- + Name: PostEntityPaste +-----------------------------------------------------------]] +function ENT:PostEntityPaste( ply ) + + -- Restore the attached entity using the information we've saved + if ( IsValid( self.AttachedEntity ) ) and ( self.AttachedEntityInfo ) then + + -- Apply skin, bodygroups, bone manipulator, etc. + duplicator.DoGeneric( self.AttachedEntity, self.AttachedEntityInfo ) + + if ( self.AttachedEntityInfo.EntityMods ) then + self.AttachedEntity.EntityMods = table.Copy( self.AttachedEntityInfo.EntityMods ) + duplicator.ApplyEntityModifiers( ply, self.AttachedEntity ) + end + + if ( self.AttachedEntityInfo.BoneMods ) then + self.AttachedEntity.BoneMods = table.Copy( self.AttachedEntityInfo.BoneMods ) + duplicator.ApplyBoneModifiers( ply, self.AttachedEntity ) + end + + self.AttachedEntityInfo = nil + + end + +end diff --git a/lua/entities/nz_prop_effect_attachment.lua b/lua/entities/nz_prop_effect_attachment.lua new file mode 100644 index 00000000..c439558c --- /dev/null +++ b/lua/entities/nz_prop_effect_attachment.lua @@ -0,0 +1,14 @@ +AddCSLuaFile() + + +ENT.Type = "anim" + +ENT.PrintName = "" +ENT.Author = "" +ENT.Contact = "" +ENT.Purpose = "" +ENT.Instructions = "" +ENT.Spawnable = false +ENT.AdminOnly = false + +-- We have absolutely nothing here. That's right, this is just to differentiate it from normal prop_dynamics \ No newline at end of file diff --git a/lua/entities/nz_script_prop/shared.lua b/lua/entities/nz_script_prop/shared.lua new file mode 100644 index 00000000..47758313 --- /dev/null +++ b/lua/entities/nz_script_prop/shared.lua @@ -0,0 +1,28 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "nz_script_prop" +ENT.Author = "Zet0r" +ENT.Contact = "youtube.com/Zet0r" +ENT.Purpose = "Scriptable prop for nZombies" +ENT.Instructions = "" + +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:OnRemove() + hook.Call("nzmapscript_PropRemoved", nil, self) +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end +end \ No newline at end of file diff --git a/lua/entities/nz_script_soulcatcher/shared.lua b/lua/entities/nz_script_soulcatcher/shared.lua new file mode 100644 index 00000000..c4b419a4 --- /dev/null +++ b/lua/entities/nz_script_soulcatcher/shared.lua @@ -0,0 +1,97 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "nz_script_soulcatcher" +ENT.Author = "Zet0r" +ENT.Contact = "youtube.com/Zet0r" +ENT.Purpose = "Scriptable soul catcher for nZombies" +ENT.Instructions = "" + +function ENT:Initialize() + if SERVER then + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + --self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) + self.CurrentAmount = 0 + self:SetTargetAmount( self.TargetAmount or 20 ) + self:SetCondition(self.Condition or function(z, dmg) return true end) -- Always allow + self:SetCatchFunction(self.CatchFunc or function(z) end) -- Nothing by default + self:SetCompleteFunction(self.CompleteFunc or function(z) end) -- Nothing either + self:SetRange(self.Range or 500) -- Default range + self:SetEnabled(self.Enabled or true) + end +end + +function ENT:OnRemove() + hook.Call("nzmapscript_SoulCatcherRemoved", nil, self) +end + +function ENT:SetCatchFunction( func ) + self.CatchFunc = func +end +function ENT:SetCompleteFunction( func ) + self.CompleteFunc = func +end +function ENT:SetTargetAmount( num ) + self.TargetAmount = tonumber(num) +end +function ENT:SetCondition( func ) + self.Condition = func +end +function ENT:SetRange( num ) + self.Range = tonumber(num)^2 +end +function ENT:SetEnabled( bool ) + self.Enabled = tobool(bool) +end +function ENT:SetReleaseOverride( func ) + self.ReleaseOverride = func +end + +function ENT:SetCurrentAmount( num ) + self.CurrentAmount = tonumber(num) +end +function ENT:Reset() + self.CurrentAmount = 0 +end + +function ENT:ReleaseSoul( z ) + if self.ReleaseOverride then + self:ReleaseOverride(z) -- You can override the effect and count logic with this + else + if self.CurrentAmount >= self.TargetAmount then return end + local e = EffectData() + e:SetOrigin(z:GetPos() + Vector(0,0,50)) + e:SetEntity(self) + util.Effect("zombie_soul", e) + self.CurrentAmount = self.CurrentAmount + 1 + end +end + +function ENT:CollectSoul() + self:CatchFunc() + if self.CurrentAmount >= self.TargetAmount then + self:CompleteFunc() + end +end + +if engine.ActiveGamemode() == "nzombies3" then + hook.Add("EntityTakeDamage", "SoulCatchZombies", function(ent, dmg) + if ent:Health() <= dmg:GetDamage() then + for k,v in pairs(ents.FindByClass("nz_script_soulcatcher")) do + if v.Enabled and ent:GetPos():DistToSqr(v:GetPos()) <= v.Range and v:Condition(ent, dmg) then + v:ReleaseSoul(ent) + break + end + end + end + end) +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end +end diff --git a/lua/entities/nz_script_triggerzone/shared.lua b/lua/entities/nz_script_triggerzone/shared.lua new file mode 100644 index 00000000..7f059ccc --- /dev/null +++ b/lua/entities/nz_script_triggerzone/shared.lua @@ -0,0 +1,102 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "triggerzone" +ENT.Author = "Zet0r" +ENT.Contact = "" +ENT.Purpose = "" +ENT.Instructions = "" + +ENT.RenderGroup = RENDERGROUP_TRANSLUCENT + +function ENT:Initialize() + if SERVER then + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_NONE ) + self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) + self.Boundone,self.Boundtwo = self:GetCollisionBounds() + self:SetBuyFunction( function() print(self, "was bought but has no buy function") end ) + end + self:SetRenderMode( RENDERMODE_TRANSALPHA ) + self:SetColor( Color(255,200,100,150) ) +end + + +function ENT:OnRemove() + if SERVER then + nzDoors:RemoveLink( self ) + else + self:SetLocked(false) + end +end + +function ENT:CreateZoneBuy(data) + if IsValid(self) then + self:SetDoorData(data) + self:SetLocked(true) + hook.Call("OnPropDoorLinkCreated", Doors, self, data) + end +end + +function ENT:SetBuyFunction(func) + self.BuyFunction = func +end + +function ENT:SetBounds(w, l, h) + self:SetSolid( SOLID_BBOX ) + self:SetCollisionBounds( Vector(-w/2, -l/2, -h/2), Vector(w/2, l/2, h/2) ) +end + +if CLIENT then + function ENT:Draw() + if nzRound:InState( ROUND_CREATE ) then + self:DrawModel() + end + end +end + +concommand.Add("nz_testbrush2", function(ply) + local ent = ents.Create("nz_triggerzone") + ent:SetPos(ply:GetPos()) + ent:SetBounds(1000,10,10) + ent:SetMaterial("debugtools/toolswhite") + ent:SetModel("models/hunter/blocks/cube4x4x4.mdl") + ent:Spawn() + ent:SetBuyFunction( function(ent) + ent:ChatPrint("Bought!") + end ) + + undo.Create( "Test Brush 2" ) + undo.SetPlayer( ply ) + undo.AddEntity( ent ) + undo.Finish( "Effect (" .. tostring( model ) .. ")" ) + + print(ent) +end) + +concommand.Add("nz_testbrush5", function(ply) + local t = SysTime() + for k,v in pairs(ents.FindByClass("nz_triggerzone_2")) do + if v:NearestPoint(Entity(1):GetPos()):DistToSqr(Entity(1):GetPos()) <= 1 then + print("Found", v) + break + end + end + local time = SysTime() - t + print("Time for FindByClass", time) + + local o = SysTime() + for k,v in pairs(ents.FindInSphere(Entity(1):GetPos(), 1)) do + if v:GetClass() == "nz_triggerzone_2" then + print("Found", v) + break + end + end + local time2 = SysTime()-o + print("Time for FindInSphere", time2) + + print(time2 < time and "Sphere is fastest" or "Class is fastest") +end) + diff --git a/lua/entities/nz_spawn_zombie.lua b/lua/entities/nz_spawn_zombie.lua new file mode 100644 index 00000000..be847b73 --- /dev/null +++ b/lua/entities/nz_spawn_zombie.lua @@ -0,0 +1,80 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" +ENT.Base = "base_entity" + +ENT.PrintName = "nz_spawn_zombie" + +AccessorFunc(ENT, "iSpawnWeight", "SpawnWeight", FORCE_NUMBER) +AccessorFunc(ENT, "tZombieData", "ZombieData") +AccessorFunc(ENT, "iZombiesToSpawn", "ZombiesToSpawn", FORCE_NUMBER) +AccessorFunc(ENT, "hSpawner", "Spawner") +AccessorFunc(ENT, "dNextSpawn", "NextSpawn", FORCE_NUMBER) + +function ENT:DecrementZombiesToSpawn() + self:SetZombiesToSpawn( self:GetZombiesToSpawn() - 1 ) +end + +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "Link" ) + +end + +function ENT:Initialize() + self:SetModel( "models/player/odessa.mdl" ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + self:SetColor(Color(0, 255, 0)) + self:DrawShadow( false ) + self:SetSpawnWeight(0) + self:SetZombiesToSpawn(0) + self:SetNextSpawn(CurTime()) +end + +function ENT:IsSuitable() + local tr = util.TraceHull( { + start = self:GetPos(), + endpos = self:GetPos(), + filter = self, + mins = Vector( -20, -20, 0 ), + maxs = Vector( 20, 20, 70 ), + ignoreworld = true, + mask = MASK_NPCSOLID + } ) + + return not tr.Hit +end + +function ENT:Think() + if SERVER then + if nzRound:InState( ROUND_PROG ) and self:GetZombiesToSpawn() > 0 then + if self:GetSpawner() and self:GetSpawner():GetNextSpawn() < CurTime() and self:GetNextSpawn() < CurTime() then + if self:IsSuitable() then + local class = nzMisc.WeightedRandom(self:GetZombieData(), "chance") + local zombie = ents.Create(class) + zombie:SetPos(self:GetPos()) + zombie:Spawn() + -- make a reference to the spawner object used for "respawning" + zombie:SetSpawner(self:GetSpawner()) + zombie:Activate() + -- reduce zombies in queue on self and spawner object + self:GetSpawner():DecrementZombiesToSpawn() + self:DecrementZombiesToSpawn() + end + self:GetSpawner():SetNextSpawn(CurTime() + self:GetSpawner():GetDelay()) + -- this will prevent one spawner from becoming dominant + self:SetNextSpawn(CurTime() + self:GetSpawner():GetDelay() * 2 + math.Rand(0,0.1)) + end + end + end +end + +if CLIENT then + function ENT:Draw() + if nzRound:InState( ROUND_CREATE ) then + self:DrawModel() + end + end +end diff --git a/lua/entities/nz_spawn_zombie_normal.lua b/lua/entities/nz_spawn_zombie_normal.lua new file mode 100644 index 00000000..277b15f2 --- /dev/null +++ b/lua/entities/nz_spawn_zombie_normal.lua @@ -0,0 +1,4 @@ +AddCSLuaFile( ) + +ENT.Base = "nz_spawn_zombie" +ENT.PrintName = "nz_spawn_zombie_normal" diff --git a/lua/entities/nz_spawn_zombie_special.lua b/lua/entities/nz_spawn_zombie_special.lua new file mode 100644 index 00000000..94864fab --- /dev/null +++ b/lua/entities/nz_spawn_zombie_special.lua @@ -0,0 +1,16 @@ +AddCSLuaFile( ) + +ENT.Base = "nz_spawn_zombie" +ENT.PrintName = "nz_spawn_zombie_special" + +function ENT:Initialize() + self:SetModel( "models/player/odessa.mdl" ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + self:SetColor(Color(255, 0, 0)) + self:DrawShadow( false ) + self:SetSpawnWeight(0) + self:SetZombiesToSpawn(0) + self:SetNextSpawn(CurTime()) +end \ No newline at end of file diff --git a/lua/entities/nz_zombie_boss_panzer.lua b/lua/entities/nz_zombie_boss_panzer.lua new file mode 100644 index 00000000..ff0fdda2 --- /dev/null +++ b/lua/entities/nz_zombie_boss_panzer.lua @@ -0,0 +1,372 @@ +AddCSLuaFile() + +ENT.Base = "nz_zombiebase" +ENT.PrintName = "Panzersoldat" +ENT.Category = "Brainz" +ENT.Author = "Zet0r" + +ENT.Models = { "models/nz_zombie/zombie_panzersoldat.mdl" } + +ENT.AttackRange = 80 +ENT.DamageLow = 90 +ENT.DamageHigh = 180 + +ENT.RedEyes = true + +ENT.AttackSequences = { + {seq = "nz_melee1"}, + {seq = "nz_melee2"}, +} + +ENT.DeathSequences = { + "nz_death", +} + +ENT.AttackSounds = { + "nz/panzer/attack/mech_swing_00.wav", + "nz/panzer/attack/mech_swing_01.wav", + "nz/panzer/attack/mech_swing_02.wav", +} + +ENT.AttackHitSounds = { + "nz/panzer/attack/mech_swing_00.wav", + "nz/panzer/attack/mech_swing_01.wav", + "nz/panzer/attack/mech_swing_02.wav", +} + +ENT.WalkSounds = { + "nz/panzer/ambient/mech_ambi_00.wav", + "nz/panzer/ambient/mech_ambi_01.wav", + "nz/panzer/ambient/mech_ambi_02.wav", +} + +ENT.ActStages = { + [1] = { + act = ACT_WALK, + minspeed = 5, + }, + [2] = { + act = ACT_WALK_ANGRY, + minspeed = 50, + }, + [3] = { + act = ACT_RUN, + minspeed = 150, + }, + [4] = { + act = ACT_RUN, + minspeed = 160, + }, +} + +function ENT:StatsInitialize() + if SERVER then + self:SetRunSpeed(150) + self:SetHealth( 100 ) + end + self:SetCollisionBounds(Vector(-20,-20, 0), Vector(20, 20, 100)) + + --PrintTable(self:GetSequenceList()) +end + +function ENT:SpecialInit() + + if CLIENT then + --make them invisible for a really short duration to blend the emerge sequences + self:SetNoDraw(true) + self:TimedEvent( 0.15, function() + self:SetNoDraw(false) + end) + + self:SetRenderClipPlaneEnabled( true ) + self:SetRenderClipPlane(self:GetUp(), self:GetUp():Dot(self:GetPos())) + + self:TimedEvent( 2, function() + self:SetRenderClipPlaneEnabled(false) + end) + + end +end + +function ENT:OnSpawn() + local seq = "nz_entry" + local tr = util.TraceLine({ + start = self:GetPos() + Vector(0,0,500), + endpos = self:GetPos(), + filter = self, + mask = MASK_NPCSOLID, + }) + if tr.Hit then seq = "nz_entry_instant" end + local _, dur = self:LookupSequence(seq) + + -- play emerge animation on spawn + -- if we have a coroutine else just spawn the zombie without emerging for now. + if coroutine.running() then + self:TimedEvent(dur - 2.1, function() + --dust cloud + local effectData = EffectData() + effectData:SetStart( self:GetPos() ) + effectData:SetOrigin( self:GetPos() ) + effectData:SetMagnitude(dur) + util.Effect("panzer_land_dust", effectData) + end) + self:PlaySequenceAndWait(seq) + end +end + +function ENT:OnZombieDeath(dmgInfo) + + self:SetRunSpeed(0) + self.loco:SetVelocity(Vector(0,0,0)) + self:Stop() + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + local seq, dur = self:LookupSequence(self.DeathSequences[math.random(#self.DeathSequences)]) + self:ResetSequence(seq) + self:SetCycle(0) + + timer.Simple(dur - 0.5, function() + if IsValid(self) then + self:EmitSound("nz/panzer/mech_explode.wav") + end + end) + timer.Simple(dur, function() + if IsValid(self) then + self:Remove() + local effectData = EffectData() + effectData:SetStart( self:GetPos() ) + effectData:SetOrigin( self:GetPos() ) + effectData:SetMagnitude(2) + util.Effect("HelicopterMegaBomb", effectData) + end + end) + +end + +function ENT:Attack( data ) + + self:SetLastAttack(CurTime()) + + --if self:Health() <= 0 then coroutine.yield() return end + + data = data or {} + data.attackseq = data.attackseq or self.AttackSequences[ math.random( #self.AttackSequences ) ].seq or "swing" + data.attacksound = data.attacksound or self.AttackSounds[ math.random( #self.AttackSounds) ] or Sound( "npc/vort/claw_swing1.wav" ) + data.hitsound = data.hitsound or self.AttackHitSounds[ math.random( #self.AttackHitSounds ) ]Sound( "npc/zombie/zombie_hit.wav" ) + data.viewpunch = data.viewpunch or VectorRand():Angle() * 0.05 + data.dmglow = data.dmglow or self.DamageLow or 50 + data.dmghigh = data.dmghigh or self.DamageHigh or 70 + data.dmgtype = data.dmgtype or DMG_CLUB + data.dmgforce = data.dmgforce or (self:GetTarget():GetPos() - self:GetPos()) * 7 + Vector( 0, 0, 16 ) + data.dmgforce.z = math.Clamp(data.dmgforce.z, 1, 16) + local seq, dur = self:LookupSequence( data.attackseq ) + data.attackdur = (seq != - 1 and dur) or 0.6 + data.dmgdelay = data.dmgdelay or ( ( data.attackdur != 0 ) and data.attackdur / 2 ) or 0.3 + + self:EmitSound("npc/zombie_poison/pz_throw2.wav", 50, math.random(75, 125)) -- whatever this is!? I will keep it for now + + self:SetAttacking( true ) + + self:TimedEvent(0.4, function() + self:EmitSound( data.attacksound ) + end) + + self:TimedEvent( data.dmgdelay, function() + if self:IsValidTarget( self:GetTarget() ) and self:TargetInRange( self:GetAttackRange() + 10 ) then + local dmgAmount = math.random( data.dmglow, data.dmghigh ) + local dmgInfo = DamageInfo() + dmgInfo:SetAttacker( self ) + dmgInfo:SetDamage( dmgAmount ) + dmgInfo:SetDamageType( data.dmgtype ) + dmgInfo:SetDamageForce( data.dmgforce ) + self:GetTarget():TakeDamageInfo(dmgInfo) + self:GetTarget():EmitSound( data.hitsound, 50, math.random( 80, 160 ) ) + if self:GetTarget().ViewPunch then + self:GetTarget():ViewPunch( data.viewpunch ) + end + self:GetTarget():SetVelocity( data.dmgforce ) + + local blood = ents.Create("env_blood") + blood:SetKeyValue("targetname", "carlbloodfx") + blood:SetKeyValue("parentname", "prop_ragdoll") + blood:SetKeyValue("spawnflags", 8) + blood:SetKeyValue("spraydir", math.random(500) .. " " .. math.random(500) .. " " .. math.random(500)) + blood:SetKeyValue("amount", dmgAmount * 5) + blood:SetCollisionGroup( COLLISION_GROUP_WORLD ) + blood:SetPos( self:GetTarget():GetPos() + self:GetTarget():OBBCenter() + Vector( 0, 0, 10 ) ) + blood:Spawn() + blood:Fire("EmitBlood") + SafeRemoveEntityDelayed( blood, 2) --just to make sure everything gets cleaned + end + end) + + self:TimedEvent(data.attackdur, function() + self:SetAttacking(false) + self:SetLastAttack(CurTime()) + end) + + self:PlayAttackAndWait(data.attackseq, 1) +end + +function ENT:BodyUpdate() + + self.CalcIdeal = ACT_IDLE + + local velocity = self:GetVelocity() + + local len2d = velocity:Length2D() + + if ( len2d > 60 ) then self.CalcIdeal = ACT_RUN elseif ( len2d > 5 ) then self.CalcIdeal = ACT_WALK end + + if self:IsJumping() and self:WaterLevel() <= 0 then + self.CalcIdeal = ACT_JUMP + end + + if self:GetActivity() != self.CalcIdeal and !self:IsAttacking() and !self:GetStop() then self:StartActivity(self.CalcIdeal) end + + if ( self.CalcIdeal and !self:GetAttacking() ) then + + self:BodyMoveXY() + + end + + self:FrameAdvance() + +end + +function ENT:OnTargetInAttackRange() + local atkData = {} + atkData.dmglow = 90 + atkData.dmghigh = 180 + atkData.dmgforce = Vector( 0, 0, 0 ) + atkData.dmgdelay = 0.6 + self:Attack( atkData ) +end + +-- Hellhounds target differently +function ENT:GetPriorityTarget() + + if GetConVar( "nz_zombie_debug" ):GetBool() then + print(self, "Retargeting") + end + + self:SetLastTargetCheck( CurTime() ) + + -- Well if he exists and he is targetable, just target this guy! + if IsValid(self:GetTarget()) and self:GetTarget():GetTargetPriority() > 0 then + local dist = self:GetRangeSquaredTo( self:GetTarget():GetPos() ) + if dist < 1000 then + if !self.sprinting then + self.sprinting = true + end + self:SetRunSpeed(100) + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + elseif !self.sprinting then + self:SetRunSpeed(80) + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + end + return self:GetTarget() + end + + -- Otherwise, we just loop through all to try and target again + local allEnts = ents.GetAll() + + local bestTarget = nil + local lowest + + --local possibleTargets = ents.FindInSphere( self:GetPos(), self:GetTargetCheckRange()) + + for _, target in pairs(allEnts) do + if self:IsValidTarget(target) then + if target:GetTargetPriority() == TARGET_PRIORITY_ALWAYS then return target end + if !lowest then + lowest = target.hellhoundtarget -- Set the lowest variable if not yet + bestTarget = target -- Also mark this for the best target so he isn't ignored + end + + if lowest and (!target.hellhoundtarget or target.hellhoundtarget < lowest) then -- If the variable exists and this player is lower than that amount + bestTarget = target -- Mark him for the potential target + lowest = target.hellhoundtarget or 0 -- And set the new lowest to continue the loop with + end + + if !lowest then -- If no players had any target values (lowest was never set, first ever hellhound) + local players = player.GetAllTargetable() + bestTarget = players[math.random(#players)] -- Then pick a random player + end + end + end + + if self:IsValidTarget(bestTarget) then -- If we found a valid target + local targetDist = self:GetRangeSquaredTo( bestTarget:GetPos() ) + if targetDist < 1000 then -- Under this distance, we will break into sprint + self.sprinting = true -- Once sprinting, you won't stop + self:SetRunSpeed(100) + else -- Otherwise we'll just search (towards him) + self:SetRunSpeed(80) + self.sprinting = nil + end + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + -- Apply the new target numbers + bestTarget.hellhoundtarget = bestTarget.hellhoundtarget and bestTarget.hellhoundtarget + 1 or 1 + self:SetTarget(bestTarget) -- Well we found a target, we kinda have to force it + + return bestTarget + else + self:TimeOut(0.2) + end +end + +function ENT:IsValidTarget( ent ) + if !ent then return false end + return IsValid( ent ) and ent:GetTargetPriority() != TARGET_PRIORITY_NONE and ent:GetTargetPriority() != TARGET_PRIORITY_SPECIAL + -- Won't go for special targets (Monkeys), but still MAX, ALWAYS and so on +end + +if CLIENT then + local eyeGlow = Material( "sprites/redglow1" ) + local white = Color( 255, 255, 255, 255 ) + function ENT:Draw() + self:DrawModel() + + local dlight = DynamicLight( self:EntIndex() ) + if ( dlight ) then + local bone = self:LookupBone("j_spinelower") + local pos, ang = self:GetBonePosition(bone) + pos = pos + ang:Right()*-8 + ang:Forward()*25 + dlight.pos = pos + dlight.r = 255 + dlight.g = 255 + dlight.b = 255 + dlight.brightness = 10 + dlight.Decay = 1000 + dlight.Size = 16 + dlight.DieTime = CurTime() + 1 + dlight.dir = ang:Right() + ang:Forward() + dlight.innerangle = 1 + dlight.outerangle = 1 + dlight.style = 0 + dlight.noworld = true + end + + if self.RedEyes then + --local eyes = self:GetAttachment(self:LookupAttachment("eyes")).Pos + --local leftEye = eyes + self:GetRight() * -1.5 + self:GetForward() * 0.5 + --local rightEye = eyes + self:GetRight() * 1.5 + self:GetForward() * 0.5 + + local leftEye = self:GetAttachment(self:LookupAttachment("lefteye")).Pos + local rightEye = self:GetAttachment(self:LookupAttachment("righteye")).Pos + cam.Start3D(EyePos(),EyeAngles()) + render.SetMaterial( eyeGlow ) + render.DrawSprite( leftEye, 4, 4, white) + render.DrawSprite( rightEye, 4, 4, white) + cam.End3D() + end + if GetConVar( "nz_zombie_debug" ):GetBool() then + render.DrawWireframeBox(self:GetPos(), Angle(0,0,0), self:OBBMins(), self:OBBMaxs(), Color(255,0,0), true) + render.DrawWireframeSphere(self:GetPos(), self:GetAttackRange(), 10, 10, Color(255,165,0), true) + end + end +end + +function ENT:OnInjured( dmgInfo ) + -- No pain sounds +end \ No newline at end of file diff --git a/lua/entities/nz_zombie_special_burning.lua b/lua/entities/nz_zombie_special_burning.lua new file mode 100644 index 00000000..e3ba1b32 --- /dev/null +++ b/lua/entities/nz_zombie_special_burning.lua @@ -0,0 +1,38 @@ +AddCSLuaFile() + +ENT.Base = "nz_zombie_walker" +ENT.PrintName = "Burning Walker" +ENT.Category = "Brainz" +ENT.Author = "Lolle" + +function ENT:StatsInitialize() + if SERVER then + local speeds = nzRound:GetZombieSpeeds() + if speeds then + self:SetRunSpeed( nzMisc.WeightedRandom(speeds) - 20 ) -- A bit slower here + end + self:SetHealth( nzRound:GetZombieHealth() or 75 ) + self:Flames( true ) + + self:SetEmergeSequenceIndex(math.random(#self.EmergeSequences)) + end +end + +function ENT:OnTargetInAttackRange() + local atkData = {} + atkData.dmglow = 20 + atkData.dmghigh = 30 + atkData.dmgforce = Vector( 0, 0, 0 ) + self:Attack( atkData ) + self:TimedEvent( 0.45, function() + if self:IsValidTarget( self:GetTarget() ) and self:TargetInRange( self.AttackRange + 10 ) then + self:Explode( math.random( 50, 100 ) ) + end + end) +end + +function ENT:OnZombieDeath(dmgInfo) + self:Explode( math.random( 25, 50 )) + self:EmitSound(self.DeathSounds[ math.random( #self.DeathSounds ) ], 50, math.random(75, 130)) + self:BecomeRagdoll(dmgInfo) +end diff --git a/lua/entities/nz_zombie_special_dog.lua b/lua/entities/nz_zombie_special_dog.lua new file mode 100644 index 00000000..c3740d99 --- /dev/null +++ b/lua/entities/nz_zombie_special_dog.lua @@ -0,0 +1,309 @@ +AddCSLuaFile() + +ENT.Base = "nz_zombiebase" +ENT.PrintName = "Hellhound" +ENT.Category = "Brainz" +ENT.Author = "Lolle" + +--ENT.Models = { "models/boz/killmeplease.mdl" } +ENT.Models = { "models/nz_zombie/zombie_hellhound.mdl" } + +ENT.AttackRange = 80 +ENT.DamageLow = 30 +ENT.DamageHigh = 40 + +ENT.AttackSequences = { + {seq = "nz_attack1"}, + {seq = "nz_attack2"}, + {seq = "nz_attack3"}, +} + +ENT.DeathSequences = { + "nz_death1", + "nz_death2", + "nz_death3", +} + +ENT.AttackSounds = { + "nz/hellhound/attack/attack_00.wav", + "nz/hellhound/attack/attack_01.wav", + "nz/hellhound/attack/attack_02.wav", + "nz/hellhound/attack/attack_03.wav", + "nz/hellhound/attack/attack_04.wav", + "nz/hellhound/attack/attack_05.wav", + "nz/hellhound/attack/attack_06.wav" +} + +ENT.AttackHitSounds = { + "nz/hellhound/bite/bite_00.wav", + "nz/hellhound/bite/bite_01.wav", + "nz/hellhound/bite/bite_02.wav", + "nz/hellhound/bite/bite_03.wav", +} + +ENT.WalkSounds = { + "nz/hellhound/dist_vox_a/dist_vox_a_00.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_01.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_02.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_03.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_04.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_05.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_06.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_07.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_08.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_09.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_10.wav", + "nz/hellhound/dist_vox_a/dist_vox_a_11.wav" +} + +ENT.PainSounds = { + "physics/flesh/flesh_impact_bullet1.wav", + "physics/flesh/flesh_impact_bullet2.wav", + "physics/flesh/flesh_impact_bullet3.wav", + "physics/flesh/flesh_impact_bullet4.wav", + "physics/flesh/flesh_impact_bullet5.wav" +} + +ENT.DeathSounds = { + "nz/hellhound/death2/death0.wav", + "nz/hellhound/death2/death1.wav", + "nz/hellhound/death2/death2.wav", + "nz/hellhound/death2/death3.wav", + "nz/hellhound/death2/death4.wav", + "nz/hellhound/death2/death5.wav", + "nz/hellhound/death2/death6.wav", +} + +ENT.SprintSounds = { + "nz/hellhound/close/close_00.wav", + "nz/hellhound/close/close_01.wav", + "nz/hellhound/close/close_02.wav", + "nz/hellhound/close/close_03.wav", +} + +ENT.ActStages = { + [1] = { + act = ACT_WALK, + minspeed = 5, + }, + [2] = { + act = ACT_WALK_ANGRY, + minspeed = 50, + }, + [3] = { + act = ACT_RUN, + minspeed = 150, + }, + [4] = { + act = ACT_RUN, + minspeed = 160, + }, +} + +function ENT:StatsInitialize() + if SERVER then + self:SetRunSpeed(250) + self:SetHealth( 100 ) + end + self:SetCollisionBounds(Vector(-14,-14, 0), Vector(14, 14, 48)) + self:SetSolid(SOLID_BBOX) + + --PrintTable(self:GetSequenceList()) +end + +function ENT:OnSpawn() + + self:SetNoDraw(true) -- Start off invisible while in the prespawn effect + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) -- Don't collide in this state + self:Stop() -- Also don't do anything + + local effectData = EffectData() + effectData:SetOrigin( self:GetPos() ) + effectData:SetMagnitude( 2 ) + effectData:SetEntity(nil) + util.Effect("lightning_prespawn", effectData) + self:SetNoDraw(true) + + timer.Simple(1.4, function() + if IsValid(self) then + effectData = EffectData() + -- startpos + effectData:SetStart( self:GetPos() + Vector(0, 0, 1000) ) + -- end pos + effectData:SetOrigin( self:GetPos() ) + -- duration + effectData:SetMagnitude( 0.75 ) + --util.Effect("lightning_strike", effectData) + util.Effect("lightning_strike", effectData) + + self:SetNoDraw(false) + self:SetCollisionGroup(COLLISION_GROUP_NONE) + self:SetStop(false) + + self:SetTarget(self:GetPriorityTarget()) + end + end) + + nzRound:SetNextSpawnTime(CurTime() + 2) -- This one spawning delays others by 3 seconds +end + +function ENT:OnZombieDeath(dmgInfo) + + self:SetRunSpeed(0) + self.loco:SetVelocity(Vector(0,0,0)) + self:Stop() + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + local seq, dur = self:LookupSequence(self.DeathSequences[math.random(#self.DeathSequences)]) + self:ResetSequence(seq) + self:SetCycle(0) + + timer.Simple(dur + 1, function() + if IsValid(self) then + self:Remove() + end + end) + self:EmitSound( self.DeathSounds[ math.random( #self.DeathSounds ) ], 100) + +end + +function ENT:BodyUpdate() + + self.CalcIdeal = ACT_IDLE + + local velocity = self:GetVelocity() + + local len2d = velocity:Length2D() + + if ( len2d > 150 ) then self.CalcIdeal = ACT_RUN elseif ( len2d > 50 ) then self.CalcIdeal = ACT_WALK_ANGRY elseif ( len2d > 5 ) then self.CalcIdeal = ACT_WALK end + + if self:IsJumping() and self:WaterLevel() <= 0 then + self.CalcIdeal = ACT_JUMP + end + + --if self:GetActivity() != self.CalcIdeal and !self:IsAttacking() and !self:GetStop() then self:StartActivity(self.CalcIdeal) end + + if !self:GetSpecialAnimation() and !self:IsAttacking() then + if self:GetActivity() != self.CalcIdeal and !self:GetStop() then self:StartActivity(self.CalcIdeal) end + + self:BodyMoveXY() + end + + self:FrameAdvance() + +end + +function ENT:OnTargetInAttackRange() + local atkData = {} + atkData.dmglow = 35 + atkData.dmghigh = 40 + atkData.dmgforce = Vector( 0, 0, 0 ) + atkData.dmgdelay = 0.3 + self:Attack( atkData ) +end + +-- Hellhounds target differently +function ENT:GetPriorityTarget() + + if GetConVar( "nz_zombie_debug" ):GetBool() then + print(self, "Retargeting") + end + + self:SetLastTargetCheck( CurTime() ) + + -- Well if he exists and he is targetable, just target this guy! + if IsValid(self:GetTarget()) and self:GetTarget():GetTargetPriority() > 0 then + local dist = self:GetRangeSquaredTo( self:GetTarget():GetPos() ) + if dist < 1000 then + if !self.sprinting then + self:EmitSound( self.SprintSounds[ math.random( #self.SprintSounds ) ], 100 ) + self.sprinting = true + end + self:SetRunSpeed(250) + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + elseif !self.sprinting then + self:SetRunSpeed(100) + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + end + return self:GetTarget() + end + + -- Otherwise, we just loop through all to try and target again + local allEnts = ents.GetAll() + + local bestTarget = nil + local lowest + + --local possibleTargets = ents.FindInSphere( self:GetPos(), self:GetTargetCheckRange()) + + for _, target in pairs(allEnts) do + if self:IsValidTarget(target) then + if target:GetTargetPriority() == TARGET_PRIORITY_ALWAYS then return target end + if !lowest then + lowest = target.hellhoundtarget -- Set the lowest variable if not yet + bestTarget = target -- Also mark this for the best target so he isn't ignored + end + + if lowest and (!target.hellhoundtarget or target.hellhoundtarget < lowest) then -- If the variable exists and this player is lower than that amount + bestTarget = target -- Mark him for the potential target + lowest = target.hellhoundtarget or 0 -- And set the new lowest to continue the loop with + end + + if !lowest then -- If no players had any target values (lowest was never set, first ever hellhound) + local players = player.GetAllTargetable() + bestTarget = players[math.random(#players)] -- Then pick a random player + end + end + end + + if self:IsValidTarget(bestTarget) then -- If we found a valid target + local targetDist = self:GetRangeSquaredTo( bestTarget:GetPos() ) + if targetDist < 1000 then -- Under this distance, we will break into sprint + self:EmitSound( self.SprintSounds[ math.random( #self.SprintSounds ) ], 100 ) + self.sprinting = true -- Once sprinting, you won't stop + self:SetRunSpeed(250) + else -- Otherwise we'll just search (towards him) + self:SetRunSpeed(100) + self.sprinting = nil + end + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + -- Apply the new target numbers + bestTarget.hellhoundtarget = bestTarget.hellhoundtarget and bestTarget.hellhoundtarget + 1 or 1 + self:SetTarget(bestTarget) -- Well we found a target, we kinda have to force it + + return bestTarget + else + self:TimeOut(0.2) + end +end + +function ENT:IsValidTarget( ent ) + if !ent then return false end + return IsValid( ent ) and ent:GetTargetPriority() != TARGET_PRIORITY_NONE and ent:GetTargetPriority() != TARGET_PRIORITY_SPECIAL + -- Won't go for special targets (Monkeys), but still MAX, ALWAYS and so on +end + +function ENT:TriggerBarricadeJump() + if !self:GetSpecialAnimation() and (!self.NextBarricade or CurTime() > self.NextBarricade) then + self:SetSpecialAnimation(true) + self:SetBlockAttack(true) + local id = self:SelectWeightedSequence(ACT_JUMP) + self:SetSequence(id) + self:SetCycle(0) + self:SetPlaybackRate(1) + self:SetSolidMask(MASK_NPCSOLID_BRUSHONLY) + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER) + self.loco:SetAcceleration( 5000 ) + self.loco:SetDesiredSpeed(20) + self:SetVelocity(self:GetForward()*30) + --self:BodyMoveXY() + --PrintTable(self:GetSequenceInfo(id)) + self:TimedEvent(1, function() + self.NextBarricade = CurTime() + 2 + self:SetSpecialAnimation(false) + self:SetBlockAttack(false) + self.loco:SetAcceleration( self.Acceleration ) + self.loco:SetDesiredSpeed(self:GetRunSpeed()) + self:UpdateSequence() + end) + end +end \ No newline at end of file diff --git a/lua/entities/nz_zombie_walker.lua b/lua/entities/nz_zombie_walker.lua new file mode 100644 index 00000000..bb1d32c3 --- /dev/null +++ b/lua/entities/nz_zombie_walker.lua @@ -0,0 +1,406 @@ +AddCSLuaFile() + +ENT.Base = "nz_zombiebase" +ENT.PrintName = "Walker" +ENT.Category = "Brainz" +ENT.Author = "Lolle" + +function ENT:SetupDataTables() + self:NetworkVar("Int", 0, "EmergeSequenceIndex") +end + +ENT.Models = { + "models/nz_zombie/zombie_rerig_animated.mdl", +} + +ENT.AttackSequences = { + {seq = "nz_stand_attack1", dmgtimes = {1, 1.5}}, + {seq = "nz_stand_attack2", dmgtimes = {0.4}}, + {seq = "nz_stand_attack3", dmgtimes = {1}}, + {seq = "nz_stand_attack4", dmgtimes = {0.4, 0.8}}, +} +ENT.WalkAttackSequences = { + {seq = "nz_walk_attack1", dmgtimes = {0.3}}, + {seq = "nz_walk_attack2", dmgtimes = {0.4, 1}}, + {seq = "nz_walk_attack3", dmgtimes = {0.6}}, + {seq = "nz_walk_attack4", dmgtimes = {0.4, 0.9}}, +} +ENT.RunAttackSequences = { + {seq = "nz_run_attack1", dmgtimes = {0.4}}, + {seq = "nz_run_attack2", dmgtimes = {0.3, 0.8}}, + {seq = "nz_run_attack3", dmgtimes = {0.3, 0.7}}, + {seq = "nz_run_attack4", dmgtimes = {0.4, 0.9}}, +} + +ENT.ActStages = { + [1] = { + act = ACT_WALK, + minspeed = 5, + attackanims = "AttackSequences", + sounds = "WalkSounds", + barricadejumps = "JumpSequences", + }, + [2] = { + act = ACT_WALK_ANGRY, + minspeed = 40, + attackanims = "WalkAttackSequences", + sounds = "WalkSounds", + barricadejumps = "JumpSequences", + }, + [3] = { + act = ACT_RUN, + minspeed = 100, + attackanims = "RunAttackSequences", + sounds = "RunSounds", + barricadejumps = "SprintJumpSequences", + }, + [4] = { + act = ACT_SPRINT, + minspeed = 160, + attackanims = "RunAttackSequences", + sounds = "RunSounds", + barricadejumps = "SprintJumpSequences", + }, +} + +ENT.RedEyes = true + +ENT.ElectrocutionSequences = { + "nz_electrocuted1", + "nz_electrocuted2", + "nz_electrocuted3", + "nz_electrocuted4", + "nz_electrocuted5", +} +ENT.EmergeSequences = { + "nz_emerge1", + "nz_emerge2", + "nz_emerge3", + "nz_emerge4", + "nz_emerge5", +} +ENT.JumpSequences = { + {seq = "nz_barricade1", speed = 15, time = 2.7}, + {seq = "nz_barricade2", speed = 15, time = 2.4}, + {seq = "nz_barricade_fast1", speed = 15, time = 1.8}, + {seq = "nz_barricade_fast2", speed = 35, time = 4}, +} +ENT.SprintJumpSequences = { + {seq = "nz_barricade_sprint1", speed = 50, time = 1.9}, + {seq = "nz_barricade_sprint2", speed = 35, time = 1.9}, +} + +ENT.AttackSounds = { + "nz/zombies/attack/attack_00.wav", + "nz/zombies/attack/attack_01.wav", + "nz/zombies/attack/attack_02.wav", + "nz/zombies/attack/attack_03.wav", + "nz/zombies/attack/attack_04.wav", + "nz/zombies/attack/attack_05.wav", + "nz/zombies/attack/attack_06.wav", + "nz/zombies/attack/attack_07.wav", + "nz/zombies/attack/attack_08.wav", + "nz/zombies/attack/attack_09.wav", + "nz/zombies/attack/attack_10.wav", + "nz/zombies/attack/attack_11.wav", + "nz/zombies/attack/attack_12.wav", + "nz/zombies/attack/attack_13.wav", + "nz/zombies/attack/attack_14.wav", + "nz/zombies/attack/attack_15.wav", + "nz/zombies/attack/attack_16.wav", + "nz/zombies/attack/attack_17.wav", + "nz/zombies/attack/attack_18.wav", + "nz/zombies/attack/attack_19.wav", + "nz/zombies/attack/attack_20.wav", + "nz/zombies/attack/attack_21.wav", + "nz/zombies/attack/attack_22.wav", +} +ENT.AttackHitSounds = { + "npc/zombie/zombie_hit.wav" +} +ENT.PainSounds = { + "physics/flesh/flesh_impact_bullet1.wav", + "physics/flesh/flesh_impact_bullet2.wav", + "physics/flesh/flesh_impact_bullet3.wav", + "physics/flesh/flesh_impact_bullet4.wav", + "physics/flesh/flesh_impact_bullet5.wav" +} +ENT.DeathSounds = { + "nz/zombies/death/death_00.wav", + "nz/zombies/death/death_01.wav", + "nz/zombies/death/death_02.wav", + "nz/zombies/death/death_03.wav", + "nz/zombies/death/death_04.wav", + "nz/zombies/death/death_05.wav", + "nz/zombies/death/death_06.wav", + "nz/zombies/death/death_07.wav", + "nz/zombies/death/death_08.wav", + "nz/zombies/death/death_09.wav", + "nz/zombies/death/death_10.wav" +} +ENT.WalkSounds = { + "nz/zombies/ambient/ambient_00.wav", + "nz/zombies/ambient/ambient_01.wav", + "nz/zombies/ambient/ambient_02.wav", + "nz/zombies/ambient/ambient_03.wav", + "nz/zombies/ambient/ambient_04.wav", + "nz/zombies/ambient/ambient_05.wav", + "nz/zombies/ambient/ambient_06.wav", + "nz/zombies/ambient/ambient_07.wav", + "nz/zombies/ambient/ambient_08.wav", + "nz/zombies/ambient/ambient_09.wav", + "nz/zombies/ambient/ambient_10.wav", + "nz/zombies/ambient/ambient_11.wav", + "nz/zombies/ambient/ambient_12.wav", + "nz/zombies/ambient/ambient_13.wav", + "nz/zombies/ambient/ambient_14.wav", + "nz/zombies/ambient/ambient_15.wav", + "nz/zombies/ambient/ambient_16.wav", + "nz/zombies/ambient/ambient_17.wav", + "nz/zombies/ambient/ambient_18.wav", + "nz/zombies/ambient/ambient_19.wav", + "nz/zombies/ambient/ambient_20.wav" +} + +ENT.RunSounds = { + "nz/zombies/sprint2/sprint0.wav", + "nz/zombies/sprint2/sprint1.wav", + "nz/zombies/sprint2/sprint2.wav", + "nz/zombies/sprint2/sprint3.wav", + "nz/zombies/sprint2/sprint4.wav", + "nz/zombies/sprint2/sprint5.wav", + "nz/zombies/sprint2/sprint6.wav", + "nz/zombies/sprint2/sprint7.wav", + "nz/zombies/sprint2/sprint8.wav" +} + +function ENT:StatsInitialize() + if SERVER then + local speeds = nzRound:GetZombieSpeeds() + if speeds then + self:SetRunSpeed( nzMisc.WeightedRandom(speeds) ) + else + self:SetRunSpeed( 100 ) + end + self:SetHealth( nzRound:GetZombieHealth() or 75 ) + + --Preselect the emerge sequnces for clientside use + self:SetEmergeSequenceIndex(math.random(#self.EmergeSequences)) + end +end + +function ENT:SpecialInit() + + if CLIENT then + --make them invisible for a really short duration to blend the emerge sequences + self:SetNoDraw(true) + self:TimedEvent( 0.15, function() + self:SetNoDraw(false) + end) + + self:SetRenderClipPlaneEnabled( true ) + self:SetRenderClipPlane(self:GetUp(), self:GetUp():Dot(self:GetPos())) + + --local _, dur = self:LookupSequence(self.EmergeSequences[self:GetEmergeSequenceIndex()]) + local _, dur = self:LookupSequence(self.EmergeSequences[self:GetEmergeSequenceIndex()]) + + self:TimedEvent( dur, function() + self:SetRenderClipPlaneEnabled(false) + end) + + end +end + +function ENT:SoundThink() + if CurTime() > self:GetNextMoanSound() and !self:GetStop() then + --local soundName = self:GetActivity() == ACT_RUN and self.RunSounds[ math.random(#self.RunSounds ) ] or self.WalkSounds[ math.random(#self.WalkSounds ) ] + local soundtbl = self.ActStages[self:GetActStage()] and self[self.ActStages[self:GetActStage()].sounds] or self.WalkSounds + local soundName = soundtbl[math.random(#soundtbl)] + self:EmitSound( soundName, 80 ) + local nextSound = SoundDuration( soundName ) + math.random(0,4) + CurTime() + self:SetNextMoanSound( nextSound ) + end +end + +function ENT:OnSpawn() + + local seq = self.EmergeSequences[self:GetEmergeSequenceIndex()] + local _, dur = self:LookupSequence(seq) + + --dust cloud + local effectData = EffectData() + effectData:SetStart( self:GetPos() ) + effectData:SetOrigin( self:GetPos() ) + effectData:SetMagnitude(dur) + util.Effect("zombie_spawn_dust", effectData) + + -- play emerge animation on spawn + -- if we have a coroutine else just spawn the zombie without emerging for now. + if coroutine.running() then + self:PlaySequenceAndWait(seq) + end +end + +function ENT:OnZombieDeath(dmgInfo) + + if dmgInfo:GetDamageType() == DMG_SHOCK then + self:SetRunSpeed(0) + self.loco:SetVelocity(Vector(0,0,0)) + self:Stop() + local seq, dur = self:LookupSequence(self.ElectrocutionSequences[math.random(#self.ElectrocutionSequences)]) + self:ResetSequence(seq) + self:SetCycle(0) + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + -- Emit electrocution scream here when added + timer.Simple(dur, function() + if IsValid(self) then + self:BecomeRagdoll(dmgInfo) + end + end) + else + self:EmitSound( self.DeathSounds[ math.random( #self.DeathSounds ) ], 100) + self:BecomeRagdoll(dmgInfo) + end + +end + +--A standard attack you can use it or create something fancy yourself +function ENT:Attack( data ) + + self:SetLastAttack(CurTime()) + + --if self:Health() <= 0 then coroutine.yield() return end + + data = data or {} + local attacktbl = self.ActStages[self:GetActStage()] and self[self.ActStages[self:GetActStage()].attackanims] or self.AttackSequences + data.attackseq = data.attackseq or attacktbl[math.random(#attacktbl)] or {seq = "swing", dmgtimes = {1}} + data.attacksound = data.attacksound or self.AttackSounds[ math.random( #self.AttackSounds) ] or Sound( "npc/vort/claw_swing1.wav" ) + data.hitsound = data.hitsound or self.AttackHitSounds[ math.random( #self.AttackHitSounds ) ] or Sound( "npc/zombie/zombie_hit.wav" ) + data.viewpunch = data.viewpunch or VectorRand():Angle() * 0.05 + data.dmglow = data.dmglow or self.DamageLow or 50 + data.dmghigh = data.dmghigh or self.DamageHigh or 70 + data.dmgtype = data.dmgtype or DMG_CLUB + data.dmgforce = data.dmgforce or (self:GetTarget():GetPos() - self:GetPos()) * 7 + Vector( 0, 0, 16 ) + data.dmgforce.z = math.Clamp(data.dmgforce.z, 1, 16) + local seq, dur = self:LookupSequence( data.attackseq.seq ) + data.attackdur = (seq != - 1 and dur) or 0.6 + data.dmgdelay = ( ( data.attackdur != 0 ) and data.attackdur / 2 ) or 0.3 + + self:EmitSound("npc/zombie_poison/pz_throw2.wav", 50, math.random(75, 125)) -- whatever this is!? I will keep it for now + + self:SetAttacking( true ) + + self:TimedEvent(0.1, function() + self:EmitSound( data.attacksound ) + end) + + if self:GetTarget():IsPlayer() then + for k,v in pairs(data.attackseq.dmgtimes) do + self:TimedEvent( v, function() + if self:IsValidTarget( self:GetTarget() ) and self:TargetInRange( self:GetAttackRange() + 10 ) then + local dmgAmount = math.random( data.dmglow, data.dmghigh ) + local dmgInfo = DamageInfo() + dmgInfo:SetAttacker( self ) + dmgInfo:SetDamage( dmgAmount ) + dmgInfo:SetDamageType( data.dmgtype ) + dmgInfo:SetDamageForce( data.dmgforce ) + self:GetTarget():TakeDamageInfo(dmgInfo) + self:GetTarget():EmitSound( data.hitsound, 50, math.random( 80, 160 ) ) + self:GetTarget():ViewPunch( data.viewpunch ) + self:GetTarget():SetVelocity( data.dmgforce ) + + local blood = ents.Create("env_blood") + blood:SetKeyValue("targetname", "carlbloodfx") + blood:SetKeyValue("parentname", "prop_ragdoll") + blood:SetKeyValue("spawnflags", 8) + blood:SetKeyValue("spraydir", math.random(500) .. " " .. math.random(500) .. " " .. math.random(500)) + blood:SetKeyValue("amount", dmgAmount * 5) + blood:SetCollisionGroup( COLLISION_GROUP_WORLD ) + blood:SetPos( self:GetTarget():GetPos() + self:GetTarget():OBBCenter() + Vector( 0, 0, 10 ) ) + blood:Spawn() + blood:Fire("EmitBlood") + SafeRemoveEntityDelayed( blood, 2) --just to make sure everything gets cleaned + end + end) + end + end + + self:TimedEvent(data.attackdur, function() + self:SetAttacking(false) + self:SetLastAttack(CurTime()) + end) + + self:PlayAttackAndWait(data.attackseq.seq, 1) +end + +function ENT:BodyUpdate() + + self.CalcIdeal = ACT_IDLE + + local velocity = self:GetVelocity() + + local len2d = velocity:Length2D() + + local range = 10 + + local curstage = self.ActStages[self:GetActStage()] + local nextstage = self.ActStages[self:GetActStage() + 1] + + if self:GetActStage() <= 0 then -- We are currently idling, no range to start walking + if nextstage and len2d >= nextstage.minspeed then -- We DO NOT apply the range here, he needs to walk at 5 speed! + self:SetActStage( self:GetActStage() + 1 ) + end + -- If there is no minspeed for the next stage, someone did something wrong and we just idle :/ + elseif (curstage and len2d <= curstage.minspeed - range) then + self:SetActStage( self:GetActStage() - 1 ) + elseif (nextstage and len2d >= nextstage.minspeed + range) then + self:SetActStage( self:GetActStage() + 1 ) + elseif !self.ActStages[self:GetActStage() - 1] and len2d < curstage.minspeed - 4 then -- Much smaller range to go back to idling + self:SetActStage(0) + end + + if self.ActStages[self:GetActStage()] then self.CalcIdeal = self.ActStages[self:GetActStage()].act end + + if self:IsJumping() and self:WaterLevel() <= 0 then + self.CalcIdeal = ACT_JUMP + end + + if !self:GetSpecialAnimation() and !self:IsAttacking() then + if self:GetActivity() != self.CalcIdeal and !self:GetStop() then self:StartActivity(self.CalcIdeal) end + + if self.ActStages[self:GetActStage()] then + self:BodyMoveXY() + end + end + + self:FrameAdvance() + +end + +function ENT:TriggerBarricadeJump() + if !self:GetSpecialAnimation() and (!self.NextBarricade or CurTime() > self.NextBarricade) then + self:SetSpecialAnimation(true) + self:SetBlockAttack(true) + local seqtbl = self.ActStages[self:GetActStage()] and self[self.ActStages[self:GetActStage()].barricadejumps] or self.JumpSequences + local seq = seqtbl[math.random(#seqtbl)] + local id, dur = self:LookupSequence(seq.seq) + self:SetSolidMask(MASK_SOLID_BRUSHONLY) + --self:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER) + self.loco:SetAcceleration( 5000 ) + self.loco:SetDesiredSpeed(seq.speed) + self:SetVelocity(self:GetForward() * seq.speed) + self:SetSequence(id) + self:SetCycle(0) + self:SetPlaybackRate(1) + --self:BodyMoveXY() + --PrintTable(self:GetSequenceInfo(id)) + self:TimedEvent(dur, function() + self.NextBarricade = CurTime() + 2 + self:SetSpecialAnimation(false) + self:SetBlockAttack(false) + self.loco:SetAcceleration( self.Acceleration ) + self.loco:SetDesiredSpeed(self:GetRunSpeed()) + self:UpdateSequence() + end) + end +end diff --git a/lua/entities/nz_zombiebase.lua b/lua/entities/nz_zombiebase.lua new file mode 100644 index 00000000..ce00f6ab --- /dev/null +++ b/lua/entities/nz_zombiebase.lua @@ -0,0 +1,1294 @@ +AddCSLuaFile() + +--debug cvars +CreateConVar( "nz_zombie_debug", "0", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_CHEAT } ) + +--[[ +This Base is not really spawnable but it contains a lot of useful functions for it's children +--]] + +--Boring +ENT.Base = "base_nextbot" +ENT.PrintName = "Zombie" +ENT.Category = "Brainz" +ENT.Author = "Lolle & Zet0r" +ENT.Spawnable = true +ENT.AdminOnly = true + +-- Zombie Stuffz +-- fallbacks +ENT.DeathDropHeight = 700 +ENT.StepHeight = 22 --Default is 18 but it makes things easier +ENT.JumpHeight = 70 +ENT.AttackRange = 65 +ENT.RunSpeed = 200 +ENT.WalkSpeed = 100 +ENT.Acceleration = 400 +ENT.DamageLow = 50 +ENT.DamageHigh = 70 + +--The Accessors will be partially shared, but should only be used serverside +AccessorFunc( ENT, "fWalkSpeed", "WalkSpeed", FORCE_NUMBER) +AccessorFunc( ENT, "fRunSpeed", "RunSpeed", FORCE_NUMBER) +AccessorFunc( ENT, "fAttackRange", "AttackRange", FORCE_NUMBER) +AccessorFunc( ENT, "fLastLand", "LastLand", FORCE_NUMBER) +AccessorFunc( ENT, "fLastTargetCheck", "LastTargetCheck", FORCE_NUMBER) +AccessorFunc( ENT, "fLastAtack", "LastAttack", FORCE_NUMBER) +AccessorFunc( ENT, "fLastTargetChange", "LastTargetChange", FORCE_NUMBER) +AccessorFunc( ENT, "fTargetCheckRange", "TargetCheckRange", FORCE_NUMBER) + +--sounds +AccessorFunc( ENT, "fNextMoanSound", "NextMoanSound", FORCE_NUMBER) + +--Stuck prevention +AccessorFunc( ENT, "fLastPostionSave", "LastPostionSave", FORCE_NUMBER) +AccessorFunc( ENT, "fLastPush", "LastPush", FORCE_NUMBER) +AccessorFunc( ENT, "iStuckCounter", "StuckCounter", FORCE_NUMBER) +AccessorFunc( ENT, "vStuckAt", "StuckAt") +AccessorFunc( ENT, "bTimedOut", "TimedOut") + +-- spawner accessor +AccessorFunc(ENT, "hSpawner", "Spawner") + +AccessorFunc( ENT, "bJumping", "Jumping", FORCE_BOOL) +AccessorFunc( ENT, "bAttacking", "Attacking", FORCE_BOOL) +AccessorFunc( ENT, "bClimbing", "Climbing", FORCE_BOOL) +AccessorFunc( ENT, "bStop", "Stop", FORCE_BOOL) +AccessorFunc( ENT, "bSpecialAnim", "SpecialAnimation", FORCE_BOOL) +AccessorFunc( ENT, "bBlockAttack", "BlockAttack", FORCE_BOOL) + +AccessorFunc( ENT, "iActStage", "ActStage", FORCE_NUMBER) + +ENT.ActStages = { + [1] = { + act = ACT_WALK, + minspeed = 5, + }, + [2] = { + act = ACT_WALK_ANGRY, + minspeed = 40, + }, + [3] = { + act = ACT_RUN, + minspeed = 100, + }, + [4] = { + act = ACT_SPRINT, + minspeed = 160, + }, +} + +function ENT:Precache() + + for _,v in pairs(self.Models) do + util.PrecacheModel( v ) + end + + if self.AttackSounds then + for _,v in pairs(self.AttackSounds) do + util.PrecacheSound( v ) + end + end + + if self.AttackHitSounds then + for _,v in pairs(self.AttackHitSounds) do + util.PrecacheSound( v ) + end + end + + if self.PainSounds then + for _,v in pairs(self.PainSounds) do + util.PrecacheSound( v ) + end + end + + if self.DeathSounds then + for _,v in pairs(self.DeathSounds) do + util.PrecacheSound( v ) + end + end + + if self.WalkSounds then + for _,v in pairs(self.WalkSounds) do + util.PrecacheSound( v ) + end + end + + if self.RunSounds then + for _,v in pairs(self.RunSounds) do + util.PrecacheSound( v ) + end + end +end +--Init +function ENT:Initialize() + + self:Precache() + + self:SetModel( self.Models[math.random( #self.Models )] ) + + self:SetJumping( false ) + self:SetLastLand( CurTime() + 1 ) --prevent jumping after spawn + self:SetLastTargetCheck( CurTime() ) + self:SetLastTargetChange( CurTime() ) + + --sounds + self:SetNextMoanSound( CurTime() + 1 ) + + --stuck prevetion + self:SetLastPush( CurTime() ) + self:SetLastPostionSave( CurTime() ) + self:SetStuckAt( self:GetPos() ) + self:SetStuckCounter( 0 ) + + self:SetAttacking( false ) + self:SetLastAttack( CurTime() ) + self:SetAttackRange( self.AttackRange ) + self:SetTargetCheckRange(0) -- 0 for no distance restriction (infinite) + + --target ignore + self:ResetIgnores() + + self:SetHealth( 75 ) --fallback + + self:SetRunSpeed( self.RunSpeed ) --fallback + self:SetWalkSpeed( self.WalkSpeed ) --fallback + + self:SetCollisionBounds(Vector(-16,-16, 0), Vector(16, 16, 70)) + + self:SetActStage(0) + self:SetSpecialAnimation(false) + + self:StatsInitialize() + self:SpecialInit() + + if SERVER then + self.loco:SetDeathDropHeight( self.DeathDropHeight ) + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + self.loco:SetAcceleration( self.Acceleration ) + self.loco:SetJumpHeight( self.JumpHeight ) + end + + for i,v in ipairs(self:GetBodyGroups()) do + self:SetBodygroup( i-1, math.random(0, self:GetBodygroupCount(i-1) - 1)) + end + self:SetSkin( math.random(self:SkinCount()) - 1 ) + +end + +--init for class related attributes hooks etc... +function ENT:SpecialInit() + --print("PLEASE Override the base class!") +end + +function ENT:StatsInit() + --print("PLEASE Override the base class!") +end + +function ENT:Think() + if SERVER then --think is shared since last update but all the stuff in here should be serverside + if !self:IsJumping() and !self:GetSpecialAnimation() and (self:GetSolidMask() == MASK_NPCSOLID_BRUSHONLY or self:GetSolidMask() == MASK_SOLID_BRUSHONLY) then + local occupied = false + local tr = util.TraceHull( { + start = self:GetPos(), + endpos = self:GetPos(), + filter = self, + mins = Vector( -20, -20, -0 ), + maxs = Vector( 20, 20, 70 ), + mask = MASK_NPCSOLID + } ) + if !tr.HitNonWorld then + self:SetSolidMask(MASK_NPCSOLID) + self:SetCollisionGroup(COLLISION_GROUP_PLAYER) + --print("No longer no-colliding") + end + --[[for _,ent in pairs(ents.FindInBox(self:GetPos() + Vector( -16, -16, 0 ), self:GetPos() + Vector( 16, 16, 70 ))) do + if ent:GetClass() == "nz_zombie*" and ent != self then occupied = true end + end + if !occupied then self:SetSolidMask(MASK_NPCSOLID) end]] + end + + if self.loco:IsUsingLadder() then + --self:SetSolidMask(MASK_NPCSOLID_BRUSHONLY) + end + + --this is a very costly operation so we only do it every second + if self:GetLastTargetCheck() + 1 < CurTime() then + self:SetTarget(self:GetPriorityTarget()) + end + + -- We don't want to say we're stuck if it's because we're attacking or timed out + if !self:GetAttacking() and !self:GetTimedOut() and self:GetLastPostionSave() + 4 < CurTime() then + if self:GetPos():Distance( self:GetStuckAt() ) < 10 then + self:SetStuckCounter( self:GetStuckCounter() + 1) + else + self:SetStuckCounter( 0 ) + end + + if self:GetStuckCounter() > 2 then + + local tr = util.TraceHull({ + start = self:GetPos(), + endpos = self:GetPos(), + maxs = self:OBBMaxs(), + mins = self:OBBMins(), + filter = self + }) + if tr.Hit then + --if there bounding box is intersecting with something there is now way we can unstuck them just respawn. + --make a dust cloud to make it look less ugly + local effectData = EffectData() + effectData:SetStart( self:GetPos() + Vector(0,0,32) ) + effectData:SetOrigin( self:GetPos() + Vector(0,0,32) ) + effectData:SetMagnitude(1) + util.Effect("zombie_spawn_dust", effectData) + + self:RespawnZombie() + self:SetStuckCounter( 0 ) + end + + if self:GetStuckCounter() <= 3 then + --try to unstuck via random velocity + self:ApplyRandomPush() + end + + if self:GetStuckCounter() > 3 and self:GetStuckCounter() <= 5 then + --try to unstuck via jump + self:Jump() + end + + if self:GetStuckCounter() > 5 then + --Worst case: + --respawn the zombie after 32 seconds with no postion change + self:RespawnZombie() + self:SetStuckCounter( 0 ) + end + + end + self:SetLastPostionSave( CurTime() ) + self:SetStuckAt( self:GetPos() ) + end + + --sounds + self:SoundThink() + + if self:ZombieWaterLevel() == 3 then + self:RespawnZombie() + end + + self:DebugThink() + + end + self:OnThink() +end + +function ENT:DebugThink() + if GetConVar( "nz_zombie_debug" ):GetBool() then + local spacing = Vector(0,0,64) + local target = self:GetTarget() + if target then + debugoverlay.Text( self:GetPos() + spacing, tostring(target), FrameTime() * 2 ) + else + debugoverlay.Text( self:GetPos() + spacing, "NO_TARGET", FrameTime() * 2 ) + end + spacing = spacing + Vector(0,0,8) + local attacking = self:IsAttacking() + if attacking then + debugoverlay.Text( self:GetPos() + spacing, "IN_ATTACK", FrameTime() * 2 ) + elseif self:IsTimedOut() then + debugoverlay.Text( self:GetPos() + spacing, "TIMED_OUT", FrameTime() * 2 ) + elseif target then + debugoverlay.Text( self:GetPos() + spacing, "MOVING_TO_TARGET", FrameTime() * 2 ) + else + debugoverlay.Text( self:GetPos() + spacing, "ERROR", FrameTime() * 2 ) + end + spacing = spacing + Vector(0,0,8) + debugoverlay.Text( self:GetPos() + spacing, tostring(self), FrameTime() * 2 ) + end +end + +function ENT:SoundThink() + if CurTime() > self:GetNextMoanSound() and !self:GetStop() then + --local soundName = self:GetActivity() == ACT_RUN and self.RunSounds[ math.random(#self.RunSounds ) ] or self.WalkSounds[ math.random(#self.WalkSounds ) ] + local soundName = self.WalkSounds[math.random(#self.WalkSounds)] + self:EmitSound( soundName, 80 ) + local nextSound = SoundDuration( soundName ) + math.random(0,4) + CurTime() + self:SetNextMoanSound( nextSound ) + end +end + +function ENT:RunBehaviour() + + self:SpawnZombie() + + while (true) do + if !self:GetStop() then + self:SetTimedOut(false) + if self:HasTarget() then + local pathResult = self:ChaseTarget( { + maxage = 1, + draw = false, + tolerance = ((self:GetAttackRange() -20) > 0 ) and self:GetAttackRange() - 10 + } ) + if pathResult == "ok" then + if self:TargetInAttackRange() then + self:OnTargetInAttackRange() + else + self:TimeOut(1) + end + elseif pathResult == "timeout" then --asume pathing timedout, maybe we are stuck maybe we are blocked by barricades + local barricade = self:CheckForBarricade() + if barricade then + self:OnBarricadeBlocking( barricade ) + else + self:OnPathTimeOut() + end + else + -- self:TimeOut(2) + --path failed what should we do :/? + end + else + self:OnNoTarget() + end + else + self:TimeOut(2) + end + end +end + +function ENT:Stop() + self:SetStop(true) + self:SetTarget(nil) +end + +--Draw sppoky red eyes +local eyeGlow = Material( "sprites/redglow1" ) +local white = Color( 255, 255, 255, 255 ) + +function ENT:Draw() + self:DrawModel() + if self.RedEyes then + --local eyes = self:GetAttachment(self:LookupAttachment("eyes")).Pos + --local leftEye = eyes + self:GetRight() * -1.5 + self:GetForward() * 0.5 + --local rightEye = eyes + self:GetRight() * 1.5 + self:GetForward() * 0.5 + + local leftEye = self:GetAttachment(self:LookupAttachment("lefteye")).Pos + local rightEye = self:GetAttachment(self:LookupAttachment("righteye")).Pos + cam.Start3D(EyePos(),EyeAngles()) + render.SetMaterial( eyeGlow ) + render.DrawSprite( leftEye, 4, 4, white) + render.DrawSprite( rightEye, 4, 4, white) + cam.End3D() + end + if GetConVar( "nz_zombie_debug" ):GetBool() then + render.DrawWireframeBox(self:GetPos(), Angle(0,0,0), self:OBBMins(), self:OBBMaxs(), Color(255,0,0), true) + render.DrawWireframeSphere(self:GetPos(), self:GetAttackRange(), 10, 10, Color(255,165,0), true) + end +end + +--[[ + Events + You can easily override them. + Todo: Add Hooks +--]] + +function ENT:SpawnZombie() + --BAIL if no navmesh is near + local nav = navmesh.GetNearestNavArea( self:GetPos() ) + if !self:IsInWorld() or !IsValid(nav) or nav:GetClosestPointOnArea( self:GetPos() ):DistToSqr( self:GetPos() ) >= 10000 then + ErrorNoHalt("Zombie ["..self:GetClass().."]["..self:EntIndex().."] spawned too far away from a navmesh!") + self:RespawnZombie() + end + + self:OnSpawn() +end + +function ENT:OnSpawn() + +end + +function ENT:OnTargetInAttackRange() + if !self:GetBlockAttack() then + self:Attack() + else + self:TimeOut(2) + end +end + +function ENT:OnBarricadeBlocking( barricade ) + if (IsValid(barricade) and barricade:GetClass() == "breakable_entry" ) then + if barricade:GetNumPlanks() > 0 then + timer.Simple(0.3, function() + + barricade:EmitSound("physics/wood/wood_plank_break" .. math.random(1, 4) .. ".wav", 100, math.random(90, 130)) + + barricade:RemovePlank() + + end) + + self:PlaySequenceAndWait(self.AttackSequences[math.random( #self.AttackSequences )].seq, 1) + self:SetLastAttack(CurTime()) + self:SetAttacking(true) + + -- this will cause zombies to attack the barricade until it's destroyed + local stillBlocked = self:CheckForBarricade() + if stillBlocked then + self:OnBarricadeBlocking(stillBlocked) + end + elseif barricade:GetTriggerJumps() then + if self.TriggerBarricadeJump then self:TriggerBarricadeJump() end + end + end +end + +function ENT:TimeOut(time) + self:SetTimedOut(true) + if coroutine.running() then + coroutine.wait(time) + end +end + +function ENT:OnPathTimeOut() + +end + +function ENT:OnNoTarget() + -- Game over! Walk around randomly + if nzRound:InState( ROUND_GO ) then + self:StartActivity(ACT_WALK) + self.loco:SetDesiredSpeed(40) + self:MoveToPos(self:GetPos() + Vector(math.random(-512, 512), math.random(-512, 512), 0), { + repath = 3, + maxage = 5 + }) + else + self:TimeOut(0.5) + -- Start off by checking for a new target + local newtarget = self:GetPriorityTarget() + if self:IsValidTarget(newtarget) then + self:SetTarget(newtarget) + else + -- If not visible to players respawn immediately + if !self:IsInSight() then + self:RespawnZombie() + else + self:UpdateSequence() -- Updates the sequence to be idle animation + self:StartActivity(self.CalcIdeal) -- Starts the newly updated sequence + self:TimeOut(3) -- Time out even longer if seen + end + end + end +end + +function ENT:OnContactWithTarget() + +end + +function ENT:OnLandOnGroundZombie() + +end + +function ENT:OnThink() + +end + +--Default NEXTBOT Events +function ENT:OnLandOnGround() + self:EmitSound("physics/flesh/flesh_impact_hard" .. math.random(1, 6) .. ".wav") + self:SetJumping( false ) + if self:HasTarget() then + self.loco:SetDesiredSpeed(self:GetRunSpeed()) + else + self.loco:SetDesiredSpeed(self:GetWalkSpeed()) + end + self.loco:SetAcceleration( self.Acceleration ) + self.loco:SetStepHeight( 22 ) + self:SetLastLand(CurTime()) + self:OnLandOnGroundZombie() +end + +function ENT:OnLeaveGround( ent ) + self:SetJumping( true ) +end + +function ENT:OnNavAreaChanged(old, new) + if bit.band(new:GetAttributes(), NAV_MESH_JUMP) != 0 then + --dont make jumps in the wrong direction + if old:ComputeGroundHeightChange( new ) < 0 then + return + end + self:Jump() + end +end + +function ENT:OnContact( ent ) + if nzConfig.ValidEnemies[ent:GetClass()] and nzConfig.ValidEnemies[self:GetClass()] then + --this is a poor approach to unstuck them when walking into each other + self.loco:Approach( self:GetPos() + Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0 ) * 2000,1000) + --important if the get stuck on top of each other! + --if math.abs(self:GetPos().z - ent:GetPos().z) > 30 then self:SetSolidMask( MASK_NPCSOLID_BRUSHONLY ) end + end + --buggy prop push away thing comment if you dont want this :) + if ( ent:GetClass() == "prop_physics_multiplayer" or ent:GetClass() == "prop_physics" ) then + --self.loco:Approach( self:GetPos() + Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0 ) * 2000,1000) + local phys = ent:GetPhysicsObject() + if IsValid(phys) then + local force = -physenv.GetGravity().z * phys:GetMass() / 12 * ent:GetFriction() + local dir = ent:GetPos() - self:GetPos() + dir:Normalize() + phys:ApplyForceCenter( dir * force ) + end + end + + if self:IsTarget( ent ) then + self:OnContactWithTarget() + end +end + +function ENT:OnInjured( dmgInfo ) + local attacker = dmgInfo:GetAttacker() + if self:IsValidTarget( attacker ) then + self:SetTarget( attacker ) + end + local soundName = self.PainSounds[ math.random( #self.PainSounds ) ] + self:EmitSound( soundName, 90 ) +end + +function ENT:OnZombieDeath() + self:BecomeRagdoll(dmgInfo) +end + +function ENT:OnKilled(dmgInfo) + + self:OnZombieDeath(dmgInfo) + hook.Call("OnZombieKilled", GAMEMODE, self, dmgInfo) + +end + +function ENT:OnRemove() + +end + +function ENT:OnStuck() + -- + --self.loco:Approach( self:GetPos() + Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0 ) * 2000, 1000 ) + --print("Now I'm stuck", self) +end + +--Target and pathfidning +function ENT:GetPriorityTarget() + + self:SetLastTargetCheck( CurTime() ) + + --if you really would want something that atracts the zombies from everywhere you would need something like this + local allEnts = ents.GetAll() + --[[for _, ent in pairs(allEnts) do + if ent:GetTargetPriority() == TARGET_PRIORITY_ALWAYS and self:IsValidTarget(ent) then + return ent + end + end]] + + -- Disabled the above for for now since it just might be better to use that same loop for everything + + local bestTarget = nil + local highestPriority = TARGET_PRIORITY_NONE + local maxdistsqr = self:GetTargetCheckRange()^2 + local targetDist = maxdistsqr + 10 + + --local possibleTargets = ents.FindInSphere( self:GetPos(), self:GetTargetCheckRange()) + + for _, target in pairs(allEnts) do + if self:IsValidTarget(target) and !self:IsIgnoredTarget(target) then + + if target:GetTargetPriority() == TARGET_PRIORITY_ALWAYS then return target end + + local dist = self:GetRangeSquaredTo( target:GetPos() ) + if maxdistsqr <= 0 or dist <= maxdistsqr then -- 0 distance is no distance restrictions + local priority = target:GetTargetPriority() + if target:GetTargetPriority() > highestPriority then + highestPriority = priority + bestTarget = target + targetDist = dist + elseif target:GetTargetPriority() == highestPriority then + if targetDist > dist then + highestPriority = priority + bestTarget = target + targetDist = dist + end + end + --print(highestPriority, bestTarget, targetDist, maxdistsqr) + end + end + end + + return bestTarget +end + +function ENT:ChaseTarget( options ) + + options = options or {} + + if !options.target then + options.target = self:GetTarget() + end + + local path = self:ChaseTargetPath( options ) + + if ( !IsValid(path) ) then return "failed" end + while ( path:IsValid() and self:HasTarget() and !self:TargetInAttackRange() ) do + + path:Update( self ) + + --Timeout the pathing so it will rerun the entire behaviour (break barricades etc) + if ( path:GetAge() > options.maxage ) then + return "timeout" + end + + path:Update( self ) -- This function moves the bot along the path + if options.draw or GetConVar( "nz_zombie_debug" ):GetBool() then + path:Draw() + end + + --the jumping part simple and buggy + --local scanDist = (self.loco:GetVelocity():Length()^2)/(2*900) + 15 + local scanDist + --this will probaly need asjustments to fit the zombies speed + if self:GetVelocity():Length2D() > 150 then scanDist = 30 else scanDist = 20 end + --debug section + if GetConVar( "nz_zombie_debug" ):GetBool() then + debugoverlay.Line( self:GetPos(), path:GetClosestPosition(self:EyePos() + self.loco:GetGroundMotionVector() * scanDist), 0.05, Color(0,0,255,0) ) + local losColor = Color(255,0,0) + if self:IsLineOfSightClear( self:GetTarget():GetPos() + Vector(0,0,35) ) then + losColor = Color(0,255,0) + end + debugoverlay.Line( self:EyePos(), self:GetTarget():GetPos() + Vector(0,0,35), 0.03, losColor ) + --[[local nav = navmesh.GetNearestNavArea( self:GetPos() ) + if IsValid(nav) and nav:GetClosestPointOnArea( self:GetPos() ):DistToSqr( self:GetPos() ) < 2500 then + debugoverlay.Line( nav:GetCorner( 0 ), nav:GetCorner( 1 ), 0.05, Color(255,0,0), true ) + debugoverlay.Line( nav:GetCorner( 0 ), nav:GetCorner( 3 ), 0.05, Color(255,0,0), true ) + debugoverlay.Line( nav:GetCorner( 1 ), nav:GetCorner( 2 ), 0.05, Color(255,0,0), true ) + debugoverlay.Line( nav:GetCorner( 2 ), nav:GetCorner( 3 ), 0.05, Color(255,0,0), true ) + for _,v in pairs(nav:GetAdjacentAreas()) do + debugoverlay.Line( v:GetCorner( 0 ), v:GetCorner( 1 ), 0.05, Color(150,80,0,80), true ) + debugoverlay.Line( v:GetCorner( 0 ), v:GetCorner( 3 ), 0.05, Color(150,80,0,80), true ) + debugoverlay.Line( v:GetCorner( 1 ), v:GetCorner( 2 ), 0.05, Color(150,80,0,80), true ) + debugoverlay.Line( v:GetCorner( 2 ), v:GetCorner( 3 ), 0.05, Color(150,80,0,80), true ) + end + end ]]-- + end + --print(self.loco:GetGroundMotionVector(), self:GetForward()) + local goal = path:GetCurrentGoal() + + --height triggered jumping + if path:IsValid() and math.abs(self:GetPos().z - path:GetClosestPosition(self:EyePos() + self.loco:GetGroundMotionVector() * scanDist).z) > 22 and (goal and goal.type != 1) then + self:Jump() + end + + --[[if path:IsValid() and goal.type == 4 then + --self.loco:SetVelocity( Vector( 0, 0, 1000 ) ) + self:SetPos( path:GetClosestPosition( goal.ladder:GetTopForwardArea():GetCenter() ) ) + self:SetClimbing( true ) + coroutine.wait( 0.5 ) + self:SetSolidMask( MASK_NPCSOLID_BRUSHONLY ) + return "timeout" + if self.loco:IsUsingLadder() then + self.loco:SetVelocity( self.loco:GetVelocity() + Vector( 0, 0, 50 ) ) + end + end --]] + + -- If we're stuck, then call the HandleStuck function and abandon + if ( self.loco:IsStuck() ) then + self:HandleStuck() + return "stuck" + end + + if self.loco:GetVelocity():Length() < 10 then + self:ApplyRandomPush() + end + + coroutine.yield() + + end + + return "ok" + +end + +function ENT:ChaseTargetPath( options ) + + options = options or {} + + local path = Path( "Follow" ) + path:SetMinLookAheadDistance( options.lookahead or 300 ) + path:SetGoalTolerance( options.tolerance or 50 ) + + --[[local targetPos = options.target:GetPos() + --set the goal to the closet navmesh + local goal = navmesh.GetNearestNavArea(targetPos, false, 100) + goal = goal and goal:GetClosestPointOnArea(targetPos) or targetPos--]] + + --Custom path computer, the same as default but not pathing through locked nav areas. + path:Compute( self, options.target:GetPos(), function( area, fromArea, ladder, elevator, length ) + if ( !IsValid( fromArea ) ) then + --first area in path, no cost + return 0 + else + if ( !self.loco:IsAreaTraversable( area ) ) then + --our locomotor says we can't move here + return -1 + end + --Prevent movement through either locked navareas or areas with closed doors + if (nz.Nav.Data[area:GetID()]) then + --print("Has area") + if nz.Nav.Data[area:GetID()].link then + --print("Area has door link") + if !nzDoors.OpenedLinks[nz.Nav.Data[area:GetID()].link] then + --print("Door link is not opened") + return -1 + end + elseif nz.Nav.Data[area:GetID()].locked then + --print("Area is locked") + return -1 end + end + --compute distance traveled along path so far + local dist = 0 + --[[if ( IsValid( ladder ) ) then + dist = ladder:GetLength() + elseif ( length > 0 ) then + --optimization to avoid recomputing length + dist = length + else + dist = ( area:GetCenter() - fromArea:GetCenter() ):GetLength() + end]]-- + local cost = dist + fromArea:GetCostSoFar() + --check height change + local deltaZ = fromArea:ComputeAdjacentConnectionHeightChange( area ) + if ( deltaZ >= self.loco:GetStepHeight() ) then + -- use player default max jump height even thouh teh zombie will jump a bit higher + if ( deltaZ >= 64 ) then + --Include ladders in pathing: + --currently disableddue to the lack of a loco:Climb function + --[[if IsValid( ladder ) then + if ladder:GetTopForwardArea():GetID() == area:GetID() then + return cost + end + end --]] + --too high to reach + return -1 + end + --jumping is slower than flat ground + local jumpPenalty = 1.1 + cost = cost + jumpPenalty * dist + elseif ( deltaZ < -self.loco:GetDeathDropHeight() ) then + --too far to drop + return -1 + end + return cost + end + end) + + -- this will replace nav groups + -- we do this after pathing to know when this happens + local lastSeg = path:LastSegment() + + -- a little more complicated that i thought but it should do the trick + if lastSeg then + if self:GetTargetNavArea() and lastSeg.area:GetID() != self:GetTargetNavArea():GetID() then + if !nz.Nav.Data[self:GetTargetNavArea():GetID()] or nz.Nav.Data[self:GetTargetNavArea():GetID()].locked then + self:IgnoreTarget(self:GetTarget()) + -- trigger a retarget + self:SetLastTargetCheck(CurTime() - 1) + self:TimeOut(0.5) + return nil + end + else + self:ResetIgnores() + return path + end + end + + return path + +end + +function ENT:GetLadderTop( ladder ) + return ladder:GetTopForwardArea() or ladder:GetTopBehindArea() or ladder:GetTopRightArea() or ladder:GetTopLeftArea() +end + +function ENT:TargetInAttackRange() + return self:TargetInRange( self:GetAttackRange() ) +end + +function ENT:TargetInRange( range ) + local target = self:GetTarget() + if !IsValid(target) then return false end + return self:GetRangeTo( target:GetPos() ) < range +end + +function ENT:CheckForBarricade() + --we try a line trace first since its more efficient + local dataL = {} + dataL.start = self:GetPos() + Vector( 0, 0, self:OBBCenter().z ) + dataL.endpos = self:GetPos() + Vector( 0, 0, self:OBBCenter().z ) + self:GetForward() * 32 + dataL.filter = function( ent ) if ( ent:GetClass() == "breakable_entry" ) then return true end end + dataL.ignoreworld = true + local trL = util.TraceLine( dataL ) + + if IsValid( trL.Entity ) and trL.Entity:GetClass() == "breakable_entry" then + return trL.Entity + end + + --perform a hull trace if line didnt hit just to make sure + local dataH = {} + dataH.start = self:GetPos() + dataH.endpos = self:GetPos() + self:GetForward() * 32 + dataH.filter = function( ent ) if ( ent:GetClass() == "breakable_entry" ) then return true end end + dataH.mins = self:OBBMins() * 0.65 + dataH.maxs = self:OBBMaxs() * 0.65 + local trH = util.TraceHull(dataH ) + + if IsValid( trH.Entity ) and trH.Entity:GetClass() == "breakable_entry" then + return trH.Entity + end + + return nil + +end + +--A standard attack you can use it or create something fancy yourself +function ENT:Attack( data ) + + self:SetLastAttack(CurTime()) + + --if self:Health() <= 0 then coroutine.yield() return end + + data = data or {} + data.attackseq = data.attackseq or self.AttackSequences[ math.random( #self.AttackSequences ) ].seq or "swing" + data.attacksound = data.attacksound or self.AttackSounds[ math.random( #self.AttackSounds) ] or Sound( "npc/vort/claw_swing1.wav" ) + data.hitsound = data.hitsound or self.AttackHitSounds[ math.random( #self.AttackHitSounds ) ]Sound( "npc/zombie/zombie_hit.wav" ) + data.viewpunch = data.viewpunch or VectorRand():Angle() * 0.05 + data.dmglow = data.dmglow or self.DamageLow or 50 + data.dmghigh = data.dmghigh or self.DamageHigh or 70 + data.dmgtype = data.dmgtype or DMG_CLUB + data.dmgforce = data.dmgforce or (self:GetTarget():GetPos() - self:GetPos()) * 7 + Vector( 0, 0, 16 ) + data.dmgforce.z = math.Clamp(data.dmgforce.z, 1, 16) + local seq, dur = self:LookupSequence( data.attackseq ) + data.attackdur = (seq != - 1 and dur) or 0.6 + data.dmgdelay = data.dmgdelay or ( ( data.attackdur != 0 ) and data.attackdur / 2 ) or 0.3 + + self:EmitSound("npc/zombie_poison/pz_throw2.wav", 50, math.random(75, 125)) -- whatever this is!? I will keep it for now + + self:SetAttacking( true ) + + self:TimedEvent(0.1, function() + self:EmitSound( data.attacksound ) + end) + + self:TimedEvent( data.dmgdelay, function() + if self:IsValidTarget( self:GetTarget() ) and self:TargetInRange( self:GetAttackRange() + 10 ) then + local dmgAmount = math.random( data.dmglow, data.dmghigh ) + local dmgInfo = DamageInfo() + dmgInfo:SetAttacker( self ) + dmgInfo:SetDamage( dmgAmount ) + dmgInfo:SetDamageType( data.dmgtype ) + dmgInfo:SetDamageForce( data.dmgforce ) + self:GetTarget():TakeDamageInfo(dmgInfo) + self:GetTarget():EmitSound( data.hitsound, 50, math.random( 80, 160 ) ) + if self:GetTarget().ViewPunch then + self:GetTarget():ViewPunch( data.viewpunch ) + end + self:GetTarget():SetVelocity( data.dmgforce ) + + local blood = ents.Create("env_blood") + blood:SetKeyValue("targetname", "carlbloodfx") + blood:SetKeyValue("parentname", "prop_ragdoll") + blood:SetKeyValue("spawnflags", 8) + blood:SetKeyValue("spraydir", math.random(500) .. " " .. math.random(500) .. " " .. math.random(500)) + blood:SetKeyValue("amount", dmgAmount * 5) + blood:SetCollisionGroup( COLLISION_GROUP_WORLD ) + blood:SetPos( self:GetTarget():GetPos() + self:GetTarget():OBBCenter() + Vector( 0, 0, 10 ) ) + blood:Spawn() + blood:Fire("EmitBlood") + SafeRemoveEntityDelayed( blood, 2) --just to make sure everything gets cleaned + end + end) + + self:TimedEvent(data.attackdur, function() + self:SetAttacking(false) + self:SetLastAttack(CurTime()) + end) + + self:PlayAttackAndWait(data.attackseq, 1) +end + +function ENT:PlayAttackAndWait( name, speed ) + + local len = self:SetSequence( name ) + speed = speed or 1 + + self:ResetSequenceInfo() + self:SetCycle( 0 ) + self:SetPlaybackRate( speed ) + + local endtime = CurTime() + len / speed + + while ( true ) do + + if ( endtime < CurTime() ) then + if !self:GetStop() then + self:StartActivity( ACT_WALK ) + self.loco:SetDesiredSpeed( self:GetRunSpeed() ) + end + return + end + if self:IsValidTarget( self:GetTarget() ) and self:TargetInRange( self:GetAttackRange() * 2 ) then + self.loco:SetDesiredSpeed( self:GetRunSpeed() / 3 ) + self.loco:Approach( self:GetTarget():GetPos(), 10 ) + self.loco:FaceTowards( self:GetTarget():GetPos() ) + end + + coroutine.yield() + + end + +end + +--we do our own jump since the loco one is a bit weird. +function ENT:Jump() + if CurTime() < self:GetLastLand() + 0.5 or navmesh.GetNavArea(self:GetPos(), 50):HasAttributes( NAV_MESH_NO_JUMP ) then return end + if !self:IsOnGround() then return end + self.loco:SetDesiredSpeed( 450 ) + self.loco:SetAcceleration( 5000 ) + self:SetJumping( true ) + --self:SetSolidMask( MASK_NPCSOLID_BRUSHONLY ) + self.loco:Jump() + --Boost them + self:TimedEvent( 0.5, function() self.loco:SetVelocity( self:GetForward() * 5 ) end) +end + +function ENT:Flames( state ) + if state then + self.FlamesEnt = ents.Create("env_fire") + if IsValid( self.FlamesEnt ) then + self.FlamesEnt:SetParent(self) + self.FlamesEnt:SetOwner(self) + self.FlamesEnt:SetPos(self:GetPos() - Vector(0, 0, -50)) + --no glow + delete when out + start on + last forever + self.FlamesEnt:SetKeyValue("spawnflags", tostring(128 + 32 + 4 + 2 + 1)) + self.FlamesEnt:SetKeyValue("firesize", (1 * math.Rand(0.7, 1.1))) + self.FlamesEnt:SetKeyValue("fireattack", 0) + self.FlamesEnt:SetKeyValue("health", 0) + self.FlamesEnt:SetKeyValue("damagescale", "-10") -- only neg. value prevents dmg + + self.FlamesEnt:Spawn() + self.FlamesEnt:Activate() + end + elseif IsValid( self.FlamesEnt ) then + self.FlamesEnt:Remove() + self.FlamesEnt = nil + end +end + +function ENT:Explode( dmg, suicide) + + suicide = suicide or true + + local ex = ents.Create("env_explosion") + ex:SetPos(self:GetPos()) + ex:SetKeyValue( "iMagnitude", tostring( dmg ) ) + ex:SetOwner(self) + ex:Spawn() + ex:Fire("Explode",0,0) + ex:EmitSound( "weapons/explode" .. math.random( 3, 5 ) .. ".wav" ) + ex:Fire("Kill",0,0) + + if suicide then self:TimedEvent( 0, function() self:Kill() end ) end + +end + +function ENT:Kill() + self:TakeDamage( 10000, self, self ) +end + +function ENT:RespawnZombie() + if SERVER then + if self:GetSpawner() then + self:GetSpawner():IncrementZombiesToSpawn() + end + + self:Remove() + end +end + +function ENT:IsInSight() + for _, ply in pairs( player.GetAll() ) do + --can player see us or the teleport location + if ply:Alive() and ply:IsLineOfSightClear( self ) then + if ply:GetAimVector():Dot((self:GetPos() - ply:GetPos()):GetNormalized()) > 0 then + return true + end + end + end +end + +function ENT:TeleportToTarget( silent ) + + if !self:HasTarget() then return false end + + --that's probably not smart, just like me. SORRY D: + local locations = { + Vector( 256, 0, 0), + Vector( -256, 0, 0), + Vector( 0, 256, 0), + Vector( 0, -256, 0), + Vector( 256, 256, 0), + Vector( -256, -256, 0), + Vector( 512, 0, 0), + Vector( -512, 0, 0), + Vector( 0, 512, 0), + Vector( 0, -512, 0), + Vector( 512, 512, 0), + Vector( -512, -512, 0), + Vector( 1024, 0, 0), + Vector( -1024, 0, 0), + Vector( 0, 1024, 0), + Vector( 0, -1024, 0), + Vector( 1024, 1024, 0), + Vector( -1024, -1024, 0) + } + + --resource friendly shuffle + local rand = math.random + local n = #locations + + while n > 2 do + + local k = rand(n) -- 1 <= k <= n + + locations[n], locations[k] = locations[k], locations[n] + n = n - 1 + + end + + for _, v in pairs( locations ) do + + local area = navmesh.GetNearestNavArea( self:GetTarget():GetPos() + v ) + + if area then + + local location = area:GetRandomPoint() + Vector( 0, 0, 2 ) + + local tr = util.TraceHull( { + start = location, + endpos = location, + maxs = Vector( 16, 16, 40 ), --DOGE is small + mins = Vector( -16, -16, 0 ), + } ) + + --debugoverlay.Box( location, Vector( -16, -16, 0 ), Vector( 16, 16, 40 ), 5, Color( 255, 0, 0 ) ) + + if silent then + if !tr.Hit and nz.Nav.NavGroupIDs[navmesh.GetNearestNavArea(location):GetID()] == nz.Nav.NavGroupIDs[navmesh.GetNearestNavArea(self:GetPos()):GetID()] then + local inFOV = false + for _, ply in pairs( player.GetAllPlayingAndAlive() ) do + --can player see us or the teleport location + if ply:Alive() and ply:IsLineOfSightClear( location ) or ply:IsLineOfSightClear( self ) then + inFOV = true + end + end + if !inFOV then + self:SetPos( location ) + return true + end + end + else + self:SetPos( location ) + end + end + end + + return false + +end + +--broken +function ENT:InFieldOfView( pos ) + + local fov = math.rad( math.cos( 110 ) ) + local v = ( Vector( pos.x, pos.y, 0 ) - Vector( self:GetPos().x, self:GetPos().y, 0 ) ):GetNormalized() + + if self:GetAimVector():Dot( v ) > fov then + local tr = util.TraceLine( { + start = self:GetShootPos(), + endpos = pos + Vector( 0, 0, 64), + filter = self + } ) + + if !tr.Hit then return true end + + end + + return true + +end + +function ENT:BodyUpdate() + + self.CalcIdeal = ACT_IDLE + + local velocity = self:GetVelocity() + + local len2d = velocity:Length2D() + + local range = 10 + + local curstage = self.ActStages[self:GetActStage()] + local nextstage = self.ActStages[self:GetActStage() + 1] + + if self:GetActStage() <= 0 then -- We are currently idling, no range to start walking + if nextstage and len2d >= nextstage.minspeed then -- We DO NOT apply the range here, he needs to walk at 5 speed! + self:SetActStage( self:GetActStage() + 1 ) + end + -- If there is no minspeed for the next stage, someone did something wrong and we just idle :/ + elseif (curstage and len2d <= curstage.minspeed - range) then + self:SetActStage( self:GetActStage() - 1 ) + elseif (nextstage and len2d >= nextstage.minspeed + range) then + self:SetActStage( self:GetActStage() + 1 ) + elseif !self.ActStages[self:GetActStage() - 1] and len2d < curstage.minspeed - 4 then -- Much smaller range to go back to idling + self:SetActStage(0) + end + + if self.ActStages[self:GetActStage()] then self.CalcIdeal = self.ActStages[self:GetActStage()].act end + + if self:IsJumping() and self:WaterLevel() <= 0 then + self.CalcIdeal = ACT_JUMP + end + + if !self:GetSpecialAnimation() and !self:IsAttacking() then + if self:GetActivity() != self.CalcIdeal and !self:GetStop() then self:StartActivity(self.CalcIdeal) end + + if self.ActStages[self:GetActStage()] then + self:BodyMoveXY() + end + end + + self:FrameAdvance() + +end + +function ENT:UpdateSequence() + self:SetActStage(0) + self:BodyUpdate() +end + +function ENT:GetAimVector() + + return self:GetForward() + +end + +function ENT:GetShootPos() + + return self:EyePos() + +end + +--Helper function +function ENT:TimedEvent(time, callback) + timer.Simple(time, function() + if (IsValid(self) and self:Health() > 0) then + callback() + end + end) +end + +function ENT:ApplyRandomPush( power ) + if CurTime() < self:GetLastPush() + 0.2 or !self:IsOnGround() then return end + power = power or 100 + local vec = self.loco:GetVelocity() + VectorRand() * power + vec.z = math.random( 100 ) + self.loco:SetVelocity( vec ) + self:SetLastPush( CurTime() ) +end + +function ENT:ZombieWaterLevel() + local pos1 = self:GetPos() + local halfSize = self:OBBCenter() + local pos2 = pos1 + halfSize + local pos3 = pos2 + halfSize + if bit.band( util.PointContents( pos3 ), CONTENTS_WATER ) == CONTENTS_WATER or bit.band( util.PointContents( pos3 ), CONTENTS_SLIME ) == CONTENTS_SLIME then + return 3 + elseif bit.band( util.PointContents( pos2 ), CONTENTS_WATER ) == CONTENTS_WATER or bit.band( util.PointContents( pos2 ), CONTENTS_SLIME ) == CONTENTS_SLIME then + return 2 + elseif bit.band( util.PointContents( pos1 ), CONTENTS_WATER ) == CONTENTS_WATER or bit.band( util.PointContents( pos1 ), CONTENTS_SLIME ) == CONTENTS_SLIME then + return 1 + end + + return 0 +end + +--Targets +function ENT:HasTarget() + return self:IsValidTarget( self:GetTarget() ) +end + +function ENT:GetTarget() + return self.Target +end + +function ENT:GetTargetNavArea() + return self:HasTarget() and navmesh.GetNearestNavArea( self:GetTarget():GetPos(), false, 100) +end + +function ENT:SetTarget( target ) + self.Target = target + if self.Target != target then + self:SetLastTargetChange(CurTime()) + end +end + +function ENT:IsTarget( ent ) + return self.Target == ent +end + +function ENT:RemoveTarget() + self:SetTarget( nil ) +end + +function ENT:IsValidTarget( ent ) + if !ent then return false end + return IsValid( ent ) and ent:GetTargetPriority() != TARGET_PRIORITY_NONE +end + +function ENT:GetIgnoredTargets() + return self.tIgnoreList +end + +function ENT:IgnoreTarget( target ) + table.insert(self.tIgnoreList, target) +end + +function ENT:IsIgnoredTarget( ent ) + table.HasValue(self.tIgnoreList, ent) +end + +function ENT:ResetIgnores() + self.tIgnoreList = {} +end + +--AccessorFuncs +function ENT:IsJumping() + return self:GetJumping() +end + +function ENT:IsClimbing() + return self:GetClimbing() +end + +function ENT:IsAttacking() + return self:GetAttacking() +end + +function ENT:IsTimedOut() + return self:GetTimedOut() +end diff --git a/lua/entities/pap_weapon_fly/shared.lua b/lua/entities/pap_weapon_fly/shared.lua new file mode 100644 index 00000000..1b65f676 --- /dev/null +++ b/lua/entities/pap_weapon_fly/shared.lua @@ -0,0 +1,57 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "pap_weapon_fly" +ENT.Author = "Zet0r" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:Initialize() + + self:SetMoveType( MOVETYPE_FLY ) + self:SetSolid( SOLID_OBB ) + --self:SetCollisionBounds(Vector(-5, -10, -3), Vector(5, 10, 3)) + --self:UseTriggerBounds(true, 1) + self:SetMoveType(MOVETYPE_FLY) + self:PhysicsInitBox(Vector(-5, -10, -3), Vector(5, 10, 3)) + self:GetPhysicsObject():EnableCollisions(false) + self:SetNotSolid(true) + self:DrawShadow( false ) + self.TriggerPos = self:GetPos() + + if SERVER then + self:SetUseType( SIMPLE_USE ) + end +end + +function ENT:SetWepClass(class) + if IsValid(self.button) then + self.button:SetWepClass(class) + end +end + +function ENT:CreateTriggerZone(reroll) + if SERVER then + self.button = ents.Create("pap_weapon_trigger") + self.button:SetPos(self.TriggerPos) + self.button:SetAngles(self:GetAngles() - Angle(90,90,0)) + self.button:Spawn() + self.button:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER) + self.button.RerollingAtts = reroll + self.button.Owner = self.Owner + self.button.wep = self + self.button:SetWepClass(self.WepClass) + end +end + +function ENT:OnRemove() + if IsValid(self.button) then self.button:Remove() end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end +end diff --git a/lua/entities/pap_weapon_trigger/shared.lua b/lua/entities/pap_weapon_trigger/shared.lua new file mode 100644 index 00000000..bf864446 --- /dev/null +++ b/lua/entities/pap_weapon_trigger/shared.lua @@ -0,0 +1,62 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "pap_weapon_trigger" +ENT.Author = "Zet0r" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "String", 0, "WepClass") + +end + +function ENT:Initialize() + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_OBB ) + self:SetModel("models/hunter/blocks/cube05x1x025.mdl") + self:DrawShadow(false) + + if SERVER then + self:SetUseType( SIMPLE_USE ) + end +end + +function ENT:Use( activator, caller ) + if activator == self.Owner then + local class = self:GetWepClass() + local weapon = activator:Give(class) + if !self.RerollingAtts then -- A 2000 point reroll should not give max ammo + nz.Weps.Functions.GiveMaxAmmoWep(activator, class, true) -- We give pap ammo count + end + timer.Simple(0, function() + if IsValid(weapon) and IsValid(activator) then + if activator:HasPerk("speed") and weapon:IsFAS2() then + nz.Weps.Functions.ApplySpeed( activator, weapon ) + end + if activator:HasPerk("dtap") and weapon:IsFAS2() then + nz.Weps.Functions.ApplyDTap( activator, weapon ) + end + nz.Weps.Functions.ApplyPaP(activator, weapon) + if IsValid(self.wep) then + self.wep.machine:SetBeingUsed(false) + self.wep:Remove() + end + end + self:Remove() + end) + else + if IsValid(self.Owner) then + activator:PrintMessage( HUD_PRINTTALK, "This is " .. self.PapOwner:Nick() .. "'s gun. You cannot take it." ) + end + end +end + +if CLIENT then + function ENT:Draw() + return + end +end diff --git a/lua/entities/perk_machine/shared.lua b/lua/entities/perk_machine/shared.lua new file mode 100644 index 00000000..375bc89f --- /dev/null +++ b/lua/entities/perk_machine/shared.lua @@ -0,0 +1,122 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "perk_machine" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +ENT.DynLightColors = { + ["jugg"] = Color(255, 100, 100), + ["speed"] = Color(100, 255, 100), + ["dtap"] = Color(255, 255, 100), + ["revive"] = Color(100, 100, 255), + ["dtap2"] = Color(255, 255, 100), + ["staminup"] = Color(200, 255, 100), + ["phd"] = Color(255, 50, 255), + ["deadshot"] = Color(150, 200, 150), + ["mulekick"] = Color(100, 200, 100), + ["cherry"] = Color(50, 50, 200), + ["tombstone"] = Color(100, 100, 100), + ["whoswho"] = Color(100, 100, 255), + ["vulture"] = Color(255, 100, 100), + ["pap"] = Color(200, 220, 220), +} + +function ENT:SetupDataTables() + self:NetworkVar("String", 0, "PerkID") + self:NetworkVar("Bool", 0, "Active") + self:NetworkVar("Bool", 1, "BeingUsed") + self:NetworkVar("Int", 0, "Price") +end + +function ENT:Initialize() + if SERVER then + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) + self:SetBeingUsed(false) + local perkData = nz.Perks.Functions.Get(self:GetPerkID()) + self:SetPrice(perkData.price) + end +end + +function ENT:TurnOn() + self:SetActive(true) + self:Update() +end + +function ENT:TurnOff() + self:SetActive(false) + self:Update() +end + +function ENT:Update() + local perkData = nz.Perks.Functions.Get(self:GetPerkID()) + self:SetModel(perkData and (self:IsOn() and perkData.on_model or perkData.off_model) or "") +end + +function ENT:IsOn() + return self:GetActive() +end + +local MachinesNoDrink = { + ["pap"] = true, +} + +function ENT:Use(activator, caller) + local perkData = nz.Perks.Functions.Get(self:GetPerkID()) + + if self:IsOn() then + local price = self:GetPrice() + -- As long as they have less than the max perks, unless it's pap + if #activator:GetPerks() < GetConVar("nz_difficulty_perks_max"):GetInt() or self:GetPerkID() == "pap" then + -- If they have enough money + if activator:CanAfford(price) then + if !activator:HasPerk(self:GetPerkID()) then + local given = activator:GivePerk(self:GetPerkID(), self) + if given then + activator:TakePoints(price) + if !MachinesNoDrink[self:GetPerkID()] then + local wep = activator:Give("nz_perk_bottle") + wep:SetPerk(self:GetPerkID()) + else + activator:Give("nz_packapunch_arms") + end + self:EmitSound("nz/machines/jingle/"..self:GetPerkID().."_get.wav", 75) + end + else + print("already have perk") + end + end + else + print(activator:Nick().." already has max perks") + end + end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + if self:GetActive() then + if !self.NextLight or CurTime() > self.NextLight then + local dlight = DynamicLight( self:EntIndex() ) + if ( dlight ) then + local col = self.DynLightColors[self:GetPerkID()] + dlight.pos = self:GetPos() + self:OBBCenter() + dlight.r = col.r + dlight.g = col.g + dlight.b = col.b + dlight.brightness = 2 + dlight.Decay = 1000 + dlight.Size = 256 + dlight.DieTime = CurTime() + 1 + end + if math.random(300) == 1 then self.NextLight = CurTime() + 0.05 end + end + end + end +end \ No newline at end of file diff --git a/lua/entities/player_spawns/shared.lua b/lua/entities/player_spawns/shared.lua new file mode 100644 index 00000000..aa8f6162 --- /dev/null +++ b/lua/entities/player_spawns/shared.lua @@ -0,0 +1,27 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "player_spawns" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + + +function ENT:Initialize() + self:SetModel( "models/player/odessa.mdl" ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + self:SetColor(Color(0,0,255)) + self:DrawShadow( false ) +end + +if CLIENT then + function ENT:Draw() + if nzRound:InState( ROUND_CREATE ) then + self:DrawModel() + end + end +end diff --git a/lua/entities/power_box/shared.lua b/lua/entities/power_box/shared.lua new file mode 100644 index 00000000..4086e1f5 --- /dev/null +++ b/lua/entities/power_box/shared.lua @@ -0,0 +1,77 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "Zombies Power" +ENT.Author = "Zet0r" +ENT.Contact = "" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "Switch" ) + self:NetworkVar( "Entity", 0, "PowerHandle") + +end + +function ENT:Initialize() + if SERVER then + self:SetModel( "models/nzprops/zombies_power_lever.mdl" ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetUseType( ONOFF_USE ) + self:SetSwitch(false) + + self.Handle = ents.Create("nz_prop_effect_attachment") + self.Handle:SetModel("models/nzprops/zombies_power_lever_handle.mdl") + self.Handle:SetAngles( self:GetAngles() ) + self.Handle:SetPos(self:GetPos() + self:GetAngles():Up()*46 + self:GetAngles():Forward()*7) + self.Handle:Spawn() + self.Handle:SetParent(self) + self:SetPowerHandle(self.Handle) + + self:DeleteOnRemove( self.Handle ) + else + self.Switched = false + end +end + +function ENT:Use( activator ) + + if ( !activator:IsPlayer() ) then return end + if !IsElec() and nzRound:InProgress() then + self:SetSwitch(true) + self.Switched = 0 + nzElec:Activate() + end + +end + +if CLIENT then + + local offang = Angle(0,0,0) + local onang = Angle(-90,0,0) + + function ENT:Think() + local handle = self:GetPowerHandle() + if self:GetSwitch() != self.Switched then + self.Switching = math.Approach( self.Switching or 0, 1, FrameTime() * 2 ) + local ang = self:GetAngles() + if self:GetSwitch() then + handle:SetRenderAngles(LerpAngle(self.Switching, ang + offang, ang + onang)) + else + handle:SetRenderAngles(LerpAngle(self.Switching, ang + onang, ang + offang)) + end + + if self.Switching >= 1 then + self.Switched = self:GetSwitch() + self.Switching = nil + end + end + end + + function ENT:Draw() + self:DrawModel() + end +end \ No newline at end of file diff --git a/lua/entities/prop_buys/shared.lua b/lua/entities/prop_buys/shared.lua new file mode 100644 index 00000000..b10a8dad --- /dev/null +++ b/lua/entities/prop_buys/shared.lua @@ -0,0 +1,77 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "wall_block_buy" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + + self:NetworkVar( "Bool", 0, "Locked" ) + +end + +function ENT:Initialize() + if SERVER then + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) + self.Boundone,self.Boundtwo = self:GetCollisionBounds() + end + self:BlockLock(true) +end + +function ENT:BlockUnlock(spawn) + --self.Locked = false + --self:SetNoDraw( true ) + if SERVER then + self:SetCollisionBounds( Vector(-4, -4, 0), Vector(4, 4, 64) ) + end + self:SetSolid( SOLID_NONE ) + self:SetNoDraw(true) + if !spawn then -- Spawning a prop should'nt register it to the doors list + self:SetLocked(false) + end +end + +function ENT:BlockLock(spawn) + --self.Locked = true + --self:SetNoDraw( false ) + if SERVER then + self:SetCollisionBounds( self.Boundone, self.Boundtwo ) + end + self:SetSolid( SOLID_VPHYSICS ) + self:SetNoDraw(false) + if !spawn then + self:SetLocked(true) + end +end + +function ENT:OnRemove() + if SERVER then + nzDoors:RemoveLink( self, true ) + else + self:SetLocked(false) + end +end + +if CLIENT then + function ENT:Draw() + if nzRound:InProgress() then + --if self:IsLocked() then + self:DrawModel() + --end + else + self:DrawModel() + end + if nzRound:InState( ROUND_CREATE ) then + if nzDoors.DisplayLinks[self] then + nzDisplay.DrawLinks(self, nzDoors.PropDoors[self:EntIndex()].link) + end + end + end +end \ No newline at end of file diff --git a/lua/entities/random_box/shared.lua b/lua/entities/random_box/shared.lua new file mode 100644 index 00000000..26c6365f --- /dev/null +++ b/lua/entities/random_box/shared.lua @@ -0,0 +1,198 @@ +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 ) + print(self:GetMoveType()) + + --[[local phys = self:GetPhysicsObject() + if (phys:IsValid()) then + phys:Wake() + end]] + print(self:GetMoveType()) + + 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(nzPowerUps:IsPowerupActive("firesale") and 10 or 950) then + local class = nzRandomBox.DecideWep(ply) + if class != nil then + ply:TakePoints(nzPowerUps:IsPowerupActive("firesale") and 10 or 950) + self:Open() + local wep = self:SpawnWeapon( ply, class ) + wep.Buyer = ply + 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.Box = self + wep:SetAngles( self:GetAngles() ) + wep:SetWepClass(class) + self:EmitSound("nz/randombox/random_box_jingle.wav") + + return wep +end + +function ENT:Think() + self:NextThink(CurTime()) + return true +end + +function ENT:MoveAway() + nz.Notifications.Functions.PlaySound("nz/randombox/Announcer_Teddy_Zombies.wav", 0) + self.Moving = true + local s = 0 + local ang = self:GetAngles() + //Shake Effect + timer.Create( "shake", 0.1, 300, function() + if s < 23 then + if s % 2 == 0 then + if self:IsValid() then + self:SetAngles(ang + Angle(10, 0, 0)) + end + else + if self:IsValid() then + self:SetAngles(ang + Angle(-10, 0, 0)) + end + end + else + self:SetAngles(ang) + timer.Destroy("shake") + end + s = s + 1 + end) + + //Move Up + timer.Simple( 1, function() + local c = 0 + timer.Create( "moveAway", 5, 1, function() + self.Moveing = false + timer.Destroy("moveAway") + timer.Destroy("shake") + + self.SpawnPoint.HasBox = false + self:MoveToNewSpot(self.SpawnPoint) + self:EmitSound("nz/randombox/poof.wav") + self:Remove() + end) + --print(self:GetMoveType()) + self:SetMoveType(MOVETYPE_FLYGRAVITY) + self:SetGravity(0.1) + self:SetNotSolid(true) + self:SetCollisionBounds(Vector(0,0,0), Vector(0,0,0)) + self:GetPhysicsObject():SetDamping(100, 0) + self:CollisionRulesChanged() + self:SetVelocity(Vector(0,0,100)) + timer.Simple(1.5, function() + self:SetVelocity( Vector(0,0,0) ) + self:SetMoveType(MOVETYPE_FLY) + self:Open() + self:SetLocalAngularVelocity( Angle(0, 0, 250) ) + timer.Simple(0.5, function() + self:SetLocalAngularVelocity( Angle(0, 0, 500) ) + timer.Simple(0.5, function() + self:SetLocalAngularVelocity( Angle(0, 0, 750) ) + timer.Simple(0.2, function() + self:SetLocalAngularVelocity( Angle(0, 0, 1000) ) + end) + end) + end) + end) + end) + + +end + +function ENT:MoveToNewSpot(oldspot) + //Calls mapping function excluding the current spot + nzRandomBox.Spawn(oldspot) +end + +function ENT:MarkForRemoval() + if !self:GetOpen() then + self:Remove() + else + hook.Add("Tick", "RemoveBox"..self:EntIndex(), function() + if !self:GetOpen() then + hook.Remove("Tick", "RemoveBox"..self:EntIndex()) + self:Remove() + 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:GetPos() + Vector( 0, 0, -200 ) + local Vector2 = v:GetPos() + 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/lua/entities/random_box_spawns/shared.lua b/lua/entities/random_box_spawns/shared.lua new file mode 100644 index 00000000..29cc05d8 --- /dev/null +++ b/lua/entities/random_box_spawns/shared.lua @@ -0,0 +1,27 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "random_box_spawns" +ENT.Author = "Alig96" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + + +function ENT:Initialize() + self:SetModel( "models/hoff/props/mysterybox/box.mdl" ) + self:SetColor( Color(255, 255, 255) ) + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) + self:DrawShadow( false ) +end + +if CLIENT then + function ENT:Draw() + if nzRound:InState( ROUND_CREATE ) then + self:DrawModel() + end + end +end \ No newline at end of file diff --git a/lua/entities/random_box_windup/shared.lua b/lua/entities/random_box_windup/shared.lua new file mode 100644 index 00000000..17e49bac --- /dev/null +++ b/lua/entities/random_box_windup/shared.lua @@ -0,0 +1,133 @@ +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") + self:NetworkVar( "Bool", 1, "IsTeddy" ) + +end + +function ENT:Initialize() + + self:SetMoveType(MOVETYPE_NOCLIP) + self:SetLocalVelocity(self:GetAngles():Up() * 4) + + self:SetSolid( SOLID_OBB ) + self:DrawShadow( false ) + + self:SetWinding(true) + self:SetIsTeddy(false) + self.c = 0 + self.s = -20 + self.t = 0 + self:SetModel("models/weapons/w_rif_ak47.mdl") + --self:SetAngles(self.Box:GetAngles()) + local box = self.Box -- self.Box + + if SERVER then + //Stop winding up + timer.Simple(5, function() + self:SetWinding(false) + if self:GetWepClass() == "nz_box_teddy" then + self:SetModel("models/hoff/props/teddy_bear/teddy_bear.mdl") + self:SetAngles( self.Box:GetAngles() + Angle(-90,90,0) ) + self:SetLocalVelocity(self.Box:GetAngles():Up()*30) + nz.Notifications.Functions.PlaySound("nz/randombox/teddy_bear_laugh.wav", 0) + self:SetIsTeddy(true) + if IsValid(self.Buyer) then self.Buyer:GivePoints(950) end -- Refund please + else + local wep = weapons.Get(self:GetWepClass()) + self:SetModel(wep.WM or wep.WorldModel) + self:SetLocalVelocity(Vector(0,0,0)) -- Stop + end + print(self:GetModel()) + end) + -- If we time out, remove the object + timer.Simple(15, function() if IsValid(self) then self:SetLocalVelocity(self:GetAngles():Up()*-2) end end) + -- If we time out, remove the object + timer.Simple(25, function() if IsValid(self) then self.Box:Close() self:Remove() end end) + end +end + +function ENT:Use( activator, caller ) + if !self:GetWinding() and self:GetWepClass() != "nz_box_teddy" then + if activator == self.Buyer then + local class = self:GetWepClass() + activator:Give(class) + nz.Weps.Functions.GiveMaxAmmoWep(activator, class) + self.Box: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 + if nzMapping.Settings.rboxweps then + gun = weapons.Get(nzMapping.Settings.rboxweps[math.random(#nzMapping.Settings.rboxweps)]) + else + gun = table.Random(weapons.GetList()) + end + + if gun and gun.WorldModel != nil then + self:SetModel(gun.WM or gun.WorldModel) + end + --[[self.c = self.c + 1.3 + 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:TeddyFlyUp( ) + self.t = self.t + 1 + if self.t > 25 then + self.Box:Close() + self.Box:MoveAway() + self:Remove() + self.t = 25 + end + --self:SetPos(Vector(self:GetPos().X, self:GetPos().Y, self:GetPos().Z + 1*self.t)) +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:GetIsTeddy() then + self:TeddyFlyUp() + elseif self:GetWinding() then + self:WindUp() + else + self:WindDown() + end + end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + end +end diff --git a/lua/entities/wall_block/shared.lua b/lua/entities/wall_block/shared.lua new file mode 100644 index 00000000..fcb95f74 --- /dev/null +++ b/lua/entities/wall_block/shared.lua @@ -0,0 +1,89 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "wall_block" +ENT.Author = "Alig96 & Zet0r" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +--[[function ENT:SetupDataTables() + self:NetworkVar("Bool", 0, "BlockPlayers") + self:NetworkVar("Bool", 1, "BlockZombies") +end + +function ENT:SetFilter(players, zombies) + if players and zombies then + self:SetBlockPlayers(true) + self:SetBlockZombies(true) + self:SetCustomCollisionCheck(false) + self:SetColor(Color(255,255,255)) + elseif players and !zombies then + self:SetBlockPlayers(true) + self:SetBlockZombies(false) + self:SetCustomCollisionCheck(true) + self:SetColor(Color(100,100,255)) + elseif !players and zombies then + self:SetBlockPlayers(false) + self:SetBlockZombies(true) + self:SetCustomCollisionCheck(true) + self:SetColor(Color(255,100,100)) + end +end + +hook.Add("ShouldCollide", "nzdsadwa_InvisibleBlockFilter", function(ent1, ent2) + if ent1:GetClass() == "wall_block" then + if ent2:IsPlayer() then + if ent1:GetBlockPlayers() then + return true + else + return false + end + elseif nzConfig.ValidEnemies[ent2:GetClass()] then + if ent1:GetBlockZombies() then + return true + else + return false + end + end + elseif ent2:GetClass() == "wall_block" then + if ent1:IsPlayer() then + if ent2:GetBlockPlayers() then + return true + else + return false + end + elseif nzConfig.ValidEnemies[ent1:GetClass()] then + if ent2:GetBlockZombies() then + return true + else + return false + end + end + end +end)]] + +function ENT:Initialize() + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + self:DrawShadow( false ) + self:SetRenderMode( RENDERMODE_TRANSCOLOR ) + --self:SetCustomCollisionCheck(true) + --self:SetFilter(true, true) +end + +-- Doesn't work? :( +--[[function ENT:TestCollision(startpos, delta, isbox, bounds) + --if !nzRound:InState( ROUND_CREATE ) then return end -- Makes traces ignore this entity + print("HDUIAHD", startpos, delta, isbox, bounds) + return +end]] + +if CLIENT then + function ENT:Draw() + if nzRound:InState( ROUND_CREATE ) then + self:DrawModel() + end + end +end \ No newline at end of file diff --git a/lua/entities/wall_buys/shared.lua b/lua/entities/wall_buys/shared.lua new file mode 100644 index 00000000..fe3efea5 --- /dev/null +++ b/lua/entities/wall_buys/shared.lua @@ -0,0 +1,320 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "buy_gun_area" +ENT.Author = "Alig96 & Zet0r" +ENT.Contact = "Don't" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + self:NetworkVar( "String", 0, "WepClass" ) + self:NetworkVar( "String", 1, "Price" ) + self:NetworkVar( "Bool", 0, "Bought" ) + self:NetworkVar( "Bool", 1, "Flipped" ) +end + +local flipscale = Vector(1.5, 0.01, 1.5) -- Decides on which axis it flattens the outline +local normalscale = Vector(0.01, 1.5, 1.5) -- based on the bool self:GetFlipped() + +CreateClientConVar("nz_outlinedetail", "4") -- Controls the outline creation + +chalkmaterial = Material("chalk.png", "unlitgeneric smooth") + +function ENT:Initialize() + if SERVER then + self:SetMoveType( MOVETYPE_NONE ) + --self:SetSolid( SOLID_VPHYSICS ) + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER) + self:SetUseType(SIMPLE_USE) + self:SetFlipped(true) -- Apparently makes it work with default orientation? + self:SetSolid( SOLID_OBB ) + self:PhysicsInit( SOLID_OBB ) + else + self.Flipped = self:GetFlipped() + self:RecalculateModelOutlines() + local wep = weapons.Get(self:GetWepClass()) + util.PrecacheModel(wep.WM or wep.WorldModel) + end + self:SetRenderMode(RENDERMODE_TRANSALPHA) + self:DrawShadow(false) + --self:SetColor(Color(0,0,0,0)) +end + +function ENT:OnRemove() + if CLIENT then + self:RemoveOutline() + end +end + +function ENT:RecalculateModelOutlines() + self:RemoveOutline() + local num = GetConVar("nz_outlinedetail"):GetInt() + local ang = self:GetAngles() + local curang = self:GetAngles() -- Modifies offset if flipped + local curpos = self:GetPos() + local wep = weapons.Get(self:GetWepClass()) + local model = wep.WM or wep.WorldModel + + -- Precache the model whenever it changes, including on spawn + util.PrecacheModel(wep.WM or wep.WorldModel) + + self.modelclass = self:GetWepClass() + + if !self.Flipped then + curang:RotateAroundAxis(curang:Up(), 90) + end + --print(curang, "HUDIASHUD", self.Flipped) + if num >= 1 then + self.Chalk1 = ClientsideModel(model) + local offset = curang:Up()*0.5 + curang:Forward()*-0.5 --Vector(0,-0.5,0.5) + self.Chalk1:SetPos(curpos + offset) + self.Chalk1:SetAngles(ang) + self.Chalk1:SetMaterial(chalkmaterial) + --self.Chalk:SetModelScale(1.7) + + local mat = Matrix() + mat:Scale( self.Flipped and flipscale or normalscale ) + + self.Chalk1:EnableMatrix( "RenderMultiply", mat ) + self.Chalk1:SetNoDraw(true) + self.Chalk1:SetParent(self) + end + + if num >= 2 then + self.Chalk2 = ClientsideModel(model) + offset = curang:Up()*-0.5 + curang:Forward()*0.5 + self.Chalk2:SetPos(curpos + offset) + self.Chalk2:SetAngles(ang) + self.Chalk2:SetMaterial(chalkmaterial) + --self.Chalk:SetModelScale(1.7) + + mat = Matrix() + mat:Scale( self.Flipped and flipscale or normalscale ) + + self.Chalk2:EnableMatrix( "RenderMultiply", mat ) + self.Chalk2:SetNoDraw(true) + self.Chalk2:SetParent(self) + end + + if num >= 3 then + self.Chalk3 = ClientsideModel(model) + offset = curang:Up()*0.5 + curang:Forward()*0.5 + self.Chalk3:SetPos(curpos + offset) + self.Chalk3:SetAngles(ang) + self.Chalk3:SetMaterial(chalkmaterial) + --self.Chalk:SetModelScale(1.7) + + mat = Matrix() + mat:Scale( self.Flipped and flipscale or normalscale ) + + self.Chalk3:EnableMatrix( "RenderMultiply", mat ) + self.Chalk3:SetNoDraw(true) + self.Chalk3:SetParent(self) + end + + if num >= 4 then + self.Chalk4 = ClientsideModel(model) + offset = curang:Up()*-0.5 + curang:Forward()*-0.5 + self.Chalk4:SetPos(curpos + offset) + self.Chalk4:SetAngles(ang) + self.Chalk4:SetMaterial(chalkmaterial) + --self.Chalk:SetModelScale(1.7) + + mat = Matrix() + mat:Scale( self.Flipped and flipscale or normalscale ) + + self.Chalk4:EnableMatrix( "RenderMultiply", mat ) + self.Chalk4:SetNoDraw(true) + self.Chalk4:SetParent(self) + end + + if num >= 1 then + self.ChalkCenter = ClientsideModel(model) + self.ChalkCenter:SetPos(curpos) + self.ChalkCenter:SetAngles(ang) + self.ChalkCenter:SetMaterial(chalkmaterial) + + mat = Matrix() + mat:Scale( self.Flipped and flipscale or normalscale ) + + self.ChalkCenter:EnableMatrix( "RenderMultiply", mat ) + self.ChalkCenter:SetNoDraw(true) + self.ChalkCenter:SetParent(self) + end +end + +function ENT:RemoveOutline() + if IsValid(self.Chalk1) then + self.Chalk1:Remove() + end + if IsValid(self.Chalk2) then + self.Chalk2:Remove() + end + if IsValid(self.Chalk3) then + self.Chalk3:Remove() + end + if IsValid(self.Chalk4) then + self.Chalk4:Remove() + end + if IsValid(self.ChalkCenter) then + self.ChalkCenter:Remove() + end +end + +if SERVER then + + function ENT:SetWeapon(weapon, price) + //Add a special check for FAS weps + local wep = weapons.Get(weapon) + local model + if !wep then + model = "models/weapons/w_crowbar.mdl" + else + model = wep.WM or wep.WorldModel + --self:SetFlipped(false) + end + self:SetModel(model) + self:SetModelScale( 1.5, 0 ) + self.WeaponGive = weapon + self.Price = price + self:SetWepClass(weapon) + self:SetPrice(price) + end + + function ENT:ToggleRotate() + local ang = self:GetAngles() + self:SetFlipped(!self:GetFlipped()) + --self:SetAngles(self:GetAngles() + Angle(0,90,0)) + ang:RotateAroundAxis(ang:Up(), 90) + self:SetAngles(ang) + --print(self:GetFlipped()) + end + + function ENT:Use( activator, caller ) + local price = self.Price + local ammo_type = weapons.Get(self.WeaponGive).Primary.Ammo + local ammo_price = math.ceil((price - (price % 10))/2) + local ammo_price_pap = 4500 + 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) + self:SetBought(true) + --activator:EmitSound("nz/effects/buy.wav") + else + print("Can't afford!") + end + elseif string.lower(ammo_type) != "none" then + if activator:GetWeapon(self.WeaponGive).pap then + if activator:CanAfford(ammo_price_pap) then + if give_ammo != 0 then + activator:TakePoints(ammo_price_pap) + nz.Weps.Functions.GiveMaxAmmoWep(activator, self.WeaponGive) + --activator:EmitSound("nz/effects/buy.wav") + else + print("Max Clip!") + end + 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) + --activator:EmitSound("nz/effects/buy.wav") + else + print("Max Clip!") + end + else + print("Can't afford!") + end + end + end + return + end +end + + +if CLIENT then + + function ENT:Think() + if self.Flipped != self:GetFlipped() then + self.Flipped = self:GetFlipped() + self:RecalculateModelOutlines() + --print(self.Flipped) + end + if self.modelclass != self:GetWepClass() then + self.modelclass = self:GetWepClass() + self:RecalculateModelOutlines() + --print(self.Flipped) + end + end + + local glow = Material ( "sprites/glow04_noz" ) + local white = Color(0,200,255,50) + function ENT:Draw() + --self:DrawModel() + local num = math.Clamp(GetConVar("nz_outlinedetail"):GetInt(), 0, 4) + if num < 1 or (self.OutlineGiveUp and self.OutlineGiveUp > 5) then + self:DrawModel() + else + local pos = LocalPlayer():EyePos()+LocalPlayer():EyeAngles():Forward()*10 + local ang = LocalPlayer():EyeAngles() + ang = Angle(ang.p+90,ang.y,0) + if halo.RenderedEntity() != self then + render.ClearStencil() + render.SetStencilEnable(true) + render.SetStencilWriteMask(255) + render.SetStencilTestMask(255) + render.SetStencilReferenceValue(15) + render.SetStencilFailOperation(STENCILOPERATION_KEEP) + render.SetStencilZFailOperation(STENCILOPERATION_KEEP) + render.SetStencilPassOperation(STENCILOPERATION_REPLACE) + render.SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_ALWAYS) + render.SetBlend(0) + + for i = 1, num do + -- If it isn't valid (NULL ENTITY), attempt to recreate + if !IsValid(self["Chalk"..i]) then + self:RecalculateModelOutlines() + -- Log how many tries we did, we'll give up after 5 and just draw the model :( + self.OutlineGiveUp = self.OutlineGiveUp and self.OutlineGiveUp + 1 or 1 + break + end + self["Chalk"..i]:DrawModel() + end + + render.SetStencilPassOperation(STENCILOPERATION_ZERO) -- Make it deselect the center model + self.ChalkCenter:DrawModel() + + render.SetBlend(1) + render.SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_EQUAL) + cam.Start3D2D(pos,ang,1) + --surface.SetDrawColor(0,0,0) + surface.SetDrawColor(255,255,255) + surface.DrawRect(-ScrW(),-ScrH(),ScrW()*2,ScrH()*2) + surface.SetMaterial(chalkmaterial) + surface.DrawTexturedRect(-ScrW(),-ScrH(),ScrW()*2,ScrH()*2) + cam.End3D2D() + render.SetStencilEnable(false) + end + local spritepos = self:WorldSpaceCenter() + cam.Start3D() + render.SetMaterial( glow ) + render.DrawSprite( spritepos + (pos-spritepos):GetNormalized()*5, 200, 100, white) + cam.End3D() + if self:GetBought() then + self:DrawModel() + end + end + end + +end diff --git a/lua/entities/whoswho_downed_clone.lua b/lua/entities/whoswho_downed_clone.lua new file mode 100644 index 00000000..bff138f8 --- /dev/null +++ b/lua/entities/whoswho_downed_clone.lua @@ -0,0 +1,176 @@ +AddCSLuaFile() + +ENT.Base = "base_nextbot" +ENT.PrintName = "Faked downed player" +ENT.Category = "Brainz" +ENT.Author = "Lolle & Zet0r" + +function ENT:Initialize() + --change those after creation + self:SetModel( "models/player/kleiner.mdl" ) + self.OwnerData = {} + if SERVER then self:GiveWeapon( "weapon_pistol" ) end +end + +function ENT:SetupDataTables() + self:NetworkVar("Entity", 0, "PerkOwner") +end + +function ENT:BodyUpdate() + if self:GetActivity() != ACT_HL2MP_SIT_PISTOL then self:StartActivity( ACT_HL2MP_SIT_PISTOL ) end +end + +function ENT:Use( act, call, type, value ) + --revive here? +end + +function ENT:RunBehaviour() + while (true) do + coroutine.wait(60) + end +end + +function ENT:GiveWeapon( wepclass ) + if !wepclass then return end + + if IsValid(self.Weapon) then + self.Weapon:Remove() + end + + self.Weapon = ents.Create( wepclass ) + if !IsValid(self.Weapon) then + return + end + self.Weapon:SetOwner(self) + self.Weapon:SetParent(self) + self.Weapon:SetPos( self:GetAttachment(self:LookupAttachment("anim_attachment_RH")).Pos ) + self.Weapon:Spawn() + self.Weapon:SetSolid(SOLID_NONE) + self.Weapon:AddEffects(EF_BONEMERGE) + self.Weapon:Fire( "SetParentAttachment", "anim_attachment_LH" ) + +end + + +local mat = Material("Models/effects/comball_tape") +function ENT:Draw() + + self:DrawModel() + render.MaterialOverride(mat) + self:DrawModel() + render.MaterialOverride(nil) + +end + +-- FAS2 weapons seem to want this function +function ENT:InVehicle() + return false +end + +function ENT:RevivePlayer() + local ply = self:GetPerkOwner() + print(self:GetPerkOwner()) + PrintTable(self.OwnerData) + + if (IsValid(ply) and ply:IsPlayer()) then + if ply:Alive() then + if !ply:GetNotDowned() then + ply:RevivePlayer() + end + else + ply:Spawn() + end + + ply:SetPos(self:GetPos()) + ply:SetEyeAngles(self:GetAngles()) + + -- Yeah no, Who's Who doesn't actually let you keep your clone's perks or weapons + ply:RemovePerks() + ply:StripWeapons() + + for k,v in pairs(self.OwnerData.weps) do + local wep = ply:Give(v.class) + if v.pap then + nz.Weps.Functions.ApplyPaP( ply, wep ) + end + end + for k,v in pairs(self.OwnerData.perks) do + if v != "whoswho" then + ply:GivePerk(v) + end + end + nz.Weps.Functions.GiveMaxAmmo(ply) + end + + -- Everything bought as the clone will be refunded, even doors + ply:GivePoints(ply.WhosWhoMoney) + + local revivor = Revive.Players[id] and Revive.Players[id].RevivePlayer or nil + if IsValid(revivor) and revivor:IsPlayer() then + if self.DownPoints then + revivor:GivePoints(self.DownPoints) + end + revivor:StripWeapon("nz_revive_morphine") -- Remove the viewmodel again + end + + self:Remove() +end + +function ENT:StartRevive(revivor, nosync) + local id = self:EntIndex() + if !Revive.Players[id] then return end -- Not even downed + if Revive.Players[id].ReviveTime then return end -- Already being revived + + Revive.Players[id].ReviveTime = CurTime() + Revive.Players[id].RevivePlayer = revivor + revivor.Reviving = self + + revivor:Give("nz_revive_morphine") -- Give them the viewmodel + + if !nosync then hook.Call("PlayerBeingRevived", Revive, self, revivor) end +end + +function ENT:StopRevive(nosync) + local id = self:EntIndex() + if !Revive.Players[id] then return end -- Not even downed + + local revivor = Revive.Players[id].RevivePlayer + if IsValid(revivor) then + revivor:StripWeapon("nz_revive_morphine") -- Remove the revivors viewmodel + end + + Revive.Players[id].ReviveTime = nil + Revive.Players[id].RevivePlayer = nil + + if !nosync then hook.Call("PlayerNoLongerBeingRevived", Revive, self) end +end + +function ENT:KillDownedPlayer() + self:Remove() +end + +function ENT:OnRemove() + local ply = self:GetPerkOwner() + if (IsValid(ply) and ply:IsPlayer()) then + -- No more refunds for you once you become your clone mate! + ply.WhosWhoMoney = nil + end + + local revivor = Revive.Players[id] and Revive.Players[id].RevivePlayer or nil + if IsValid(revivor) then -- This shouldn't happen as players can't die if they are currently being revived + revivor:StripWeapon("nz_revive_morphine") -- Remove the revivors if someone was reviving viewmodel + end + + Revive.Players[self:EntIndex()] = nil + + if SERVER then + net.Start("nz_WhosWhoActive") + net.WriteBool(false) + net.Send(ply) + hook.Call("PlayerRevived", Revive, self) + end +end + +function ENT:UpdateTransmitState() + return TRANSMIT_ALWAYS +end \ No newline at end of file diff --git a/lua/entities/wunderfizz_machine/shared.lua b/lua/entities/wunderfizz_machine/shared.lua new file mode 100644 index 00000000..66100e80 --- /dev/null +++ b/lua/entities/wunderfizz_machine/shared.lua @@ -0,0 +1,191 @@ +AddCSLuaFile() + +ENT.Type = "anim" + +ENT.PrintName = "wundefizz_machine" +ENT.Author = "Zet0r" +ENT.Contact = "youtube.com/Zet0r" +ENT.Purpose = "" +ENT.Instructions = "" + +function ENT:SetupDataTables() + self:NetworkVar("Int", 0, "Price") + self:NetworkVar("Bool", 0, "Active") + self:NetworkVar("Bool", 1, "BeingUsed") + self:NetworkVar("Entity", 0, "User") + + self:NetworkVar( "String", 0, "PerkID") + self:NetworkVar( "Bool", 2, "IsTeddy" ) +end + +function ENT:DecideOutcomePerk(specific) + if specific then self:SetPerkID(specific) return end + + if self.TimesUsed > 2 and math.random(100) <= 55 and #ents.FindByClass("wundefizz_machine") > 1 then + self.OutcomePerk = "teddy" + else + local blockedperks = { + ["wunderfizz"] = true, -- lol, this would happen + ["pap"] = true, + } + local available = nzMapping.Settings.wunderfizzperks or table.GetKeys(nz.Perks.Functions.GetList()) + local tbl = {} + for k,v in pairs(available) do + if !self:GetUser():HasPerk(v) and !blockedperks[v] then + table.insert(tbl, v) + end + end + if #tbl <= 0 then return "teddy" end -- Teddy bear for no more perks D: + self.OutcomePerk = tbl[math.random(#tbl)] + end +end + +function ENT:Initialize() + if SERVER then + self:SetModel("models/alig96/perks/wunderfizz/nz_wunderfizz.mdl") + self:SetMoveType( MOVETYPE_NONE ) + self:SetSolid( SOLID_VPHYSICS ) + --self:DrawShadow( false ) + self:SetUseType( SIMPLE_USE ) + self:SetBeingUsed(false) + self:SetIsTeddy(false) + self:SetPrice(1500) + + self.NextLightning = CurTime() + math.random(10) + self:SetAutomaticFrameAdvance(true) + self:TurnOff(true) + self.TimesUsed = 0 + end +end + +function ENT:TurnOn() + local turnon, dur = self:LookupSequence("turn_on") + self:SetCycle(0) + self:ResetSequence(turnon) + self.GoIdle = CurTime() + dur -- Delay when to go idle (after turn on animation) +end + +function ENT:TurnOff(spawn) + self:SetActive(false) + local turnoff, dur = self:LookupSequence("turn_off") + self:ResetSequence(turnoff) + if spawn then self:SetCycle(1) else self:SetCycle(0) end + --self:SetCycle(0) + --self:SetPlaybackRate(10) + --print(turnoff) +end + +function ENT:IsOn() + return self:GetActive() +end + +function ENT:Think() + if SERVER then + if self.GoIdle and self.GoIdle < CurTime() then + local idle = self:LookupSequence("idle") + self:SetCycle(0) + self:ResetSequence(idle) + self:SetActive(true) -- Turn on here + self.GoIdle = nil + --print("idling") + end + if self:IsOn() and CurTime() > self.NextLightning then + local e = EffectData() + e:SetStart(self:GetPos() + Vector(0,0,3000)) + e:SetOrigin(self:GetPos() + Vector(0,0,100)) + e:SetMagnitude(0.5) + util.Effect("lightning_strike_wunderfizz", e) + self.NextLightning = CurTime() + math.random(30) + end + self:NextThink(CurTime()) + return true + end +end + +function ENT:Use(activator, caller) + if self:IsOn() and !self.GoIdle then -- Only after fully arriving + if !IsValid(self.Bottle) and !self:GetBeingUsed() then + local price = self:GetPrice() + -- Can only be bought if you have free perk slots + if #activator:GetPerks() < GetConVar("nz_difficulty_perks_max"):GetInt() then + -- If they have enough money + if activator:CanAfford(price) then + activator:TakePoints(price) + self:SetBeingUsed(true) + self:SetUser(activator) + + self:DecideOutcomePerk() + self.Bottle = ents.Create("wunderfizz_windup") + self.Bottle:SetPos(self:GetPos() + Vector(0,0,45)) + self.Bottle:SetAngles(self:GetAngles() + Angle(0,-90,0)) + self.Bottle.WMachine = self + self.Bottle.Perk = self.OutcomePerk + self.Bottle:Spawn() + + local e = EffectData() + e:SetEntity(self.Bottle) + e:SetMagnitude(1.1) + util.Effect("lightning_aura", e) + + self.TimesUsed = self.TimesUsed + 1 + end + else + print(activator:Nick().." already has max perks") + end + elseif self:GetUser() == activator and !self.Bottle:GetWinding() and !self:GetIsTeddy() then + local perk = self:GetPerkID() + local wep = activator:Give("nz_perk_bottle") + wep:SetPerk(perk) + activator:GivePerk(perk) + self:SetBeingUsed(false) + self:SetPerkID("") + self:SetUser(nil) + self.Bottle:Remove() + end + end +end + +function ENT:OnRemove() + if IsValid(self.Bottle) then self.Bottle:Remove() end +end + +function ENT:MoveLocation() + self:TurnOff() + self:SetPerkID("") + self:SetUser(nil) + self:SetIsTeddy(false) + + local tbl = {} + for k,v in pairs(ents.FindByClass("wunderfizz_machine")) do + if !v:IsOn() and v != self then + table.insert(tbl, v) + end + end + local target = tbl[math.random(#tbl)] + if IsValid(target) then + target:TurnOn() + end +end + +local offlight = Material( "sprites/redglow1" ) +local offpos = Vector(10, 23.6, 61.4) +local red = Color(255,255,255) -- The sprite itself is red +local onlight = Material( "sprites/physg_glow1" ) +local onpos = Vector(10, 23.6, 58) +local green = Color(0,255,0) -- That one's white though +if CLIENT then + function ENT:Draw() + self:DrawModel() + if self:IsOn() then + cam.Start3D(EyePos(),EyeAngles()) + render.SetMaterial( onlight ) + render.DrawSprite( self:LocalToWorld(onpos), 10, 10, green) + cam.End3D() + else + cam.Start3D(EyePos(),EyeAngles()) + render.SetMaterial( offlight ) + render.DrawSprite( self:LocalToWorld(offpos), 10, 10, red) + cam.End3D() + end + end +end \ No newline at end of file diff --git a/lua/entities/wunderfizz_windup/shared.lua b/lua/entities/wunderfizz_windup/shared.lua new file mode 100644 index 00000000..10374597 --- /dev/null +++ b/lua/entities/wunderfizz_windup/shared.lua @@ -0,0 +1,114 @@ +AddCSLuaFile( ) + +ENT.Type = "anim" + +ENT.PrintName = "wunderfizz_windup" +ENT.Author = "Zet0r" +ENT.Contact = "youtube.com/Zet0r" +ENT.Purpose = "" +ENT.Instructions = "" + +local perk_materials = { + ["jugg"] = "models/perk_bottle/c_perk_bottle_jugg", + ["speed"] = "models/perk_bottle/c_perk_bottle_speed", + ["dtap"] = "models/perk_bottle/c_perk_bottle_dtap", + ["revive"] = "models/perk_bottle/c_perk_bottle_revive", + ["dtap2"] = "models/perk_bottle/c_perk_bottle_dtap2", + ["staminup"] = "models/perk_bottle/c_perk_bottle_stamin", + ["phd"] = "models/perk_bottle/c_perk_bottle_phd", + ["deadshot"] = "models/perk_bottle/c_perk_bottle_deadshot", + ["mulekick"] = "models/perk_bottle/c_perk_bottle_mulekick", + ["cherry"] = "models/perk_bottle/c_perk_bottle_cherry", + ["tombstone"] = "models/perk_bottle/c_perk_bottle_tombstone", + ["whoswho"] = "models/perk_bottle/c_perk_bottle_whoswho", + ["vulture"] = "models/perk_bottle/c_perk_bottle_vulture", + ["teddy"] = "models/perk_bottle/c_perk_bottle_teddy", +} + +function ENT:SetupDataTables() + self:NetworkVar( "Bool", 0, "Winding" ) +end + +function ENT:RandomizeSkin() + local skin + if nzMapping.Settings.wunderfizzperks then + skin = table.Random(perk_materials) + else + skin = table.Random(perk_materials) + end + + if skin then + self:SetMaterial(skin) + end +end + +function ENT:Initialize() + + self:SetMoveType(MOVETYPE_NONE) + + self:SetSolid( SOLID_OBB ) + self:DrawShadow( false ) + + self:SetModel("models/alig96/perks/perkacola/perkacola.mdl") + self:RandomizeSkin() + local machine = self.WMachine + + if SERVER then + self:SetWinding(true) + //Stop winding up + timer.Simple(5, function() + self:SetWinding(false) + self:SetMaterial(perk_materials[self.Perk]) + if self.Perk == "teddy" then + machine:SetIsTeddy(true) + machine:GetUser():GivePoints(machine:GetPrice()) + timer.Simple(5, function() + if IsValid(self) and IsValid(machine) then + self:Remove() + machine:MoveLocation() + end + end) + end + machine:SetPerkID(self.Perk) + end) + -- If we time out, remove the object + timer.Simple(25, function() if IsValid(self) then self:Remove() end end) + end +end + +function ENT:WindUp( ) + self:RandomizeSkin() +end + +function ENT:TeddyFlyUp( ) + +end + +function ENT:Think() + if SERVER then + if self:GetWinding() then + self:WindUp() + end + end +end + +function ENT:OnRemove() + if IsValid(self.WMachine) then + self.WMachine:SetBeingUsed(false) + self.WMachine.Bottle = nil + end +end + +if CLIENT then + function ENT:Draw() + self:DrawModel() + if self:GetWinding() then + if !self:GetRenderAngles() then self:SetRenderAngles(self:GetAngles() + Angle(20,0,0)) end + self:SetRenderAngles(self:GetRenderAngles()+(Angle(0,100,0)*FrameTime())) + elseif !self.Stopped then + self:SetRenderAngles(self:GetNetworkAngles()) + self.LightningAura = nil -- Kill the aura effect + self.Stopped = true + end + end +end diff --git a/lua/nzmapscripts/mechanics_test.lua b/lua/nzmapscripts/mechanics_test.lua new file mode 100644 index 00000000..de970485 --- /dev/null +++ b/lua/nzmapscripts/mechanics_test.lua @@ -0,0 +1,8 @@ +local script = {} -- Create the table in which to add functions to + +function script.OnRoundBegin(num) + print(num) +end + +-- Return the table - this is critical, never forget +return script diff --git a/lua/nzmapscripts/nz_ttt_kosovos;Breakout.lua b/lua/nzmapscripts/nz_ttt_kosovos;Breakout.lua new file mode 100644 index 00000000..bcc01fab --- /dev/null +++ b/lua/nzmapscripts/nz_ttt_kosovos;Breakout.lua @@ -0,0 +1,194 @@ +local mapscript = {} + +local scriptgascanpositions = { + {pos = Vector(4275, -1381, 39), ang = Angle(0, 0, 0)}, + {pos = Vector(3507, -1311, 38), ang = Angle(0, 0, 0)}, + {pos = Vector(4274, -697, 39), ang = Angle(0, -2, 0)}, + {pos = Vector(4041, -515, 167), ang = Angle(0, 2, 0)}, + {pos = Vector(4244, -1278, 165), ang = Angle(0, 2, 0)}, + {pos = Vector(4311, -477, 172), ang = Angle(0, 1, 0)}, + {pos = Vector(4887, -249, 172), ang = Angle(0, -2, 0)}, + {pos = Vector(4955, 87, 171), ang = Angle(0, -1, 0)}, + {pos = Vector(4485, -4, 173), ang = Angle(0, 13, 0)}, + {pos = Vector(4203, 231, 175), ang = Angle(0, -91, 0)}, + {pos = Vector(4024, 669, 173), ang = Angle(0, 3, 0)}, + {pos = Vector(3978, 707, 175), ang = Angle(0, -91, 0)}, + {pos = Vector(3527, 983, 173), ang = Angle(0, 42, 0)}, + {pos = Vector(3278, 635, 245), ang = Angle(90, -150, 180)}, + {pos = Vector(3820, 159, 214), ang = Angle(0, -40, 0)}, + {pos = Vector(3618, 308, 174), ang = Angle(90, -132, 180)}, + {pos = Vector(3413, -199, 15), ang = Angle(0, 3, 0)}, + {pos = Vector(3636, 93, 150), ang = Angle(0, -86, 0)}, +} + +local scriptscriptgenerator +local scriptscriptgascan +local hasscriptgascan = false +local scripthasusedelev = false +local scriptnextexpltime + +local gascanobject = nzItemCarry:CreateCategory("gascan") +gascanobject:SetIcon("spawnicons/models/props_junk/gascan001a.png") +gascanobject:SetText("Press E to pick up Gas Can.") +gascanobject:SetDropOnDowned(true) + +gascanobject:SetDropFunction( function(self, ply) + if IsValid(scriptgascan) then scriptgascan:Remove() end + scriptgascan = ents.Create("nz_script_prop") + scriptgascan:SetModel("models/props_junk/gascan001a.mdl") + scriptgascan:SetPos(ply:GetPos()) + scriptgascan:SetAngles(Angle(0,0,0)) + scriptgascan:Spawn() + self:RegisterEntity( scriptgascan ) +end) + +gascanobject:SetResetFunction( function(self) + hasscriptgascan = false + if IsValid(scriptgascan) then scriptgascan:Remove() end + local ran = scriptgascanpositions[math.random(table.Count(scriptgascanpositions))] + if ran and ran.pos and ran.ang then + scriptgascan = ents.Create("nz_script_prop") + scriptgascan:SetModel("models/props_junk/gascan001a.mdl") + scriptgascan:SetPos(ran.pos) + scriptgascan:SetAngles(ran.ang) + scriptgascan:Spawn() + self:RegisterEntity( scriptgascan ) + end +end) + +gascanobject:SetPickupFunction( function(self, ply, ent) + hasscriptgascan = true + ply:GiveCarryItem(self.id) + ent:Remove() +end) + +-- Call this to update the info to clients! +gascanobject:Update() + +function mapscript.ScriptLoad() +end + + +function mapscript.OnGameBegin() + mapscript.ScriptUnload() -- Clean up the entities from previous games if they exist + local button = ents.FindByName("ele_call_down")[1] + button:Fire("Press") -- Call the elevator down to begin with + + local button2 = ents.FindByName("ele_button_1")[1] + button2.OnUsed = function(self) + if !scripthasusedelev then + scripthasusedelev = true + scriptgenerator:SetNWString("NZText", "Elevator is currently on the lower floor.") + local ent = ents.FindByName("alarm_obj")[1] + timer.Simple(50, function() + ent:Fire("PlaySound") + end) + timer.Simple(60, function() + ent:Fire("StopSound") + scripthasusedelev = false + scriptgenerator:SetNWString("NZText", "You need a gas can to power the elevator.") + for k,v in pairs(player.GetAllPlaying()) do + local pos = v:GetPos() + if pos.z < -1000 then + local e = EffectData() + e:SetOrigin(v:GetPos()) + e:SetEntity(v) + e:SetMagnitude(2) + util.Effect("lightning_prespawn", e) + local spawn = ents.FindByClass("player_spawns")[v:EntIndex()] + e = EffectData() + e:SetOrigin(spawn:GetPos()) + e:SetEntity(nil) + util.Effect("lightning_prespawn", e) + end + end + timer.Simple(2, function() + for k,v in pairs(player.GetAllPlaying()) do + local pos = v:GetPos() + if pos.z < -1000 then + local e = EffectData() + e:SetOrigin(pos) + e:SetMagnitude(0.75) + util.Effect("lightning_strike", e) + local spawnpos = ents.FindByClass("player_spawns")[v:EntIndex()]:GetPos() + e = EffectData() + e:SetOrigin(spawnpos) + e:SetMagnitude(0.75) + util.Effect("lightning_strike", e) + v:SetPos(spawnpos) + end + end + end) + end) + end + end + + local button3 = ents.FindByName("ele_button_7")[1] + + scriptgenerator = ents.Create("nz_script_prop") + scriptgenerator:SetPos(Vector(3275, -254, -275)) + scriptgenerator:SetAngles(Angle(0, 90, 0)) + scriptgenerator:SetModel("models/props_vehicles/generatortrailer01.mdl") + scriptgenerator:SetNWString("NZText", "You need a gas can to power the elevator.") + scriptgenerator:SetNWString("NZRequiredItem", "gascan") + scriptgenerator:SetNWString("NZHasText", "Press E to fuel generator with Gas Can.") + scriptgenerator:Spawn() + scriptgenerator:Activate() + -- Function when it is used (E) + scriptgenerator.OnUsed = function( self, ply ) + if ply:HasCarryItem("gascan") then -- Only if we picked up the gascan + hasscriptgascan = false -- Reset gascan status + ply:RemoveCarryItem("gascan") + if button3:GetPos().z < -1000 then + button3:Fire("Unlock") -- Call the elevator up + button3:Fire("Press") + scriptgenerator:SetNWString("NZText", "Elevator is on its way up.") -- Update text + end + end + end + + local door = ents.GetMapCreatedEntity(1836) + if IsValid(door) then door:SetNWString("NZText", "You need to disable security.") end + + for k,v in pairs(ents.FindInSphere(Vector(3315, -1280, 55), 10)) do + if v:GetClass() == "prop_buys" then v:BlockUnlock() end + end +end + +function mapscript.PostCleanupMap() + --print("Things") +end + +-- This one will be called at the start of each round +function mapscript.OnRoundStart() + if !IsValid(scriptgascan) and !hasscriptgascan and !scripthasusedelev then + gascanobject:Reset() -- Makes it respawn + end +end + +-- Will be called every second if a round is in progress (zombies are alive) +function mapscript.RoundThink() + +end + +-- Will be called after each round +function mapscript.RoundEnd() + +end + +-- Cleanup +function mapscript.ScriptUnload() + if IsValid(scriptgenerator) then scriptgenerator:Remove() end + if IsValid(scriptgascan) then scriptgascan:Remove() end + scriptgenerator = nil + scriptgaspositions = nil + scriptgascan = nil + hasscriptgascan = nil +end + +-- Only functions will be hooked, meaning you can safely store data as well +mapscript.TestPrint = "v0.0" +local testprint2 = "This is cool" -- You can also store the data locally + +-- Always return the mapscript table. This gives it on to the gamemode so it can use it. +return mapscript diff --git a/lua/nzmapscripts/template.lua b/lua/nzmapscripts/template.lua new file mode 100644 index 00000000..9df0d5dd --- /dev/null +++ b/lua/nzmapscripts/template.lua @@ -0,0 +1,29 @@ +local mapscript = {} + +-- Any function added to this table will automatically get hooked to the hook with the same name +function mapscript.RoundInit() + -- E.g. this function will run with the RoundInit hook + print(mapscript.TestPrint) +end + +-- This one will be called at the start of each round +function mapscript.RoundStart() + +end + +-- Will be called every second if a round is in progress (zombies are alive) +function mapscript.RoundThink() + +end + +-- Will be called after each round +function mapscript.RoundEnd() + +end + +-- Only functions will be hooked, meaning you can safely store data as well +mapscript.TestPrint = "v0.0" +local testprint2 = "This is cool" -- You can also store the data locally + +-- Always return the mapscript table. This gives it on to the gamemode so it can use it. +return mapscript diff --git a/lua/weapons/nz_bowie_knife.lua b/lua/weapons/nz_bowie_knife.lua new file mode 100644 index 00000000..5ec47121 --- /dev/null +++ b/lua/weapons/nz_bowie_knife.lua @@ -0,0 +1,191 @@ +if SERVER then + AddCSLuaFile("nz_bowie_knife.lua") + SWEP.Weight = 5 + SWEP.AutoSwitchTo = false + SWEP.AutoSwitchFrom = true +end + +if CLIENT then + + SWEP.PrintName = "Bowie Knife" + SWEP.Slot = 1 + SWEP.SlotPos = 1 + SWEP.DrawAmmo = false + SWEP.DrawCrosshair = true + + SWEP.Category = "nZombies" + +end + + +SWEP.Author = "Zet0r" +SWEP.Contact = "youtube.com/Zet0r" +SWEP.Purpose = "Stab Stab Stab!" +SWEP.Instructions = "Let the gamemode give you it" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.HoldType = "knife" + +SWEP.ViewModel = "models/weapons/c_bowie_knife.mdl" +SWEP.WorldModel = "models/weapons/w_bowie_knife.mdl" +SWEP.UseHands = true +SWEP.vModel = true + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "none" +SWEP.Primary.DamageType = DMG_CLUB +SWEP.Primary.Force = 0 + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.NextReload = 1 + +SWEP.Primary.Damage = 200 +SWEP.Range = 100 + + +function SWEP:Initialize() + + self:SetHoldType( self.HoldType ) + +end + +function SWEP:Deploy() + --self:SendWeaponAnim(ACT_VM_DRAW) + --self:SetHoldType( self.HoldType ) +end + +function SWEP:PrimaryAttack() + // Only the player fires this way so we can cast + + if CurTime() < self.HolsterTime then return end + + local ply = self.Owner; + + if ( !ply ) then + return + end + + local vecSrc = ply:GetShootPos() + local vecDirection = ply:GetAimVector() + + local trace = {} + trace.start = vecSrc + trace.endpos = vecSrc + ( vecDirection * self.Range) + trace.filter = ply + + local traceHit = util.TraceLine( trace ) + + if ( traceHit.Hit ) then + + if math.random(0,1) == 0 then + self:SendWeaponAnim( ACT_VM_HITCENTER ) + ply:SetAnimation( PLAYER_ATTACK1 ) + self.HolsterTime = CurTime() + 1 + self:EmitSound("nz/bowie/stab/bowie_stab_0"..math.random(0,2)..".wav") + else + self:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + ply:SetAnimation( PLAYER_ATTACK1 ) + self.HolsterTime = CurTime() + 0.5 + self:EmitSound("nz/bowie/swing/bowie_swing_0"..math.random(0,2)..".wav") + end + + local vecSrc = ply:GetShootPos() + + if ( SERVER ) then + ply:TraceHullAttack( vecSrc, traceHit.HitPos, Vector( -5, -5, -5 ), Vector( 5, 5, 36 ), self.Primary.Damage, self.Primary.DamageType, self.Primary.Force ) + end + + return + + end + + + self:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + ply:SetAnimation( PLAYER_ATTACK1 ) + self:EmitSound("nz/bowie/swing/bowie_swing_0"..math.random(0,2)..".wav") + + self.HolsterTime = CurTime() + 0.5 + + return +end + +function SWEP:DrawAnim() + self:SendWeaponAnim(ACT_VM_DRAW) + self.HolsterTime = CurTime() + 2.5 + self:EmitSound("nz/bowie/draw/bowie_start.wav") + + timer.Simple(0.7, function() + if IsValid(self) then + self:EmitSound("nz/bowie/draw/bowie_turn.wav") + end + end) + timer.Simple(1.4, function() + if IsValid(self) then + self:EmitSound("nz/bowie/draw/bowie_toss.wav") + end + end) + + timer.Simple(1.9, function() + if IsValid(self) then + self:EmitSound("nz/bowie/draw/bowie_catch.wav") + end + end) +end + +function SWEP:PostDrawViewModel() + +end + +function SWEP:DrawWorldModel() + +end + +function SWEP:OnRemove() + +end + +function SWEP:Think() + if engine.ActiveGamemode() == "nzombies3" then + if !self.Owner:GetUsingSpecialWeapon() or (self.HolsterTime and CurTime() > self.HolsterTime) then + self.Owner:SetUsingSpecialWeapon(false) + self.Owner:EquipPreviousWeapon() + end + end +end + +function SWEP:GetViewModelPosition( pos, ang ) + + local newpos = LocalPlayer():EyePos() + local newang = LocalPlayer():EyeAngles() + local up = newang:Up() + + newpos = newpos + LocalPlayer():GetAimVector()*6 - up*65 + + return newpos, newang + +end + +if engine.ActiveGamemode() == "nzombies3" then + nzSpecialWeapons:AddWeapon( "nz_bowie_knife", "knife", function(ply, wep) -- Use function + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SetActiveWeapon(wep) + wep:PrimaryAttack() + end + end, function(ply, wep) + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SetActiveWeapon(nil) + ply:SelectWeapon("nz_bowie_knife") + wep:DrawAnim() + end + end) +end \ No newline at end of file diff --git a/lua/weapons/nz_grenade.lua b/lua/weapons/nz_grenade.lua new file mode 100644 index 00000000..5a8ae129 --- /dev/null +++ b/lua/weapons/nz_grenade.lua @@ -0,0 +1,115 @@ +if SERVER then + AddCSLuaFile("nz_grenade.lua") + SWEP.Weight = 1 + SWEP.AutoSwitchTo = false + SWEP.AutoSwitchFrom = true +end + +if CLIENT then + + SWEP.PrintName = "M67 Grenade" + SWEP.Slot = 1 + SWEP.SlotPos = 1 + SWEP.DrawAmmo = false + SWEP.DrawCrosshair = true + +end + + +SWEP.Author = "Zet0r" +SWEP.Contact = "youtube.com/Zet0r" +SWEP.Purpose = "Throws a grenade if you have any" +SWEP.Instructions = "Let the gamemode give you it" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.HoldType = "grenade" + +SWEP.ViewModel = "models/weapons/c_grenade.mdl" +SWEP.WorldModel = "models/weapons/w_grenade.mdl" +SWEP.UseHands = true +SWEP.vModel = true + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "none" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.NextReload = 1 + +function SWEP:Initialize() + + self:SetHoldType( self.HoldType ) + +end + +function SWEP:Deploy() + self:SendWeaponAnim(ACT_VM_DRAW) + if !self.Owner:GetUsingSpecialWeapon() then + self.Owner:EquipPreviousWeapon() + end +end + +function SWEP:StartGrenadeModel() + self.GrenadeModel = ClientsideModel("models/weapons/w_eq_fraggrenade.mdl") +end + +function SWEP:EndGrenadeModel() + if IsValid(self.GrenadeModel) then + self.GrenadeModel:Remove() + self.GrenadeModel = nil + end +end + +function SWEP:PrimaryAttack() + --self:ThrowGrenade(1000) +end + +function SWEP:ThrowGrenade(force) + self.Owner:SetAnimation(PLAYER_ATTACK1) + self:SendWeaponAnim(ACT_VM_THROW) + + local nade = ents.Create("nz_fraggrenade") + nade:SetPos(self.Owner:EyePos() + (self.Owner:GetAimVector() * 20)) + nade:Spawn() + nade:Activate() + nade:SetOwner(self.Owner) + + local nadePhys = nade:GetPhysicsObject() + if !IsValid(nadePhys) then return end + nadePhys:ApplyForceCenter(self.Owner:GetAimVector():GetNormalized() * force + self.Owner:GetVelocity()) + + nade:SetExplosionTimer(3) +end + +function SWEP:PostDrawViewModel() + + if IsValid(self.GrenadeModel) then + local pos = LocalPlayer():GetViewModel():GetBonePosition( LocalPlayer():GetViewModel():LookupBone( "ValveBiped.Grenade_body" ) ) + local ang = EyeAngles() + self.GrenadeModel:SetPos(pos - ang:Up()*2 - ang:Forward()*5 + ang:Right()*2) + self.GrenadeModel:SetAngles(ang - Angle(25,0,20)) + --render.Model({model = "models/weapons/w_eq_fraggrenade.mdl", pos = pos, ang = ang}) + end + + LocalPlayer():GetViewModel():ManipulateBoneScale( LocalPlayer():GetViewModel():LookupBone( "ValveBiped.Grenade_body" ), Vector(0,0,0) ) + LocalPlayer():GetViewModel():ManipulateBoneScale( LocalPlayer():GetViewModel():LookupBone( "ValveBiped.Pin" ), Vector(0,0,0) ) +end + +function SWEP:DrawWorldModel() +end + +function SWEP:OnRemove() + self:EndGrenadeModel() +end + +function SWEP:Holster( wep ) + if not IsFirstTimePredicted() then return end + self:EndGrenadeModel() +end \ No newline at end of file diff --git a/lua/weapons/nz_monkey_bomb.lua b/lua/weapons/nz_monkey_bomb.lua new file mode 100644 index 00000000..f89af00d --- /dev/null +++ b/lua/weapons/nz_monkey_bomb.lua @@ -0,0 +1,186 @@ +if SERVER then + AddCSLuaFile("nz_monkey_bomb.lua") + SWEP.Weight = 5 + SWEP.AutoSwitchTo = false + SWEP.AutoSwitchFrom = true +end + +if CLIENT then + + SWEP.PrintName = "Monkey Bomb" + SWEP.Slot = 1 + SWEP.SlotPos = 1 + SWEP.DrawAmmo = false + SWEP.DrawCrosshair = true + + SWEP.Category = "nZombies" + +end + + +SWEP.Author = "Zet0r" +SWEP.Contact = "youtube.com/Zet0r" +SWEP.Purpose = "Throws a monkey bomb if you have any" +SWEP.Instructions = "Let the gamemode give you it" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.HoldType = "slam" + +SWEP.ViewModel = "models/weapons/c_monkey_bomb.mdl" +SWEP.WorldModel = "models/nzprops/monkey_bomb.mdl" +SWEP.UseHands = true +SWEP.vModel = true + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "none" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.NextReload = 1 + +SWEP.PrimeSounds = { + "nz/monkey/voice_prime/raise_vox_00.wav", + "nz/monkey/voice_prime/raise_vox_01.wav", + "nz/monkey/voice_prime/raise_vox_02.wav", + "nz/monkey/voice_prime/raise_vox_03.wav", + "nz/monkey/voice_prime/raise_vox_04.wav", + "nz/monkey/voice_prime/raise_vox_05.wav", + "nz/monkey/voice_prime/raise_vox_06.wav", + "nz/monkey/voice_prime/raise_vox_07.wav", + "nz/monkey/voice_prime/raise_vox_08.wav", + "nz/monkey/voice_prime/raise_vox_09.wav", + "nz/monkey/voice_prime/raise_vox_10.wav", + "nz/monkey/voice_prime/raise_vox_11.wav", +} + +function SWEP:Initialize() + + self:SetHoldType( "slam" ) + +end + +function SWEP:Deploy() + self:SendWeaponAnim(ACT_VM_DRAW) + self:SetHoldType( "slam" ) + timer.Simple(2, function() if IsValid(self) then self:SetHoldType("grenade") end end) + if CLIENT then + local sound = self.PrimeSounds[math.random(1,#self.PrimeSounds)] + surface.PlaySound(sound) + timer.Simple(1.2, function() + if IsValid(self) then + surface.PlaySound("nz/monkey/hat1.wav") + local i = 0 + timer.Create("MonkeyCymbalViewmodel", 0.23, 7, function() + surface.PlaySound("nz/monkey/cymbals/monk_cymb_0"..math.Round(i/2)..".wav") + i = i < 8 and i + 1 or 8 + end) + end + end) + + else + self:CallOnClient("Deploy") + end +end + +function SWEP:PrimaryAttack() + +end + +function SWEP:ThrowBomb(force) + self.Owner:SetAnimation(PLAYER_ATTACK1) + self:SendWeaponAnim(ACT_VM_THROW) + + local nade = ents.Create("nz_monkeybomb") + local pos = self.Owner:EyePos() + (self.Owner:GetAimVector() * 20) + local ang = Angle(0,(self.Owner:GetPos() - pos):Angle()[2]-90,0) + nade:SetPos(pos) + nade:SetAngles(ang) + nade:Spawn() + nade:Activate() + nade:SetOwner(self.Owner) + + local nadePhys = nade:GetPhysicsObject() + if !IsValid(nadePhys) then return end + nadePhys:ApplyForceCenter(self.Owner:GetAimVector():GetNormalized() * force + self.Owner:GetVelocity()) + nade:EmitSound("nz/monkey/voice_throw/throw_0"..math.random(0,3)..".wav") + +end + +function SWEP:PostDrawViewModel() + +end + +function SWEP:DrawWorldModel() + +end + +function SWEP:OnRemove() + +end + +function SWEP:GetViewModelPosition( pos, ang ) + + local newpos = LocalPlayer():EyePos() + local newang = LocalPlayer():EyeAngles() + local up = newang:Up() + + newpos = newpos + LocalPlayer():GetAimVector()*6 - up*65 + + return newpos, newang + +end + +if engine.ActiveGamemode() == "nzombies3" then + nzSpecialWeapons:AddWeapon( "nz_monkey_bomb", "specialgrenade", function(ply) -- Use function + if SERVER then + if ply:GetAmmoCount("nz_specialgrenade") <= 0 then return end + ply:SetUsingSpecialWeapon(true) + ply:SelectWeapon("nz_monkey_bomb") + timer.Simple(3, function() + if IsValid(ply) then + local wep = ply:GetActiveWeapon() + if wep:GetClass() == "nz_monkey_bomb" then + if !ply:KeyDown(IN_GRENADE2) then + wep:ThrowBomb(700) + ply:SetAmmo(ply:GetAmmoCount("nz_specialgrenade") - 1, "nz_specialgrenade") + timer.Simple(1, function() + if IsValid(ply) then + ply:SetUsingSpecialWeapon(false) + ply:EquipPreviousWeapon() + end + end) + else + hook.Add("KeyRelease", "CheckMonkeyRelease"..ply:EntIndex(), function(kply, key) + if kply == ply and key == IN_GRENADE2 then + wep:ThrowBomb(700) + ply:SetAmmo(ply:GetAmmoCount("nz_specialgrenade") - 1, "nz_specialgrenade") + timer.Simple(1, function() + if IsValid(ply) then + ply:SetUsingSpecialWeapon(false) + ply:EquipPreviousWeapon() + end + end) + hook.Remove("KeyRelease", "CheckMonkeyRelease"..ply:EntIndex()) + end + end) + end + else + ply:SetUsingSpecialWeapon(false) + ply:EquipPreviousWeapon() + end + end + end) + end + end, function(ply) -- Equip Function + ply:SetAmmo(3, "nz_specialgrenade") + end, function(ply) -- Max Ammo function + ply:SetAmmo(3, "nz_specialgrenade") + end) +end \ No newline at end of file diff --git a/lua/weapons/nz_multi_tool.lua b/lua/weapons/nz_multi_tool.lua new file mode 100644 index 00000000..b0f10848 --- /dev/null +++ b/lua/weapons/nz_multi_tool.lua @@ -0,0 +1,290 @@ +SWEP.PrintName = "Create Mode Toolgun" +SWEP.Author = "Zet0r" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" + +SWEP.ViewModel = "models/weapons/c_toolgun.mdl" +SWEP.WorldModel = "models/weapons/w_toolgun.mdl" +SWEP.AnimPrefix = "python" + +SWEP.Slot = 5 +SWEP.SlotPos = 1 + +SWEP.UseHands = true + +util.PrecacheModel( SWEP.ViewModel ) +util.PrecacheModel( SWEP.WorldModel ) + +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.NZPreventBox = true + +--[[--------------------------------------------------------- + Initialize +-----------------------------------------------------------]] +function SWEP:Initialize() + self.Primary = + { + ClipSize = -1, + DefaultClip = -1, + Automatic = false, + Ammo = "none" + } + + self.Secondary = + { + ClipSize = -1, + DefaultClip = -1, + Automatic = false, + Ammo = "none" + } + + self.ToolMode = "default" +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 ) + + + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + + 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 + +--[[--------------------------------------------------------- + Switch to another toolmode +-----------------------------------------------------------]] +function SWEP:SwitchTool(id) + + //Only allow if the condition has been met + if nz.Tools.ToolData[id].condition(self, self.Owner) then + self.ToolMode = id + + //Update the server with the newly equipped tool + nz.Tools.Functions.SendData( nz.Tools.SavedData[id], id ) + end + +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 CLIENT and !game.SinglePlayer() and !IsFirstTimePredicted() then return end + if nz.Tools.ToolData[self.ToolMode] and nz.Tools.ToolData[self.ToolMode].PrimaryAttack then + nz.Tools.ToolData[self.ToolMode].PrimaryAttack(self, self.Owner, trace, self.Owner.NZToolData) + end + if ( game.SinglePlayer() ) then self:CallOnClient( "PrimaryAttack" ) 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 CLIENT and !game.SinglePlayer() and !IsFirstTimePredicted() then return end + if nz.Tools.ToolData[self.ToolMode] and nz.Tools.ToolData[self.ToolMode].SecondaryAttack then + nz.Tools.ToolData[self.ToolMode].SecondaryAttack(self, self.Owner, trace, self.Owner.NZToolData) + end + if ( game.SinglePlayer() ) then self:CallOnClient( "SecondaryAttack" ) end +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() ) + + reload_cd = CurTime() + 0.3 + + if CLIENT and !game.SinglePlayer() and !IsFirstTimePredicted() then return end + if nz.Tools.ToolData[self.ToolMode] and nz.Tools.ToolData[self.ToolMode].Reload then + nz.Tools.ToolData[self.ToolMode].Reload(self, self.Owner, trace, self.Owner.NZToolData) + end + + end + if ( game.SinglePlayer() ) then self:CallOnClient( "Reload" ) end +end + +function SWEP:Deploy() + if CLIENT and !game.SinglePlayer() and !IsFirstTimePredicted() then return end + if nz.Tools.ToolData[self.ToolMode] and nz.Tools.ToolData[self.ToolMode].OnEquip then + nz.Tools.ToolData[self.ToolMode].OnEquip(self, self.Owner, self.Owner.NZToolData) + end + if ( game.SinglePlayer() ) then self:CallOnClient( "Deploy" ) end +end + +function SWEP:Holster() + if nz.Tools.ToolData[self.ToolMode] and nz.Tools.ToolData[self.ToolMode].OnHolster then + nz.Tools.ToolData[self.ToolMode].OnHolster(self, self.Owner, self.Owner.NZToolData) + end + if ( game.SinglePlayer() ) then self:CallOnClient( "Holster" ) end + return true +end + +--[[ +RENDER The scroll text Liek in sandbox +--]] + +if CLIENT then + local matScreen = Material( "models/weapons/v_toolgun/screen" ) + local txBackground = surface.GetTextureID( "models/weapons/v_toolgun/screen_bg" ) + + -- GetRenderTarget returns the texture if it exists, or creates it if it doesn't + local RTTexture = GetRenderTarget( "GModToolgunScreen", 256, 256 ) + + surface.CreateFont( "GModToolScreen", { + font = "Helvetica", + size = 60, + weight = 900 + } ) + + + local function DrawScrollingText( text, y, texwide ) + + local w, h = surface.GetTextSize( text ) + w = w + 64 + + y = y - h / 2 -- Center text to y position + + local x = RealTime() * 250 % w * -1 + + while ( x < texwide ) do + + surface.SetTextColor( 0, 0, 0, 255 ) + surface.SetTextPos( x + 3, y + 3 ) + surface.DrawText( text ) + + surface.SetTextColor( 255, 255, 255, 255 ) + surface.SetTextPos( x, y ) + surface.DrawText( text ) + + x = x + w + + end + + end + + --[[--------------------------------------------------------- + We use this opportunity to draw to the toolmode + screen's rendertarget texture. + -----------------------------------------------------------]] + function SWEP:RenderScreen() + + local TEX_SIZE = 256 + local mode = GetConVarString( "gmod_toolmode" ) + local oldW = ScrW() + local oldH = ScrH() + + -- Set the material of the screen to our render target + matScreen:SetTexture( "$basetexture", RTTexture ) + + local OldRT = render.GetRenderTarget() + local text = "Toolgun" + if nz.Tools.ToolData[self.ToolMode] then + text = nz.Tools.ToolData[self.ToolMode].displayname + if nz.Tools.SavedData[self.ToolMode] then + for k,v in pairs(nz.Tools.SavedData[self.ToolMode]) do + text = text .." - "..k..": "..v + end + text = text .. " - " + end + end + + -- Set up our view for drawing to the texture + render.SetRenderTarget( RTTexture ) + render.SetViewPort( 0, 0, TEX_SIZE, TEX_SIZE ) + cam.Start2D() + + -- Background + surface.SetDrawColor( 255, 255, 255, 255 ) + surface.SetTexture( txBackground ) + surface.DrawTexturedRect( 0, 0, TEX_SIZE, TEX_SIZE ) + + surface.SetFont( "GModToolScreen" ) + DrawScrollingText( text, 104, TEX_SIZE ) + + cam.End2D() + render.SetRenderTarget( OldRT ) + render.SetViewPort( 0, 0, oldW, oldH ) + end + + function SWEP:DrawHUD() + if nz.Tools.ToolData[self.ToolMode] and nz.Tools.ToolData[self.ToolMode].drawhud then + nz.Tools.ToolData[self.ToolMode].drawhud() + end + end +end diff --git a/lua/weapons/nz_one_inch_punch.lua b/lua/weapons/nz_one_inch_punch.lua new file mode 100644 index 00000000..3544684f --- /dev/null +++ b/lua/weapons/nz_one_inch_punch.lua @@ -0,0 +1,225 @@ +SWEP.Base = "weapon_fists" + +if SERVER then + AddCSLuaFile("nz_one_inch_punch.lua") + SWEP.Weight = 5 + SWEP.AutoSwitchTo = false + SWEP.AutoSwitchFrom = true +end + +if CLIENT then + + SWEP.PrintName = "One Inch Punch" + SWEP.Slot = 1 + SWEP.SlotPos = 1 + SWEP.DrawAmmo = false + SWEP.DrawCrosshair = true + + SWEP.Category = "nZombies" + +end + + +SWEP.Author = "Zet0r" +SWEP.Contact = "youtube.com/Zet0r" +SWEP.Purpose = "FORCE SLAM!" +SWEP.Instructions = "Let the gamemode give you it" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false +SWEP.WorldModel = Model( "models/effects/combineball.mdl" ) + +SWEP.NZPreventBox = true + +function SWEP:PostDrawViewModel() + +end + +local SwingSound = Sound( "WeaponFrag.Throw" ) +local HitSound = Sound( "Flesh.ImpactHard" ) + +function SWEP:PrimaryAttack( right ) + + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + + local anim = "fists_left" + local bone = 8 + if ( self:GetCombo() >= 1 ) then anim = "fists_right" bone = 27 end + if ( self:GetCombo() >= 2 ) then + anim = "fists_uppercut" + bone = 27 + end + + local vm = self.Owner:GetViewModel() + vm:SendViewModelMatchingSequence( vm:LookupSequence( anim ) ) + + self:EmitSound( SwingSound ) + + self:UpdateNextIdle() + self:SetNextMeleeAttack( CurTime() + 0.2 ) + + self:SetNextPrimaryFire( CurTime() + 0.9 ) + self:SetNextSecondaryFire( CurTime() + 0.9 ) + + if CLIENT then + local e = EffectData() + e:SetMagnitude(bone) + util.Effect("one_inch_punch_blow",e) + end + +end + +function SWEP:SecondaryAttack() + + self:PrimaryAttack( true ) + +end + +function SWEP:DealDamage() + + local anim = self:GetSequenceName(self.Owner:GetViewModel():GetSequence()) + + self.Owner:LagCompensation( true ) + + local tr = util.TraceLine( { + start = self.Owner:GetShootPos(), + endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance, + filter = self.Owner, + mask = MASK_SHOT_HULL + } ) + + if ( !IsValid( tr.Entity ) ) then + tr = util.TraceHull( { + start = self.Owner:GetShootPos(), + endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance, + filter = self.Owner, + mins = Vector( -10, -10, -8 ), + maxs = Vector( 10, 10, 8 ), + mask = MASK_SHOT_HULL + } ) + end + + -- We need the second part for single player because SWEP:Think is ran shared in SP + if ( tr.Hit && !( game.SinglePlayer() && CLIENT ) ) then + self:EmitSound( HitSound ) + end + + local hit = false + + if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then + local dmginfo = DamageInfo() + + local attacker = self.Owner + if ( !IsValid( attacker ) ) then attacker = self end + dmginfo:SetAttacker( attacker ) + + dmginfo:SetInflictor( self ) + dmginfo:SetDamage( math.random( 419, 450 ) ) + + if ( anim == "fists_left" ) then + dmginfo:SetDamageForce( self.Owner:GetRight() * 4912 + self.Owner:GetForward() * 9998 + self.Owner:GetUp() * 5000 ) -- Yes we need those specific numbers + elseif ( anim == "fists_right" ) then + dmginfo:SetDamageForce( self.Owner:GetRight() * -4912 + self.Owner:GetForward() * 9989 + self.Owner:GetUp() * 5000 ) + elseif ( anim == "fists_uppercut" ) then + dmginfo:SetDamageForce( self.Owner:GetUp() * 15158 + self.Owner:GetForward() * 10012 ) + end + + tr.Entity:TakeDamageInfo( dmginfo ) + hit = true + else + if ( SERVER ) then + self:SetCombo( 0 ) + end + end + + if ( SERVER && IsValid( tr.Entity ) ) then + local phys = tr.Entity:GetPhysicsObject() + if ( IsValid( phys ) ) then + phys:ApplyForceOffset( self.Owner:GetAimVector() * 80 * phys:GetMass(), tr.HitPos ) + end + end + + if ( SERVER ) then + if ( hit && anim != "fists_uppercut" ) then + self:SetCombo( self:GetCombo() + 1 ) + else + self:SetCombo( 0 ) + end + end + + self.Owner:LagCompensation( false ) + +end + +function SWEP:Think() + + local vm = self.Owner:GetViewModel() + local curtime = CurTime() + local idletime = self:GetNextIdle() + + if ( idletime > 0 && CurTime() > idletime ) then + + vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_idle_0" .. math.random( 1, 2 ) ) ) + + self:UpdateNextIdle() + + end + + local meleetime = self:GetNextMeleeAttack() + + if ( meleetime > 0 && CurTime() > meleetime ) then + + self:DealDamage() + + self:SetNextMeleeAttack( 0 ) + + end + +end + +function SWEP:Deploy() + + local vm = self.Owner:GetViewModel() + vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_draw" ) ) + + self:UpdateNextIdle() + +end + +if engine.ActiveGamemode() == "nzombies3" then + nzSpecialWeapons:AddWeapon( "nz_one_inch_punch", "knife", function(ply, wep) + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SetActiveWeapon(nil) + ply:SelectWeapon("nz_one_inch_punch") + timer.Simple(0.1, function() + if IsValid(ply) then + ply:ConCommand("+attack") + timer.Simple(0.15, function() + if IsValid(ply) then + ply:ConCommand("-attack") + end + end) + end + end) + timer.Simple(0.7, function() + if IsValid(ply) then + ply:SetUsingSpecialWeapon(false) + ply:EquipPreviousWeapon() + end + end) + end + end, function(ply, wep) + if SERVER then + local prevwep = ply:GetActiveWeapon():GetClass() + ply:SetUsingSpecialWeapon(true) + ply:SelectWeapon("nz_one_inch_punch") + timer.Simple(1, function() + if IsValid(ply) then + ply:SetUsingSpecialWeapon(false) + ply:EquipPreviousWeapon() + end + end) + end + end) +end \ No newline at end of file diff --git a/lua/weapons/nz_packapunch_arms.lua b/lua/weapons/nz_packapunch_arms.lua new file mode 100644 index 00000000..8e889199 --- /dev/null +++ b/lua/weapons/nz_packapunch_arms.lua @@ -0,0 +1,130 @@ +if SERVER then + AddCSLuaFile("nz_packapunch_arms.lua") + SWEP.Weight = 5 + SWEP.AutoSwitchTo = false + SWEP.AutoSwitchFrom = true +end + +if CLIENT then + + SWEP.PrintName = "Hands" + SWEP.Slot = 1 + SWEP.SlotPos = 1 + SWEP.DrawAmmo = false + SWEP.DrawCrosshair = true + + SWEP.Category = "nZombies" + +end + + +SWEP.Author = "Zet0r" +SWEP.Contact = "youtube.com/Zet0r" +SWEP.Purpose = "Fancy Viewmodel Animations" +SWEP.Instructions = "Let the gamemode give you it" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.HoldType = "slam" + +SWEP.ViewModel = "models/weapons/c_packapunch_arms.mdl" +SWEP.WorldModel = "" +SWEP.UseHands = true +SWEP.vModel = true + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "none" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.NZPreventBox = true + +function SWEP:Initialize() + + self:SetHoldType( "slam" ) + +end + +function SWEP:Deploy() + self:SendWeaponAnim(ACT_VM_DRAW) + + timer.Simple(0.5,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + self:EmitSound("nz/perks/knuckle_00.wav") + end + end + end) + + timer.Simple(1.3,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + self:EmitSound("nz/perks/knuckle_01.wav") + end + end + end) + + timer.Simple(2.5,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + timer.Simple(0.1,function() + self.Owner:SetUsingSpecialWeapon(false) + if IsValid(self.Owner:GetWeapons()[1]) then self.Owner:SelectWeapon(self.Owner:GetWeapons()[1]:GetClass()) end + self:Remove() + end) + end + end + end) +end + +function SWEP:Equip( owner ) + + --timer.Simple(3.2,function() self:Remove() end) + owner:SetActiveWeapon("nz_packapunch_arms") + +end + +function SWEP:PrimaryAttack() + +end + +function SWEP:PostDrawViewModel() + +end + +function SWEP:DrawWorldModel() + +end + +function SWEP:OnRemove() + if !IsValid(self.Owner:GetActiveWeapon()) or !self.Owner:GetActiveWeapon():IsSpecial() then + self.Owner:SetUsingSpecialWeapon(false) + end +end + +function SWEP:GetViewModelPosition( pos, ang ) + + local newpos = LocalPlayer():EyePos() + local newang = LocalPlayer():EyeAngles() + local up = newang:Up() + + newpos = newpos + LocalPlayer():GetAimVector()*6 - up*63 + + return newpos, newang + +end + +if engine.ActiveGamemode() == "nzombies3" then + nzSpecialWeapons:AddWeapon( "nz_packapunch_arms", "display", nil, function(ply, wep) + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SelectWeapon("nz_packapunch_arms") + end + end) +end \ No newline at end of file diff --git a/lua/weapons/nz_perk_bottle/shared.lua b/lua/weapons/nz_perk_bottle/shared.lua new file mode 100644 index 00000000..d1143070 --- /dev/null +++ b/lua/weapons/nz_perk_bottle/shared.lua @@ -0,0 +1,181 @@ + +AddCSLuaFile( "shared.lua" ) + +SWEP.Author = "Zet0r" +SWEP.Instructions = "Fancy Viewmodel Animations" +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.ViewModel = "models/weapons/c_perk_bottle.mdl" +SWEP.WorldModel = "" + +SWEP.UseHands = true + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Delay = 1 +SWEP.ViewModelFOV = 75 +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = true +SWEP.AutoSwitchFrom = false + +SWEP.PrintName = "Perk Bottle" +SWEP.Slot = 3 +SWEP.SlotPos = 1 +SWEP.DrawAmmo = false +SWEP.DrawCrosshair = false + +SWEP.SwayScale = 0 +SWEP.BobScale = 0 + +SWEP.NZPreventBox = true -- Prevents from being in the box by default + +local oldmat +local perk_materials = { + ["jugg"] = "models/perk_bottle/c_perk_bottle_jugg", + ["speed"] = "models/perk_bottle/c_perk_bottle_speed", + ["dtap"] = "models/perk_bottle/c_perk_bottle_dtap", + ["revive"] = "models/perk_bottle/c_perk_bottle_revive", + ["dtap2"] = "models/perk_bottle/c_perk_bottle_dtap2", + ["staminup"] = "models/perk_bottle/c_perk_bottle_stamin", + ["phd"] = "models/perk_bottle/c_perk_bottle_phd", + ["deadshot"] = "models/perk_bottle/c_perk_bottle_deadshot", + ["mulekick"] = "models/perk_bottle/c_perk_bottle_mulekick", + ["cherry"] = "models/perk_bottle/c_perk_bottle_cherry", + ["tombstone"] = "models/perk_bottle/c_perk_bottle_tombstone", + ["whoswho"] = "models/perk_bottle/c_perk_bottle_whoswho", + ["vulture"] = "models/perk_bottle/c_perk_bottle_vulture", +} + +if SERVER then + util.AddNetworkString("perk_blur_screen") +end + +function SWEP:SetupDataTables() + + self:NetworkVar( "String", 0, "Perk" ) + +end + +function SWEP:Initialize() + if CLIENT then + if self.Owner == LocalPlayer() then + local vm = LocalPlayer():GetViewModel() + local mat = perk_materials[self:GetPerk()] + oldmat = vm:GetMaterial() or "" + vm:SetMaterial(mat) + end + end +end + +function SWEP:Equip( owner ) + + timer.Simple(3.2,function() + owner:SetUsingSpecialWeapon(false) + owner:EquipPreviousWeapon() + end) + owner:SetActiveWeapon("nz_perk_bottle") + +end + +function SWEP:Deploy() + + timer.Simple(0.5,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + self:EmitSound("nz/perks/open.wav") + self.Owner:ViewPunch( Angle( -1, -1, 0 ) ) + end + end + end) + + timer.Simple(1.3,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + self:EmitSound("nz/perks/drink.wav") + self.Owner:ViewPunch( Angle( -3, 0, 0 ) ) + end + end + end) + + timer.Simple(2.3,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + self:EmitSound("nz/perks/smash.wav") + net.Start("perk_blur_screen") + net.Send(self.Owner) + end + end + end) + + timer.Simple(3,function() + if IsValid(self) and IsValid(self.Owner) then + if self.Owner:Alive() then + self:EmitSound("nz/perks/burp.wav") + timer.Simple(0.1,function() self.Owner:SetUsingSpecialWeapon(false) self:Remove() end) + end + end + end) + + +end + +function PerkBlurScreen() + local mat = Material( "pp/blurscreen" ) + local function blurhook() + DrawMotionBlur(0.4, 0.8, 0.01) + end + hook.Add( "RenderScreenspaceEffects", "PaintPerkBlur", blurhook ) + timer.Simple(0.7,function() hook.Remove( "RenderScreenspaceEffects", "PaintPerkBlur" ) end) +end +net.Receive("perk_blur_screen", PerkBlurScreen) + +function SWEP:Holster() + return false +end + +function SWEP:PrimaryAttack() +end + +function SWEP:OnRemove() + + if CLIENT then + if self.Owner == LocalPlayer() then + local vm = LocalPlayer():GetViewModel() + vm:SetMaterial(oldmat) + end + if !IsValid(self.Owner:GetActiveWeapon()) or !self.Owner:GetActiveWeapon():IsSpecial() then + self.Owner:SetUsingSpecialWeapon(false) + end + end + + hook.Remove( "RenderScreenspaceEffects", "PaintPerkBlur" ) + +end + +function SWEP:GetViewModelPosition( pos, ang ) + + local newpos = LocalPlayer():EyePos() + local newang = LocalPlayer():EyeAngles() + local up = newang:Up() + + newpos = newpos + LocalPlayer():GetAimVector()*3 - up*65 + + return newpos, newang + +end + +function SWEP:SecondaryAttack() +end + +function SWEP:ShouldDropOnDie() + return false +end + +-- So it counts as special weapon in the gamemode +function SWEP:IsSpecial() + return true +end \ No newline at end of file diff --git a/lua/weapons/nz_quickknife_crowbar/ai_translations.lua b/lua/weapons/nz_quickknife_crowbar/ai_translations.lua new file mode 100644 index 00000000..748d50db --- /dev/null +++ b/lua/weapons/nz_quickknife_crowbar/ai_translations.lua @@ -0,0 +1,20 @@ + +/*--------------------------------------------------------- + Name: SetupWeaponHoldTypeForAI + Desc: Mainly a Todo.. In a seperate file to clean up the init.lua +---------------------------------------------------------*/ +function SWEP:SetupWeaponHoldTypeForAI( t ) + + self.ActivityTranslateAI = {} + self.ActivityTranslateAI [ ACT_STAND ] = ACT_IDLE_MELEE + self.ActivityTranslateAI [ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_MELEE + + self.ActivityTranslateAI [ ACT_MP_RUN ] = ACT_HL2MP_RUN_MELEE + self.ActivityTranslateAI [ ACT_MP_CROUCHWALK ] = ACT_HL2MP_WALK_CROUCH_MELEE + + self.ActivityTranslateAI [ ACT_MELEE_ATTACK1 ] = ACT_MELEE_ATTACK1 + + self.ActivityTranslateAI [ ACT_RELOAD ] = ACT_RELOAD + +end + diff --git a/lua/weapons/nz_quickknife_crowbar/cl_init.lua b/lua/weapons/nz_quickknife_crowbar/cl_init.lua new file mode 100644 index 00000000..95638668 --- /dev/null +++ b/lua/weapons/nz_quickknife_crowbar/cl_init.lua @@ -0,0 +1,37 @@ + +include('shared.lua') + + +SWEP.PrintName = "Crowbar" +SWEP.ClassName = "nz_quickknife_crowbar" +SWEP.Slot = 0 +SWEP.SlotPos = 0 +SWEP.DrawAmmo = false +SWEP.DrawCrosshair = true +SWEP.DrawWeaponInfoBox = false +SWEP.BounceWeaponIcon = false + +SWEP.WepSelectFont = "HL2MPTypeDeath" +SWEP.WepSelectLetter = "6" +SWEP.IconFont = "HL2MPTypeDeath" +SWEP.IconLetter = "6" + +/*--------------------------------------------------------- + Checks the objects before any action is taken + This is to make sure that the entities haven't been removed +---------------------------------------------------------*/ +function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha ) + + // Set us up the texture + surface.SetDrawColor( color_transparent ) + surface.SetTextColor( 255, 220, 0, alpha ) + surface.SetFont( self.WepSelectFont ) + local w, h = surface.GetTextSize( self.WepSelectLetter ) + + // Draw that mother + surface.SetTextPos( x + ( wide / 2 ) - ( w / 2 ), + y + ( tall / 2 ) - ( h / 2 ) ) + surface.DrawText( self.WepSelectLetter ) + +end + diff --git a/lua/weapons/nz_quickknife_crowbar/init.lua b/lua/weapons/nz_quickknife_crowbar/init.lua new file mode 100644 index 00000000..bd42ca76 --- /dev/null +++ b/lua/weapons/nz_quickknife_crowbar/init.lua @@ -0,0 +1,23 @@ + +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) + +include( "shared.lua" ) +include( "ai_translations.lua" ) + +SWEP.Weight = 0 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +/*--------------------------------------------------------- + Name: OnDrop + Desc: Weapon was dropped +---------------------------------------------------------*/ +function SWEP:OnDrop() + + if ( IsValid( self.Weapon ) ) then + // self.Weapon:Remove() + end + +end + diff --git a/lua/weapons/nz_quickknife_crowbar/shared.lua b/lua/weapons/nz_quickknife_crowbar/shared.lua new file mode 100644 index 00000000..4c358712 --- /dev/null +++ b/lua/weapons/nz_quickknife_crowbar/shared.lua @@ -0,0 +1,252 @@ + + -- Weapon base courtesy of CptFuzzies SWEP Bases project + -- Recoded to do more balanced damage + +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" + +SWEP.ViewModelFOV = 54 +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/c_crowbar.mdl" +SWEP.WorldModel = "models/weapons/w_crowbar.mdl" +SWEP.AnimPrefix = "crowbar" +SWEP.HoldType = "melee" + +SWEP.UseHands = true + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +CROWBAR_RANGE = 75.0 +CROWBAR_REFIRE = 0.4 + +SWEP.Primary.Sound = Sound( "Weapon_Crowbar.Single" ) +SWEP.Primary.Hit = Sound( "Weapon_Crowbar.Melee_Hit" ) +SWEP.Primary.Range = CROWBAR_RANGE +SWEP.Primary.Damage = 75 +SWEP.Primary.DamageType = DMG_CLUB +SWEP.Primary.Force = 0.75 +SWEP.Primary.ClipSize = -1 +SWEP.Primary.Delay = CROWBAR_REFIRE +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "None" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "None" + +SWEP.NZPreventBox = true + + + +/*--------------------------------------------------------- + Name: SWEP:Initialize( ) + Desc: Called when the weapon is first loaded +---------------------------------------------------------*/ +function SWEP:Initialize() + self:SetWeaponHoldType( self.HoldType ) +end + + +/*--------------------------------------------------------- + Name: SWEP:PrimaryAttack( ) + Desc: +attack1 has been pressed +---------------------------------------------------------*/ +function SWEP:PrimaryAttack() + + // Only the player fires this way so we can cast + local pPlayer = self.Owner; + + if ( !pPlayer ) then + return; + end + + // Make sure we can swing first + if ( !self:CanPrimaryAttack() ) then return end + + local vecSrc = pPlayer:GetShootPos(); + local vecDirection = pPlayer:GetAimVector(); + + local trace = {} + trace.start = vecSrc + trace.endpos = vecSrc + ( vecDirection * self:GetRange() ) + trace.filter = pPlayer + + local traceHit = util.TraceLine( trace ) + + if ( traceHit.Hit ) then + + self.Weapon:EmitSound( self.Primary.Hit ); + + self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER ); + pPlayer:SetAnimation( PLAYER_ATTACK1 ); + + self.Weapon:SetNextPrimaryFire( CurTime() + self:GetFireRate() ); + self.Weapon:SetNextSecondaryFire( CurTime() + self.Weapon:SequenceDuration() ); + + self:Hit( traceHit, pPlayer ); + + return + + end + + self.Weapon:EmitSound( self.Primary.Sound ); + + self.Weapon:SendWeaponAnim( ACT_VM_MISSCENTER ); + pPlayer:SetAnimation( PLAYER_ATTACK1 ); + + self.Weapon:SetNextPrimaryFire( CurTime() + self:GetFireRate() ); + self.Weapon:SetNextSecondaryFire( CurTime() + self.Weapon:SequenceDuration() ); + + self:Swing( traceHit, pPlayer ); + + return + +end + + +/*--------------------------------------------------------- + Name: SWEP:SecondaryAttack( ) + Desc: +attack2 has been pressed +---------------------------------------------------------*/ +function SWEP:SecondaryAttack() + return false +end + +/*--------------------------------------------------------- + Name: SWEP:Reload( ) + Desc: Reload is being pressed +---------------------------------------------------------*/ +function SWEP:Reload() + return false +end + +//----------------------------------------------------------------------------- +// Purpose: Get the damage amount for the animation we're doing +// Input : hitActivity - currently played activity +// Output : Damage amount +//----------------------------------------------------------------------------- +function SWEP:GetDamageForActivity( hitActivity ) + return nzRound:InProgress() and 30 + (45/nzRound:GetNumber()) or 75 +end + +//----------------------------------------------------------------------------- +// Purpose: Add in a view kick for this weapon +//----------------------------------------------------------------------------- +function SWEP:AddViewKick() + + local pPlayer = self:GetOwner(); + + if ( pPlayer == NULL ) then + return; + end + + if ( pPlayer:IsNPC() ) then + return; + end + + local punchAng = Angle( 0, 0 ,0 ); + + punchAng.pitch = math.Rand( 1.0, 2.0 ); + punchAng.yaw = math.Rand( -2.0, -1.0 ); + punchAng.roll = 0.0; + + pPlayer:ViewPunch( punchAng ); + +end + + +/*--------------------------------------------------------- + Name: SWEP:Deploy( ) + Desc: Whip it out +---------------------------------------------------------*/ +function SWEP:Deploy() + + self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) + self:SetDeploySpeed( self.Weapon:SequenceDuration() ) + + return true + +end + + +/*--------------------------------------------------------- + Name: SWEP:Hit( ) + Desc: A convenience function to trace impacts +---------------------------------------------------------*/ +function SWEP:Hit( traceHit, pPlayer ) + + local vecSrc = pPlayer:GetShootPos(); + + if ( SERVER ) then + pPlayer:TraceHullAttack( vecSrc, traceHit.HitPos, Vector( -5, -5, -5 ), Vector( 5, 5, 36 ), self:GetDamageForActivity(), self.Primary.DamageType, self.Primary.Force ); + end + + // self:AddViewKick(); + +end + + +/*--------------------------------------------------------- + Name: SWEP:Swing( ) + Desc: A convenience function to trace impacts +---------------------------------------------------------*/ +function SWEP:Swing( traceHit, pPlayer ) +end + + +/*--------------------------------------------------------- + Name: SWEP:CanPrimaryAttack( ) + Desc: Helper function for checking for no ammo +---------------------------------------------------------*/ +function SWEP:CanPrimaryAttack() + return true +end + + +/*--------------------------------------------------------- + Name: SWEP:CanSecondaryAttack( ) + Desc: Helper function for checking for no ammo +---------------------------------------------------------*/ +function SWEP:CanSecondaryAttack() + return false +end + + +/*--------------------------------------------------------- + Name: SetDeploySpeed + Desc: Sets the weapon deploy speed. + This value needs to match on client and server. +---------------------------------------------------------*/ +function SWEP:SetDeploySpeed( speed ) + + self.m_WeaponDeploySpeed = tonumber( speed / GetConVarNumber( "phys_timescale" ) ) + + self.Weapon:SetNextPrimaryFire( CurTime() + speed ) + self.Weapon:SetNextSecondaryFire( CurTime() + speed ) + +end + + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +function SWEP:Drop( vecVelocity ) +if ( !CLIENT ) then + self:Remove(); +end +end + +function SWEP:GetRange() + return self.Primary.Range; +end + +function SWEP:GetFireRate() + return self.Primary.Delay; +end + diff --git a/lua/weapons/nz_revive_morphine.lua b/lua/weapons/nz_revive_morphine.lua new file mode 100644 index 00000000..f5e196c9 --- /dev/null +++ b/lua/weapons/nz_revive_morphine.lua @@ -0,0 +1,104 @@ +if SERVER then + AddCSLuaFile("nz_revive_morphine.lua") + SWEP.Weight = 5 + SWEP.AutoSwitchTo = false + SWEP.AutoSwitchFrom = true +end + +if CLIENT then + + SWEP.PrintName = "Morphine" + SWEP.Slot = 1 + SWEP.SlotPos = 1 + SWEP.DrawAmmo = false + SWEP.DrawCrosshair = true + + SWEP.Category = "nZombies" + +end + + +SWEP.Author = "Zet0r" +SWEP.Contact = "youtube.com/Zet0r" +SWEP.Purpose = "Fancy Viewmodel Animations" +SWEP.Instructions = "Let the gamemode give you it" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.HoldType = "slam" + +SWEP.ViewModel = "models/weapons/c_revive_morphine.mdl" +SWEP.WorldModel = "" +SWEP.UseHands = true +SWEP.vModel = true + +SWEP.Primary.ClipSize = -1 +SWEP.Primary.DefaultClip = -1 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "none" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.NZPreventBox = true + +function SWEP:Initialize() + + self:SetHoldType( "slam" ) + +end + +function SWEP:Deploy() + self:SendWeaponAnim(ACT_VM_DRAW) + self.WepOwner = self.Owner +end + +function SWEP:Equip( owner ) + owner:SetActiveWeapon("nz_revive_morphine") +end + +function SWEP:PrimaryAttack() + +end + +function SWEP:PostDrawViewModel() + +end + +function SWEP:DrawWorldModel() + +end + +function SWEP:OnRemove() + if SERVER then + if !IsValid(self.WepOwner:GetActiveWeapon()) or !self.WepOwner:GetActiveWeapon():IsSpecial() then + self.WepOwner:SetUsingSpecialWeapon(false) + end + self.WepOwner:SetActiveWeapon(nil) + self.WepOwner:EquipPreviousWeapon() + end +end + +function SWEP:GetViewModelPosition( pos, ang ) + + local newpos = LocalPlayer():EyePos() + local newang = LocalPlayer():EyeAngles() + local up = newang:Up() + + newpos = newpos + LocalPlayer():GetAimVector()*6 - up*63 + + return newpos, newang + +end + +if engine.ActiveGamemode() == "nzombies3" then + nzSpecialWeapons:AddWeapon( "nz_revive_morphine", "display", nil, function(ply, wep) + if SERVER then + ply:SetUsingSpecialWeapon(true) + ply:SelectWeapon("nz_revive_morphine") + end + end) +end \ No newline at end of file diff --git a/nzombies3/entities/weapons/nz_tool_base/cl_init.lua b/lua/weapons/nz_tool_base/cl_init.lua similarity index 100% rename from nzombies3/entities/weapons/nz_tool_base/cl_init.lua rename to lua/weapons/nz_tool_base/cl_init.lua diff --git a/nzombies3/entities/weapons/nz_tool_base/init.lua b/lua/weapons/nz_tool_base/init.lua similarity index 100% rename from nzombies3/entities/weapons/nz_tool_base/init.lua rename to lua/weapons/nz_tool_base/init.lua diff --git a/lua/weapons/nz_tool_base/shared.lua b/lua/weapons/nz_tool_base/shared.lua new file mode 100644 index 00000000..979252da --- /dev/null +++ b/lua/weapons/nz_tool_base/shared.lua @@ -0,0 +1,178 @@ +-- 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.NZPreventBox = 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 + self:OnPrimaryAttack(trace) + end +end + +function SWEP:OnPrimaryAttack( trace ) + print("dicks") +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 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/maps/ttt_kosovos.nav b/maps/ttt_kosovos.nav new file mode 100644 index 00000000..862a80fc Binary files /dev/null and b/maps/ttt_kosovos.nav differ diff --git a/materials/bloodline_score.png b/materials/bloodline_score.png new file mode 100644 index 00000000..cbe7e0fb Binary files /dev/null and b/materials/bloodline_score.png differ diff --git a/materials/bloodline_score1.png b/materials/bloodline_score1.png new file mode 100644 index 00000000..85f7dbe8 Binary files /dev/null and b/materials/bloodline_score1.png differ diff --git a/materials/bloodline_score2.png b/materials/bloodline_score2.png new file mode 100644 index 00000000..0264cd8b Binary files /dev/null and b/materials/bloodline_score2.png differ diff --git a/materials/bloodline_score3.png b/materials/bloodline_score3.png new file mode 100644 index 00000000..4e2b3ee7 Binary files /dev/null and b/materials/bloodline_score3.png differ diff --git a/materials/bloodline_score4.png b/materials/bloodline_score4.png new file mode 100644 index 00000000..22eaf365 Binary files /dev/null and b/materials/bloodline_score4.png differ diff --git a/materials/bloodline_scoreboard.png b/materials/bloodline_scoreboard.png new file mode 100644 index 00000000..23249461 Binary files /dev/null and b/materials/bloodline_scoreboard.png differ diff --git a/materials/chalk.png b/materials/chalk.png new file mode 100644 index 00000000..e87feb01 Binary files /dev/null and b/materials/chalk.png differ diff --git a/materials/cod_hud.png b/materials/cod_hud.png new file mode 100644 index 00000000..f3422a9d Binary files /dev/null and b/materials/cod_hud.png differ diff --git a/materials/grenade-256.png b/materials/grenade-256.png new file mode 100644 index 00000000..1fe22db4 Binary files /dev/null and b/materials/grenade-256.png differ diff --git a/materials/gun_hud_blood.png b/materials/gun_hud_blood.png new file mode 100644 index 00000000..8d84459c Binary files /dev/null and b/materials/gun_hud_blood.png differ diff --git a/materials/icon_close.png b/materials/icon_close.png new file mode 100644 index 00000000..39641921 Binary files /dev/null and b/materials/icon_close.png differ diff --git a/materials/icon_settings.png b/materials/icon_settings.png new file mode 100644 index 00000000..507c5edd Binary files /dev/null and b/materials/icon_settings.png differ diff --git a/materials/lightning.png b/materials/lightning.png new file mode 100644 index 00000000..ddab2a57 Binary files /dev/null and b/materials/lightning.png differ diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vmt b/materials/models/alig96/perks/doubletap/doubletap.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vmt rename to materials/models/alig96/perks/doubletap/doubletap.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vtf b/materials/models/alig96/perks/doubletap/doubletap.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap.vtf rename to materials/models/alig96/perks/doubletap/doubletap.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_off.vmt b/materials/models/alig96/perks/doubletap/doubletap_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_off.vmt rename to materials/models/alig96/perks/doubletap/doubletap_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_on.vmt b/materials/models/alig96/perks/doubletap/doubletap_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_on.vmt rename to materials/models/alig96/perks/doubletap/doubletap_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_phong.vtf b/materials/models/alig96/perks/doubletap/doubletap_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_phong.vtf rename to materials/models/alig96/perks/doubletap/doubletap_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vmt b/materials/models/alig96/perks/doubletap/doubletap_price.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vmt rename to materials/models/alig96/perks/doubletap/doubletap_price.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vtf b/materials/models/alig96/perks/doubletap/doubletap_price.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price.vtf rename to materials/models/alig96/perks/doubletap/doubletap_price.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_off.vmt b/materials/models/alig96/perks/doubletap/doubletap_price_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_off.vmt rename to materials/models/alig96/perks/doubletap/doubletap_price_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_on.vmt b/materials/models/alig96/perks/doubletap/doubletap_price_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_price_on.vmt rename to materials/models/alig96/perks/doubletap/doubletap_price_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vmt b/materials/models/alig96/perks/doubletap/doubletap_snn.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vmt rename to materials/models/alig96/perks/doubletap/doubletap_snn.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vtf b/materials/models/alig96/perks/doubletap/doubletap_snn.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn.vtf rename to materials/models/alig96/perks/doubletap/doubletap_snn.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf b/materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf rename to materials/models/alig96/perks/doubletap/doubletap_snn_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt b/materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt rename to materials/models/alig96/perks/doubletap/doubletap_snn_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt b/materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt rename to materials/models/alig96/perks/doubletap/doubletap_snn_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf b/materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf rename to materials/models/alig96/perks/doubletap/doubletap_snn_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vmt b/materials/models/alig96/perks/doubletap/power_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vmt rename to materials/models/alig96/perks/doubletap/power_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vtf b/materials/models/alig96/perks/doubletap/power_off.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/power_off.vtf rename to materials/models/alig96/perks/doubletap/power_off.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vmt b/materials/models/alig96/perks/doubletap/power_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vmt rename to materials/models/alig96/perks/doubletap/power_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vtf b/materials/models/alig96/perks/doubletap/power_on.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/power_on.vtf rename to materials/models/alig96/perks/doubletap/power_on.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/doubletap/white.vtf b/materials/models/alig96/perks/doubletap/white.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/doubletap/white.vtf rename to materials/models/alig96/perks/doubletap/white.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg.vmt b/materials/models/alig96/perks/jugg/jugg.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg.vmt rename to materials/models/alig96/perks/jugg/jugg.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg.vtf b/materials/models/alig96/perks/jugg/jugg.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg.vtf rename to materials/models/alig96/perks/jugg/jugg.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_nrm.vtf b/materials/models/alig96/perks/jugg/jugg_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_nrm.vtf rename to materials/models/alig96/perks/jugg/jugg_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_off.vmt b/materials/models/alig96/perks/jugg/jugg_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_off.vmt rename to materials/models/alig96/perks/jugg/jugg_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_on.vmt b/materials/models/alig96/perks/jugg/jugg_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_on.vmt rename to materials/models/alig96/perks/jugg/jugg_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_phong.vtf b/materials/models/alig96/perks/jugg/jugg_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_phong.vtf rename to materials/models/alig96/perks/jugg/jugg_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vmt b/materials/models/alig96/perks/jugg/jugg_price.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vmt rename to materials/models/alig96/perks/jugg/jugg_price.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vtf b/materials/models/alig96/perks/jugg/jugg_price.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_price.vtf rename to materials/models/alig96/perks/jugg/jugg_price.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_off.vmt b/materials/models/alig96/perks/jugg/jugg_price_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_off.vmt rename to materials/models/alig96/perks/jugg/jugg_price_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_on.vmt b/materials/models/alig96/perks/jugg/jugg_price_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_price_on.vmt rename to materials/models/alig96/perks/jugg/jugg_price_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vmt b/materials/models/alig96/perks/jugg/jugg_snn.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vmt rename to materials/models/alig96/perks/jugg/jugg_snn.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vtf b/materials/models/alig96/perks/jugg/jugg_snn.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn.vtf rename to materials/models/alig96/perks/jugg/jugg_snn.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf b/materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf rename to materials/models/alig96/perks/jugg/jugg_snn_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_off.vmt b/materials/models/alig96/perks/jugg/jugg_snn_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_off.vmt rename to materials/models/alig96/perks/jugg/jugg_snn_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_on.vmt b/materials/models/alig96/perks/jugg/jugg_snn_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_on.vmt rename to materials/models/alig96/perks/jugg/jugg_snn_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_phong.vtf b/materials/models/alig96/perks/jugg/jugg_snn_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/jugg_snn_phong.vtf rename to materials/models/alig96/perks/jugg/jugg_snn_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vmt b/materials/models/alig96/perks/jugg/power_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/power_off.vmt rename to materials/models/alig96/perks/jugg/power_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_off.vtf b/materials/models/alig96/perks/jugg/power_off.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/power_off.vtf rename to materials/models/alig96/perks/jugg/power_off.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vmt b/materials/models/alig96/perks/jugg/power_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/power_on.vmt rename to materials/models/alig96/perks/jugg/power_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/power_on.vtf b/materials/models/alig96/perks/jugg/power_on.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/power_on.vtf rename to materials/models/alig96/perks/jugg/power_on.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/jugg/white.vtf b/materials/models/alig96/perks/jugg/white.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/jugg/white.vtf rename to materials/models/alig96/perks/jugg/white.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt b/materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt rename to materials/models/alig96/perks/packapunch/pack_a_punch_c.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vtf b/materials/models/alig96/perks/packapunch/pack_a_punch_c.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_c.vtf rename to 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/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vmt rename to materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vtf b/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vtf rename to materials/models/alig96/perks/packapunch/pack_a_punch_moving_c.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_n.vtf b/materials/models/alig96/perks/packapunch/pack_a_punch_moving_n.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_moving_n.vtf rename to materials/models/alig96/perks/packapunch/pack_a_punch_moving_n.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_n.vtf b/materials/models/alig96/perks/packapunch/pack_a_punch_n.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/packapunch/pack_a_punch_n.vtf rename to materials/models/alig96/perks/packapunch/pack_a_punch_n.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/readme.txt b/materials/models/alig96/perks/readme.txt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/readme.txt rename to materials/models/alig96/perks/readme.txt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_off.vmt b/materials/models/alig96/perks/revive/power_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/power_off.vmt rename to materials/models/alig96/perks/revive/power_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_off.vtf b/materials/models/alig96/perks/revive/power_off.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/power_off.vtf rename to materials/models/alig96/perks/revive/power_off.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_on.vmt b/materials/models/alig96/perks/revive/power_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/power_on.vmt rename to materials/models/alig96/perks/revive/power_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/power_on.vtf b/materials/models/alig96/perks/revive/power_on.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/power_on.vtf rename to materials/models/alig96/perks/revive/power_on.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive.vmt b/materials/models/alig96/perks/revive/revive.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive.vmt rename to materials/models/alig96/perks/revive/revive.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive.vtf b/materials/models/alig96/perks/revive/revive.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive.vtf rename to materials/models/alig96/perks/revive/revive.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_nrm.vtf b/materials/models/alig96/perks/revive/revive_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_nrm.vtf rename to materials/models/alig96/perks/revive/revive_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_phong.vtf b/materials/models/alig96/perks/revive/revive_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_phong.vtf rename to materials/models/alig96/perks/revive/revive_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vmt b/materials/models/alig96/perks/revive/revive_price.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_price.vmt rename to materials/models/alig96/perks/revive/revive_price.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_price.vtf b/materials/models/alig96/perks/revive/revive_price.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_price.vtf rename to materials/models/alig96/perks/revive/revive_price.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vmt b/materials/models/alig96/perks/revive/revive_snn.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vmt rename to materials/models/alig96/perks/revive/revive_snn.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vtf b/materials/models/alig96/perks/revive/revive_snn.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_snn.vtf rename to materials/models/alig96/perks/revive/revive_snn.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_nrm.vtf b/materials/models/alig96/perks/revive/revive_snn_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_snn_nrm.vtf rename to materials/models/alig96/perks/revive/revive_snn_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revive_snn_phong.vtf b/materials/models/alig96/perks/revive/revive_snn_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revive_snn_phong.vtf rename to materials/models/alig96/perks/revive/revive_snn_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign.vmt b/materials/models/alig96/perks/revive/revivesign.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revivesign.vmt rename to materials/models/alig96/perks/revive/revivesign.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign.vtf b/materials/models/alig96/perks/revive/revivesign.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revivesign.vtf rename to materials/models/alig96/perks/revive/revivesign.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_nrm.vtf b/materials/models/alig96/perks/revive/revivesign_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revivesign_nrm.vtf rename to materials/models/alig96/perks/revive/revivesign_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_off.vmt b/materials/models/alig96/perks/revive/revivesign_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revivesign_off.vmt rename to materials/models/alig96/perks/revive/revivesign_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_on.vmt b/materials/models/alig96/perks/revive/revivesign_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revivesign_on.vmt rename to materials/models/alig96/perks/revive/revivesign_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/revive/revivesign_phong.vtf b/materials/models/alig96/perks/revive/revivesign_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/revivesign_phong.vtf rename to materials/models/alig96/perks/revive/revivesign_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/revive/white.vtf b/materials/models/alig96/perks/revive/white.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/revive/white.vtf rename to materials/models/alig96/perks/revive/white.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vmt b/materials/models/alig96/perks/sleight/perk_bottle_drips.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vmt rename to materials/models/alig96/perks/sleight/perk_bottle_drips.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vtf b/materials/models/alig96/perks/sleight/perk_bottle_drips.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_drips.vtf rename to materials/models/alig96/perks/sleight/perk_bottle_drips.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_nrm.vtf b/materials/models/alig96/perks/sleight/perk_bottle_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_nrm.vtf rename to materials/models/alig96/perks/sleight/perk_bottle_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt b/materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt rename to materials/models/alig96/perks/sleight/perk_bottle_sleight.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf b/materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf rename to materials/models/alig96/perks/sleight/perk_bottle_sleight.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vmt b/materials/models/alig96/perks/sleight/power_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/power_off.vmt rename to materials/models/alig96/perks/sleight/power_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_off.vtf b/materials/models/alig96/perks/sleight/power_off.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/power_off.vtf rename to materials/models/alig96/perks/sleight/power_off.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vmt b/materials/models/alig96/perks/sleight/power_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/power_on.vmt rename to materials/models/alig96/perks/sleight/power_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/power_on.vtf b/materials/models/alig96/perks/sleight/power_on.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/power_on.vtf rename to materials/models/alig96/perks/sleight/power_on.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight.vmt b/materials/models/alig96/perks/sleight/sleight.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight.vmt rename to materials/models/alig96/perks/sleight/sleight.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight.vtf b/materials/models/alig96/perks/sleight/sleight.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight.vtf rename to materials/models/alig96/perks/sleight/sleight.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_nrm.vtf b/materials/models/alig96/perks/sleight/sleight_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_nrm.vtf rename to materials/models/alig96/perks/sleight/sleight_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_off.vmt b/materials/models/alig96/perks/sleight/sleight_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_off.vmt rename to materials/models/alig96/perks/sleight/sleight_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_on.vmt b/materials/models/alig96/perks/sleight/sleight_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_on.vmt rename to materials/models/alig96/perks/sleight/sleight_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_phong.vtf b/materials/models/alig96/perks/sleight/sleight_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_phong.vtf rename to materials/models/alig96/perks/sleight/sleight_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vmt b/materials/models/alig96/perks/sleight/sleight_price.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vmt rename to materials/models/alig96/perks/sleight/sleight_price.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vtf b/materials/models/alig96/perks/sleight/sleight_price.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_price.vtf rename to materials/models/alig96/perks/sleight/sleight_price.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vmt b/materials/models/alig96/perks/sleight/sleight_snn.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vmt rename to materials/models/alig96/perks/sleight/sleight_snn.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vtf b/materials/models/alig96/perks/sleight/sleight_snn.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn.vtf rename to materials/models/alig96/perks/sleight/sleight_snn.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf b/materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf rename to materials/models/alig96/perks/sleight/sleight_snn_nrm.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_off.vmt b/materials/models/alig96/perks/sleight/sleight_snn_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_off.vmt rename to materials/models/alig96/perks/sleight/sleight_snn_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_on.vmt b/materials/models/alig96/perks/sleight/sleight_snn_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_on.vmt rename to materials/models/alig96/perks/sleight/sleight_snn_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_phong.vtf b/materials/models/alig96/perks/sleight/sleight_snn_phong.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_snn_phong.vtf rename to materials/models/alig96/perks/sleight/sleight_snn_phong.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vmt b/materials/models/alig96/perks/sleight/sleight_window.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vmt rename to materials/models/alig96/perks/sleight/sleight_window.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vtf b/materials/models/alig96/perks/sleight/sleight_window.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleight_window.vtf rename to materials/models/alig96/perks/sleight/sleight_window.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vmt b/materials/models/alig96/perks/sleight/sleightsign.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vmt rename to materials/models/alig96/perks/sleight/sleightsign.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vtf b/materials/models/alig96/perks/sleight/sleightsign.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleightsign.vtf rename to materials/models/alig96/perks/sleight/sleightsign.vtf diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_off.vmt b/materials/models/alig96/perks/sleight/sleightsign_off.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_off.vmt rename to materials/models/alig96/perks/sleight/sleightsign_off.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_on.vmt b/materials/models/alig96/perks/sleight/sleightsign_on.vmt similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/sleightsign_on.vmt rename to materials/models/alig96/perks/sleight/sleightsign_on.vmt diff --git a/nzombies3/content/materials/models/alig96/perks/sleight/white.vtf b/materials/models/alig96/perks/sleight/white.vtf similarity index 100% rename from nzombies3/content/materials/models/alig96/perks/sleight/white.vtf rename to materials/models/alig96/perks/sleight/white.vtf diff --git a/materials/models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0.vmt b/materials/models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0.vmt new file mode 100644 index 00000000..ef2b2f01 --- /dev/null +++ b/materials/models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0" + "$bumpmap" "models/barbwire/p6_zm_tm_barbed_wire_poles_n" + "$alphatest" "1" + "$nocull" "1" +} diff --git a/materials/models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0.vtf b/materials/models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0.vtf new file mode 100644 index 00000000..ca2e5ba8 Binary files /dev/null and b/materials/models/barbwire/_-gp6_zm_tm_barbed_wire_poles_c#0.vtf differ diff --git a/materials/models/barbwire/p6_zm_tm_barbed_wire_poles_n.vtf b/materials/models/barbwire/p6_zm_tm_barbed_wire_poles_n.vtf new file mode 100644 index 00000000..c55a9c6e Binary files /dev/null and b/materials/models/barbwire/p6_zm_tm_barbed_wire_poles_n.vtf differ diff --git a/materials/models/cherry/cherry_colour.vmt b/materials/models/cherry/cherry_colour.vmt new file mode 100644 index 00000000..9f909523 --- /dev/null +++ b/materials/models/cherry/cherry_colour.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/cherry/cherry_colour" + "$bumpmap" "models/cherry/cherry_normal" + "$selfillum" "1" +} diff --git a/materials/models/cherry/cherry_colour.vtf b/materials/models/cherry/cherry_colour.vtf new file mode 100644 index 00000000..22ff8761 Binary files /dev/null and b/materials/models/cherry/cherry_colour.vtf differ diff --git a/materials/models/cherry/cherry_colour_off.vmt b/materials/models/cherry/cherry_colour_off.vmt new file mode 100644 index 00000000..d099c785 --- /dev/null +++ b/materials/models/cherry/cherry_colour_off.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/cherry/cherry_colour" + "$bumpmap" "models/cherry/cherry_normal" +} diff --git a/materials/models/cherry/cherry_glass.vmt b/materials/models/cherry/cherry_glass.vmt new file mode 100644 index 00000000..638dbb31 --- /dev/null +++ b/materials/models/cherry/cherry_glass.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/cherry/cherry_glass" + "$translucent" 1 +} diff --git a/materials/models/cherry/cherry_glass.vtf b/materials/models/cherry/cherry_glass.vtf new file mode 100644 index 00000000..ff80af3d Binary files /dev/null and b/materials/models/cherry/cherry_glass.vtf differ diff --git a/materials/models/cherry/cherry_normal.vtf b/materials/models/cherry/cherry_normal.vtf new file mode 100644 index 00000000..21dee65f Binary files /dev/null and b/materials/models/cherry/cherry_normal.vtf differ diff --git a/materials/models/chugabud/chugabud_colour.vmt b/materials/models/chugabud/chugabud_colour.vmt new file mode 100644 index 00000000..01430066 --- /dev/null +++ b/materials/models/chugabud/chugabud_colour.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/chugabud/chugabud_colour" + "$bumpmap" "models/chugabud/chugabud_normal" + "$selfillum" "1" +} diff --git a/materials/models/chugabud/chugabud_colour.vtf b/materials/models/chugabud/chugabud_colour.vtf new file mode 100644 index 00000000..dacb7733 Binary files /dev/null and b/materials/models/chugabud/chugabud_colour.vtf differ diff --git a/materials/models/chugabud/chugabud_colour_off.vmt b/materials/models/chugabud/chugabud_colour_off.vmt new file mode 100644 index 00000000..735c54b2 --- /dev/null +++ b/materials/models/chugabud/chugabud_colour_off.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/chugabud/chugabud_colour" + "$bumpmap" "models/chugabud/chugabud_normal" +} diff --git a/materials/models/chugabud/chugabud_glass.vmt b/materials/models/chugabud/chugabud_glass.vmt new file mode 100644 index 00000000..dbcfc908 --- /dev/null +++ b/materials/models/chugabud/chugabud_glass.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/chugabud/chugabud_glass" + "$translucent" 1 +} diff --git a/materials/models/chugabud/chugabud_glass.vtf b/materials/models/chugabud/chugabud_glass.vtf new file mode 100644 index 00000000..bc2e46e5 Binary files /dev/null and b/materials/models/chugabud/chugabud_glass.vtf differ diff --git a/materials/models/chugabud/chugabud_normal.vtf b/materials/models/chugabud/chugabud_normal.vtf new file mode 100644 index 00000000..45599092 Binary files /dev/null and b/materials/models/chugabud/chugabud_normal.vtf differ diff --git a/materials/models/deadshot/zombie_vending_ads_c.vmt b/materials/models/deadshot/zombie_vending_ads_c.vmt new file mode 100644 index 00000000..a2fee521 --- /dev/null +++ b/materials/models/deadshot/zombie_vending_ads_c.vmt @@ -0,0 +1,19 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/deadshot/zombie_vending_ads_c" + "$bumpmap" "models/deadshot/zombie_vending_ads_normal" + "$selfillum" "1" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/deadshot/zombie_vending_ads_c.vtf b/materials/models/deadshot/zombie_vending_ads_c.vtf new file mode 100644 index 00000000..6ae4565f Binary files /dev/null and b/materials/models/deadshot/zombie_vending_ads_c.vtf differ diff --git a/materials/models/deadshot/zombie_vending_ads_c_off.vmt b/materials/models/deadshot/zombie_vending_ads_c_off.vmt new file mode 100644 index 00000000..8c55cab2 --- /dev/null +++ b/materials/models/deadshot/zombie_vending_ads_c_off.vmt @@ -0,0 +1,18 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/deadshot/zombie_vending_ads_c" + "$bumpmap" "models/deadshot/zombie_vending_ads_normal" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/deadshot/zombie_vending_ads_glass.vmt b/materials/models/deadshot/zombie_vending_ads_glass.vmt new file mode 100644 index 00000000..f4d584d8 --- /dev/null +++ b/materials/models/deadshot/zombie_vending_ads_glass.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/deadshot/zombie_vending_ads_glass" + "$translucent" 1 +} diff --git a/materials/models/deadshot/zombie_vending_ads_glass.vtf b/materials/models/deadshot/zombie_vending_ads_glass.vtf new file mode 100644 index 00000000..653a2b1b Binary files /dev/null and b/materials/models/deadshot/zombie_vending_ads_glass.vtf differ diff --git a/materials/models/deadshot/zombie_vending_ads_logo_c.vmt b/materials/models/deadshot/zombie_vending_ads_logo_c.vmt new file mode 100644 index 00000000..8b579aa9 --- /dev/null +++ b/materials/models/deadshot/zombie_vending_ads_logo_c.vmt @@ -0,0 +1,19 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/deadshot/zombie_vending_ads_logo_c" + "$bumpmap" "models/deadshot/zombie_vending_ads_logo_normal" + "$selfillum" "1" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/deadshot/zombie_vending_ads_logo_c.vtf b/materials/models/deadshot/zombie_vending_ads_logo_c.vtf new file mode 100644 index 00000000..2f0913be Binary files /dev/null and b/materials/models/deadshot/zombie_vending_ads_logo_c.vtf differ diff --git a/materials/models/deadshot/zombie_vending_ads_logo_c_off.vmt b/materials/models/deadshot/zombie_vending_ads_logo_c_off.vmt new file mode 100644 index 00000000..7d577beb --- /dev/null +++ b/materials/models/deadshot/zombie_vending_ads_logo_c_off.vmt @@ -0,0 +1,18 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/deadshot/zombie_vending_ads_logo_c" + "$bumpmap" "models/deadshot/zombie_vending_ads_logo_normal" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/deadshot/zombie_vending_ads_logo_normal.vtf b/materials/models/deadshot/zombie_vending_ads_logo_normal.vtf new file mode 100644 index 00000000..2fdea515 Binary files /dev/null and b/materials/models/deadshot/zombie_vending_ads_logo_normal.vtf differ diff --git a/materials/models/deadshot/zombie_vending_ads_normal.vtf b/materials/models/deadshot/zombie_vending_ads_normal.vtf new file mode 100644 index 00000000..ae28d93b Binary files /dev/null and b/materials/models/deadshot/zombie_vending_ads_normal.vtf differ diff --git a/materials/models/doubletap2/doubletap2_colour.vmt b/materials/models/doubletap2/doubletap2_colour.vmt new file mode 100644 index 00000000..72f6daeb --- /dev/null +++ b/materials/models/doubletap2/doubletap2_colour.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/doubletap2/doubletap2_colour" + "$bumpmap" "models/doubletap2/doubletap2_normal" + "$selfillum" "1" +} diff --git a/materials/models/doubletap2/doubletap2_colour.vtf b/materials/models/doubletap2/doubletap2_colour.vtf new file mode 100644 index 00000000..21d6a2ba Binary files /dev/null and b/materials/models/doubletap2/doubletap2_colour.vtf differ diff --git a/materials/models/doubletap2/doubletap2_colour_off.vmt b/materials/models/doubletap2/doubletap2_colour_off.vmt new file mode 100644 index 00000000..9c488e7c --- /dev/null +++ b/materials/models/doubletap2/doubletap2_colour_off.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/doubletap2/doubletap2_colour" + "$bumpmap" "models/doubletap2/doubletap2_normal" +} diff --git a/materials/models/doubletap2/doubletap2_normal.vtf b/materials/models/doubletap2/doubletap2_normal.vtf new file mode 100644 index 00000000..f14baddc Binary files /dev/null and b/materials/models/doubletap2/doubletap2_normal.vtf differ diff --git a/materials/models/doubletap2/doubletap2_vent.vmt b/materials/models/doubletap2/doubletap2_vent.vmt new file mode 100644 index 00000000..f019a88f --- /dev/null +++ b/materials/models/doubletap2/doubletap2_vent.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/doubletap2/doubletap2_vent" + "$selfillum" "1" +} diff --git a/materials/models/doubletap2/doubletap2_vent.vtf b/materials/models/doubletap2/doubletap2_vent.vtf new file mode 100644 index 00000000..ae8d4f6f Binary files /dev/null and b/materials/models/doubletap2/doubletap2_vent.vtf differ diff --git a/materials/models/doubletap2/doubletap2_vent_off.vmt b/materials/models/doubletap2/doubletap2_vent_off.vmt new file mode 100644 index 00000000..0bccf16c --- /dev/null +++ b/materials/models/doubletap2/doubletap2_vent_off.vmt @@ -0,0 +1,4 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/doubletap2/doubletap2_vent" +} diff --git a/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt b/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt similarity index 100% rename from nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt rename to materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vmt diff --git a/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vtf b/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vtf similarity index 100% rename from nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_box_c.vtf rename to 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/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vmt similarity index 100% rename from nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vmt rename to materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vmt diff --git a/nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vtf b/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vtf similarity index 100% rename from nzombies3/content/materials/models/hoff/props/mysterybox/zombie_treasure_fill_c.vtf rename to 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/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vmt similarity index 100% rename from nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vmt rename to materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vmt diff --git a/nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf b/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf similarity index 100% rename from nzombies3/content/materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf rename to materials/models/hoff/props/teddy_bear/zombie_teddybear_c.vtf diff --git a/materials/models/mulekick/__-gzombie_vending_three_gun__c3f3de96.vmt b/materials/models/mulekick/__-gzombie_vending_three_gun__c3f3de96.vmt new file mode 100644 index 00000000..a773ee2f --- /dev/null +++ b/materials/models/mulekick/__-gzombie_vending_three_gun__c3f3de96.vmt @@ -0,0 +1,18 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/mulekick/__-gzombie_vending_three_gun__c3f3de96" + "$bumpmap" "models/mulekick/zombie_vending_three_gun_normal" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/mulekick/__-gzombie_vending_three_gun__c3f3de96.vtf b/materials/models/mulekick/__-gzombie_vending_three_gun__c3f3de96.vtf new file mode 100644 index 00000000..306d73c8 Binary files /dev/null and b/materials/models/mulekick/__-gzombie_vending_three_gun__c3f3de96.vtf differ diff --git a/materials/models/mulekick/zombie_vending_three_gun_glass.vmt b/materials/models/mulekick/zombie_vending_three_gun_glass.vmt new file mode 100644 index 00000000..f548b0b7 --- /dev/null +++ b/materials/models/mulekick/zombie_vending_three_gun_glass.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/mulekick/zombie_vending_three_gun_glass" + "$translucent" 1 +} diff --git a/materials/models/mulekick/zombie_vending_three_gun_glass.vtf b/materials/models/mulekick/zombie_vending_three_gun_glass.vtf new file mode 100644 index 00000000..653a2b1b Binary files /dev/null and b/materials/models/mulekick/zombie_vending_three_gun_glass.vtf differ diff --git a/materials/models/mulekick/zombie_vending_three_gun_logo_c.vmt b/materials/models/mulekick/zombie_vending_three_gun_logo_c.vmt new file mode 100644 index 00000000..40289cb4 --- /dev/null +++ b/materials/models/mulekick/zombie_vending_three_gun_logo_c.vmt @@ -0,0 +1,19 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/mulekick/zombie_vending_three_gun_logo_c" + "$bumpmap" "models/mulekick/zombie_vending_three_gun_logo_normal" + "$selfillum" "1" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/mulekick/zombie_vending_three_gun_logo_c.vtf b/materials/models/mulekick/zombie_vending_three_gun_logo_c.vtf new file mode 100644 index 00000000..9cb4ad24 Binary files /dev/null and b/materials/models/mulekick/zombie_vending_three_gun_logo_c.vtf differ diff --git a/materials/models/mulekick/zombie_vending_three_gun_logo_c_off.vmt b/materials/models/mulekick/zombie_vending_three_gun_logo_c_off.vmt new file mode 100644 index 00000000..f545acd9 --- /dev/null +++ b/materials/models/mulekick/zombie_vending_three_gun_logo_c_off.vmt @@ -0,0 +1,18 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/mulekick/zombie_vending_three_gun_logo_c" + "$bumpmap" "models/mulekick/zombie_vending_three_gun_logo_normal" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/mulekick/zombie_vending_three_gun_logo_normal.vtf b/materials/models/mulekick/zombie_vending_three_gun_logo_normal.vtf new file mode 100644 index 00000000..f1cc6d53 Binary files /dev/null and b/materials/models/mulekick/zombie_vending_three_gun_logo_normal.vtf differ diff --git a/materials/models/mulekick/zombie_vending_three_gun_normal.vtf b/materials/models/mulekick/zombie_vending_three_gun_normal.vtf new file mode 100644 index 00000000..853bacf2 Binary files /dev/null and b/materials/models/mulekick/zombie_vending_three_gun_normal.vtf differ diff --git a/materials/models/nz_zombie/_-gc_zom_german_soldier_upper1_c.vmt b/materials/models/nz_zombie/_-gc_zom_german_soldier_upper1_c.vmt new file mode 100644 index 00000000..1b5dbc19 --- /dev/null +++ b/materials/models/nz_zombie/_-gc_zom_german_soldier_upper1_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/_-gc_zom_german_soldier_upper1_c" + "$bumpmap" "models/nz_zombie/c_zom_german_soldier_upper1_n" +} \ No newline at end of file diff --git a/materials/models/nz_zombie/_-gc_zom_german_soldier_upper1_c.vtf b/materials/models/nz_zombie/_-gc_zom_german_soldier_upper1_c.vtf new file mode 100644 index 00000000..bf1940c9 Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_german_soldier_upper1_c.vtf differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_alpha_c.vmt b/materials/models/nz_zombie/_-gc_zom_mech_alpha_c.vmt new file mode 100644 index 00000000..3d74c5be --- /dev/null +++ b/materials/models/nz_zombie/_-gc_zom_mech_alpha_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/_-gc_zom_mech_alpha_c" + "$bumpmap" "models/nz_zombie/c_zom_mech_alpha_n" + "$translucent" "1" +} \ No newline at end of file diff --git a/materials/models/nz_zombie/_-gc_zom_mech_alpha_c.vtf b/materials/models/nz_zombie/_-gc_zom_mech_alpha_c.vtf new file mode 100644 index 00000000..dcbafcd8 Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_alpha_c.vtf differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_body1_c.tga b/materials/models/nz_zombie/_-gc_zom_mech_body1_c.tga new file mode 100644 index 00000000..0d588a01 Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_body1_c.tga differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_body1_c.vmt b/materials/models/nz_zombie/_-gc_zom_mech_body1_c.vmt new file mode 100644 index 00000000..700bdc16 --- /dev/null +++ b/materials/models/nz_zombie/_-gc_zom_mech_body1_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/_-gc_zom_mech_body1_c" + "$bumpmap" "models/nz_zombie/c_zom_mech_body1_n" +} \ No newline at end of file diff --git a/materials/models/nz_zombie/_-gc_zom_mech_body1_c.vtf b/materials/models/nz_zombie/_-gc_zom_mech_body1_c.vtf new file mode 100644 index 00000000..c0854c4d Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_body1_c.vtf differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_body2_c.tga b/materials/models/nz_zombie/_-gc_zom_mech_body2_c.tga new file mode 100644 index 00000000..798bae6a Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_body2_c.tga differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_body2_c.vmt b/materials/models/nz_zombie/_-gc_zom_mech_body2_c.vmt new file mode 100644 index 00000000..514e1afa --- /dev/null +++ b/materials/models/nz_zombie/_-gc_zom_mech_body2_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/_-gc_zom_mech_body2_c" + "$bumpmap" "models/nz_zombie/c_zom_mech_body2_n" +} \ No newline at end of file diff --git a/materials/models/nz_zombie/_-gc_zom_mech_body2_c.vtf b/materials/models/nz_zombie/_-gc_zom_mech_body2_c.vtf new file mode 100644 index 00000000..57c9fd0d Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_body2_c.vtf differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_head_c.vmt b/materials/models/nz_zombie/_-gc_zom_mech_head_c.vmt new file mode 100644 index 00000000..43f05672 --- /dev/null +++ b/materials/models/nz_zombie/_-gc_zom_mech_head_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/_-gc_zom_mech_head_c" + "$bumpmap" "models/nz_zombie/c_zom_mech_head_n" +} \ No newline at end of file diff --git a/materials/models/nz_zombie/_-gc_zom_mech_head_c.vtf b/materials/models/nz_zombie/_-gc_zom_mech_head_c.vtf new file mode 100644 index 00000000..27148f9a Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_head_c.vtf differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.tga b/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.tga new file mode 100644 index 00000000..17fa84c4 Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.tga differ diff --git a/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.vmt b/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.vmt new file mode 100644 index 00000000..847a9543 --- /dev/null +++ b/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/_-gc_zom_mech_headgear_c" + "$bumpmap" "models/nz_zombie/c_zom_mech_headgear_n" +} \ No newline at end of file diff --git a/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.vtf b/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.vtf new file mode 100644 index 00000000..dd683d0d Binary files /dev/null and b/materials/models/nz_zombie/_-gc_zom_mech_headgear_c.vtf differ diff --git a/materials/models/nz_zombie/c_zom_german_soldier_upper1_n.vtf b/materials/models/nz_zombie/c_zom_german_soldier_upper1_n.vtf new file mode 100644 index 00000000..6725a64f Binary files /dev/null and b/materials/models/nz_zombie/c_zom_german_soldier_upper1_n.vtf differ diff --git a/materials/models/nz_zombie/c_zom_mech_alpha_n.vtf b/materials/models/nz_zombie/c_zom_mech_alpha_n.vtf new file mode 100644 index 00000000..c6974f44 Binary files /dev/null and b/materials/models/nz_zombie/c_zom_mech_alpha_n.vtf differ diff --git a/materials/models/nz_zombie/c_zom_mech_body1_n.vtf b/materials/models/nz_zombie/c_zom_mech_body1_n.vtf new file mode 100644 index 00000000..70e85dde Binary files /dev/null and b/materials/models/nz_zombie/c_zom_mech_body1_n.vtf differ diff --git a/materials/models/nz_zombie/c_zom_mech_body2_n.vtf b/materials/models/nz_zombie/c_zom_mech_body2_n.vtf new file mode 100644 index 00000000..15c9adf8 Binary files /dev/null and b/materials/models/nz_zombie/c_zom_mech_body2_n.vtf differ diff --git a/materials/models/nz_zombie/c_zom_mech_head_n.vtf b/materials/models/nz_zombie/c_zom_mech_head_n.vtf new file mode 100644 index 00000000..3e693cc3 Binary files /dev/null and b/materials/models/nz_zombie/c_zom_mech_head_n.vtf differ diff --git a/materials/models/nz_zombie/c_zom_mech_headgear_n.vtf b/materials/models/nz_zombie/c_zom_mech_headgear_n.vtf new file mode 100644 index 00000000..1f27b934 Binary files /dev/null and b/materials/models/nz_zombie/c_zom_mech_headgear_n.vtf differ diff --git a/materials/models/nz_zombie/char_gen_gib_decals.vmt b/materials/models/nz_zombie/char_gen_gib_decals.vmt new file mode 100644 index 00000000..2b349ec6 --- /dev/null +++ b/materials/models/nz_zombie/char_gen_gib_decals.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_gen_gib_decals" + "$bumpmap" "models/nz_zombie/char_gen_gib_decals_n_bump" + "$model" 1 + "$translucent" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_gen_gib_decals.vtf b/materials/models/nz_zombie/char_gen_gib_decals.vtf new file mode 100644 index 00000000..7963daf7 Binary files /dev/null and b/materials/models/nz_zombie/char_gen_gib_decals.vtf differ diff --git a/materials/models/nz_zombie/char_gen_gib_decals_n_bump.vtf b/materials/models/nz_zombie/char_gen_gib_decals_n_bump.vtf new file mode 100644 index 00000000..1546cfc6 Binary files /dev/null and b/materials/models/nz_zombie/char_gen_gib_decals_n_bump.vtf differ diff --git a/materials/models/nz_zombie/char_ger_honorguard_body1_c.vmt b/materials/models/nz_zombie/char_ger_honorguard_body1_c.vmt new file mode 100644 index 00000000..8476b44c --- /dev/null +++ b/materials/models/nz_zombie/char_ger_honorguard_body1_c.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_honorguard_body1_c" + "$bumpmap" "models/nz_zombie/char_ger_honorguard_body1_n" + "$model" 1 + //"$selfillum" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_honorguard_body1_c.vtf b/materials/models/nz_zombie/char_ger_honorguard_body1_c.vtf new file mode 100644 index 00000000..59871f7f Binary files /dev/null and b/materials/models/nz_zombie/char_ger_honorguard_body1_c.vtf differ diff --git a/materials/models/nz_zombie/char_ger_honorguard_body1_n.vtf b/materials/models/nz_zombie/char_ger_honorguard_body1_n.vtf new file mode 100644 index 00000000..2228bda4 Binary files /dev/null and b/materials/models/nz_zombie/char_ger_honorguard_body1_n.vtf differ diff --git a/materials/models/nz_zombie/char_ger_honorguard_body1_n_bump.vtf b/materials/models/nz_zombie/char_ger_honorguard_body1_n_bump.vtf new file mode 100644 index 00000000..55bac0c2 Binary files /dev/null and b/materials/models/nz_zombie/char_ger_honorguard_body1_n_bump.vtf differ diff --git a/materials/models/nz_zombie/char_ger_honorguard_body2_c.vmt b/materials/models/nz_zombie/char_ger_honorguard_body2_c.vmt new file mode 100644 index 00000000..8ff8e726 --- /dev/null +++ b/materials/models/nz_zombie/char_ger_honorguard_body2_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_honorguard_body2_c" + "$bumpmap" "models/nz_zombie/char_ger_honorguard_body1_n" + "$model" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_honorguard_body2_c.vtf b/materials/models/nz_zombie/char_ger_honorguard_body2_c.vtf new file mode 100644 index 00000000..3f48226e Binary files /dev/null and b/materials/models/nz_zombie/char_ger_honorguard_body2_c.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head1_c.vmt b/materials/models/nz_zombie/char_ger_zombie_head1_c.vmt new file mode 100644 index 00000000..0ebae94b --- /dev/null +++ b/materials/models/nz_zombie/char_ger_zombie_head1_c.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_zombie_head1_c" + "$bumpmap" "models/nz_zombie/char_ger_zombie_head1_n" + "$model" 1 + //"$selfillum" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_zombie_head1_c.vtf b/materials/models/nz_zombie/char_ger_zombie_head1_c.vtf new file mode 100644 index 00000000..248dbf33 Binary files /dev/null and b/materials/models/nz_zombie/char_ger_zombie_head1_c.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head1_n.vtf b/materials/models/nz_zombie/char_ger_zombie_head1_n.vtf new file mode 100644 index 00000000..18476ad4 Binary files /dev/null and b/materials/models/nz_zombie/char_ger_zombie_head1_n.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head1_n_bump.vtf b/materials/models/nz_zombie/char_ger_zombie_head1_n_bump.vtf new file mode 100644 index 00000000..5b933fdb Binary files /dev/null and b/materials/models/nz_zombie/char_ger_zombie_head1_n_bump.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head2_c.vmt b/materials/models/nz_zombie/char_ger_zombie_head2_c.vmt new file mode 100644 index 00000000..8bc19cbc --- /dev/null +++ b/materials/models/nz_zombie/char_ger_zombie_head2_c.vmt @@ -0,0 +1,8 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_zombie_head2_c" + "$bumpmap" "models/nz_zombie/char_ger_zombie_head1_n" + "$model" 1 + //"$selfillum" 1 + +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_zombie_head2_c.vtf b/materials/models/nz_zombie/char_ger_zombie_head2_c.vtf new file mode 100644 index 00000000..de29877f Binary files /dev/null and b/materials/models/nz_zombie/char_ger_zombie_head2_c.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head3_c.vmt b/materials/models/nz_zombie/char_ger_zombie_head3_c.vmt new file mode 100644 index 00000000..159806fe --- /dev/null +++ b/materials/models/nz_zombie/char_ger_zombie_head3_c.vmt @@ -0,0 +1,8 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_zombie_head3_c" + "$bumpmap" "models/nz_zombie/char_ger_zombie_head1_n" + "$model" 1 + //"$selfillum" 1 + +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_zombie_head3_c.vtf b/materials/models/nz_zombie/char_ger_zombie_head3_c.vtf new file mode 100644 index 00000000..d88e7b42 Binary files /dev/null and b/materials/models/nz_zombie/char_ger_zombie_head3_c.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head4_c.vmt b/materials/models/nz_zombie/char_ger_zombie_head4_c.vmt new file mode 100644 index 00000000..c663ed22 --- /dev/null +++ b/materials/models/nz_zombie/char_ger_zombie_head4_c.vmt @@ -0,0 +1,8 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_zombie_head4_c" + "$bumpmap" "models/nz_zombie/char_ger_zombie_head1_n" + "$model" 1 + //"$selfillum" 1 + +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_zombie_head4_c.vtf b/materials/models/nz_zombie/char_ger_zombie_head4_c.vtf new file mode 100644 index 00000000..c9da3151 Binary files /dev/null and b/materials/models/nz_zombie/char_ger_zombie_head4_c.vtf differ diff --git a/materials/models/nz_zombie/char_ger_zombie_head5_c.vmt b/materials/models/nz_zombie/char_ger_zombie_head5_c.vmt new file mode 100644 index 00000000..df2d44fb --- /dev/null +++ b/materials/models/nz_zombie/char_ger_zombie_head5_c.vmt @@ -0,0 +1,8 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_zombie_head1_c" + "$bumpmap" "models/nz_zombie/char_ger_zombie_head1_n" + "$model" 1 + //"$selfillum" 1 + +} \ No newline at end of file diff --git a/materials/models/nz_zombie/char_ger_zombie_head6_c.vmt b/materials/models/nz_zombie/char_ger_zombie_head6_c.vmt new file mode 100644 index 00000000..98a1fa21 --- /dev/null +++ b/materials/models/nz_zombie/char_ger_zombie_head6_c.vmt @@ -0,0 +1,8 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/char_ger_zombie_head3_c" + "$bumpmap" "models/nz_zombie/char_ger_zombie_head1_n" + "$model" 1 + //"$selfillum" 1 + +} \ No newline at end of file diff --git a/materials/models/nz_zombie/limbs_c.vmt b/materials/models/nz_zombie/limbs_c.vmt new file mode 100644 index 00000000..0c398ea8 --- /dev/null +++ b/materials/models/nz_zombie/limbs_c.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/limbs_c" + "$bumpmap" "models/nz_zombie/limbs_n_bump" + "$model" 1 + "$translucent" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/limbs_c.vtf b/materials/models/nz_zombie/limbs_c.vtf new file mode 100644 index 00000000..b50994df Binary files /dev/null and b/materials/models/nz_zombie/limbs_c.vtf differ diff --git a/materials/models/nz_zombie/limbs_n_bump.vmt b/materials/models/nz_zombie/limbs_n_bump.vmt new file mode 100644 index 00000000..06dee99a --- /dev/null +++ b/materials/models/nz_zombie/limbs_n_bump.vmt @@ -0,0 +1,4 @@ +"LightmappedGeneric" +{ + "$basetexture" "models/nz_zombie/limbs_n_bump" +} diff --git a/materials/models/nz_zombie/limbs_n_bump.vtf b/materials/models/nz_zombie/limbs_n_bump.vtf new file mode 100644 index 00000000..ae907fbc Binary files /dev/null and b/materials/models/nz_zombie/limbs_n_bump.vtf differ diff --git a/materials/models/nz_zombie/zombie_eye.vmt b/materials/models/nz_zombie/zombie_eye.vmt new file mode 100644 index 00000000..64b7f678 --- /dev/null +++ b/materials/models/nz_zombie/zombie_eye.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/zombie_eye" + //"$bumpmap" "models/nzprops/zombies_power_lever_normal" + "$model" 1 + "$selfillum" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/zombie_eye.vtf b/materials/models/nz_zombie/zombie_eye.vtf new file mode 100644 index 00000000..7cda122d Binary files /dev/null and b/materials/models/nz_zombie/zombie_eye.vtf differ diff --git a/materials/models/nz_zombie/zombie_wolf_c.vmt b/materials/models/nz_zombie/zombie_wolf_c.vmt new file mode 100644 index 00000000..90b1c88d --- /dev/null +++ b/materials/models/nz_zombie/zombie_wolf_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/zombie_wolf_c" + "$bumpmap" "models/nz_zombie/zombie_wolf_n_bump" + "$model" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/zombie_wolf_c.vtf b/materials/models/nz_zombie/zombie_wolf_c.vtf new file mode 100644 index 00000000..1cebe3ec Binary files /dev/null and b/materials/models/nz_zombie/zombie_wolf_c.vtf differ diff --git a/materials/models/nz_zombie/zombie_wolf_clean_c.vmt b/materials/models/nz_zombie/zombie_wolf_clean_c.vmt new file mode 100644 index 00000000..33299888 --- /dev/null +++ b/materials/models/nz_zombie/zombie_wolf_clean_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/zombie_wolf_clean_c" + "$bumpmap" "models/nz_zombie/zombie_wolf_clean_n_bump" + "$model" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/zombie_wolf_clean_c.vtf b/materials/models/nz_zombie/zombie_wolf_clean_c.vtf new file mode 100644 index 00000000..dcb3fbf6 Binary files /dev/null and b/materials/models/nz_zombie/zombie_wolf_clean_c.vtf differ diff --git a/materials/models/nz_zombie/zombie_wolf_clean_n_bump.vtf b/materials/models/nz_zombie/zombie_wolf_clean_n_bump.vtf new file mode 100644 index 00000000..d7e46efc Binary files /dev/null and b/materials/models/nz_zombie/zombie_wolf_clean_n_bump.vtf differ diff --git a/materials/models/nz_zombie/zombie_wolf_fur_c.vmt b/materials/models/nz_zombie/zombie_wolf_fur_c.vmt new file mode 100644 index 00000000..63a250dd --- /dev/null +++ b/materials/models/nz_zombie/zombie_wolf_fur_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nz_zombie/zombie_wolf_fur_c" + "$model" 1 + "$translucent" 1 +} \ No newline at end of file diff --git a/materials/models/nz_zombie/zombie_wolf_fur_c.vtf b/materials/models/nz_zombie/zombie_wolf_fur_c.vtf new file mode 100644 index 00000000..7a4c9e2f Binary files /dev/null and b/materials/models/nz_zombie/zombie_wolf_fur_c.vtf differ diff --git a/materials/models/nz_zombie/zombie_wolf_n_bump.vtf b/materials/models/nz_zombie/zombie_wolf_n_bump.vtf new file mode 100644 index 00000000..68b7e3c1 Binary files /dev/null and b/materials/models/nz_zombie/zombie_wolf_n_bump.vtf differ diff --git a/materials/models/nzprops/mtl_zombie_power_lever.vmt b/materials/models/nzprops/mtl_zombie_power_lever.vmt new file mode 100644 index 00000000..c4d44518 --- /dev/null +++ b/materials/models/nzprops/mtl_zombie_power_lever.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nzprops/zombies_power_lever" + //"$bumpmap" "models/nzprops/zombies_power_lever_normal" + "$model" 1 + //"$selfillum" 1 +} \ No newline at end of file diff --git a/materials/models/nzprops/zombie_power_lever_c.vmt b/materials/models/nzprops/zombie_power_lever_c.vmt new file mode 100644 index 00000000..c4d44518 --- /dev/null +++ b/materials/models/nzprops/zombie_power_lever_c.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/nzprops/zombies_power_lever" + //"$bumpmap" "models/nzprops/zombies_power_lever_normal" + "$model" 1 + //"$selfillum" 1 +} \ No newline at end of file diff --git a/materials/models/nzprops/zombies_power_lever.vtf b/materials/models/nzprops/zombies_power_lever.vtf new file mode 100644 index 00000000..901799b9 Binary files /dev/null and b/materials/models/nzprops/zombies_power_lever.vtf differ diff --git a/materials/models/nzprops/zombies_power_lever_normal.vtf b/materials/models/nzprops/zombies_power_lever_normal.vtf new file mode 100644 index 00000000..98d8f7ac Binary files /dev/null and b/materials/models/nzprops/zombies_power_lever_normal.vtf differ diff --git a/materials/models/originscorpse/_-gp6_zm_tm_dead_body_01_c.vtf b/materials/models/originscorpse/_-gp6_zm_tm_dead_body_01_c.vtf new file mode 100644 index 00000000..f4c9656a Binary files /dev/null and b/materials/models/originscorpse/_-gp6_zm_tm_dead_body_01_c.vtf differ diff --git a/materials/models/originscorpse/_-gstatic_peleliu_stick_trap_c.vmt b/materials/models/originscorpse/_-gstatic_peleliu_stick_trap_c.vmt new file mode 100644 index 00000000..82b78000 --- /dev/null +++ b/materials/models/originscorpse/_-gstatic_peleliu_stick_trap_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/originscorpse/_-gstatic_peleliu_stick_trap_c" + "$bumpmap" "models/originscorpse/static_peleliu_stick_trap_n" +} diff --git a/materials/models/originscorpse/_-gstatic_peleliu_stick_trap_c.vtf b/materials/models/originscorpse/_-gstatic_peleliu_stick_trap_c.vtf new file mode 100644 index 00000000..2d478846 Binary files /dev/null and b/materials/models/originscorpse/_-gstatic_peleliu_stick_trap_c.vtf differ diff --git a/materials/models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b.vmt b/materials/models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b.vmt new file mode 100644 index 00000000..0e8a76df --- /dev/null +++ b/materials/models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b" + "$bumpmap" "models/originscorpse/p6_zm_tm_dead_body_01_n" + "$translucent" "0" +} diff --git a/materials/models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b.vtf b/materials/models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b.vtf new file mode 100644 index 00000000..0ad3a597 Binary files /dev/null and b/materials/models/originscorpse/__-gp6_zm_tm_dead_body_01_c-r_afcbca1b.vtf differ diff --git a/materials/models/originscorpse/p6_zm_tm_dead_body_01_n.vtf b/materials/models/originscorpse/p6_zm_tm_dead_body_01_n.vtf new file mode 100644 index 00000000..66b14f54 Binary files /dev/null and b/materials/models/originscorpse/p6_zm_tm_dead_body_01_n.vtf differ diff --git a/materials/models/originscorpse/static_peleliu_stick_trap_n.vtf b/materials/models/originscorpse/static_peleliu_stick_trap_n.vtf new file mode 100644 index 00000000..bd7fcb49 Binary files /dev/null and b/materials/models/originscorpse/static_peleliu_stick_trap_n.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_cherry.vmt b/materials/models/perk_bottle/c_perk_bottle_cherry.vmt new file mode 100644 index 00000000..0f2bce3e --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_cherry.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_cherry" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_cherry.vtf b/materials/models/perk_bottle/c_perk_bottle_cherry.vtf new file mode 100644 index 00000000..1dce245a Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_cherry.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_deadshot.vmt b/materials/models/perk_bottle/c_perk_bottle_deadshot.vmt new file mode 100644 index 00000000..6193439a --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_deadshot.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_deadshot" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_deadshot.vtf b/materials/models/perk_bottle/c_perk_bottle_deadshot.vtf new file mode 100644 index 00000000..98e80d71 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_deadshot.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_dtap.vmt b/materials/models/perk_bottle/c_perk_bottle_dtap.vmt new file mode 100644 index 00000000..52a49bb1 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_dtap.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_dtap" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_dtap.vtf b/materials/models/perk_bottle/c_perk_bottle_dtap.vtf new file mode 100644 index 00000000..dcd6b53e Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_dtap.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_dtap2.vmt b/materials/models/perk_bottle/c_perk_bottle_dtap2.vmt new file mode 100644 index 00000000..fdbe3197 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_dtap2.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_dtap2" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_dtap2.vtf b/materials/models/perk_bottle/c_perk_bottle_dtap2.vtf new file mode 100644 index 00000000..671f3d04 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_dtap2.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_jugg.vmt b/materials/models/perk_bottle/c_perk_bottle_jugg.vmt new file mode 100644 index 00000000..c26dbb35 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_jugg.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_jugg" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_jugg.vtf b/materials/models/perk_bottle/c_perk_bottle_jugg.vtf new file mode 100644 index 00000000..78de5563 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_jugg.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_mulekick.vmt b/materials/models/perk_bottle/c_perk_bottle_mulekick.vmt new file mode 100644 index 00000000..5d195148 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_mulekick.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_mulekick" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_mulekick.vtf b/materials/models/perk_bottle/c_perk_bottle_mulekick.vtf new file mode 100644 index 00000000..d86a5412 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_mulekick.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_phd.vmt b/materials/models/perk_bottle/c_perk_bottle_phd.vmt new file mode 100644 index 00000000..a4e85374 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_phd.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_phd" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_phd.vtf b/materials/models/perk_bottle/c_perk_bottle_phd.vtf new file mode 100644 index 00000000..4b72dc30 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_phd.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_revive.vmt b/materials/models/perk_bottle/c_perk_bottle_revive.vmt new file mode 100644 index 00000000..a3f4425f --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_revive.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_revive" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_revive.vtf b/materials/models/perk_bottle/c_perk_bottle_revive.vtf new file mode 100644 index 00000000..37753020 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_revive.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_speed.vmt b/materials/models/perk_bottle/c_perk_bottle_speed.vmt new file mode 100644 index 00000000..607cb8c0 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_speed.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_speed" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_speed.vtf b/materials/models/perk_bottle/c_perk_bottle_speed.vtf new file mode 100644 index 00000000..76556aff Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_speed.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_stamin.vmt b/materials/models/perk_bottle/c_perk_bottle_stamin.vmt new file mode 100644 index 00000000..acb32899 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_stamin.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_stamin" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_stamin.vtf b/materials/models/perk_bottle/c_perk_bottle_stamin.vtf new file mode 100644 index 00000000..5cc949fc Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_stamin.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_teddy.vmt b/materials/models/perk_bottle/c_perk_bottle_teddy.vmt new file mode 100644 index 00000000..5ba4ae34 --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_teddy.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_teddy" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_teddy.vtf b/materials/models/perk_bottle/c_perk_bottle_teddy.vtf new file mode 100644 index 00000000..8383b8bf Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_teddy.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_tombstone.vmt b/materials/models/perk_bottle/c_perk_bottle_tombstone.vmt new file mode 100644 index 00000000..20e2bacd --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_tombstone.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_tombstone" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_tombstone.vtf b/materials/models/perk_bottle/c_perk_bottle_tombstone.vtf new file mode 100644 index 00000000..90175258 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_tombstone.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_vulture.vmt b/materials/models/perk_bottle/c_perk_bottle_vulture.vmt new file mode 100644 index 00000000..8b28cd8b --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_vulture.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_vulture" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_vulture.vtf b/materials/models/perk_bottle/c_perk_bottle_vulture.vtf new file mode 100644 index 00000000..5c3c7a62 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_vulture.vtf differ diff --git a/materials/models/perk_bottle/c_perk_bottle_whoswho.vmt b/materials/models/perk_bottle/c_perk_bottle_whoswho.vmt new file mode 100644 index 00000000..f238ad8c --- /dev/null +++ b/materials/models/perk_bottle/c_perk_bottle_whoswho.vmt @@ -0,0 +1,5 @@ +"UnlitGeneric" +{ + "$basetexture" "models/perk_bottle/c_perk_bottle_whoswho" + "$surfaceprop" "Default" +} diff --git a/materials/models/perk_bottle/c_perk_bottle_whoswho.vtf b/materials/models/perk_bottle/c_perk_bottle_whoswho.vtf new file mode 100644 index 00000000..ba1937f9 Binary files /dev/null and b/materials/models/perk_bottle/c_perk_bottle_whoswho.vtf differ diff --git a/materials/models/phdflopper/_-gzombie_vending_nuke_c.vmt b/materials/models/phdflopper/_-gzombie_vending_nuke_c.vmt new file mode 100644 index 00000000..7ffbad55 --- /dev/null +++ b/materials/models/phdflopper/_-gzombie_vending_nuke_c.vmt @@ -0,0 +1,19 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/phdflopper/_-gzombie_vending_nuke_c" + "$bumpmap" "models/phdflopper/zombie_vending_nuke_normal" + "$selfillum" "1" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/phdflopper/_-gzombie_vending_nuke_c.vtf b/materials/models/phdflopper/_-gzombie_vending_nuke_c.vtf new file mode 100644 index 00000000..3d538aeb Binary files /dev/null and b/materials/models/phdflopper/_-gzombie_vending_nuke_c.vtf differ diff --git a/materials/models/phdflopper/_-gzombie_vending_nuke_c_off.vmt b/materials/models/phdflopper/_-gzombie_vending_nuke_c_off.vmt new file mode 100644 index 00000000..db19fe52 --- /dev/null +++ b/materials/models/phdflopper/_-gzombie_vending_nuke_c_off.vmt @@ -0,0 +1,18 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/phdflopper/_-gzombie_vending_nuke_c" + "$bumpmap" "models/phdflopper/zombie_vending_nuke_normal" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/phdflopper/zombie_vending_nuke_glass.vmt b/materials/models/phdflopper/zombie_vending_nuke_glass.vmt new file mode 100644 index 00000000..365eb3f0 --- /dev/null +++ b/materials/models/phdflopper/zombie_vending_nuke_glass.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/phdflopper/zombie_vending_nuke_glass" + "$translucent" 1 +} diff --git a/materials/models/phdflopper/zombie_vending_nuke_glass.vtf b/materials/models/phdflopper/zombie_vending_nuke_glass.vtf new file mode 100644 index 00000000..653a2b1b Binary files /dev/null and b/materials/models/phdflopper/zombie_vending_nuke_glass.vtf differ diff --git a/materials/models/phdflopper/zombie_vending_nuke_normal.vtf b/materials/models/phdflopper/zombie_vending_nuke_normal.vtf new file mode 100644 index 00000000..ad64c715 Binary files /dev/null and b/materials/models/phdflopper/zombie_vending_nuke_normal.vtf differ diff --git a/materials/models/sandbag/_-gp6_zm_tm_sandbags_c.vtf b/materials/models/sandbag/_-gp6_zm_tm_sandbags_c.vtf new file mode 100644 index 00000000..b6532059 Binary files /dev/null and b/materials/models/sandbag/_-gp6_zm_tm_sandbags_c.vtf differ diff --git a/materials/models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f.vmt b/materials/models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f.vmt new file mode 100644 index 00000000..77c8e050 --- /dev/null +++ b/materials/models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f" + "$bumpmap" "models/sandbag/p6_zm_tm_sandbags_n" +} diff --git a/materials/models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f.vtf b/materials/models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f.vtf new file mode 100644 index 00000000..c109affd Binary files /dev/null and b/materials/models/sandbag/__-gp6_zm_tm_sandbags_c-rgb&__689d060f.vtf differ diff --git a/materials/models/sandbag/p6_zm_tm_sandbags_n.vtf b/materials/models/sandbag/p6_zm_tm_sandbags_n.vtf new file mode 100644 index 00000000..1b3351bf Binary files /dev/null and b/materials/models/sandbag/p6_zm_tm_sandbags_n.vtf differ diff --git a/materials/models/staminup/_-gzombie_vending_marathon_c.vmt b/materials/models/staminup/_-gzombie_vending_marathon_c.vmt new file mode 100644 index 00000000..562149cb --- /dev/null +++ b/materials/models/staminup/_-gzombie_vending_marathon_c.vmt @@ -0,0 +1,19 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/staminup/_-gzombie_vending_marathon_c" + "$bumpmap" "models/staminup/zombie_vending_marathon_normal" + "$selfillum" "1" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/staminup/_-gzombie_vending_marathon_c.vtf b/materials/models/staminup/_-gzombie_vending_marathon_c.vtf new file mode 100644 index 00000000..b51c6c3d Binary files /dev/null and b/materials/models/staminup/_-gzombie_vending_marathon_c.vtf differ diff --git a/materials/models/staminup/_-gzombie_vending_marathon_c_off.vmt b/materials/models/staminup/_-gzombie_vending_marathon_c_off.vmt new file mode 100644 index 00000000..acf312f2 --- /dev/null +++ b/materials/models/staminup/_-gzombie_vending_marathon_c_off.vmt @@ -0,0 +1,18 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/staminup/_-gzombie_vending_marathon_c" + "$bumpmap" "models/staminup/zombie_vending_marathon_normal" +$phong 1 +$phongboost "0.2" +$phongexponent 2 +$phongtint "[.85 .85 1]" +$halflambert 0 +$phongfresnelranges "[.3 .65 30]" +$ambientocclusion 1 + "$rimlight" "0" + "$rimlightexponent" "30" + "$rimlightboost" "2" + + +$diffuseexp "1.5" +} diff --git a/materials/models/staminup/zombie_vending_marathon_glass.vmt b/materials/models/staminup/zombie_vending_marathon_glass.vmt new file mode 100644 index 00000000..2e2b8a13 --- /dev/null +++ b/materials/models/staminup/zombie_vending_marathon_glass.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/staminup/zombie_vending_marathon_glass" + "$translucent" 1 +} diff --git a/materials/models/staminup/zombie_vending_marathon_glass.vtf b/materials/models/staminup/zombie_vending_marathon_glass.vtf new file mode 100644 index 00000000..54503426 Binary files /dev/null and b/materials/models/staminup/zombie_vending_marathon_glass.vtf differ diff --git a/materials/models/staminup/zombie_vending_marathon_normal.vtf b/materials/models/staminup/zombie_vending_marathon_normal.vtf new file mode 100644 index 00000000..9a07dead Binary files /dev/null and b/materials/models/staminup/zombie_vending_marathon_normal.vtf differ diff --git a/materials/models/tombstone/tombstone_colour.vmt b/materials/models/tombstone/tombstone_colour.vmt new file mode 100644 index 00000000..5ff36ca2 --- /dev/null +++ b/materials/models/tombstone/tombstone_colour.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/tombstone/tombstone_colour" + "$bumpmap" "models/tombstone/tombstone_normal" +} diff --git a/materials/models/tombstone/tombstone_colour.vtf b/materials/models/tombstone/tombstone_colour.vtf new file mode 100644 index 00000000..5264b1fe Binary files /dev/null and b/materials/models/tombstone/tombstone_colour.vtf differ diff --git a/materials/models/tombstone/tombstone_normal.vtf b/materials/models/tombstone/tombstone_normal.vtf new file mode 100644 index 00000000..cadbe4fc Binary files /dev/null and b/materials/models/tombstone/tombstone_normal.vtf differ diff --git a/materials/models/tombstone/tombstone_sign.vmt b/materials/models/tombstone/tombstone_sign.vmt new file mode 100644 index 00000000..27640616 --- /dev/null +++ b/materials/models/tombstone/tombstone_sign.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/tombstone/tombstone_sign" + "$bumpmap" "models/tombstone/tombstone_sign_normal" + "$selfillum" "1" +} diff --git a/materials/models/tombstone/tombstone_sign.vtf b/materials/models/tombstone/tombstone_sign.vtf new file mode 100644 index 00000000..4f442d79 Binary files /dev/null and b/materials/models/tombstone/tombstone_sign.vtf differ diff --git a/materials/models/tombstone/tombstone_sign_normal.vtf b/materials/models/tombstone/tombstone_sign_normal.vtf new file mode 100644 index 00000000..0d6824d6 Binary files /dev/null and b/materials/models/tombstone/tombstone_sign_normal.vtf differ diff --git a/materials/models/tombstone/tombstone_sign_off.vmt b/materials/models/tombstone/tombstone_sign_off.vmt new file mode 100644 index 00000000..879824e1 --- /dev/null +++ b/materials/models/tombstone/tombstone_sign_off.vmt @@ -0,0 +1,5 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/tombstone/tombstone_sign" + "$bumpmap" "models/tombstone/tombstone_sign_normal" +} diff --git a/materials/models/tombstone/tombstone_vent.vmt b/materials/models/tombstone/tombstone_vent.vmt new file mode 100644 index 00000000..a9c51428 --- /dev/null +++ b/materials/models/tombstone/tombstone_vent.vmt @@ -0,0 +1,4 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/tombstone/tombstone_vent" +} diff --git a/materials/models/tombstone/tombstone_vent.vtf b/materials/models/tombstone/tombstone_vent.vtf new file mode 100644 index 00000000..c8a3eb7d Binary files /dev/null and b/materials/models/tombstone/tombstone_vent.vtf differ diff --git a/materials/models/vulture/vultureaid_colour.vmt b/materials/models/vulture/vultureaid_colour.vmt new file mode 100644 index 00000000..d2a880c5 --- /dev/null +++ b/materials/models/vulture/vultureaid_colour.vmt @@ -0,0 +1,7 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/vulture/vultureaid_colour" + "$bumpmap" "models/vulture/vultureaid_normal" + "$selfillum" "1" + +} diff --git a/materials/models/vulture/vultureaid_colour.vtf b/materials/models/vulture/vultureaid_colour.vtf new file mode 100644 index 00000000..a0caa90b Binary files /dev/null and b/materials/models/vulture/vultureaid_colour.vtf differ diff --git a/materials/models/vulture/vultureaid_colour_off.vmt b/materials/models/vulture/vultureaid_colour_off.vmt new file mode 100644 index 00000000..a888018f --- /dev/null +++ b/materials/models/vulture/vultureaid_colour_off.vmt @@ -0,0 +1,6 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/vulture/vultureaid_colour" + "$bumpmap" "models/vulture/vultureaid_normal" + +} diff --git a/materials/models/vulture/vultureaid_normal.vtf b/materials/models/vulture/vultureaid_normal.vtf new file mode 100644 index 00000000..59343a5e Binary files /dev/null and b/materials/models/vulture/vultureaid_normal.vtf differ diff --git a/materials/models/weapons/monkey_bomb_c.vmt b/materials/models/weapons/monkey_bomb_c.vmt new file mode 100644 index 00000000..d37b254b --- /dev/null +++ b/materials/models/weapons/monkey_bomb_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/monkey_bomb_c" + "$bumpmap" "models/weapons/monkey_bomb_n" + "$model" 1 +} \ No newline at end of file diff --git a/materials/models/weapons/monkey_bomb_c.vtf b/materials/models/weapons/monkey_bomb_c.vtf new file mode 100644 index 00000000..3f8c833f Binary files /dev/null and b/materials/models/weapons/monkey_bomb_c.vtf differ diff --git a/materials/models/weapons/monkey_bomb_n.vmt b/materials/models/weapons/monkey_bomb_n.vmt new file mode 100644 index 00000000..b6d55694 --- /dev/null +++ b/materials/models/weapons/monkey_bomb_n.vmt @@ -0,0 +1,4 @@ +"LightmappedGeneric" +{ + "$basetexture" "models/weapons/monkey_bomb_n" +} diff --git a/materials/models/weapons/monkey_bomb_n.vtf b/materials/models/weapons/monkey_bomb_n.vtf new file mode 100644 index 00000000..c75e49d2 Binary files /dev/null and b/materials/models/weapons/monkey_bomb_n.vtf differ diff --git a/materials/models/weapons/monkey_fur_c.vmt b/materials/models/weapons/monkey_fur_c.vmt new file mode 100644 index 00000000..4993a2e3 --- /dev/null +++ b/materials/models/weapons/monkey_fur_c.vmt @@ -0,0 +1,11 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/monkey_fur_c" + "$model" 1 + + "$phong" "1" + "$phongexponent" "100" + "$phongboost" "0.1" + "$phongfresnelranges" "[0.2 0.5 1]" + "$phongalbedotint" "1" +} \ No newline at end of file diff --git a/materials/models/weapons/monkey_fur_c.vtf b/materials/models/weapons/monkey_fur_c.vtf new file mode 100644 index 00000000..65b62041 Binary files /dev/null and b/materials/models/weapons/monkey_fur_c.vtf differ diff --git a/materials/models/weapons/morphine_c.vmt b/materials/models/weapons/morphine_c.vmt new file mode 100644 index 00000000..531a4ede --- /dev/null +++ b/materials/models/weapons/morphine_c.vmt @@ -0,0 +1,11 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/morphine_c" + "$model" 1 + + "$phong" "1" + "$phongexponent" "100" + "$phongboost" "0.1" + "$phongfresnelranges" "[0.2 0.5 1]" + "$phongalbedotint" "1" +} \ No newline at end of file diff --git a/materials/models/weapons/morphine_c.vtf b/materials/models/weapons/morphine_c.vtf new file mode 100644 index 00000000..c4d011f3 Binary files /dev/null and b/materials/models/weapons/morphine_c.vtf differ diff --git a/materials/models/weapons/morphine_glass_c.vmt b/materials/models/weapons/morphine_glass_c.vmt new file mode 100644 index 00000000..3afd144e --- /dev/null +++ b/materials/models/weapons/morphine_glass_c.vmt @@ -0,0 +1,11 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/morphine_glass_c" + "$model" 1 + + "$phong" "1" + "$phongexponent" "100" + "$phongboost" "0.1" + "$phongfresnelranges" "[0.2 0.5 1]" + "$phongalbedotint" "1" +} \ No newline at end of file diff --git a/materials/models/weapons/morphine_glass_c.vtf b/materials/models/weapons/morphine_glass_c.vtf new file mode 100644 index 00000000..528e8a12 Binary files /dev/null and b/materials/models/weapons/morphine_glass_c.vtf differ diff --git a/materials/models/weapons/morphine_pin_c.vmt b/materials/models/weapons/morphine_pin_c.vmt new file mode 100644 index 00000000..4b22d939 --- /dev/null +++ b/materials/models/weapons/morphine_pin_c.vmt @@ -0,0 +1,11 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/morphine_pin_c" + "$model" 1 + + "$phong" "1" + "$phongexponent" "100" + "$phongboost" "0.1" + "$phongfresnelranges" "[0.2 0.5 1]" + "$phongalbedotint" "1" +} \ No newline at end of file diff --git a/materials/models/weapons/morphine_pin_c.vtf b/materials/models/weapons/morphine_pin_c.vtf new file mode 100644 index 00000000..bf64963c Binary files /dev/null and b/materials/models/weapons/morphine_pin_c.vtf differ diff --git a/materials/models/weapons/usa_knife_bowie_c.vmt b/materials/models/weapons/usa_knife_bowie_c.vmt new file mode 100644 index 00000000..64de5e10 --- /dev/null +++ b/materials/models/weapons/usa_knife_bowie_c.vmt @@ -0,0 +1,12 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/usa_knife_bowie_c" + "$bumpmap" "models/weapons/usa_knife_bowie_n_bump" + "$model" 1 + + "$phong" "1" + "$phongexponent" "300" + "$phongboost" "10" + "$phongfresnelranges" "[0.2 1 2]" + "$phongalbedotint" "1" +} \ No newline at end of file diff --git a/materials/models/weapons/usa_knife_bowie_c.vtf b/materials/models/weapons/usa_knife_bowie_c.vtf new file mode 100644 index 00000000..d8ed0dd8 Binary files /dev/null and b/materials/models/weapons/usa_knife_bowie_c.vtf differ diff --git a/materials/models/weapons/usa_knife_bowie_n_bump.vtf b/materials/models/weapons/usa_knife_bowie_n_bump.vtf new file mode 100644 index 00000000..5578dfcc Binary files /dev/null and b/materials/models/weapons/usa_knife_bowie_n_bump.vtf differ diff --git a/materials/models/weapons/usa_monkey_bomb_explosive_c.vmt b/materials/models/weapons/usa_monkey_bomb_explosive_c.vmt new file mode 100644 index 00000000..d87cd0c2 --- /dev/null +++ b/materials/models/weapons/usa_monkey_bomb_explosive_c.vmt @@ -0,0 +1,6 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/weapons/usa_monkey_bomb_explosive_c" + "$bumpmap" "models/weapons/usa_monkey_bomb_explosive_n" + "$model" 1 +} \ No newline at end of file diff --git a/materials/models/weapons/usa_monkey_bomb_explosive_c.vtf b/materials/models/weapons/usa_monkey_bomb_explosive_c.vtf new file mode 100644 index 00000000..3d57ebd9 Binary files /dev/null and b/materials/models/weapons/usa_monkey_bomb_explosive_c.vtf differ diff --git a/materials/models/weapons/usa_monkey_bomb_explosive_n.vtf b/materials/models/weapons/usa_monkey_bomb_explosive_n.vtf new file mode 100644 index 00000000..262ccc8f Binary files /dev/null and b/materials/models/weapons/usa_monkey_bomb_explosive_n.vtf differ diff --git a/materials/models/wunderfizz/_-gchemistry_glass_c.vmt b/materials/models/wunderfizz/_-gchemistry_glass_c.vmt new file mode 100644 index 00000000..888117eb --- /dev/null +++ b/materials/models/wunderfizz/_-gchemistry_glass_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/wunderfizz/_-gchemistry_glass_c" + "$translucent" "1" +} diff --git a/materials/models/wunderfizz/_-gchemistry_glass_c.vtf b/materials/models/wunderfizz/_-gchemistry_glass_c.vtf new file mode 100644 index 00000000..ec109f33 Binary files /dev/null and b/materials/models/wunderfizz/_-gchemistry_glass_c.vtf differ diff --git a/materials/models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c.vmt b/materials/models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c.vmt new file mode 100644 index 00000000..121eac82 --- /dev/null +++ b/materials/models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c" + "$bumpmap" "models/wunderfizz/mtl_p6_zm_tm_crystal_n" +} diff --git a/materials/models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c.vtf b/materials/models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c.vtf new file mode 100644 index 00000000..729d4d3a Binary files /dev/null and b/materials/models/wunderfizz/_-gmtl_p6_zm_tm_crystal_bubbles_c.vtf differ diff --git a/materials/models/wunderfizz/_-gp6_zm_tm_monolith_dark_c.vmt b/materials/models/wunderfizz/_-gp6_zm_tm_monolith_dark_c.vmt new file mode 100644 index 00000000..f0c55805 --- /dev/null +++ b/materials/models/wunderfizz/_-gp6_zm_tm_monolith_dark_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/wunderfizz/_-gp6_zm_tm_monolith_dark_c" + "$bumpmap" "models/wunderfizz/zm_tm_rock_pattern_01_n" +} diff --git a/materials/models/wunderfizz/_-gp6_zm_tm_monolith_dark_c.vtf b/materials/models/wunderfizz/_-gp6_zm_tm_monolith_dark_c.vtf new file mode 100644 index 00000000..34914fec Binary files /dev/null and b/materials/models/wunderfizz/_-gp6_zm_tm_monolith_dark_c.vtf differ diff --git a/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c.vmt b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c.vmt new file mode 100644 index 00000000..680f756d --- /dev/null +++ b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c" + "$bumpmap" "models/wunderfizz/p6_zm_vending_diesel_magic_acc_n" +} diff --git a/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c.vtf b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c.vtf new file mode 100644 index 00000000..56b345c7 Binary files /dev/null and b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_acc_c.vtf differ diff --git a/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_c.vmt b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_c.vmt new file mode 100644 index 00000000..77909382 --- /dev/null +++ b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_c.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "models/wunderfizz/_-gp6_zm_vending_diesel_magic_c" + "$bumpmap" "models/wunderfizz/p6_zm_vending_diesel_magic_n" +} diff --git a/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_c.vtf b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_c.vtf new file mode 100644 index 00000000..f364b73b Binary files /dev/null and b/materials/models/wunderfizz/_-gp6_zm_vending_diesel_magic_c.vtf differ diff --git a/materials/models/wunderfizz/mtl_p6_zm_tm_crystal_n.vtf b/materials/models/wunderfizz/mtl_p6_zm_tm_crystal_n.vtf new file mode 100644 index 00000000..b5a9473d Binary files /dev/null and b/materials/models/wunderfizz/mtl_p6_zm_tm_crystal_n.vtf differ diff --git a/materials/models/wunderfizz/p6_zm_vending_diesel_magic_acc_n.vtf b/materials/models/wunderfizz/p6_zm_vending_diesel_magic_acc_n.vtf new file mode 100644 index 00000000..a531b8f6 Binary files /dev/null and b/materials/models/wunderfizz/p6_zm_vending_diesel_magic_acc_n.vtf differ diff --git a/materials/models/wunderfizz/p6_zm_vending_diesel_magic_n.vtf b/materials/models/wunderfizz/p6_zm_vending_diesel_magic_n.vtf new file mode 100644 index 00000000..6c6de34b Binary files /dev/null and b/materials/models/wunderfizz/p6_zm_vending_diesel_magic_n.vtf differ diff --git a/materials/models/wunderfizz/zm_tm_rock_pattern_01_n.vtf b/materials/models/wunderfizz/zm_tm_rock_pattern_01_n.vtf new file mode 100644 index 00000000..3ad14ecc Binary files /dev/null and b/materials/models/wunderfizz/zm_tm_rock_pattern_01_n.vtf differ diff --git a/materials/nzmapicons/nz_ttt_kosovos;Breakout.png b/materials/nzmapicons/nz_ttt_kosovos;Breakout.png new file mode 100644 index 00000000..dd484774 Binary files /dev/null and b/materials/nzmapicons/nz_ttt_kosovos;Breakout.png differ diff --git a/materials/overlay_low_health.png b/materials/overlay_low_health.png new file mode 100644 index 00000000..7759b2e5 Binary files /dev/null and b/materials/overlay_low_health.png differ diff --git a/materials/perk_icons/cherry.png b/materials/perk_icons/cherry.png new file mode 100644 index 00000000..aff6a373 Binary files /dev/null and b/materials/perk_icons/cherry.png differ diff --git a/materials/perk_icons/deadshot.png b/materials/perk_icons/deadshot.png new file mode 100644 index 00000000..272ec589 Binary files /dev/null and b/materials/perk_icons/deadshot.png differ diff --git a/materials/perk_icons/dtap.png b/materials/perk_icons/dtap.png new file mode 100644 index 00000000..8be5a732 Binary files /dev/null and b/materials/perk_icons/dtap.png differ diff --git a/materials/perk_icons/dtap2.png b/materials/perk_icons/dtap2.png new file mode 100644 index 00000000..012c0169 Binary files /dev/null and b/materials/perk_icons/dtap2.png differ diff --git a/materials/perk_icons/jugg.png b/materials/perk_icons/jugg.png new file mode 100644 index 00000000..882b3a5d Binary files /dev/null and b/materials/perk_icons/jugg.png differ diff --git a/materials/perk_icons/mulekick.png b/materials/perk_icons/mulekick.png new file mode 100644 index 00000000..b8e897f7 Binary files /dev/null and b/materials/perk_icons/mulekick.png differ diff --git a/materials/perk_icons/perk_icons.psd b/materials/perk_icons/perk_icons.psd new file mode 100644 index 00000000..8ef496cf Binary files /dev/null and b/materials/perk_icons/perk_icons.psd differ diff --git a/materials/perk_icons/phd.png b/materials/perk_icons/phd.png new file mode 100644 index 00000000..93916441 Binary files /dev/null and b/materials/perk_icons/phd.png differ diff --git a/materials/perk_icons/revive.png b/materials/perk_icons/revive.png new file mode 100644 index 00000000..c5e4fd6d Binary files /dev/null and b/materials/perk_icons/revive.png differ diff --git a/materials/perk_icons/speed.png b/materials/perk_icons/speed.png new file mode 100644 index 00000000..17170728 Binary files /dev/null and b/materials/perk_icons/speed.png differ diff --git a/materials/perk_icons/staminup.png b/materials/perk_icons/staminup.png new file mode 100644 index 00000000..b3a74ee4 Binary files /dev/null and b/materials/perk_icons/staminup.png differ diff --git a/materials/perk_icons/tombstone.png b/materials/perk_icons/tombstone.png new file mode 100644 index 00000000..b865bb12 Binary files /dev/null and b/materials/perk_icons/tombstone.png differ diff --git a/materials/perk_icons/vulture.png b/materials/perk_icons/vulture.png new file mode 100644 index 00000000..2fc09730 Binary files /dev/null and b/materials/perk_icons/vulture.png differ diff --git a/materials/perk_icons/whoswho.png b/materials/perk_icons/whoswho.png new file mode 100644 index 00000000..ae869689 Binary files /dev/null and b/materials/perk_icons/whoswho.png differ diff --git a/materials/revive.png b/materials/revive.png new file mode 100644 index 00000000..d3f942a2 Binary files /dev/null and b/materials/revive.png differ diff --git a/materials/sprites/glow04_actual_noz.vmt b/materials/sprites/glow04_actual_noz.vmt new file mode 100644 index 00000000..1a5187b4 --- /dev/null +++ b/materials/sprites/glow04_actual_noz.vmt @@ -0,0 +1,8 @@ +"UnlitGeneric" +{ + "$basetexture" "sprites/glow04" + "$ignorez" 1 + "$additive" 1 + "$vertexcolor" 1 + "$vertexalpha" 1 +} diff --git a/materials/sprites/physg_glow1_noz.vmt b/materials/sprites/physg_glow1_noz.vmt new file mode 100644 index 00000000..93452ba9 --- /dev/null +++ b/materials/sprites/physg_glow1_noz.vmt @@ -0,0 +1,12 @@ +"Sprite" +{ + "$basetexture" "sprites/physgun_glow" + + "$spriteorientation" "vp_parallel" + "$spriteorigin" "[ 0.50 0.50 ]" + "$vertexalpha" 1 + "$vertexcolor" 1 + "$spriterendermode" 5 + "$alpha" "0.5" + "$ignorez" 1 +} \ No newline at end of file diff --git a/materials/sprites/physg_glow2_noz.vmt b/materials/sprites/physg_glow2_noz.vmt new file mode 100644 index 00000000..c9ac0727 --- /dev/null +++ b/materials/sprites/physg_glow2_noz.vmt @@ -0,0 +1,12 @@ +"Sprite" +{ + "$basetexture" "sprites/physgun_glow" + + "$spriteorientation" "vp_parallel" + "$spriteorigin" "[ 0.50 0.50 ]" + "$vertexalpha" 1 + "$vertexcolor" 1 + "$spriterendermode" 5 + "$alpha" "0.3" + "$ignorez" 1 +} \ No newline at end of file diff --git a/materials/vulture_icons/pap.png b/materials/vulture_icons/pap.png new file mode 100644 index 00000000..c54e8e2c Binary files /dev/null and b/materials/vulture_icons/pap.png differ diff --git a/materials/vulture_icons/random_box.png b/materials/vulture_icons/random_box.png new file mode 100644 index 00000000..424501c5 Binary files /dev/null and b/materials/vulture_icons/random_box.png differ diff --git a/materials/vulture_icons/wall_buys.png b/materials/vulture_icons/wall_buys.png new file mode 100644 index 00000000..fe97bb17 Binary files /dev/null and b/materials/vulture_icons/wall_buys.png differ diff --git a/materials/vulture_icons/wunderfizz.png b/materials/vulture_icons/wunderfizz.png new file mode 100644 index 00000000..00ca1a60 Binary files /dev/null and b/materials/vulture_icons/wunderfizz.png differ diff --git a/models/alig96/perks/cherry/cherry.dx80.vtx b/models/alig96/perks/cherry/cherry.dx80.vtx new file mode 100644 index 00000000..6180cdd3 Binary files /dev/null and b/models/alig96/perks/cherry/cherry.dx80.vtx differ diff --git a/models/alig96/perks/cherry/cherry.dx90.vtx b/models/alig96/perks/cherry/cherry.dx90.vtx new file mode 100644 index 00000000..1b32e196 Binary files /dev/null and b/models/alig96/perks/cherry/cherry.dx90.vtx differ diff --git a/models/alig96/perks/cherry/cherry.mdl b/models/alig96/perks/cherry/cherry.mdl new file mode 100644 index 00000000..82978943 Binary files /dev/null and b/models/alig96/perks/cherry/cherry.mdl differ diff --git a/models/alig96/perks/cherry/cherry.phy b/models/alig96/perks/cherry/cherry.phy new file mode 100644 index 00000000..ef8c1e9c Binary files /dev/null and b/models/alig96/perks/cherry/cherry.phy differ diff --git a/models/alig96/perks/cherry/cherry.sw.vtx b/models/alig96/perks/cherry/cherry.sw.vtx new file mode 100644 index 00000000..cdf328f9 Binary files /dev/null and b/models/alig96/perks/cherry/cherry.sw.vtx differ diff --git a/models/alig96/perks/cherry/cherry.vvd b/models/alig96/perks/cherry/cherry.vvd new file mode 100644 index 00000000..52d6b532 Binary files /dev/null and b/models/alig96/perks/cherry/cherry.vvd differ diff --git a/models/alig96/perks/cherry/cherry_off.dx80.vtx b/models/alig96/perks/cherry/cherry_off.dx80.vtx new file mode 100644 index 00000000..0c915e7f Binary files /dev/null and b/models/alig96/perks/cherry/cherry_off.dx80.vtx differ diff --git a/models/alig96/perks/cherry/cherry_off.dx90.vtx b/models/alig96/perks/cherry/cherry_off.dx90.vtx new file mode 100644 index 00000000..bc641603 Binary files /dev/null and b/models/alig96/perks/cherry/cherry_off.dx90.vtx differ diff --git a/models/alig96/perks/cherry/cherry_off.mdl b/models/alig96/perks/cherry/cherry_off.mdl new file mode 100644 index 00000000..4d7bad94 Binary files /dev/null and b/models/alig96/perks/cherry/cherry_off.mdl differ diff --git a/models/alig96/perks/cherry/cherry_off.phy b/models/alig96/perks/cherry/cherry_off.phy new file mode 100644 index 00000000..661d4dc7 Binary files /dev/null and b/models/alig96/perks/cherry/cherry_off.phy differ diff --git a/models/alig96/perks/cherry/cherry_off.sw.vtx b/models/alig96/perks/cherry/cherry_off.sw.vtx new file mode 100644 index 00000000..045124a2 Binary files /dev/null and b/models/alig96/perks/cherry/cherry_off.sw.vtx differ diff --git a/models/alig96/perks/cherry/cherry_off.vvd b/models/alig96/perks/cherry/cherry_off.vvd new file mode 100644 index 00000000..eda4f258 Binary files /dev/null and b/models/alig96/perks/cherry/cherry_off.vvd differ diff --git a/models/alig96/perks/deadshot/deadshot.dx80.vtx b/models/alig96/perks/deadshot/deadshot.dx80.vtx new file mode 100644 index 00000000..346d6dc0 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot.dx80.vtx differ diff --git a/models/alig96/perks/deadshot/deadshot.dx90.vtx b/models/alig96/perks/deadshot/deadshot.dx90.vtx new file mode 100644 index 00000000..fc82a6ed Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot.dx90.vtx differ diff --git a/models/alig96/perks/deadshot/deadshot.mdl b/models/alig96/perks/deadshot/deadshot.mdl new file mode 100644 index 00000000..21e01633 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot.mdl differ diff --git a/models/alig96/perks/deadshot/deadshot.phy b/models/alig96/perks/deadshot/deadshot.phy new file mode 100644 index 00000000..6470e9ef Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot.phy differ diff --git a/models/alig96/perks/deadshot/deadshot.sw.vtx b/models/alig96/perks/deadshot/deadshot.sw.vtx new file mode 100644 index 00000000..3c7f1e8d Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot.sw.vtx differ diff --git a/models/alig96/perks/deadshot/deadshot.vvd b/models/alig96/perks/deadshot/deadshot.vvd new file mode 100644 index 00000000..c7ece544 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot.vvd differ diff --git a/models/alig96/perks/deadshot/deadshot_off.dx80.vtx b/models/alig96/perks/deadshot/deadshot_off.dx80.vtx new file mode 100644 index 00000000..b3c1274e Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot_off.dx80.vtx differ diff --git a/models/alig96/perks/deadshot/deadshot_off.dx90.vtx b/models/alig96/perks/deadshot/deadshot_off.dx90.vtx new file mode 100644 index 00000000..968bf0d6 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot_off.dx90.vtx differ diff --git a/models/alig96/perks/deadshot/deadshot_off.mdl b/models/alig96/perks/deadshot/deadshot_off.mdl new file mode 100644 index 00000000..ba49017e Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot_off.mdl differ diff --git a/models/alig96/perks/deadshot/deadshot_off.phy b/models/alig96/perks/deadshot/deadshot_off.phy new file mode 100644 index 00000000..44dca682 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot_off.phy differ diff --git a/models/alig96/perks/deadshot/deadshot_off.sw.vtx b/models/alig96/perks/deadshot/deadshot_off.sw.vtx new file mode 100644 index 00000000..f6a91038 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot_off.sw.vtx differ diff --git a/models/alig96/perks/deadshot/deadshot_off.vvd b/models/alig96/perks/deadshot/deadshot_off.vvd new file mode 100644 index 00000000..9ecf7259 Binary files /dev/null and b/models/alig96/perks/deadshot/deadshot_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx80.vtx b/models/alig96/perks/doubletap/doubletap_off.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx80.vtx rename to models/alig96/perks/doubletap/doubletap_off.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx90.vtx b/models/alig96/perks/doubletap/doubletap_off.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_off.dx90.vtx rename to models/alig96/perks/doubletap/doubletap_off.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.mdl b/models/alig96/perks/doubletap/doubletap_off.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_off.mdl rename to models/alig96/perks/doubletap/doubletap_off.mdl diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.phy b/models/alig96/perks/doubletap/doubletap_off.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_off.phy rename to models/alig96/perks/doubletap/doubletap_off.phy diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.sw.vtx b/models/alig96/perks/doubletap/doubletap_off.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_off.sw.vtx rename to models/alig96/perks/doubletap/doubletap_off.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_off.vvd b/models/alig96/perks/doubletap/doubletap_off.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_off.vvd rename to models/alig96/perks/doubletap/doubletap_off.vvd diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx80.vtx b/models/alig96/perks/doubletap/doubletap_on.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx80.vtx rename to models/alig96/perks/doubletap/doubletap_on.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx90.vtx b/models/alig96/perks/doubletap/doubletap_on.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_on.dx90.vtx rename to models/alig96/perks/doubletap/doubletap_on.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.mdl b/models/alig96/perks/doubletap/doubletap_on.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_on.mdl rename to models/alig96/perks/doubletap/doubletap_on.mdl diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.phy b/models/alig96/perks/doubletap/doubletap_on.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_on.phy rename to models/alig96/perks/doubletap/doubletap_on.phy diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.sw.vtx b/models/alig96/perks/doubletap/doubletap_on.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_on.sw.vtx rename to models/alig96/perks/doubletap/doubletap_on.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/doubletap/doubletap_on.vvd b/models/alig96/perks/doubletap/doubletap_on.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/doubletap/doubletap_on.vvd rename to models/alig96/perks/doubletap/doubletap_on.vvd diff --git a/models/alig96/perks/doubletap2/doubletap2.dx80.vtx b/models/alig96/perks/doubletap2/doubletap2.dx80.vtx new file mode 100644 index 00000000..828aa5ad Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2.dx80.vtx differ diff --git a/models/alig96/perks/doubletap2/doubletap2.dx90.vtx b/models/alig96/perks/doubletap2/doubletap2.dx90.vtx new file mode 100644 index 00000000..0f8b359a Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2.dx90.vtx differ diff --git a/models/alig96/perks/doubletap2/doubletap2.mdl b/models/alig96/perks/doubletap2/doubletap2.mdl new file mode 100644 index 00000000..24949f88 Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2.mdl differ diff --git a/models/alig96/perks/doubletap2/doubletap2.phy b/models/alig96/perks/doubletap2/doubletap2.phy new file mode 100644 index 00000000..6309791d Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2.phy differ diff --git a/models/alig96/perks/doubletap2/doubletap2.sw.vtx b/models/alig96/perks/doubletap2/doubletap2.sw.vtx new file mode 100644 index 00000000..b849be0e Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2.sw.vtx differ diff --git a/models/alig96/perks/doubletap2/doubletap2.vvd b/models/alig96/perks/doubletap2/doubletap2.vvd new file mode 100644 index 00000000..0fff36ba Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2.vvd differ diff --git a/models/alig96/perks/doubletap2/doubletap2_off.dx80.vtx b/models/alig96/perks/doubletap2/doubletap2_off.dx80.vtx new file mode 100644 index 00000000..65619ec3 Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2_off.dx80.vtx differ diff --git a/models/alig96/perks/doubletap2/doubletap2_off.dx90.vtx b/models/alig96/perks/doubletap2/doubletap2_off.dx90.vtx new file mode 100644 index 00000000..a772821d Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2_off.dx90.vtx differ diff --git a/models/alig96/perks/doubletap2/doubletap2_off.mdl b/models/alig96/perks/doubletap2/doubletap2_off.mdl new file mode 100644 index 00000000..488d6cb0 Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2_off.mdl differ diff --git a/models/alig96/perks/doubletap2/doubletap2_off.phy b/models/alig96/perks/doubletap2/doubletap2_off.phy new file mode 100644 index 00000000..80130e5f Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2_off.phy differ diff --git a/models/alig96/perks/doubletap2/doubletap2_off.sw.vtx b/models/alig96/perks/doubletap2/doubletap2_off.sw.vtx new file mode 100644 index 00000000..2fc70590 Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2_off.sw.vtx differ diff --git a/models/alig96/perks/doubletap2/doubletap2_off.vvd b/models/alig96/perks/doubletap2/doubletap2_off.vvd new file mode 100644 index 00000000..e3ff3203 Binary files /dev/null and b/models/alig96/perks/doubletap2/doubletap2_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx80.vtx b/models/alig96/perks/jugg/jugg_off.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_off.dx80.vtx rename to models/alig96/perks/jugg/jugg_off.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.dx90.vtx b/models/alig96/perks/jugg/jugg_off.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_off.dx90.vtx rename to models/alig96/perks/jugg/jugg_off.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.mdl b/models/alig96/perks/jugg/jugg_off.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_off.mdl rename to models/alig96/perks/jugg/jugg_off.mdl diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.phy b/models/alig96/perks/jugg/jugg_off.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_off.phy rename to models/alig96/perks/jugg/jugg_off.phy diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.sw.vtx b/models/alig96/perks/jugg/jugg_off.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_off.sw.vtx rename to models/alig96/perks/jugg/jugg_off.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_off.vvd b/models/alig96/perks/jugg/jugg_off.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_off.vvd rename to models/alig96/perks/jugg/jugg_off.vvd diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx80.vtx b/models/alig96/perks/jugg/jugg_on.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_on.dx80.vtx rename to models/alig96/perks/jugg/jugg_on.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.dx90.vtx b/models/alig96/perks/jugg/jugg_on.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_on.dx90.vtx rename to models/alig96/perks/jugg/jugg_on.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.mdl b/models/alig96/perks/jugg/jugg_on.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_on.mdl rename to models/alig96/perks/jugg/jugg_on.mdl diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.phy b/models/alig96/perks/jugg/jugg_on.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_on.phy rename to models/alig96/perks/jugg/jugg_on.phy diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.sw.vtx b/models/alig96/perks/jugg/jugg_on.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_on.sw.vtx rename to models/alig96/perks/jugg/jugg_on.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/jugg/jugg_on.vvd b/models/alig96/perks/jugg/jugg_on.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/jugg/jugg_on.vvd rename to models/alig96/perks/jugg/jugg_on.vvd diff --git a/models/alig96/perks/mulekick/mulekick.dx80.vtx b/models/alig96/perks/mulekick/mulekick.dx80.vtx new file mode 100644 index 00000000..ca4b3bb7 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick.dx80.vtx differ diff --git a/models/alig96/perks/mulekick/mulekick.dx90.vtx b/models/alig96/perks/mulekick/mulekick.dx90.vtx new file mode 100644 index 00000000..1a844e5d Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick.dx90.vtx differ diff --git a/models/alig96/perks/mulekick/mulekick.mdl b/models/alig96/perks/mulekick/mulekick.mdl new file mode 100644 index 00000000..47a4c631 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick.mdl differ diff --git a/models/alig96/perks/mulekick/mulekick.phy b/models/alig96/perks/mulekick/mulekick.phy new file mode 100644 index 00000000..6ba63588 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick.phy differ diff --git a/models/alig96/perks/mulekick/mulekick.sw.vtx b/models/alig96/perks/mulekick/mulekick.sw.vtx new file mode 100644 index 00000000..aa466408 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick.sw.vtx differ diff --git a/models/alig96/perks/mulekick/mulekick.vvd b/models/alig96/perks/mulekick/mulekick.vvd new file mode 100644 index 00000000..1ada9796 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick.vvd differ diff --git a/models/alig96/perks/mulekick/mulekick_off.dx80.vtx b/models/alig96/perks/mulekick/mulekick_off.dx80.vtx new file mode 100644 index 00000000..0bce3292 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick_off.dx80.vtx differ diff --git a/models/alig96/perks/mulekick/mulekick_off.dx90.vtx b/models/alig96/perks/mulekick/mulekick_off.dx90.vtx new file mode 100644 index 00000000..4dd991ff Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick_off.dx90.vtx differ diff --git a/models/alig96/perks/mulekick/mulekick_off.mdl b/models/alig96/perks/mulekick/mulekick_off.mdl new file mode 100644 index 00000000..e2a7bd1f Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick_off.mdl differ diff --git a/models/alig96/perks/mulekick/mulekick_off.phy b/models/alig96/perks/mulekick/mulekick_off.phy new file mode 100644 index 00000000..c7d6b53d Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick_off.phy differ diff --git a/models/alig96/perks/mulekick/mulekick_off.sw.vtx b/models/alig96/perks/mulekick/mulekick_off.sw.vtx new file mode 100644 index 00000000..7b3402fc Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick_off.sw.vtx differ diff --git a/models/alig96/perks/mulekick/mulekick_off.vvd b/models/alig96/perks/mulekick/mulekick_off.vvd new file mode 100644 index 00000000..ab454293 Binary files /dev/null and b/models/alig96/perks/mulekick/mulekick_off.vvd differ diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx80.vtx b/models/alig96/perks/packapunch/packapunch.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/packapunch/packapunch.dx80.vtx rename to models/alig96/perks/packapunch/packapunch.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.dx90.vtx b/models/alig96/perks/packapunch/packapunch.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/packapunch/packapunch.dx90.vtx rename to models/alig96/perks/packapunch/packapunch.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.mdl b/models/alig96/perks/packapunch/packapunch.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/packapunch/packapunch.mdl rename to models/alig96/perks/packapunch/packapunch.mdl diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.phy b/models/alig96/perks/packapunch/packapunch.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/packapunch/packapunch.phy rename to models/alig96/perks/packapunch/packapunch.phy diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.sw.vtx b/models/alig96/perks/packapunch/packapunch.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/packapunch/packapunch.sw.vtx rename to models/alig96/perks/packapunch/packapunch.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/packapunch/packapunch.vvd b/models/alig96/perks/packapunch/packapunch.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/packapunch/packapunch.vvd rename to models/alig96/perks/packapunch/packapunch.vvd diff --git a/models/alig96/perks/perkacola/perkacola.dx80.vtx b/models/alig96/perks/perkacola/perkacola.dx80.vtx new file mode 100644 index 00000000..7f279a9c Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola.dx80.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola.dx90.vtx b/models/alig96/perks/perkacola/perkacola.dx90.vtx new file mode 100644 index 00000000..a66a0ce5 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola.dx90.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola.mdl b/models/alig96/perks/perkacola/perkacola.mdl new file mode 100644 index 00000000..4ef6f95d Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola.mdl differ diff --git a/models/alig96/perks/perkacola/perkacola.phy b/models/alig96/perks/perkacola/perkacola.phy new file mode 100644 index 00000000..37c6d4d7 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola.phy differ diff --git a/models/alig96/perks/perkacola/perkacola.sw.vtx b/models/alig96/perks/perkacola/perkacola.sw.vtx new file mode 100644 index 00000000..50dad356 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola.sw.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola.vvd b/models/alig96/perks/perkacola/perkacola.vvd new file mode 100644 index 00000000..aaccc0e8 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola.vvd differ diff --git a/models/alig96/perks/perkacola/perkacola_cap.dx80.vtx b/models/alig96/perks/perkacola/perkacola_cap.dx80.vtx new file mode 100644 index 00000000..fb61f70b Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_cap.dx80.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola_cap.dx90.vtx b/models/alig96/perks/perkacola/perkacola_cap.dx90.vtx new file mode 100644 index 00000000..a99d08af Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_cap.dx90.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola_cap.mdl b/models/alig96/perks/perkacola/perkacola_cap.mdl new file mode 100644 index 00000000..83fe6b2e Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_cap.mdl differ diff --git a/models/alig96/perks/perkacola/perkacola_cap.phy b/models/alig96/perks/perkacola/perkacola_cap.phy new file mode 100644 index 00000000..784625ed Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_cap.phy differ diff --git a/models/alig96/perks/perkacola/perkacola_cap.sw.vtx b/models/alig96/perks/perkacola/perkacola_cap.sw.vtx new file mode 100644 index 00000000..44d86e3d Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_cap.sw.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola_cap.vvd b/models/alig96/perks/perkacola/perkacola_cap.vvd new file mode 100644 index 00000000..6d135058 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_cap.vvd differ diff --git a/models/alig96/perks/perkacola/perkacola_nocap.dx80.vtx b/models/alig96/perks/perkacola/perkacola_nocap.dx80.vtx new file mode 100644 index 00000000..f1532dd7 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_nocap.dx80.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola_nocap.dx90.vtx b/models/alig96/perks/perkacola/perkacola_nocap.dx90.vtx new file mode 100644 index 00000000..e92b25e2 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_nocap.dx90.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola_nocap.mdl b/models/alig96/perks/perkacola/perkacola_nocap.mdl new file mode 100644 index 00000000..0aa4907f Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_nocap.mdl differ diff --git a/models/alig96/perks/perkacola/perkacola_nocap.phy b/models/alig96/perks/perkacola/perkacola_nocap.phy new file mode 100644 index 00000000..583e83f7 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_nocap.phy differ diff --git a/models/alig96/perks/perkacola/perkacola_nocap.sw.vtx b/models/alig96/perks/perkacola/perkacola_nocap.sw.vtx new file mode 100644 index 00000000..2295cc4a Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_nocap.sw.vtx differ diff --git a/models/alig96/perks/perkacola/perkacola_nocap.vvd b/models/alig96/perks/perkacola/perkacola_nocap.vvd new file mode 100644 index 00000000..153f53b8 Binary files /dev/null and b/models/alig96/perks/perkacola/perkacola_nocap.vvd differ diff --git a/models/alig96/perks/phd/phdflopper.dx80.vtx b/models/alig96/perks/phd/phdflopper.dx80.vtx new file mode 100644 index 00000000..31f1554f Binary files /dev/null and b/models/alig96/perks/phd/phdflopper.dx80.vtx differ diff --git a/models/alig96/perks/phd/phdflopper.dx90.vtx b/models/alig96/perks/phd/phdflopper.dx90.vtx new file mode 100644 index 00000000..7d1ef7ea Binary files /dev/null and b/models/alig96/perks/phd/phdflopper.dx90.vtx differ diff --git a/models/alig96/perks/phd/phdflopper.mdl b/models/alig96/perks/phd/phdflopper.mdl new file mode 100644 index 00000000..590043c1 Binary files /dev/null and b/models/alig96/perks/phd/phdflopper.mdl differ diff --git a/models/alig96/perks/phd/phdflopper.phy b/models/alig96/perks/phd/phdflopper.phy new file mode 100644 index 00000000..49be399a Binary files /dev/null and b/models/alig96/perks/phd/phdflopper.phy differ diff --git a/models/alig96/perks/phd/phdflopper.sw.vtx b/models/alig96/perks/phd/phdflopper.sw.vtx new file mode 100644 index 00000000..3cc9c750 Binary files /dev/null and b/models/alig96/perks/phd/phdflopper.sw.vtx differ diff --git a/models/alig96/perks/phd/phdflopper.vvd b/models/alig96/perks/phd/phdflopper.vvd new file mode 100644 index 00000000..55dc220a Binary files /dev/null and b/models/alig96/perks/phd/phdflopper.vvd differ diff --git a/models/alig96/perks/phd/phdflopper_off.dx80.vtx b/models/alig96/perks/phd/phdflopper_off.dx80.vtx new file mode 100644 index 00000000..52e5a4ab Binary files /dev/null and b/models/alig96/perks/phd/phdflopper_off.dx80.vtx differ diff --git a/models/alig96/perks/phd/phdflopper_off.dx90.vtx b/models/alig96/perks/phd/phdflopper_off.dx90.vtx new file mode 100644 index 00000000..812c9b00 Binary files /dev/null and b/models/alig96/perks/phd/phdflopper_off.dx90.vtx differ diff --git a/models/alig96/perks/phd/phdflopper_off.mdl b/models/alig96/perks/phd/phdflopper_off.mdl new file mode 100644 index 00000000..fdfa493b Binary files /dev/null and b/models/alig96/perks/phd/phdflopper_off.mdl differ diff --git a/models/alig96/perks/phd/phdflopper_off.phy b/models/alig96/perks/phd/phdflopper_off.phy new file mode 100644 index 00000000..081e94f7 Binary files /dev/null and b/models/alig96/perks/phd/phdflopper_off.phy differ diff --git a/models/alig96/perks/phd/phdflopper_off.sw.vtx b/models/alig96/perks/phd/phdflopper_off.sw.vtx new file mode 100644 index 00000000..f5c16602 Binary files /dev/null and b/models/alig96/perks/phd/phdflopper_off.sw.vtx differ diff --git a/models/alig96/perks/phd/phdflopper_off.vvd b/models/alig96/perks/phd/phdflopper_off.vvd new file mode 100644 index 00000000..ee9db7f8 Binary files /dev/null and b/models/alig96/perks/phd/phdflopper_off.vvd differ diff --git a/models/alig96/perks/readme.txt b/models/alig96/perks/readme.txt new file mode 100644 index 00000000..219f5416 --- /dev/null +++ b/models/alig96/perks/readme.txt @@ -0,0 +1,4 @@ +Models by Beat the Zombie + +Recompiled by Alig96 so everything is in a nice folder. +Additional perks added by Zet0r, extracted by YoloJoe \ No newline at end of file diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.dx80.vtx b/models/alig96/perks/revive/revive_off.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_off.dx80.vtx rename to models/alig96/perks/revive/revive_off.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.dx90.vtx b/models/alig96/perks/revive/revive_off.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_off.dx90.vtx rename to models/alig96/perks/revive/revive_off.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.mdl b/models/alig96/perks/revive/revive_off.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_off.mdl rename to models/alig96/perks/revive/revive_off.mdl diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.phy b/models/alig96/perks/revive/revive_off.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_off.phy rename to models/alig96/perks/revive/revive_off.phy diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.sw.vtx b/models/alig96/perks/revive/revive_off.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_off.sw.vtx rename to models/alig96/perks/revive/revive_off.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/revive/revive_off.vvd b/models/alig96/perks/revive/revive_off.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_off.vvd rename to models/alig96/perks/revive/revive_off.vvd diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.dx80.vtx b/models/alig96/perks/revive/revive_on.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_on.dx80.vtx rename to models/alig96/perks/revive/revive_on.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.dx90.vtx b/models/alig96/perks/revive/revive_on.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_on.dx90.vtx rename to models/alig96/perks/revive/revive_on.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.mdl b/models/alig96/perks/revive/revive_on.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_on.mdl rename to models/alig96/perks/revive/revive_on.mdl diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.phy b/models/alig96/perks/revive/revive_on.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_on.phy rename to models/alig96/perks/revive/revive_on.phy diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.sw.vtx b/models/alig96/perks/revive/revive_on.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_on.sw.vtx rename to models/alig96/perks/revive/revive_on.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/revive/revive_on.vvd b/models/alig96/perks/revive/revive_on.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/revive/revive_on.vvd rename to models/alig96/perks/revive/revive_on.vvd diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx80.vtx b/models/alig96/perks/speed/speed_off.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_off.dx80.vtx rename to models/alig96/perks/speed/speed_off.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.dx90.vtx b/models/alig96/perks/speed/speed_off.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_off.dx90.vtx rename to models/alig96/perks/speed/speed_off.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.mdl b/models/alig96/perks/speed/speed_off.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_off.mdl rename to models/alig96/perks/speed/speed_off.mdl diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.phy b/models/alig96/perks/speed/speed_off.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_off.phy rename to models/alig96/perks/speed/speed_off.phy diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.sw.vtx b/models/alig96/perks/speed/speed_off.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_off.sw.vtx rename to models/alig96/perks/speed/speed_off.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_off.vvd b/models/alig96/perks/speed/speed_off.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_off.vvd rename to models/alig96/perks/speed/speed_off.vvd diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx80.vtx b/models/alig96/perks/speed/speed_on.dx80.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_on.dx80.vtx rename to models/alig96/perks/speed/speed_on.dx80.vtx diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.dx90.vtx b/models/alig96/perks/speed/speed_on.dx90.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_on.dx90.vtx rename to models/alig96/perks/speed/speed_on.dx90.vtx diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.mdl b/models/alig96/perks/speed/speed_on.mdl similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_on.mdl rename to models/alig96/perks/speed/speed_on.mdl diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.phy b/models/alig96/perks/speed/speed_on.phy similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_on.phy rename to models/alig96/perks/speed/speed_on.phy diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.sw.vtx b/models/alig96/perks/speed/speed_on.sw.vtx similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_on.sw.vtx rename to models/alig96/perks/speed/speed_on.sw.vtx diff --git a/nzombies3/content/models/alig96/perks/sleight/sleight_on.vvd b/models/alig96/perks/speed/speed_on.vvd similarity index 100% rename from nzombies3/content/models/alig96/perks/sleight/sleight_on.vvd rename to models/alig96/perks/speed/speed_on.vvd diff --git a/models/alig96/perks/staminup/staminup.dx80.vtx b/models/alig96/perks/staminup/staminup.dx80.vtx new file mode 100644 index 00000000..8f95258c Binary files /dev/null and b/models/alig96/perks/staminup/staminup.dx80.vtx differ diff --git a/models/alig96/perks/staminup/staminup.dx90.vtx b/models/alig96/perks/staminup/staminup.dx90.vtx new file mode 100644 index 00000000..d252f02d Binary files /dev/null and b/models/alig96/perks/staminup/staminup.dx90.vtx differ diff --git a/models/alig96/perks/staminup/staminup.mdl b/models/alig96/perks/staminup/staminup.mdl new file mode 100644 index 00000000..0335c5e4 Binary files /dev/null and b/models/alig96/perks/staminup/staminup.mdl differ diff --git a/models/alig96/perks/staminup/staminup.phy b/models/alig96/perks/staminup/staminup.phy new file mode 100644 index 00000000..ed5aec3b Binary files /dev/null and b/models/alig96/perks/staminup/staminup.phy differ diff --git a/models/alig96/perks/staminup/staminup.sw.vtx b/models/alig96/perks/staminup/staminup.sw.vtx new file mode 100644 index 00000000..15bf90b3 Binary files /dev/null and b/models/alig96/perks/staminup/staminup.sw.vtx differ diff --git a/models/alig96/perks/staminup/staminup.vvd b/models/alig96/perks/staminup/staminup.vvd new file mode 100644 index 00000000..9b69330f Binary files /dev/null and b/models/alig96/perks/staminup/staminup.vvd differ diff --git a/models/alig96/perks/staminup/staminup_off.dx80.vtx b/models/alig96/perks/staminup/staminup_off.dx80.vtx new file mode 100644 index 00000000..58fdacb0 Binary files /dev/null and b/models/alig96/perks/staminup/staminup_off.dx80.vtx differ diff --git a/models/alig96/perks/staminup/staminup_off.dx90.vtx b/models/alig96/perks/staminup/staminup_off.dx90.vtx new file mode 100644 index 00000000..e3e9c0e0 Binary files /dev/null and b/models/alig96/perks/staminup/staminup_off.dx90.vtx differ diff --git a/models/alig96/perks/staminup/staminup_off.mdl b/models/alig96/perks/staminup/staminup_off.mdl new file mode 100644 index 00000000..6b1ee454 Binary files /dev/null and b/models/alig96/perks/staminup/staminup_off.mdl differ diff --git a/models/alig96/perks/staminup/staminup_off.phy b/models/alig96/perks/staminup/staminup_off.phy new file mode 100644 index 00000000..89630383 Binary files /dev/null and b/models/alig96/perks/staminup/staminup_off.phy differ diff --git a/models/alig96/perks/staminup/staminup_off.sw.vtx b/models/alig96/perks/staminup/staminup_off.sw.vtx new file mode 100644 index 00000000..6c083463 Binary files /dev/null and b/models/alig96/perks/staminup/staminup_off.sw.vtx differ diff --git a/models/alig96/perks/staminup/staminup_off.vvd b/models/alig96/perks/staminup/staminup_off.vvd new file mode 100644 index 00000000..b75a06e0 Binary files /dev/null and b/models/alig96/perks/staminup/staminup_off.vvd differ diff --git a/models/alig96/perks/tombstone/tombstone.dx80.vtx b/models/alig96/perks/tombstone/tombstone.dx80.vtx new file mode 100644 index 00000000..f8de2213 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone.dx80.vtx differ diff --git a/models/alig96/perks/tombstone/tombstone.dx90.vtx b/models/alig96/perks/tombstone/tombstone.dx90.vtx new file mode 100644 index 00000000..373a5d49 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone.dx90.vtx differ diff --git a/models/alig96/perks/tombstone/tombstone.mdl b/models/alig96/perks/tombstone/tombstone.mdl new file mode 100644 index 00000000..d1b6d761 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone.mdl differ diff --git a/models/alig96/perks/tombstone/tombstone.phy b/models/alig96/perks/tombstone/tombstone.phy new file mode 100644 index 00000000..8cdeae27 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone.phy differ diff --git a/models/alig96/perks/tombstone/tombstone.sw.vtx b/models/alig96/perks/tombstone/tombstone.sw.vtx new file mode 100644 index 00000000..9079822b Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone.sw.vtx differ diff --git a/models/alig96/perks/tombstone/tombstone.vvd b/models/alig96/perks/tombstone/tombstone.vvd new file mode 100644 index 00000000..04fd97e2 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone.vvd differ diff --git a/models/alig96/perks/tombstone/tombstone_off.dx80.vtx b/models/alig96/perks/tombstone/tombstone_off.dx80.vtx new file mode 100644 index 00000000..3bdf2f84 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone_off.dx80.vtx differ diff --git a/models/alig96/perks/tombstone/tombstone_off.dx90.vtx b/models/alig96/perks/tombstone/tombstone_off.dx90.vtx new file mode 100644 index 00000000..f6bdf363 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone_off.dx90.vtx differ diff --git a/models/alig96/perks/tombstone/tombstone_off.mdl b/models/alig96/perks/tombstone/tombstone_off.mdl new file mode 100644 index 00000000..546ae98f Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone_off.mdl differ diff --git a/models/alig96/perks/tombstone/tombstone_off.phy b/models/alig96/perks/tombstone/tombstone_off.phy new file mode 100644 index 00000000..7041edd9 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone_off.phy differ diff --git a/models/alig96/perks/tombstone/tombstone_off.sw.vtx b/models/alig96/perks/tombstone/tombstone_off.sw.vtx new file mode 100644 index 00000000..70b3bc95 Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone_off.sw.vtx differ diff --git a/models/alig96/perks/tombstone/tombstone_off.vvd b/models/alig96/perks/tombstone/tombstone_off.vvd new file mode 100644 index 00000000..0711d21c Binary files /dev/null and b/models/alig96/perks/tombstone/tombstone_off.vvd differ diff --git a/models/alig96/perks/vulture/vultureaid.dx80.vtx b/models/alig96/perks/vulture/vultureaid.dx80.vtx new file mode 100644 index 00000000..94494bdb Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid.dx80.vtx differ diff --git a/models/alig96/perks/vulture/vultureaid.dx90.vtx b/models/alig96/perks/vulture/vultureaid.dx90.vtx new file mode 100644 index 00000000..8090fbdd Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid.dx90.vtx differ diff --git a/models/alig96/perks/vulture/vultureaid.mdl b/models/alig96/perks/vulture/vultureaid.mdl new file mode 100644 index 00000000..03682331 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid.mdl differ diff --git a/models/alig96/perks/vulture/vultureaid.phy b/models/alig96/perks/vulture/vultureaid.phy new file mode 100644 index 00000000..edc067b7 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid.phy differ diff --git a/models/alig96/perks/vulture/vultureaid.sw.vtx b/models/alig96/perks/vulture/vultureaid.sw.vtx new file mode 100644 index 00000000..39461aab Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid.sw.vtx differ diff --git a/models/alig96/perks/vulture/vultureaid.vvd b/models/alig96/perks/vulture/vultureaid.vvd new file mode 100644 index 00000000..5c130db9 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid.vvd differ diff --git a/models/alig96/perks/vulture/vultureaid_off.dx80.vtx b/models/alig96/perks/vulture/vultureaid_off.dx80.vtx new file mode 100644 index 00000000..f1f5d421 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid_off.dx80.vtx differ diff --git a/models/alig96/perks/vulture/vultureaid_off.dx90.vtx b/models/alig96/perks/vulture/vultureaid_off.dx90.vtx new file mode 100644 index 00000000..2b0735e5 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid_off.dx90.vtx differ diff --git a/models/alig96/perks/vulture/vultureaid_off.mdl b/models/alig96/perks/vulture/vultureaid_off.mdl new file mode 100644 index 00000000..cc62822b Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid_off.mdl differ diff --git a/models/alig96/perks/vulture/vultureaid_off.phy b/models/alig96/perks/vulture/vultureaid_off.phy new file mode 100644 index 00000000..41c1cd83 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid_off.phy differ diff --git a/models/alig96/perks/vulture/vultureaid_off.sw.vtx b/models/alig96/perks/vulture/vultureaid_off.sw.vtx new file mode 100644 index 00000000..0adf00bb Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid_off.sw.vtx differ diff --git a/models/alig96/perks/vulture/vultureaid_off.vvd b/models/alig96/perks/vulture/vultureaid_off.vvd new file mode 100644 index 00000000..5b667771 Binary files /dev/null and b/models/alig96/perks/vulture/vultureaid_off.vvd differ diff --git a/models/alig96/perks/whoswho/whoswho.dx80.vtx b/models/alig96/perks/whoswho/whoswho.dx80.vtx new file mode 100644 index 00000000..37c1ef24 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho.dx80.vtx differ diff --git a/models/alig96/perks/whoswho/whoswho.dx90.vtx b/models/alig96/perks/whoswho/whoswho.dx90.vtx new file mode 100644 index 00000000..0aed826c Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho.dx90.vtx differ diff --git a/models/alig96/perks/whoswho/whoswho.mdl b/models/alig96/perks/whoswho/whoswho.mdl new file mode 100644 index 00000000..4e8e11e4 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho.mdl differ diff --git a/models/alig96/perks/whoswho/whoswho.phy b/models/alig96/perks/whoswho/whoswho.phy new file mode 100644 index 00000000..f5619312 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho.phy differ diff --git a/models/alig96/perks/whoswho/whoswho.sw.vtx b/models/alig96/perks/whoswho/whoswho.sw.vtx new file mode 100644 index 00000000..a70ea2d3 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho.sw.vtx differ diff --git a/models/alig96/perks/whoswho/whoswho.vvd b/models/alig96/perks/whoswho/whoswho.vvd new file mode 100644 index 00000000..898abd67 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho.vvd differ diff --git a/models/alig96/perks/whoswho/whoswho_off.dx80.vtx b/models/alig96/perks/whoswho/whoswho_off.dx80.vtx new file mode 100644 index 00000000..09d323ad Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho_off.dx80.vtx differ diff --git a/models/alig96/perks/whoswho/whoswho_off.dx90.vtx b/models/alig96/perks/whoswho/whoswho_off.dx90.vtx new file mode 100644 index 00000000..e6634e48 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho_off.dx90.vtx differ diff --git a/models/alig96/perks/whoswho/whoswho_off.mdl b/models/alig96/perks/whoswho/whoswho_off.mdl new file mode 100644 index 00000000..a856e4f7 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho_off.mdl differ diff --git a/models/alig96/perks/whoswho/whoswho_off.phy b/models/alig96/perks/whoswho/whoswho_off.phy new file mode 100644 index 00000000..e1f8b4d8 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho_off.phy differ diff --git a/models/alig96/perks/whoswho/whoswho_off.sw.vtx b/models/alig96/perks/whoswho/whoswho_off.sw.vtx new file mode 100644 index 00000000..de00e7cd Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho_off.sw.vtx differ diff --git a/models/alig96/perks/whoswho/whoswho_off.vvd b/models/alig96/perks/whoswho/whoswho_off.vvd new file mode 100644 index 00000000..0e615b58 Binary files /dev/null and b/models/alig96/perks/whoswho/whoswho_off.vvd differ diff --git a/models/alig96/perks/wunderfizz/nz_wunderfizz.dx80.vtx b/models/alig96/perks/wunderfizz/nz_wunderfizz.dx80.vtx new file mode 100644 index 00000000..1117cb61 Binary files /dev/null and b/models/alig96/perks/wunderfizz/nz_wunderfizz.dx80.vtx differ diff --git a/models/alig96/perks/wunderfizz/nz_wunderfizz.dx90.vtx b/models/alig96/perks/wunderfizz/nz_wunderfizz.dx90.vtx new file mode 100644 index 00000000..a096b5fa Binary files /dev/null and b/models/alig96/perks/wunderfizz/nz_wunderfizz.dx90.vtx differ diff --git a/models/alig96/perks/wunderfizz/nz_wunderfizz.mdl b/models/alig96/perks/wunderfizz/nz_wunderfizz.mdl new file mode 100644 index 00000000..0ebd6609 Binary files /dev/null and b/models/alig96/perks/wunderfizz/nz_wunderfizz.mdl differ diff --git a/models/alig96/perks/wunderfizz/nz_wunderfizz.phy b/models/alig96/perks/wunderfizz/nz_wunderfizz.phy new file mode 100644 index 00000000..ca497be7 Binary files /dev/null and b/models/alig96/perks/wunderfizz/nz_wunderfizz.phy differ diff --git a/models/alig96/perks/wunderfizz/nz_wunderfizz.sw.vtx b/models/alig96/perks/wunderfizz/nz_wunderfizz.sw.vtx new file mode 100644 index 00000000..7f2884a7 Binary files /dev/null and b/models/alig96/perks/wunderfizz/nz_wunderfizz.sw.vtx differ diff --git a/models/alig96/perks/wunderfizz/nz_wunderfizz.vvd b/models/alig96/perks/wunderfizz/nz_wunderfizz.vvd new file mode 100644 index 00000000..344b2f33 Binary files /dev/null and b/models/alig96/perks/wunderfizz/nz_wunderfizz.vvd differ diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.dx80.vtx b/models/hoff/props/mysterybox/box.dx80.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box.dx80.vtx rename to models/hoff/props/mysterybox/box.dx80.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.dx90.vtx b/models/hoff/props/mysterybox/box.dx90.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box.dx90.vtx rename to models/hoff/props/mysterybox/box.dx90.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.mdl b/models/hoff/props/mysterybox/box.mdl similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box.mdl rename to models/hoff/props/mysterybox/box.mdl diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.phy b/models/hoff/props/mysterybox/box.phy similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box.phy rename to models/hoff/props/mysterybox/box.phy diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.sw.vtx b/models/hoff/props/mysterybox/box.sw.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box.sw.vtx rename to models/hoff/props/mysterybox/box.sw.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box.vvd b/models/hoff/props/mysterybox/box.vvd similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box.vvd rename to models/hoff/props/mysterybox/box.vvd diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.dx80.vtx b/models/hoff/props/mysterybox/box1.dx80.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box1.dx80.vtx rename to models/hoff/props/mysterybox/box1.dx80.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.dx90.vtx b/models/hoff/props/mysterybox/box1.dx90.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box1.dx90.vtx rename to models/hoff/props/mysterybox/box1.dx90.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.mdl b/models/hoff/props/mysterybox/box1.mdl similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box1.mdl rename to models/hoff/props/mysterybox/box1.mdl diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.phy b/models/hoff/props/mysterybox/box1.phy similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box1.phy rename to models/hoff/props/mysterybox/box1.phy diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.sw.vtx b/models/hoff/props/mysterybox/box1.sw.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box1.sw.vtx rename to models/hoff/props/mysterybox/box1.sw.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box1.vvd b/models/hoff/props/mysterybox/box1.vvd similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box1.vvd rename to models/hoff/props/mysterybox/box1.vvd diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.dx80.vtx b/models/hoff/props/mysterybox/box2.dx80.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box2.dx80.vtx rename to models/hoff/props/mysterybox/box2.dx80.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.dx90.vtx b/models/hoff/props/mysterybox/box2.dx90.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box2.dx90.vtx rename to models/hoff/props/mysterybox/box2.dx90.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.mdl b/models/hoff/props/mysterybox/box2.mdl similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box2.mdl rename to models/hoff/props/mysterybox/box2.mdl diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.sw.vtx b/models/hoff/props/mysterybox/box2.sw.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box2.sw.vtx rename to models/hoff/props/mysterybox/box2.sw.vtx diff --git a/nzombies3/content/models/hoff/props/mysterybox/box2.vvd b/models/hoff/props/mysterybox/box2.vvd similarity index 100% rename from nzombies3/content/models/hoff/props/mysterybox/box2.vvd rename to models/hoff/props/mysterybox/box2.vvd diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx80.vtx b/models/hoff/props/teddy_bear/teddy_bear.dx80.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx80.vtx rename to models/hoff/props/teddy_bear/teddy_bear.dx80.vtx diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx90.vtx b/models/hoff/props/teddy_bear/teddy_bear.dx90.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.dx90.vtx rename to models/hoff/props/teddy_bear/teddy_bear.dx90.vtx diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.mdl b/models/hoff/props/teddy_bear/teddy_bear.mdl similarity index 100% rename from nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.mdl rename to models/hoff/props/teddy_bear/teddy_bear.mdl diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.phy b/models/hoff/props/teddy_bear/teddy_bear.phy similarity index 100% rename from nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.phy rename to models/hoff/props/teddy_bear/teddy_bear.phy diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.sw.vtx b/models/hoff/props/teddy_bear/teddy_bear.sw.vtx similarity index 100% rename from nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.sw.vtx rename to models/hoff/props/teddy_bear/teddy_bear.sw.vtx diff --git a/nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.vvd b/models/hoff/props/teddy_bear/teddy_bear.vvd similarity index 100% rename from nzombies3/content/models/hoff/props/teddy_bear/teddy_bear.vvd rename to models/hoff/props/teddy_bear/teddy_bear.vvd diff --git a/models/nz_zombie/panzer_claw.dx80.vtx b/models/nz_zombie/panzer_claw.dx80.vtx new file mode 100644 index 00000000..0465014d Binary files /dev/null and b/models/nz_zombie/panzer_claw.dx80.vtx differ diff --git a/models/nz_zombie/panzer_claw.dx90.vtx b/models/nz_zombie/panzer_claw.dx90.vtx new file mode 100644 index 00000000..7c8ed334 Binary files /dev/null and b/models/nz_zombie/panzer_claw.dx90.vtx differ diff --git a/models/nz_zombie/panzer_claw.mdl b/models/nz_zombie/panzer_claw.mdl new file mode 100644 index 00000000..b6b3e67b Binary files /dev/null and b/models/nz_zombie/panzer_claw.mdl differ diff --git a/models/nz_zombie/panzer_claw.sw.vtx b/models/nz_zombie/panzer_claw.sw.vtx new file mode 100644 index 00000000..2bea376b Binary files /dev/null and b/models/nz_zombie/panzer_claw.sw.vtx differ diff --git a/models/nz_zombie/panzer_claw.vvd b/models/nz_zombie/panzer_claw.vvd new file mode 100644 index 00000000..fe443d77 Binary files /dev/null and b/models/nz_zombie/panzer_claw.vvd differ diff --git a/models/nz_zombie/zombie_hellhound.dx80.vtx b/models/nz_zombie/zombie_hellhound.dx80.vtx new file mode 100644 index 00000000..7288fbaa Binary files /dev/null and b/models/nz_zombie/zombie_hellhound.dx80.vtx differ diff --git a/models/nz_zombie/zombie_hellhound.dx90.vtx b/models/nz_zombie/zombie_hellhound.dx90.vtx new file mode 100644 index 00000000..c1e4916d Binary files /dev/null and b/models/nz_zombie/zombie_hellhound.dx90.vtx differ diff --git a/models/nz_zombie/zombie_hellhound.mdl b/models/nz_zombie/zombie_hellhound.mdl new file mode 100644 index 00000000..7d76a89b Binary files /dev/null and b/models/nz_zombie/zombie_hellhound.mdl differ diff --git a/models/nz_zombie/zombie_hellhound.phy b/models/nz_zombie/zombie_hellhound.phy new file mode 100644 index 00000000..6c8c4322 Binary files /dev/null and b/models/nz_zombie/zombie_hellhound.phy differ diff --git a/models/nz_zombie/zombie_hellhound.sw.vtx b/models/nz_zombie/zombie_hellhound.sw.vtx new file mode 100644 index 00000000..8afe4d5c Binary files /dev/null and b/models/nz_zombie/zombie_hellhound.sw.vtx differ diff --git a/models/nz_zombie/zombie_hellhound.vvd b/models/nz_zombie/zombie_hellhound.vvd new file mode 100644 index 00000000..d8ec0eb5 Binary files /dev/null and b/models/nz_zombie/zombie_hellhound.vvd differ diff --git a/models/nz_zombie/zombie_panzersoldat.dx80.vtx b/models/nz_zombie/zombie_panzersoldat.dx80.vtx new file mode 100644 index 00000000..c0a667e1 Binary files /dev/null and b/models/nz_zombie/zombie_panzersoldat.dx80.vtx differ diff --git a/models/nz_zombie/zombie_panzersoldat.dx90.vtx b/models/nz_zombie/zombie_panzersoldat.dx90.vtx new file mode 100644 index 00000000..f54a76f6 Binary files /dev/null and b/models/nz_zombie/zombie_panzersoldat.dx90.vtx differ diff --git a/models/nz_zombie/zombie_panzersoldat.mdl b/models/nz_zombie/zombie_panzersoldat.mdl new file mode 100644 index 00000000..2a07e457 Binary files /dev/null and b/models/nz_zombie/zombie_panzersoldat.mdl differ diff --git a/models/nz_zombie/zombie_panzersoldat.phy b/models/nz_zombie/zombie_panzersoldat.phy new file mode 100644 index 00000000..260d865a Binary files /dev/null and b/models/nz_zombie/zombie_panzersoldat.phy differ diff --git a/models/nz_zombie/zombie_panzersoldat.sw.vtx b/models/nz_zombie/zombie_panzersoldat.sw.vtx new file mode 100644 index 00000000..daed35ab Binary files /dev/null and b/models/nz_zombie/zombie_panzersoldat.sw.vtx differ diff --git a/models/nz_zombie/zombie_panzersoldat.vvd b/models/nz_zombie/zombie_panzersoldat.vvd new file mode 100644 index 00000000..4a02fdd6 Binary files /dev/null and b/models/nz_zombie/zombie_panzersoldat.vvd differ diff --git a/models/nz_zombie/zombie_rerig_animated.dx80.vtx b/models/nz_zombie/zombie_rerig_animated.dx80.vtx new file mode 100644 index 00000000..cefb45ad Binary files /dev/null and b/models/nz_zombie/zombie_rerig_animated.dx80.vtx differ diff --git a/models/nz_zombie/zombie_rerig_animated.dx90.vtx b/models/nz_zombie/zombie_rerig_animated.dx90.vtx new file mode 100644 index 00000000..b955becd Binary files /dev/null and b/models/nz_zombie/zombie_rerig_animated.dx90.vtx differ diff --git a/models/nz_zombie/zombie_rerig_animated.mdl b/models/nz_zombie/zombie_rerig_animated.mdl new file mode 100644 index 00000000..6a4a2b3f Binary files /dev/null and b/models/nz_zombie/zombie_rerig_animated.mdl differ diff --git a/models/nz_zombie/zombie_rerig_animated.phy b/models/nz_zombie/zombie_rerig_animated.phy new file mode 100644 index 00000000..ddc4e0fa Binary files /dev/null and b/models/nz_zombie/zombie_rerig_animated.phy differ diff --git a/models/nz_zombie/zombie_rerig_animated.sw.vtx b/models/nz_zombie/zombie_rerig_animated.sw.vtx new file mode 100644 index 00000000..7a663897 Binary files /dev/null and b/models/nz_zombie/zombie_rerig_animated.sw.vtx differ diff --git a/models/nz_zombie/zombie_rerig_animated.vvd b/models/nz_zombie/zombie_rerig_animated.vvd new file mode 100644 index 00000000..247208e0 Binary files /dev/null and b/models/nz_zombie/zombie_rerig_animated.vvd differ diff --git a/models/nzpowerups/bloodmoney.dx80.vtx b/models/nzpowerups/bloodmoney.dx80.vtx new file mode 100644 index 00000000..1f66d462 Binary files /dev/null and b/models/nzpowerups/bloodmoney.dx80.vtx differ diff --git a/models/nzpowerups/bloodmoney.dx90.vtx b/models/nzpowerups/bloodmoney.dx90.vtx new file mode 100644 index 00000000..ed0694e3 Binary files /dev/null and b/models/nzpowerups/bloodmoney.dx90.vtx differ diff --git a/models/nzpowerups/bloodmoney.mdl b/models/nzpowerups/bloodmoney.mdl new file mode 100644 index 00000000..0160e750 Binary files /dev/null and b/models/nzpowerups/bloodmoney.mdl differ diff --git a/models/nzpowerups/bloodmoney.phy b/models/nzpowerups/bloodmoney.phy new file mode 100644 index 00000000..516efa74 Binary files /dev/null and b/models/nzpowerups/bloodmoney.phy differ diff --git a/models/nzpowerups/bloodmoney.sw.vtx b/models/nzpowerups/bloodmoney.sw.vtx new file mode 100644 index 00000000..fe7385f5 Binary files /dev/null and b/models/nzpowerups/bloodmoney.sw.vtx differ diff --git a/models/nzpowerups/bloodmoney.vvd b/models/nzpowerups/bloodmoney.vvd new file mode 100644 index 00000000..ebdf4799 Binary files /dev/null and b/models/nzpowerups/bloodmoney.vvd differ diff --git a/models/nzpowerups/carpenter.dx80.vtx b/models/nzpowerups/carpenter.dx80.vtx new file mode 100644 index 00000000..47d01529 Binary files /dev/null and b/models/nzpowerups/carpenter.dx80.vtx differ diff --git a/models/nzpowerups/carpenter.dx90.vtx b/models/nzpowerups/carpenter.dx90.vtx new file mode 100644 index 00000000..27f2cee6 Binary files /dev/null and b/models/nzpowerups/carpenter.dx90.vtx differ diff --git a/models/nzpowerups/carpenter.mdl b/models/nzpowerups/carpenter.mdl new file mode 100644 index 00000000..0209ea16 Binary files /dev/null and b/models/nzpowerups/carpenter.mdl differ diff --git a/models/nzpowerups/carpenter.phy b/models/nzpowerups/carpenter.phy new file mode 100644 index 00000000..cfebae3a Binary files /dev/null and b/models/nzpowerups/carpenter.phy differ diff --git a/models/nzpowerups/carpenter.sw.vtx b/models/nzpowerups/carpenter.sw.vtx new file mode 100644 index 00000000..2f052b14 Binary files /dev/null and b/models/nzpowerups/carpenter.sw.vtx differ diff --git a/models/nzpowerups/carpenter.vvd b/models/nzpowerups/carpenter.vvd new file mode 100644 index 00000000..fcc5cd76 Binary files /dev/null and b/models/nzpowerups/carpenter.vvd differ diff --git a/models/nzpowerups/firesale.dx80.vtx b/models/nzpowerups/firesale.dx80.vtx new file mode 100644 index 00000000..daf7927f Binary files /dev/null and b/models/nzpowerups/firesale.dx80.vtx differ diff --git a/models/nzpowerups/firesale.dx90.vtx b/models/nzpowerups/firesale.dx90.vtx new file mode 100644 index 00000000..dbe79242 Binary files /dev/null and b/models/nzpowerups/firesale.dx90.vtx differ diff --git a/models/nzpowerups/firesale.mdl b/models/nzpowerups/firesale.mdl new file mode 100644 index 00000000..9735fbb4 Binary files /dev/null and b/models/nzpowerups/firesale.mdl differ diff --git a/models/nzpowerups/firesale.phy b/models/nzpowerups/firesale.phy new file mode 100644 index 00000000..32796393 Binary files /dev/null and b/models/nzpowerups/firesale.phy differ diff --git a/models/nzpowerups/firesale.sw.vtx b/models/nzpowerups/firesale.sw.vtx new file mode 100644 index 00000000..6aaa2a53 Binary files /dev/null and b/models/nzpowerups/firesale.sw.vtx differ diff --git a/models/nzpowerups/firesale.vvd b/models/nzpowerups/firesale.vvd new file mode 100644 index 00000000..1c47eff1 Binary files /dev/null and b/models/nzpowerups/firesale.vvd differ diff --git a/models/nzpowerups/insta.dx80.vtx b/models/nzpowerups/insta.dx80.vtx new file mode 100644 index 00000000..1146906c Binary files /dev/null and b/models/nzpowerups/insta.dx80.vtx differ diff --git a/models/nzpowerups/insta.dx90.vtx b/models/nzpowerups/insta.dx90.vtx new file mode 100644 index 00000000..0878be3a Binary files /dev/null and b/models/nzpowerups/insta.dx90.vtx differ diff --git a/models/nzpowerups/insta.mdl b/models/nzpowerups/insta.mdl new file mode 100644 index 00000000..9ffb2bcd Binary files /dev/null and b/models/nzpowerups/insta.mdl differ diff --git a/models/nzpowerups/insta.phy b/models/nzpowerups/insta.phy new file mode 100644 index 00000000..a27a95e7 Binary files /dev/null and b/models/nzpowerups/insta.phy differ diff --git a/models/nzpowerups/insta.sw.vtx b/models/nzpowerups/insta.sw.vtx new file mode 100644 index 00000000..2474f36b Binary files /dev/null and b/models/nzpowerups/insta.sw.vtx differ diff --git a/models/nzpowerups/insta.vvd b/models/nzpowerups/insta.vvd new file mode 100644 index 00000000..ad478a93 Binary files /dev/null and b/models/nzpowerups/insta.vvd differ diff --git a/models/nzpowerups/nuke.dx80.vtx b/models/nzpowerups/nuke.dx80.vtx new file mode 100644 index 00000000..fe848e1f Binary files /dev/null and b/models/nzpowerups/nuke.dx80.vtx differ diff --git a/models/nzpowerups/nuke.dx90.vtx b/models/nzpowerups/nuke.dx90.vtx new file mode 100644 index 00000000..cb9cea8e Binary files /dev/null and b/models/nzpowerups/nuke.dx90.vtx differ diff --git a/models/nzpowerups/nuke.mdl b/models/nzpowerups/nuke.mdl new file mode 100644 index 00000000..395ba269 Binary files /dev/null and b/models/nzpowerups/nuke.mdl differ diff --git a/models/nzpowerups/nuke.phy b/models/nzpowerups/nuke.phy new file mode 100644 index 00000000..149bccff Binary files /dev/null and b/models/nzpowerups/nuke.phy differ diff --git a/models/nzpowerups/nuke.sw.vtx b/models/nzpowerups/nuke.sw.vtx new file mode 100644 index 00000000..cbf749df Binary files /dev/null and b/models/nzpowerups/nuke.sw.vtx differ diff --git a/models/nzpowerups/nuke.vvd b/models/nzpowerups/nuke.vvd new file mode 100644 index 00000000..43c17148 Binary files /dev/null and b/models/nzpowerups/nuke.vvd differ diff --git a/models/nzpowerups/x2.dx80.vtx b/models/nzpowerups/x2.dx80.vtx new file mode 100644 index 00000000..55fcead9 Binary files /dev/null and b/models/nzpowerups/x2.dx80.vtx differ diff --git a/models/nzpowerups/x2.dx90.vtx b/models/nzpowerups/x2.dx90.vtx new file mode 100644 index 00000000..b105ea91 Binary files /dev/null and b/models/nzpowerups/x2.dx90.vtx differ diff --git a/models/nzpowerups/x2.mdl b/models/nzpowerups/x2.mdl new file mode 100644 index 00000000..38811225 Binary files /dev/null and b/models/nzpowerups/x2.mdl differ diff --git a/models/nzpowerups/x2.phy b/models/nzpowerups/x2.phy new file mode 100644 index 00000000..196b2d91 Binary files /dev/null and b/models/nzpowerups/x2.phy differ diff --git a/models/nzpowerups/x2.sw.vtx b/models/nzpowerups/x2.sw.vtx new file mode 100644 index 00000000..5efec9b2 Binary files /dev/null and b/models/nzpowerups/x2.sw.vtx differ diff --git a/models/nzpowerups/x2.vvd b/models/nzpowerups/x2.vvd new file mode 100644 index 00000000..62adb713 Binary files /dev/null and b/models/nzpowerups/x2.vvd differ diff --git a/models/nzpowerups/zombieblood.dx80.vtx b/models/nzpowerups/zombieblood.dx80.vtx new file mode 100644 index 00000000..9894e5d7 Binary files /dev/null and b/models/nzpowerups/zombieblood.dx80.vtx differ diff --git a/models/nzpowerups/zombieblood.dx90.vtx b/models/nzpowerups/zombieblood.dx90.vtx new file mode 100644 index 00000000..5cde91b5 Binary files /dev/null and b/models/nzpowerups/zombieblood.dx90.vtx differ diff --git a/models/nzpowerups/zombieblood.mdl b/models/nzpowerups/zombieblood.mdl new file mode 100644 index 00000000..9590bd39 Binary files /dev/null and b/models/nzpowerups/zombieblood.mdl differ diff --git a/models/nzpowerups/zombieblood.phy b/models/nzpowerups/zombieblood.phy new file mode 100644 index 00000000..ba65e05f Binary files /dev/null and b/models/nzpowerups/zombieblood.phy differ diff --git a/models/nzpowerups/zombieblood.sw.vtx b/models/nzpowerups/zombieblood.sw.vtx new file mode 100644 index 00000000..a82a150b Binary files /dev/null and b/models/nzpowerups/zombieblood.sw.vtx differ diff --git a/models/nzpowerups/zombieblood.vvd b/models/nzpowerups/zombieblood.vvd new file mode 100644 index 00000000..d87ccc3f Binary files /dev/null and b/models/nzpowerups/zombieblood.vvd differ diff --git a/models/nzprops/monkey_bomb.dx80.vtx b/models/nzprops/monkey_bomb.dx80.vtx new file mode 100644 index 00000000..85122b67 Binary files /dev/null and b/models/nzprops/monkey_bomb.dx80.vtx differ diff --git a/models/nzprops/monkey_bomb.dx90.vtx b/models/nzprops/monkey_bomb.dx90.vtx new file mode 100644 index 00000000..560b2f5e Binary files /dev/null and b/models/nzprops/monkey_bomb.dx90.vtx differ diff --git a/models/nzprops/monkey_bomb.mdl b/models/nzprops/monkey_bomb.mdl new file mode 100644 index 00000000..246d8dee Binary files /dev/null and b/models/nzprops/monkey_bomb.mdl differ diff --git a/models/nzprops/monkey_bomb.sw.vtx b/models/nzprops/monkey_bomb.sw.vtx new file mode 100644 index 00000000..694edc62 Binary files /dev/null and b/models/nzprops/monkey_bomb.sw.vtx differ diff --git a/models/nzprops/monkey_bomb.vvd b/models/nzprops/monkey_bomb.vvd new file mode 100644 index 00000000..693174a1 Binary files /dev/null and b/models/nzprops/monkey_bomb.vvd differ diff --git a/models/nzprops/origins/barbwire_blockade.dx80.vtx b/models/nzprops/origins/barbwire_blockade.dx80.vtx new file mode 100644 index 00000000..65835707 Binary files /dev/null and b/models/nzprops/origins/barbwire_blockade.dx80.vtx differ diff --git a/models/nzprops/origins/barbwire_blockade.dx90.vtx b/models/nzprops/origins/barbwire_blockade.dx90.vtx new file mode 100644 index 00000000..f79795b7 Binary files /dev/null and b/models/nzprops/origins/barbwire_blockade.dx90.vtx differ diff --git a/models/nzprops/origins/barbwire_blockade.mdl b/models/nzprops/origins/barbwire_blockade.mdl new file mode 100644 index 00000000..bfff02bd Binary files /dev/null and b/models/nzprops/origins/barbwire_blockade.mdl differ diff --git a/models/nzprops/origins/barbwire_blockade.phy b/models/nzprops/origins/barbwire_blockade.phy new file mode 100644 index 00000000..7b224465 Binary files /dev/null and b/models/nzprops/origins/barbwire_blockade.phy differ diff --git a/models/nzprops/origins/barbwire_blockade.sw.vtx b/models/nzprops/origins/barbwire_blockade.sw.vtx new file mode 100644 index 00000000..4bc2cbc0 Binary files /dev/null and b/models/nzprops/origins/barbwire_blockade.sw.vtx differ diff --git a/models/nzprops/origins/barbwire_blockade.vvd b/models/nzprops/origins/barbwire_blockade.vvd new file mode 100644 index 00000000..22a74f97 Binary files /dev/null and b/models/nzprops/origins/barbwire_blockade.vvd differ diff --git a/models/nzprops/origins/barbwire_gate.dx80.vtx b/models/nzprops/origins/barbwire_gate.dx80.vtx new file mode 100644 index 00000000..bf51206c Binary files /dev/null and b/models/nzprops/origins/barbwire_gate.dx80.vtx differ diff --git a/models/nzprops/origins/barbwire_gate.dx90.vtx b/models/nzprops/origins/barbwire_gate.dx90.vtx new file mode 100644 index 00000000..09f2e54b Binary files /dev/null and b/models/nzprops/origins/barbwire_gate.dx90.vtx differ diff --git a/models/nzprops/origins/barbwire_gate.mdl b/models/nzprops/origins/barbwire_gate.mdl new file mode 100644 index 00000000..e4149ab4 Binary files /dev/null and b/models/nzprops/origins/barbwire_gate.mdl differ diff --git a/models/nzprops/origins/barbwire_gate.phy b/models/nzprops/origins/barbwire_gate.phy new file mode 100644 index 00000000..b51efbcd Binary files /dev/null and b/models/nzprops/origins/barbwire_gate.phy differ diff --git a/models/nzprops/origins/barbwire_gate.sw.vtx b/models/nzprops/origins/barbwire_gate.sw.vtx new file mode 100644 index 00000000..7b2f74ce Binary files /dev/null and b/models/nzprops/origins/barbwire_gate.sw.vtx differ diff --git a/models/nzprops/origins/barbwire_gate.vvd b/models/nzprops/origins/barbwire_gate.vvd new file mode 100644 index 00000000..335c0353 Binary files /dev/null and b/models/nzprops/origins/barbwire_gate.vvd differ diff --git a/models/nzprops/origins/barbwire_long.dx80.vtx b/models/nzprops/origins/barbwire_long.dx80.vtx new file mode 100644 index 00000000..13e7c8ad Binary files /dev/null and b/models/nzprops/origins/barbwire_long.dx80.vtx differ diff --git a/models/nzprops/origins/barbwire_long.dx90.vtx b/models/nzprops/origins/barbwire_long.dx90.vtx new file mode 100644 index 00000000..57f752ee Binary files /dev/null and b/models/nzprops/origins/barbwire_long.dx90.vtx differ diff --git a/models/nzprops/origins/barbwire_long.mdl b/models/nzprops/origins/barbwire_long.mdl new file mode 100644 index 00000000..6a14e694 Binary files /dev/null and b/models/nzprops/origins/barbwire_long.mdl differ diff --git a/models/nzprops/origins/barbwire_long.phy b/models/nzprops/origins/barbwire_long.phy new file mode 100644 index 00000000..7dd9ce49 Binary files /dev/null and b/models/nzprops/origins/barbwire_long.phy differ diff --git a/models/nzprops/origins/barbwire_long.sw.vtx b/models/nzprops/origins/barbwire_long.sw.vtx new file mode 100644 index 00000000..687775e8 Binary files /dev/null and b/models/nzprops/origins/barbwire_long.sw.vtx differ diff --git a/models/nzprops/origins/barbwire_long.vvd b/models/nzprops/origins/barbwire_long.vvd new file mode 100644 index 00000000..caa686c9 Binary files /dev/null and b/models/nzprops/origins/barbwire_long.vvd differ diff --git a/models/nzprops/origins/barbwire_tube.dx80.vtx b/models/nzprops/origins/barbwire_tube.dx80.vtx new file mode 100644 index 00000000..c2ba06a6 Binary files /dev/null and b/models/nzprops/origins/barbwire_tube.dx80.vtx differ diff --git a/models/nzprops/origins/barbwire_tube.dx90.vtx b/models/nzprops/origins/barbwire_tube.dx90.vtx new file mode 100644 index 00000000..03a37e38 Binary files /dev/null and b/models/nzprops/origins/barbwire_tube.dx90.vtx differ diff --git a/models/nzprops/origins/barbwire_tube.mdl b/models/nzprops/origins/barbwire_tube.mdl new file mode 100644 index 00000000..6462c551 Binary files /dev/null and b/models/nzprops/origins/barbwire_tube.mdl differ diff --git a/models/nzprops/origins/barbwire_tube.phy b/models/nzprops/origins/barbwire_tube.phy new file mode 100644 index 00000000..e404c182 Binary files /dev/null and b/models/nzprops/origins/barbwire_tube.phy differ diff --git a/models/nzprops/origins/barbwire_tube.sw.vtx b/models/nzprops/origins/barbwire_tube.sw.vtx new file mode 100644 index 00000000..6e0d8c5b Binary files /dev/null and b/models/nzprops/origins/barbwire_tube.sw.vtx differ diff --git a/models/nzprops/origins/barbwire_tube.vvd b/models/nzprops/origins/barbwire_tube.vvd new file mode 100644 index 00000000..eff1193e Binary files /dev/null and b/models/nzprops/origins/barbwire_tube.vvd differ diff --git a/models/nzprops/origins/originscorpse01.dx80.vtx b/models/nzprops/origins/originscorpse01.dx80.vtx new file mode 100644 index 00000000..68cd7ef3 Binary files /dev/null and b/models/nzprops/origins/originscorpse01.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse01.dx90.vtx b/models/nzprops/origins/originscorpse01.dx90.vtx new file mode 100644 index 00000000..06533e22 Binary files /dev/null and b/models/nzprops/origins/originscorpse01.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse01.mdl b/models/nzprops/origins/originscorpse01.mdl new file mode 100644 index 00000000..f80234be Binary files /dev/null and b/models/nzprops/origins/originscorpse01.mdl differ diff --git a/models/nzprops/origins/originscorpse01.phy b/models/nzprops/origins/originscorpse01.phy new file mode 100644 index 00000000..daa1cf9a Binary files /dev/null and b/models/nzprops/origins/originscorpse01.phy differ diff --git a/models/nzprops/origins/originscorpse01.sw.vtx b/models/nzprops/origins/originscorpse01.sw.vtx new file mode 100644 index 00000000..664c5f8e Binary files /dev/null and b/models/nzprops/origins/originscorpse01.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse01.vvd b/models/nzprops/origins/originscorpse01.vvd new file mode 100644 index 00000000..07f4ece2 Binary files /dev/null and b/models/nzprops/origins/originscorpse01.vvd differ diff --git a/models/nzprops/origins/originscorpse02.dx80.vtx b/models/nzprops/origins/originscorpse02.dx80.vtx new file mode 100644 index 00000000..10255a71 Binary files /dev/null and b/models/nzprops/origins/originscorpse02.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse02.dx90.vtx b/models/nzprops/origins/originscorpse02.dx90.vtx new file mode 100644 index 00000000..9b3c4075 Binary files /dev/null and b/models/nzprops/origins/originscorpse02.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse02.mdl b/models/nzprops/origins/originscorpse02.mdl new file mode 100644 index 00000000..9935e31a Binary files /dev/null and b/models/nzprops/origins/originscorpse02.mdl differ diff --git a/models/nzprops/origins/originscorpse02.phy b/models/nzprops/origins/originscorpse02.phy new file mode 100644 index 00000000..468b34a8 Binary files /dev/null and b/models/nzprops/origins/originscorpse02.phy differ diff --git a/models/nzprops/origins/originscorpse02.sw.vtx b/models/nzprops/origins/originscorpse02.sw.vtx new file mode 100644 index 00000000..eb4116e2 Binary files /dev/null and b/models/nzprops/origins/originscorpse02.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse02.vvd b/models/nzprops/origins/originscorpse02.vvd new file mode 100644 index 00000000..5f9d9767 Binary files /dev/null and b/models/nzprops/origins/originscorpse02.vvd differ diff --git a/models/nzprops/origins/originscorpse03.dx80.vtx b/models/nzprops/origins/originscorpse03.dx80.vtx new file mode 100644 index 00000000..212b7396 Binary files /dev/null and b/models/nzprops/origins/originscorpse03.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse03.dx90.vtx b/models/nzprops/origins/originscorpse03.dx90.vtx new file mode 100644 index 00000000..67421559 Binary files /dev/null and b/models/nzprops/origins/originscorpse03.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse03.mdl b/models/nzprops/origins/originscorpse03.mdl new file mode 100644 index 00000000..76dff9cc Binary files /dev/null and b/models/nzprops/origins/originscorpse03.mdl differ diff --git a/models/nzprops/origins/originscorpse03.phy b/models/nzprops/origins/originscorpse03.phy new file mode 100644 index 00000000..b53676a2 Binary files /dev/null and b/models/nzprops/origins/originscorpse03.phy differ diff --git a/models/nzprops/origins/originscorpse03.sw.vtx b/models/nzprops/origins/originscorpse03.sw.vtx new file mode 100644 index 00000000..2c663f97 Binary files /dev/null and b/models/nzprops/origins/originscorpse03.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse03.vvd b/models/nzprops/origins/originscorpse03.vvd new file mode 100644 index 00000000..f498edbf Binary files /dev/null and b/models/nzprops/origins/originscorpse03.vvd differ diff --git a/models/nzprops/origins/originscorpse04.dx80.vtx b/models/nzprops/origins/originscorpse04.dx80.vtx new file mode 100644 index 00000000..d0e4ed83 Binary files /dev/null and b/models/nzprops/origins/originscorpse04.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse04.dx90.vtx b/models/nzprops/origins/originscorpse04.dx90.vtx new file mode 100644 index 00000000..701ebf51 Binary files /dev/null and b/models/nzprops/origins/originscorpse04.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse04.mdl b/models/nzprops/origins/originscorpse04.mdl new file mode 100644 index 00000000..5a0f8592 Binary files /dev/null and b/models/nzprops/origins/originscorpse04.mdl differ diff --git a/models/nzprops/origins/originscorpse04.phy b/models/nzprops/origins/originscorpse04.phy new file mode 100644 index 00000000..57dd1d4f Binary files /dev/null and b/models/nzprops/origins/originscorpse04.phy differ diff --git a/models/nzprops/origins/originscorpse04.sw.vtx b/models/nzprops/origins/originscorpse04.sw.vtx new file mode 100644 index 00000000..8f6759ac Binary files /dev/null and b/models/nzprops/origins/originscorpse04.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse04.vvd b/models/nzprops/origins/originscorpse04.vvd new file mode 100644 index 00000000..9aeaba76 Binary files /dev/null and b/models/nzprops/origins/originscorpse04.vvd differ diff --git a/models/nzprops/origins/originscorpse04stick.dx80.vtx b/models/nzprops/origins/originscorpse04stick.dx80.vtx new file mode 100644 index 00000000..2eb2324e Binary files /dev/null and b/models/nzprops/origins/originscorpse04stick.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse04stick.dx90.vtx b/models/nzprops/origins/originscorpse04stick.dx90.vtx new file mode 100644 index 00000000..4b77ebb5 Binary files /dev/null and b/models/nzprops/origins/originscorpse04stick.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse04stick.mdl b/models/nzprops/origins/originscorpse04stick.mdl new file mode 100644 index 00000000..cfea34d4 Binary files /dev/null and b/models/nzprops/origins/originscorpse04stick.mdl differ diff --git a/models/nzprops/origins/originscorpse04stick.phy b/models/nzprops/origins/originscorpse04stick.phy new file mode 100644 index 00000000..1f15c69a Binary files /dev/null and b/models/nzprops/origins/originscorpse04stick.phy differ diff --git a/models/nzprops/origins/originscorpse04stick.sw.vtx b/models/nzprops/origins/originscorpse04stick.sw.vtx new file mode 100644 index 00000000..f4fe2deb Binary files /dev/null and b/models/nzprops/origins/originscorpse04stick.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse04stick.vvd b/models/nzprops/origins/originscorpse04stick.vvd new file mode 100644 index 00000000..d49642e1 Binary files /dev/null and b/models/nzprops/origins/originscorpse04stick.vvd differ diff --git a/models/nzprops/origins/originscorpse05.dx80.vtx b/models/nzprops/origins/originscorpse05.dx80.vtx new file mode 100644 index 00000000..9dccdee9 Binary files /dev/null and b/models/nzprops/origins/originscorpse05.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse05.dx90.vtx b/models/nzprops/origins/originscorpse05.dx90.vtx new file mode 100644 index 00000000..41f88ed4 Binary files /dev/null and b/models/nzprops/origins/originscorpse05.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse05.mdl b/models/nzprops/origins/originscorpse05.mdl new file mode 100644 index 00000000..76a33e4d Binary files /dev/null and b/models/nzprops/origins/originscorpse05.mdl differ diff --git a/models/nzprops/origins/originscorpse05.phy b/models/nzprops/origins/originscorpse05.phy new file mode 100644 index 00000000..7e24bcc9 Binary files /dev/null and b/models/nzprops/origins/originscorpse05.phy differ diff --git a/models/nzprops/origins/originscorpse05.sw.vtx b/models/nzprops/origins/originscorpse05.sw.vtx new file mode 100644 index 00000000..69af9755 Binary files /dev/null and b/models/nzprops/origins/originscorpse05.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse05.vvd b/models/nzprops/origins/originscorpse05.vvd new file mode 100644 index 00000000..710e3bc1 Binary files /dev/null and b/models/nzprops/origins/originscorpse05.vvd differ diff --git a/models/nzprops/origins/originscorpse05stick.dx80.vtx b/models/nzprops/origins/originscorpse05stick.dx80.vtx new file mode 100644 index 00000000..bc574c89 Binary files /dev/null and b/models/nzprops/origins/originscorpse05stick.dx80.vtx differ diff --git a/models/nzprops/origins/originscorpse05stick.dx90.vtx b/models/nzprops/origins/originscorpse05stick.dx90.vtx new file mode 100644 index 00000000..eb5b49d2 Binary files /dev/null and b/models/nzprops/origins/originscorpse05stick.dx90.vtx differ diff --git a/models/nzprops/origins/originscorpse05stick.mdl b/models/nzprops/origins/originscorpse05stick.mdl new file mode 100644 index 00000000..19223354 Binary files /dev/null and b/models/nzprops/origins/originscorpse05stick.mdl differ diff --git a/models/nzprops/origins/originscorpse05stick.phy b/models/nzprops/origins/originscorpse05stick.phy new file mode 100644 index 00000000..b1e7cf5f Binary files /dev/null and b/models/nzprops/origins/originscorpse05stick.phy differ diff --git a/models/nzprops/origins/originscorpse05stick.sw.vtx b/models/nzprops/origins/originscorpse05stick.sw.vtx new file mode 100644 index 00000000..d6c441b7 Binary files /dev/null and b/models/nzprops/origins/originscorpse05stick.sw.vtx differ diff --git a/models/nzprops/origins/originscorpse05stick.vvd b/models/nzprops/origins/originscorpse05stick.vvd new file mode 100644 index 00000000..85c16b63 Binary files /dev/null and b/models/nzprops/origins/originscorpse05stick.vvd differ diff --git a/models/nzprops/origins/sandbag_blockade.dx80.vtx b/models/nzprops/origins/sandbag_blockade.dx80.vtx new file mode 100644 index 00000000..bcba555c Binary files /dev/null and b/models/nzprops/origins/sandbag_blockade.dx80.vtx differ diff --git a/models/nzprops/origins/sandbag_blockade.dx90.vtx b/models/nzprops/origins/sandbag_blockade.dx90.vtx new file mode 100644 index 00000000..84781434 Binary files /dev/null and b/models/nzprops/origins/sandbag_blockade.dx90.vtx differ diff --git a/models/nzprops/origins/sandbag_blockade.mdl b/models/nzprops/origins/sandbag_blockade.mdl new file mode 100644 index 00000000..11ed5627 Binary files /dev/null and b/models/nzprops/origins/sandbag_blockade.mdl differ diff --git a/models/nzprops/origins/sandbag_blockade.phy b/models/nzprops/origins/sandbag_blockade.phy new file mode 100644 index 00000000..df1d5424 Binary files /dev/null and b/models/nzprops/origins/sandbag_blockade.phy differ diff --git a/models/nzprops/origins/sandbag_blockade.sw.vtx b/models/nzprops/origins/sandbag_blockade.sw.vtx new file mode 100644 index 00000000..8f1b820a Binary files /dev/null and b/models/nzprops/origins/sandbag_blockade.sw.vtx differ diff --git a/models/nzprops/origins/sandbag_blockade.vvd b/models/nzprops/origins/sandbag_blockade.vvd new file mode 100644 index 00000000..480a8e99 Binary files /dev/null and b/models/nzprops/origins/sandbag_blockade.vvd differ diff --git a/models/nzprops/zombies_power_lever.dx80.vtx b/models/nzprops/zombies_power_lever.dx80.vtx new file mode 100644 index 00000000..5ce37285 Binary files /dev/null and b/models/nzprops/zombies_power_lever.dx80.vtx differ diff --git a/models/nzprops/zombies_power_lever.dx90.vtx b/models/nzprops/zombies_power_lever.dx90.vtx new file mode 100644 index 00000000..7d67ef4b Binary files /dev/null and b/models/nzprops/zombies_power_lever.dx90.vtx differ diff --git a/models/nzprops/zombies_power_lever.mdl b/models/nzprops/zombies_power_lever.mdl new file mode 100644 index 00000000..02a229d4 Binary files /dev/null and b/models/nzprops/zombies_power_lever.mdl differ diff --git a/models/nzprops/zombies_power_lever.phy b/models/nzprops/zombies_power_lever.phy new file mode 100644 index 00000000..ed4f2e22 Binary files /dev/null and b/models/nzprops/zombies_power_lever.phy differ diff --git a/models/nzprops/zombies_power_lever.sw.vtx b/models/nzprops/zombies_power_lever.sw.vtx new file mode 100644 index 00000000..6d5d5150 Binary files /dev/null and b/models/nzprops/zombies_power_lever.sw.vtx differ diff --git a/models/nzprops/zombies_power_lever.vvd b/models/nzprops/zombies_power_lever.vvd new file mode 100644 index 00000000..04129cc8 Binary files /dev/null and b/models/nzprops/zombies_power_lever.vvd differ diff --git a/models/nzprops/zombies_power_lever_handle.dx80.vtx b/models/nzprops/zombies_power_lever_handle.dx80.vtx new file mode 100644 index 00000000..c88f73b4 Binary files /dev/null and b/models/nzprops/zombies_power_lever_handle.dx80.vtx differ diff --git a/models/nzprops/zombies_power_lever_handle.dx90.vtx b/models/nzprops/zombies_power_lever_handle.dx90.vtx new file mode 100644 index 00000000..4ce3eceb Binary files /dev/null and b/models/nzprops/zombies_power_lever_handle.dx90.vtx differ diff --git a/models/nzprops/zombies_power_lever_handle.mdl b/models/nzprops/zombies_power_lever_handle.mdl new file mode 100644 index 00000000..bab4b4ba Binary files /dev/null and b/models/nzprops/zombies_power_lever_handle.mdl differ diff --git a/models/nzprops/zombies_power_lever_handle.phy b/models/nzprops/zombies_power_lever_handle.phy new file mode 100644 index 00000000..1437c616 Binary files /dev/null and b/models/nzprops/zombies_power_lever_handle.phy differ diff --git a/models/nzprops/zombies_power_lever_handle.sw.vtx b/models/nzprops/zombies_power_lever_handle.sw.vtx new file mode 100644 index 00000000..bd9342c8 Binary files /dev/null and b/models/nzprops/zombies_power_lever_handle.sw.vtx differ diff --git a/models/nzprops/zombies_power_lever_handle.vvd b/models/nzprops/zombies_power_lever_handle.vvd new file mode 100644 index 00000000..9c85cc47 Binary files /dev/null and b/models/nzprops/zombies_power_lever_handle.vvd differ diff --git a/models/nzprops/zombies_power_lever_short.dx80.vtx b/models/nzprops/zombies_power_lever_short.dx80.vtx new file mode 100644 index 00000000..ed6bf67c Binary files /dev/null and b/models/nzprops/zombies_power_lever_short.dx80.vtx differ diff --git a/models/nzprops/zombies_power_lever_short.dx90.vtx b/models/nzprops/zombies_power_lever_short.dx90.vtx new file mode 100644 index 00000000..6adab76c Binary files /dev/null and b/models/nzprops/zombies_power_lever_short.dx90.vtx differ diff --git a/models/nzprops/zombies_power_lever_short.mdl b/models/nzprops/zombies_power_lever_short.mdl new file mode 100644 index 00000000..f48df6b3 Binary files /dev/null and b/models/nzprops/zombies_power_lever_short.mdl differ diff --git a/models/nzprops/zombies_power_lever_short.phy b/models/nzprops/zombies_power_lever_short.phy new file mode 100644 index 00000000..10d0cef9 Binary files /dev/null and b/models/nzprops/zombies_power_lever_short.phy differ diff --git a/models/nzprops/zombies_power_lever_short.sw.vtx b/models/nzprops/zombies_power_lever_short.sw.vtx new file mode 100644 index 00000000..985d8000 Binary files /dev/null and b/models/nzprops/zombies_power_lever_short.sw.vtx differ diff --git a/models/nzprops/zombies_power_lever_short.vvd b/models/nzprops/zombies_power_lever_short.vvd new file mode 100644 index 00000000..7b84914c Binary files /dev/null and b/models/nzprops/zombies_power_lever_short.vvd differ diff --git a/models/weapons/c_bowie_knife.dx80.vtx b/models/weapons/c_bowie_knife.dx80.vtx new file mode 100644 index 00000000..60f0a79e Binary files /dev/null and b/models/weapons/c_bowie_knife.dx80.vtx differ diff --git a/models/weapons/c_bowie_knife.dx90.vtx b/models/weapons/c_bowie_knife.dx90.vtx new file mode 100644 index 00000000..41556c10 Binary files /dev/null and b/models/weapons/c_bowie_knife.dx90.vtx differ diff --git a/models/weapons/c_bowie_knife.mdl b/models/weapons/c_bowie_knife.mdl new file mode 100644 index 00000000..42627a8e Binary files /dev/null and b/models/weapons/c_bowie_knife.mdl differ diff --git a/models/weapons/c_bowie_knife.sw.vtx b/models/weapons/c_bowie_knife.sw.vtx new file mode 100644 index 00000000..e9951f8f Binary files /dev/null and b/models/weapons/c_bowie_knife.sw.vtx differ diff --git a/models/weapons/c_bowie_knife.vvd b/models/weapons/c_bowie_knife.vvd new file mode 100644 index 00000000..1c59a680 Binary files /dev/null and b/models/weapons/c_bowie_knife.vvd differ diff --git a/models/weapons/c_monkey_bomb.dx80.vtx b/models/weapons/c_monkey_bomb.dx80.vtx new file mode 100644 index 00000000..f9e7fa58 Binary files /dev/null and b/models/weapons/c_monkey_bomb.dx80.vtx differ diff --git a/models/weapons/c_monkey_bomb.dx90.vtx b/models/weapons/c_monkey_bomb.dx90.vtx new file mode 100644 index 00000000..1234a17d Binary files /dev/null and b/models/weapons/c_monkey_bomb.dx90.vtx differ diff --git a/models/weapons/c_monkey_bomb.mdl b/models/weapons/c_monkey_bomb.mdl new file mode 100644 index 00000000..78615c32 Binary files /dev/null and b/models/weapons/c_monkey_bomb.mdl differ diff --git a/models/weapons/c_monkey_bomb.sw.vtx b/models/weapons/c_monkey_bomb.sw.vtx new file mode 100644 index 00000000..1f1e4f23 Binary files /dev/null and b/models/weapons/c_monkey_bomb.sw.vtx differ diff --git a/models/weapons/c_monkey_bomb.vvd b/models/weapons/c_monkey_bomb.vvd new file mode 100644 index 00000000..2076ee51 Binary files /dev/null and b/models/weapons/c_monkey_bomb.vvd differ diff --git a/models/weapons/c_packapunch_arms.dx80.vtx b/models/weapons/c_packapunch_arms.dx80.vtx new file mode 100644 index 00000000..542a3f6a Binary files /dev/null and b/models/weapons/c_packapunch_arms.dx80.vtx differ diff --git a/models/weapons/c_packapunch_arms.dx90.vtx b/models/weapons/c_packapunch_arms.dx90.vtx new file mode 100644 index 00000000..313956a2 Binary files /dev/null and b/models/weapons/c_packapunch_arms.dx90.vtx differ diff --git a/models/weapons/c_packapunch_arms.mdl b/models/weapons/c_packapunch_arms.mdl new file mode 100644 index 00000000..07781350 Binary files /dev/null and b/models/weapons/c_packapunch_arms.mdl differ diff --git a/models/weapons/c_packapunch_arms.sw.vtx b/models/weapons/c_packapunch_arms.sw.vtx new file mode 100644 index 00000000..ac34c7d5 Binary files /dev/null and b/models/weapons/c_packapunch_arms.sw.vtx differ diff --git a/models/weapons/c_packapunch_arms.vvd b/models/weapons/c_packapunch_arms.vvd new file mode 100644 index 00000000..105394c0 Binary files /dev/null and b/models/weapons/c_packapunch_arms.vvd differ diff --git a/models/weapons/c_perk_bottle.dx80.vtx b/models/weapons/c_perk_bottle.dx80.vtx new file mode 100644 index 00000000..a3969373 Binary files /dev/null and b/models/weapons/c_perk_bottle.dx80.vtx differ diff --git a/models/weapons/c_perk_bottle.dx90.vtx b/models/weapons/c_perk_bottle.dx90.vtx new file mode 100644 index 00000000..083c99b2 Binary files /dev/null and b/models/weapons/c_perk_bottle.dx90.vtx differ diff --git a/models/weapons/c_perk_bottle.mdl b/models/weapons/c_perk_bottle.mdl new file mode 100644 index 00000000..4d4bf09b Binary files /dev/null and b/models/weapons/c_perk_bottle.mdl differ diff --git a/models/weapons/c_perk_bottle.sw.vtx b/models/weapons/c_perk_bottle.sw.vtx new file mode 100644 index 00000000..0745b7c3 Binary files /dev/null and b/models/weapons/c_perk_bottle.sw.vtx differ diff --git a/models/weapons/c_perk_bottle.vvd b/models/weapons/c_perk_bottle.vvd new file mode 100644 index 00000000..deb94057 Binary files /dev/null and b/models/weapons/c_perk_bottle.vvd differ diff --git a/models/weapons/c_revive_morphine.dx80.vtx b/models/weapons/c_revive_morphine.dx80.vtx new file mode 100644 index 00000000..cfc6902b Binary files /dev/null and b/models/weapons/c_revive_morphine.dx80.vtx differ diff --git a/models/weapons/c_revive_morphine.dx90.vtx b/models/weapons/c_revive_morphine.dx90.vtx new file mode 100644 index 00000000..895e2eff Binary files /dev/null and b/models/weapons/c_revive_morphine.dx90.vtx differ diff --git a/models/weapons/c_revive_morphine.mdl b/models/weapons/c_revive_morphine.mdl new file mode 100644 index 00000000..72a1fb99 Binary files /dev/null and b/models/weapons/c_revive_morphine.mdl differ diff --git a/models/weapons/c_revive_morphine.sw.vtx b/models/weapons/c_revive_morphine.sw.vtx new file mode 100644 index 00000000..60914271 Binary files /dev/null and b/models/weapons/c_revive_morphine.sw.vtx differ diff --git a/models/weapons/c_revive_morphine.vvd b/models/weapons/c_revive_morphine.vvd new file mode 100644 index 00000000..d52d98c6 Binary files /dev/null and b/models/weapons/c_revive_morphine.vvd differ diff --git a/models/weapons/w_bowie_knife.dx80.vtx b/models/weapons/w_bowie_knife.dx80.vtx new file mode 100644 index 00000000..8d2e2627 Binary files /dev/null and b/models/weapons/w_bowie_knife.dx80.vtx differ diff --git a/models/weapons/w_bowie_knife.dx90.vtx b/models/weapons/w_bowie_knife.dx90.vtx new file mode 100644 index 00000000..b705ce78 Binary files /dev/null and b/models/weapons/w_bowie_knife.dx90.vtx differ diff --git a/models/weapons/w_bowie_knife.mdl b/models/weapons/w_bowie_knife.mdl new file mode 100644 index 00000000..bcca1804 Binary files /dev/null and b/models/weapons/w_bowie_knife.mdl differ diff --git a/models/weapons/w_bowie_knife.sw.vtx b/models/weapons/w_bowie_knife.sw.vtx new file mode 100644 index 00000000..86667a7f Binary files /dev/null and b/models/weapons/w_bowie_knife.sw.vtx differ diff --git a/models/weapons/w_bowie_knife.vvd b/models/weapons/w_bowie_knife.vvd new file mode 100644 index 00000000..486d1396 Binary files /dev/null and b/models/weapons/w_bowie_knife.vvd differ diff --git a/nzombies3/content/materials/models/zed/male/art_facemap.vmt b/nzombies3/content/materials/models/zed/male/art_facemap.vmt deleted file mode 100644 index 0fc8b872..00000000 --- a/nzombies3/content/materials/models/zed/male/art_facemap.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index ad25be31..00000000 Binary files a/nzombies3/content/materials/models/zed/male/art_facemap.vtf and /dev/null 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 deleted file mode 100644 index 8972f41f..00000000 Binary files a/nzombies3/content/materials/models/zed/male/art_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/blood_sheet.vmt b/nzombies3/content/materials/models/zed/male/blood_sheet.vmt deleted file mode 100644 index a20c63e5..00000000 --- a/nzombies3/content/materials/models/zed/male/blood_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index b88b11c2..00000000 Binary files a/nzombies3/content/materials/models/zed/male/blood_sheet.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/citizen2_sheet.vmt b/nzombies3/content/materials/models/zed/male/citizen2_sheet.vmt deleted file mode 100644 index 97c02864..00000000 --- a/nzombies3/content/materials/models/zed/male/citizen2_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 97c02864..00000000 --- a/nzombies3/content/materials/models/zed/male/citizen3_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 97c02864..00000000 --- a/nzombies3/content/materials/models/zed/male/citizen_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index f92f0001..00000000 Binary files a/nzombies3/content/materials/models/zed/male/citizen_sheet.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet2.vmt b/nzombies3/content/materials/models/zed/male/citizen_sheet2.vmt deleted file mode 100644 index 71a9a383..00000000 --- a/nzombies3/content/materials/models/zed/male/citizen_sheet2.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index d6d32980..00000000 Binary files a/nzombies3/content/materials/models/zed/male/citizen_sheet2.vtf and /dev/null 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 deleted file mode 100644 index b1eed595..00000000 Binary files a/nzombies3/content/materials/models/zed/male/citizen_sheet2_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/citizen_sheet3.vmt b/nzombies3/content/materials/models/zed/male/citizen_sheet3.vmt deleted file mode 100644 index ff69639d..00000000 --- a/nzombies3/content/materials/models/zed/male/citizen_sheet3.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index bb9420d8..00000000 Binary files a/nzombies3/content/materials/models/zed/male/citizen_sheet3.vtf and /dev/null 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 deleted file mode 100644 index 8706d940..00000000 Binary files a/nzombies3/content/materials/models/zed/male/citizen_sheet_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/corpse1.vmt b/nzombies3/content/materials/models/zed/male/corpse1.vmt deleted file mode 100644 index 120ec700..00000000 --- a/nzombies3/content/materials/models/zed/male/corpse1.vmt +++ /dev/null @@ -1,5 +0,0 @@ -"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 deleted file mode 100644 index 58582bb7..00000000 Binary files a/nzombies3/content/materials/models/zed/male/corpse1.vtf and /dev/null 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 deleted file mode 100644 index 16e518a2..00000000 --- a/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 1764f6ce..00000000 Binary files a/nzombies3/content/materials/models/zed/male/dark_eyeball_l.vtf and /dev/null 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 deleted file mode 100644 index cdeb9165..00000000 --- a/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 5f158985..00000000 Binary files a/nzombies3/content/materials/models/zed/male/dark_eyeball_r.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/erdim_cylmap.vmt b/nzombies3/content/materials/models/zed/male/erdim_cylmap.vmt deleted file mode 100644 index 90876cc1..00000000 --- a/nzombies3/content/materials/models/zed/male/erdim_cylmap.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index a6397de5..00000000 Binary files a/nzombies3/content/materials/models/zed/male/erdim_cylmap.vtf and /dev/null 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 deleted file mode 100644 index e64cfb44..00000000 Binary files a/nzombies3/content/materials/models/zed/male/erdim_cylmap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/erdim_facemap.vmt b/nzombies3/content/materials/models/zed/male/erdim_facemap.vmt deleted file mode 100644 index 16fccf51..00000000 --- a/nzombies3/content/materials/models/zed/male/erdim_facemap.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 5a6f0023..00000000 --- a/nzombies3/content/materials/models/zed/male/eric_facemap.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index cbcfc641..00000000 Binary files a/nzombies3/content/materials/models/zed/male/eric_facemap.vtf and /dev/null 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 deleted file mode 100644 index 206c5405..00000000 Binary files a/nzombies3/content/materials/models/zed/male/eric_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/eyeball_l.vmt b/nzombies3/content/materials/models/zed/male/eyeball_l.vmt deleted file mode 100644 index 25ea99f8..00000000 --- a/nzombies3/content/materials/models/zed/male/eyeball_l.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 8e571024..00000000 Binary files a/nzombies3/content/materials/models/zed/male/eyeball_l.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/eyeball_r.vmt b/nzombies3/content/materials/models/zed/male/eyeball_r.vmt deleted file mode 100644 index bb0eb052..00000000 --- a/nzombies3/content/materials/models/zed/male/eyeball_r.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 570c7d1c..00000000 Binary files a/nzombies3/content/materials/models/zed/male/eyeball_r.vtf and /dev/null 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 deleted file mode 100644 index 11a521cc..00000000 --- a/nzombies3/content/materials/models/zed/male/g1_01_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 65c06c9c..00000000 --- a/nzombies3/content/materials/models/zed/male/g1_02_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index a20c63e5..00000000 --- a/nzombies3/content/materials/models/zed/male/g1_03_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index e5923156..00000000 --- a/nzombies3/content/materials/models/zed/male/g1_04_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 83dd7dd5..00000000 --- a/nzombies3/content/materials/models/zed/male/g1_05_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 11a521cc..00000000 --- a/nzombies3/content/materials/models/zed/male/g2_01_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 65c06c9c..00000000 --- a/nzombies3/content/materials/models/zed/male/g2_02_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index a20c63e5..00000000 --- a/nzombies3/content/materials/models/zed/male/g2_03_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index e5923156..00000000 --- a/nzombies3/content/materials/models/zed/male/g2_04_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 83dd7dd5..00000000 --- a/nzombies3/content/materials/models/zed/male/g2_05_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 11a521cc..00000000 --- a/nzombies3/content/materials/models/zed/male/g3_01_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 65c06c9c..00000000 --- a/nzombies3/content/materials/models/zed/male/g3_02_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index a20c63e5..00000000 --- a/nzombies3/content/materials/models/zed/male/g3_03_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index e5923156..00000000 --- a/nzombies3/content/materials/models/zed/male/g3_04_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 83dd7dd5..00000000 --- a/nzombies3/content/materials/models/zed/male/g3_05_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 11a521cc..00000000 --- a/nzombies3/content/materials/models/zed/male/g4_01_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 65c06c9c..00000000 --- a/nzombies3/content/materials/models/zed/male/g4_02_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index a20c63e5..00000000 --- a/nzombies3/content/materials/models/zed/male/g4_03_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index e5923156..00000000 --- a/nzombies3/content/materials/models/zed/male/g4_04_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 83dd7dd5..00000000 --- a/nzombies3/content/materials/models/zed/male/g4_05_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 9dd2d50e..00000000 --- a/nzombies3/content/materials/models/zed/male/glint.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index 7d4a0ff6..00000000 Binary files a/nzombies3/content/materials/models/zed/male/glint.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/grey_sheet.vmt b/nzombies3/content/materials/models/zed/male/grey_sheet.vmt deleted file mode 100644 index 65c06c9c..00000000 --- a/nzombies3/content/materials/models/zed/male/grey_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 69a621b4..00000000 Binary files a/nzombies3/content/materials/models/zed/male/grey_sheet.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/jackson_sheet.vmt b/nzombies3/content/materials/models/zed/male/jackson_sheet.vmt deleted file mode 100644 index 83dd7dd5..00000000 --- a/nzombies3/content/materials/models/zed/male/jackson_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index de27faf7..00000000 Binary files a/nzombies3/content/materials/models/zed/male/jackson_sheet.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/joe_facemap.vmt b/nzombies3/content/materials/models/zed/male/joe_facemap.vmt deleted file mode 100644 index 80e15334..00000000 --- a/nzombies3/content/materials/models/zed/male/joe_facemap.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 5c31cd96..00000000 Binary files a/nzombies3/content/materials/models/zed/male/joe_facemap.vtf and /dev/null 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 deleted file mode 100644 index 2e1b1839..00000000 Binary files a/nzombies3/content/materials/models/zed/male/joe_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/mike_facemap.vmt b/nzombies3/content/materials/models/zed/male/mike_facemap.vmt deleted file mode 100644 index b67a27bd..00000000 --- a/nzombies3/content/materials/models/zed/male/mike_facemap.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index f54636aa..00000000 Binary files a/nzombies3/content/materials/models/zed/male/mike_facemap.vtf and /dev/null 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 deleted file mode 100644 index 1a373b7d..00000000 Binary files a/nzombies3/content/materials/models/zed/male/mike_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/mouth.vmt b/nzombies3/content/materials/models/zed/male/mouth.vmt deleted file mode 100644 index d0789af5..00000000 --- a/nzombies3/content/materials/models/zed/male/mouth.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index abe1c02b..00000000 Binary files a/nzombies3/content/materials/models/zed/male/mouth.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/plaid_sheet.vmt b/nzombies3/content/materials/models/zed/male/plaid_sheet.vmt deleted file mode 100644 index 11a521cc..00000000 --- a/nzombies3/content/materials/models/zed/male/plaid_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 21789e42..00000000 Binary files a/nzombies3/content/materials/models/zed/male/plaid_sheet.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/pupil_l.vmt b/nzombies3/content/materials/models/zed/male/pupil_l.vmt deleted file mode 100644 index 61dfe74b..00000000 --- a/nzombies3/content/materials/models/zed/male/pupil_l.vmt +++ /dev/null @@ -1,4 +0,0 @@ -"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 deleted file mode 100644 index 481beab3..00000000 Binary files a/nzombies3/content/materials/models/zed/male/pupil_l.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/pupil_r.vmt b/nzombies3/content/materials/models/zed/male/pupil_r.vmt deleted file mode 100644 index 23fac5bc..00000000 --- a/nzombies3/content/materials/models/zed/male/pupil_r.vmt +++ /dev/null @@ -1,4 +0,0 @@ -"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 deleted file mode 100644 index 3bdc93d5..00000000 Binary files a/nzombies3/content/materials/models/zed/male/pupil_r.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/sandro_facemap.vmt b/nzombies3/content/materials/models/zed/male/sandro_facemap.vmt deleted file mode 100644 index bd3d3756..00000000 --- a/nzombies3/content/materials/models/zed/male/sandro_facemap.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index 4e13337a..00000000 Binary files a/nzombies3/content/materials/models/zed/male/sandro_facemap.vtf and /dev/null 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 deleted file mode 100644 index dfa6c600..00000000 Binary files a/nzombies3/content/materials/models/zed/male/sandro_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/service_sheet.vmt b/nzombies3/content/materials/models/zed/male/service_sheet.vmt deleted file mode 100644 index e5923156..00000000 --- a/nzombies3/content/materials/models/zed/male/service_sheet.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index af96c062..00000000 Binary files a/nzombies3/content/materials/models/zed/male/service_sheet.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/ted_facemap.vmt b/nzombies3/content/materials/models/zed/male/ted_facemap.vmt deleted file mode 100644 index 8a093a84..00000000 --- a/nzombies3/content/materials/models/zed/male/ted_facemap.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index f4c6f419..00000000 Binary files a/nzombies3/content/materials/models/zed/male/ted_facemap.vtf and /dev/null 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 deleted file mode 100644 index c0f6bf2d..00000000 Binary files a/nzombies3/content/materials/models/zed/male/ted_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/van_facemap.vmt b/nzombies3/content/materials/models/zed/male/van_facemap.vmt deleted file mode 100644 index 5cf09f3b..00000000 --- a/nzombies3/content/materials/models/zed/male/van_facemap.vmt +++ /dev/null @@ -1,6 +0,0 @@ -"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 deleted file mode 100644 index b1fcde85..00000000 Binary files a/nzombies3/content/materials/models/zed/male/van_facemap.vtf and /dev/null 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 deleted file mode 100644 index c9584d98..00000000 Binary files a/nzombies3/content/materials/models/zed/male/van_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/materials/models/zed/male/vance_facemap.vmt b/nzombies3/content/materials/models/zed/male/vance_facemap.vmt deleted file mode 100644 index b88a5885..00000000 --- a/nzombies3/content/materials/models/zed/male/vance_facemap.vmt +++ /dev/null @@ -1,7 +0,0 @@ -"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 deleted file mode 100644 index 46913ec7..00000000 Binary files a/nzombies3/content/materials/models/zed/male/vance_facemap.vtf and /dev/null 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 deleted file mode 100644 index 0c64c721..00000000 Binary files a/nzombies3/content/materials/models/zed/male/vance_facemap_normal.vtf and /dev/null differ diff --git a/nzombies3/content/models/alig96/perks/readme.txt b/nzombies3/content/models/alig96/perks/readme.txt deleted file mode 100644 index c0801c50..00000000 --- a/nzombies3/content/models/alig96/perks/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -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/zed/male_shared.mdl b/nzombies3/content/models/zed/male_shared.mdl deleted file mode 100644 index 3dacef39..00000000 Binary files a/nzombies3/content/models/zed/male_shared.mdl and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_04.dx80.vtx b/nzombies3/content/models/zed/malezed_04.dx80.vtx deleted file mode 100644 index 4286d81b..00000000 Binary files a/nzombies3/content/models/zed/malezed_04.dx80.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_04.dx90.vtx b/nzombies3/content/models/zed/malezed_04.dx90.vtx deleted file mode 100644 index 602b05f8..00000000 Binary files a/nzombies3/content/models/zed/malezed_04.dx90.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_04.mdl b/nzombies3/content/models/zed/malezed_04.mdl deleted file mode 100644 index 4cf04b03..00000000 Binary files a/nzombies3/content/models/zed/malezed_04.mdl and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_04.phy b/nzombies3/content/models/zed/malezed_04.phy deleted file mode 100644 index 6837ae84..00000000 Binary files a/nzombies3/content/models/zed/malezed_04.phy and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_04.sw.vtx b/nzombies3/content/models/zed/malezed_04.sw.vtx deleted file mode 100644 index faa6237e..00000000 Binary files a/nzombies3/content/models/zed/malezed_04.sw.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_04.vvd b/nzombies3/content/models/zed/malezed_04.vvd deleted file mode 100644 index 419ad42e..00000000 Binary files a/nzombies3/content/models/zed/malezed_04.vvd and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_06.dx80.vtx b/nzombies3/content/models/zed/malezed_06.dx80.vtx deleted file mode 100644 index 48424622..00000000 Binary files a/nzombies3/content/models/zed/malezed_06.dx80.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_06.dx90.vtx b/nzombies3/content/models/zed/malezed_06.dx90.vtx deleted file mode 100644 index 758e6fa7..00000000 Binary files a/nzombies3/content/models/zed/malezed_06.dx90.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_06.mdl b/nzombies3/content/models/zed/malezed_06.mdl deleted file mode 100644 index 10196b8c..00000000 Binary files a/nzombies3/content/models/zed/malezed_06.mdl and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_06.phy b/nzombies3/content/models/zed/malezed_06.phy deleted file mode 100644 index e857d4e9..00000000 Binary files a/nzombies3/content/models/zed/malezed_06.phy and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_06.sw.vtx b/nzombies3/content/models/zed/malezed_06.sw.vtx deleted file mode 100644 index b59eb20f..00000000 Binary files a/nzombies3/content/models/zed/malezed_06.sw.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_06.vvd b/nzombies3/content/models/zed/malezed_06.vvd deleted file mode 100644 index 452e5c10..00000000 Binary files a/nzombies3/content/models/zed/malezed_06.vvd and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_08.dx80.vtx b/nzombies3/content/models/zed/malezed_08.dx80.vtx deleted file mode 100644 index 045dc1fe..00000000 Binary files a/nzombies3/content/models/zed/malezed_08.dx80.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_08.dx90.vtx b/nzombies3/content/models/zed/malezed_08.dx90.vtx deleted file mode 100644 index 06984c79..00000000 Binary files a/nzombies3/content/models/zed/malezed_08.dx90.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_08.mdl b/nzombies3/content/models/zed/malezed_08.mdl deleted file mode 100644 index a1bca030..00000000 Binary files a/nzombies3/content/models/zed/malezed_08.mdl and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_08.phy b/nzombies3/content/models/zed/malezed_08.phy deleted file mode 100644 index 99f6e054..00000000 Binary files a/nzombies3/content/models/zed/malezed_08.phy and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_08.sw.vtx b/nzombies3/content/models/zed/malezed_08.sw.vtx deleted file mode 100644 index f83c17c0..00000000 Binary files a/nzombies3/content/models/zed/malezed_08.sw.vtx and /dev/null differ diff --git a/nzombies3/content/models/zed/malezed_08.vvd b/nzombies3/content/models/zed/malezed_08.vvd deleted file mode 100644 index 8ba3f68d..00000000 Binary files a/nzombies3/content/models/zed/malezed_08.vvd and /dev/null differ diff --git a/nzombies3/content/sound/nz/powerups/nuke.mp3 b/nzombies3/content/sound/nz/powerups/nuke.mp3 deleted file mode 100644 index 2e184065..00000000 Binary files a/nzombies3/content/sound/nz/powerups/nuke.mp3 and /dev/null differ diff --git a/nzombies3/entities/entities/breakable_entry/shared.lua b/nzombies3/entities/entities/breakable_entry/shared.lua deleted file mode 100644 index a8d700be..00000000 --- a/nzombies3/entities/entities/breakable_entry/shared.lua +++ /dev/null @@ -1,110 +0,0 @@ -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/button_elec/shared.lua b/nzombies3/entities/entities/button_elec/shared.lua deleted file mode 100644 index bef56b5a..00000000 --- a/nzombies3/entities/entities/button_elec/shared.lua +++ /dev/null @@ -1,57 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "button_elec" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - -function ENT:SetupDataTables() - - self:NetworkVar( "Bool", 0, "Switch" ) - -end - -function ENT:Initialize() - if SERVER then - self:SetModel( "models/MaxOfS2D/button_01.mdl" ) - self:SetSolid( SOLID_VPHYSICS ) - self:SetMoveType( MOVETYPE_NONE ) - self:SetUseType( ONOFF_USE ) - self:SetSwitch(false) - else - self.PosePosition = 0 - end -end - -function ENT:Use( activator ) - - if ( !activator:IsPlayer() ) then return end - 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 - -if CLIENT then - - function ENT:Think() - - local TargetPos = 0.0; - - if ( self:GetSwitch() ) then TargetPos = 1.0; end - - self.PosePosition = math.Approach( self.PosePosition, TargetPos, FrameTime() * 5.0 ) - - self:SetPoseParameter( "switch", self.PosePosition ) - self:InvalidateBoneCache() - - end - - function ENT:Draw() - self:DrawModel() - end -end \ No newline at end of file diff --git a/nzombies3/entities/entities/drop_powerup/shared.lua b/nzombies3/entities/entities/drop_powerup/shared.lua deleted file mode 100644 index 85146962..00000000 --- a/nzombies3/entities/entities/drop_powerup/shared.lua +++ /dev/null @@ -1,80 +0,0 @@ -AddCSLuaFile() - -ENT.Type = "anim" - -ENT.PrintName = "drop_powerups" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - -function ENT:SetupDataTables() - - self:NetworkVar( "String", 0, "PowerUp" ) - -end - -function ENT:Initialize() - - //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) - self.DeathTimer = 30 - if SERVER then - self:SetUseType(SIMPLE_USE) - local phys = self:GetPhysicsObject() - if (phys:IsValid()) then - phys:Wake() - --phys:EnableCollisions(false) - end - end - timer.Create( self:EntIndex().."_deathtimer", 0.1, 300, function() - if self:IsValid() then - self.DeathTimer = self.DeathTimer - 0.1 - if self.DeathTimer <= 0 then - timer.Destroy(self:EntIndex().."_deathtimer") - if SERVER then - self:Remove() - end - end - end - end) -end - -if SERVER then - function ENT:StartTouch(hitEnt) - if (hitEnt:IsValid() and hitEnt:IsPlayer()) then - nz.PowerUps.Functions.Activate(self:GetPowerUp(), hitEnt) - self:Remove() - end - end -end - -if CLIENT then - function ENT:Draw() - - local modi,modf = math.modf(self.DeathTimer) - if modi > 10 then - self:DrawModel() - elseif modi > 5 and modi <= 10 then - if modi % 2 == 0 then - self:DrawModel() - end - else - if math.Round(modf*10) % 2 == 0 then - self:DrawModel() - end - end - end - local num = 0 - function ENT:Think() - local var = math.sin( CurTime() * 3 ) - 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_powerup" ), Color( 0, 255, 0 ), 2, 2, 2 ) - end ) -end \ No newline at end of file diff --git a/nzombies3/entities/entities/nut_zombie.lua b/nzombies3/entities/entities/nut_zombie.lua deleted file mode 100644 index 904ffba7..00000000 --- a/nzombies3/entities/entities/nut_zombie.lua +++ /dev/null @@ -1,278 +0,0 @@ -AddCSLuaFile() - -ENT.Base = "base_nextbot" -ENT.PrintName = "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.1, 0) - self.loco:SetDeathDropHeight(700) - if SERVER then - 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)) - - 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: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) - if ((dist < min_dist||min_dist==-1)) then - closest_target = target - min_dist = dist - end - end - end - - return closest_target -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 - - //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", 50, 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", 50, 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 - if nz.Curves.Data.Speed[nz.Rounds.Data.CurrentRound] >= 160 then - self:StartActivity(ACT_RUN) - else - self:StartActivity(ACT_WALK) - end - 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", 40, math.random(30, 50)) - self.nextYell = CurTime() + math.random(4, 8) - end - - self.loco:SetDesiredSpeed(nz.Curves.Data.Speed[nz.Rounds.Data.CurrentRound]) - self:MoveToPos(target:GetPos(), { - maxage = 0.67 - }) - end - else - self.target = nil - self:StartActivity(ACT_WALK) - self.loco:SetDesiredSpeed(40) - 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", 50, 60) - - if (math.random(1, 2) == 2) then - self:PlaySequenceAndWait("scaredidle") - else - self:PlaySequenceAndWait("photo_react_startle") - end - end - //New AI Stuffz - if (!self.target) then - local v = self:GetPriorityEnemy() - self.target = v - self:AlertNearby(v) - self.target = v - self:PlaySequenceAndWait("wave_smg1", 0.9) - end - end - coroutine.yield() - end -end - -function ENT:Think() - //Retarget closest players. Don't put this in the function above or else mass lag due to constant rethinking of target - self.target = self:GetPriorityEnemy() - self:NextThink(4) -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", 50, 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", 50, 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 - - self:EmitSound(table.Random(deathSounds), 50, math.random(75, 130)) - self:BecomeRagdoll(damageInfo) - - nz.Enemies.Functions.OnEnemyKilled( self, attacker ) - -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 hitgroup = util.QuickTrace( damageInfo:GetDamagePosition( ), damageInfo:GetDamagePosition( ) ).HitGroup - local range = self:GetRangeTo(attacker) - //Deal an double damage if headshot - if hitgroup == HITGROUP_HEAD then - 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) - - 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 deleted file mode 100644 index 02279c74..00000000 --- a/nzombies3/entities/entities/perk_machine/shared.lua +++ /dev/null @@ -1,62 +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") - 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/nzombies3/entities/entities/player_spawns/shared.lua b/nzombies3/entities/entities/player_spawns/shared.lua deleted file mode 100644 index 208782f9..00000000 --- a/nzombies3/entities/entities/player_spawns/shared.lua +++ /dev/null @@ -1,27 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "player_spawns" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - - -function ENT:Initialize() - self:SetModel( "models/player/odessa.mdl" ) - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_VPHYSICS ) - self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) - self:SetColor(0, 255, 0, 255) - self:DrawShadow( false ) -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/prop_buys/shared.lua b/nzombies3/entities/entities/prop_buys/shared.lua deleted file mode 100644 index 5f34c3c1..00000000 --- a/nzombies3/entities/entities/prop_buys/shared.lua +++ /dev/null @@ -1,63 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "wall_block_buy" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - -function ENT:SetupDataTables() - - self:NetworkVar( "Bool", 0, "Locked" ) - -end - -function ENT:Initialize() - if SERVER then - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_VPHYSICS ) - self:DrawShadow( false ) - self:SetUseType( SIMPLE_USE ) - self.Boundone,self.Boundtwo = self:GetCollisionBounds() - end - self:BlockLock() -end - -function ENT:BlockUnlock() - self.Locked = false - --self:SetNoDraw( true ) - if SERVER then - self:SetCollisionBounds( Vector(-4, -4, 0), Vector(4, 4, 64) ) - end - self:SetSolid( SOLID_NONE ) - self:SetLocked(false) -end - -function ENT:BlockLock() - self.Locked = true - --self:SetNoDraw( false ) - if SERVER then - self:SetCollisionBounds( self.Boundone, self.Boundtwo ) - end - self:SetSolid( SOLID_VPHYSICS ) - self:SetLocked(true) -end - -if CLIENT then - function ENT:Draw() - 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 \ No newline at end of file diff --git a/nzombies3/entities/entities/random_box/shared.lua b/nzombies3/entities/entities/random_box/shared.lua deleted file mode 100644 index 3725736d..00000000 --- a/nzombies3/entities/entities/random_box/shared.lua +++ /dev/null @@ -1,153 +0,0 @@ -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/nzombies3/entities/entities/random_box_spawns/shared.lua b/nzombies3/entities/entities/random_box_spawns/shared.lua deleted file mode 100644 index a9aa5bc3..00000000 --- a/nzombies3/entities/entities/random_box_spawns/shared.lua +++ /dev/null @@ -1,27 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "random_box_spawns" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - - -function ENT:Initialize() - self:SetModel( "models/hoff/props/mysterybox/box.mdl" ) - self:SetColor( 255, 255, 255 ) - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_VPHYSICS ) - self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) - self:DrawShadow( false ) -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/nzombies3/entities/entities/random_box_windup/shared.lua b/nzombies3/entities/entities/random_box_windup/shared.lua deleted file mode 100644 index 73e81545..00000000 --- a/nzombies3/entities/entities/random_box_windup/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: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/nzombies3/entities/entities/wall_block/shared.lua b/nzombies3/entities/entities/wall_block/shared.lua deleted file mode 100644 index fdb6607c..00000000 --- a/nzombies3/entities/entities/wall_block/shared.lua +++ /dev/null @@ -1,24 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "wall_block" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - -function ENT:Initialize() - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_VPHYSICS ) - self:DrawShadow( false ) - self:SetRenderMode( RENDERMODE_TRANSCOLOR ) -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/nzombies3/entities/entities/wall_buys/shared.lua b/nzombies3/entities/entities/wall_buys/shared.lua deleted file mode 100644 index 861eb438..00000000 --- a/nzombies3/entities/entities/wall_buys/shared.lua +++ /dev/null @@ -1,75 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "buy_gun_area" -ENT.Author = "Alig96" -ENT.Contact = "Don't" -ENT.Purpose = "" -ENT.Instructions = "" - -function ENT:SetupDataTables() - - self:NetworkVar( "String", 0, "EntName" ) - self:NetworkVar( "String", 1, "Price" ) -end - -if SERVER then - function ENT:Initialize() - self:SetMoveType( MOVETYPE_NONE ) - 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 - //self:SetModel( weapons.Get(weapon).WM ) - self:SetModel( weapons.Get(weapon).WorldModel ) - else - self:SetModel( weapons.Get(weapon).WorldModel ) - end - self:SetModelScale( 1.5, 0 ) - self.WeaponGive = weapon - self.Price = price - self:SetEntName(weapon) - self:SetPrice(price) - end - - function ENT:Use( activator, caller ) - 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 -end - -if CLIENT then - function ENT:Draw() - self:DrawModel() - end -end diff --git a/nzombies3/entities/entities/zed_spawns/shared.lua b/nzombies3/entities/entities/zed_spawns/shared.lua deleted file mode 100644 index b4938545..00000000 --- a/nzombies3/entities/entities/zed_spawns/shared.lua +++ /dev/null @@ -1,32 +0,0 @@ -AddCSLuaFile( ) - -ENT.Type = "anim" - -ENT.PrintName = "zed_spawns" -ENT.Author = "Alig96" -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" ) - self:SetMoveType( MOVETYPE_NONE ) - self:SetSolid( SOLID_VPHYSICS ) - self:SetCollisionGroup( COLLISION_GROUP_WEAPON ) - self:SetColor(255, 0, 0, 255) - self:DrawShadow( false ) -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/weapons/nz_tool_barricades.lua b/nzombies3/entities/weapons/nz_tool_barricades.lua deleted file mode 100644 index bebd3efe..00000000 --- a/nzombies3/entities/weapons/nz_tool_barricades.lua +++ /dev/null @@ -1,17 +0,0 @@ -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/shared.lua b/nzombies3/entities/weapons/nz_tool_base/shared.lua deleted file mode 100644 index 17f572a2..00000000 --- a/nzombies3/entities/weapons/nz_tool_base/shared.lua +++ /dev/null @@ -1,176 +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 - self:OnPrimaryAttack(trace) - end -end - -function SWEP:OnPrimaryAttack( trace ) - print("dicks") -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 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 deleted file mode 100644 index d1c6a3de..00000000 --- a/nzombies3/entities/weapons/nz_tool_block_spawns.lua +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 5c9bd327..00000000 --- a/nzombies3/entities/weapons/nz_tool_door_locker.lua +++ /dev/null @@ -1,30 +0,0 @@ -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_elec.lua b/nzombies3/entities/weapons/nz_tool_elec.lua deleted file mode 100644 index 5dd42419..00000000 --- a/nzombies3/entities/weapons/nz_tool_elec.lua +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index d665fafa..00000000 --- a/nzombies3/entities/weapons/nz_tool_perk_machine.lua +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index a699c470..00000000 --- a/nzombies3/entities/weapons/nz_tool_player_spawns.lua +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index d5965a7c..00000000 --- a/nzombies3/entities/weapons/nz_tool_prop_modifier.lua +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 5e6ab998..00000000 --- a/nzombies3/entities/weapons/nz_tool_random_box.lua +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index c58fd7ea..00000000 --- a/nzombies3/entities/weapons/nz_tool_template.lua +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index e648a3f2..00000000 --- a/nzombies3/entities/weapons/nz_tool_wall_buys.lua +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index 3a321d07..00000000 --- a/nzombies3/entities/weapons/nz_tool_zed_spawns.lua +++ /dev/null @@ -1,23 +0,0 @@ -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/config/sh_constructor.lua b/nzombies3/gamemode/config/sh_constructor.lua deleted file mode 100644 index f16cb9ba..00000000 --- a/nzombies3/gamemode/config/sh_constructor.lua +++ /dev/null @@ -1,85 +0,0 @@ -//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"} - nz.Config.EnemyTypes = {} - nz.Config.EnemyTypes[1] = {["nut_zombie"] = 100} - //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 - - - - -end - -//Shared - -//Barricades -nz.Config.MaxPlanks = 6 diff --git a/nzombies3/gamemode/curves/sh_constructor.lua b/nzombies3/gamemode/curves/sh_constructor.lua deleted file mode 100644 index 8164291a..00000000 --- a/nzombies3/gamemode/curves/sh_constructor.lua +++ /dev/null @@ -1,25 +0,0 @@ -//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 deleted file mode 100644 index 41e1ad3b..00000000 --- a/nzombies3/gamemode/display/cl_fonts.lua +++ /dev/null @@ -1,34 +0,0 @@ -//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 deleted file mode 100644 index 1dc505d0..00000000 --- a/nzombies3/gamemode/display/cl_halos.lua +++ /dev/null @@ -1,43 +0,0 @@ -//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 deleted file mode 100644 index 09abbe4b..00000000 --- a/nzombies3/gamemode/display/cl_hud.lua +++ /dev/null @@ -1,101 +0,0 @@ -// - -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 deleted file mode 100644 index c439edf7..00000000 --- a/nzombies3/gamemode/display/cl_target.lua +++ /dev/null @@ -1,153 +0,0 @@ -// - -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 deleted file mode 100644 index 7606c2a8..00000000 --- a/nzombies3/gamemode/display/sh_constructor.lua +++ /dev/null @@ -1,6 +0,0 @@ -//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 deleted file mode 100644 index d4aa0029..00000000 --- a/nzombies3/gamemode/door_system/sh_constructor.lua +++ /dev/null @@ -1,11 +0,0 @@ -//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 deleted file mode 100644 index a02f4948..00000000 --- a/nzombies3/gamemode/door_system/sh_door_meta.lua +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100644 index 3236b3a3..00000000 --- a/nzombies3/gamemode/door_system/sh_doors.lua +++ /dev/null @@ -1,11 +0,0 @@ -//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 deleted file mode 100644 index e8c041d8..00000000 --- a/nzombies3/gamemode/door_system/sh_sync.lua +++ /dev/null @@ -1,29 +0,0 @@ -//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 deleted file mode 100644 index 1f77e751..00000000 --- a/nzombies3/gamemode/door_system/sv_doors.lua +++ /dev/null @@ -1,138 +0,0 @@ -// - -//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 deleted file mode 100644 index db13ec03..00000000 --- a/nzombies3/gamemode/door_system/sv_gameplay.lua +++ /dev/null @@ -1,65 +0,0 @@ -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/electricity/sh_constructor.lua b/nzombies3/gamemode/electricity/sh_constructor.lua deleted file mode 100644 index 35db8fe2..00000000 --- a/nzombies3/gamemode/electricity/sh_constructor.lua +++ /dev/null @@ -1,13 +0,0 @@ -//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 deleted file mode 100644 index 08efd2d1..00000000 --- a/nzombies3/gamemode/electricity/sh_sync.lua +++ /dev/null @@ -1,28 +0,0 @@ -//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 deleted file mode 100644 index 8bd6353a..00000000 --- a/nzombies3/gamemode/electricity/sv_elec.lua +++ /dev/null @@ -1,38 +0,0 @@ -// - -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 deleted file mode 100644 index bca4711e..00000000 --- a/nzombies3/gamemode/enemies/sh_constructor.lua +++ /dev/null @@ -1,9 +0,0 @@ -//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 deleted file mode 100644 index 2b6f0835..00000000 --- a/nzombies3/gamemode/enemies/sv_hooks.lua +++ /dev/null @@ -1,43 +0,0 @@ -// - - -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 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 deleted file mode 100644 index 3f594152..00000000 --- a/nzombies3/gamemode/enemies/sv_spawner.lua +++ /dev/null @@ -1,119 +0,0 @@ -// - -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/init.lua b/nzombies3/gamemode/init.lua deleted file mode 100644 index 7e12d398..00000000 --- a/nzombies3/gamemode/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -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_int_configloader.lua b/nzombies3/gamemode/interfaces/sh_int_configloader.lua deleted file mode 100644 index d96e33d4..00000000 --- a/nzombies3/gamemode/interfaces/sh_int_configloader.lua +++ /dev/null @@ -1,51 +0,0 @@ -// - -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 deleted file mode 100644 index f080dc9b..00000000 --- a/nzombies3/gamemode/interfaces/sh_int_door.lua +++ /dev/null @@ -1,97 +0,0 @@ -// - -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_weps.lua b/nzombies3/gamemode/interfaces/sh_int_weps.lua deleted file mode 100644 index ac636b3a..00000000 --- a/nzombies3/gamemode/interfaces/sh_int_weps.lua +++ /dev/null @@ -1,60 +0,0 @@ -// - -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 deleted file mode 100644 index d243df02..00000000 --- a/nzombies3/gamemode/interfaces/sh_int_zombielinks.lua +++ /dev/null @@ -1,68 +0,0 @@ -// - -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/mapping/sh_constructor.lua b/nzombies3/gamemode/mapping/sh_constructor.lua deleted file mode 100644 index 628d2e60..00000000 --- a/nzombies3/gamemode/mapping/sh_constructor.lua +++ /dev/null @@ -1,6 +0,0 @@ -//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 deleted file mode 100644 index 5c479ab6..00000000 --- a/nzombies3/gamemode/mapping/sv_mapping.lua +++ /dev/null @@ -1,163 +0,0 @@ -// - -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 - - - -//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 ) \ No newline at end of file diff --git a/nzombies3/gamemode/mapping/sv_saveload.lua b/nzombies3/gamemode/mapping/sv_saveload.lua deleted file mode 100644 index 0795f094..00000000 --- a/nzombies3/gamemode/mapping/sv_saveload.lua +++ /dev/null @@ -1,265 +0,0 @@ -// - -nz.Mapping.Data.Version = 350 //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 - - 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 - }) - end - - local player_spawns = {} - for k,v in pairs(ents.FindByClass("player_spawns")) do - table.insert(player_spawns, { - pos = v:GetPos(), - }) - end - - 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, { - pos = v:GetPos(), - angle = v:GetAngles( ), - 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, { - pos = v:GetPos(), - angle = v:GetAngles(), - }) - end - - local perk_machinespawns = {} - for k,v in pairs(ents.FindByClass("perk_machine")) do - table.insert(perk_machinespawns, { - pos = v:GetPos(), - angle = v:GetAngles(), - id = v:GetPerkID(), - }) - 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() 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 - - main["ZedSpawns"] = zed_spawns - main["PlayerSpawns"] = player_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["DoorSetup"] = door_setup - main["BreakEntry"] = break_entry - - 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" ) - -end - -function nz.Mapping.Functions.ClearConfig() - print("[NZ] Clearing current map") - - 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 - - for k,v in pairs(ents.FindByClass("wall_buys")) do - v:Remove() - end - - 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 - - //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 - - //Sync - nz.Rounds.Functions.SendSync() - nz.Doors.Functions.SendSync() -end - -function nz.Mapping.Functions.LoadConfig( name ) - - local filepath = "nz/"..name - - if file.Exists( filepath, "DATA" ) then - print("[NZ] MAP CONFIG FOUND!") - - - - local data = util.JSONToTable( file.Read( filepath, "DATA" ) ) - - 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 - - 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 - - nz.Mapping.Functions.ClearConfig() - - print("[NZ] Loading " .. filepath .. "...") - - - //Start sorting the data - - for k,v in pairs(data.ZedSpawns) do - nz.Mapping.Functions.ZedSpawn(v.pos, v.link) - end - - for k,v in pairs(data.PlayerSpawns) do - nz.Mapping.Functions.PlayerSpawn(v.pos) - end - - 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.BuyablePropSpawns) do - nz.Mapping.Functions.PropBuy(v.pos, v.angle, v.model, v.flags) - end - - for k,v in pairs(data.ElecSpawns) do - 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 - nz.Mapping.Functions.BoxSpawn(v.pos, v.angle) - end - - for k,v in pairs(data.PerkMachineSpawns) do - nz.Mapping.Functions.PerkMachine(v.pos, v.angle, v.id) - end - - //Normal Map doors - for k,v in pairs(data.DoorSetup) do - nz.Doors.Functions.CreateMapDoorLink(k, v.flags) - end - - if version >= 350 then - //Barricades - for k,v in pairs(data.BreakEntry) do - nz.Mapping.Functions.BreakEntry(v.pos, v.angle) - 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()..".txt") - end) -end) \ No newline at end of file diff --git a/nzombies3/gamemode/mapping/sv_validation.lua b/nzombies3/gamemode/mapping/sv_validation.lua deleted file mode 100644 index db8dc054..00000000 --- a/nzombies3/gamemode/mapping/sv_validation.lua +++ /dev/null @@ -1,35 +0,0 @@ -// - -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 deleted file mode 100644 index 63407406..00000000 --- a/nzombies3/gamemode/misc/sh_constructor.lua +++ /dev/null @@ -1,6 +0,0 @@ -//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 deleted file mode 100644 index f984f79e..00000000 --- a/nzombies3/gamemode/misc/sh_weightedrandom.lua +++ /dev/null @@ -1,24 +0,0 @@ -//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_chatcommands.lua b/nzombies3/gamemode/misc/sv_chatcommands.lua deleted file mode 100644 index c58b889d..00000000 --- a/nzombies3/gamemode/misc/sv_chatcommands.lua +++ /dev/null @@ -1,105 +0,0 @@ -//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 deleted file mode 100644 index 099ddf3b..00000000 --- a/nzombies3/gamemode/misc/sv_consolecommands.lua +++ /dev/null @@ -1,39 +0,0 @@ -//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 deleted file mode 100644 index 8e74d81c..00000000 --- a/nzombies3/gamemode/misc/sv_resources.lua +++ /dev/null @@ -1,8 +0,0 @@ -//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/perks/sh_constructor.lua b/nzombies3/gamemode/perks/sh_constructor.lua deleted file mode 100644 index b5ed3a5d..00000000 --- a/nzombies3/gamemode/perks/sh_constructor.lua +++ /dev/null @@ -1,8 +0,0 @@ -//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 deleted file mode 100644 index 8d7054cb..00000000 --- a/nzombies3/gamemode/perks/sh_meta.lua +++ /dev/null @@ -1,53 +0,0 @@ -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 deleted file mode 100644 index ccc8176e..00000000 --- a/nzombies3/gamemode/perks/sh_perks.lua +++ /dev/null @@ -1,121 +0,0 @@ -// - -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/player_class/sh_constructor.lua b/nzombies3/gamemode/player_class/sh_constructor.lua deleted file mode 100644 index bfd0206f..00000000 --- a/nzombies3/gamemode/player_class/sh_constructor.lua +++ /dev/null @@ -1,6 +0,0 @@ -//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 deleted file mode 100644 index 5deaaeb8..00000000 --- a/nzombies3/gamemode/player_class/sh_player_create.lua +++ /dev/null @@ -1,35 +0,0 @@ -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" ) - -end - -player_manager.RegisterClass( "player_create", PLAYER, "player_default" ) \ No newline at end of file diff --git a/nzombies3/gamemode/player_class/sh_player_ingame.lua b/nzombies3/gamemode/player_class/sh_player_ingame.lua deleted file mode 100644 index 742d5437..00000000 --- a/nzombies3/gamemode/player_class/sh_player_ingame.lua +++ /dev/null @@ -1,55 +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 - -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 deleted file mode 100644 index 10229428..00000000 --- a/nzombies3/gamemode/player_class/sv_players.lua +++ /dev/null @@ -1,47 +0,0 @@ -// - -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() -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/nzombies3/gamemode/points/sh_points.lua b/nzombies3/gamemode/points/sh_points.lua deleted file mode 100644 index 93ee446b..00000000 --- a/nzombies3/gamemode/points/sh_points.lua +++ /dev/null @@ -1,36 +0,0 @@ -local _PLAYER = FindMetaTable("Player") - -function _PLAYER:GetPoints() - return self:GetNWInt("points") or 0 -end - -function _PLAYER:HasPoints(amount) - return self:GetPoints() >= amount -end - -function _PLAYER:CanAfford(amount) - return (self:GetPoints() - amount) >= 0 -end - -if (SERVER) then - -- Sets the character's amount of currency to a specific value. - function _PLAYER:SetPoints(amount) - amount = math.Round(amount, 2) - self:SetNWInt("points", amount) - end - - -- Quick function to set the money to the current amount plus an amount specified. - function _PLAYER:GivePoints(amount) - //If double points is on. - if nz.PowerUps.Functions.IsPowerupActive("dp") then - amount = amount * 2 - end - self:SetPoints(self:GetPoints() + amount) - end - - -- Takes away a certain amount by inverting the amount specified. - function _PLAYER:TakePoints(amount) - //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 \ No newline at end of file diff --git a/nzombies3/gamemode/powerups/sh_constructor.lua b/nzombies3/gamemode/powerups/sh_constructor.lua deleted file mode 100644 index fdb2baf7..00000000 --- a/nzombies3/gamemode/powerups/sh_constructor.lua +++ /dev/null @@ -1,8 +0,0 @@ -//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 deleted file mode 100644 index e474de65..00000000 --- a/nzombies3/gamemode/powerups/sh_powerups.lua +++ /dev/null @@ -1,143 +0,0 @@ -// - -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 deleted file mode 100644 index b2e58b73..00000000 --- a/nzombies3/gamemode/powerups/sh_sync.lua +++ /dev/null @@ -1,29 +0,0 @@ -//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 deleted file mode 100644 index d133f4e6..00000000 --- a/nzombies3/gamemode/powerups/sv_powerups.lua +++ /dev/null @@ -1,36 +0,0 @@ -// - -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 deleted file mode 100644 index bd8a5ca9..00000000 --- a/nzombies3/gamemode/props_menu/cl_menu.lua +++ /dev/null @@ -1,75 +0,0 @@ - -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 deleted file mode 100644 index 11c71a52..00000000 --- a/nzombies3/gamemode/props_menu/sh_constructor.lua +++ /dev/null @@ -1,8 +0,0 @@ -//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 deleted file mode 100644 index 1800e61a..00000000 --- a/nzombies3/gamemode/props_menu/sh_net.lua +++ /dev/null @@ -1,40 +0,0 @@ -//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 deleted file mode 100644 index 196e73e5..00000000 --- a/nzombies3/gamemode/props_menu/sh_populate.lua +++ /dev/null @@ -1,24 +0,0 @@ -// - -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 deleted file mode 100644 index 2ebe7ee2..00000000 --- a/nzombies3/gamemode/random_box/sh_constructor.lua +++ /dev/null @@ -1,6 +0,0 @@ -//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 deleted file mode 100644 index f858a145..00000000 --- a/nzombies3/gamemode/random_box/sv_random_box.lua +++ /dev/null @@ -1,62 +0,0 @@ -// - -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 deleted file mode 100644 index 3532bb29..00000000 --- a/nzombies3/gamemode/round_handler/sh_constructor.lua +++ /dev/null @@ -1,21 +0,0 @@ -//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 deleted file mode 100644 index ed0c30c0..00000000 --- a/nzombies3/gamemode/round_handler/sh_sync.lua +++ /dev/null @@ -1,36 +0,0 @@ -//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 deleted file mode 100644 index 91a0f0be..00000000 --- a/nzombies3/gamemode/round_handler/sv_handler.lua +++ /dev/null @@ -1,261 +0,0 @@ -// - -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() - -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 - print(pre) - 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.Data.CurrentState == ROUND_PROG or nz.Rounds.Data.CurrentState == ROUND_PREP) 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 deleted file mode 100644 index 60970b81..00000000 --- a/nzombies3/gamemode/round_handler/sv_player.lua +++ /dev/null @@ -1,91 +0,0 @@ -// - -//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_validation.lua b/nzombies3/gamemode/round_handler/sv_validation.lua deleted file mode 100644 index 8f802467..00000000 --- a/nzombies3/gamemode/round_handler/sv_validation.lua +++ /dev/null @@ -1,41 +0,0 @@ -// - -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 diff --git a/nzombies3/gamemode/shared.lua b/nzombies3/gamemode/shared.lua deleted file mode 100644 index 1dc25317..00000000 --- a/nzombies3/gamemode/shared.lua +++ /dev/null @@ -1,25 +0,0 @@ -GM.Name = "nZombies 3" -GM.Author = "N/A" -GM.Email = "N/A" -GM.Website = "N/A" - -// Constants \\ - -//Round Constants - -ROUND_INIT = 0 -ROUND_PREP = 1 -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 ) ) - -//DeriveGamemode("sandbox") \ No newline at end of file diff --git a/nzombies3/gamemode/spectator/sh_constructor.lua b/nzombies3/gamemode/spectator/sh_constructor.lua deleted file mode 100644 index 0ab01ca9..00000000 --- a/nzombies3/gamemode/spectator/sh_constructor.lua +++ /dev/null @@ -1,6 +0,0 @@ -//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 deleted file mode 100644 index e3cdedc4..00000000 --- a/nzombies3/gamemode/spectator/sv_gm.lua +++ /dev/null @@ -1,45 +0,0 @@ -// - -//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 deleted file mode 100644 index ef33bb7b..00000000 --- a/nzombies3/gamemode/spectator/sv_override.lua +++ /dev/null @@ -1,39 +0,0 @@ -//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 deleted file mode 100644 index 7f4a9e20..00000000 --- a/nzombies3/gamemode/spectator/sv_player.lua +++ /dev/null @@ -1,45 +0,0 @@ -// - -//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_fas2.lua b/nzombies3/gamemode/weapons/sh_fas2.lua deleted file mode 100644 index 04b3b6d6..00000000 --- a/nzombies3/gamemode/weapons/sh_fas2.lua +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100644 index 9b4c01f8..00000000 --- a/nzombies3/gamemode/weapons/sh_wep_sync.lua +++ /dev/null @@ -1,36 +0,0 @@ -//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 deleted file mode 100644 index ebe77105..00000000 --- a/nzombies3/gamemode/weapons/sv_ammo.lua +++ /dev/null @@ -1,43 +0,0 @@ -//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 deleted file mode 100644 index a56a3446..00000000 --- a/nzombies3/gamemode/weapons/sv_weps.lua +++ /dev/null @@ -1,103 +0,0 @@ -// - -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(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 - end) - end -end - -hook.Add("OnEntityCreated", "nz.Weps.OnEntityCreated", nz.Weps.Functions.OnWepCreated) diff --git a/nzombies3/nzombies3.txt b/nzombies3/nzombies3.txt deleted file mode 100644 index 2a5005d0..00000000 --- a/nzombies3/nzombies3.txt +++ /dev/null @@ -1,14 +0,0 @@ -"nzombies" -{ - "base" "base" - "title" "nZombies 3" - "version" "3.0" - "menusystem" "1" - - "author_name" "Alig96" - "author_email" "" - - "icon" "" - "info" "" - "hide" "0" -} diff --git a/nzombies3/content/resource/fonts/DK Umbilical Noose.ttf b/resource/fonts/DK Umbilical Noose.ttf similarity index 100% rename from nzombies3/content/resource/fonts/DK Umbilical Noose.ttf rename to resource/fonts/DK Umbilical Noose.ttf diff --git a/sound/nz/bowie/draw/bowie_catch.wav b/sound/nz/bowie/draw/bowie_catch.wav new file mode 100644 index 00000000..3ca027d4 Binary files /dev/null and b/sound/nz/bowie/draw/bowie_catch.wav differ diff --git a/sound/nz/bowie/draw/bowie_start.wav b/sound/nz/bowie/draw/bowie_start.wav new file mode 100644 index 00000000..a0b1a9d1 Binary files /dev/null and b/sound/nz/bowie/draw/bowie_start.wav differ diff --git a/sound/nz/bowie/draw/bowie_toss.wav b/sound/nz/bowie/draw/bowie_toss.wav new file mode 100644 index 00000000..bb9f9526 Binary files /dev/null and b/sound/nz/bowie/draw/bowie_toss.wav differ diff --git a/sound/nz/bowie/draw/bowie_turn.wav b/sound/nz/bowie/draw/bowie_turn.wav new file mode 100644 index 00000000..9c6c2bdb Binary files /dev/null and b/sound/nz/bowie/draw/bowie_turn.wav differ diff --git a/sound/nz/bowie/stab/bowie_stab_00.wav b/sound/nz/bowie/stab/bowie_stab_00.wav new file mode 100644 index 00000000..004df317 Binary files /dev/null and b/sound/nz/bowie/stab/bowie_stab_00.wav differ diff --git a/sound/nz/bowie/stab/bowie_stab_01.wav b/sound/nz/bowie/stab/bowie_stab_01.wav new file mode 100644 index 00000000..c9a80ae8 Binary files /dev/null and b/sound/nz/bowie/stab/bowie_stab_01.wav differ diff --git a/sound/nz/bowie/stab/bowie_stab_02.wav b/sound/nz/bowie/stab/bowie_stab_02.wav new file mode 100644 index 00000000..aaa1156b Binary files /dev/null and b/sound/nz/bowie/stab/bowie_stab_02.wav differ diff --git a/sound/nz/bowie/swing/bowie_swing_00.wav b/sound/nz/bowie/swing/bowie_swing_00.wav new file mode 100644 index 00000000..6799531c Binary files /dev/null and b/sound/nz/bowie/swing/bowie_swing_00.wav differ diff --git a/sound/nz/bowie/swing/bowie_swing_01.wav b/sound/nz/bowie/swing/bowie_swing_01.wav new file mode 100644 index 00000000..839eef98 Binary files /dev/null and b/sound/nz/bowie/swing/bowie_swing_01.wav differ diff --git a/sound/nz/bowie/swing/bowie_swing_02.wav b/sound/nz/bowie/swing/bowie_swing_02.wav new file mode 100644 index 00000000..91d321ae Binary files /dev/null and b/sound/nz/bowie/swing/bowie_swing_02.wav differ diff --git a/sound/nz/easteregg/motd_bad.wav b/sound/nz/easteregg/motd_bad.wav new file mode 100644 index 00000000..16504f5f Binary files /dev/null and b/sound/nz/easteregg/motd_bad.wav differ diff --git a/sound/nz/easteregg/motd_good.wav b/sound/nz/easteregg/motd_good.wav new file mode 100644 index 00000000..013b768c Binary files /dev/null and b/sound/nz/easteregg/motd_good.wav differ diff --git a/sound/nz/easteregg/motd_round-01.wav b/sound/nz/easteregg/motd_round-01.wav new file mode 100644 index 00000000..a86dd9b9 Binary files /dev/null and b/sound/nz/easteregg/motd_round-01.wav differ diff --git a/sound/nz/easteregg/motd_round-02.wav b/sound/nz/easteregg/motd_round-02.wav new file mode 100644 index 00000000..082d286a Binary files /dev/null and b/sound/nz/easteregg/motd_round-02.wav differ diff --git a/sound/nz/easteregg/motd_round-03.wav b/sound/nz/easteregg/motd_round-03.wav new file mode 100644 index 00000000..3b4eb0a5 Binary files /dev/null and b/sound/nz/easteregg/motd_round-03.wav differ diff --git a/sound/nz/easteregg/motd_round-04.wav b/sound/nz/easteregg/motd_round-04.wav new file mode 100644 index 00000000..2c1cc921 Binary files /dev/null and b/sound/nz/easteregg/motd_round-04.wav differ diff --git a/sound/nz/easteregg/motd_standard.wav b/sound/nz/easteregg/motd_standard.wav new file mode 100644 index 00000000..8c2420b6 Binary files /dev/null and b/sound/nz/easteregg/motd_standard.wav differ diff --git a/sound/nz/effects/board_slam_00.wav b/sound/nz/effects/board_slam_00.wav new file mode 100644 index 00000000..e264d5eb Binary files /dev/null and b/sound/nz/effects/board_slam_00.wav differ diff --git a/sound/nz/effects/board_slam_01.wav b/sound/nz/effects/board_slam_01.wav new file mode 100644 index 00000000..d43d3789 Binary files /dev/null and b/sound/nz/effects/board_slam_01.wav differ diff --git a/sound/nz/effects/board_slam_02.wav b/sound/nz/effects/board_slam_02.wav new file mode 100644 index 00000000..4bacb185 Binary files /dev/null and b/sound/nz/effects/board_slam_02.wav differ diff --git a/sound/nz/effects/board_slam_03.wav b/sound/nz/effects/board_slam_03.wav new file mode 100644 index 00000000..80ff2945 Binary files /dev/null and b/sound/nz/effects/board_slam_03.wav differ diff --git a/sound/nz/effects/board_slam_04.wav b/sound/nz/effects/board_slam_04.wav new file mode 100644 index 00000000..e0349ad9 Binary files /dev/null and b/sound/nz/effects/board_slam_04.wav differ diff --git a/sound/nz/effects/board_slam_05.wav b/sound/nz/effects/board_slam_05.wav new file mode 100644 index 00000000..82ab077e Binary files /dev/null and b/sound/nz/effects/board_slam_05.wav differ diff --git a/sound/nz/effects/buy.wav b/sound/nz/effects/buy.wav new file mode 100644 index 00000000..46d8c0f5 Binary files /dev/null and b/sound/nz/effects/buy.wav differ diff --git a/sound/nz/effects/pap_laser_shot.wav b/sound/nz/effects/pap_laser_shot.wav new file mode 100644 index 00000000..6f557b60 Binary files /dev/null and b/sound/nz/effects/pap_laser_shot.wav differ diff --git a/sound/nz/effects/pap_shoot_glock20.wav b/sound/nz/effects/pap_shoot_glock20.wav new file mode 100644 index 00000000..1dcb7462 Binary files /dev/null and b/sound/nz/effects/pap_shoot_glock20.wav differ diff --git a/sound/nz/effects/repair_ching.wav b/sound/nz/effects/repair_ching.wav new file mode 100644 index 00000000..03bfe86e Binary files /dev/null and b/sound/nz/effects/repair_ching.wav differ diff --git a/sound/nz/hellhound/attack/attack_00.wav b/sound/nz/hellhound/attack/attack_00.wav new file mode 100644 index 00000000..70ccd87a Binary files /dev/null and b/sound/nz/hellhound/attack/attack_00.wav differ diff --git a/sound/nz/hellhound/attack/attack_01.wav b/sound/nz/hellhound/attack/attack_01.wav new file mode 100644 index 00000000..3bd6c894 Binary files /dev/null and b/sound/nz/hellhound/attack/attack_01.wav differ diff --git a/sound/nz/hellhound/attack/attack_02.wav b/sound/nz/hellhound/attack/attack_02.wav new file mode 100644 index 00000000..9d5f714c Binary files /dev/null and b/sound/nz/hellhound/attack/attack_02.wav differ diff --git a/sound/nz/hellhound/attack/attack_03.wav b/sound/nz/hellhound/attack/attack_03.wav new file mode 100644 index 00000000..43d70f3c Binary files /dev/null and b/sound/nz/hellhound/attack/attack_03.wav differ diff --git a/sound/nz/hellhound/attack/attack_04.wav b/sound/nz/hellhound/attack/attack_04.wav new file mode 100644 index 00000000..36eab6d3 Binary files /dev/null and b/sound/nz/hellhound/attack/attack_04.wav differ diff --git a/sound/nz/hellhound/attack/attack_05.wav b/sound/nz/hellhound/attack/attack_05.wav new file mode 100644 index 00000000..a0716da5 Binary files /dev/null and b/sound/nz/hellhound/attack/attack_05.wav differ diff --git a/sound/nz/hellhound/attack/attack_06.wav b/sound/nz/hellhound/attack/attack_06.wav new file mode 100644 index 00000000..59962dea Binary files /dev/null and b/sound/nz/hellhound/attack/attack_06.wav differ diff --git a/sound/nz/hellhound/bite/bite_00.wav b/sound/nz/hellhound/bite/bite_00.wav new file mode 100644 index 00000000..ce0b0264 Binary files /dev/null and b/sound/nz/hellhound/bite/bite_00.wav differ diff --git a/sound/nz/hellhound/bite/bite_01.wav b/sound/nz/hellhound/bite/bite_01.wav new file mode 100644 index 00000000..468632e3 Binary files /dev/null and b/sound/nz/hellhound/bite/bite_01.wav differ diff --git a/sound/nz/hellhound/bite/bite_02.wav b/sound/nz/hellhound/bite/bite_02.wav new file mode 100644 index 00000000..e2a53a6e Binary files /dev/null and b/sound/nz/hellhound/bite/bite_02.wav differ diff --git a/sound/nz/hellhound/bite/bite_03.wav b/sound/nz/hellhound/bite/bite_03.wav new file mode 100644 index 00000000..754c14ce Binary files /dev/null and b/sound/nz/hellhound/bite/bite_03.wav differ diff --git a/sound/nz/hellhound/close/close_00.wav b/sound/nz/hellhound/close/close_00.wav new file mode 100644 index 00000000..9dc193ef Binary files /dev/null and b/sound/nz/hellhound/close/close_00.wav differ diff --git a/sound/nz/hellhound/close/close_01.wav b/sound/nz/hellhound/close/close_01.wav new file mode 100644 index 00000000..9496193a Binary files /dev/null and b/sound/nz/hellhound/close/close_01.wav differ diff --git a/sound/nz/hellhound/close/close_02.wav b/sound/nz/hellhound/close/close_02.wav new file mode 100644 index 00000000..74000450 Binary files /dev/null and b/sound/nz/hellhound/close/close_02.wav differ diff --git a/sound/nz/hellhound/close/close_03.wav b/sound/nz/hellhound/close/close_03.wav new file mode 100644 index 00000000..00c0adaa Binary files /dev/null and b/sound/nz/hellhound/close/close_03.wav differ diff --git a/sound/nz/hellhound/death/death0.wav b/sound/nz/hellhound/death/death0.wav new file mode 100644 index 00000000..f64403e3 Binary files /dev/null and b/sound/nz/hellhound/death/death0.wav differ diff --git a/sound/nz/hellhound/death/death1.wav b/sound/nz/hellhound/death/death1.wav new file mode 100644 index 00000000..bce58b76 Binary files /dev/null and b/sound/nz/hellhound/death/death1.wav differ diff --git a/sound/nz/hellhound/death/death2.wav b/sound/nz/hellhound/death/death2.wav new file mode 100644 index 00000000..6677ca8e Binary files /dev/null and b/sound/nz/hellhound/death/death2.wav differ diff --git a/sound/nz/hellhound/death/death3.wav b/sound/nz/hellhound/death/death3.wav new file mode 100644 index 00000000..8b3ecfd2 Binary files /dev/null and b/sound/nz/hellhound/death/death3.wav differ diff --git a/sound/nz/hellhound/death2/death0.wav b/sound/nz/hellhound/death2/death0.wav new file mode 100644 index 00000000..7bb67c49 Binary files /dev/null and b/sound/nz/hellhound/death2/death0.wav differ diff --git a/sound/nz/hellhound/death2/death1.wav b/sound/nz/hellhound/death2/death1.wav new file mode 100644 index 00000000..360c8f3a Binary files /dev/null and b/sound/nz/hellhound/death2/death1.wav differ diff --git a/sound/nz/hellhound/death2/death2.wav b/sound/nz/hellhound/death2/death2.wav new file mode 100644 index 00000000..26543125 Binary files /dev/null and b/sound/nz/hellhound/death2/death2.wav differ diff --git a/sound/nz/hellhound/death2/death3.wav b/sound/nz/hellhound/death2/death3.wav new file mode 100644 index 00000000..f67a494e Binary files /dev/null and b/sound/nz/hellhound/death2/death3.wav differ diff --git a/sound/nz/hellhound/death2/death4.wav b/sound/nz/hellhound/death2/death4.wav new file mode 100644 index 00000000..0e79c3fc Binary files /dev/null and b/sound/nz/hellhound/death2/death4.wav differ diff --git a/sound/nz/hellhound/death2/death5.wav b/sound/nz/hellhound/death2/death5.wav new file mode 100644 index 00000000..41f59979 Binary files /dev/null and b/sound/nz/hellhound/death2/death5.wav differ diff --git a/sound/nz/hellhound/death2/death6.wav b/sound/nz/hellhound/death2/death6.wav new file mode 100644 index 00000000..0a23d0e9 Binary files /dev/null and b/sound/nz/hellhound/death2/death6.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_00.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_00.wav new file mode 100644 index 00000000..60331910 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_00.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_01.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_01.wav new file mode 100644 index 00000000..a309b077 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_01.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_02.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_02.wav new file mode 100644 index 00000000..e76cf58d Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_02.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_03.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_03.wav new file mode 100644 index 00000000..856c326e Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_03.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_04.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_04.wav new file mode 100644 index 00000000..9fb7b85e Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_04.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_05.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_05.wav new file mode 100644 index 00000000..11aa5a11 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_05.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_06.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_06.wav new file mode 100644 index 00000000..390c9f04 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_06.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_07.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_07.wav new file mode 100644 index 00000000..581ec651 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_07.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_08.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_08.wav new file mode 100644 index 00000000..0da39d8f Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_08.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_09.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_09.wav new file mode 100644 index 00000000..659566be Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_09.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_10.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_10.wav new file mode 100644 index 00000000..a5678001 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_10.wav differ diff --git a/sound/nz/hellhound/dist_vox_a/dist_vox_a_11.wav b/sound/nz/hellhound/dist_vox_a/dist_vox_a_11.wav new file mode 100644 index 00000000..e9156021 Binary files /dev/null and b/sound/nz/hellhound/dist_vox_a/dist_vox_a_11.wav differ diff --git a/sound/nz/hellhound/explosion/exp0.wav b/sound/nz/hellhound/explosion/exp0.wav new file mode 100644 index 00000000..3c614712 Binary files /dev/null and b/sound/nz/hellhound/explosion/exp0.wav differ diff --git a/sound/nz/hellhound/explosion/exp1.wav b/sound/nz/hellhound/explosion/exp1.wav new file mode 100644 index 00000000..2949e914 Binary files /dev/null and b/sound/nz/hellhound/explosion/exp1.wav differ diff --git a/sound/nz/hellhound/explosion/exp2.wav b/sound/nz/hellhound/explosion/exp2.wav new file mode 100644 index 00000000..db0f0abd Binary files /dev/null and b/sound/nz/hellhound/explosion/exp2.wav differ diff --git a/sound/nz/hellhound/explosion/exp3.wav b/sound/nz/hellhound/explosion/exp3.wav new file mode 100644 index 00000000..acb3ae86 Binary files /dev/null and b/sound/nz/hellhound/explosion/exp3.wav differ diff --git a/sound/nz/hellhound/explosion/exp4.wav b/sound/nz/hellhound/explosion/exp4.wav new file mode 100644 index 00000000..d2417c34 Binary files /dev/null and b/sound/nz/hellhound/explosion/exp4.wav differ diff --git a/sound/nz/hellhound/explosion/exp5.wav b/sound/nz/hellhound/explosion/exp5.wav new file mode 100644 index 00000000..785162d2 Binary files /dev/null and b/sound/nz/hellhound/explosion/exp5.wav differ diff --git a/sound/nz/hellhound/fire/loop_00.wav b/sound/nz/hellhound/fire/loop_00.wav new file mode 100644 index 00000000..24b987a2 Binary files /dev/null and b/sound/nz/hellhound/fire/loop_00.wav differ diff --git a/sound/nz/hellhound/fire/loop_end.wav b/sound/nz/hellhound/fire/loop_end.wav new file mode 100644 index 00000000..ec732306 Binary files /dev/null and b/sound/nz/hellhound/fire/loop_end.wav differ diff --git a/sound/nz/hellhound/fire/zdog_breath_loop.wav b/sound/nz/hellhound/fire/zdog_breath_loop.wav new file mode 100644 index 00000000..b58130bc Binary files /dev/null and b/sound/nz/hellhound/fire/zdog_breath_loop.wav differ diff --git a/sound/nz/hellhound/spawn/prespawn.wav b/sound/nz/hellhound/spawn/prespawn.wav new file mode 100644 index 00000000..ed01eed3 Binary files /dev/null and b/sound/nz/hellhound/spawn/prespawn.wav differ diff --git a/sound/nz/hellhound/spawn/spawn_01.wav b/sound/nz/hellhound/spawn/spawn_01.wav new file mode 100644 index 00000000..6961d0d7 Binary files /dev/null and b/sound/nz/hellhound/spawn/spawn_01.wav differ diff --git a/sound/nz/hellhound/spawn/strike.wav b/sound/nz/hellhound/spawn/strike.wav new file mode 100644 index 00000000..9567c8db Binary files /dev/null and b/sound/nz/hellhound/spawn/strike.wav differ diff --git a/sound/nz/hellhound/step/step_00.wav b/sound/nz/hellhound/step/step_00.wav new file mode 100644 index 00000000..be408d96 Binary files /dev/null and b/sound/nz/hellhound/step/step_00.wav differ diff --git a/sound/nz/hellhound/step/step_01.wav b/sound/nz/hellhound/step/step_01.wav new file mode 100644 index 00000000..fa438881 Binary files /dev/null and b/sound/nz/hellhound/step/step_01.wav differ diff --git a/sound/nz/hellhound/step/step_02.wav b/sound/nz/hellhound/step/step_02.wav new file mode 100644 index 00000000..1abbabbd Binary files /dev/null and b/sound/nz/hellhound/step/step_02.wav differ diff --git a/sound/nz/hellhound/step/step_03.wav b/sound/nz/hellhound/step/step_03.wav new file mode 100644 index 00000000..bffd0421 Binary files /dev/null and b/sound/nz/hellhound/step/step_03.wav differ diff --git a/sound/nz/hellhound/step/step_04.wav b/sound/nz/hellhound/step/step_04.wav new file mode 100644 index 00000000..0675b3b5 Binary files /dev/null and b/sound/nz/hellhound/step/step_04.wav differ diff --git a/sound/nz/hellhound/step/step_05.wav b/sound/nz/hellhound/step/step_05.wav new file mode 100644 index 00000000..482427da Binary files /dev/null and b/sound/nz/hellhound/step/step_05.wav differ diff --git a/sound/nz/hellhound/step/step_06.wav b/sound/nz/hellhound/step/step_06.wav new file mode 100644 index 00000000..4ef18561 Binary files /dev/null and b/sound/nz/hellhound/step/step_06.wav differ diff --git a/sound/nz/hellhound/step/step_07.wav b/sound/nz/hellhound/step/step_07.wav new file mode 100644 index 00000000..9b014dfa Binary files /dev/null and b/sound/nz/hellhound/step/step_07.wav differ diff --git a/sound/nz/hellhound/step/step_08.wav b/sound/nz/hellhound/step/step_08.wav new file mode 100644 index 00000000..312675f2 Binary files /dev/null and b/sound/nz/hellhound/step/step_08.wav differ diff --git a/sound/nz/hellhound/step/step_09.wav b/sound/nz/hellhound/step/step_09.wav new file mode 100644 index 00000000..e9bddbf5 Binary files /dev/null and b/sound/nz/hellhound/step/step_09.wav differ diff --git a/sound/nz/hellhound/step/step_10.wav b/sound/nz/hellhound/step/step_10.wav new file mode 100644 index 00000000..9d36115d Binary files /dev/null and b/sound/nz/hellhound/step/step_10.wav differ diff --git a/sound/nz/hellhound/step/step_11.wav b/sound/nz/hellhound/step/step_11.wav new file mode 100644 index 00000000..92624035 Binary files /dev/null and b/sound/nz/hellhound/step/step_11.wav differ diff --git a/sound/nz/machines/gen_loop_start.wav b/sound/nz/machines/gen_loop_start.wav new file mode 100644 index 00000000..c9e18ac1 Binary files /dev/null and b/sound/nz/machines/gen_loop_start.wav differ diff --git a/sound/nz/machines/jingle/cherry_get.wav b/sound/nz/machines/jingle/cherry_get.wav new file mode 100644 index 00000000..2960d0b2 Binary files /dev/null and b/sound/nz/machines/jingle/cherry_get.wav differ diff --git a/sound/nz/machines/jingle/deadshot_get.wav b/sound/nz/machines/jingle/deadshot_get.wav new file mode 100644 index 00000000..15ea50eb Binary files /dev/null and b/sound/nz/machines/jingle/deadshot_get.wav differ diff --git a/sound/nz/machines/jingle/dtap2_get.wav b/sound/nz/machines/jingle/dtap2_get.wav new file mode 100644 index 00000000..b3137051 Binary files /dev/null and b/sound/nz/machines/jingle/dtap2_get.wav differ diff --git a/sound/nz/machines/jingle/dtap_get.wav b/sound/nz/machines/jingle/dtap_get.wav new file mode 100644 index 00000000..b3137051 Binary files /dev/null and b/sound/nz/machines/jingle/dtap_get.wav differ diff --git a/sound/nz/machines/jingle/jugg_get.wav b/sound/nz/machines/jingle/jugg_get.wav new file mode 100644 index 00000000..fe98798d Binary files /dev/null and b/sound/nz/machines/jingle/jugg_get.wav differ diff --git a/sound/nz/machines/jingle/mulekick_get.wav b/sound/nz/machines/jingle/mulekick_get.wav new file mode 100644 index 00000000..bc0ce39f Binary files /dev/null and b/sound/nz/machines/jingle/mulekick_get.wav differ diff --git a/sound/nz/machines/jingle/pap_get.wav b/sound/nz/machines/jingle/pap_get.wav new file mode 100644 index 00000000..56f9a060 Binary files /dev/null and b/sound/nz/machines/jingle/pap_get.wav differ diff --git a/sound/nz/machines/jingle/phd_get.wav b/sound/nz/machines/jingle/phd_get.wav new file mode 100644 index 00000000..bd450a7f Binary files /dev/null and b/sound/nz/machines/jingle/phd_get.wav differ diff --git a/sound/nz/machines/jingle/revive_get.wav b/sound/nz/machines/jingle/revive_get.wav new file mode 100644 index 00000000..97b63290 Binary files /dev/null and b/sound/nz/machines/jingle/revive_get.wav differ diff --git a/sound/nz/machines/jingle/speed_get.wav b/sound/nz/machines/jingle/speed_get.wav new file mode 100644 index 00000000..a8809dd3 Binary files /dev/null and b/sound/nz/machines/jingle/speed_get.wav differ diff --git a/sound/nz/machines/jingle/staminup_get.wav b/sound/nz/machines/jingle/staminup_get.wav new file mode 100644 index 00000000..e40ebec0 Binary files /dev/null and b/sound/nz/machines/jingle/staminup_get.wav differ diff --git a/sound/nz/machines/jingle/tombstone_get.wav b/sound/nz/machines/jingle/tombstone_get.wav new file mode 100644 index 00000000..691a7845 Binary files /dev/null and b/sound/nz/machines/jingle/tombstone_get.wav differ diff --git a/sound/nz/machines/jingle/vulture_get.wav b/sound/nz/machines/jingle/vulture_get.wav new file mode 100644 index 00000000..41b15fad Binary files /dev/null and b/sound/nz/machines/jingle/vulture_get.wav differ diff --git a/sound/nz/machines/jingle/whoswho_get.wav b/sound/nz/machines/jingle/whoswho_get.wav new file mode 100644 index 00000000..f85d54da Binary files /dev/null and b/sound/nz/machines/jingle/whoswho_get.wav differ diff --git a/sound/nz/machines/pap_ready.wav b/sound/nz/machines/pap_ready.wav new file mode 100644 index 00000000..10230910 Binary files /dev/null and b/sound/nz/machines/pap_ready.wav differ diff --git a/sound/nz/machines/pap_up.wav b/sound/nz/machines/pap_up.wav new file mode 100644 index 00000000..05dcea95 Binary files /dev/null and b/sound/nz/machines/pap_up.wav differ diff --git a/sound/nz/machines/power_down.wav b/sound/nz/machines/power_down.wav new file mode 100644 index 00000000..0db2c3af Binary files /dev/null and b/sound/nz/machines/power_down.wav differ diff --git a/sound/nz/machines/power_up.wav b/sound/nz/machines/power_up.wav new file mode 100644 index 00000000..6939ad22 Binary files /dev/null and b/sound/nz/machines/power_up.wav differ diff --git a/sound/nz/monkey/cymbals/monk_cymb_00.wav b/sound/nz/monkey/cymbals/monk_cymb_00.wav new file mode 100644 index 00000000..2028f64a Binary files /dev/null and b/sound/nz/monkey/cymbals/monk_cymb_00.wav differ diff --git a/sound/nz/monkey/cymbals/monk_cymb_01.wav b/sound/nz/monkey/cymbals/monk_cymb_01.wav new file mode 100644 index 00000000..95fb3304 Binary files /dev/null and b/sound/nz/monkey/cymbals/monk_cymb_01.wav differ diff --git a/sound/nz/monkey/cymbals/monk_cymb_02.wav b/sound/nz/monkey/cymbals/monk_cymb_02.wav new file mode 100644 index 00000000..2d971f34 Binary files /dev/null and b/sound/nz/monkey/cymbals/monk_cymb_02.wav differ diff --git a/sound/nz/monkey/cymbals/monk_cymb_03.wav b/sound/nz/monkey/cymbals/monk_cymb_03.wav new file mode 100644 index 00000000..1de21031 Binary files /dev/null and b/sound/nz/monkey/cymbals/monk_cymb_03.wav differ diff --git a/sound/nz/monkey/cymbals/monk_cymb_04.wav b/sound/nz/monkey/cymbals/monk_cymb_04.wav new file mode 100644 index 00000000..e657444c Binary files /dev/null and b/sound/nz/monkey/cymbals/monk_cymb_04.wav differ diff --git a/sound/nz/monkey/cymbals/monk_cymb_m.wav b/sound/nz/monkey/cymbals/monk_cymb_m.wav new file mode 100644 index 00000000..7d483f38 Binary files /dev/null and b/sound/nz/monkey/cymbals/monk_cymb_m.wav differ diff --git a/sound/nz/monkey/hat1.wav b/sound/nz/monkey/hat1.wav new file mode 100644 index 00000000..06b9a859 Binary files /dev/null and b/sound/nz/monkey/hat1.wav differ diff --git a/sound/nz/monkey/hat2.wav b/sound/nz/monkey/hat2.wav new file mode 100644 index 00000000..7a01c038 Binary files /dev/null and b/sound/nz/monkey/hat2.wav differ diff --git a/sound/nz/monkey/monkeyscream.wav b/sound/nz/monkey/monkeyscream.wav new file mode 100644 index 00000000..cc9773eb Binary files /dev/null and b/sound/nz/monkey/monkeyscream.wav differ diff --git a/sound/nz/monkey/music/song1.wav b/sound/nz/monkey/music/song1.wav new file mode 100644 index 00000000..cbc64ddc Binary files /dev/null and b/sound/nz/monkey/music/song1.wav differ diff --git a/sound/nz/monkey/music/song2.wav b/sound/nz/monkey/music/song2.wav new file mode 100644 index 00000000..666f6e05 Binary files /dev/null and b/sound/nz/monkey/music/song2.wav differ diff --git a/sound/nz/monkey/music/song3.wav b/sound/nz/monkey/music/song3.wav new file mode 100644 index 00000000..d5b6e289 Binary files /dev/null and b/sound/nz/monkey/music/song3.wav differ diff --git a/sound/nz/monkey/voice_bounce/land_00.wav b/sound/nz/monkey/voice_bounce/land_00.wav new file mode 100644 index 00000000..ff5d9958 Binary files /dev/null and b/sound/nz/monkey/voice_bounce/land_00.wav differ diff --git a/sound/nz/monkey/voice_bounce/land_01.wav b/sound/nz/monkey/voice_bounce/land_01.wav new file mode 100644 index 00000000..798a8354 Binary files /dev/null and b/sound/nz/monkey/voice_bounce/land_01.wav differ diff --git a/sound/nz/monkey/voice_bounce/land_02.wav b/sound/nz/monkey/voice_bounce/land_02.wav new file mode 100644 index 00000000..c7e73d58 Binary files /dev/null and b/sound/nz/monkey/voice_bounce/land_02.wav differ diff --git a/sound/nz/monkey/voice_bounce/land_03.wav b/sound/nz/monkey/voice_bounce/land_03.wav new file mode 100644 index 00000000..3ce99572 Binary files /dev/null and b/sound/nz/monkey/voice_bounce/land_03.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_00.wav b/sound/nz/monkey/voice_explosion/explo_vox_00.wav new file mode 100644 index 00000000..b485947e Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_00.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_01.wav b/sound/nz/monkey/voice_explosion/explo_vox_01.wav new file mode 100644 index 00000000..06f7525d Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_01.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_02.wav b/sound/nz/monkey/voice_explosion/explo_vox_02.wav new file mode 100644 index 00000000..0be1dd15 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_02.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_03.wav b/sound/nz/monkey/voice_explosion/explo_vox_03.wav new file mode 100644 index 00000000..39c866e2 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_03.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_04.wav b/sound/nz/monkey/voice_explosion/explo_vox_04.wav new file mode 100644 index 00000000..2e2718a2 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_04.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_05.wav b/sound/nz/monkey/voice_explosion/explo_vox_05.wav new file mode 100644 index 00000000..36a662b8 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_05.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_06.wav b/sound/nz/monkey/voice_explosion/explo_vox_06.wav new file mode 100644 index 00000000..563264fc Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_06.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_07.wav b/sound/nz/monkey/voice_explosion/explo_vox_07.wav new file mode 100644 index 00000000..935d1e7e Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_07.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_08.wav b/sound/nz/monkey/voice_explosion/explo_vox_08.wav new file mode 100644 index 00000000..07809df1 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_08.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_09.wav b/sound/nz/monkey/voice_explosion/explo_vox_09.wav new file mode 100644 index 00000000..9ee3256c Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_09.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_10.wav b/sound/nz/monkey/voice_explosion/explo_vox_10.wav new file mode 100644 index 00000000..74697672 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_10.wav differ diff --git a/sound/nz/monkey/voice_explosion/explo_vox_11.wav b/sound/nz/monkey/voice_explosion/explo_vox_11.wav new file mode 100644 index 00000000..447713d4 Binary files /dev/null and b/sound/nz/monkey/voice_explosion/explo_vox_11.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_00.wav b/sound/nz/monkey/voice_prime/raise_vox_00.wav new file mode 100644 index 00000000..1dd4c286 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_00.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_01.wav b/sound/nz/monkey/voice_prime/raise_vox_01.wav new file mode 100644 index 00000000..c050427b Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_01.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_02.wav b/sound/nz/monkey/voice_prime/raise_vox_02.wav new file mode 100644 index 00000000..312d1d26 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_02.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_03.wav b/sound/nz/monkey/voice_prime/raise_vox_03.wav new file mode 100644 index 00000000..e5006fa8 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_03.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_04.wav b/sound/nz/monkey/voice_prime/raise_vox_04.wav new file mode 100644 index 00000000..5f8d1d65 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_04.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_05.wav b/sound/nz/monkey/voice_prime/raise_vox_05.wav new file mode 100644 index 00000000..8c550596 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_05.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_06.wav b/sound/nz/monkey/voice_prime/raise_vox_06.wav new file mode 100644 index 00000000..ef5bd821 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_06.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_07.wav b/sound/nz/monkey/voice_prime/raise_vox_07.wav new file mode 100644 index 00000000..46d1a86e Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_07.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_08.wav b/sound/nz/monkey/voice_prime/raise_vox_08.wav new file mode 100644 index 00000000..9aae64d1 Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_08.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_09.wav b/sound/nz/monkey/voice_prime/raise_vox_09.wav new file mode 100644 index 00000000..8651006a Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_09.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_10.wav b/sound/nz/monkey/voice_prime/raise_vox_10.wav new file mode 100644 index 00000000..23a3e12b Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_10.wav differ diff --git a/sound/nz/monkey/voice_prime/raise_vox_11.wav b/sound/nz/monkey/voice_prime/raise_vox_11.wav new file mode 100644 index 00000000..4fbf4f4b Binary files /dev/null and b/sound/nz/monkey/voice_prime/raise_vox_11.wav differ diff --git a/sound/nz/monkey/voice_throw/throw_00.wav b/sound/nz/monkey/voice_throw/throw_00.wav new file mode 100644 index 00000000..6f8a4300 Binary files /dev/null and b/sound/nz/monkey/voice_throw/throw_00.wav differ diff --git a/sound/nz/monkey/voice_throw/throw_01.wav b/sound/nz/monkey/voice_throw/throw_01.wav new file mode 100644 index 00000000..02d923f3 Binary files /dev/null and b/sound/nz/monkey/voice_throw/throw_01.wav differ diff --git a/sound/nz/monkey/voice_throw/throw_02.wav b/sound/nz/monkey/voice_throw/throw_02.wav new file mode 100644 index 00000000..dabd9ba5 Binary files /dev/null and b/sound/nz/monkey/voice_throw/throw_02.wav differ diff --git a/sound/nz/monkey/voice_throw/throw_03.wav b/sound/nz/monkey/voice_throw/throw_03.wav new file mode 100644 index 00000000..49a3335c Binary files /dev/null and b/sound/nz/monkey/voice_throw/throw_03.wav differ diff --git a/sound/nz/monkey/wind_monkeybomb.wav b/sound/nz/monkey/wind_monkeybomb.wav new file mode 100644 index 00000000..95a609a6 Binary files /dev/null and b/sound/nz/monkey/wind_monkeybomb.wav differ diff --git a/sound/nz/panzer/ambient/mech_ambi_00.wav b/sound/nz/panzer/ambient/mech_ambi_00.wav new file mode 100644 index 00000000..482bb0eb Binary files /dev/null and b/sound/nz/panzer/ambient/mech_ambi_00.wav differ diff --git a/sound/nz/panzer/ambient/mech_ambi_01.wav b/sound/nz/panzer/ambient/mech_ambi_01.wav new file mode 100644 index 00000000..c74c9aa8 Binary files /dev/null and b/sound/nz/panzer/ambient/mech_ambi_01.wav differ diff --git a/sound/nz/panzer/ambient/mech_ambi_02.wav b/sound/nz/panzer/ambient/mech_ambi_02.wav new file mode 100644 index 00000000..79383d01 Binary files /dev/null and b/sound/nz/panzer/ambient/mech_ambi_02.wav differ diff --git a/sound/nz/panzer/attack/mech_swing_00.wav b/sound/nz/panzer/attack/mech_swing_00.wav new file mode 100644 index 00000000..8c15a464 Binary files /dev/null and b/sound/nz/panzer/attack/mech_swing_00.wav differ diff --git a/sound/nz/panzer/attack/mech_swing_01.wav b/sound/nz/panzer/attack/mech_swing_01.wav new file mode 100644 index 00000000..36f21684 Binary files /dev/null and b/sound/nz/panzer/attack/mech_swing_01.wav differ diff --git a/sound/nz/panzer/attack/mech_swing_02.wav b/sound/nz/panzer/attack/mech_swing_02.wav new file mode 100644 index 00000000..547b98cb Binary files /dev/null and b/sound/nz/panzer/attack/mech_swing_02.wav differ diff --git a/sound/nz/panzer/claw/mech_claw_00.wav b/sound/nz/panzer/claw/mech_claw_00.wav new file mode 100644 index 00000000..19750663 Binary files /dev/null and b/sound/nz/panzer/claw/mech_claw_00.wav differ diff --git a/sound/nz/panzer/claw/mech_claw_01.wav b/sound/nz/panzer/claw/mech_claw_01.wav new file mode 100644 index 00000000..2151a6a2 Binary files /dev/null and b/sound/nz/panzer/claw/mech_claw_01.wav differ diff --git a/sound/nz/panzer/claw/mech_claw_02.wav b/sound/nz/panzer/claw/mech_claw_02.wav new file mode 100644 index 00000000..c2ca5cc6 Binary files /dev/null and b/sound/nz/panzer/claw/mech_claw_02.wav differ diff --git a/sound/nz/panzer/claw/mech_claw_loop.wav b/sound/nz/panzer/claw/mech_claw_loop.wav new file mode 100644 index 00000000..f4f3b4f8 Binary files /dev/null and b/sound/nz/panzer/claw/mech_claw_loop.wav differ diff --git a/sound/nz/panzer/footsteps/mech_footstep_00.wav b/sound/nz/panzer/footsteps/mech_footstep_00.wav new file mode 100644 index 00000000..19aa819d Binary files /dev/null and b/sound/nz/panzer/footsteps/mech_footstep_00.wav differ diff --git a/sound/nz/panzer/footsteps/mech_footstep_01.wav b/sound/nz/panzer/footsteps/mech_footstep_01.wav new file mode 100644 index 00000000..791015f0 Binary files /dev/null and b/sound/nz/panzer/footsteps/mech_footstep_01.wav differ diff --git a/sound/nz/panzer/footsteps/mech_footstep_02.wav b/sound/nz/panzer/footsteps/mech_footstep_02.wav new file mode 100644 index 00000000..3ebed794 Binary files /dev/null and b/sound/nz/panzer/footsteps/mech_footstep_02.wav differ diff --git a/sound/nz/panzer/footsteps/mech_footstep_03.wav b/sound/nz/panzer/footsteps/mech_footstep_03.wav new file mode 100644 index 00000000..eb46ffc8 Binary files /dev/null and b/sound/nz/panzer/footsteps/mech_footstep_03.wav differ diff --git a/sound/nz/panzer/land/mech_land_00.wav b/sound/nz/panzer/land/mech_land_00.wav new file mode 100644 index 00000000..9e7879d0 Binary files /dev/null and b/sound/nz/panzer/land/mech_land_00.wav differ diff --git a/sound/nz/panzer/land/mech_land_01.wav b/sound/nz/panzer/land/mech_land_01.wav new file mode 100644 index 00000000..d386a9aa Binary files /dev/null and b/sound/nz/panzer/land/mech_land_01.wav differ diff --git a/sound/nz/panzer/land/mech_land_02.wav b/sound/nz/panzer/land/mech_land_02.wav new file mode 100644 index 00000000..0dc5f52f Binary files /dev/null and b/sound/nz/panzer/land/mech_land_02.wav differ diff --git a/sound/nz/panzer/mech_alarm.wav b/sound/nz/panzer/mech_alarm.wav new file mode 100644 index 00000000..e6b39432 Binary files /dev/null and b/sound/nz/panzer/mech_alarm.wav differ diff --git a/sound/nz/panzer/mech_explode.wav b/sound/nz/panzer/mech_explode.wav new file mode 100644 index 00000000..68c5036b Binary files /dev/null and b/sound/nz/panzer/mech_explode.wav differ diff --git a/sound/nz/panzer/mech_flamethrower_loop.wav b/sound/nz/panzer/mech_flamethrower_loop.wav new file mode 100644 index 00000000..d5bf1d98 Binary files /dev/null and b/sound/nz/panzer/mech_flamethrower_loop.wav differ diff --git a/sound/nz/panzer/mech_flamethrower_start.wav b/sound/nz/panzer/mech_flamethrower_start.wav new file mode 100644 index 00000000..c22b2c61 Binary files /dev/null and b/sound/nz/panzer/mech_flamethrower_start.wav differ diff --git a/sound/nz/panzer/mech_intro.wav b/sound/nz/panzer/mech_intro.wav new file mode 100644 index 00000000..5a280f2e Binary files /dev/null and b/sound/nz/panzer/mech_intro.wav differ diff --git a/sound/nz/panzer/mech_killshot.wav b/sound/nz/panzer/mech_killshot.wav new file mode 100644 index 00000000..e5d0b643 Binary files /dev/null and b/sound/nz/panzer/mech_killshot.wav differ diff --git a/sound/nz/panzer/mech_rocket_loop.wav b/sound/nz/panzer/mech_rocket_loop.wav new file mode 100644 index 00000000..f3ba6786 Binary files /dev/null and b/sound/nz/panzer/mech_rocket_loop.wav differ diff --git a/sound/nz/panzer/mech_rocket_shot.wav b/sound/nz/panzer/mech_rocket_shot.wav new file mode 100644 index 00000000..27be738e Binary files /dev/null and b/sound/nz/panzer/mech_rocket_shot.wav differ diff --git a/sound/nz/panzer/servo/mech_servo_00.wav b/sound/nz/panzer/servo/mech_servo_00.wav new file mode 100644 index 00000000..e31c3f4c Binary files /dev/null and b/sound/nz/panzer/servo/mech_servo_00.wav differ diff --git a/sound/nz/panzer/servo/mech_servo_01.wav b/sound/nz/panzer/servo/mech_servo_01.wav new file mode 100644 index 00000000..20e1f134 Binary files /dev/null and b/sound/nz/panzer/servo/mech_servo_01.wav differ diff --git a/sound/nz/perks/burp.wav b/sound/nz/perks/burp.wav new file mode 100644 index 00000000..ba8ed8a7 Binary files /dev/null and b/sound/nz/perks/burp.wav differ diff --git a/sound/nz/perks/buy.wav b/sound/nz/perks/buy.wav new file mode 100644 index 00000000..d9fb4bcf Binary files /dev/null and b/sound/nz/perks/buy.wav differ diff --git a/sound/nz/perks/drink.wav b/sound/nz/perks/drink.wav new file mode 100644 index 00000000..56f70fac Binary files /dev/null and b/sound/nz/perks/drink.wav differ diff --git a/sound/nz/perks/knuckle_00.wav b/sound/nz/perks/knuckle_00.wav new file mode 100644 index 00000000..53e3b8f0 Binary files /dev/null and b/sound/nz/perks/knuckle_00.wav differ diff --git a/sound/nz/perks/knuckle_01.wav b/sound/nz/perks/knuckle_01.wav new file mode 100644 index 00000000..d5774524 Binary files /dev/null and b/sound/nz/perks/knuckle_01.wav differ diff --git a/sound/nz/perks/open.wav b/sound/nz/perks/open.wav new file mode 100644 index 00000000..be6e1fc4 Binary files /dev/null and b/sound/nz/perks/open.wav differ diff --git a/sound/nz/perks/smash.wav b/sound/nz/perks/smash.wav new file mode 100644 index 00000000..ad7c37f9 Binary files /dev/null and b/sound/nz/perks/smash.wav differ diff --git a/sound/nz/powerups/carp_loop.wav b/sound/nz/powerups/carp_loop.wav new file mode 100644 index 00000000..08d926a0 Binary files /dev/null and b/sound/nz/powerups/carp_loop.wav differ diff --git a/sound/nz/powerups/carpenter.wav b/sound/nz/powerups/carpenter.wav new file mode 100644 index 00000000..ac9f3c8c Binary files /dev/null and b/sound/nz/powerups/carpenter.wav differ diff --git a/nzombies3/content/sound/nz/powerups/double_points.mp3 b/sound/nz/powerups/double_points.mp3 similarity index 100% rename from nzombies3/content/sound/nz/powerups/double_points.mp3 rename to sound/nz/powerups/double_points.mp3 diff --git a/sound/nz/powerups/fire_sale_announcer.wav b/sound/nz/powerups/fire_sale_announcer.wav new file mode 100644 index 00000000..302cbc1b Binary files /dev/null and b/sound/nz/powerups/fire_sale_announcer.wav differ diff --git a/nzombies3/content/sound/nz/powerups/insta_kill.mp3 b/sound/nz/powerups/insta_kill.mp3 similarity index 100% rename from nzombies3/content/sound/nz/powerups/insta_kill.mp3 rename to sound/nz/powerups/insta_kill.mp3 diff --git a/nzombies3/content/sound/nz/powerups/max_ammo.mp3 b/sound/nz/powerups/max_ammo.mp3 similarity index 100% rename from nzombies3/content/sound/nz/powerups/max_ammo.mp3 rename to sound/nz/powerups/max_ammo.mp3 diff --git a/sound/nz/powerups/nuke.wav b/sound/nz/powerups/nuke.wav new file mode 100644 index 00000000..48288a2c Binary files /dev/null and b/sound/nz/powerups/nuke.wav differ diff --git a/sound/nz/powerups/power_up_grab.wav b/sound/nz/powerups/power_up_grab.wav new file mode 100644 index 00000000..66ffb16a Binary files /dev/null and b/sound/nz/powerups/power_up_grab.wav differ diff --git a/sound/nz/powerups/power_up_spawn.wav b/sound/nz/powerups/power_up_spawn.wav new file mode 100644 index 00000000..bfb68487 Binary files /dev/null and b/sound/nz/powerups/power_up_spawn.wav differ diff --git a/sound/nz/powerups/zombie_blood.wav b/sound/nz/powerups/zombie_blood.wav new file mode 100644 index 00000000..ddad7ea6 Binary files /dev/null and b/sound/nz/powerups/zombie_blood.wav differ diff --git a/sound/nz/randombox/Announcer_Teddy_Zombies.wav b/sound/nz/randombox/Announcer_Teddy_Zombies.wav new file mode 100644 index 00000000..0cda1945 Binary files /dev/null and b/sound/nz/randombox/Announcer_Teddy_Zombies.wav differ diff --git a/sound/nz/randombox/fire_sale.wav b/sound/nz/randombox/fire_sale.wav new file mode 100644 index 00000000..6ecf7de8 Binary files /dev/null and b/sound/nz/randombox/fire_sale.wav differ diff --git a/sound/nz/randombox/poof.wav b/sound/nz/randombox/poof.wav new file mode 100644 index 00000000..8d4e7af2 Binary files /dev/null and b/sound/nz/randombox/poof.wav differ diff --git a/sound/nz/randombox/random_box_jingle.wav b/sound/nz/randombox/random_box_jingle.wav new file mode 100644 index 00000000..a0a173d9 Binary files /dev/null and b/sound/nz/randombox/random_box_jingle.wav differ diff --git a/sound/nz/randombox/teddy_bear_laugh.wav b/sound/nz/randombox/teddy_bear_laugh.wav new file mode 100644 index 00000000..499db9d7 Binary files /dev/null and b/sound/nz/randombox/teddy_bear_laugh.wav differ diff --git a/sound/nz/round/dog_start.wav b/sound/nz/round/dog_start.wav new file mode 100644 index 00000000..61f67e23 Binary files /dev/null and b/sound/nz/round/dog_start.wav differ diff --git a/nzombies3/content/sound/nz/round/game_over_4.mp3 b/sound/nz/round/game_over_4.mp3 similarity index 100% rename from nzombies3/content/sound/nz/round/game_over_4.mp3 rename to sound/nz/round/game_over_4.mp3 diff --git a/nzombies3/content/sound/nz/round/round_end.mp3 b/sound/nz/round/round_end.mp3 similarity index 100% rename from nzombies3/content/sound/nz/round/round_end.mp3 rename to sound/nz/round/round_end.mp3 diff --git a/nzombies3/content/sound/nz/round/round_start.mp3 b/sound/nz/round/round_start.mp3 similarity index 100% rename from nzombies3/content/sound/nz/round/round_start.mp3 rename to sound/nz/round/round_start.mp3 diff --git a/sound/nz/round/special_round_end.wav b/sound/nz/round/special_round_end.wav new file mode 100644 index 00000000..2060e3f0 Binary files /dev/null and b/sound/nz/round/special_round_end.wav differ diff --git a/sound/nz/round/special_round_start.wav b/sound/nz/round/special_round_start.wav new file mode 100644 index 00000000..153b9aed Binary files /dev/null and b/sound/nz/round/special_round_start.wav differ diff --git a/sound/nz/zombies/ambient/ambient_00.wav b/sound/nz/zombies/ambient/ambient_00.wav new file mode 100644 index 00000000..7b50aa98 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_00.wav differ diff --git a/sound/nz/zombies/ambient/ambient_01.wav b/sound/nz/zombies/ambient/ambient_01.wav new file mode 100644 index 00000000..faf42adf Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_01.wav differ diff --git a/sound/nz/zombies/ambient/ambient_02.wav b/sound/nz/zombies/ambient/ambient_02.wav new file mode 100644 index 00000000..1c735e24 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_02.wav differ diff --git a/sound/nz/zombies/ambient/ambient_03.wav b/sound/nz/zombies/ambient/ambient_03.wav new file mode 100644 index 00000000..c34f067a Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_03.wav differ diff --git a/sound/nz/zombies/ambient/ambient_04.wav b/sound/nz/zombies/ambient/ambient_04.wav new file mode 100644 index 00000000..9bf95df5 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_04.wav differ diff --git a/sound/nz/zombies/ambient/ambient_05.wav b/sound/nz/zombies/ambient/ambient_05.wav new file mode 100644 index 00000000..028d986a Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_05.wav differ diff --git a/sound/nz/zombies/ambient/ambient_06.wav b/sound/nz/zombies/ambient/ambient_06.wav new file mode 100644 index 00000000..942bdbfa Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_06.wav differ diff --git a/sound/nz/zombies/ambient/ambient_07.wav b/sound/nz/zombies/ambient/ambient_07.wav new file mode 100644 index 00000000..e93221de Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_07.wav differ diff --git a/sound/nz/zombies/ambient/ambient_08.wav b/sound/nz/zombies/ambient/ambient_08.wav new file mode 100644 index 00000000..0e333f83 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_08.wav differ diff --git a/sound/nz/zombies/ambient/ambient_09.wav b/sound/nz/zombies/ambient/ambient_09.wav new file mode 100644 index 00000000..bc8bd3f0 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_09.wav differ diff --git a/sound/nz/zombies/ambient/ambient_10.wav b/sound/nz/zombies/ambient/ambient_10.wav new file mode 100644 index 00000000..e22c2e44 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_10.wav differ diff --git a/sound/nz/zombies/ambient/ambient_11.wav b/sound/nz/zombies/ambient/ambient_11.wav new file mode 100644 index 00000000..99e8e552 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_11.wav differ diff --git a/sound/nz/zombies/ambient/ambient_12.wav b/sound/nz/zombies/ambient/ambient_12.wav new file mode 100644 index 00000000..b3d5b15c Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_12.wav differ diff --git a/sound/nz/zombies/ambient/ambient_13.wav b/sound/nz/zombies/ambient/ambient_13.wav new file mode 100644 index 00000000..a8169a00 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_13.wav differ diff --git a/sound/nz/zombies/ambient/ambient_14.wav b/sound/nz/zombies/ambient/ambient_14.wav new file mode 100644 index 00000000..dea792ab Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_14.wav differ diff --git a/sound/nz/zombies/ambient/ambient_15.wav b/sound/nz/zombies/ambient/ambient_15.wav new file mode 100644 index 00000000..51bc5340 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_15.wav differ diff --git a/sound/nz/zombies/ambient/ambient_16.wav b/sound/nz/zombies/ambient/ambient_16.wav new file mode 100644 index 00000000..08be818a Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_16.wav differ diff --git a/sound/nz/zombies/ambient/ambient_17.wav b/sound/nz/zombies/ambient/ambient_17.wav new file mode 100644 index 00000000..f1e456c0 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_17.wav differ diff --git a/sound/nz/zombies/ambient/ambient_18.wav b/sound/nz/zombies/ambient/ambient_18.wav new file mode 100644 index 00000000..6f8caf47 Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_18.wav differ diff --git a/sound/nz/zombies/ambient/ambient_19.wav b/sound/nz/zombies/ambient/ambient_19.wav new file mode 100644 index 00000000..3a08afde Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_19.wav differ diff --git a/sound/nz/zombies/ambient/ambient_20.wav b/sound/nz/zombies/ambient/ambient_20.wav new file mode 100644 index 00000000..6d9db5fc Binary files /dev/null and b/sound/nz/zombies/ambient/ambient_20.wav differ diff --git a/sound/nz/zombies/attack/attack_00.wav b/sound/nz/zombies/attack/attack_00.wav new file mode 100644 index 00000000..04504e1f Binary files /dev/null and b/sound/nz/zombies/attack/attack_00.wav differ diff --git a/sound/nz/zombies/attack/attack_01.wav b/sound/nz/zombies/attack/attack_01.wav new file mode 100644 index 00000000..e3f46d52 Binary files /dev/null and b/sound/nz/zombies/attack/attack_01.wav differ diff --git a/sound/nz/zombies/attack/attack_02.wav b/sound/nz/zombies/attack/attack_02.wav new file mode 100644 index 00000000..25d5c7a5 Binary files /dev/null and b/sound/nz/zombies/attack/attack_02.wav differ diff --git a/sound/nz/zombies/attack/attack_03.wav b/sound/nz/zombies/attack/attack_03.wav new file mode 100644 index 00000000..8a183782 Binary files /dev/null and b/sound/nz/zombies/attack/attack_03.wav differ diff --git a/sound/nz/zombies/attack/attack_04.wav b/sound/nz/zombies/attack/attack_04.wav new file mode 100644 index 00000000..ba2508f7 Binary files /dev/null and b/sound/nz/zombies/attack/attack_04.wav differ diff --git a/sound/nz/zombies/attack/attack_05.wav b/sound/nz/zombies/attack/attack_05.wav new file mode 100644 index 00000000..aedf5613 Binary files /dev/null and b/sound/nz/zombies/attack/attack_05.wav differ diff --git a/sound/nz/zombies/attack/attack_06.wav b/sound/nz/zombies/attack/attack_06.wav new file mode 100644 index 00000000..ad4fd9a4 Binary files /dev/null and b/sound/nz/zombies/attack/attack_06.wav differ diff --git a/sound/nz/zombies/attack/attack_07.wav b/sound/nz/zombies/attack/attack_07.wav new file mode 100644 index 00000000..7a50a08b Binary files /dev/null and b/sound/nz/zombies/attack/attack_07.wav differ diff --git a/sound/nz/zombies/attack/attack_08.wav b/sound/nz/zombies/attack/attack_08.wav new file mode 100644 index 00000000..d808c73d Binary files /dev/null and b/sound/nz/zombies/attack/attack_08.wav differ diff --git a/sound/nz/zombies/attack/attack_09.wav b/sound/nz/zombies/attack/attack_09.wav new file mode 100644 index 00000000..6e23b2e5 Binary files /dev/null and b/sound/nz/zombies/attack/attack_09.wav differ diff --git a/sound/nz/zombies/attack/attack_10.wav b/sound/nz/zombies/attack/attack_10.wav new file mode 100644 index 00000000..a70f04ae Binary files /dev/null and b/sound/nz/zombies/attack/attack_10.wav differ diff --git a/sound/nz/zombies/attack/attack_11.wav b/sound/nz/zombies/attack/attack_11.wav new file mode 100644 index 00000000..42d7610e Binary files /dev/null and b/sound/nz/zombies/attack/attack_11.wav differ diff --git a/sound/nz/zombies/attack/attack_12.wav b/sound/nz/zombies/attack/attack_12.wav new file mode 100644 index 00000000..29ca6724 Binary files /dev/null and b/sound/nz/zombies/attack/attack_12.wav differ diff --git a/sound/nz/zombies/attack/attack_13.wav b/sound/nz/zombies/attack/attack_13.wav new file mode 100644 index 00000000..91481808 Binary files /dev/null and b/sound/nz/zombies/attack/attack_13.wav differ diff --git a/sound/nz/zombies/attack/attack_14.wav b/sound/nz/zombies/attack/attack_14.wav new file mode 100644 index 00000000..e82a00e1 Binary files /dev/null and b/sound/nz/zombies/attack/attack_14.wav differ diff --git a/sound/nz/zombies/attack/attack_15.wav b/sound/nz/zombies/attack/attack_15.wav new file mode 100644 index 00000000..dbb6b457 Binary files /dev/null and b/sound/nz/zombies/attack/attack_15.wav differ diff --git a/sound/nz/zombies/attack/attack_16.wav b/sound/nz/zombies/attack/attack_16.wav new file mode 100644 index 00000000..32c2a0a2 Binary files /dev/null and b/sound/nz/zombies/attack/attack_16.wav differ diff --git a/sound/nz/zombies/attack/attack_17.wav b/sound/nz/zombies/attack/attack_17.wav new file mode 100644 index 00000000..092681f4 Binary files /dev/null and b/sound/nz/zombies/attack/attack_17.wav differ diff --git a/sound/nz/zombies/attack/attack_18.wav b/sound/nz/zombies/attack/attack_18.wav new file mode 100644 index 00000000..a77607c5 Binary files /dev/null and b/sound/nz/zombies/attack/attack_18.wav differ diff --git a/sound/nz/zombies/attack/attack_19.wav b/sound/nz/zombies/attack/attack_19.wav new file mode 100644 index 00000000..3c324c5c Binary files /dev/null and b/sound/nz/zombies/attack/attack_19.wav differ diff --git a/sound/nz/zombies/attack/attack_20.wav b/sound/nz/zombies/attack/attack_20.wav new file mode 100644 index 00000000..be1aaff4 Binary files /dev/null and b/sound/nz/zombies/attack/attack_20.wav differ diff --git a/sound/nz/zombies/attack/attack_21.wav b/sound/nz/zombies/attack/attack_21.wav new file mode 100644 index 00000000..78c7bb64 Binary files /dev/null and b/sound/nz/zombies/attack/attack_21.wav differ diff --git a/sound/nz/zombies/attack/attack_22.wav b/sound/nz/zombies/attack/attack_22.wav new file mode 100644 index 00000000..7666d874 Binary files /dev/null and b/sound/nz/zombies/attack/attack_22.wav differ diff --git a/sound/nz/zombies/behind/behind_00.wav b/sound/nz/zombies/behind/behind_00.wav new file mode 100644 index 00000000..9fefec2f Binary files /dev/null and b/sound/nz/zombies/behind/behind_00.wav differ diff --git a/sound/nz/zombies/behind/behind_01.wav b/sound/nz/zombies/behind/behind_01.wav new file mode 100644 index 00000000..11c01612 Binary files /dev/null and b/sound/nz/zombies/behind/behind_01.wav differ diff --git a/sound/nz/zombies/behind/behind_02.wav b/sound/nz/zombies/behind/behind_02.wav new file mode 100644 index 00000000..ba243206 Binary files /dev/null and b/sound/nz/zombies/behind/behind_02.wav differ diff --git a/sound/nz/zombies/behind/behind_03.wav b/sound/nz/zombies/behind/behind_03.wav new file mode 100644 index 00000000..1c9ab04b Binary files /dev/null and b/sound/nz/zombies/behind/behind_03.wav differ diff --git a/sound/nz/zombies/behind/behind_04.wav b/sound/nz/zombies/behind/behind_04.wav new file mode 100644 index 00000000..8e0723ef Binary files /dev/null and b/sound/nz/zombies/behind/behind_04.wav differ diff --git a/sound/nz/zombies/crawl/crawl_00.wav b/sound/nz/zombies/crawl/crawl_00.wav new file mode 100644 index 00000000..bd7df6fa Binary files /dev/null and b/sound/nz/zombies/crawl/crawl_00.wav differ diff --git a/sound/nz/zombies/crawl/crawl_01.wav b/sound/nz/zombies/crawl/crawl_01.wav new file mode 100644 index 00000000..65496386 Binary files /dev/null and b/sound/nz/zombies/crawl/crawl_01.wav differ diff --git a/sound/nz/zombies/crawl/crawl_02.wav b/sound/nz/zombies/crawl/crawl_02.wav new file mode 100644 index 00000000..01d68da9 Binary files /dev/null and b/sound/nz/zombies/crawl/crawl_02.wav differ diff --git a/sound/nz/zombies/crawl/crawl_03.wav b/sound/nz/zombies/crawl/crawl_03.wav new file mode 100644 index 00000000..0dd4413c Binary files /dev/null and b/sound/nz/zombies/crawl/crawl_03.wav differ diff --git a/sound/nz/zombies/crawl/crawl_04.wav b/sound/nz/zombies/crawl/crawl_04.wav new file mode 100644 index 00000000..3eabe626 Binary files /dev/null and b/sound/nz/zombies/crawl/crawl_04.wav differ diff --git a/sound/nz/zombies/crawl/crawl_05.wav b/sound/nz/zombies/crawl/crawl_05.wav new file mode 100644 index 00000000..f9850093 Binary files /dev/null and b/sound/nz/zombies/crawl/crawl_05.wav differ diff --git a/sound/nz/zombies/death/death_00.wav b/sound/nz/zombies/death/death_00.wav new file mode 100644 index 00000000..830b75a6 Binary files /dev/null and b/sound/nz/zombies/death/death_00.wav differ diff --git a/sound/nz/zombies/death/death_01.wav b/sound/nz/zombies/death/death_01.wav new file mode 100644 index 00000000..45278189 Binary files /dev/null and b/sound/nz/zombies/death/death_01.wav differ diff --git a/sound/nz/zombies/death/death_02.wav b/sound/nz/zombies/death/death_02.wav new file mode 100644 index 00000000..56497e75 Binary files /dev/null and b/sound/nz/zombies/death/death_02.wav differ diff --git a/sound/nz/zombies/death/death_03.wav b/sound/nz/zombies/death/death_03.wav new file mode 100644 index 00000000..70bec8d5 Binary files /dev/null and b/sound/nz/zombies/death/death_03.wav differ diff --git a/sound/nz/zombies/death/death_04.wav b/sound/nz/zombies/death/death_04.wav new file mode 100644 index 00000000..480a9700 Binary files /dev/null and b/sound/nz/zombies/death/death_04.wav differ diff --git a/sound/nz/zombies/death/death_05.wav b/sound/nz/zombies/death/death_05.wav new file mode 100644 index 00000000..b3ac6b8a Binary files /dev/null and b/sound/nz/zombies/death/death_05.wav differ diff --git a/sound/nz/zombies/death/death_06.wav b/sound/nz/zombies/death/death_06.wav new file mode 100644 index 00000000..6485e2e8 Binary files /dev/null and b/sound/nz/zombies/death/death_06.wav differ diff --git a/sound/nz/zombies/death/death_07.wav b/sound/nz/zombies/death/death_07.wav new file mode 100644 index 00000000..6afc4137 Binary files /dev/null and b/sound/nz/zombies/death/death_07.wav differ diff --git a/sound/nz/zombies/death/death_08.wav b/sound/nz/zombies/death/death_08.wav new file mode 100644 index 00000000..a18e0853 Binary files /dev/null and b/sound/nz/zombies/death/death_08.wav differ diff --git a/sound/nz/zombies/death/death_09.wav b/sound/nz/zombies/death/death_09.wav new file mode 100644 index 00000000..48b9abb4 Binary files /dev/null and b/sound/nz/zombies/death/death_09.wav differ diff --git a/sound/nz/zombies/death/death_10.wav b/sound/nz/zombies/death/death_10.wav new file mode 100644 index 00000000..8d7cbdc4 Binary files /dev/null and b/sound/nz/zombies/death/death_10.wav differ diff --git a/sound/nz/zombies/electrocuted/elec_00.wav b/sound/nz/zombies/electrocuted/elec_00.wav new file mode 100644 index 00000000..bf71d84c Binary files /dev/null and b/sound/nz/zombies/electrocuted/elec_00.wav differ diff --git a/sound/nz/zombies/electrocuted/elec_01.wav b/sound/nz/zombies/electrocuted/elec_01.wav new file mode 100644 index 00000000..bf070b14 Binary files /dev/null and b/sound/nz/zombies/electrocuted/elec_01.wav differ diff --git a/sound/nz/zombies/electrocuted/elec_02.wav b/sound/nz/zombies/electrocuted/elec_02.wav new file mode 100644 index 00000000..be838850 Binary files /dev/null and b/sound/nz/zombies/electrocuted/elec_02.wav differ diff --git a/sound/nz/zombies/electrocuted/elec_03.wav b/sound/nz/zombies/electrocuted/elec_03.wav new file mode 100644 index 00000000..69237f8c Binary files /dev/null and b/sound/nz/zombies/electrocuted/elec_03.wav differ diff --git a/sound/nz/zombies/electrocuted/elec_04.wav b/sound/nz/zombies/electrocuted/elec_04.wav new file mode 100644 index 00000000..9da6cd71 Binary files /dev/null and b/sound/nz/zombies/electrocuted/elec_04.wav differ diff --git a/sound/nz/zombies/electrocuted/elec_05.wav b/sound/nz/zombies/electrocuted/elec_05.wav new file mode 100644 index 00000000..be406196 Binary files /dev/null and b/sound/nz/zombies/electrocuted/elec_05.wav differ diff --git a/sound/nz/zombies/sprint/sprint_00.wav b/sound/nz/zombies/sprint/sprint_00.wav new file mode 100644 index 00000000..91250604 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_00.wav differ diff --git a/sound/nz/zombies/sprint/sprint_01.wav b/sound/nz/zombies/sprint/sprint_01.wav new file mode 100644 index 00000000..46e0692d Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_01.wav differ diff --git a/sound/nz/zombies/sprint/sprint_02.wav b/sound/nz/zombies/sprint/sprint_02.wav new file mode 100644 index 00000000..4ba39504 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_02.wav differ diff --git a/sound/nz/zombies/sprint/sprint_03.wav b/sound/nz/zombies/sprint/sprint_03.wav new file mode 100644 index 00000000..fd8be71c Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_03.wav differ diff --git a/sound/nz/zombies/sprint/sprint_05.wav b/sound/nz/zombies/sprint/sprint_05.wav new file mode 100644 index 00000000..30517eb9 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_05.wav differ diff --git a/sound/nz/zombies/sprint/sprint_06.wav b/sound/nz/zombies/sprint/sprint_06.wav new file mode 100644 index 00000000..38ad6d5c Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_06.wav differ diff --git a/sound/nz/zombies/sprint/sprint_07.wav b/sound/nz/zombies/sprint/sprint_07.wav new file mode 100644 index 00000000..0a091600 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_07.wav differ diff --git a/sound/nz/zombies/sprint/sprint_08.wav b/sound/nz/zombies/sprint/sprint_08.wav new file mode 100644 index 00000000..16c355a3 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_08.wav differ diff --git a/sound/nz/zombies/sprint/sprint_09.wav b/sound/nz/zombies/sprint/sprint_09.wav new file mode 100644 index 00000000..b0672e68 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_09.wav differ diff --git a/sound/nz/zombies/sprint/sprint_10.wav b/sound/nz/zombies/sprint/sprint_10.wav new file mode 100644 index 00000000..265236a1 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_10.wav differ diff --git a/sound/nz/zombies/sprint/sprint_11.wav b/sound/nz/zombies/sprint/sprint_11.wav new file mode 100644 index 00000000..be0b553a Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_11.wav differ diff --git a/sound/nz/zombies/sprint/sprint_12.wav b/sound/nz/zombies/sprint/sprint_12.wav new file mode 100644 index 00000000..42262295 Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_12.wav differ diff --git a/sound/nz/zombies/sprint/sprint_13.wav b/sound/nz/zombies/sprint/sprint_13.wav new file mode 100644 index 00000000..c5f033ed Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_13.wav differ diff --git a/sound/nz/zombies/sprint/sprint_14.wav b/sound/nz/zombies/sprint/sprint_14.wav new file mode 100644 index 00000000..c08794ee Binary files /dev/null and b/sound/nz/zombies/sprint/sprint_14.wav differ diff --git a/sound/nz/zombies/sprint2/sprint0.wav b/sound/nz/zombies/sprint2/sprint0.wav new file mode 100644 index 00000000..c1eeafc3 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint0.wav differ diff --git a/sound/nz/zombies/sprint2/sprint1.wav b/sound/nz/zombies/sprint2/sprint1.wav new file mode 100644 index 00000000..6af691ba Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint1.wav differ diff --git a/sound/nz/zombies/sprint2/sprint2.wav b/sound/nz/zombies/sprint2/sprint2.wav new file mode 100644 index 00000000..cddb8584 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint2.wav differ diff --git a/sound/nz/zombies/sprint2/sprint3.wav b/sound/nz/zombies/sprint2/sprint3.wav new file mode 100644 index 00000000..ee3125f7 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint3.wav differ diff --git a/sound/nz/zombies/sprint2/sprint4.wav b/sound/nz/zombies/sprint2/sprint4.wav new file mode 100644 index 00000000..e311bfb9 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint4.wav differ diff --git a/sound/nz/zombies/sprint2/sprint5.wav b/sound/nz/zombies/sprint2/sprint5.wav new file mode 100644 index 00000000..7a2460b8 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint5.wav differ diff --git a/sound/nz/zombies/sprint2/sprint6.wav b/sound/nz/zombies/sprint2/sprint6.wav new file mode 100644 index 00000000..a5032476 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint6.wav differ diff --git a/sound/nz/zombies/sprint2/sprint7.wav b/sound/nz/zombies/sprint2/sprint7.wav new file mode 100644 index 00000000..b1cb86ae Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint7.wav differ diff --git a/sound/nz/zombies/sprint2/sprint8.wav b/sound/nz/zombies/sprint2/sprint8.wav new file mode 100644 index 00000000..1fd61978 Binary files /dev/null and b/sound/nz/zombies/sprint2/sprint8.wav differ diff --git a/sound/nz/zombies/taunt/taunt.wav b/sound/nz/zombies/taunt/taunt.wav new file mode 100644 index 00000000..73ae1009 Binary files /dev/null and b/sound/nz/zombies/taunt/taunt.wav differ diff --git a/sound/nz/zombies/taunt/taunt_00.wav b/sound/nz/zombies/taunt/taunt_00.wav new file mode 100644 index 00000000..01de5833 Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_00.wav differ diff --git a/sound/nz/zombies/taunt/taunt_01.wav b/sound/nz/zombies/taunt/taunt_01.wav new file mode 100644 index 00000000..f7e382a9 Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_01.wav differ diff --git a/sound/nz/zombies/taunt/taunt_02.wav b/sound/nz/zombies/taunt/taunt_02.wav new file mode 100644 index 00000000..99b10575 Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_02.wav differ diff --git a/sound/nz/zombies/taunt/taunt_03.wav b/sound/nz/zombies/taunt/taunt_03.wav new file mode 100644 index 00000000..15d9557b Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_03.wav differ diff --git a/sound/nz/zombies/taunt/taunt_04.wav b/sound/nz/zombies/taunt/taunt_04.wav new file mode 100644 index 00000000..2aff17ff Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_04.wav differ diff --git a/sound/nz/zombies/taunt/taunt_05.wav b/sound/nz/zombies/taunt/taunt_05.wav new file mode 100644 index 00000000..3c953fd4 Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_05.wav differ diff --git a/sound/nz/zombies/taunt/taunt_06.wav b/sound/nz/zombies/taunt/taunt_06.wav new file mode 100644 index 00000000..d2fb3a96 Binary files /dev/null and b/sound/nz/zombies/taunt/taunt_06.wav differ