summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:16:30 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:48 +0000
commitc24c98e51210879202c4c275831afb72b4eb69ff (patch)
treecb8913bd348cfb9f1920bbf920bc3a0e189a909c /src/game/g_buildable.c
parentfd3de48aeee45b7e45f97aa75cea335382fa04f1 (diff)
* 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!
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c47
1 files changed, 21 insertions, 26 deletions
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;
}
}
}