diff --git a/backgrounds/abducted_1.jpg b/backgrounds/abducted_1.jpg new file mode 100644 index 0000000..dfb218b Binary files /dev/null and b/backgrounds/abducted_1.jpg differ diff --git a/backgrounds/abducted_2.jpg b/backgrounds/abducted_2.jpg new file mode 100644 index 0000000..48c6ea9 Binary files /dev/null and b/backgrounds/abducted_2.jpg differ diff --git a/backgrounds/abducted_3.jpg b/backgrounds/abducted_3.jpg new file mode 100644 index 0000000..6bb23d1 Binary files /dev/null and b/backgrounds/abducted_3.jpg differ diff --git a/backgrounds/evac_1.jpg b/backgrounds/evac_1.jpg new file mode 100644 index 0000000..2c22869 Binary files /dev/null and b/backgrounds/evac_1.jpg differ diff --git a/backgrounds/evac_2.jpg b/backgrounds/evac_2.jpg new file mode 100644 index 0000000..29f7733 Binary files /dev/null and b/backgrounds/evac_2.jpg differ diff --git a/backgrounds/evac_3.jpg b/backgrounds/evac_3.jpg new file mode 100644 index 0000000..89037ec Binary files /dev/null and b/backgrounds/evac_3.jpg differ diff --git a/backgrounds/evac_4.jpg b/backgrounds/evac_4.jpg new file mode 100644 index 0000000..ec63ae7 Binary files /dev/null and b/backgrounds/evac_4.jpg differ diff --git a/backgrounds/horror_raid.jpg b/backgrounds/horror_raid.jpg new file mode 100644 index 0000000..c8f4f9a Binary files /dev/null and b/backgrounds/horror_raid.jpg differ diff --git a/backgrounds/scream_1.jpg b/backgrounds/scream_1.jpg new file mode 100644 index 0000000..d49ed44 Binary files /dev/null and b/backgrounds/scream_1.jpg differ diff --git a/backgrounds/scream_2.jpg b/backgrounds/scream_2.jpg new file mode 100644 index 0000000..30e764d Binary files /dev/null and b/backgrounds/scream_2.jpg differ diff --git a/backgrounds/scream_3.jpg b/backgrounds/scream_3.jpg new file mode 100644 index 0000000..25fc4ca Binary files /dev/null and b/backgrounds/scream_3.jpg differ diff --git a/backgrounds/southtown.jpg b/backgrounds/southtown.jpg new file mode 100644 index 0000000..5c721b6 Binary files /dev/null and b/backgrounds/southtown.jpg differ diff --git a/content/materials/effects/actionflash1.vtf b/content/materials/effects/actionflash1.vtf new file mode 100644 index 0000000..3ebcf59 Binary files /dev/null and b/content/materials/effects/actionflash1.vtf differ diff --git a/content/materials/effects/actionflash2.vmt b/content/materials/effects/actionflash2.vmt new file mode 100644 index 0000000..d111bb3 --- /dev/null +++ b/content/materials/effects/actionflash2.vmt @@ -0,0 +1,8 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/actionflash1" + "$additive" 1 + "$vertexcolor" 1 + "$vertexalpha" 1 + +} diff --git a/content/materials/effects/actionflash2.vtf b/content/materials/effects/actionflash2.vtf new file mode 100644 index 0000000..38c85b0 Binary files /dev/null and b/content/materials/effects/actionflash2.vtf differ diff --git a/content/materials/effects/multi/muzzleflash1.vmt b/content/materials/effects/multi/muzzleflash1.vmt new file mode 100644 index 0000000..35a4752 --- /dev/null +++ b/content/materials/effects/multi/muzzleflash1.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/multi/muzzleflash1" + "$additive" "1" + "$vertexcolor" 1 + "$vertexalpha" "1" +} \ No newline at end of file diff --git a/content/materials/effects/multi/muzzleflash1.vtf b/content/materials/effects/multi/muzzleflash1.vtf new file mode 100644 index 0000000..8c292e0 Binary files /dev/null and b/content/materials/effects/multi/muzzleflash1.vtf differ diff --git a/content/materials/effects/multi/muzzleflash2.vmt b/content/materials/effects/multi/muzzleflash2.vmt new file mode 100644 index 0000000..d0d6e25 --- /dev/null +++ b/content/materials/effects/multi/muzzleflash2.vmt @@ -0,0 +1,6 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/multi/muzzleflash2" + "$additive" "1" + "$vertexcolor" 1 + "$vertexalpha" "1" \ No newline at end of file diff --git a/content/materials/effects/multi/muzzleflash2.vtf b/content/materials/effects/multi/muzzleflash2.vtf new file mode 100644 index 0000000..1a4cd9d Binary files /dev/null and b/content/materials/effects/multi/muzzleflash2.vtf differ diff --git a/content/materials/effects/multi/muzzleflash3.vmt b/content/materials/effects/multi/muzzleflash3.vmt new file mode 100644 index 0000000..12aa757 --- /dev/null +++ b/content/materials/effects/multi/muzzleflash3.vmt @@ -0,0 +1,6 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/multi/muzzleflash3" + "$additive" "1" + "$vertexcolor" 1 + "$vertexalpha" "1" \ No newline at end of file diff --git a/content/materials/effects/multi/muzzleflash3.vtf b/content/materials/effects/multi/muzzleflash3.vtf new file mode 100644 index 0000000..070c593 Binary files /dev/null and b/content/materials/effects/multi/muzzleflash3.vtf differ diff --git a/content/materials/effects/multi/muzzleflash4.vmt b/content/materials/effects/multi/muzzleflash4.vmt new file mode 100644 index 0000000..109c68b --- /dev/null +++ b/content/materials/effects/multi/muzzleflash4.vmt @@ -0,0 +1,6 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/multi/muzzleflash4" + "$additive" "1" + "$vertexcolor" 1 + "$vertexalpha" "1" \ No newline at end of file diff --git a/content/materials/effects/multi/muzzleflash4.vtf b/content/materials/effects/multi/muzzleflash4.vtf new file mode 100644 index 0000000..f5cb8c2 Binary files /dev/null and b/content/materials/effects/multi/muzzleflash4.vtf differ diff --git a/content/materials/effects/multi/muzzleflashx.vmt b/content/materials/effects/multi/muzzleflashx.vmt new file mode 100644 index 0000000..0ee0999 --- /dev/null +++ b/content/materials/effects/multi/muzzleflashx.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/multi/muzzleflashX" + "$additive" "1" + "$vertexcolor" "1" + "$vertexalpha" "1" + \ No newline at end of file diff --git a/content/materials/effects/multi/muzzleflashx.vtf b/content/materials/effects/multi/muzzleflashx.vtf new file mode 100644 index 0000000..e7ae256 Binary files /dev/null and b/content/materials/effects/multi/muzzleflashx.vtf differ diff --git a/content/materials/effects/muzzle_root.vmt b/content/materials/effects/muzzle_root.vmt new file mode 100644 index 0000000..c50aef4 --- /dev/null +++ b/content/materials/effects/muzzle_root.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ +"$basetexture" "effects/muzzle_root" + "$additive" 1 + "$vertexcolor" 1 + "$vertexalpha" 1 +} diff --git a/content/materials/effects/muzzle_root.vtf b/content/materials/effects/muzzle_root.vtf new file mode 100644 index 0000000..d9da98f Binary files /dev/null and b/content/materials/effects/muzzle_root.vtf differ diff --git a/content/materials/effects/muzzleflash4p.vmt b/content/materials/effects/muzzleflash4p.vmt new file mode 100644 index 0000000..4a8d3d8 --- /dev/null +++ b/content/materials/effects/muzzleflash4p.vmt @@ -0,0 +1,8 @@ +"UnlitGeneric" +{ + "$basetexture" "effects/muzzleflash4p" + "$additive" 1 + "$vertexcolor" 1 + "$vertexalpha" 1 + +} diff --git a/content/materials/effects/muzzleflash4p.vtf b/content/materials/effects/muzzleflash4p.vtf new file mode 100644 index 0000000..0eb54fd Binary files /dev/null and b/content/materials/effects/muzzleflash4p.vtf differ diff --git a/content/materials/effects/muzzleflash_ptp.vmt b/content/materials/effects/muzzleflash_ptp.vmt new file mode 100644 index 0000000..66c45e8 --- /dev/null +++ b/content/materials/effects/muzzleflash_ptp.vmt @@ -0,0 +1,9 @@ +"SpriteCard" +{ + $basetexture "materials/effects/muzzleflash_ptp" + $addself 1 +// $addbasetexture2 2 +// $addbasetexture2 1.5 + $overbrightfactor 6 + $DEPTHBLEND 1 +} \ No newline at end of file diff --git a/content/materials/effects/muzzleflash_ptp.vtf b/content/materials/effects/muzzleflash_ptp.vtf new file mode 100644 index 0000000..1ea9643 Binary files /dev/null and b/content/materials/effects/muzzleflash_ptp.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_ak47.vmt b/content/materials/vgui/entities/ptp_cs_ak47.vmt new file mode 100644 index 0000000..b26f3aa --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_ak47.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_ak47" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_ak47.vtf b/content/materials/vgui/entities/ptp_cs_ak47.vtf new file mode 100644 index 0000000..b6a9931 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_ak47.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_aug.vmt b/content/materials/vgui/entities/ptp_cs_aug.vmt new file mode 100644 index 0000000..818c6ad --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_aug.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_aug" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_aug.vtf b/content/materials/vgui/entities/ptp_cs_aug.vtf new file mode 100644 index 0000000..4f12a92 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_aug.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_autoshotgun.vmt b/content/materials/vgui/entities/ptp_cs_autoshotgun.vmt new file mode 100644 index 0000000..6beaf1b --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_autoshotgun.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_autoshotgun" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_autoshotgun.vtf b/content/materials/vgui/entities/ptp_cs_autoshotgun.vtf new file mode 100644 index 0000000..0a25209 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_autoshotgun.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_awp.vmt b/content/materials/vgui/entities/ptp_cs_awp.vmt new file mode 100644 index 0000000..ab5ebaf --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_awp.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_awp" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_awp.vtf b/content/materials/vgui/entities/ptp_cs_awp.vtf new file mode 100644 index 0000000..334b42a Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_awp.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_deagle.vmt b/content/materials/vgui/entities/ptp_cs_deagle.vmt new file mode 100644 index 0000000..8c30a45 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_deagle.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_deagle" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_deagle.vtf b/content/materials/vgui/entities/ptp_cs_deagle.vtf new file mode 100644 index 0000000..39bbf64 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_deagle.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_elites.vmt b/content/materials/vgui/entities/ptp_cs_elites.vmt new file mode 100644 index 0000000..95f2056 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_elites.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_elites" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_elites.vtf b/content/materials/vgui/entities/ptp_cs_elites.vtf new file mode 100644 index 0000000..a8ab410 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_elites.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_famas.vmt b/content/materials/vgui/entities/ptp_cs_famas.vmt new file mode 100644 index 0000000..17d7ca0 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_famas.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_famas" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_famas.vtf b/content/materials/vgui/entities/ptp_cs_famas.vtf new file mode 100644 index 0000000..8452bae Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_famas.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_fiveseven.vmt b/content/materials/vgui/entities/ptp_cs_fiveseven.vmt new file mode 100644 index 0000000..f1ed131 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_fiveseven.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_fiveseven" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_fiveseven.vtf b/content/materials/vgui/entities/ptp_cs_fiveseven.vtf new file mode 100644 index 0000000..fa55022 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_fiveseven.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_g3sg1.vmt b/content/materials/vgui/entities/ptp_cs_g3sg1.vmt new file mode 100644 index 0000000..11039a2 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_g3sg1.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_g3sg1" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_g3sg1.vtf b/content/materials/vgui/entities/ptp_cs_g3sg1.vtf new file mode 100644 index 0000000..1d4e012 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_g3sg1.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_galil.vmt b/content/materials/vgui/entities/ptp_cs_galil.vmt new file mode 100644 index 0000000..a5763ac --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_galil.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_galil" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_galil.vtf b/content/materials/vgui/entities/ptp_cs_galil.vtf new file mode 100644 index 0000000..54a85b5 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_galil.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_glock.vmt b/content/materials/vgui/entities/ptp_cs_glock.vmt new file mode 100644 index 0000000..8351d56 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_glock.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_glock" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_glock.vtf b/content/materials/vgui/entities/ptp_cs_glock.vtf new file mode 100644 index 0000000..0c2e2f3 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_glock.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_knife.vmt b/content/materials/vgui/entities/ptp_cs_knife.vmt new file mode 100644 index 0000000..16942ed --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_knife.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_knife" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} \ No newline at end of file diff --git a/content/materials/vgui/entities/ptp_cs_knife.vtf b/content/materials/vgui/entities/ptp_cs_knife.vtf new file mode 100644 index 0000000..6ced692 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_knife.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_m4.vmt b/content/materials/vgui/entities/ptp_cs_m4.vmt new file mode 100644 index 0000000..17246d8 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_m4.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_m4" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_m4.vtf b/content/materials/vgui/entities/ptp_cs_m4.vtf new file mode 100644 index 0000000..e69d7ad Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_m4.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_mac10.vmt b/content/materials/vgui/entities/ptp_cs_mac10.vmt new file mode 100644 index 0000000..600c601 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_mac10.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_mac10" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_mac10.vtf b/content/materials/vgui/entities/ptp_cs_mac10.vtf new file mode 100644 index 0000000..73d3767 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_mac10.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_mp5.vmt b/content/materials/vgui/entities/ptp_cs_mp5.vmt new file mode 100644 index 0000000..7963025 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_mp5.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_mp5" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_mp5.vtf b/content/materials/vgui/entities/ptp_cs_mp5.vtf new file mode 100644 index 0000000..1e03824 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_mp5.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_p228.vmt b/content/materials/vgui/entities/ptp_cs_p228.vmt new file mode 100644 index 0000000..befc4bb --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_p228.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_p228" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_p228.vtf b/content/materials/vgui/entities/ptp_cs_p228.vtf new file mode 100644 index 0000000..4f51cda Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_p228.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_p90.vmt b/content/materials/vgui/entities/ptp_cs_p90.vmt new file mode 100644 index 0000000..db8d0eb --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_p90.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_p90" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_p90.vtf b/content/materials/vgui/entities/ptp_cs_p90.vtf new file mode 100644 index 0000000..0e97248 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_p90.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_para.vmt b/content/materials/vgui/entities/ptp_cs_para.vmt new file mode 100644 index 0000000..219547c --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_para.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_para" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_para.vtf b/content/materials/vgui/entities/ptp_cs_para.vtf new file mode 100644 index 0000000..5547c05 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_para.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_pumpshotgun.vmt b/content/materials/vgui/entities/ptp_cs_pumpshotgun.vmt new file mode 100644 index 0000000..14ce078 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_pumpshotgun.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_pumpshotgun" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_pumpshotgun.vtf b/content/materials/vgui/entities/ptp_cs_pumpshotgun.vtf new file mode 100644 index 0000000..d2a7eea Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_pumpshotgun.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_scout.vmt b/content/materials/vgui/entities/ptp_cs_scout.vmt new file mode 100644 index 0000000..0b02b42 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_scout.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_scout" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_scout.vtf b/content/materials/vgui/entities/ptp_cs_scout.vtf new file mode 100644 index 0000000..c228f1d Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_scout.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_sg550.vmt b/content/materials/vgui/entities/ptp_cs_sg550.vmt new file mode 100644 index 0000000..fd37eb2 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_sg550.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_sg550" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_sg550.vtf b/content/materials/vgui/entities/ptp_cs_sg550.vtf new file mode 100644 index 0000000..47974d3 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_sg550.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_sg552.vmt b/content/materials/vgui/entities/ptp_cs_sg552.vmt new file mode 100644 index 0000000..761fdcb --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_sg552.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_sg552" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_sg552.vtf b/content/materials/vgui/entities/ptp_cs_sg552.vtf new file mode 100644 index 0000000..44ae813 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_sg552.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_tmp.vmt b/content/materials/vgui/entities/ptp_cs_tmp.vmt new file mode 100644 index 0000000..7539955 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_tmp.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_tmp" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_tmp.vtf b/content/materials/vgui/entities/ptp_cs_tmp.vtf new file mode 100644 index 0000000..bd1d27b Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_tmp.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_ump45.vmt b/content/materials/vgui/entities/ptp_cs_ump45.vmt new file mode 100644 index 0000000..b59bc61 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_ump45.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_ump45" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_ump45.vtf b/content/materials/vgui/entities/ptp_cs_ump45.vtf new file mode 100644 index 0000000..bcc335e Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_ump45.vtf differ diff --git a/content/materials/vgui/entities/ptp_cs_usp.vmt b/content/materials/vgui/entities/ptp_cs_usp.vmt new file mode 100644 index 0000000..f7f0474 --- /dev/null +++ b/content/materials/vgui/entities/ptp_cs_usp.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_cs_usp" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_cs_usp.vtf b/content/materials/vgui/entities/ptp_cs_usp.vtf new file mode 100644 index 0000000..e4a1cd6 Binary files /dev/null and b/content/materials/vgui/entities/ptp_cs_usp.vtf differ diff --git a/content/materials/vgui/entities/ptp_weapon_flash.vmt b/content/materials/vgui/entities/ptp_weapon_flash.vmt new file mode 100644 index 0000000..24185da --- /dev/null +++ b/content/materials/vgui/entities/ptp_weapon_flash.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_weapon_flash" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_weapon_flash.vtf b/content/materials/vgui/entities/ptp_weapon_flash.vtf new file mode 100644 index 0000000..72b223d Binary files /dev/null and b/content/materials/vgui/entities/ptp_weapon_flash.vtf differ diff --git a/content/materials/vgui/entities/ptp_weapon_grenade.vmt b/content/materials/vgui/entities/ptp_weapon_grenade.vmt new file mode 100644 index 0000000..29c8642 --- /dev/null +++ b/content/materials/vgui/entities/ptp_weapon_grenade.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_weapon_grenade" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_weapon_grenade.vtf b/content/materials/vgui/entities/ptp_weapon_grenade.vtf new file mode 100644 index 0000000..045de31 Binary files /dev/null and b/content/materials/vgui/entities/ptp_weapon_grenade.vtf differ diff --git a/content/materials/vgui/entities/ptp_weapon_smoke.vmt b/content/materials/vgui/entities/ptp_weapon_smoke.vmt new file mode 100644 index 0000000..f9c344a --- /dev/null +++ b/content/materials/vgui/entities/ptp_weapon_smoke.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/ptp_weapon_smoke" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/content/materials/vgui/entities/ptp_weapon_smoke.vtf b/content/materials/vgui/entities/ptp_weapon_smoke.vtf new file mode 100644 index 0000000..f2992cd Binary files /dev/null and b/content/materials/vgui/entities/ptp_weapon_smoke.vtf differ diff --git a/content/sound/theend/missionfailed.wav b/content/sound/theend/missionfailed.wav new file mode 100644 index 0000000..0f78e62 Binary files /dev/null and b/content/sound/theend/missionfailed.wav differ diff --git a/content/sound/weapons/universal/firemode.wav b/content/sound/weapons/universal/firemode.wav new file mode 100644 index 0000000..1d2aca1 Binary files /dev/null and b/content/sound/weapons/universal/firemode.wav differ diff --git a/content/sound/weapons/universal/iron_in.wav b/content/sound/weapons/universal/iron_in.wav new file mode 100644 index 0000000..83e8e5a Binary files /dev/null and b/content/sound/weapons/universal/iron_in.wav differ diff --git a/content/sound/weapons/universal/iron_out.wav b/content/sound/weapons/universal/iron_out.wav new file mode 100644 index 0000000..76da3c3 Binary files /dev/null and b/content/sound/weapons/universal/iron_out.wav differ diff --git a/content/sound/weapons/universal/pap.wav b/content/sound/weapons/universal/pap.wav new file mode 100644 index 0000000..3f67b5b Binary files /dev/null and b/content/sound/weapons/universal/pap.wav differ diff --git a/content/sound/weapons/universal/zoom.wav b/content/sound/weapons/universal/zoom.wav new file mode 100644 index 0000000..c56c2fc Binary files /dev/null and b/content/sound/weapons/universal/zoom.wav differ diff --git a/custom_coop.txt b/custom_coop.txt new file mode 100644 index 0000000..df05571 --- /dev/null +++ b/custom_coop.txt @@ -0,0 +1,74 @@ +"coopgamemode" +{ + "base" "sandbox" + "title" "Feedc0de's coop Mode" + "menusystem" "1" + "maps" "coop" + "settings" + { + 1 + { + "name" "gc_bringcooldown" + "text" "!bring cooldown:" + "type" "Numeric" + "default" "120" + } + 2 + { + "name" "gc_allowbringplayers" + "text" "Allow the !bring command" + "type" "CheckBox" + "default" "0" + } + 3 + { + "name" "gc_allowcheckpoints" + "text" "Generate checkpoints (doors/health rechargers)" + "type" "CheckBox" + "default" "1" + } + 4 + { + "name" "gc_respawndistance" + "text" "Item distance to map origin to trigger a respawn" + "type" "Numeric" + "default" "75" + } + 6 + { + "name" "gc_realismmode" + "text" "Spectate after death until players reach checkpoint" + "type" "CheckBox" + "default" "0" + } + 7 + { + "name" "gc_realheadcrabs" + "text" "Headcrabs do more damage" + "type" "CheckBox" + "default" "1" + } + 8 + { + "name" "gc_realzombies" + "text" "Zombies do more damage" + "type" "CheckBox" + "default" "1" + } + 9 + { + "name" "gc_realisticdamage" + "text" "Damage increases with amount of players" + "type" "CheckBox" + "default" "1" + } + 10 + { + "name" "sbox_playershurtplayers" + "text" "Friendly Fire" + "type" "CheckBox" + "default" "0" + } + } + +} diff --git a/entities/weapons/coop_ak47/shared.lua b/entities/weapons/coop_ak47/shared.lua new file mode 100644 index 0000000..24b0bcd --- /dev/null +++ b/entities/weapons/coop_ak47/shared.lua @@ -0,0 +1,109 @@ +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "AK-47" + SWEP.Author = "" + SWEP.Slot = 3 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "b" + + killicon.AddFont( "coop_ak47", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "ar2" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 47 + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true +SWEP.UseHands = true + +SWEP.ViewModel = "models/weapons/cstrike/c_rif_ak47.mdl" +SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl" + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = true +SWEP.AutoSwitchFrom = true + +SWEP.Primary.Sound = Sound( "weapon_ak47.single" ) +SWEP.Primary.Recoil = 6 +SWEP.Primary.Damage = 15 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.03 +SWEP.Primary.ClipSize = 30 +SWEP.Primary.Delay = 0.12 +SWEP.Primary.DefaultClip = 30 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "smg1" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector(-6.614, -11.551, 2.648) +SWEP.IronSightsAng = Vector(2.275, 0, 0) +SWEP.AimSightsPos = Vector(-6.614, -11.551, 2.648) +SWEP.AimSightsAng = Vector(2.275, 0, 0) +SWEP.DashArmPos = Vector(4.355, -7.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 37.062, -10.664) + + +--Extras +SWEP.ReloadHolster = 2.4 +SWEP.StockIronSightAnim = false + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.08 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.02 -- Accuracy when we're standing still +SWEP.Delay = 0.1 +SWEP.Recoil = 5 +SWEP.RecoilZoom = 1 +SWEP.IronSightsCone = 0.01 + +/*--------------------------------------------------------- +SetIronsights +---------------------------------------------------------*/ +function SWEP:SetIronsights(b) + + + if self.Owner:KeyDown(IN_USE) then return end + + if self.Owner:KeyDown(IN_SPEED) then return end + + if !self.Owner:OnGround() then return end + + self.Weapon:SetNetworkedBool("Ironsights", b) + + if self.Weapon:GetNetworkedBool( "Ironsights", true) then + --self.Primary.Recoil = self.RecoilZoom + self.IronSightsPos = self.AimSightsPos + self.IronSightsAng = self.AimSightsAng + self.Weapon:EmitSound("weapons/universal/iron_in.wav") + self.Owner:SetFOV(self.ZoomFOV, 0.15) + if self.CSSZoom then + self.Primary.Recoil = self.RecoilZoom + self.Primary.Delay = self.DelayZoom + end + else + self.Primary.Recoil = self.Recoil + self.Owner:SetFOV(0, 0.15) + if self.CSSZoom then + self.Primary.Recoil = self.Recoil + self.Primary.Delay = self.Delay + end + self.Weapon:EmitSound("weapons/universal/iron_out.wav") + end + +end diff --git a/entities/weapons/coop_autoshotgun/shared.lua b/entities/weapons/coop_autoshotgun/shared.lua new file mode 100644 index 0000000..2f1baab --- /dev/null +++ b/entities/weapons/coop_autoshotgun/shared.lua @@ -0,0 +1,63 @@ +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Automatic Shotgun" + SWEP.Author = "" + SWEP.Slot = 2 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "B" + + + killicon.AddFont( "coop_autoshotgun", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "shotgun" +SWEP.Base = "coop_shotgun_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_shot_xm1014.mdl" +SWEP.WorldModel = "models/weapons/w_shot_xm1014.mdl" +SWEP.UseHands = true +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 54 + +SWEP.Weight = 10 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_xm1014.Single" ) +SWEP.Primary.Recoil = 3 +SWEP.Primary.Damage = 10 +SWEP.Primary.NumShots = 6 +SWEP.Primary.Cone = 0.09 +SWEP.Primary.ClipSize = 7 +SWEP.Primary.Delay = 0.25 +SWEP.Primary.DefaultClip = 7 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "buckshot" + +SWEP.IronSightsPos = Vector(-6.96, -4.329, 2.7) +SWEP.IronSightsAng = Vector(-0.2, -0.8, 0) +SWEP.AimSightsPos = Vector(-6.96, -4.329, 2.7) +SWEP.AimSightsAng = Vector(-0.2, -0.8, 0) +SWEP.DashArmPos = Vector(4.355, -7.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 47.062, -10.664) + +--Extras +SWEP.ReloadHolster = 3 +SWEP.StockIronSightAnim = true + +--Accuracy +SWEP.Delay = 0.25 +SWEP.Recoil = 3 +SWEP.RecoilZoom = 2 + diff --git a/entities/weapons/coop_deagle/shared.lua b/entities/weapons/coop_deagle/shared.lua new file mode 100644 index 0000000..53b9a17 --- /dev/null +++ b/entities/weapons/coop_deagle/shared.lua @@ -0,0 +1,70 @@ + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Desert Eagle" + SWEP.Author = "" + + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "f" + + killicon.AddFont( "coop_deagle", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "revolver" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_pist_deagle.mdl" +SWEP.WorldModel = "models/weapons/w_pist_deagle.mdl" +SWEP.UseHands = true +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 45 +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_Deagle.Single" ) +SWEP.Primary.Recoil = 7 +SWEP.Primary.Damage = 60 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.01 +SWEP.Primary.ClipSize = 7 +SWEP.Primary.Delay = 0.3 +SWEP.Primary.DefaultClip = 7 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "357" + +SWEP.IronSightsPos = Vector(-6.365, -11.287, 2.134) +SWEP.IronSightsAng = Vector(0.056, 0, 0) +SWEP.AimSightsPos = Vector(-6.365, -11.287, 2.134) +SWEP.AimSightsAng = Vector(0.056, 0, 0) +SWEP.DashArmPos = Vector(0, 0, 0) +SWEP.DashArmAng = Vector(-10, 0, 0) + + +--Extras +SWEP.ReloadHolster = 2 +SWEP.ZoomFOV = 85 +SWEP.StockIronSightAnim = true + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.08 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.01 -- Accuracy when we're standing still +SWEP.IronsightsCone = 0.015 +SWEP.Recoil = 7 +SWEP.Delay = 0.3 +SWEP.DelayZoom = 0.2 diff --git a/entities/weapons/coop_famas/shared.lua b/entities/weapons/coop_famas/shared.lua new file mode 100644 index 0000000..5fe0b5b --- /dev/null +++ b/entities/weapons/coop_famas/shared.lua @@ -0,0 +1,73 @@ +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Famas" + SWEP.Author = "" + SWEP.Slot = 3 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "t" + + killicon.AddFont( "coop_famas", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "ar2" +SWEP.Base = "coop_zoom_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/cstrike/c_rif_famas.mdl" +SWEP.WorldModel = "models/weapons/w_rif_famas.mdl" +SWEP.UseHands = true +SWEP.ViewModelFOV = 57 + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_famas.Single" ) +SWEP.Primary.Recoil = 4 +SWEP.Primary.Damage = 14 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.015 +SWEP.Primary.ClipSize = 25 +SWEP.Primary.Delay = 0.1 +SWEP.Primary.DefaultClip = 25 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "smg1" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector(-3.57, -6.375, 0) +SWEP.IronSightsAng = Vector(2.497, 0.05, 0.7) +SWEP.AimSightsPos = Vector(-3.57, -6.375, 0) +SWEP.AimSightsAng = Vector(2.497, 0.05, 0.7) +SWEP.DashArmPos = Vector(2.055, -4.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 37.062, -10.664) + +--Extras +SWEP.ReloadHolster = 3.3 +SWEP.StockIronSightAnim = true + + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.05 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.015 -- Accuracy when we're standing still +SWEP.Delay = 0.09 +SWEP.Recoil = 3 +SWEP.RecoilZoom = 0.7 +SWEP.IronSightsCone = 0.01 + diff --git a/entities/weapons/coop_fiveseven/shared.lua b/entities/weapons/coop_fiveseven/shared.lua new file mode 100644 index 0000000..c81a046 --- /dev/null +++ b/entities/weapons/coop_fiveseven/shared.lua @@ -0,0 +1,67 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Five-Seven" + SWEP.Author = "" + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "u" + + killicon.AddFont( "coop_fiveseven", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "pistol" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_pist_fiveseven.mdl" +SWEP.WorldModel = "models/weapons/w_pist_fiveseven.mdl" +SWEP.ViewModelFOV = 47 +SWEP.UseHands = true +SWEP.ViewModelFlip = false +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_FiveSeven.Single" ) +SWEP.Primary.Recoil = 2.5 +SWEP.Primary.Damage = 8 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.01 +SWEP.Primary.ClipSize = 20 +SWEP.Primary.Delay = 0.09 +SWEP.Primary.DefaultClip = 20 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "pistol" + +SWEP.IronSightsPos = Vector(-5.95, -6.375, 3) +SWEP.IronSightsAng = Vector(-0.5, 0, 0) +SWEP.AimSightsPos = Vector(-5.95, -6.375, 3) +SWEP.AimSightsAng = Vector(-0.5, 0, 0) +SWEP.DashArmPos = Vector(0, 0, 0) +SWEP.DashArmAng = Vector(-10, 0, 0) + +--Extras +SWEP.ReloadHolster = 3 +SWEP.StockIronSightAnim = true + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.015 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.04 -- Accuracy when we're walking +SWEP.AirCone = 0.085 -- Accuracy when we're in air +SWEP.StandCone = 0.01 -- Accuracy when we're standing still +SWEP.Recoil = 2.5 +SWEP.RecoilZoom = 0.7 +SWEP.Delay = 0.09 diff --git a/entities/weapons/coop_glock/shared.lua b/entities/weapons/coop_glock/shared.lua new file mode 100644 index 0000000..ddfebcb --- /dev/null +++ b/entities/weapons/coop_glock/shared.lua @@ -0,0 +1,79 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Glock" + SWEP.Author = "" + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "c" + + killicon.AddFont( "coop_glock", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "pistol" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = false + +SWEP.ViewModel = "models/weapons/cstrike/c_pist_glock18.mdl" +SWEP.WorldModel = "models/weapons/w_pist_glock18.mdl" +SWEP.UseHands = true +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 44 +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_Glock.Single" ) +SWEP.Primary.Recoil = 3 +SWEP.Primary.Damage = 9 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.015 +SWEP.Primary.ClipSize = 20 +SWEP.Primary.Delay = 0.09 +SWEP.Primary.DefaultClip = 20 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "pistol" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector(-5.77, -5.15, 2.785) +SWEP.IronSightsAng = Vector(0.46, 0, 0) +SWEP.AimSightsPos = Vector(-5.77, -5.15, 2.785) +SWEP.AimSightsAng = Vector(0.46, 0, 0) +SWEP.DashArmPos = Vector(0, 0, 0) +SWEP.DashArmAng = Vector(-10, 0, 0) + +--Extras +SWEP.ReloadHolster = 1.9 +SWEP.PistolBurstOnly = true +SWEP.StockIronSightAnim = true + +--FireModes +SWEP.FiringMode = true +SWEP.Burstable = true +SWEP.BurstShots = 3 + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.015 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.02 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.015 -- Accuracy when we're standing still +SWEP.Recoil = 3 +SWEP.RecoilZoom = 0.7 +SWEP.Delay = 0.09 + diff --git a/entities/weapons/coop_m4/shared.lua b/entities/weapons/coop_m4/shared.lua new file mode 100644 index 0000000..f13c4e3 --- /dev/null +++ b/entities/weapons/coop_m4/shared.lua @@ -0,0 +1,77 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "M4A1" + SWEP.Author = "" + SWEP.Slot = 3 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "w" + + killicon.AddFont( "coop_m4", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "ar2" +SWEP.Base = "coop_zoom_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_rif_m4a1.mdl" +SWEP.WorldModel = "models/weapons/w_rif_m4a1.mdl" +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 54 +SWEP.UseHands = true +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_M4A1.Single" ) +SWEP.SilencedSound = Sound( "Weapon_M4a1.Silenced" ) +SWEP.Primary.Recoil = 2.5 +SWEP.Primary.Damage = 13 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.01 +SWEP.Primary.ClipSize = 30 +SWEP.Primary.Delay = 0.08 +SWEP.Primary.DefaultClip = 30 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "smg1" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector(-3.57, -6.375, 0) +SWEP.IronSightsAng = Vector(2.497, 0.05, 0.7) +SWEP.AimSightsPos = Vector(-3.57, -6.375, 0) +SWEP.AimSightsAng = Vector(2.497, 0.05, 0.7) +SWEP.DashArmPos = Vector(2.359, -2.6, -4.113) +SWEP.DashArmAng = Vector(-10.965, 37.062, -10.664) + +--Extras +SWEP.ReloadHolster = 2.9 +SWEP.SilenceHolster = 2 +SWEP.StockIronSightAnim = true + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.05 -- Accuracy when we're walking +SWEP.AirCone = 0.15 -- Accuracy when we're in air +SWEP.StandCone = 0.01 -- Accuracy when we're standing still +SWEP.Delay = 0.1 +SWEP.Recoil = 2.5 +SWEP.RecoilZoom = 0.7 +SWEP.IronSightsCone = 0.01 +SWEP.Silenceable = true +SWEP.SilenceTiming = 2 \ No newline at end of file diff --git a/entities/weapons/coop_mac10/shared.lua b/entities/weapons/coop_mac10/shared.lua new file mode 100644 index 0000000..d0aed17 --- /dev/null +++ b/entities/weapons/coop_mac10/shared.lua @@ -0,0 +1,70 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "MAC-10" + SWEP.Author = "" + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "l" + + killicon.AddFont( "coop_mac10", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "smg" +SWEP.Base = "coop_zoom_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_smg_mac10.mdl" +SWEP.WorldModel = "models/weapons/w_smg_mac10.mdl" +SWEP.UseHands = true +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 47 +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_mac10.Single" ) +SWEP.Primary.Recoil = 5 +SWEP.Primary.Damage = 6 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.05 +SWEP.Primary.ClipSize = 30 +SWEP.Primary.Delay = 0.07 +SWEP.Primary.DefaultClip = 30 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "pistol" + +SWEP.IronSightsPos = Vector(-6.185, -7.106, 0.885) +SWEP.IronSightsAng = Vector(0.601, -5.383, -8.29) +SWEP.AimSightsPos = Vector(-6.185, -7.106, 0.885) +SWEP.AimSightsAng = Vector(0.601, -5.383, -8.29) +SWEP.DashArmPos = Vector(4.355, -7.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 47.062, -10.664) + +--Extras +SWEP.ReloadHolster = 3.2 +SWEP.StockIronSightAnim = true + +-- Accuracy +SWEP.CrouchCone = 0.03 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.035 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.1 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.07 -- Accuracy when we're standing still +SWEP.IronSightsCone = 0.01 +SWEP.Recoil = 5 +SWEP.RecoilZoom = 0.8 +SWEP.Delay = 0.07 + + diff --git a/entities/weapons/coop_mp5/shared.lua b/entities/weapons/coop_mp5/shared.lua new file mode 100644 index 0000000..bab83f1 --- /dev/null +++ b/entities/weapons/coop_mp5/shared.lua @@ -0,0 +1,69 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "MP5" + SWEP.Author = "" + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "x" + + killicon.AddFont( "coop_mp5", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "ar2" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_smg_mp5.mdl" +SWEP.WorldModel = "models/weapons/w_smg_mp5.mdl" +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 55 +SWEP.UseHands = true + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false +SWEP.Primary.Sound = Sound( "Weapon_MP5Navy.Single" ) +SWEP.Primary.Recoil = 2.5 +SWEP.Primary.Damage = 9 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.02 +SWEP.Primary.ClipSize = 30 +SWEP.Primary.Delay = 0.08 +SWEP.Primary.DefaultClip = 30 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "pistol" + +SWEP.IronSightsPos = Vector(-5.33, -5.431, 2.1) +SWEP.IronSightsAng = Vector(0.886, 0, 0) +SWEP.AimSightsPos = Vector(-5.33, -5.431, 2.1) +SWEP.AimSightsAng = Vector(0.886, 0, 0) +SWEP.DashArmPos = Vector(4.355, -7.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 47.062, -10.664) + +--Extras +SWEP.ReloadHolster = 2.9 +SWEP.StockIronSightAnim = false + + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.05 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.02 -- Accuracy when we're standing still +SWEP.Recoil = 2.5 +SWEP.RecoilZoom = 0.8 + + diff --git a/entities/weapons/coop_p228/shared.lua b/entities/weapons/coop_p228/shared.lua new file mode 100644 index 0000000..83ecbca --- /dev/null +++ b/entities/weapons/coop_p228/shared.lua @@ -0,0 +1,67 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "p228" + SWEP.Author = "" + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "y" + + killicon.AddFont( "coop_p228", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "pistol" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_pist_p228.mdl" +SWEP.WorldModel = "models/weapons/w_pist_p228.mdl" +SWEP.UseHands = true +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 47 + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false +SWEP.Primary.Sound = Sound( "Weapon_p228.Single" ) +SWEP.Primary.Recoil = 3 +SWEP.Primary.Damage = 10 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.01 +SWEP.Primary.ClipSize = 13 +SWEP.Primary.Delay = 0.08 +SWEP.Primary.DefaultClip = 13 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "pistol" + +SWEP.IronSightsPos = Vector(-5.98, 0.375, 3) +SWEP.IronSightsAng = Vector(-0.5, 0, 0) +SWEP.AimSightsPos = Vector(-5.98, 0.375, 3) +SWEP.AimSightsAng = Vector(-0.5, 0, 0) +SWEP.DashArmPos = Vector(0, 0, 0) +SWEP.DashArmAng = Vector(-10, 0, 0) + +--Extras +SWEP.ReloadHolster = 2.5 +SWEP.StockIronSightAnim = true + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.015 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.02 -- Accuracy when we're walking +SWEP.AirCone = 0.15 -- Accuracy when we're in air +SWEP.StandCone = 0.01 -- Accuracy when we're standing still +SWEP.Recoil = 3 +SWEP.RecoilZoom = 0.8 +SWEP.Delay = 0.08 \ No newline at end of file diff --git a/entities/weapons/coop_para/shared.lua b/entities/weapons/coop_para/shared.lua new file mode 100644 index 0000000..445df0f --- /dev/null +++ b/entities/weapons/coop_para/shared.lua @@ -0,0 +1,68 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "M249" + SWEP.Author = "" + SWEP.Slot = 3 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "z" + + killicon.AddFont( "coop_para", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "ar2" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_mach_m249para.mdl" +SWEP.WorldModel = "models/weapons/w_mach_m249para.mdl" +SWEP.ViewModelFOV = 55 +SWEP.UseHands = true +SWEP.ViewModelFlip = false + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false +SWEP.Primary.Sound = Sound( "Weapon_m249.Single" ) +SWEP.Primary.Recoil = 6 +SWEP.Primary.Damage = 12 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.07 +SWEP.Primary.ClipSize = 100 +SWEP.Primary.Delay = 0.09 +SWEP.Primary.DefaultClip = 100 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "smg1" + +SWEP.IronSightsPos = Vector(-5.935, -6.31, 2.3) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.AimSightsPos = Vector(-5.935, -6.31, 2.3) +SWEP.AimSightsAng = Vector(0, 0, 0) +SWEP.DashArmPos = Vector(4.355, -7.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 47.062, -10.664) + +--Extras +SWEP.ReloadHolster = 5.7 +SWEP.StockIronSightAnim = false + +-- Accuracy +SWEP.CrouchCone = 0.04 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.055 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.15 -- Accuracy when we're walking +SWEP.AirCone = 0.2 -- Accuracy when we're in air +SWEP.StandCone = 0.07 -- Accuracy when we're standing still +SWEP.IronSightsCone = 0.01 +SWEP.Delay = 0.09 +SWEP.Recoil = 6 +SWEP.RecoilZoom = 1 \ No newline at end of file diff --git a/entities/weapons/coop_pumpshotgun/shared.lua b/entities/weapons/coop_pumpshotgun/shared.lua new file mode 100644 index 0000000..c16ba81 --- /dev/null +++ b/entities/weapons/coop_pumpshotgun/shared.lua @@ -0,0 +1,59 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Pump Shotgun" + SWEP.Author = "" + SWEP.Slot = 2 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "k" + + killicon.AddFont( "coop_pumpshotgun", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "ar2" +SWEP.Base = "coop_shotgun_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_shot_m3super90.mdl" +SWEP.WorldModel = "models/weapons/w_shot_m3super90.mdl" +SWEP.ViewModelFlip = false +SWEP.ViewModelFOV = 46 +SWEP.UseHands = true + +SWEP.Weight = 10 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false +SWEP.Primary.Sound = Sound( "Weapon_m3.Single" ) +SWEP.Primary.Recoil = 3 +SWEP.Primary.Damage = 15 +SWEP.Primary.NumShots = 7 +SWEP.Primary.Cone = 0.1 +SWEP.Primary.ClipSize = 8 +SWEP.Primary.Delay = 0.9 +SWEP.Primary.DefaultClip = 8 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "buckshot" + +SWEP.IronSightsPos = Vector(-7.644, -4.115, 3.5) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.AimSightsPos = Vector(-7.644, -4.115, 3.5) +SWEP.AimSightsAng = Vector(0, 0, 0) +SWEP.DashArmPos = Vector(4.355, -7.206, -0.681) +SWEP.DashArmAng = Vector(-10.965, 47.062, -10.664) + +SWEP.StockIronSightAnim = true + +SWEP.Delay = 0.9 +SWEP.Recoil = 3 +SWEP.RecoilZoom = 2 diff --git a/entities/weapons/coop_shotgun_base/shared.lua b/entities/weapons/coop_shotgun_base/shared.lua new file mode 100644 index 0000000..4dcac4f --- /dev/null +++ b/entities/weapons/coop_shotgun_base/shared.lua @@ -0,0 +1,351 @@ +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "Shotteh" + SWEP.Author = "Fonix" + SWEP.Slot = 2 + SWEP.SlotPos = 0 + SWEP.IconLetter = "" + SWEP.IconLetterCSS = "" + + killicon.AddFont( "weapon_cs_ak47", "TextKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) ) + surface.CreateFont("TextKillIcons", { font="Roboto-Medium", weight="500", size=ScreenScale(13),antialiasing=true,additive=true }) + surface.CreateFont("TextSelectIcons", { font="Roboto-Medium", weight="500", size=ScreenScale(20),antialiasing=true,additive=true }) + surface.CreateFont("CSKillIcons", { font="csd", weight="500", size=ScreenScale(30),antialiasing=true,additive=true }) + surface.CreateFont("CSSelectIcons", { font="csd", weight="500", size=ScreenScale(60),antialiasing=true,additive=true }) +end + + +SWEP.HoldType = "shotgun" +SWEP.Base = "coop_weapon_base" +SWEP.Category = "PTP: Heavy" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.ViewModel = "models/weapons/v_shot_war_md.mdl" +SWEP.WorldModel = "models/weapons/w_shot_war_md.mdl" +SWEP.ViewModelFlip = true +SWEP.ViewModelFOV = 65 +SWEP.BounceWeaponIcon = false + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = true +SWEP.AutoSwitchFrom = true + +SWEP.Primary.Sound = Sound( "sound_fire.single" ) +SWEP.Primary.Recoil = 4 +SWEP.Primary.Damage = 15 +SWEP.Primary.NumShots = 10 +SWEP.Primary.Cone = 0.05 +SWEP.Primary.ClipSize = 8 +SWEP.Primary.Delay = 0.3 +SWEP.Primary.DefaultClip = 64 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "buckshot" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector( 2.03, -5, 0.7 ) +SWEP.IronSightsAng = Vector( 0, 0, 0 ) + +--Extras +SWEP.MuzzleEffect = "lee_muzzle_rifle" +SWEP.MuzzleAttachment = "1" +SWEP.MuzzleAttachmentTrue = true +SWEP.TracerShot = 3 +SWEP.BulletForce = 10 +SWEP.Silenceable = false +SWEP.SilenceTiming = 2 +SWEP.ZoomFOV = 65 +SWEP.CSSZoom = false +SWEP.ShellTime = 0.5 +SWEP.StockIronSightAnim = true -- This is used for multiplayer, check out the ak. Do we want to use the animation or the scripted animation? + +-- Accuracy +SWEP.Delay = 0.4 -- Delay For Not Zoom +SWEP.Recoil = 4 -- Recoil For not Aimed +SWEP.RecoilZoom = 0.3 -- Recoil For Zoom + +/*--------------------------------------------------------- + PrimaryAttack +---------------------------------------------------------*/ +function SWEP:SecondaryAttack() +end + +function SWEP:PrimaryAttack() + + local DisableDashing = false + + if GetConVar("sv_ptp_dashing_disable") == nil then + DisableDashing = false + else + DisableDashing = GetConVar("sv_ptp_dashing_disable"):GetBool() + end + + if(!self.Owner:IsNPC()) then + if self.Owner:KeyPressed(IN_ATTACK) and self.Owner:KeyDown(IN_RELOAD) then return end + end + + if(!self.Owner:IsNPC()) then + if self.Owner:KeyDown(IN_SPEED) and not DisableDashing then return end + end + + + self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) + + if ( !self:CanPrimaryAttack() ) then return end + // If Swep Data is Silenced Play Silenced else Unsilenced + if self.Weapon:GetNetworkedBool("Silenced") == true then + self.Weapon:EmitSound( self.SilencedSound ) + self:CSShootBullet( self.Primary.Damage * 0.8, self.Recoil * 0.75, self.Primary.NumShots, self.Primary.Cone, self.MuzzleEffect ) + end + if self.Weapon:GetNetworkedBool("pap") == true then + self.Weapon:EmitSound( self.PackAPunchSound ) + self:CSShootBullet( self.Primary.Damage * 2, self.Recoil * 0.4, self.Primary.NumShots, self.Primary.Cone, "lee_muzzle_rifle_pap" ) + end + if ((self.Weapon:GetNetworkedBool("pap") == false) and (self.Weapon:GetNetworkedBool("Silenced") == false)) then + self.Weapon:EmitSound( self.Primary.Sound ) + self:CSShootBullet( self.Primary.Damage , self.Recoil , self.Primary.NumShots, self.Primary.Cone, self.MuzzleEffect ) + end + //If Swep Data is Silenced Play Silenced else Unsilenced + + // Remove 1 bullet from our clip + self:TakePrimaryAmmo( self.TakeAmmoOnShot ) + + if ( self.Owner:IsNPC() ) then return end + + // Punch the player's view + self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil * 10, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) ) + + // In singleplayer this function doesn't get called on the client, so we use a networked float + // to send the last shoot time. In multiplayer this is predicted clientside so we don't need to + // send the float. + if ( (game.SinglePlayer() && SERVER) || CLIENT ) then + self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() ) + end + +end +/*--------------------------------------------------------- + Reload does nothing +---------------------------------------------------------*/ +function SWEP:Reload() + + //if ( CLIENT ) then return end + + if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then return end + + if ( self.Weapon:Clip1() < 1) and self.Owner:KeyPressed(IN_ATTACK) or ( self.Weapon:Clip1() == self.Primary.ClipSize )then return end + self:SetIronsights(false) + //Set the ironsight mode to false + + + self.Owner:SetFOV(0, 0.15) + self.Primary.Recoil = self:GetNWInt("recoil") + + // Already reloading + self.Weapon:SetVar( "reloadtimer",0 ) + + + + // Start reloading if we can + if ( self.Weapon:Clip1() < self.Primary.ClipSize && self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then + + self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) + + self.Weapon:SetNetworkedBool( "reloading", true ) + self.Weapon:SetNetworkedBool("Ironsights", false) + self.Weapon:SetNetworkedFloat( "reloadtimer", CurTime() + self.ShellTime + 0.3 ) + + end +end + +/*--------------------------------------------------------- + Think does nothing +---------------------------------------------------------*/ +function SWEP:Think() + + + self:ShottyReload() + + self:DashingPos() //Dont to be confused with doshing + + --Recoil on Zoom/UnZoomed + if self.Weapon:GetNetworkedBool( "Ironsights" ) then + self.Primary.Recoil = self:GetNWInt("recoilzoom") + else + self.Primary.Recoil = self:GetNWInt("recoil") + end + + local DisableDashing = false //Garanties on disable that ironsights stay the aimsights + + if GetConVar("sv_ptp_dashing_disable") == nil then + DisableDashing = false + else + DisableDashing = GetConVar("sv_ptp_dashing_disable"):GetBool() + end + + if DisableDashing then + self.IronSightsPos = self.AimSightsPos + self.IronSightsAng = self.AimSightsAng + end + + if self.Owner:KeyPressed(IN_SPEED) or self.Owner:KeyPressed(IN_JUMP) and not self.Owner:KeyDown(IN_SPEED) then + self.Weapon:SetNetworkedBool("Ironsights", false) + self.Owner:SetFOV(0, 0.15) + self.Primary.Recoil = self:GetNWInt("recoil") + end +end + +/*--------------------------------------------------------- +Shotty Reload +---------------------------------------------------------*/ +function SWEP:ShottyReload() + + + if self.Owner:KeyPressed(IN_ATTACK) then + self.Weapon:SetNetworkedBool( "reloading", false ) + end + + if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then + + if ( self.Weapon:GetNetworkedFloat( "reloadtimer" ) < CurTime()) then + + // Finsished reload + if ( self.Weapon:Clip1() >= self.Primary.ClipSize || self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0 ) then + self.Weapon:SetNetworkedBool( "reloading", false ) + return + end + + self.Weapon:SetNetworkedFloat( "reloadtimer", CurTime() + self.ShellTime ) + if not ( self.Weapon:Clip1() == self.Primary.ClipSize) then + + vm = self.Owner:GetViewModel()-- its a messy way to do it, but holy shit, it works! + vm:ResetSequence(vm:LookupSequence("after_reload")) -- Fuck you, garry, why the hell can't I reset a sequence in multiplayer? + vm:SetPlaybackRate(.01) + + timer.Simple(0.01, function () + self.Weapon:SendWeaponAnim( ACT_VM_RELOAD ) + end) + end + + // Add ammo + self.Owner:RemoveAmmo( 1, self.Primary.Ammo, false ) + self.Weapon:SetClip1( self.Weapon:Clip1() + 1 ) + + // Finish filling, final pump. Current Clip is = to ClipSize or No more ammo in the reserve + if ( self.Weapon:Clip1() == self.Primary.ClipSize || self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0) then + self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay) + timer.Simple( 0.5, function() + if self.Weapon == nil then return end + self.Weapon:SendWeaponAnim( ACT_SHOTGUN_RELOAD_FINISH ) + self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay) + timer.Simple( 1, function() + if self.Weapon == nil then return end + self.Weapon:SetNetworkedBool( "reloading", false ) + end) + end ) + + end + end +end +end +/*--------------------------------------------------------- +DashingPos +---------------------------------------------------------*/ +function SWEP:DashingPos() + + + if self.Weapon:GetNetworkedBool("reloading", true) then return end + + local DisableDashing = false + + if DisableDashing then return end + + if self.Owner:KeyDown(IN_SPEED) then + self.IronSightsPos = self.DashArmPos + self.IronSightsAng = self.DashArmAng + self.Weapon:SetNetworkedBool("Ironsights", true) + self.SwayScale = 1.0 + self.BobScale = 2.0 + if not (self.Pistol) then + self:SetWeaponHoldType("passive") + else + self:SetWeaponHoldType("normal") + end + end + + if self.Owner:KeyReleased(IN_SPEED) then + self.Weapon:SetNextPrimaryFire( CurTime() + 0.2 ) + self.Weapon:SetNetworkedBool("Ironsights", false) + self:SetWeaponHoldType( self.HoldType ) + end + + if self.Owner:KeyDown(IN_SPEED) then return end + +end + +local IRONSIGHT_TIME = 0.15 +/*--------------------------------------------------------- + Name: GetViewModelPosition + Desc: Allows you to re-position the view model +---------------------------------------------------------*/ +function SWEP:GetViewModelPosition( pos, ang ) + + if ( !self.IronSightsPos ) then return pos, ang end + + local bIron = self.Weapon:GetNetworkedBool( "Ironsights" ) + + if (bIron != self.bLastIron) then + self.bLastIron = bIron + self.fIronTime = CurTime() + + if (bIron) then + self.SwayScale = 0.3 + self.BobScale = 0.01 + else + self.SwayScale = 1.5 + self.BobScale = 1 + end + + end + + local fIronTime = self.fIronTime or 0 + + if (!bIron && fIronTime < CurTime() - IRONSIGHT_TIME) then + return pos, ang + end + + local Mul = 1.0 + + if (fIronTime > CurTime() - IRONSIGHT_TIME) then + Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1) + + if (!bIron) then Mul = 1 - Mul end + end + + if (self.IronSightsAng) then + ang = ang * 1 + ang:RotateAroundAxis(ang:Right(), self.IronSightsAng.x * Mul) + ang:RotateAroundAxis(ang:Up(), self.IronSightsAng.y * Mul) + ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul) + end + + local Right = ang:Right() + local Up = ang:Up() + local Forward = ang:Forward() + + pos = pos + self.IronSightsPos.x * Right * Mul + pos = pos + self.IronSightsPos.y * Forward * Mul + pos = pos + self.IronSightsPos.z * Up * Mul + + return pos, ang +end \ No newline at end of file diff --git a/entities/weapons/coop_usp/shared.lua b/entities/weapons/coop_usp/shared.lua new file mode 100644 index 0000000..759dda1 --- /dev/null +++ b/entities/weapons/coop_usp/shared.lua @@ -0,0 +1,77 @@ + + +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end + +if ( CLIENT ) then + + SWEP.PrintName = "USP" + SWEP.Author = "" + SWEP.Slot = 1 + SWEP.SlotPos = 0 + SWEP.IconLetterCSS = "a" + + killicon.AddFont( "coop_usp", "CSKillIcons", SWEP.IconLetterCSS, Color( 255, 80, 0, 255 ) ) + +end + +SWEP.HoldType = "pistol" +SWEP.Base = "coop_zoom_base" +SWEP.Category = "CO-OP" + +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.ViewModel = "models/weapons/cstrike/c_pist_usp.mdl" +SWEP.WorldModel = "models/weapons/w_pist_usp.mdl" +SWEP.ViewModelFlip = false +SWEP.UseHands = true +SWEP.ViewModelFOV = 47 +SWEP.Weight = 5 +SWEP.AutoSwitchTo = false +SWEP.AutoSwitchFrom = false + +SWEP.Primary.Sound = Sound( "Weapon_usp.Single" ) +SWEP.SilencedSound = Sound( "Weapon_usp.SilencedShot" ) +SWEP.Primary.Recoil = 2 +SWEP.Primary.Damage = 9 +SWEP.Primary.NumShots = 1 +SWEP.Primary.Cone = 0.01 +SWEP.Primary.ClipSize = 12 +SWEP.Primary.Delay = 0.08 +SWEP.Primary.DefaultClip = 12 +SWEP.Primary.Automatic = false +SWEP.Primary.Ammo = "pistol" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector(-3.57, -6.375, 0) +SWEP.IronSightsAng = Vector(2.497, 0.05, 0.7) +SWEP.AimSightsPos = Vector(-3.57, -6.375, 0) +SWEP.AimSightsAng = Vector(2.497, 0.05, 0.7) +SWEP.DashArmPos = Vector(0, 0, 0) +SWEP.DashArmAng = Vector(-10, 0, 0) + +--Extras +SWEP.ReloadHolster = 2.4 +SWEP.SilenceHolster = 2.9 +SWEP.StockIronSightAnim = true + +-- Accuracy +SWEP.CrouchCone = 0.005 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.01 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.02 -- Accuracy when we're walking +SWEP.AirCone = 0.07 -- Accuracy when we're in air +SWEP.StandCone = 0.01 -- Accuracy when we're standing still +SWEP.Recoil = 2 +SWEP.Delay = 0.08 +SWEP.DelayZoom = 0.08 +SWEP.IronSightsCone = 0.015 +SWEP.Silenceable = true +SWEP.SilenceTiming = 2 \ No newline at end of file diff --git a/entities/weapons/coop_weapon_base/shared.lua b/entities/weapons/coop_weapon_base/shared.lua new file mode 100644 index 0000000..f4baea3 --- /dev/null +++ b/entities/weapons/coop_weapon_base/shared.lua @@ -0,0 +1,787 @@ +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end +----------------------------------------------------------/ +--/ --/ +--/ Project Start: 11/11/13 --/ +--/ --/ +----------------------------------------------------------/ +----------------------------------------------------------- +-- Client Variables +----------------------------------------------------------- +if ( CLIENT ) then + + SWEP.PrintName = "SWEPNAME" + SWEP.Author = "Fonix" + SWEP.Slot = 2 + SWEP.SlotPos = 1 + SWEP.IconLetter = "" --Text Font + SWEP.IconLetterCSS = "" --For Css Font + SWEP.DrawCrosshair = true + SWEP.DrawAmmo = true + SWEP.CSMuzzleFlashes = true + + killicon.AddFont( "weapon_cs_ak47_gb", "TextKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) ) + surface.CreateFont("TextKillIcons", { font="Roboto-Medium", weight="500", size=ScreenScale(13),antialiasing=true,additive=true }) + surface.CreateFont("TextSelectIcons", { font="Roboto-Medium", weight="500", size=ScreenScale(20),antialiasing=true,additive=true }) + surface.CreateFont("CSKillIcons", { font="csd", weight="500", size=ScreenScale(30),antialiasing=true,additive=true }) + surface.CreateFont("CSSelectIcons", { font="csd", weight="500", size=ScreenScale(60),antialiasing=true,additive=true }) + +end +----------------------------------------------------------- +-- The Layout... +--------------------------------------------------------- +SWEP.Category = "Hello" +SWEP.ViewModelFlip = true + +SWEP.Spawnable = false -- Delete this comment and change these to true +SWEP.AdminSpawnable = false -- If you don't you can't spawn the swep :( + +SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl" +SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl" +SWEP.ViewModelFOV = 55 + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = true +SWEP.AutoSwitchFrom = true +SWEP.BounceWeaponIcon = false + +SWEP.Primary.Sound = Sound( "" ) +SWEP.SilencedSound = Sound( "" ) --This is for silencers. Dont bite me, I know its really called a suppressor. +SWEP.PackAPunchSound = Sound( "pap.Single" ) +SWEP.Primary.Recoil = 1 +SWEP.Primary.Damage = 34 +SWEP.Primary.NumShots = 0 +SWEP.Primary.Cone = 0.02 +SWEP.Primary.ClipSize = 30 +SWEP.Primary.Delay = 0.08 +SWEP.Primary.DefaultClip = 300 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "smg1" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +--Extras +SWEP.MuzzleEffect = "lee_muzzle_rifle" -- Muzzle attachments should not be messed with +SWEP.MuzzleAttachment = "1" -- There's only one anyways +SWEP.MuzzleAttachmentTrue = true -- Keep it true +SWEP.TracerShot = 3 -- On what shot should there be a tracer? +SWEP.TakeAmmoOnShot = 1 -- How many rounds should we take per shot? Typically leave this at one. +SWEP.BulletForce = 10 -- The force a bullet has on a prop +SWEP.Silenceable = false -- If the model supports a silencer +SWEP.SilenceHolster = 0 -- The timing for silencer animation +SWEP.ZoomFOV = 65 -- Fov for when we're aiming +SWEP.CSSZoom = false -- This is for using Zoom Delays. Example the AUG zoom in CSS +SWEP.MPrecoil = 1 -- Changes the amount of view punch in multiplayer +SWEP.ReloadHolster = 1 -- How long should we wait before allowing think when reloading(Seconds or Gmodical Units. Idk) +SWEP.ReloadSound = false -- This has only been found to be used on HL2 weapons +SWEP.StockIronSightAnim = false -- This is used for multiplayer, check out the ak. Do we want to use the animation or the scripted animation? +SWEP.BoltAction = false +SWEP.ViewModelCSS = true -- Donot use this.. unless you understand what it does, look done in the code if you give a shet.. + +--FireModes +SWEP.FiringMode = false --Can we switch the firing modes? Auto, Semi, and Burst? +SWEP.Burstable = false --Can we burst with firing modes? +SWEP.BurstShots = 0 --How many rounds should we shoot on burst? If you use more than 5 you are retarded beyond hell. +SWEP.PistolBurstOnly = false --This might be confusing like the rest of my base. Only use this for pistols that only "burst" and "Semi" fire. + + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.025 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.015 -- Accuracy when we're standing still +SWEP.IronSightsCone = 0.006 -- Accuracy when we're aiming +SWEP.Delay = 0.08 -- Delay For Not Zoom +SWEP.Recoil = 1 -- Recoil For not Aimed +SWEP.RecoilZoom = 0.4 -- Recoil For Zoom + +----------------------------------------------------------- +----------------------------------------------------------- +function SWEP:Initialize() + + if ( SERVER ) then + self:SetNPCMinBurst( 30 ) + self:SetNPCMaxBurst( 30 ) + self:SetNPCFireRate( 0.01 ) + end + + self.Weapon:SetNetworkedBool( "Ironsights", false ) + self.Weapon:SetNetworkedBool("Burst",false) + self.Weapon:SetNetworkedBool("pap",false) + self.Weapon:SetNetworkedBool("HitRecoil", true) + self.Weapon:SetNetworkedBool("dt", false) + self.Weapon:SetNWBool("Reloading", false) + self.OGVMFLIP = self.ViewModelFlip + self.OGViewModelFOV = self.ViewModelFOV + self.oldVModel = self.ViewModel + self.VMLoc = self.IronSightsPos or Vector(0,0,0) + self.RecoilMax = 0.5 + self.RecoilReturn = 0.5 + self.IronAjust = 0 + self.IronAjustMin = 0 + + if (self.Owner:GetNWBool("HasDeadEye") == true) then + self:DeadEye() + end + if (self.Owner:GetNWBool("HasPap") == true) then + self:PackAPunch() + end + + self.Reloadaftershoot = 0 + self.nextreload = 0 + + self:SetNWFloat("SprayAdditive",0) + self:SetNWInt("LastClip",0) + self:SetNWInt("firemode", 1) + + self:SetHoldType(self.HoldType) +end +----------------------------------------------------------- +--Think +--------------------------------------------------------- + +function SWEP:Equip( NewOwner ) + self:SetHoldType(self.HoldType) +end + +function SWEP:Think() + + + + --When the convar says so, flip it. + + self:SpreadSystem() + --A Spread System that Changes the SPREAD + + self:DashingPos() + --Dont to be confused with doshing + + self:LuaAnimation() + --MoveModelWhenFiring + + end + +SWEP.SetNextFireMode = 0 +SWEP.Cycle = 0 + +local oldVMFOV = SWEP.ViewModelFOV + +SWEP.ViewModel2 = "models/weapons/v_rif_ak47.mdl" + +----------------------------------------------------------- +--VM FLIP +--------------------------------------------------------- + +function SWEP:LuaAnimation() + + if self.SetNextFireMode2 >= CurTime() then + if self.IronAjust == self.IronAjustMin then + self.IronAjust = self.IronAjust + self.RecoilReturn + end + end + if self.SetNextFireMode2 < CurTime() then + if self.IronAjust >= self.RecoilMax then + self.IronAjust = self.IronAjust - self.RecoilReturn + end + end + + local OriginalOrigin = self.IronSightsPos + self.VMLoc = OriginalOrigin - Vector(0 ,self.IronAjust,0) + +end + +----------------------------------------------------------- +--DashingPos +--------------------------------------------------------- +function SWEP:DashingPos() + + if (self.Owner:GetRunSpeed() < 150) then return end + + if self.Owner:KeyPressed(IN_USE) then return end + + if self.Owner:KeyDown(IN_SPEED) then + self.IronSightsPos = self.DashArmPos + self.IronSightsAng = self.DashArmAng + self.Weapon:SetNetworkedBool("Ironsights", true) + self.SwayScale = 1.0 + self.BobScale = 2.2 + elseif self.Owner:KeyReleased(IN_SPEED) then + self.Weapon:SetNextPrimaryFire( CurTime() + 0.3 ) + self.Weapon:SetNetworkedBool("Ironsights", false) + end + + if self.Owner:KeyDown(IN_SPEED) then return end + +end + +----------------------------------------------------------- +--SpreadSystem +--------------------------------------------------------- +function SWEP:SpreadSystem() + + + if (self.Weapon:GetNetworkedBool("DeadEye") == false) or (self.Weapon:GetNetworkedBool("DeadEye") == nil) then + + if self.Owner:OnGround() and (self.Owner:KeyDown(IN_FORWARD) or self.Owner:KeyDown(IN_BACK) or self.Owner:KeyDown(IN_MOVERIGHT) or self.Owner:KeyDown(IN_MOVELEFT)) then + if self.Owner:KeyDown(IN_DUCK) then + self.Primary.Cone = self.CrouchWalkCone + elseif self.Owner:KeyDown(IN_SPEED) then + self.Primary.Cone = self.AirCone + else + self.Primary.Cone = self.WalkCone + end + elseif self.Owner:OnGround() and self.Owner:KeyDown(IN_DUCK) then + self.Primary.Cone = self.CrouchCone + elseif not self.Owner:OnGround() then + self.Primary.Cone = self.AirCone + else + self.Primary.Cone = self.StandCone + end + + if self.Weapon:GetNetworkedBool( "Ironsights") and self.Owner:OnGround() then + self.Primary.Cone = self.IronSightsCone + end + else + self.Primary.Cone = 0.003 + end + + + if self.Owner:KeyPressed(IN_ATTACK) then + self:SetNWInt("LastClip", self.Weapon:Clip1()) + end + if self.Owner:KeyReleased(IN_ATTACK) then + self:SetNWFloat("SprayAdditive", 0) + end + + if self.Owner:KeyPressed(IN_SPEED) then + self.Owner:SetFOV(0, 0.15) + end + + if (game.SinglePlayer() ) then + self:SetNWInt("sprecoil", 1.8) + self:SetNWInt("mprecoil", 1) + else + self:SetNWInt("MPrecoil", 10) + self:SetNWInt("sprecoil", 5) + end +end +----------------------------------------------------------- +--Deploy +--------------------------------------------------------- +function SWEP:Deploy() + + self.Weapon:SetNWBool("Reloading", false) + + if self.Weapon:GetNetworkedBool("Silenced") == true then + self.Weapon:SendWeaponAnim( ACT_VM_DRAW_SILENCED ); + else + self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) + end + --Which draw should we use? The bool knows all. + + self:SetWeaponHoldType( self.HoldType ) + --Restores the Weapon hold type + + self.Reloadaftershoot = CurTime() + 1 + --Can't shoot while deploying + + self:SetIronsights(false) + --Set the ironsight mode to false + + self.Weapon:SetNextPrimaryFire(CurTime() + 1) + --Set the next primary fire to 1 second after deploying + + self.Primary.Delay = self.Delay + --Set Delay back to normal + + self.Primary.Recoil = self.Recoil + --Set Recoil to normal + + if self.PistolBurstOnly then + self.Cycle = 2 + end + + if timer.Exists("ReloadTimer") then + timer.Destroy("ReloadTimer") + end + --Destroy the faggot timer on deploy if its running. + + self:SetNWInt("skipthink", false) + + return true +end + +SWEP.DoubleTapped = false +--------------------------------------------------------- +--Perk: DoubleTap +--------------------------------------------------------- +function SWEP:DoubleTap() + + if (self.Weapon:GetNetworkedBool("dt", false)) then + if (self.Delay >= 0.06 and self.Delay <= 0.09) then + self.Delay = 0.06 + end + if (self.Delay >= 0.09 and self.Delay <= 0.13) then + self.Delay = 0.06 + end + if (self.Delay > 0.13 and self.Delay <= 0.2) then + self.Delay = self.Delay - 0.024 + end + if (self.Delay > 0.2) then + self.Delay = self.Delay - 0.03 + end + self.Primary.Delay = self.Delay + self.Weapon:SetNetworkedBool("dt", true) + self.DoubleTapped = true; + end +end + +function SWEP:GetDoubleTap() + local dt = self.DoubleTapped + return dt +end + +SWEP.PackPunched = false +---------------------------------------------------------- +--Perk: Packed a Punch +--------------------------------------------------------- +function SWEP:PackAPunch() + + if (self.PackPunched == false) then + self.PackPunched = true; + self.Weapon:SetNetworkedBool("pap", true) + self.Primary.ClipSize = self.Primary.ClipSize + math.ceil(self.Primary.ClipSize * 0.333333) + self:TakePrimaryAmmo( 1 ) + time.Simple(0.05, function() + self:Reload(); + end) + if (self.BoltAction) then + self.Delay = self.Delay * 0.5 + self.Primary.Delay = self.Delay + end + end +end + +function SWEP:GetPackAPunch() + local dt = self.PackPunched + return dt +end + +SWEP.DeadEyed = false +SWEP.DeadEyeMul = 1 +----------------------------------------------------------- +--Perk: DeadEye +--------------------------------------------------------- +function SWEP:DeadEye() + + if (self.DeadEyed == false) then + self.DeadEyed = true; + self.Weapon:SetNetworkedBool("DeadEye", true) + self.DeadEyeMul = 0.5 + end +end + +function SWEP:GetDeadEye() + local dt = self.DeadEyed + return dt +end + +SWEP.MuleKicked = false +----------------------------------------------------------- +--Perk: DeadEye +--------------------------------------------------------- +function SWEP:MuleKick() + + if (self.MuleKicked == false) then + self.MuleKicked = true; + self.Recoil = self.Recoil * 0.5 + end +end + +function SWEP:GetMuleKick() + local dt = self.MuleKicked + return dt +end + + +----------------------------------------------------------- +--Reload +--------------------------------------------------------- +function SWEP:Reload() + + if self.Owner:KeyDown(IN_ATTACK) then return end + + if( self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0 || self.Weapon:Clip1() >= self.Primary.ClipSize) then return end + --Why go through the function is dis nigga got no reserve, aswell a full clip? + + + if ( self.Reloadaftershoot > CurTime() ) then return end + --If you're firing, you can't reload + + if self.Weapon:GetNetworkedBool("Silenced") == true then + self.Weapon:DefaultReload( ACT_VM_RELOAD_SILENCED ); + else + self.Weapon:DefaultReload(ACT_VM_RELOAD) + end + + self:SetIronsights( false ) + self.Weapon:SetNetworkedBool("Ironsights", false) + --Set the ironsight to false + + self.Owner:SetFOV( 0, 0.15 ) + --Set the Fov back to normal if zoomed + + self:SetWeaponHoldType( self.HoldType ) + --Make sure that holdtypes dont get mixed and masshshed and stuff + + if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0 then + + self.MouseSensitivity = 1 + --Set MouseSens Back to one + + self.Primary.Delay = self.Delay + --Set Delay back to normal + + self.Primary.Recoil = self.Recoil + --Set Recoil to normal + + if not CLIENT then + self.Owner:DrawViewModel(true) + end + + if (self.ReloadSound) then + self.Weapon:EmitSound(self.Primary.Reload) + end + end +end + +SWEP.SetNextFireMode2 = CurTime() + +----------------------------------------------------------- +-- PrimaryAttack +--------------------------------------------------------- +function SWEP:PrimaryAttack() + + if self.SetNextFireMode > CurTime() then return end + + + if(!self.Owner:IsNPC()) then + if self.Owner:KeyDown(IN_SPEED) and (self.Owner:GetRunSpeed() > 149) then return end + end + --Skip firing when sprinting and dashing is allowed + + self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) + + if (self.Weapon:GetNetworkedBool("DeadEye") == false) or (self.Weapon:GetNetworkedBool("DeadEye") == nil) then + if ( self.Weapon:Clip1() < self:GetNWInt("LastClip") - 4) and (self:GetNWFloat("SprayAdditive") != 15) then + self:SetNWFloat("SprayAdditive",self:GetNWFloat("SprayAdditive") + 0.5 ) + end + end + + self.SetNextFireMode2 = CurTime() + (self.Primary.Delay * 0.5) + + if ( !self:CanPrimaryAttack() ) then return end + + + local Hacking = false + + if GetConVar("cl_ptp_damage_disable") == nil then + Hacking = false + else + Hacking = GetConVar("cl_ptp_damage_disable"):GetBool() + end + + local dmgMul = 1 + + if Hacking then + dmgMul = 0.001 + else + dmgMul = 1 + end + + + if self.Weapon:GetNetworkedBool("Silenced") == true and self.Weapon:GetNetworkedBool("pap") == false then + self.Weapon:EmitSound( self.SilencedSound ) + self:CSShootBullet( self.Primary.Damage * 0.8 * dmgMul, self.Recoil * 0.75, self.Primary.NumShots, self.Primary.Cone, self.MuzzleEffect ) + end + if self.Weapon:GetNetworkedBool("pap") == true then + if self.Weapon:GetNetworkedBool("Silenced") == true then + self.Weapon:EmitSound( self.SilencedSound ) + else + self.Weapon:EmitSound( self.Primary.Sound ) + end + self.Weapon:EmitSound( self.PackAPunchSound ) + self:CSShootBullet( self.Primary.Damage * 2 * dmgMul, self.Recoil * 0.4, self.Primary.NumShots, self.Primary.Cone, "lee_muzzle_rifle_pap" ) + end + if ((self.Weapon:GetNetworkedBool("pap") == false) and (self.Weapon:GetNetworkedBool("Silenced") == false)) then + self.Weapon:EmitSound( self.Primary.Sound ) + self:CSShootBullet( self.Primary.Damage * dmgMul , self.Recoil , self.Primary.NumShots, self.Primary.Cone, self.MuzzleEffect ) + end + --If Swep Data is Silenced Play Silenced else Unsilenced + + self:TakePrimaryAmmo( self.TakeAmmoOnShot ) + --Remove X bullet from our clip + + if self.Weapon:GetNetworkedBool("Burst", true) then + self.BurstTimer = CurTime() + self.SetNextPrimaryFire = CurTime() + 0.5 + self.BurstCounter = self.BurstShots - 1 + end + + if ( self.Owner:IsNPC() ) then return end + + -- Punch the player's view + self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.2) * 0.5, math.Rand(-0.1,0.1) * 0.5, 0 ) ) + + -- In singleplayer this function doesn't get called on the client, so we use a networked float + -- to send the last shoot time. In multiplayer this is predicted clientside so we don't need to + -- send the float. + if ( (game.SinglePlayer() && SERVER) || CLIENT ) then + self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() ) + end + +end +----------------------------------------------------------- + -- Name: SWEP:CSShootBullet( ) +--------------------------------------------------------- +function SWEP:CSShootBullet( dmg, recoil, numbul, cone, flash ) + + numbul = numbul or 1 + cone = cone or 0.01 + + local ang = self.Owner:GetAimVector() + ang = Vector(ang.x, ang.y, ang.z + (math.abs(self:GetNWFloat("SprayAdditive"))* .001 * 5)) + + + local bullet = {} + bullet.Num = numbul + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = ang -- Dir of bullet + bullet.Spread = Vector( cone, cone, 0 ) -- Aim Cone + bullet.Tracer = self.TracerShot -- Show a tracer on every x bullets + bullet.Force = self.BulletForce/25 -- Amount of force to give to phys objects + bullet.Damage = dmg + + if (!Hacking) then + self.Owner:FireBullets( bullet ) --Sorry asshole + end + + self.Owner:MuzzleFlash() -- Crappy muzzle light + self.Owner:SetAnimation( PLAYER_ATTACK1 ) --3rd Person Animation + + + if ((self.Weapon:GetNetworkedBool("Ironsights") == true) && (self.StockIronSightAnim == true)) then + if self.Weapon:GetNetworkedBool("Silenced") == false then + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + else + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) + end + end + if (self.Weapon:GetNetworkedBool("Ironsights") == false)then + if self.Weapon:GetNetworkedBool("Silenced") == false then + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + else + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) + end + end + if ((self.Weapon:GetNetworkedBool("Ironsights") == true) && (self.StockIronSightAnim == false)) then + end + + if ((self.Weapon:GetNetworkedBool("Ironsights") == true) && (self.StockIronSightAnim == false) && (game.SinglePlayer()) ) then + if self.Weapon:GetNetworkedBool("Silenced") == false then + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + else + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) + end + end + + if (self.Primary.Ammo == "pistol" and self.Weapon:GetNetworkedBool("pap") == true) then + if (SERVER) then + local eyetrace = self.Owner:GetEyeTrace(); + local explo = ents.Create( "env_explosion" ) + explo:SetPos( eyetrace.HitPos ) + explo:SetOwner( self.Owner ) + explo:SetKeyValue( "iMagnitude", "15" ) + explo:SetKeyValue( "iRadiusOverride", 250 ) + explo:Spawn() + explo:Activate() + explo:Fire( "Explode", "", 0 ) + end + end + + + local fx = EffectData() + fx:SetEntity(self.Weapon) + fx:SetOrigin(self.Owner:GetShootPos()) + fx:SetNormal(self.Owner:GetAimVector()) + fx:SetAttachment(self.MuzzleAttachment) + + util.Effect(flash,fx) + + + -- CUSTOM RECOIL ! + if(!self.Owner:IsNPC()) then + if ( (game.SinglePlayer() && SERVER) || ( !game.SinglePlayer() && CLIENT && IsFirstTimePredicted() ) ) then + + local eyeang = self.Owner:EyeAngles() + eyeang.pitch = eyeang.pitch - ((recoil/4) * self.DeadEyeMul) --Dont mess with this. + self.Owner:SetEyeAngles( eyeang ) + + end + end +end + +----------------------------------------------------------- +-- 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 ) + + draw.SimpleText( self.IconLetter, "TextSelectIcons", x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER ) + + -- try to fool them into thinking they're playing a Tony Hawks game + draw.SimpleText( self.IconLetter, "TextSelectIcons", x + wide/2 + math.Rand(-4, 4), y + tall*0.2+ math.Rand(-14, 14), Color( 255, 210, 0, math.Rand(10, 120) ), TEXT_ALIGN_CENTER ) + draw.SimpleText( self.IconLetter, "TextSelectIcons", x + wide/2 + math.Rand(-4, 4), y + tall*0.2+ math.Rand(-9, 9), Color( 255, 210, 0, math.Rand(10, 120) ), TEXT_ALIGN_CENTER ) + + draw.SimpleText( self.IconLetterCSS, "CSSelectIcons", x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER ) + + -- try to fool them into thinking they're playing a Tony Hawks game + draw.SimpleText( self.IconLetterCSS, "CSSelectIcons", x + wide/2 + math.Rand(-4, 4), y + tall*0.2+ math.Rand(-14, 14), Color( 255, 210, 0, math.Rand(10, 120) ), TEXT_ALIGN_CENTER ) + draw.SimpleText( self.IconLetterCSS, "CSSelectIcons", x + wide/2 + math.Rand(-4, 4), y + tall*0.2+ math.Rand(-9, 9), Color( 255, 210, 0, math.Rand(10, 120) ), TEXT_ALIGN_CENTER ) + +end + + +ptp_viewmodel_bob = 1 +ptp_viewmodel_sway = 1.5 + +local IRONSIGHT_TIME = 0.15 +----------------------------------------------------------- +-- Name: GetViewModelPosition + -- Desc: Allows you to re-position the view model +--------------------------------------------------------- +function SWEP:GetViewModelPosition( pos, ang ) + + if ( !self.IronSightsPos ) then return pos, ang end + + local bIron = self.Weapon:GetNetworkedBool( "Ironsights" ) + + if (bIron != self.bLastIron) then + self.bLastIron = bIron + self.fIronTime = CurTime() + + if (bIron) then + self.SwayScale = 0.3 + self.BobScale = 0.01 + else + self.SwayScale = ptp_viewmodel_bob + self.BobScale = ptp_viewmodel_sway + end + + end + + local fIronTime = self.fIronTime or 0 + + if (!bIron && fIronTime < CurTime() - IRONSIGHT_TIME) then + return pos, ang + end + + local Mul = 1.0 + + if (fIronTime > CurTime() - IRONSIGHT_TIME) then + Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1) + + if (!bIron) then Mul = 1 - Mul end + end + + + if (self.IronSightsAng) then + ang = ang * 1 + ang:RotateAroundAxis(ang:Right(), self.IronSightsAng.x * Mul) + ang:RotateAroundAxis(ang:Up(), self.IronSightsAng.y * Mul) + ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul) + end + + local Right = ang:Right() + local Up = ang:Up() + local Forward = ang:Forward() + + pos = pos + self.VMLoc.x * Right * Mul + pos = pos + self.VMLoc.y * Forward * Mul + pos = pos + self.VMLoc.z * Up * Mul + + return pos, ang +end + +SWEP.NextSecondaryAttack = 0 + +----------------------------------------------------------- +-- Silence Timings and Stuff +--------------------------------------------------------- +function SWEP:Silence() + + if self.Weapon:GetNetworkedBool("Silenced") == false then + self:SetIronsights( false ) + self.Weapon:SetNetworkedBool("Silenced", true) + self.Weapon:SendWeaponAnim( ACT_VM_ATTACH_SILENCER ) + self.CSMuzzleFlashes = true + + else + self.Weapon:SetNetworkedBool("Silenced", false) + self:SetIronsights( false ) + self.Weapon:SendWeaponAnim( ACT_VM_DETACH_SILENCER ) + self.CSMuzzleFlashes = true + end + + self:SetIronsights( false ) + self.Weapon:SetNextPrimaryFire( CurTime() + self.SilenceHolster + .1) + self.Weapon:SetNextSecondaryFire( CurTime() + self.SilenceHolster + .5) + self.Reloadaftershoot = CurTime() + 3 + self.Weapon:SetNetworkedInt("deploydelay", CurTime() + 3); +end + + +----------------------------------------------------------- +-- SecondaryAttack +--------------------------------------------------------- + +function SWEP:SecondaryAttack() +end + +function SWEP:SetIronsights(b) + + + if self.Owner:KeyDown(IN_USE) then return end + + if self.Owner:KeyDown(IN_SPEED) then return end + + self.Weapon:SetNetworkedBool("Ironsights", b) + + if self.Weapon:GetNetworkedBool( "Ironsights", true) then + self.Primary.Recoil = self.RecoilZoom + self.IronSightsPos = self.AimSightsPos + self.IronSightsAng = self.AimSightsAng + self.Weapon:EmitSound("weapons/universal/iron_in.wav") + self.Owner:SetFOV(self.ZoomFOV, 0.15) + if self.CSSZoom then + self.Primary.Recoil = self.RecoilZoom + self.Primary.Delay = self.DelayZoom + end + else + self.Primary.Recoil = self.Recoil + self.Owner:SetFOV(0, 0.15) + if self.CSSZoom then + self.Primary.Recoil = self.Recoil + self.Primary.Delay = self.Delay + end + self.Weapon:EmitSound("weapons/universal/iron_out.wav") + end + +end \ No newline at end of file diff --git a/entities/weapons/coop_zoom_base/shared.lua b/entities/weapons/coop_zoom_base/shared.lua new file mode 100644 index 0000000..9683ee1 --- /dev/null +++ b/entities/weapons/coop_zoom_base/shared.lua @@ -0,0 +1,96 @@ +if ( SERVER ) then + + AddCSLuaFile( "shared.lua" ) + +end +/////////////////////////////////////////////////////////// +/// /// +/// Project Start: 11/11/13 /// +/// /// +/////////////////////////////////////////////////////////// +/*--------------------------------------------------------- + Client Variables +---------------------------------------------------------*/ +if ( CLIENT ) then + + SWEP.PrintName = "SWEPNAME" + SWEP.Author = "Fonix" + SWEP.Slot = 2 + SWEP.SlotPos = 1 + SWEP.IconLetter = "" --Text Font + SWEP.IconLetterCSS = "" --For Css Font + SWEP.DrawCrosshair = true + SWEP.DrawAmmo = true + SWEP.CSMuzzleFlashes = true + + killicon.AddFont( "weapon_cs_ak47_gb", "TextKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) ) + surface.CreateFont("TextKillIcons", { font="Roboto-Medium", weight="500", size=ScreenScale(13),antialiasing=true,additive=true }) + surface.CreateFont("TextSelectIcons", { font="Roboto-Medium", weight="500", size=ScreenScale(20),antialiasing=true,additive=true }) + surface.CreateFont("CSKillIcons", { font="csd", weight="500", size=ScreenScale(30),antialiasing=true,additive=true }) + surface.CreateFont("CSSelectIcons", { font="csd", weight="500", size=ScreenScale(60),antialiasing=true,additive=true }) + +end +/*--------------------------------------------------------- + The Layout... +---------------------------------------------------------*/ +SWEP.Category = "Hello" +SWEP.ViewModelFlip = true + +SWEP.Spawnable = false -- Delete this comment and change these to true +SWEP.AdminSpawnable = false -- If you don't you can't spawn the swep :( + +SWEP.Base = "coop_weapon_base" +SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl" +SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl" +SWEP.ViewModelFOV = 65 + +SWEP.Weight = 5 +SWEP.AutoSwitchTo = true +SWEP.AutoSwitchFrom = true +SWEP.BounceWeaponIcon = false + +SWEP.Primary.Sound = Sound( "" ) +SWEP.SilencedSound = Sound( "" ) --This is for silencers. Dont bite me, I know its really called a suppressor. +SWEP.Primary.Recoil = 1 +SWEP.Primary.Damage = 34 +SWEP.Primary.NumShots = 0 +SWEP.Primary.Cone = 0.02 +SWEP.Primary.ClipSize = 30 +SWEP.Primary.Delay = 0.08 +SWEP.Primary.DefaultClip = 300 +SWEP.Primary.Automatic = true +SWEP.Primary.Ammo = "smg1" + +SWEP.Secondary.ClipSize = -1 +SWEP.Secondary.DefaultClip = -1 +SWEP.Secondary.Automatic = false +SWEP.Secondary.Ammo = "none" + +SWEP.IronSightsPos = Vector( 3.4, -3, 1.2 ) +SWEP.IronSightsAng = Vector( 0.5, 0.0, 0 ) + +--Extras +SWEP.MuzzleEffect = "lee_muzzle_rifle" -- Muzzle attachments should not be messed with +SWEP.MuzzleAttachment = "1" -- There's only one anyways +SWEP.MuzzleAttachmentTrue = true -- Keep it true +SWEP.TracerShot = 3 -- On what shot should there be a tracer? +SWEP.TakeAmmoOnShot = 1 -- How many rounds should we take per shot? Typically leave this at one. +SWEP.BulletForce = 10 -- The force a bullet has on a prop +SWEP.Silenceable = false -- If the model supports a silencer +SWEP.SilenceHolster = 0 -- The timing for silencer animation +SWEP.ZoomFOV = 65 -- Fov for when we're aiming +SWEP.CSSZoom = false -- This is for using Zoom Delays. Example the AUG zoom in CSS +SWEP.MPrecoil = 1 -- Changes the amount of view punch in multiplayer +SWEP.ReloadHolster = 1 -- How long should we wait before allowing think when reloading +SWEP.ReloadSound = false -- This has only been found to be used on HL2 weapons + +-- Accuracy +SWEP.CrouchCone = 0.01 -- Accuracy when we're crouching +SWEP.CrouchWalkCone = 0.02 -- Accuracy when we're crouching and walking +SWEP.WalkCone = 0.025 -- Accuracy when we're walking +SWEP.AirCone = 0.1 -- Accuracy when we're in air +SWEP.StandCone = 0.015 -- Accuracy when we're standing still +SWEP.IronSightsCone = 0.006 -- Accuracy when we're aiming +SWEP.Delay = 0.08 -- Delay For Not Zoom +SWEP.Recoil = 1 -- Recoil For not Aimed +SWEP.RecoilZoom = 0.3 -- Recoil For Zoom \ No newline at end of file diff --git a/entities/weapons/npc_knife/ai_translations.lua b/entities/weapons/npc_knife/ai_translations.lua new file mode 100644 index 0000000..d4e026f --- /dev/null +++ b/entities/weapons/npc_knife/ai_translations.lua @@ -0,0 +1,205 @@ + +/*--------------------------------------------------------- + Name: SetupWeaponHoldTypeForAI + Desc: Mainly a Todo.. In a seperate file to clean up the init.lua +---------------------------------------------------------*/ +function SWEP:SetupWeaponHoldTypeForAI( t ) + + self.ActivityTranslateAI = {} + if ( t == "melee" ) then + self.ActivityTranslateAI [ ACT_IDLE ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_ANGRY ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_RELAXED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_STIMULATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AGITATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_RELAXED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_STIMULATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_AGITATED ] = ACT_HL2MP_IDLE_KNIFE + + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1_LOW ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_MELEE_ATTACK1 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_MELEE_ATTACK2 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_SPECIAL_ATTACK1 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + + + self.ActivityTranslateAI [ ACT_RANGE_AIM_LOW ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_COVER_LOW ] = ACT_HL2MP_IDLE_KNIFE + + self.ActivityTranslateAI [ ACT_WALK ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_RELAXED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_STIMULATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_AGITATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_RELAXED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_STIMULATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_AGITATED ] = ACT_HL2MP_WALK_KNIFE + + + self.ActivityTranslateAI[ ACT_RUN_RELAXED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI[ ACT_RUN_STIMULATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI[ ACT_RUN_AGITATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_CROUCH ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_CROUCH_AIM ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_RELAXED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_STIMULATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_AGITATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_MP_RUN ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_SMALL_FLINCH ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_BIG_FLINCH ] = ACT_HL2MP_RUN_KNIFE + + return end + + if ( t == "melee2" ) then + self.ActivityTranslateAI [ ACT_IDLE ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_ANGRY ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_RELAXED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_STIMULATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AGITATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_RELAXED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_STIMULATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_AGITATED ] = ACT_HL2MP_IDLE_KNIFE + + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1_LOW ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_MELEE_ATTACK1 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_MELEE_ATTACK2 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + self.ActivityTranslateAI [ ACT_SPECIAL_ATTACK1 ] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE + + + self.ActivityTranslateAI [ ACT_RANGE_AIM_LOW ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_COVER_LOW ] = ACT_HL2MP_IDLE_KNIFE + + self.ActivityTranslateAI [ ACT_WALK ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_RELAXED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_STIMULATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_AGITATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_RELAXED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_STIMULATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_AGITATED ] = ACT_HL2MP_WALK_KNIFE + + self.ActivityTranslateAI[ ACT_RUN_RELAXED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI[ ACT_RUN_STIMULATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI[ ACT_RUN_AGITATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_CROUCH ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_CROUCH_AIM ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_RELAXED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_STIMULATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_AGITATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_MP_RUN ] = ACT_HL2MP_RUN_KNIFE + + return end + + + if ( t == "smg" ) then + + self.ActivityTranslateAI [ ACT_IDLE ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_RELAXED ] = ACT_IDLE + self.ActivityTranslateAI [ ACT_IDLE_STIMULATED ] = ACT_IDLE + self.ActivityTranslateAI [ ACT_IDLE_AGITATED ] = ACT_IDLE_ANGRY_MELEE + + self.ActivityTranslateAI[ ACT_RUN_RELAXED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI[ ACT_RUN_STIMULATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI[ ACT_RUN_AGITATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_CROUCH ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_CROUCH_AIM ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_RELAXED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_STIMULATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM_AGITATED ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_RUN_AIM ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_MP_RUN ] = ACT_HL2MP_RUN_KNIFE + self.ActivityTranslateAI [ ACT_WALK ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_RELAXED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_STIMULATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI[ ACT_WALK_AIM_AGITATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_RELAXED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_STIMULATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_WALK_AGITATED ] = ACT_HL2MP_WALK_KNIFE + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1 ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1_LOW ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_MELEE_ATTACK1 ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_MELEE_ATTACK2 ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_SPECIAL_ATTACK1 ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_SMALL_FLINCH ] = ACT_RANGE_ATTACK_PISTOL + self.ActivityTranslateAI [ ACT_BIG_FLINCH ] = ACT_RANGE_ATTACK_PISTOL + + return end + + if ( t == "shotgun" ) then + + self.ActivityTranslateAI [ ACT_IDLE ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_RELAXED ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_STIMULATED ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_AGITATED ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_AIM_RELAXED ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_AIM_STIMULATED ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_IDLE_AIM_AGITATED ] = ACT_IDLE_ANGRY_MELEE + + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1 ] = ACT_RANGE_ATTACK_THROW + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1_LOW ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_MELEE_ATTACK1 ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_MELEE_ATTACK2 ] = ACT_MELEE_ATTACK_SWING + self.ActivityTranslateAI [ ACT_SPECIAL_ATTACK1 ] = ACT_RANGE_ATTACK_THROW + + + self.ActivityTranslateAI [ ACT_RANGE_AIM_LOW ] = ACT_IDLE_ANGRY_MELEE + self.ActivityTranslateAI [ ACT_COVER_LOW ] = ACT_IDLE_ANGRY_MELEE + + self.ActivityTranslateAI [ ACT_WALK ] = ACT_WALK_SUITCASE + self.ActivityTranslateAI [ ACT_WALK_RELAXED ] = ACT_WALK_SUITCASE + self.ActivityTranslateAI [ ACT_WALK_STIMULATED ] = ACT_WALK_SUITCASE + self.ActivityTranslateAI [ ACT_WALK_AGITATED ] = ACT_WALK_SUITCASE + + self.ActivityTranslateAI [ ACT_RUN ] = ACT_RUN_CROUCH + self.ActivityTranslateAI [ ACT_RUN_AIM_RELAXED ] = ACT_RUN_CROUCH + self.ActivityTranslateAI [ ACT_RUN_AIM_STIMULATED ] = ACT_RUN_CROUCH + self.ActivityTranslateAI [ ACT_RUN_AIM_AGITATED ] = ACT_RUN_CROUCH + self.ActivityTranslateAI [ ACT_RUN_AIM ] = ACT_RUN_CROUCH + self.ActivityTranslateAI [ ACT_SMALL_FLINCH ] = ACT_RANGE_ATTACK_PISTOL + self.ActivityTranslateAI [ ACT_BIG_FLINCH ] = ACT_RANGE_ATTACK_PISTOL + + return end + + if ( t == "pistol") then + + self.ActivityTranslateAI [ ACT_IDLE ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_ANGRY ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_RELAXED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_STIMULATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AGITATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_RELAXED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_STIMULATED ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_IDLE_AIM_AGITATED ] = ACT_HL2MP_IDLE_KNIFE + + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1 ] = ACT_MELEE_ATTACK1 + self.ActivityTranslateAI [ ACT_RANGE_ATTACK1_LOW ] = ACT_MELEE_ATTACK1 + self.ActivityTranslateAI [ ACT_MELEE_ATTACK1 ] = ACT_MELEE_ATTACK1 + self.ActivityTranslateAI [ ACT_MELEE_ATTACK2 ] = ACT_MELEE_ATTACK1 + self.ActivityTranslateAI [ ACT_SPECIAL_ATTACK1 ] = ACT_MELEE_ATTACK1 + + + self.ActivityTranslateAI [ ACT_RANGE_AIM_LOW ] = ACT_HL2MP_IDLE_KNIFE + self.ActivityTranslateAI [ ACT_COVER_LOW ] = ACT_HL2MP_IDLE_KNIFE + + self.ActivityTranslateAI [ ACT_WALK ] = ACT_WALK_UNARMED + self.ActivityTranslateAI [ ACT_WALK_RELAXED ] = ACT_WALK_UNARMED + self.ActivityTranslateAI [ ACT_WALK_STIMULATED ] = ACT_WALK_UNARMED + self.ActivityTranslateAI [ ACT_WALK_AGITATED ] = ACT_WALK_UNARMED + + self.ActivityTranslateAI [ ACT_RUN ] = ACT_RUN_AIM_SHOTGUN + self.ActivityTranslateAI [ ACT_RUN_AIM_RELAXED ] = ACT_RUN_AIM_SHOTGUN + self.ActivityTranslateAI [ ACT_RUN_AIM_STIMULATED ] = ACT_RUN_AIM_SHOTGUN + self.ActivityTranslateAI [ ACT_RUN_AIM_AGITATED ] = ACT_RUN_AIM_SHOTGUN + self.ActivityTranslateAI [ ACT_RUN_AIM ] = ACT_RUN_AIM_SHOTGUN + + return end +end diff --git a/entities/weapons/npc_knife/cl_init.lua b/entities/weapons/npc_knife/cl_init.lua new file mode 100644 index 0000000..72eace7 --- /dev/null +++ b/entities/weapons/npc_knife/cl_init.lua @@ -0,0 +1,9 @@ +include('shared.lua') + +SWEP.PrintName = "" // 'Nice' Weapon name (Shown on HUD) +SWEP.Slot = 2 // Slot in the weapon selection menu +SWEP.SlotPos = 2 // Position in the slot +SWEP.DrawAmmo = true // Should draw the default HL2 ammo counter // Should draw the default crosshair +SWEP.DrawWeaponInfoBox = true // Should draw the weapon info box +SWEP.BounceWeaponIcon = true // Should the weapon icon bounce? +SWEP.CSMuzzleFlashes = true \ No newline at end of file diff --git a/entities/weapons/npc_knife/init.lua b/entities/weapons/npc_knife/init.lua new file mode 100644 index 0000000..838e224 --- /dev/null +++ b/entities/weapons/npc_knife/init.lua @@ -0,0 +1,137 @@ +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) +include( "ai_translations.lua" ) +SWEP.testtimer = false +include('shared.lua') +SWEP.IsCloaked = false +SWEP.Weight = 30 // Decides whether we should switch from/to this +SWEP.AutoSwitchTo = true // Auto switch to we pick it up +SWEP.AutoSwitchFrom = true // Auto switch from you pick up a better weapon +SWEP.timer = false +SWEP.NextFireTimer = false +SWEP.FailedBlinkTimer = false +function SWEP:Initialize() + //util.PrecacheSound("weapons/knife/knife_slash1.wav") + //util.PrecacheSound("weapons/knife/knife_hit"..math.random(1,4)..".wav") + self:SetWeaponHoldType("melee") + + if self.Owner:GetClass() == "npc_metropolice" then + self:SetWeaponHoldType("smg") + end + + self.Owner:Fire( "GagEnable" ) + + if self.Owner:GetClass() == "npc_citizen" then + self.Weapon.Owner:Fire( "DisableWeaponPickup" ) + end + + self:Proficiency() + self.Weapon.Owner:SetKeyValue( "spawnflags", "256" ) + if self.Owner:GetClass() == "npc_combine_s" then + + self:SetWeaponHoldType("melee2") + + end + hook.Add( "Think", self, self.onThink ) +end + +function SWEP:onThink() +if !IsValid(self) or !IsValid(self.Owner) then return; end +self.Owner:RemoveAllDecals() +self.Owner:ClearCondition(13) +self.Owner:ClearCondition(17) +self.Owner:ClearCondition(18) +self.Owner:ClearCondition(20) +if self.NextFireTimer == false and self.Owner:GetEnemy() then +self:NextFire() +end + end + +function SWEP:NextFire() + if !self:IsValid() or !self.Owner:IsValid() then return; end + if self.Owner:IsCurrentSchedule(SCHED_CHASE_ENEMY) then return end + self.NextFireTimer = true + self:Chase_Enemy() + local randomtimer = math.Rand(0.4, 0.7) + timer.Simple(randomtimer, function() + self.NextFireTimer = false + end) + end + +function SWEP:Proficiency() +timer.Simple(0.5, function() +if !self:IsValid() or !self.Owner:IsValid() then return; end + self.Owner:SetCurrentWeaponProficiency(4) + self.Owner:CapabilitiesAdd( CAP_FRIENDLY_DMG_IMMUNE ) + self.Owner:CapabilitiesRemove( CAP_WEAPON_MELEE_ATTACK1 ) + self.Owner:CapabilitiesRemove( CAP_INNATE_MELEE_ATTACK1 ) + + + + end) +end + +function SWEP:GetCapabilities() + return bit.bor( CAP_WEAPON_MELEE_ATTACK1 ) +end + +function SWEP:NPCShoot_Primary( ShootPos, ShootDir ) +if !self:IsValid() or !self.Owner:IsValid() then return;end +if !self.Owner:GetEnemy() then return end +self.CooldownTimer = true +local seqtimer = 0.4 +if self.Owner:GetClass() == "npc_alyx" then +seqtimer = 0.8 +end + +timer.Simple(seqtimer, function() +if !self:IsValid() or !self.Owner:IsValid() then return;end +if self.Owner:IsCurrentSchedule( SCHED_MELEE_ATTACK2 ) then + self:PrimaryAttack() + end +self.CooldownTimer = false + end) +end + +function SWEP:Chase_Enemy() +if !self:IsValid() or !self.Owner:IsValid() then return;end +if self.Owner:GetEnemy():GetPos():Distance(self:GetPos()) > 100 then +self.Owner:SetSchedule( SCHED_CHASE_ENEMY ) +end + if self.CooldownTimer == false and self.Owner:GetEnemy():GetPos():Distance(self:GetPos()) <= 100 then + + self.Owner:SetSchedule( SCHED_MELEE_ATTACK2 ) + self:NPCShoot_Primary( ShootPos, ShootDir ) + + end +end + +AccessorFunc( SWEP, "fNPCMinBurst", "NPCMinBurst" ) +AccessorFunc( SWEP, "fNPCMaxBurst", "NPCMaxBurst" ) +AccessorFunc( SWEP, "fNPCFireRate", "NPCFireRate" ) +AccessorFunc( SWEP, "fNPCMinRestTime", "NPCMinRest" ) +AccessorFunc( SWEP, "fNPCMaxRestTime", "NPCMaxRest" ) + +function SWEP:OnDrop() + if GetConVar("Melee_drop"):GetInt() == 1 then + local droppedprop = ents.Create( "prop_physics_override" ) + droppedprop:SetModel( "models/weapons/w_knife_t.mdl" ) + droppedprop:SetPos( self:GetPos() ) + droppedprop:SetAngles( self:GetAngles() ) + droppedprop:SetKeyValue( "spawnflags", 4 + 512 ) + droppedprop:Fire("DisablePhyscannonPickup") + + self:Remove() + droppedprop:Spawn() + else + self:Remove() + end +end + +function SWEP:CloakCheck() +self.IsCloaked = true +end + +function SWEP:NotCloaked() +self.IsCloaked = false +end \ No newline at end of file diff --git a/entities/weapons/npc_knife/shared.lua b/entities/weapons/npc_knife/shared.lua new file mode 100644 index 0000000..522131d --- /dev/null +++ b/entities/weapons/npc_knife/shared.lua @@ -0,0 +1,126 @@ +if( SERVER ) then + AddCSLuaFile( "shared.lua" ) +end + +SWEP.Category = "NPC_WEAPONS" +SWEP.Author = "" + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false +SWEP.GrenadeTimer = false +SWEP.ViewModel = "" +SWEP.WorldModel = "models/weapons/w_knife_t.mdl" +SWEP.RunAwayTimer = false +SWEP.Primary.Damage = 40 +SWEP.StealthTimer = false +SWEP.Primary.ClipSize = -1 -- Size of a clip +SWEP.Primary.DefaultClip = -1 -- Default number of bullets in a clip +SWEP.Primary.Automatic = true -- Automatic/Semi Auto +SWEP.Primary.Ammo = "none" +SWEP.Secondary.ClipSize = -1 -- Size of a clip +SWEP.Secondary.DefaultClip = -1 -- Default number of bullets in a clip +SWEP.Secondary.Automatic = false -- Automatic/Semi Auto +SWEP.Secondary.Ammo = "none" +SWEP.BaseCombineHoldType = false +SWEP.Slash = 1 +SWEP.IsCombine = false +SWEP.CooldownTimer = false +dontslash = false + +--[[function SWEP:SpawnCorroBolt2() + + local ent = ents.Create( "panda_pfirer" ) + if ( !IsValid( ent ) ) then return end + ent:SetPos(self.Owner:GetShootPos() + self.Owner:EyeAngles():Right() * 5 + self.Owner:EyeAngles():Forward() * 20 + self.Owner:GetAimVector() * 0 - self.Owner:EyeAngles():Up() * 10) + ent:SetAngles( self.Owner:EyeAngles() ) + ent:SetOwner( self.Owner ) + ent:Spawn() + ent:Activate() + ent:SetPhysicsAttacker( self.Owner, 10 ) + + local phys = ent:GetPhysicsObject() + if ( !IsValid( phys ) ) then ent:Remove() return end + phys:ApplyForceCenter( self.Owner:GetAimVector() * 1599 ) + +end--]] + +--[[function SWEP:HwaveCharged2() + + + + if ( SERVER ) then + self:SpawnCorroBolt2() + + end + + if ( self.Owner:IsPlayer() ) then + self.Owner:ViewPunch( Angle( math.random( -0.25, -1.5 ), math.random( 0, 0.03 ), math.random( 0, 0.03 ) ) ) + + end + + + + + + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self:SendWeaponAnim( ACT_VM_SECONDARYATTACK ) + + + + + + +end--]] + +function SWEP:PrimaryAttack() +if !self:IsValid() or !self.Owner:IsValid() or dontslash then return end + pos = self.Owner:GetShootPos() + ang = self.Owner:GetAimVector() + --self:HwaveCharged2() + self.Weapon:EmitSound("weapons/knife/knife_slash1.wav")--slash in the wind sound here + if SERVER and IsValid(self.Owner) then + local slash = {} + slash.start = pos + slash.endpos = pos + (ang * 80) + slash.filter = self.Owner + slash.mins = Vector(-5, -5, 0) + slash.maxs = Vector(5, 5, 5) + local slashtrace = util.TraceHull(slash) + if slashtrace.Hit then + targ = slashtrace.Entity + if targ:IsPlayer() or targ:IsNPC() then + self.Owner:EmitSound("coop_scream/knifekill"..math.random(1,2)..".wav") + paininfo = DamageInfo() + paininfo:SetDamage(self.Primary.Damage) + paininfo:SetDamageType(DMG_FALL) + paininfo:SetAttacker(self.Owner) + paininfo:SetInflictor(self.Weapon) + local RandomForce = math.random(1,2) + paininfo:SetDamageForce(slashtrace.Normal * RandomForce) + if targ:IsPlayer() then + targ:ViewPunch( Angle( -10, -20, 0 ) ) + end + local blood = targ:GetBloodColor() + local fleshimpact = EffectData() + fleshimpact:SetEntity(self.Weapon) + fleshimpact:SetOrigin(slashtrace.HitPos) + fleshimpact:SetNormal(slashtrace.HitPos) + if blood >= 0 then + fleshimpact:SetColor(blood) + util.Effect("BloodImpact", fleshimpact) + end + + if SERVER then targ:TakeDamageInfo(paininfo) end + end + end + end + end + +function SWEP:IsBaseCombineHoldType() +self.BaseCombineHoldType = true +end + + +function SWEP:ChaseFailed() +self.FailedChase = true +end \ No newline at end of file diff --git a/gamemode/allplayersdied.lua b/gamemode/allplayersdied.lua new file mode 100644 index 0000000..80290ee --- /dev/null +++ b/gamemode/allplayersdied.lua @@ -0,0 +1,155 @@ +CreateConVar( "gc_realismmode", 0, SERVER_CAN_EXECUTE, "Players don't respawn when they die, if all players die the map restarts" ) +CreateConVar( "gc_allowcheckpoints", 1, SERVER_CAN_EXECUTE, "Health re-chargers and some doors act as checkpoints." ) +util.PrecacheSound("theend/missionfailed.wav") + +restarting = 0 +firstdeath = Vector(0,0,0) +anydeaths = false +forcerealismenable = false +disablecheckpoints = false +usedcheckpoints = {} +failmusic = "theend/missionfailed.wav" + +function MapLoadFunctionInitDead() + timer.Simple(2,function() + timer.Create( "DeadPlayerChecker", 1, 0, function() + CheckingAlivePlayers() + end ) + end ) +end +hook.Add( "Initialize", "MapLoadFunctionDeadChecking", MapLoadFunctionInitDead ); + +function MissionFailed() + if(restarting == 0) then + restarting = 1 + for k, v in pairs(player.GetAll()) do + if(v:IsValid()) then + v:ScreenFade(SCREENFADE.OUT, color_black,6,2) + v:Freeze(true) + v:ConCommand("play " .. failmusic) + v:StripAmmo() + v:StripWeapons() + end + end + + --local relay = ents.FindByName(mission_failed_entity)[1] + --if (relay != nil) then + --relay:Fire("Trigger") + --end + if (mission_failed_entity ~= nil) then + local relay = ents.FindByName(mission_failed_entity)[1] + if (relay ~= nil) then + relay:Fire("Trigger") + end + end + stopspawning = false; + timer.Simple( 7.1, function() + for m, l in pairs(player.GetAll()) do + if(l:IsValid()) then + l:UnSpectate() + l:Freeze(false) + end + restarting = 0 + end + timer.Simple( 0.2, function() + RunConsoleCommand("changelevel",game.GetMap()) + end ) + end ) + end +end + + +function CheckingAlivePlayers() + aliveplayers = 0 + deadplayers = 0 + for k, v in pairs(player.GetAll()) do + if (v:IsValid() && v:Alive()) then + aliveplayers = aliveplayers + 1 + end + if (v:IsValid() && !v:Alive()) then + deadplayers = deadplayers + 1 + end + end + if(aliveplayers == 0 && deadplayers != 0 && restarting == 0) then + if((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable) then + restarting = 1 + for k, v in pairs(player.GetAll()) do + v:ScreenFade(SCREENFADE.OUT, color_black,6,2) + v:Freeze(true) + v:ConCommand("play " .. failmusic) + end + + --local relay = ents.FindByName(mission_failed_entity)[1] + --if (relay != nil) then + --relay:Fire("Trigger") + --end + if (mission_failed_entity ~= nil) then + local relay = ents.FindByName(mission_failed_entity)[1] + if (relay ~= nil) then + relay:Fire("Trigger") + end + end + timer.Simple( 7.1, function() timer.Simple( 0.2, function() RunConsoleCommand("changelevel",game.GetMap()) end ) end ) + end + end +end + +function canrespawn( ply ) + if(((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable) && stopspawning) then + return false + end +end +hook.Add( "PlayerDeathThink", "PlayerDontSpawn", canrespawn); + +hook.Add( "PlayerUse", "CheckPointRecharger", function( ply, ent ) +if(ent:IsValid() && ent:GetClass() == "item_suitcharger") then if(ply:Armor() < 100) then ply:SetArmor(100) ent:EmitSound( "items/suitchargeok1.wav", 75, 100, 1, CHAN_AUTO ) end end +if((GetConVarNumber( "gc_allowcheckpoints" ) == 1) && (disablecheckpoints == false) && ((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable)) then + if(ent:IsValid() && ent:GetClass() == "item_healthcharger") then + if(ply:Health() < 100) then ply:SetHealth(100) ent:EmitSound( "items/medshot4.wav", 75, 100, 1, CHAN_AUTO ) end + if(!table.HasValue(usedcheckpoints,ent:MapCreationID())) then + table.insert(usedcheckpoints,ent:MapCreationID()) + for _, l in pairs(ents.GetAll()) do + if((l:GetPos():Distance(ent:GetPos()) < 3500) && l:GetClass() == "item_healthcharger") then table.insert(usedcheckpoints,l:MapCreationID()) end + if((l:GetPos():Distance(ent:GetPos()) < 3500) && l:GetClass() == "prop_door_rotating") then table.insert(usedcheckpoints,l:MapCreationID()) end + end + ActivateCheckpoint(ply:GetPos(),true) + else + end + end +end +end ) + +hook.Add( "PlayerUse", "CheckPointDoors", function( ply, ent ) +if((GetConVarNumber( "gc_allowcheckpoints" ) == 1) && (disablecheckpoints == false) && ((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable)) then + if(ent:IsValid() && (ent:GetClass() == "prop_door_rotating") && (!ent:GetSaveTable( ).m_bLocked)) then + if(!table.HasValue(usedcheckpoints,ent:MapCreationID())) then + table.insert(usedcheckpoints,ent:MapCreationID()) + if (ent:GetPos():Distance(firstdeath) > 3500) then + ActivateCheckpoint(ply:GetPos(),true) + anydeaths = false + end + end + end +end +end ) + +hook.Add( "DoPlayerDeath", "FirstDeathVector", function( victim ) + if(anydeaths == false) then + firstdeath = victim:GetPos() + anydeaths = true + end +end ) + +function ActivateCheckpoint(checkpoint,sound) + for k, v in pairs(player.GetAll()) do + if(!v:Alive()) then + v:UnSpectate() + v:Spawn() + v:SetPos(checkpoint) + v:SetHealth(50) + if(sound) then + v:EmitSound( "ambient/energy/whiteflash.wav", 75, 100, 0.3, CHAN_AUTO ) + end + end + end +end diff --git a/gamemode/anticheat.lua b/gamemode/anticheat.lua new file mode 100644 index 0000000..9f803c2 --- /dev/null +++ b/gamemode/anticheat.lua @@ -0,0 +1,80 @@ +customspawn = false +stopspawning = false + +function GameStart() + stopspawning = true; + for k, v in pairs(player.GetAll()) do + v:ConCommand("play plats/elevbell1.wav") + v:PrintMessage( HUD_PRINTCENTER, "THE GAME HAS STARTED" ) + end +end + +local function CreateCheapTick() + nearspawn = true + + timer.Simple(2, function() + RunConsoleCommand("mp_falldamage","1") + RunConsoleCommand("sbox_godmode","0") + RunConsoleCommand("sbox_noclip","0") + RunConsoleCommand("sv_allow_color_correction","1") + RunConsoleCommand("ai_ignoreplayers","0") + RunConsoleCommand("ai_disabled","0") + + timer.Create( "cheapfragtick", 1, 0, function() + for k, v in pairs(player.GetAll()) do + if(v:HasWeapon("weapon_frag") && v:GetAmmoCount(10) == 0) then + v:StripWeapon( "weapon_frag" ) + end + end + end ) + + + timer.Create( "cheaptick", 1, 0, function() + if((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable) then + if(stopspawning == false) then + if(#player.GetAll() > 0) then + if(!customspawn) then + for k, v in pairs(player.GetAll()) do + for m, l in pairs(ents.FindByClass("info_player_start")) do + if(v:GetPos():Distance(l:GetPos()) > 256) then + nearspawn = false + else + nearspawn = true + break + end + end + if(!nearspawn && !stopspawning) then + GameStart() + break + end + end + end + end + end + end + end ) + + end ) +end +hook.Add( "Initialize", "Cheap Tick", CreateCheapTick ) + +local function DisableNoclip( ply ) + return false; +end +hook.Add( "PlayerNoClip", "DisableNoclipFunction", DisableNoclipFunction ) + +local function spawn( ply ) + if(((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable) && stopspawning) then + timer.Simple(0.1,function() + if(ply:IsValid()) then + ply:Kill() + ply:SetObserverMode(OBS_MODE_ROAMING) + ply:SetMoveType(MOVETYPE_OBSERVER) + ply:SpectateEntity(table.Random(player.GetAll())) + end + end ) + + end +end +hook.Add( "PlayerInitialSpawn", "InitialSpawnCheck", spawn ) + diff --git a/gamemode/bringplayers.lua b/gamemode/bringplayers.lua new file mode 100644 index 0000000..897775e --- /dev/null +++ b/gamemode/bringplayers.lua @@ -0,0 +1,36 @@ +CreateConVar( "gc_allowbringplayers", 0, SERVER_CAN_EXECUTE, "Allow the !bring command to be used." ) +cooldown = CreateConVar( "gc_bringcooldown", 120, {SERVER_CAN_EXECUTE, FCVAR_NEVER_AS_STRING}, "Sets the !bring cooldown (in seconds)." ) +canbringplayers = true +forcebringdisable = false + +function BringAllPlayers(ply) + if(canbringplayers) then + canbringplayers = false + timer.Simple(cooldown:GetInt(), function() canbringplayers = true end ) + for k, v in pairs(player.GetAll()) do + if(ply != v) then + if(v:IsPlayer() && v:Alive()) then + v:SetPos(ply:GetPos()) + end + end + end + end +end + +hook.Add( "PlayerSay", "BringPlayersCommandSay", function( ply, text, public ) + text = string.lower( text ) + if ( text == "!bring" ) then + if((GetConVarNumber( "gc_allowbringplayers" ) != 0) && (forcebringdisable == false)) then + if(canbringplayers == false) then + ply:ChatPrint("You can use the !bring command only once every " .. cooldown:GetInt() .. " seconds!") + end + if(canbringplayers) then + for k, v in pairs(player.GetAll()) do + v:ChatPrint(ply:Nick() .. " has just used the !bring command!") + end + BringAllPlayers(ply) + end + end + return "" + end +end ) diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua new file mode 100644 index 0000000..21cdfc5 --- /dev/null +++ b/gamemode/cl_init.lua @@ -0,0 +1 @@ +include( "shared.lua" ) \ No newline at end of file diff --git a/gamemode/deathspectate.lua b/gamemode/deathspectate.lua new file mode 100644 index 0000000..9112e44 --- /dev/null +++ b/gamemode/deathspectate.lua @@ -0,0 +1,37 @@ +hook.Add( "PlayerDeath", "DeathSpectatingFunction", function( victim, inflictor, attacker ) +if((GetConVarNumber( "gc_realismmode" ) == 1) || forcerealismenable) then + timer.Simple(1,function() + if(victim:IsValid()) then + victim:SetObserverMode(OBS_MODE_IN_EYE) + victim:SetMoveType(MOVETYPE_OBSERVER) + for k, v in pairs(player.GetAll()) do if(v:IsValid() && v:Alive() && v != victim) then victim:SpectateEntity(v) return end end + end + end ) +end +end ) + +hook.Add( "KeyPress", "SpectatingKeyPress", function( ply, key ) + if(key == IN_ATTACK) then + if(!ply:Alive()) then + local randomplayer = table.Random(player.GetAll()) + if (randomplayer:IsValid() && randomplayer:Alive() && randomplayer != ply && randomplayer != ply:GetObserverTarget()) then + if(randomplayer == nil) then return + end + ply:SpectateEntity(randomplayer) + end + end + end + if(key == IN_JUMP) then + if(!ply:Alive()) then + local randomplayer = table.Random(player.GetAll()) + if (randomplayer:IsValid() && randomplayer:Alive() && randomplayer != ply && randomplayer != ply:GetObserverTarget()) then + if(randomplayer == nil) then return + end + ply:SpectateEntity(randomplayer) + end + if(ply:GetObserverMode() == 4) then ply:SetObserverMode(OBS_MODE_CHASE) + elseif(ply:GetObserverMode() == 5) then ply:SetObserverMode(OBS_MODE_IN_EYE) + end + end +end +end ) \ No newline at end of file diff --git a/gamemode/dynamicmovement.lua b/gamemode/dynamicmovement.lua new file mode 100644 index 0000000..af61525 --- /dev/null +++ b/gamemode/dynamicmovement.lua @@ -0,0 +1,68 @@ +local jumped = 0 +local vellock = true + +hook.Add( "PlayerHurt", "SlowingDownHurtPlayers", function( victim, attacker, healthRemaining, damageTaken ) + if(victim:IsValid()) then + if(horrormovement) then + victim:SetSlowWalkSpeed(230) + victim:SetWalkSpeed(230) + victim:SetRunSpeed(230) + else + if(damageTaken < 100) then + victim:SetSlowWalkSpeed(140 - damageTaken) + victim:SetWalkSpeed(155 - damageTaken) + victim:SetRunSpeed(210 - damageTaken) + else + victim:SetSlowWalkSpeed(10) + victim:SetWalkSpeed(10) + victim:SetRunSpeed(10) + end + end + victim:ViewPunch( Angle( -(damageTaken / 10), 0, 0 )) + end + if(horrormovement) then + -- timer.Simple( 0.5, function() if(victim:IsValid() && jumped < CurTime()) then print("player back to normal after taking damage") victim:SetSlowWalkSpeed(120) victim:SetWalkSpeed(180) victim:SetRunSpeed(140) end end ) + timer.Simple( 2, function() if(victim:IsValid()) then victim:SetSlowWalkSpeed(120) victim:SetWalkSpeed(181) victim:SetRunSpeed(140) end end ) + else + -- timer.Simple( 0.5, function() if(victim:IsValid() && jumped < CurTime()) then victim:SetSlowWalkSpeed(140) victim:SetWalkSpeed(155) victim:SetRunSpeed(210) end end ) + timer.Simple( 0.5, function() if(victim:IsValid()) then victim:SetSlowWalkSpeed(140) victim:SetWalkSpeed(155) victim:SetRunSpeed(210) end end ) + end +end ) + + +hook.Add("KeyPress", "Anti-Bhop", function(player, key) + if(key == IN_JUMP) then + if(CurTime() < jumped) then + if(player:IsValid()) then + if(!vellock) then + player:SetVelocity(- player:GetVelocity() / 2) + jumped = CurTime() + 3 + vellock = true + end + jumped = CurTime() + 3 + end + else + jumped = CurTime() + 3 + end + return true + end +end) + +hook.Add( "OnPlayerHitGround", "SlowingFall", function( player, inWater, onFloater, speed ) + if(horrormovement) then + if(player:IsValid()) then + player:SetSlowWalkSpeed(100) + player:SetWalkSpeed(100) + player:SetRunSpeed(100) + end + timer.Simple( 0.5, function() if(player:IsValid()) then player:SetSlowWalkSpeed(120) player:SetWalkSpeed(181) player:SetRunSpeed(140) end end) + else + if(player:IsValid()) then + player:SetSlowWalkSpeed(140) + player:SetWalkSpeed(140) + player:SetRunSpeed(140) + end + timer.Simple( 0.5, function() if(player:IsValid()) then player:SetSlowWalkSpeed(140) player:SetWalkSpeed(155) player:SetRunSpeed(210) end end) + end + vellock = false +end ) \ No newline at end of file diff --git a/gamemode/headcrabs.lua b/gamemode/headcrabs.lua new file mode 100644 index 0000000..a5f0693 --- /dev/null +++ b/gamemode/headcrabs.lua @@ -0,0 +1,37 @@ +CreateConVar( "gc_realheadcrabs", 1, SERVER_CAN_EXECUTE, "Headcrabs have a chance to kill you instantly." ) + +function HeadcrabDeath(ply,headcrab) +ply:ConCommand("pp_mat_overlay halflife/black") +ply:ConCommand("play npc/headcrab_poison/ph_poisonbite1.wav") +headcrab:Remove() +timer.Simple(1,function() if(ply:IsValid()) then ply:ConCommand("pp_mat_overlay [[]]") end end ) +end + +hook.Add( "PlayerHurt", "HeadcrabHurtFunction", function( victim, attacker, healthRemaining, damageTaken ) +if((GetConVarNumber( "gc_realheadcrabs" ) != 0) || forcerealisticheadcrabs) then + + if(attacker:GetClass() == "npc_headcrab_fast") then + if((damageTaken + 25) >= healthRemaining) then + HeadcrabDeath(victim,attacker) + end + victim:SetHealth(healthRemaining - 25) + end + + if(attacker:GetClass() == "npc_headcrab") then + if((damageTaken + 40) >= healthRemaining) then + HeadcrabDeath(victim,attacker) + end + victim:SetHealth(healthRemaining - 40) + end + + if(attacker:GetClass() == "npc_headcrab_black") then + HeadcrabDeath(victim,attacker) + victim:SetHealth(0) + end + + if(attacker:GetClass() == "npc_headcrab_poison") then + HeadcrabDeath(victim,attacker) + victim:SetHealth(0) + end +end +end) \ No newline at end of file diff --git a/gamemode/init.lua b/gamemode/init.lua new file mode 100644 index 0000000..c1bfbdd --- /dev/null +++ b/gamemode/init.lua @@ -0,0 +1,18 @@ +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) +AddCSLuaFile( "levels.lua" ) +include( "spawninit.lua" ) +include( "weaponsystem.lua" ) +include( "allplayersdied.lua" ) +include( "deathspectate.lua" ) +include( "headcrabs.lua" ) +include( "zombies.lua" ) +--include( "anticheat.lua" ) +include( "bringplayers.lua" ) +include( "realisticdamage.lua" ) +include( "dynamicmovement.lua" ) +include( "mapperstuff.lua" ) +include( "noheadcrabs.lua" ) +include( "shared.lua" ) + +resource.AddFile( "sound/weapons/universal/pap.wav" ) diff --git a/gamemode/levels.lua b/gamemode/levels.lua new file mode 100644 index 0000000..0631225 --- /dev/null +++ b/gamemode/levels.lua @@ -0,0 +1,407 @@ +function GetRandomLevel() + local myTable = { + "syn_deadsimple", + "Poison_Coop_RE1_Beta1", + "oc_systems2B-2", + "oc_systems2B-1", + "mph_twilight1_bb_fix", + "level03_underground_1f5", + "js_coop_sewers_vv5", + "js_coop_minimall_p7", + "js_coop_coast_x1", + "coop_z_harrier2", + "coop_d3_c17_10a_10b_jedi2e", + "coop_bb_tombs_v1", + "js_coop_tbr_[a1]_ttc_v6b", + "js_coop_tbr_[a1]_ttc_v7a", + "x_coop_kanny_lockdown_reloaded", + "x_coop_minimall_reloaded_v5", + "tbr_coop_skyscrapers_v4", + "x_coop_space", + "x_coop_helicave", + "x_coop_citadel", + "x_coop_minimall", + "tbr_coop_thousand_antlions_v3b", + "tbr_coop_red_keops_v4", + "tbr_coop_red_keops_v2", + "ta_coop_the_pitts_v2a", + "ta_coop_the_edge_v4", + "ta_coop_the_edge_v2", + "ta_coop_run_for_your_life_v1", + "ta_coop_run_for_your_life_0", + "ta_coop_phrenetic_escape_v3", + "ta_coop_phrenetic_escape_0", + "ta_coop_last_man_standing_v5", + "ta_coop_last_man_standing_v2", + "ta_coop_last_man_standing_0", + "syn_lvcoop_part2", + "syn_lvcoop_part1", + "sg_coop_steamlab_b5", + "sg_coop_steamlab_b4", + "sg_coop_steamlab_b1", + "sg_coop_runoff_zb", + "sg_coop_runoff_zb2", + "sg_coop_resistance_b2", + "sg_coop_resistance_b1", + "sg_coop_overwatch_b4", + "sg_coop_overwatch_b3", + "sg_coop_overwatch_b1", + "sg_coop_lockdown_b3", + "scary_united_coop", + "scary_gmod_coop_x", + "poison_coop_re1_beta1", + "oblivion_coop_v1", + "mp_coop_fan_p2port", + "mp_coop_fan_p2port_fawosfix", + "mm_coop_underpass_v2", + "js_x_coop_stargate", + "js_lm_coop_underground_v4b", + "js_coop_zero_g_oc4", + "js_coop_waterworks_ttc_v4", + "js_coop_waterworks_ttc_v3", + "js_coop_vtol_x_v5", + "js_coop_underground_x_v3", + "js_coop_ultraviolet_v6b", + "js_coop_ttc_tbr_p1", + "js_coop_train_station_v1", + "js_coop_train_reloaded", + "js_coop_train_reloaded_2a", + "js_coop_train_reloada", + "js_coop_thunder", + "js_coop_thunder_b4", + "js_coop_thunder_b3a", + "js_coop_thunder_b2", + "js_coop_teleport_v9fix", + "js_coop_teleport_sg_zb", + "js_coop_teleport_sg_zb3", + "js_coop_team_v3", + "js_coop_team_ttc_b1", + "js_coop_tbr_cave_v7a", + "js_coop_tbr_cave_v5_!", + "js_coop_subway_x_v6", + "js_coop_subway_fixed", + "js_coop_space_x_v2", + "js_coop_space_station_v2a", + "js_coop_space_fixed", + "js_coop_sky_chase_tbr_v3", + "js_coop_siege_v4", + "js_coop_shore", + "js_coop_sewers_v5", + "js_coop_sewers_v3", + "js_coop_savescientist_v5a", + "js_coop_save_scientist_v4", + "js_coop_save_scientist_v3b", + "js_coop_savescientist_ob1", + "js_coop_save_dog_v4b", + "js_coop_save_dog_tbr_v5", + "js_coop_save_dog_tbr_v3", + "js_coop_rocks_v8", + "js_coop_rm_powerworks_2020_v2", + "js_coop_ravenholm_x_bb", + "js_coop_ravenholm_x2", + "js_coop_quest_vv9", + "js_coop_quest_v9", + "js_coop_quest", + "js_coop_powerworks_v2", + "js_coop_powercrysis_v3_b", + "js_coop_part3_waterworks_v2", + "js_coop_part2_waterworks_v3", + "js_coop_part2_powerworks_v1a", + "js_coop_nation_v1", + "js_coop_monsterkill_v2b", + "js_coop_monsterkill_reload_b", + "js_coop_missiontwo_v1f", + "js_coop_minimall_fixed", + "js_coop_mesa_v3", + "js_coop_lvls_tbr_combine_v1", + "js_coop_lockdown_x_v7", + "js_coop_lockdown_tbr_v3", + "js_coop_lk8", + "js_coop_lj9", + "js_coop_lh5_windows", + "js_coop_lh5", + "js_coop_levels_tbr_rock_v27", + "js_coop_levelcube_ttc_a", + "js_coop_level8_x_v1", + "js_coop_level5_x_v1", + "js_coop_lc3_nuke_m", + "js_coop_lc3", + "js_coop_la4", + "js_coop_killer_lost_v16", + "js_coop_killer_lost_final_d1", + "js_coop_horror_v13", + "js_coop_horror_v12", + "js_coop_helicave_x_v2", + "js_coop_hanhack_vv6", + "js_coop_hacktown_v3", + "js_coop_hacktown_v1", + "js_coop_gnarkill_puzzlev3", + "js_coop_gethev_v1a", + "js_coop_docks_x_v4", + "js_coop_docks2_vv3", + "js_coop_deep_v12", + "js_coop_deep6_x_v4", + "js_coop_dasole_x_v2", + "js_coop_dasole_ttc_b1", + "js_coop_dasole2_v7", + "js_coop_dasole2_ttc_b1", + "js_coop_cubix_v1", + "js_coop_cranecase_x_v4", + "js_coop_cranecase_p1", + "js_coop_combine_reload_b", + "js_coop_combine2_ttc_p5", + "js_coop_combine2_sg_b4", + "js_coop_combine2_sg_b3", + "js_coop_coast_x_v5", + "js_coop_citadel_v14fixx", + "js_coop_citadel_blast_v5", + "js_coop_church_ttc_ob", + "js_coop_cavettc_ob", + "js_coop_bugbait_v3", + "js_coop_bridgewar_v6", + "js_coop_blueberry_ob_p7", + "js_coop_basemission_beta", + "js_coop_antlionrun_v4", + "js_coop_airboats_v5", + "js_coop_acc_v6", + "js_coop_2fort_teleport_p1", + "js_coop_2fort_b11_teleport_x3", + "js_coop_2011_savedog_v2", + "jr_coop_undergroundescape_v1", + "gm_escape_coop_part_01", + "eye_coop8", + "dm_rebledefence_coop", + "dm_coop_perverslabyrinthe", + "dm_chickencoop_v2", + "csv_coop_evac_5_credits", + "csv_coop_darkbonus", + "coop_zombiescity", + "coop_zombie_map", + "coop_zombie_invasion_10_r1", + "coop_zelda01_b", + "coop_warpath_v1", + "coop_war_of_the_worlds_1ve", + "coop_wardogs_v5", + "coop_wardogs_v4", + "coop_venture_v1c", + "coop_venture_rc4", + "coop_uprising_c", + "coop_unnormal", + "coop_unnamed_1", + "coop_underground_win", + "coop_traps_v1c", + "coop_trainstation_02_1cube", + "coop_train_escape_z1", + "coop_train_02_1cube", + "coop_town_level4d", + "coop_town_level3a", + "coop_town_level2a", + "coop_town_level1", + "coop_tim-3", + "coop_thunder", + "coop_the_pitts_pr2", + "coop_the_pitts_fix", + "coop_the_escape_part4_beta4", + "coop_the_escape_part3_beta5", + "coop_the_escape_part2_beta6", + "coop_the_escape_part1_beta19", + "coop_the_edge_r1", + "coop_swampthing_v6", + "coop_striders_revenge_2b", + "coop_stargate", + "coop_sd_zombie-city_b1", + "coop_run_for_your_life", + "coop_run_for_your_life_0", + "coop_rocks_v11", + "coop_resistance_part1_v1c", + "coop_resident_evil_sg_zb4", + "coop_redqueen_zba_z3", + "coop_rebel_incursion5", + "coop_rebel_escape_r1", + "coop_ravenholm_2a_cube", + "coopqwest_one_jr", + "coop_port_sg_zb", + "coop_planet_ant", + "coop_other_in_blackmesa_hl2", + "coop_other_city17_outland_ep2", + "coop_other_city17", + "coop_other_city17_ep1", + "coop_other_city17_antarctic_ep3", + "coop_nvc_citadel_escape", + "coop_npcwar_v6", + "coop_npcwar_v6_aldo", + "coop_npcwar_final", + "coop_npcwar3_v6", + "coop_npcwar3_final", + "coop_npcwar3_aldo", + "coop_npcwar2_final", + "coop_npcwar2_aldo", + "coop_mw_revenge_ttc_v1", + "coop_monster", + "coop_missile_silo_bb3", + "coop_missile_silo206", + "coop_miniflatgrass", + "coop_militia_sg_zb", + "coop_metamorphics_egypt_level1", + "coop_meows_winter_wonderland", + "coop_meows_tower_of_babel_v_4", + "coop_meows_tower_of_babel_v_3", + "coop_meows_symphony_eight_v_4", + "coop_meows_stairway_hell_v_2", + "coop_meows_stairway_hell_v_1", + "coop_meows_sewer_mania_v_5", + "coop_meows_sewer_mania_v4", + "coop_meows_runoff_winter_v7", + "coop_meows_runoff_winter_v5", + "coop_meows_runoff_ver_1", + "coop_meows_runoff_v_4", + "coop_meows_runoff_v_3", + "coop_meows_runoff_v_2", + "coop_meows_round_robin_v9", + "coop_meows_round_robin_fixed", + "coop_meows_revenge_v_3", + "coop_meows_pyramid_v1", + "coop_meows_pyramid_pr1", + "coop_meows_pitifull", + "coop_meows_new_tricks_v_7a", + "coop_meows_new_tricks_v_6", + "coop_meows_lockdown_v_3", + "coop_meows_lockdown_v1d", + "coop_meows_kill_em_all_ver2", + "coop_meows_kill_em_all_v_4", + "coop_meows_island_defence_v_1", + "coop_meows_island_defence", + "coop_meows_icey_topsy_turvey", + "coop_meows_house_to_house_z1", + "coop_meows_house_to_house", + "coop_meows_house_to_house1", + "coop_meows_fun_day_out_z1", + "coop_meows_corridoors_v_6", + "coop_meows_corridoors_v_5", + "coop_meows_corridoors_r1", + "coop_manticore", + "coop_manticore_bb", + "coop_lockdown_b2", + "coop_linux_zombie_2b", + "coop_linux_ravenholm_1g", + "coop_level_9a", + "coop_level_7b", + "coop_level_6d", + "coop_level_5b", + "coop_level_4a", + "coop_level_1", + "coop_level_1b_cube", + "coop_level07_scary_house_v4", + "coop_level07_scary_house_fix2", + "coop_level06_base", + "coop_level02_traps_v1c", + "coop_level01_dooms_entry_v1b", + "coop_last_man_standing_v2", + "coop_ktz-treehouse", + "coop_ktz-hell", + "coop_kinyoenta_vz_g", + "coop_killbox_1", + "coop_great_evil", + "coop_fog_lab", + "coop_fog_city", + "coop_fleeravenholm_part1", + "coop_fleeravenholm", + "coop_fire_pit_finalv2", + "coop_ffgs_powerhouse", + "coop_evacuationbm", + "coop_evac_5_credits", + "coop_evac_4", + "coop_evac_3", + "coop_evac_2", + "coop_evac_1", + "coop_epicycle_v4", + "coop_ep1_level4_remote_2b", + "coop_ep1_level3_remote_2a", + "coop_ep1_level3_remote_1e", + "coop_ep1_level2_remote_1c", + "coop_ep1_level2_jedi_1l", + "coop_ep1_level1_remote_2a", + "coop_dtm_c2e1_v1b209", + "coop_dooms_entry_v1b", + "coop_dogs_revenge_1b", + "coop_dogs_rampage_2b", + "coop_dog_1d_cube", + "coop_defensegarage_v2", + "coop_darkmesa", + "coop_darkbonus", + "coop_dark17", + "coop_danmaku_i", + "coop_d3_c17_15_d_2y", + "coop_coopbox_v2", + "coop_combat17", + "coop_coast_01_1k_cube", + "coop_city_c17_level3_jedi_1b", + "coop_city_c17_level3_jedi_1a", + "coop_city_17_level5_jedi_1b", + "coop_city_17_level5_jedi_1a", + "coop_city_17_level4_jedi_1h", + "coop_city_17_level1_jedi_1a", + "coop_city_17_jedi_2f", + "coop_citadel_level1_2i", + "coop_citadel_escape_v7", + "coop_citadel_escape_v5", + "coop_citadel_escape_v2fix", + "coop_citadel_escape_p6", + "coop_citadel_chapter12_1f", + "coop_citadel_2_1a_cube", + "coop_cc_nochance_v1b60", + "coop_canalsv4", + "coop_canalsv10", + "coop_canals_f4", + "coop_canals_f3", + "coop_burlybrawl_bb", + "coop_bunker_buddies", + "coop_breen_1d_cube", + "coop_breen_01_jedi_5e", + "coop_blueberry_oblivion_x1", + "coop_blueberry", + "coop_blame!_log2_v2", + "coop_blame!_log2_v1", + "coop_blame!_log1_v2", + "coop_blame_log1_v1", + "coop_blame!_log1_v1", + "coop_blame!_log1_v1a", + "coop_blackmesa_combat", + "coop_bb_xtotalcontrol", + "coop_bb_xtotalcontrol_d", + "coop_bb_level_2_b6", + "coop_bb_level_1", + "coop_atlantis_beta04", + "coop_a_place_to_die_jbrfix_final_v1", + "coop_a_place_to_die_jbrfixed2i", + "coop_ant_tower_b1_3", + "coop_across_the_darkness3a", + "coop_abducted_4", + "coop_abducted_3", + "coop_abducted_2", + "coop_abducted_1", + "coop9_oblivion_blueberry_x3", + "coop6_180_blueberry", + "coop4_ob_gunzfly_p5", + "coop4_ob_gunzfly_p4", + "coop3_oblivion_lockdown_x1", + "coop_123module_v2", + "coop_123module_bb2", + "cl_coop_venture_up", + "cl_coop_quest_v5", + "cl_coop_level3_topside_b2", + "cl_coop_level2_survive_r1", + "cl_coop_level2_survive", + "cl_coop_level1_escape_r1", + "cl_coop_level1_escape", + "cl_coop_laserquest_b2", + "cl_coop_doors_v4", + "cl_coop_doors", + "cl_coop_corridor_b3", + "cl_coop_cages", + "cl_coop_breakable", + "cl_coop_breakable_b2", + "ad_coop_mara_final" + } + return myTable[ math.random( #myTable ) ] +end diff --git a/gamemode/mapperstuff.lua b/gamemode/mapperstuff.lua new file mode 100644 index 0000000..8ba3e29 --- /dev/null +++ b/gamemode/mapperstuff.lua @@ -0,0 +1,275 @@ +unstuckammo = false +striponspawn = false +forcebringdisable = false +forcerealisticheadcrabs = false +forcerealisticzombies = false +noweapontransfer = false +flashlights = true + +function CheckpointsDisabled(bool) +if(bool) then + disablecheckpoints = true +else + disablecheckpoints = false +end +end + +function RemoveSpeedMods() + for k, v in pairs( ents.FindByClass( "player_speedmod" ) ) do + if(!v:GetName() == "coopspeed1" && !v:GetName() == "coopspeed2" && !v:GetName() == "coopspeed3" && !v:GetName() == "coopspeed") then + v:Remove() + end + end +end + +function MapChange(mapname) + file.Write("weptranslevel.txt",string.lower(mapname)) + file.Write("weptransplayers.txt","") + file.Write("weptransweps.txt","") + file.Write("weptransammo.txt","") + file.Write("weptransammotypes.txt","") + file.Write("weptranshealth.txt","") + file.Write("weptransarmor.txt","") + file.Write("weptransclips.txt","") + file.Write("weptransalreadygiven.txt","") + file.Write("weptransmodel.txt","") + if(game.SinglePlayer()) then + file.Write("weptransgametype.txt","singleplayer") + else + file.Write("weptransgametype.txt","multiplayer") + end + for k, v in pairs(player.GetAll()) do + if(game.SinglePlayer()) then + file.Write("weptransplayers.txt",1) + else + if(v:IsValid()) then + file.Append("weptransplayers.txt",v:SteamID()..",") + end + end + if(v:IsValid()) then + if(v:Health() > 25) then + file.Append("weptranshealth.txt",v:Health()..",") + else + file.Append("weptranshealth.txt","25,") + end + file.Append("weptransarmor.txt",v:Armor()..",") + file.Append("weptransmodel.txt",v:GetModel()..",") + v:ScreenFade(SCREENFADE.OUT, color_black,1.5,9999) + v:Freeze(true) + for l, m in pairs(v:GetWeapons()) do + file.Append("weptransweps.txt",m:GetClass()..",") + file.Append("weptransclips.txt",m:Clip1()..",") + end + file.Append("weptransweps.txt","\n") + file.Append("weptransclips.txt","\n") + for d, z in pairs(v:GetAmmo()) do + file.Append("weptransammo.txt",z..",") + file.Append("weptransammotypes.txt",game.GetAmmoName(d)..",") + end + file.Append("weptransammo.txt","\n") + file.Append("weptransammotypes.txt","\n") + end + end + timer.Simple( 2, function() RunConsoleCommand("changelevel",string.lower(mapname)) end ) + timer.Simple( 4, function() PrintMessage( HUD_PRINTTALK,"Next map not found! Download the next map!" ) end ) + timer.Simple( 7, function() RunConsoleCommand("disconnect") end ) +end + +function LoadWeapons() + if(game.SinglePlayer() && file.Read("weptransgametype.txt","DATA") == "singleplayer") then + local ply = Entity(1) + if(ply:IsValid()) then + ply:SetHealth(string.Split(file.Read("weptranshealth.txt","DATA"),",")[1]) + ply:SetArmor(string.Split(file.Read("weptransarmor.txt","DATA"),",")[1]) + ply:SetModel(string.Split(file.Read("weptransmodel.txt","DATA"),",")[1]) + ply.UseWeaponSpawn = CurTime() + for m, l in pairs(string.Split(string.Split(file.Read("weptransweps.txt","DATA"),"\n")[1],",")) do + if(l != "") then + ply:Give(l,true) + ply:GetWeapon(l):SetClip1(string.Split(string.Split(file.Read("weptransclips.txt","DATA"),"\n")[1],",")[m]) + end + end + end + timer.Simple( 0.1, function() + for d, z in pairs(string.Split(string.Split(file.Read("weptransammotypes.txt","DATA"),"\n")[1],",")) do + if(z != "") then + if(ply:IsValid()) then + ply:GiveAmmo(string.Split(string.Split(file.Read("weptransammo.txt","DATA"),"\n")[1],",")[d],z,true) + end + end + end + end ) + else if (!game.SinglePlayer() && file.Read("weptransgametype.txt","DATA") == "multiplayer") then + for k, v in pairs(string.Split(file.Read("weptransplayers.txt","DATA"),",")) do + local ply = player.GetBySteamID(v) + if(ply != false && ply:GetNWBool("givenloadout") != true) then + if(ply:IsValid()) then + ply:SetNWBool("givenloadout",true) + file.Append("weptransalreadygiven.txt",ply:SteamID()..",") + ply:SetHealth(string.Split(file.Read("weptranshealth.txt","DATA"),",")[k]) + ply:SetArmor(string.Split(file.Read("weptransarmor.txt","DATA"),",")[k]) + ply:SetModel(string.Split(file.Read("weptransmodel.txt","DATA"),",")[k]) + ply.UseWeaponSpawn = CurTime() + for m, l in pairs(string.Split(string.Split(file.Read("weptransweps.txt","DATA"),"\n")[k],",")) do + if(l != "") then + ply:Give(l,true) + ply:GetWeapon(l):SetClip1(string.Split(string.Split(file.Read("weptransclips.txt","DATA"),"\n")[k],",")[m]) + end + end + end + timer.Simple( 0.1, function() + for d, z in pairs(string.Split(string.Split(file.Read("weptransammotypes.txt","DATA"),"\n")[k],",")) do + if(z != "") then + if(ply:IsValid()) then + ply:GiveAmmo(string.Split(string.Split(file.Read("weptransammo.txt","DATA"),"\n")[k],",")[d],z,true) + end + end + end + end ) + end + end + end + end +end + +hook.Add( "PlayerDeath", "LoadoutDeath", function( victim, inflictor, attacker ) + if(victim:GetNWBool("givenloadout") != true) then + if(victim:IsValid()) then + file.Append("weptransalreadygiven.txt",victim:SteamID()..",") + end + end + if(victim:IsValid()) then victim:SetNWBool("givenloadout",true) end +end ) + +--[[function lddisc( ply ) + if(!CheckGiven(player)) then + file.Append("weptransalreadygiven.txt",ply:SteamID()..",") + end +end +hook.Add( "PlayerDisconnected", "loadoutdisconnect", lddisc )]]-- + +--[[function CheckGiven(ply) +for k, v in pairs(string.Split(file.Read("weptransalreadygiven.txt","DATA"),",")) do + local ply = player.GetBySteamID(v) + if(ply != false) then + return true + end +end + return false +end]]-- + +hook.Add( "PlayerSpawn", "LevelChangeLoadout", function(player) + timer.Simple(2,function() + if(!noweapontransfer) then + if(player:IsValid() && player:GetNWBool("givenloadout") != true) then +-- if(!CheckGiven(player)) then + if(game.GetMap() == file.Read("weptranslevel.txt")) then + LoadWeapons() + end +-- end + end + end + end ) +end ) + +function EmptyTransferData() + file.Write("weptranslevel.txt","") + file.Write("weptransplayers.txt","") + file.Write("weptransweps.txt","") + file.Write("weptransammo.txt","") + file.Write("weptransammotypes.txt","") + file.Write("weptranshealth.txt","") + file.Write("weptransarmor.txt","") + file.Write("weptransclips.txt","") + file.Write("weptransalreadygiven.txt","") + file.Write("weptransmodel.txt","") +end + +function AllFrozen(bool) +if(bool) then + for k, v in pairs(player.GetAll()) do v:Freeze(true) end +else + for k, v in pairs(player.GetAll()) do v:Freeze(false) end +end +end + +function UnfreezeAmmo() + if(unstuckammo == false) then + for k, v in pairs( ents.FindByClass( "item_*" ) ) do + v:SetPos(v:GetPos() + Vector(0,0,1)) + unstuckammo = true + end + end +end + +local function spawnspeedmodremove( ply ) + RemoveSpeedMods() + UnfreezeAmmo() +end +hook.Add( "PlayerInitialSpawn", "InitialSpawnRemove", spawnspeedmodremove ) + +local function MapperStuffInit() + timer.Simple(2, function() + RemoveSpeedMods() + UnfreezeAmmo() + --if(#ents.FindByClass("weapon_crowbar") != 0) then StartWithNothing(true) end + end ) +end +hook.Add( "Initialize", "RemoveSpeedModInit", MapperStuffInit ) + +function FlashlightStatus(allow) +if(allow) then + for k, v in pairs(player.GetAll()) do v:AllowFlashlight(true) end + flashlights = true +else + for k, v in pairs(player.GetAll()) do v:AllowFlashlight(false) end + flashlights = false +end +end + + + +hook.Add( "PlayerSwitchFlashlight", "FlashlightSettings", function( ply, enabled ) + return flashlights +end ) + +function ForceRealismEnable(bool) +if(bool) then + forcerealismenable = true +else + forcerealismenable = false +end +end + +function StartWithNothing(bool) +if(bool) then + striponspawn = true +else + striponspawn = false +end +end + + +function ForceBringDisable(bool) +if(bool) then + forcebringdisable = true +else + forcebringdisable = false +end +end + +function ForceRealisticZombies(bool) +if(bool) then + forcerealisticzombies = true +else + forcerealisticzombies = false +end +end + +function ForceRealisticHeadcrabs(bool) +if(bool) then + forcerealisticheadcrabs = true +else + forcerealisticheadcrabs = false +end +end diff --git a/gamemode/noheadcrabs.lua b/gamemode/noheadcrabs.lua new file mode 100644 index 0000000..bdd66b9 --- /dev/null +++ b/gamemode/noheadcrabs.lua @@ -0,0 +1,46 @@ +headcrabsdontexist = false + +function NoHeadcrabs(bool) + if(bool) then headcrabsdontexist = true end + if(!bool) then headcrabsdontexist = false end +end + +local function RemoveCrabsTick() + if(headcrabsdontexist) then + local Crabs = table.Add( table.Add( table.Add( table.Add( ents.FindByClass( "npc_headcrab" )), ents.FindByClass( "npc_headcrab_fast" ) ), ents.FindByClass( "npc_headcrab_black" ) ), ents.FindByClass( "npc_headcrab_poison" )) + local Zombies = table.Add(table.Add( table.Add( table.Add( table.Add( ents.FindByClass("npc_zombie_torso"), ents.FindByClass( "npc_zombie" )), ents.FindByClass( "npc_fastzombie" ) ), ents.FindByClass( "npc_zombine" ) ), ents.FindByClass("npc_fastzombie_torso")), ents.FindByClass("npc_poisonzombie")) + for _, crab in pairs( Crabs ) do + SafeRemoveEntity( crab ) + end + for k, zombie in pairs( Zombies ) do + zombie:SetBodygroup(1,0) + zombie:SetBodygroup(2,0) + zombie:SetBodygroup(3,0) + zombie:SetBodygroup(4,0) + end + end + end +hook.Add( "Tick", "NoHeadcrabsTick", RemoveCrabsTick ) + +local function HeadcrabsStay(ent,dmg) +if(headcrabsdontexist) then + if (IsValid(ent) && ((ent:GetClass() == "npc_zombie") || (ent:GetClass() == "npc_zombine") || (ent:GetClass() == "npc_fastzombie") || (ent:GetClass() == "npc_zombie_torso") || (ent:GetClass() == "npc_fastzombie_torso") || (ent:GetClass() == "npc_poisonzombie"))) then + --Get zombie data + local Data = ent:GetSaveTable() + --Check if this shot will kill them + local HP = ent:Health() + if dmg:GetDamage()>=HP then + --We will die, change things that we need to to prevent headcrabs + --increase damage to prevent headcrabs if needed + local MaxHP = Data.max_health or 100 + if dmg:GetDamage()= 25% of MaxHP) + end + dmg:SetDamageType(DMG_SLASH) + --Return modified damage + return dmg + end + end +end +end +hook.Add("EntityTakeDamage", "Headcrabs Stay", HeadcrabsStay) \ No newline at end of file diff --git a/gamemode/realisticdamage.lua b/gamemode/realisticdamage.lua new file mode 100644 index 0000000..df73c9a --- /dev/null +++ b/gamemode/realisticdamage.lua @@ -0,0 +1,42 @@ +CreateConVar( "gc_realisticdamage", 1, SERVER_CAN_EXECUTE, "Enable/Disable realistic damage." ) +forcerealisticdamage = false + +local function AmountOfPlayers() + if(#player.GetHumans() <= 3) then + return 1 + else if((#player.GetHumans() <= 5) && (#player.GetHumans() > 3)) then + return 2 + else if((#player.GetHumans() <= 8) && (#player.GetHumans() > 5)) then + return 4 + else if(#player.GetHumans() > 8) then + return 5 + end + end + end + end +end + + +hook.Add( "ScalePlayerDamage", "realisticPlayerdamageFUNC", function(ply, hitgroup, dmginfo) + if((GetConVarNumber( "gc_realisticdamage" ) != 0) || forcerealisticdamage) then + if(hitgroup == HITGROUP_GENERIC && ply:Armor() == 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.5) end + if(hitgroup == HITGROUP_GENERIC && ply:Armor() > 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.5) end + if(hitgroup == HITGROUP_HEAD && ply:Armor() == 0) then dmginfo:ScaleDamage(AmountOfPlayers()) end + if(hitgroup == HITGROUP_HEAD && ply:Armor() > 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.9) end + if(hitgroup == HITGROUP_CHEST && ply:Armor() == 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.9) end + if(hitgroup == HITGROUP_CHEST && ply:Armor() > 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.7) end + if(hitgroup == HITGROUP_STOMACH && ply:Armor() == 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.9) end + if(hitgroup == HITGROUP_STOMACH && ply:Armor() > 0) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.7) end + if(hitgroup == (HITGROUP_LEFTLEG || HITGROUP_RIGHTLEG || HITGROUP_LEFTARM || HITGROUP_RIGHTARM)) then dmginfo:ScaleDamage(AmountOfPlayers() * 0.5) end + end +end) + +hook.Add( "ScaleNPCDamage", "realisticNPCdamageFUNC", function(npc, hitgroup, dmginfo) + if((GetConVarNumber( "gc_realisticdamage" ) != 0) || forcerealisticdamage) then + if(hitgroup == HITGROUP_HEAD) then dmginfo:ScaleDamage(3 / AmountOfPlayers()) end + if(hitgroup == HITGROUP_CHEST) then dmginfo:ScaleDamage(2 / AmountOfPlayers()) end + if(hitgroup == HITGROUP_STOMACH) then dmginfo:ScaleDamage(2 / AmountOfPlayers()) end + end +end) + + diff --git a/gamemode/shared.lua b/gamemode/shared.lua new file mode 100644 index 0000000..1353692 --- /dev/null +++ b/gamemode/shared.lua @@ -0,0 +1,147 @@ +GM.Name = "Feedc0de's coop Mode" +GM.Author = "0xFEEDC0DE64" +GM.Email = "daniel@brunner.ninja" +GM.Website = "brunner.ninja" + +DeriveGamemode("sandbox") + +include( "levels.lua" ) + +function ChangeRandomLevel(ply,com,arg) + local randomLevel = GetRandomLevel() + print("Changing to random level " .. randomLevel) + RunConsoleCommand( "changelevel", randomLevel ) +end + +function NextRandomLevel(ply,com,arg) + local randomLevel = GetRandomLevel() + print("Setting nextlevel to random " .. randomLevel) + RunConsoleCommand( "nextlevel", randomLevel ) +end + +if (SERVER) then + concommand.Add("randomlevel", ChangeRandomLevel) + concommand.Add("randomnextlevel", NextRandomLevel) +end + +hook.Add( "Initialize", "SetupRandomLevels", function () + print("hatschi2") + timer.Simple( 3600, ChangeRandomLevel ) + NextRandomLevel() + timer.Simple( 0, NextRandomLevel ) +end) + +-- timer.Simple( +-- 1, +-- function() +-- function HideThings(name) +-- if (name == "CHudDamageIndicator" or name == "CHudHintDisplay") then +-- return false +-- end +-- end +-- hook.Add("HUDShouldDraw", "HideThings", HideThings) +-- end +-- ) + +function GM:IsSpawnpointSuitable(ply, spawnpointent, bMakeSuitable) + local Pos = spawnpointent:GetPos() + + -- Note that we're searching the default hull size here for a player in the way of our spawning. + -- This seems pretty rough, seeing as our player's hull could be different.. but it should do the job + -- ( HL2DM kills everything within a 128 unit radius ) + local Ents = ents.FindInBox(Pos + Vector(-16, -16, 0), Pos + Vector(16, 16, 72)) + + if (ply:Team() == TEAM_SPECTATOR or ply:Team() == TEAM_UNASSIGNED) then + return true + end + + local Blockers = 0 + + for k, v in pairs(Ents) do + if (IsValid(v) and v:GetClass() == "player" and v:Alive()) then + Blockers = Blockers + 1 + + if (bMakeSuitable) then + v:SetVelocity(v:GetPos() + Vector(100, 100, 0)) + end + end + end + + if (bMakeSuitable) then + return true + end + if (Blockers > 0) then + return false + end + return true +end + +function GM:PlayerLoadout(ply) + if (not striponspawn) then + ply:Give("weapon_fists") + end +end + +hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", function () + return LocalPlayer():IsAdmin() +end) + +hook.Add( "ContextMenuOpen", "DisallowSpawnMenu", function () + return LocalPlayer():IsAdmin() +end) + +function GM:PlayerNoClip(ply, desiredState) + if desiredState then + return ply:IsAdmin() + else + return true + end +end + +function GM:PlayerDeathSound() + return true +end + +function GM:DrawDeathNotice(x, y) + return false +end + +function GM:PlayerSpawnVehicle(ply, model, name, table) + return ply:IsAdmin() +end + +function GM:PlayerSpawnSWEP(ply, weapon, info) + return ply:IsAdmin() +end + +function GM:PlayerSpawnSENT(ply, class) + return ply:IsAdmin() +end + +function GM:PlayerSpawnRagdoll(ply, model) + return ply:IsAdmin() +end + +function GM:PlayerSpawnProp(ply, model) + return ply:IsAdmin() +end + +function GM:PlayerSpawnObject(ply, model, skin) + return ply:IsAdmin() +end + +function GM:PlayerSpawnNPC(ply, npc_type, weapon) + return ply:IsAdmin() +end + +function GM:PlayerSpawnEffect(ply, model) + return ply:IsAdmin() +end + +function GM:PlayerGiveSWEP(ply, weapon, swep) + return ply:IsAdmin() +end + +--function GM:HUDAmmoPickedUp( item, amount ) +-- return false; +--end diff --git a/gamemode/spawninit.lua b/gamemode/spawninit.lua new file mode 100644 index 0000000..dbf08f3 --- /dev/null +++ b/gamemode/spawninit.lua @@ -0,0 +1,35 @@ +horrormovement = false + +hook.Add( "PlayerSpawn", "SpawningInitialize", function(player) + timer.Simple(0.3,function() + if(player:IsValid()) then + player:SetCollisionGroup(15) + player:SetCanZoom(false) + if(horrormovement) then + player:SetSlowWalkSpeed(120) + player:SetWalkSpeed(180) + player:SetRunSpeed(140) + player:SetMaxSpeed(195) + player:SetJumpPower(150) + else + player:SetSlowWalkSpeed(140) + player:SetWalkSpeed(155) + player:SetRunSpeed(215) + player:SetMaxSpeed(215) + player:SetJumpPower(160) + end + player:ConCommand([[mat_colorcorrection 1]]) + player:ConCommand([[cl_showhints 0]]) + end + end ) + player:SetMoveType(MOVETYPE_WALK) +end ) + +--hook.Add( "PlayerSay", "help", function( ply, text, public ) +-- text = string.lower( text ) -- Make the chat message entirely lowercase +-- local disabled = 0 +-- if ( text == "!help" ) then +-- printHelp(ply) +-- return "" +-- end +--end ) diff --git a/gamemode/weaponsystem.lua b/gamemode/weaponsystem.lua new file mode 100644 index 0000000..00a110a --- /dev/null +++ b/gamemode/weaponsystem.lua @@ -0,0 +1,191 @@ +CreateConVar("gc_respawndistance", 75, SERVER_CAN_EXECUTE, "Item distance to map origin to trigger a respawn") + +hook.Add("PlayerSpawn", "SpawningInitializeAmmo", function(ply) + timer.Simple(0, function() + ply:ShouldDropWeapon(false) + end) +end) + +hook.Add( "OnEntityCreated", "Respawn items", function( ent ) + if not ent:IsValid() then + --print("Ignoring invalid item") + return + end + + local entityClass = ent:GetClass() + + if not string.StartWith(entityClass, "item_") and not string.StartWith(entityClass, "weapon_") then + --print("Ignoring not-item " .. entityClass) + return + end + + timer.Simple(0, function() + if not ent:IsValid() then + -- print("Ignoring invalid item " .. entityClass .. " (from timer)") + return + end + + local entityClass = ent:GetClass() + local entityPos = ent:GetPos() + local entityAngles = ent:GetAngles() + local entityModel = ent:GetModel() + local entityCollisionGroup = ent:GetCollisionGroup() + local entityCreatedByMap = ent:CreatedByMap() + + ent:SetNWBool("blockPickup", true) + ent:SetNWVector("respawnPos", entityPos) + ent:SetNWAngle("respawnAngle", entityAngle) + + ent:CallOnRemove("Respawn", function(ent) + -- print("item " .. entityClass .. " removed!") + + timer.Simple(1, function() + if (entityCreatedByMap) then + entityPos = entityPos + Vector(0, 0, 3) + end + + local ent = ents.Create(entityClass) + ent:SetPos(entityPos) + ent:SetAngles(entityAngles) + ent:SetModel(entityModel) + ent:SetCollisionGroup(entityCollisionGroup) + ent:Spawn() + ent:EmitSound("items/suitchargeok1.wav") + + -- print("item " .. entityClass .. " recreated!") + end) + end) + + local callbackId = ent:AddCallback( "OnAngleChange", function( entity, newangle ) + local distance = entity:GetPos():Distance(entityPos) + + if (distance < GetConVarNumber("gc_respawndistance")) then + return + end + + local callbackId = entity:GetNWInt("callbackId") + entity:RemoveCallback( "OnAngleChange", callbackId ) + + -- print("item " .. entityClass .. " distance: " .. distance .. " callbackId: " .. callbackId) + + timer.Simple(1, function() + if not entity:IsValid() then + return + end + entity:Remove() + end) + end ) + + ent:SetNWInt("callbackId", callbackId) + + -- print("Map item processed: " .. ent:GetClass() .. " pos: " .. entityPos.x .. "," .. entityPos.y .. "," .. entityPos.z) + end) +end ) + +hook.Add("PlayerCanPickupWeapon", "DontPickupIfAlreadyFull", function (ply, weapon) + local className = weapon:GetClass() + + for k, v in pairs(ply:GetWeapons()) do + if (v:GetClass() == className) then + local primaryAmmoType = weapon:GetPrimaryAmmoType() + local secondaryAmmoType = weapon:GetSecondaryAmmoType() + local primaryAmmoCount = ply:GetAmmoCount(primaryAmmoType) + local secondaryAmmoCount = ply:GetAmmoCount(secondaryAmmoType) + local vClip1 = v:Clip1() + local vClip2 = v:Clip2() + local vMaxClip1 = v:GetMaxClip1() + local vMaxClip2 = v:GetMaxClip2() + + if ply:KeyDown(IN_USE) then + ply:ChatPrint(className .. ": vClip1:" .. vClip1 .. " maxClip1:" .. vMaxClip1 .. " vClip2:" .. vClip2.. " maxClip2:" .. vMaxClip2 .. + " playerClip1:" .. primaryAmmoCount .. " playerClip2:" .. secondaryAmmoCount .. + " wClip1:" .. weapon:Clip1() .. " wClip2:" .. weapon:Clip2()) + end + + local blacklist = { + "weapon_crowbar", + "weapon_fists", + "weapon_frag", + "weapon_rpg" + } + + local whitelist = { + "weapon_pistol", + "weapon_357" + } + + if (table.HasValue(blacklist, className)) then + local gave = false + if (vMaxClip1 < 0 and primaryAmmoCount < 15) then + local amountToGive = 15 - primaryAmmoCount + ply:GiveAmmo(amountToGive, primaryAmmoType) + --ply:ChatPrint(className .. " give1 " .. amountToGive .. " primary (" .. vClip1 .. "/" .. primaryAmmoCount .. "/" .. vMaxClip1 .. ")") + gave = true + end + if (vMaxClip2 < 0 and secondaryAmmoCount < 15) then + local amountToGive = 15 - secondaryAmmoCount + ply:GiveAmmo(amountToGive, secondaryAmmoType) + --ply:ChatPrint(className .. " give1 " .. amountToGive .. " secondary (" .. vClip2 .. "/" .. secondaryAmmoCount .. "/" .. vMaxClip2 .. ")") + gave = true + end + if gave then + return table.HasValue(whitelist, className) + end + end + + if primaryAmmoCount >= vMaxClip1 and secondaryAmmoCount >= vMaxClip2 then + return false + else + if primaryAmmoCount < vMaxClip1 then + ply:GiveAmmo(math.min(weapon:Clip1(), vMaxClip1 - primaryAmmoCount), primaryAmmoType) + --ply:ChatPrint(className .. " give2 " .. math.min(weapon:Clip1(), vMaxClip1 - primaryAmmoCount) .. " primary") + end + if secondaryAmmoCount < vMaxClip2 then + ply:GiveAmmo(math.min(weapon:Clip2(), vMaxClip2 - secondaryAmmoCount), secondaryAmmoType) + --ply:ChatPrint(className .. " give2 " .. math.min(weapon:Clip2(), vMaxClip2 - secondaryAmmoCount) .. " secondary") + end + + return table.HasValue(whitelist, className) + end + end + end + + return true +end) + +hook.Add( "WeaponEquip", "RespawnOnCollected", function(weapon, ply) + -- print("WeaponEquip " .. weapon:GetClass()) + + local entityClass = weapon:GetClass() + local entityPos = weapon:GetNWVector("respawnPos") + local entityAngles = weapon:GetNWAngle("respawnAngle") + local entityModel = weapon:GetModel() + local entityCollisionGroup = weapon:GetCollisionGroup() + local entityCreatedByMap = weapon:CreatedByMap() + + timer.Simple(1, function() + if (entityCreatedByMap) then + entityPos = entityPos + Vector(0, 0, 3) + end + + local ent = ents.Create(entityClass) + ent:SetPos(entityPos) + ent:SetAngles(entityAngles) + ent:SetModel(entityModel) + ent:SetCollisionGroup(entityCollisionGroup) + ent:Spawn() + ent:EmitSound("items/suitchargeok1.wav") + + -- print("item " .. entityClass .. " recreated!") + end) + + --if (weapon:GetClass() == "weapon_crowbar") then + -- if (ply:HasWeapon("weapon_fists")) then + -- ply:StripWeapon("weapon_fists") + -- end + --end +end) + +hook.Add("AllowPlayerPickup", "some_unique_name", function (ply, ent) + return not ent:GetNWBool("blockPickup") +end) diff --git a/gamemode/zombies.lua b/gamemode/zombies.lua new file mode 100644 index 0000000..d05f324 --- /dev/null +++ b/gamemode/zombies.lua @@ -0,0 +1,37 @@ +CreateConVar( "gc_realzombies", 1, SERVER_CAN_EXECUTE, "Zombies have a chance to kill you instantly." ) +forcerealisticzombies = false + +hook.Add( "PlayerHurt", "ZombieHurtFunction", function( victim, attacker, healthRemaining, damageTaken ) +if((GetConVarNumber( "gc_realzombies" ) != 0) || forcerealisticzombies) then + if(attacker:GetClass() == "npc_zombie") then + victim:SetHealth(healthRemaining - 40) + end + + if(attacker:GetClass() == "npc_zombine") then + victim:SetHealth(healthRemaining - 30) + end + + if(attacker:GetClass() == "npc_zombie_torso") then + victim:SetHealth(healthRemaining - 25) + end + + if(attacker:GetClass() == "npc_fastzombie_torso") then + victim:SetHealth(healthRemaining - 27) + end + + if(attacker:GetClass() == "npc_fastzombie") then + if(damageTaken == 3) then + victim:SetHealth(healthRemaining - 12) + else if(damageTaken == 5) then + victim:SetHealth(healthRemaining - 35) + end + end + end + + if(attacker:GetClass() == "npc_poisonzombie") then + victim:SetHealth(healthRemaining - 40) + end +end +end) + + diff --git a/icon24.png b/icon24.png new file mode 100644 index 0000000..2fa9e54 Binary files /dev/null and b/icon24.png differ diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..b7be18b Binary files /dev/null and b/logo.png differ