Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
531 commits
Select commit Hold shift + click to select a range
2affb24
Added a nz prefix to all modules
lolleko Apr 16, 2016
3b1b012
Merge pull request #153 from lolleko/config-curves-rewrite
Zet0rz Apr 16, 2016
a63faf3
Nav based jumping
lolleko Apr 17, 2016
aad5460
More Weapon List Options
Zet0rz Apr 18, 2016
52daf85
Removed prints
Zet0rz Apr 18, 2016
f2c84a0
Misc Fixes
Zet0rz Apr 19, 2016
a52722f
Merge remote-tracking branch 'refs/remotes/Zet0rz/Master-Changes' int…
lolleko Apr 19, 2016
75466ec
Improved jumping & Debug
lolleko Apr 19, 2016
959fbc6
Merge pull request #160 from lolleko/zombie-segment-jumping
Zet0rz Apr 19, 2016
d7cfaff
Wunderfizz!
Zet0rz Apr 20, 2016
fad4b30
Merge remote-tracking branch 'origin/Master-Changes' into Master-Changes
Zet0rz Apr 20, 2016
436b529
Wunderfizz Fixes
Zet0rz Apr 21, 2016
fab7900
Barricade Jump Animations!
Zet0rz Apr 22, 2016
75add69
Merge branch 'Master-Changes' of https://github.com/Zet0rz/nzombies i…
Zet0rz Apr 22, 2016
4a17713
Moar Props!
Zet0rz Apr 22, 2016
8d449ea
Zombie Blood & Powerups
Zet0rz Apr 23, 2016
66d6246
Points Hotfix
Zet0rz Apr 24, 2016
e36d55a
Powerups Hotfix 2
Zet0rz Apr 24, 2016
bb05d52
Apocalyptic Models
Zet0rz Apr 24, 2016
8e21e99
Revival Improvements
Zet0rz Apr 25, 2016
fb85816
Barricade Backwards Compatiblity
Zet0rz Apr 25, 2016
30d18cc
Zombie Barricade Jump Improvements
Zet0rz Apr 25, 2016
244bf1a
Random Box Error Fix
Zet0rz Apr 25, 2016
c458531
Dogs Barricade Jumps
Zet0rz Apr 25, 2016
5abfb54
Panzersoldat Models
Zet0rz Apr 25, 2016
e5487ce
Updated to add weapon pack
Zet0rz Apr 26, 2016
f51f7c4
Map Settings tool fix
Zet0rz Apr 26, 2016
3287c01
Merge branch 'Master-Changes' of https://github.com/Zet0rz/nzombies i…
Zet0rz Apr 26, 2016
1a0cf76
A bit o Panzer Progress
Zet0rz Apr 26, 2016
e5d3b6a
More Sounds n' Model Stuff
Zet0rz Apr 27, 2016
7849907
Merge remote-tracking branch 'refs/remotes/Zet0rz/Master-Changes'
lolleko Apr 28, 2016
395b06a
Completly reworked the ttt_kosovos navmesh
lolleko Apr 28, 2016
77f0b5e
Merge remote-tracking branch 'refs/remotes/Zet0rz/Master-Changes' int…
lolleko Apr 28, 2016
51f604c
Merge pull request #175 from lolleko/kosovos-new-navmesh
Zet0rz Apr 28, 2016
ead30c7
Fixed Clientside barricade collsions & minor Bug fixes
lolleko Apr 28, 2016
efaf1f0
Improved barricade attacking behaviour
lolleko Apr 28, 2016
2b66aa7
Merge remote-tracking branch 'refs/remotes/Zet0rz/Master-Changes' int…
lolleko Apr 28, 2016
3c300a1
Merge pull request #176 from lolleko/barricade-collisions
Zet0rz Apr 28, 2016
b35c9a0
Workshop Content Repack
Zet0rz Apr 29, 2016
6b3ec59
Update README.md
Zet0rz Apr 29, 2016
caabf99
Repack Repack
Zet0rz Apr 30, 2016
5305873
Merge pull request #1 from Zet0rz/master-workshop
lolleko Apr 30, 2016
346499d
Official Config Fixes
Zet0rz Apr 30, 2016
0a1a880
Barricade & AI Improvements
Zet0rz Apr 30, 2016
c34c5d2
Simple Improvements
Zet0rz May 1, 2016
f87e707
Cheats Fix
Zet0rz May 2, 2016
e4c3491
Lag Compensation and Compatibility
Zet0rz May 2, 2016
d824549
Official Configs Fix
Zet0rz May 2, 2016
9902fc1
Breakout Script Fix & Panzer Progress
Zet0rz May 2, 2016
74fab22
Random Box Starting Locations & Fixes
Zet0rz May 3, 2016
a2ffbf2
Interface Links
Zet0rz May 3, 2016
c8b73d5
Map Props
Zet0rz May 4, 2016
8e2cc04
Animations Improvements & Fixes
Zet0rz May 5, 2016
73513ae
Grenade Failsafe
Zet0rz May 6, 2016
eb59350
Slightly Higher Chances
May 6, 2016
2cc3720
Update sh_constructor.lua
May 6, 2016
fe30216
Fixed a math error
May 6, 2016
664b1ad
Gamemode Extensions
Zet0rz May 6, 2016
adbc3bc
HUD Error Fix
Zet0rz May 7, 2016
16f1e60
logic_waves and more
Zet0rz May 7, 2016
6ab2230
Firesale Fix
Zet0rz May 8, 2016
3c6bd74
Weapon Modifiers!
Zet0rz May 13, 2016
206d21f
Merge pull request #187 from ScriptnLua/patch-1
Zet0rz May 13, 2016
5cf4769
Wall Buy Fix
Zet0rz May 14, 2016
6bd5a13
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko May 14, 2016
8a31863
PaP Sound Fix
Zet0rz May 15, 2016
f033aca
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko May 17, 2016
b9f10ae
Added Pseudo Random Distribution for powerup drops.
lolleko May 17, 2016
4ed074b
Removed debug prints
lolleko May 17, 2016
9ab344b
Merge pull request #199 from lolleko/psd-powerup-drops
Zet0rz May 17, 2016
234683d
Who's Who and Tombstone fix
Zet0rz May 17, 2016
be6abe9
Merge branch 'master-workshop' of https://github.com/Zet0rz/nzombies …
Zet0rz May 17, 2016
baec48d
Fixed Grammatical Issues with README.md
May 18, 2016
6a2c082
Merge pull request #200 from ScriptnLua/patch-2
Zet0rz May 18, 2016
e1adc42
Perk Rewrite
Zet0rz May 18, 2016
cce3f84
Merge branch 'master-workshop' of https://github.com/Zet0rz/nzombies …
Zet0rz May 18, 2016
b8226bc
PaP Fix
Zet0rz May 19, 2016
288ec9d
Spawn Improvements, Update Rates, Max Zombies, ...
Zet0rz May 24, 2016
b52939e
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko May 24, 2016
872ba6e
Changed NZ to nZ
May 27, 2016
5867cac
Weaponized Update
Zet0rz May 28, 2016
568b561
Merge pull request #210 from ScriptnLua/patch-2
Zet0rz May 29, 2016
1249219
Mismatch, Fixes, Preview
Zet0rz May 31, 2016
e41c55f
Merge branch 'master-workshop' of https://github.com/Zet0rz/nzombies …
Zet0rz May 31, 2016
00bb323
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Jun 2, 2016
19d64f6
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Jun 2, 2016
1990d56
Some Minor Fixes & Decapitation
lolleko Jun 2, 2016
9e101d1
Merge pull request #222 from lolleko/zombie-fixes
Zet0rz Jun 3, 2016
e47ba08
Change 'edit mode' to 'creative mode' in README.md
Jun 8, 2016
9d9e5ab
Changed all outputs from 'NZ' to 'nZ'
Jun 8, 2016
6d644df
Cleared up more edit mode confusion in README.md
Jun 8, 2016
22d5281
Merge pull request #228 from OctothorpeObelus/patch-1
Zet0rz Jun 8, 2016
bb54799
Config Loader Upgrade
Zet0rz Jun 9, 2016
def342b
Merge branch 'master-workshop' of https://github.com/Zet0rz/nzombies …
Zet0rz Jun 9, 2016
28ea451
Map Script Fix
Zet0rz Jun 10, 2016
bf7d091
Proper Nouns and Objective Pronouns
Jun 13, 2016
51d15c4
Merge pull request #231 from OctothorpeObelus/patch-3
Zet0rz Jun 13, 2016
c6a5f45
Fix for sprinting
lolleko Jun 15, 2016
7d632d6
Merge pull request #233 from Zet0rz/hotfix-sprinting
Zet0rz Jun 15, 2016
3d0510c
Panzer Progress & Fixes
Zet0rz Jun 18, 2016
4e0bb12
Merge branch 'master-workshop' of https://github.com/Zet0rz/nzombies …
Zet0rz Jun 18, 2016
57c1952
Misc. Changes
Zet0rz Jun 22, 2016
1af8003
Invulnerable Zombies & Other Fixes
Zet0rz Jun 25, 2016
b7d2aff
Fire Zombie Lag Fix
Zet0rz Jun 27, 2016
41bf9b5
Statue Zombies?!
Zet0rz Jul 1, 2016
39aea56
Special Round Choice
Zet0rz Jul 7, 2016
6ef2b15
Round 3 Fix
Zet0rz Jul 7, 2016
9a472ae
Settings Error
Zet0rz Jul 7, 2016
060967c
More Weapon Compatibility
Zet0rz Jul 8, 2016
2341c9d
Bosses, Spawning, Menu!
Zet0rz Jul 16, 2016
9fb50cc
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Jul 21, 2016
026cafd
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Jul 22, 2016
baf22e1
Spawmenu Upgrade!
Zet0rz Jul 27, 2016
9b609f5
Empty Spawnlist Fix
Zet0rz Jul 28, 2016
8de884b
Support for Nicks with spaces
lolleko Jul 31, 2016
19cc82d
Close menu after readying up.
lolleko Aug 1, 2016
c30b0a8
Merge pull request #283 from Zet0rz/the-noob-problem
Zet0rz Aug 2, 2016
af88cba
Trapbase
lolleko Aug 2, 2016
af009c5
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Aug 2, 2016
eded4da
Fixed Syntax errors :exclamation:
lolleko Aug 2, 2016
5f608d8
Merge pull request #279 from Zet0rz/chatcommands-patch
lolleko Aug 2, 2016
67b1a9c
Spawnmenu Fix & Invulnerable Zombie Killing
Zet0rz Aug 2, 2016
b773df4
Merge branch 'master-workshop' of https://github.com/Zet0rz/nzombies …
Zet0rz Aug 2, 2016
4841498
Added baseclass for activatable things
lolleko Aug 3, 2016
0298ed4
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Aug 3, 2016
c9fcc56
Transfer Files
Zet0rz Aug 5, 2016
7fc98c8
Update README.md
Zet0rz Aug 5, 2016
b8e755f
Predicted Grenades
Zet0rz Aug 7, 2016
cb25d11
Damage Wall cleanup fix
Zet0rz Aug 12, 2016
faa68e6
Predicted Special Weapons System
Zet0rz Aug 17, 2016
c76ce20
Creative Admin Removal & Remaining Special Weapons
Zet0rz Aug 17, 2016
a4657b7
Better Spawn Distribution
Zet0rz Aug 22, 2016
6aeadae
Recovered Interfaces Module
Zet0rz Aug 22, 2016
6c86a0c
Map Vote System
Zet0rz Aug 25, 2016
1d19e29
Additional Hook Calls
Zet0rz Aug 25, 2016
8e67e9f
Even More Hooks
Zet0rz Aug 25, 2016
3008445
Buy Events
Zet0rz Aug 27, 2016
c627d15
RTV Enabled & Zombie Fixes
Zet0rz Aug 28, 2016
d445cf1
Critical Fixes
Zet0rz Aug 30, 2016
8bf12f0
Tools and Properties
Zet0rz Sep 1, 2016
611b8e6
Zombie Table Changes
Zet0rz Sep 2, 2016
a553f9c
PaP Replacement
Zet0rz Sep 9, 2016
950c4af
PaP Replacement fixes
Zet0rz Sep 9, 2016
7dac58f
Editable Vars for traps and buttons
lolleko Sep 21, 2016
135928a
Merge remote-tracking branch 'refs/remotes/Zet0rz/master-workshop' in…
lolleko Sep 21, 2016
08b6c19
Button Models & AND Gates
lolleko Sep 22, 2016
43ac882
Buttons to open OpenDoorLinks
lolleko Sep 22, 2016
ef8b856
Massive Changes
Zet0rz Sep 22, 2016
6a22cd9
Merge remote-tracking branch 'refs/remotes/Zet0rz/development' into t…
lolleko Sep 22, 2016
24fba01
Merge pull request #309 from lolleko/traps-and-defenses
Zet0rz Sep 22, 2016
135cd4d
Round Infinity
Zet0rz Sep 23, 2016
334be73
Fixes & Features
Zet0rz Sep 27, 2016
2ff2608
Modular Save System Overhaul
Zet0rz Oct 4, 2016
d58e750
Server Autoload, Weighted Random Box & Fixes
Zet0rz Oct 6, 2016
57195b6
RELOAD FIX!
Zet0rz Oct 7, 2016
63936ae
New Content Implementation
Zet0rz Oct 8, 2016
75d0174
Widows Wine New Grenade Ammo ID
Zet0rz Oct 8, 2016
daf5b11
Barricade Fix
Zet0rz Oct 9, 2016
653ed22
Act Stage Changes & Barricade Fixes
Zet0rz Oct 11, 2016
f710de2
Boss Round Tweaks
Zet0rz Oct 11, 2016
84324af
Boss Table Registration
Zet0rz Oct 11, 2016
a292118
FGD
Zet0rz Oct 14, 2016
35f81e5
Loads of Bug Fixes
Zet0rz Oct 16, 2016
c744cd3
Imprisoned & Fixes
Zet0rz Nov 1, 2016
79ffdfa
Insignificant Editing
Nov 3, 2016
9b950cb
Merge pull request #319 from OctothorpeObelus/patch-6
Zet0rz Nov 3, 2016
9f05cd2
Imprisoned, Easter Eggs, Buildables
Zet0rz Nov 5, 2016
33cb7ba
Imprisoned EE & Hotfix
Zet0rz Nov 6, 2016
f73b225
Special Weaponry Improvements
Zet0rz Nov 6, 2016
fb0ab53
Imprisoned Fixes & Effects
Zet0rz Nov 7, 2016
93c2f6d
Imprisoned EE Hotfix
Zet0rz Nov 7, 2016
6a0b0d4
EE Cameras, Fire Sale, Effects, Fixes
Zet0rz Nov 8, 2016
fa5cc0f
Max Ammo Hotfix
Zet0rz Nov 9, 2016
507ba1b
nzEE.Cam & Imprisoned EE
Zet0rz Nov 10, 2016
be89b45
Barricades, Panzers, Grenades, Icons
Zet0rz Nov 11, 2016
78d9b85
Effects and Walls
Zet0rz Nov 12, 2016
6920609
Progress on traps part 2
lolleko Nov 14, 2016
9c69955
New Models, Effects, Sounds
Zet0rz Nov 16, 2016
9e46303
Fixes and Convenience
Zet0rz Nov 16, 2016
938ad29
Traps & Logic Finalization
lolleko Nov 17, 2016
52552ef
Added turret settings
lolleko Nov 17, 2016
2435bd8
Merge pull request #326 from Zet0rz/traps-logic-part2
Zet0rz Nov 17, 2016
d27b718
Weapon Fixes & Bugs
Zet0rz Nov 24, 2016
2ade798
Final Touches
Zet0rz Nov 26, 2016
0761ef9
Test
Zet0rz Nov 26, 2016
4940729
Merge branch 'master-workshop' into development
Zet0rz Nov 26, 2016
7010ec1
Update README.md
Zet0rz Nov 26, 2016
9214dd3
RTV enabled
Zet0rz Nov 28, 2016
a0ab578
Traps Disappearing
Zet0rz Nov 28, 2016
9d513f6
Map Script Fix
Zet0rz Dec 8, 2016
014da2a
Ragdolls & Tools
Zet0rz Jan 25, 2017
66e73a9
Max Ammo fix
Zet0rz Jan 26, 2017
50cc7ae
The TFA Update
Zet0rz Mar 1, 2017
b93d177
PaP Quickfix
Zet0rz Mar 1, 2017
467521e
GetPrintName Fix
Zet0rz Mar 2, 2017
11cbd2f
TFA Vox invalid model error fix
Zet0rz Mar 4, 2017
a95c9ad
Increased Special Weapon sync delay
Zet0rz Mar 4, 2017
ba3a0c7
Update nz_activatable.lua
lolleko Apr 5, 2017
22b6fb7
Merge pull request #405 from Zet0rz/398-trap-bug
Zet0rz Apr 5, 2017
82656a5
The Bug Fixening
Zet0rz Apr 6, 2017
92adb3c
The Bug Fixening's Fixening
Zet0rz Apr 7, 2017
073f721
Proper Invisible Blocks
Zet0rz Apr 21, 2017
1d82efc
Fixed ERROR Spam When a Panzer is Defeated
May 18, 2017
750ab2a
IsValid(ply/ent/pl)
May 22, 2017
3cd0ad5
Removed IsValid(pl) on line 76
May 22, 2017
88408e1
Merge pull request #470 from OctothorpeObelus/patch-8
Zet0rz May 23, 2017
930fc8d
Merge pull request #451 from OctothorpeObelus/patch-7
Zet0rz May 28, 2017
ba97c20
fix revive system
bozoweed Jul 30, 2017
33a60ad
fix scorboard nor reset on new try
bozoweed Jul 30, 2017
8dd7526
Merge pull request #550 from bozoweed/master-workshop
lolleko Oct 9, 2017
742d373
Faster health regeneration
Jan 17, 2018
5a2a9d3
Merge pull request #602 from Napalmburner/patch-2
Zet0rz Jan 19, 2018
6a66e8d
Fixed exploit that allowed anyone to do nz_qr.
Feb 1, 2018
8a849b4
Update sv_consolecommands.lua
Feb 1, 2018
0a27aa9
Forgot to include 'ply' in the function
Feb 1, 2018
c44baec
Update 1 - Restarted
minin43 Jan 29, 2020
5b20a1d
Update 2
minin43 Feb 2, 2020
b8165b0
Update 3
minin43 Feb 3, 2020
b964cc0
Update 4
minin43 Feb 5, 2020
58e2ea3
Update 5
minin43 Feb 5, 2020
921e761
Update 6
minin43 Feb 5, 2020
57ce733
Update 7 - Really Shaping Up
minin43 Feb 10, 2020
e7e791a
Update 7
minin43 Feb 10, 2020
9e02d7d
Update 8
minin43 Feb 12, 2020
81c81a4
Update 9
minin43 Feb 12, 2020
fc23d01
Update 10
minin43 Feb 14, 2020
96a84f6
Update 11 - Started NavScript Shit
minin43 Feb 17, 2020
72035b0
Update 12 - Leaps
minin43 Feb 24, 2020
febcb23
Update 12.1
minin43 Feb 26, 2020
bf817ab
Update 13 - More progress
minin43 Mar 2, 2020
50262e2
Update 14
minin43 Mar 4, 2020
16af0b3
Update 15
minin43 Mar 4, 2020
33bf452
Update 14 merge
minin43 Mar 4, 2020
788e07a
Update 16
minin43 Mar 4, 2020
b15cdc3
Fix for first buying weapons with overridden GetPrimaryAmmoType in we…
YuRaNnNzZZ Apr 2, 2020
a12e6ab
Merge pull request #690 from YuRaNnNzZZ/tfa_compatfix
lolleko Apr 5, 2020
6462a60
Update 17
minin43 Jul 31, 2020
3468f11
Update 18
minin43 Aug 1, 2020
8cf28a4
Merge pull request #619 from Ethorbit/master-workshop
Zet0rz Jul 14, 2021
2f2c2b5
Merge pull request #1 from Zet0rz/master-workshop
minin43 Apr 7, 2022
61d1194
Update README.md
minin43 Apr 7, 2022
6b4800b
Edits to my Newest Script
minin43 Aug 16, 2022
f42afa7
Bug fixing
minin43 Aug 16, 2022
f8ad836
Update nz_gm_scrapmetal_v2;Dazed.lua
minin43 Aug 16, 2022
62f318f
Merge branch 'master-workshop' of https://github.com/minin43/nzombies…
minin43 Aug 16, 2022
1241b8f
Quality of Life changes to cl_target
minin43 Aug 16, 2022
185ba58
Merge branch 'master-workshop' of https://github.com/minin43/nzombies…
minin43 Aug 16, 2022
718498c
Fixes Buffer Overflow exception on game start
minin43 Sep 10, 2022
579c498
Match Zet's repo
minin43 Sep 10, 2022
31012f0
Merge pull request #714 from minin43/ZetRepoPRs
Zet0rz Sep 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,58 @@ 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 content pack with all models and materials here:
http://steamcommunity.com/sharedfiles/filedetails/?id=675138912

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
- Fully working revival system, including crawling around and animations

