diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-06-28 21:06:06 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-06-28 21:06:06 +0200 |
commit | 93d2e4414ee25e417ee0d2ca0248448002ea4d5b (patch) | |
tree | f8a5884f09d7396bd04f4b356767230144f50d3a /src/game/g_missile.c | |
parent | 5904b538d7fd639429a450b0ad7928cd311213fd (diff) |
Remove all code and assets related to Mine, Smoke and Flames.
Diffstat (limited to 'src/game/g_missile.c')
-rw-r--r-- | src/game/g_missile.c | 355 |
1 files changed, 2 insertions, 353 deletions
diff --git a/src/game/g_missile.c b/src/game/g_missile.c index 1894f94..5dd9725 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -48,26 +48,8 @@ void G_BounceMissile( gentity_t *ent, trace_t *trace ) if( ent->s.eFlags & EF_BOUNCE_HALF ) { - - if(!strcmp(ent->classname,"mine")) { - VectorScale( ent->s.pos.trDelta, 0.00, ent->s.pos.trDelta ); - if( VectorLength( ent->s.pos.trDelta ) < 40 ) - { - G_SetOrigin( ent, trace->endpos ); - return; - } - } - if(!strcmp(ent->classname,"flames")) { - VectorScale( ent->s.pos.trDelta, 0.00, ent->s.pos.trDelta ); - if( VectorLength( ent->s.pos.trDelta ) < 40 ) - { - G_SetOrigin( ent, trace->endpos ); - return; - } - } - else { - VectorScale( ent->s.pos.trDelta, 0.65, ent->s.pos.trDelta ); - } + VectorScale( ent->s.pos.trDelta, 0.65, ent->s.pos.trDelta ); + // check for stop if( trace->plane.normal[ 2 ] > 0.2 && VectorLength( ent->s.pos.trDelta ) < 40 ) { @@ -169,17 +151,6 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) other->client->ps.stats[ STAT_VIEWLOCK ] = DirToByte( dir ); } } - else if( !strcmp( ent->classname, "mine")) - { - //grenade doesn't explode on impact - G_BounceMissile( ent, trace ); - //only play a sound if requested - if( !other->client && !( ent->s.eFlags & EF_NO_BOUNCE_SOUND )) - { - G_AddEvent( ent, EV_MINE_BOUNCE, 0 ); - } - return; - } else if( !strcmp( ent->classname, "acidbomb" ) ) { //bomb doesn't explode on impact @@ -424,143 +395,6 @@ void G_RunMissile( gentity_t *ent ) G_RunThink( ent ); } - -/* -================ -G_ProcessFlamerFlames -Spreads flames all over the place -================ -*/ -void G_ProcessFlamerFlames(gentity_t *ent) -{ - int i, total_entities, entityList[MAX_GENTITIES]; - vec3_t range, mins, maxs; - gentity_t *target; - - if (level.time > ent->s.time + 11000) - { - ent->nextthink = level.time; - ent->think = G_ExplodeMissile; - return; - } - trap_LinkEntity( ent ); - // Set the next time to run this check (can be overwritten below) - ent->nextthink = level.time + 400; - // Grab all entities around us - VectorSet(range, FLAMES_DETECT, FLAMES_DETECT, FLAMES_DETECT); - VectorAdd(ent->s.origin, range, maxs); - VectorSubtract(ent->s.origin, range, mins); - total_entities = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES); - // Loop entities looking for an enemy body - for(i=0; i<total_entities; i++) { - target = &g_entities[entityList[i]]; - if(target->client) { - if (G_Visible( ent, target, MASK_SHOT )) - { - G_Damage( target, ent, ent->parent, NULL, ent->s.origin, ent->damage/3, 0, ent->methodOfDeath ); - return; - } - } - } -} - - -/* -================ -G_ProcessSmoke -================ -*/ -void G_ProcessSmoke(gentity_t *ent) { - // int i, total_entities, entityList[MAX_GENTITIES]; - // vec3_t range, mins, maxs; - // gentity_t *target; - if (level.time > ent->s.time + 30000) - { - ent->nextthink = level.time + 100; - ent->think = G_ExplodeMissile; - return; - } - // Set the next time to run this check (can be overwritten below) - ent->nextthink = level.time + SMOKE_CHECK_FREQUENCY; -} - -/* -================ -G_ProcessMine -If an enemy is close to the entity, go boom! -================ -*/ -void G_ProcessMine(gentity_t *ent) { - int i, total_entities, entityList[MAX_GENTITIES]; - vec3_t range, mins, maxs; - gentity_t *target; - - // Set the next time to run this check (can be overwritten below) - ent->nextthink = level.time + MINE_CHECK_FREQUENCY; - - // Grab all entities around us - VectorSet(range, MINE_DETECT, MINE_DETECT, MINE_DETECT); - VectorAdd(ent->s.origin, range, maxs); - VectorSubtract(ent->s.origin, range, mins); - - total_entities = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES); - - // Loop entities looking for an enemy body - for(i=0; i<total_entities; i++) { - target = &g_entities[entityList[i]]; - if(target->client && - target->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS/* && - target->client->ps.weapon > WP_ALEVEL1_UPG */) - { - if (G_Visible( ent, target, MASK_SHOT )) - { - // Found an enemy, boom time! - ent->nextthink = level.time + MINE_BOOM_TIME; - ent->think = G_ExplodeMissile; - return; - } - } - } -} - -/* -================= -launch_grenade_flames -================= -*/ -gentity_t *launch_grenade_flames( gentity_t *self, vec3_t start, vec3_t dir ) -{ - gentity_t *bolt; - VectorNormalize( dir ); - bolt = G_Spawn( ); - bolt->classname = "flames"; - bolt->nextthink = level.time + 5000; - bolt->think = G_ProcessFlamerFlames; - bolt->s.eType = ET_MISSILE; - bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.eFlags = EF_NO_BOUNCE_SOUND; - bolt->s.generic1 = WPM_PRIMARY; //weaponMode - bolt->r.ownerNum = self->s.number; - bolt->parent = self; - bolt->damage = 3; - bolt->splashDamage = 0; - bolt->splashRadius = 0; - bolt->methodOfDeath = MOD_FLAMES; - bolt->splashMethodOfDeath = MOD_FLAMES; - bolt->clipmask = MASK_SHOT; - bolt->target_ent = NULL; - bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -3.0f; - bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 3.0f; - bolt->s.time = level.time; - bolt->s.pos.trType = TR_GRAVITY; - 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, NADEFLAMES_SPEED, bolt->s.pos.trDelta ); - SnapVector( bolt->s.pos.trDelta ); // save net bandwidth - VectorCopy( start, bolt->r.currentOrigin ); - return bolt; -} - /* ================= FlameTurretFireNormal @@ -601,145 +435,6 @@ gentity_t *FlameTurretFireNormal( gentity_t *self, vec3_t start, vec3_t dir ) return bolt; } - -/* -================= -NapalmChargeFire -Naplam charge for Flamer -================= -*/ -gentity_t *NapalmChargeFire( gentity_t *self, vec3_t start, vec3_t dir, - int damage, int radius, int speed ) -{ - gentity_t *bolt; - float charge; - vec3_t pvel; - VectorNormalize( dir ); - bolt = G_Spawn( ); - bolt->classname = "lcannon"; - bolt->pointAgainstWorld = qtrue; - bolt->think = G_ExplodeMissile; - bolt->s.eType = ET_MISSILE; - bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.weapon = WP_FLAMER; - bolt->s.generic1 = self->s.generic1; //weaponMode - bolt->r.ownerNum = self->s.number; - bolt->parent = self; - bolt->damage = damage / 1.7; - bolt->splashDamage = damage / 5.2; - bolt->splashRadius = damage / 1.1 ; - bolt->methodOfDeath = MOD_FLAMES; - bolt->splashMethodOfDeath = MOD_FLAMER_SPLASH; - bolt->clipmask = MASK_SHOT; - bolt->target_ent = NULL; - bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -LCANNON_SIZE; - bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = -bolt->r.mins[ 0 ]; - // Pass the missile charge through - charge = (float)( damage - LCANNON_SECONDARY_DAMAGE ) / LCANNON_DAMAGE; - bolt->s.torsoAnim = charge * 255; - if( bolt->s.torsoAnim < 0 ) - bolt->s.torsoAnim = 0; - bolt->s.pos.trType = TR_GRAVITY; - bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame - - VectorCopy( start, bolt->s.pos.trBase ); - VectorScale( self->client->ps.velocity, FLAMER_LAG, pvel ); - VectorMA( pvel, FLAMER_SPEED+(damage*4), dir, bolt->s.pos.trDelta ); - SnapVector( bolt->s.pos.trDelta ); // save net bandwidth - VectorCopy( start, bolt->r.currentOrigin ); - return bolt; -} - -/* -================= -NapalmChargeImp -Fire field for Napalm -================= -*/ -gentity_t *NapalmChargeImp( gentity_t *self, vec3_t start, vec3_t dir, - int damage, int radius, int speed ) -{ - gentity_t *bolt; - vec3_t pvel; - float charge; - VectorNormalize( dir ); - - bolt = G_Spawn( ); - bolt->classname = "flames"; - bolt->nextthink = level.time; - bolt->think = G_ProcessFlamerFlames; - bolt->s.eType = ET_MISSILE; - bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.eFlags = EF_BOUNCE_HALF; - bolt->s.generic1 = WPM_PRIMARY; //weaponMode - bolt->r.ownerNum = self->s.number; - bolt->parent = self; - bolt->damage = damage /8 ; - bolt->splashDamage = 0; - bolt->splashRadius = 0; - bolt->methodOfDeath = MOD_FLAMES; - bolt->splashMethodOfDeath = MOD_FLAMES; - bolt->clipmask = MASK_SHOT; - bolt->target_ent = NULL; - bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -5.0f; - bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 5.0f; - charge = (float)( damage - LCANNON_SECONDARY_DAMAGE ) / LCANNON_DAMAGE; - bolt->s.torsoAnim = charge * 255; - if( bolt->s.torsoAnim < 0 ) - bolt->s.torsoAnim = 0; - bolt->s.time = level.time; - bolt->s.pos.trType = TR_GRAVITY; - bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame - VectorCopy( start, bolt->s.pos.trBase ); - VectorScale( self->client->ps.velocity, FLAMER_LAG, pvel ); - VectorMA( pvel, FLAMER_SPEED+(damage*4), dir, bolt->s.pos.trDelta ); - SnapVector( bolt->s.pos.trDelta ); // save net bandwidth - VectorCopy( start, bolt->r.currentOrigin ); - return bolt; -} - -/* -================= -FireBreath_fire -================= -*/ -gentity_t *FireBreath_fire( gentity_t *self, vec3_t start, vec3_t dir, - int damage, int radius, int speed ) -{ - gentity_t *bolt; - vec3_t pvel; - VectorNormalize( dir ); - bolt = G_Spawn( ); - bolt->classname = "flames"; - bolt->pointAgainstWorld = qtrue; - bolt->think = G_ExplodeMissile; - bolt->s.eType = ET_MISSILE; - bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.weapon = WP_ALEVEL4; - bolt->s.generic1 = WPM_TERTIARY; //weaponMode - bolt->r.ownerNum = self->s.number; - bolt->parent = self; - bolt->damage = LEVEL4_FIREBREATHDMG; - bolt->splashDamage = 60; - bolt->splashRadius = 250 ; - bolt->methodOfDeath = MOD_LEVEL4_FLAMES; - bolt->splashMethodOfDeath = MOD_LEVEL4_FLAMES; - bolt->clipmask = MASK_SHOT; - bolt->target_ent = NULL; - - // Give the missile a big bounding box - bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -(25); - bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = (25); - 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( self->client->ps.velocity, FLAMER_LAG, pvel ); - VectorMA( pvel, LEVEL4_FIREBREATHSPEED, dir, bolt->s.pos.trDelta ); - SnapVector( bolt->s.pos.trDelta ); // save net bandwidth - VectorCopy( start, bolt->r.currentOrigin ); - return bolt; -} - /* ================= FlamerNormalFire @@ -1477,52 +1172,6 @@ gentity_t *fire_slowBlob( gentity_t *self, vec3_t start, vec3_t dir ) return bolt; } - -void mine_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ) -{ - self->nextthink = level.time + MINE_BOOM_TIME; - self->think = G_ExplodeMissile; -} - -gentity_t *launch_mine( gentity_t *self, vec3_t start, vec3_t dir ) -{ - gentity_t *bolt; - VectorNormalize( dir ); - bolt = G_Spawn( ); - bolt->classname = "mine"; - /* bolt->nextthink = level.time + MINE_INIT_TIME; - bolt->think = G_ProcessMine; */ - bolt->nextthink = level.time + 5000; - bolt->think = G_ExplodeMissile; - bolt->s.eType = ET_MISSILE; - bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.weapon = WP_MINE; - bolt->s.eFlags = EF_BOUNCE_HALF; - bolt->s.generic1 = WPM_PRIMARY; //weaponMode - bolt->r.ownerNum = self->s.number; - bolt->parent = self; - bolt->damage = MINE_DAMAGE; - bolt->splashDamage = MINE_DAMAGE; - bolt->splashRadius = MINE_RANGE; - bolt->methodOfDeath = MOD_MINE; - bolt->splashMethodOfDeath = MOD_MINE; - bolt->clipmask = MASK_SHOT; - bolt->takedamage = MINE_TAKEDAMAGE; - bolt->health = MINE_HEALTH; - bolt->die = mine_die; - bolt->target_ent = NULL; - bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -3.0f; - bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 3.0f; - bolt->s.time = level.time; - bolt->s.pos.trType = TR_GRAVITY; - 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, MINE_SPEED, bolt->s.pos.trDelta ); - SnapVector( bolt->s.pos.trDelta ); // save net bandwidth - VectorCopy( start, bolt->r.currentOrigin ); - return bolt; -} - /* ================= Prickles_Fire |