mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-15 16:51:36 +00:00
54 lines
No EOL
1.4 KiB
C++
54 lines
No EOL
1.4 KiB
C++
/*
|
|
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;
|
|
nade.classname = "explosiveNade";
|
|
|
|
makevectors (self.v_angle);
|
|
|
|
nade.velocity = v_forward*3000;
|
|
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);
|
|
} |