From 5119bfd1239a0303b0ea72cf57ae6e7d3bc85897 Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:16:41 +0000 Subject: ACIDTUBE_REPEAT is now the actual repeat rate for Acid tube fire. Removed the redundant AAcidTube_Damage pseudo-think function. --- src/game/g_buildable.c | 51 ++++++++++++++++---------------------------------- src/game/tremulous.h | 2 +- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 43a5dfd8..27168bbb 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1099,36 +1099,6 @@ void ABarricade_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) void AAcidTube_Think( gentity_t *self ); -/* -================ -AAcidTube_Damage - -Damage function for Alien Acid Tube -================ -*/ -void AAcidTube_Damage( gentity_t *self ) -{ - if( !self->spawned || self->health <= 0 ) - { - 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->think = AAcidTube_Think; - self->nextthink = level.time + ACIDTUBE_REPEAT; -} - /* ================ AAcidTube_Think @@ -1156,7 +1126,10 @@ void AAcidTube_Think( gentity_t *self ) return; } - if( self->spawned && G_FindOvermind( self ) ) + G_CreepSlow( self ); + + // attack nearby humans + if( self->spawned && self->health && G_FindOvermind( self ) ) { num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); for( i = 0; i < num; i++ ) @@ -1168,14 +1141,22 @@ void AAcidTube_Think( gentity_t *self ) if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) { - self->think = AAcidTube_Damage; - break; + // start the attack animation + 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 ); + self->nextthink = level.time + ACIDTUBE_REPEAT; + return; } } } - G_CreepSlow( self ); - self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex ); } diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 1c6e396c..57cc33ed 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -278,7 +278,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ACIDTUBE_SPLASHDAMAGE 50 #define ACIDTUBE_SPLASHRADIUS 50 #define ACIDTUBE_CREEPSIZE 120 -#define ACIDTUBE_DAMAGE 6 +#define ACIDTUBE_DAMAGE 10 #define ACIDTUBE_RANGE 300.0f #define ACIDTUBE_REPEAT 300 #define ACIDTUBE_REPEAT_ANIM 2000 -- cgit