2023-07-16 16:06:57 +00:00
|
|
|
/*
|
|
|
|
server/weapons/grenade_launcher.qc
|
|
|
|
|
|
|
|
Core logic for the Ray Gun special weapon.
|
|
|
|
Modified from Unofficial Patch implementation.
|
|
|
|
|
|
|
|
Copyright (C) 2021-2023 NZ:P Team
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
void() GrenadeExplode;
|
|
|
|
|
|
|
|
//
|
|
|
|
// W_FireGrenade()
|
|
|
|
// Called by weapon_core for the Grenade firetype. Sets up the
|
|
|
|
// nade and prepares it for impact and force forward.
|
|
|
|
//
|
|
|
|
void(float side) W_FireGrenade =
|
|
|
|
{
|
|
|
|
entity nade = spawn();
|
|
|
|
nade.owner = self;
|
|
|
|
nade.movetype = MOVETYPE_BOUNCE;
|
|
|
|
nade.solid = SOLID_BBOX;
|
2023-09-12 03:21:46 +00:00
|
|
|
nade.classname = "projectile_grenade";
|
2023-07-16 16:06:57 +00:00
|
|
|
|
|
|
|
makevectors (self.v_angle);
|
|
|
|
|
2023-07-16 16:16:26 +00:00
|
|
|
nade.velocity = v_forward*3000;
|
2023-07-16 16:06:57 +00:00
|
|
|
nade.avelocity = '50 -50 50';
|
|
|
|
|
|
|
|
nade.touch = GrenadeExplode;
|
|
|
|
setsize(nade, '0 0 0', '0 0 0');
|
|
|
|
nade.origin = self.origin + self.view_ofs;
|
|
|
|
|
|
|
|
setorigin(nade, nade.origin);
|
2023-10-27 18:35:44 +00:00
|
|
|
|
|
|
|
#ifdef FTE
|
|
|
|
|
|
|
|
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
|
|
|
WriteByte(MSG_MULTICAST, EVENT_PISTOLFIRE);
|
|
|
|
WriteEntity(MSG_MULTICAST, self);
|
|
|
|
WriteFloat(MSG_MULTICAST, side);
|
|
|
|
WriteCoord(MSG_MULTICAST, 0);
|
|
|
|
WriteCoord(MSG_MULTICAST, 0);
|
|
|
|
WriteCoord(MSG_MULTICAST, 0);
|
|
|
|
WriteCoord(MSG_MULTICAST, 0);
|
|
|
|
WriteCoord(MSG_MULTICAST, 0);
|
|
|
|
WriteCoord(MSG_MULTICAST, 0);
|
|
|
|
WriteEntity(MSG_MULTICAST, world);
|
|
|
|
multicast(self.origin, MULTICAST_PHS);
|
|
|
|
|
|
|
|
#endif // FTE
|
2023-07-16 16:06:57 +00:00
|
|
|
}
|