From c24c98e51210879202c4c275831afb72b4eb69ff Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:16:30 +0000 Subject: * Acid tube animation fixed (used to include part of dying animation!) * Acid tube splash damage (from exploding) separated from attack damage, new variable added to tremulous.h to control that and the animation * Class X not allowed at stage # fixed to show the right stage number * Whether or not the mass driver will shoot through objects can be toggled from tremulous.h, don't forget to save g_weapons.c or 'make clean' to get the change compiled! --- src/game/bg_misc.c | 2 +- src/game/g_buildable.c | 47 +++++++++++++++++++++-------------------------- src/game/g_cmds.c | 2 +- src/game/g_weapon.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/game/tremulous.h | 9 ++++++--- 5 files changed, 76 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 1c6e18e7..79ff31d5 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -173,7 +173,7 @@ buildableAttributes_t bg_buildableList[ ] = ACIDTUBE_REGEN, //int regenRate; ACIDTUBE_SPLASHDAMAGE, //int splashDamage; ACIDTUBE_SPLASHRADIUS, //int splashRadius; - MOD_ATUBE, //int meansOfDeath; + MOD_ASPAWN, //int meansOfDeath; BIT_ALIENS, //int team; ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index ad2ece9e..43a5dfd8 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -765,11 +765,15 @@ void AOvermind_Think( gentity_t *self ) G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse ); } } - + // just in case an egg finishes building after we tell overmind to stfu if( level.numAlienSpawns > 0 ) level.overmindMuted = qfalse; + // shut up during intermission + if( level.intermissiontime ) + level.overmindMuted = qtrue; + //low on spawns if( !level.overmindMuted && level.numAlienSpawns <= 0 && level.time > self->overmindSpawnsTimer ) @@ -1104,30 +1108,25 @@ Damage function for Alien Acid Tube */ void AAcidTube_Damage( gentity_t *self ) { - if( self->spawned ) + if( !self->spawned || self->health <= 0 ) { - if( !( self->s.eFlags & EF_FIRING ) ) - { - self->s.eFlags |= EF_FIRING; - G_AddEvent( self, EV_ALIEN_ACIDTUBE, DirToByte( self->s.origin2 ) ); - } - - if( ( self->timestamp + ACIDTUBE_REPEAT ) > level.time ) - self->think = AAcidTube_Damage; - else - { - self->think = AAcidTube_Think; - self->s.eFlags &= ~EF_FIRING; - } - - //do some damage - G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage, - self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS ); + AAcidTube_Think( self ); + return; } + if( level.time >= self->timestamp + ACIDTUBE_REPEAT_ANIM ) + { + self->timestamp = level.time; + G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse ); + G_AddEvent( self, EV_ALIEN_ACIDTUBE, DirToByte( self->s.origin2 ) ); + } + G_SelectiveRadiusDamage( self->s.pos.trBase, self, ACIDTUBE_DAMAGE, + ACIDTUBE_RANGE, self, MOD_ATUBE, PTE_ALIENS ); + G_CreepSlow( self ); - - self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex ); + + self->think = AAcidTube_Think; + self->nextthink = level.time + ACIDTUBE_REPEAT; } /* @@ -1159,7 +1158,6 @@ void AAcidTube_Think( gentity_t *self ) if( self->spawned && G_FindOvermind( self ) ) { - //do some damage num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); for( i = 0; i < num; i++ ) { @@ -1170,11 +1168,8 @@ void AAcidTube_Think( gentity_t *self ) if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) { - self->timestamp = level.time; self->think = AAcidTube_Damage; - self->nextthink = level.time + 100; - G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse ); - return; + break; } } } diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index a6e73d6a..2703c2f7 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1565,7 +1565,7 @@ void Cmd_Class_f( gentity_t *ent ) { trap_SendServerCommand( ent-g_entities, va( "print \"Class %s not allowed at stage %d\n\"", - s, g_alienStage.integer ) ); + s, g_alienStage.integer + 1 ) ); return; } diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index f5dd0a4d..7217bb1b 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -437,6 +437,8 @@ MASS DRIVER ====================================================================== */ +#ifdef MDRIVER_SHOOT_THROUGH + void massDriverFire( gentity_t *ent ) { trace_t tr; @@ -492,6 +494,51 @@ void massDriverFire( gentity_t *ent ) G_UnlaggedOff( ); } +#else + +void massDriverFire( gentity_t *ent ) +{ + trace_t tr; + vec3_t end; + gentity_t *tent; + gentity_t *traceEnt; + + VectorMA( muzzle, 8192 * 16, forward, end ); + + G_UnlaggedOn( muzzle, 8192 * 16 ); + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + G_UnlaggedOff( ); + + if( tr.surfaceFlags & SURF_NOIMPACT ) + return; + + traceEnt = &g_entities[ tr.entityNum ]; + + // snap the endpos to integers, but nudged towards the line + SnapVectorTowards( tr.endpos, muzzle ); + + // send impact + if( traceEnt->takedamage && traceEnt->client ) + { + BloodSpurt( ent, traceEnt, &tr ); + } + else + { + tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS ); + tent->s.eventParm = DirToByte( tr.plane.normal ); + tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode + } + + if( traceEnt->takedamage ) + { + G_Damage( traceEnt, ent, ent, forward, tr.endpos, + MDRIVER_DMG, 0, MOD_MDRIVER ); + } +} + +#endif + /* ====================================================================== diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 33613e63..1c6e396c 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -275,11 +275,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ACIDTUBE_BT 15000 #define ACIDTUBE_HEALTH ABHM(125) #define ACIDTUBE_REGEN 10 -#define ACIDTUBE_SPLASHDAMAGE 6 -#define ACIDTUBE_SPLASHRADIUS 300 +#define ACIDTUBE_SPLASHDAMAGE 50 +#define ACIDTUBE_SPLASHRADIUS 50 #define ACIDTUBE_CREEPSIZE 120 +#define ACIDTUBE_DAMAGE 6 #define ACIDTUBE_RANGE 300.0f -#define ACIDTUBE_REPEAT 3000 +#define ACIDTUBE_REPEAT 300 +#define ACIDTUBE_REPEAT_ANIM 2000 #define ACIDTUBE_K_SCALE 1.0f #define HIVE_BP 12 @@ -420,6 +422,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define MDRIVER_REPEAT 1000 #define MDRIVER_K_SCALE 1.0f #define MDRIVER_RELOAD 2000 +#define MDRIVER_SHOOT_THROUGH // uncomment to enable MD shooting through entities #define CHAINGUN_PRICE 400 #define CHAINGUN_BULLETS 300 -- cgit