diff options
author | enneract <trem.redman@gmail.com> | 2014-11-19 19:57:31 +0100 |
---|---|---|
committer | enneract <trem.redman@gmail.com> | 2014-11-19 19:57:31 +0100 |
commit | 9e0e1eeeb964f1eaf94622399695e4b4a2d0f1db (patch) | |
tree | a13681a4560d2a9884ca18ec75efc3291cfda50c /src/game/g_missile.c | |
parent | 2a93a38bfa8feab7e7f9be7332f75f2d2b0036e7 (diff) |
Implement the Rocket Launcher.
Diffstat (limited to 'src/game/g_missile.c')
-rw-r--r-- | src/game/g_missile.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/game/g_missile.c b/src/game/g_missile.c index 74ee72b..959067e 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -965,6 +965,47 @@ gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir, return bolt; } + +/* +================= +fire_rocket +================= +*/ +gentity_t *fire_rocket( gentity_t *self, vec3_t start, vec3_t dir ) +{ + gentity_t *bolt; + + VectorNormalize (dir); + + bolt = G_Spawn(); + bolt->classname = "rocket"; + bolt->pointAgainstWorld = qtrue; + bolt->nextthink = level.time + 10000; + bolt->think = G_ExplodeMissile; + bolt->s.eType = ET_MISSILE; + bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; + bolt->s.weapon = WP_ROCKET_LAUNCHER; + bolt->s.generic1 = self->s.generic1; //weaponMode + bolt->r.ownerNum = self->s.number; + bolt->parent = self; + bolt->damage = ROCKETL_DAMAGE; + bolt->splashDamage = ROCKETL_DAMAGE / 2; + bolt->splashRadius = ROCKETL_RADIUS; + bolt->methodOfDeath = MOD_ROCKETL; + bolt->splashMethodOfDeath = MOD_ROCKETL_SPLASH; + bolt->clipmask = MASK_SHOT; + bolt->target_ent = NULL; + bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -ROCKETL_SIZE; + bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = ROCKETL_SIZE; + bolt->s.pos.trType = TR_LINEAR; + bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame + VectorCopy( start, bolt->s.pos.trBase ); + VectorScale( dir, ROCKETL_SPEED, bolt->s.pos.trDelta ); + SnapVector( bolt->s.pos.trDelta ); // save net bandwidth + VectorCopy( start, bolt->r.currentOrigin ); + return bolt; +} + /* ================= launch_grenade |