diff --git a/src/server/item_pickup.qc b/src/server/item_pickup.qc deleted file mode 100644 index 03f8000..0000000 --- a/src/server/item_pickup.qc +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2016-2020 Marco Cawthorne - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -void item_pickup::Touch(entity eToucher) -{ - bool isDeathmatch = false; - - if (eToucher.classname != "player") { - return; - } - - /* don't remove if AddItem fails */ - if (Weapons_AddItem((player)eToucher, id, m_iClip) == FALSE) { - return; - } - - if (cvar("deathmatch") == 1 || cvar("deathmatch") == 2) - isDeathmatch = true; - - Logging_Pickup(eToucher, this, __NULL__); - Sound_Play(other, CHAN_ITEM, "dmc_weapon.pickup"); - - UseTargets(eToucher, TRIG_TOGGLE, m_flDelay); - - if (real_owner || m_iWasDropped == 1 || isDeathmatch == false) { - Destroy(); - } else { - Disappear(); - ScheduleThink(PickupRespawn, 30.0f); - } -} - -void item_pickup::SetItem(int i) -{ - id = i; - m_oldModel = Weapons_GetWorldmodel(id); - SetModel(GetSpawnModel()); - SetSize([-16,-16,0], [16,16,16]); -} - -void item_pickup::SetFloating(int i) -{ - m_bFloating = rint(bound(0, m_bFloating, 1)); -} - -void -item_pickup::PickupRespawn(void) -{ - Respawn(); - Sound_Play(this, CHAN_ITEM, "dmc_item.respawn"); -} - -void item_pickup::Respawn(void) -{ - SetSolid(SOLID_TRIGGER); - SetOrigin(GetSpawnOrigin()); - botinfo = BOTINFO_WEAPON; - modelflags = MF_ROTATE; - - /* At some points, the item id might not yet be set */ - if (GetSpawnModel()) { - SetModel(GetSpawnModel()); - } - - SetSize([-16,-16,0], [16,16,16]); - ReleaseThink(); - - if (!m_bFloating) { - DropToFloor(); - SetMovetype(MOVETYPE_TOSS); - } -} - -void -item_pickup::Spawned(void) -{ - super::Spawned(); - - Sound_Precache("dmc_item.respawn"); - Sound_Precache("dmc_weapon.pickup"); -} - -void item_pickup::item_pickup(void) -{ -} diff --git a/src/server/progs.src b/src/server/progs.src index 7ca212f..100f6c3 100644 --- a/src/server/progs.src +++ b/src/server/progs.src @@ -55,7 +55,7 @@ defs.h ../../../valve/src/server/monster_zombie.qc ../../../valve/src/server/player.qc -item_pickup.qc +../../../valve/src/server/items.qc ../../../valve/src/server/item_longjump.qc ../../../valve/src/server/item_suit.qc ../../../valve/src/server/item_healthkit.qc diff --git a/src/shared/w_grenadelauncher.qc b/src/shared/w_grenadelauncher.qc index b9b401c..0baf7ad 100644 --- a/src/shared/w_grenadelauncher.qc +++ b/src/shared/w_grenadelauncher.qc @@ -257,11 +257,3 @@ w_grenadelauncher = .type = w_grenadelauncher_type, .hudpic = w_grenadelauncher_hudpic }; - -#ifdef SERVER -void -weapon_grenadelauncher(void) -{ - Weapons_InitItem(WEAPON_GRENADELAUNCHER); -} -#endif diff --git a/src/shared/w_lightning.qc b/src/shared/w_lightning.qc index 1e1627e..eb6f89d 100644 --- a/src/shared/w_lightning.qc +++ b/src/shared/w_lightning.qc @@ -391,11 +391,3 @@ weapon_t w_lightning = .hudpic = w_lightning_hudpic, .predraw = w_lightning_postdraw }; - -#ifdef SERVER -void -weapon_lightning(void) -{ - Weapons_InitItem(WEAPON_LIGHTNING); -} -#endif diff --git a/src/shared/w_nailgun.qc b/src/shared/w_nailgun.qc index c95a802..1c54531 100644 --- a/src/shared/w_nailgun.qc +++ b/src/shared/w_nailgun.qc @@ -242,12 +242,3 @@ weapon_t w_nailgun = .type = w_nailgun_type, .hudpic = w_nailgun_hudpic }; - -/* pickups */ -#ifdef SERVER -void -weapon_nailgun(void) -{ - Weapons_InitItem(WEAPON_NAILGUN); -} -#endif diff --git a/src/shared/w_rocketlauncher.qc b/src/shared/w_rocketlauncher.qc index d397e3b..18175ac 100644 --- a/src/shared/w_rocketlauncher.qc +++ b/src/shared/w_rocketlauncher.qc @@ -237,12 +237,4 @@ w_rocketlauncher = .isempty = w_rocketlauncher_isempty, .type = w_rocketlauncher_type, .hudpic = w_rocketlauncher_hudpic -}; - -#ifdef SERVER -void -weapon_rocketlauncher(void) -{ - Weapons_InitItem(WEAPON_ROCKETLAUNCHER); -} -#endif +}; \ No newline at end of file diff --git a/src/shared/w_shotgun.qc b/src/shared/w_shotgun.qc index 5e2c15f..646f037 100644 --- a/src/shared/w_shotgun.qc +++ b/src/shared/w_shotgun.qc @@ -229,7 +229,3 @@ weapon_t w_shotgun = .type = w_shotgun_type, .hudpic = w_shotgun_hudpic }; - -#ifdef SERVER - -#endif diff --git a/src/shared/w_supernailgun.qc b/src/shared/w_supernailgun.qc index 063bae0..aaaba0e 100644 --- a/src/shared/w_supernailgun.qc +++ b/src/shared/w_supernailgun.qc @@ -229,12 +229,4 @@ weapon_t w_supernailgun = .isempty = w_supernailgun_isempty, .type = w_supernailgun_type, .hudpic = w_supernailgun_hudpic -}; - -#ifdef SERVER -void -weapon_supernailgun(void) -{ - Weapons_InitItem(WEAPON_SUPERNAILGUN); -} -#endif +}; \ No newline at end of file diff --git a/src/shared/w_supershotgun.qc b/src/shared/w_supershotgun.qc index 0d17ed3..4ab283d 100644 --- a/src/shared/w_supershotgun.qc +++ b/src/shared/w_supershotgun.qc @@ -245,13 +245,4 @@ weapon_t w_supershotgun = .isempty = w_supershotgun_isempty, .type = w_supershotgun_type, .hudpic = w_supershotgun_hudpic -}; - -/* pickups */ -#ifdef SERVER -void -weapon_supershotgun(void) -{ - Weapons_InitItem(WEAPON_SUPERSHOTGUN); -} -#endif +}; \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_grenadelauncher.def b/zpak001.pk3dir/def/weapon_grenadelauncher.def new file mode 100644 index 0000000..6488ec7 --- /dev/null +++ b/zpak001.pk3dir/def/weapon_grenadelauncher.def @@ -0,0 +1,15 @@ +entityDef weapon_grenadelauncher +{ + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Grenade Launcher" + "editor_rotatable" "1" + + "spawnclass" "NSItem" + "model" "models/g_rock.mdl" + "inv_item" "6" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" +} \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_lightning.def b/zpak001.pk3dir/def/weapon_lightning.def new file mode 100644 index 0000000..d46898f --- /dev/null +++ b/zpak001.pk3dir/def/weapon_lightning.def @@ -0,0 +1,15 @@ +entityDef weapon_lightning +{ + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Lightning Gun" + "editor_rotatable" "1" + + "spawnclass" "NSItem" + "model" "models/g_light.mdl" + "inv_item" "8" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" +} \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_nailgun.def b/zpak001.pk3dir/def/weapon_nailgun.def new file mode 100644 index 0000000..d2080a8 --- /dev/null +++ b/zpak001.pk3dir/def/weapon_nailgun.def @@ -0,0 +1,15 @@ +entityDef weapon_nailgun +{ + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Nailgun" + "editor_rotatable" "1" + + "spawnclass" "NSItem" + "model" "models/g_nail.mdl" + "inv_item" "4" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" +} \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_rocketlauncher.def b/zpak001.pk3dir/def/weapon_rocketlauncher.def new file mode 100644 index 0000000..0f502b0 --- /dev/null +++ b/zpak001.pk3dir/def/weapon_rocketlauncher.def @@ -0,0 +1,15 @@ +entityDef weapon_rocketlauncher +{ + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Rocket Launcher" + "editor_rotatable" "1" + + "spawnclass" "NSItem" + "model" "models/g_rock2.mdl" + "inv_item" "7" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" +} \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_supernailgun.def b/zpak001.pk3dir/def/weapon_supernailgun.def new file mode 100644 index 0000000..c489d78 --- /dev/null +++ b/zpak001.pk3dir/def/weapon_supernailgun.def @@ -0,0 +1,15 @@ +entityDef weapon_supernailgun +{ + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Super Nailgun" + "editor_rotatable" "1" + + "spawnclass" "NSItem" + "model" "models/g_nail2.mdl" + "inv_item" "5" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" +} \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_supershotgun.def b/zpak001.pk3dir/def/weapon_supershotgun.def new file mode 100644 index 0000000..cfb7075 --- /dev/null +++ b/zpak001.pk3dir/def/weapon_supershotgun.def @@ -0,0 +1,15 @@ +entityDef weapon_supershotgun +{ + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Super Shotgun" + "editor_rotatable" "1" + + "spawnclass" "NSItem" + "model" "models/g_shot2.mdl" + "inv_item" "3" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" +} \ No newline at end of file