- Navigation Tools
- Lock areas of the maps based on doors, allowing Zombies to navigate around them

- Additional Content
- All perks up until Black Ops 3; all DLC working!
- A proper HUD!
- More Powerups
- More sounds
- More effects
- Official configs w/ Full Easter Eggs
- Traps
- Better editing in creative mode
- Undo system
- Context Menu to quickly edit properties without equipping tool (Hold C)
- Many more props, light effects, sky/fog/sun editors, fire entities, and more ...
- Better tool system

- Better Mapping!
- Decide weapons in box, music easter egg songs, boss rounds, special rounds
- Decide starting weapon and starting amount of points
- Support for many more types of doors

- Better Zombie AI (Thanks Lolle!)

- 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

- Better Mechanics
- Proper Weapon System
- Better Zombie health and speed curves

- Misc changes
- Speed Cola and Double Tap now works on all weapons!
- Wall Buys are actual chalk-outlines!
- Zombies are actual Der Riese models w/ Animations and sound!

- 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.
11 changes: 11 additions & 0 deletions addon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"title" : "nZombies 3",
"type" : "gamemode",
"tags" : [ "fun", "realism" ],
"ignore" :
[
"*.psd",
"*.vcproj",
"*.svn*"
]
}
197 changes: 197 additions & 0 deletions gamemodes/nzombies/entities/effects/lightning_aura/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@

