summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:16:41 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:49 +0000
commit5119bfd1239a0303b0ea72cf57ae6e7d3bc85897 (patch)
tree4ba8966078654c5b8a477bc84f97e1417457ad41
parentc24c98e51210879202c4c275831afb72b4eb69ff (diff)
ACIDTUBE_REPEAT is now the actual repeat rate for Acid tube fire.
Removed the redundant AAcidTube_Damage pseudo-think function.
-rw-r--r--src/game/g_buildable.c51
-rw-r--r--src/game/tremulous.h2
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
@@ -1101,36 +1101,6 @@ 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
Think function for Alien Acid Tube
@@ -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