--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:GetRadius() or 1
if self.Size <= 0 then self.Size = 1 end
self.MaxArcs = 2
self.Parent = data:GetEntity()
--self:SetParent(self.Parent)
self.Frequency = data:GetMagnitude() and data:GetMagnitude()/10 or 0.01
self.Pos = self.Parent:WorldSpaceCenter()
local scale = data:GetScale()

if IsValid(self.Parent.LightningAuraEffect) then
self.Parent.LightningAuraEffect.KILL = true
end

if scale then
if scale >= 0 then
self.Parent.LightningAura = CurTime() + scale
else
self.Parent.LightningAura = true
end
else
self.Parent.LightningAura = CurTime() + 10 -- Default time for this effect
end

self.Alpha = 255
self.Life = 0
self.NextArc = 0
self.Arcs = {}
self.Queue = 1

self.Parent.LightningAuraEffect = self

self:SetRenderBounds( Vector(0,0,0), Vector(0,0,0), Vector(50,50,50) )

end

--[[---------------------------------------------------------
THINK
-----------------------------------------------------------]]
function EFFECT:Think()

if self.KILL then return false end

if IsValid(self.Parent) then
self.Pos = self.Parent:WorldSpaceCenter()
self:SetPos(self.Pos)
end

self.Life = self.Life + FrameTime()
--self.Alpha = 255 * ( 1 - self.Life )

if self.NextArc <= self.Life and self.Pos 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

if IsValid(self.Parent) then
if !(type(self.Parent.LightningAura) == "number" and CurTime() < self.Parent.LightningAura or self.Parent.LightningAura == true) then
self.Parent.LightningAura = nil
return false
end
else
return false
end

return true
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.2

return points
end

--[[---------------------------------------------------------
Draw the effect
-----------------------------------------------------------]]
function EFFECT:Render()

if ( self.KILL or self.Alpha < 1 or self.Parent:IsDormant() ) 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]

local size = arc.size * ((arc.dietime-CurTime())/0.2)

render.DrawBeam(
startPos,
endPos,
(edge and size*3 or size),
texcoord,
texcoord + ((startPos - endPos):Length() / 128),
arc.color
)
end
end
end
Loading