diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2019-08-27 00:18:42 +0100 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2019-08-27 00:18:42 +0100 |
commit | 200945a313c0894edb2030e198e480ea13819a58 (patch) | |
tree | 7b8b1d8b709364eef42eff4478e82baba0652d83 | |
parent | a5c19fd1b7bdb5dcec58153a30acfa24e3fabfd5 (diff) |
team-chat OM/RC bleed alert added
-rw-r--r-- | src/game/g_buildable.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 4e07c64..43ac66a 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -766,6 +766,11 @@ pain function for Alien Spawn void ASpawn_Pain( gentity_t *self, gentity_t *attacker, int damage ) { G_SetBuildableAnim( self, BANIM_PAIN1, qfalse ); + + if ( self->s.modelindex == BA_A_OVERMIND && self->health > 0 && + attacker && attacker->client && attacker->client->pers.teamSelection == PTE_ALIENS ) + G_TeamCommand( PTE_ALIENS, va( "print \"Overmind ^3DAMAGED^7 by ^1TEAMMATE^7 %s^7\n\"", + attacker->client->pers.netname )); } @@ -1808,6 +1813,27 @@ void HReactor_Think( gentity_t *self ) self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex ); } +/* +================ +HReactor_Pain +================ +*/ + +void HReactor_Pain( gentity_t *self, gentity_t *attacker, int damage) +{ + if (self->health <= 0) + return; + + if (!attacker || !attacker->client) + return; + + if (attacker->client->pers.teamSelection != PTE_HUMANS) + return; + + G_TeamCommand(PTE_HUMANS, va( "print \"Reactor ^3DAMAGED^7 by ^1TEAMMATE^7 %s^7\n\"", + attacker->client->pers.netname)); +} + //================================================================================== @@ -3585,6 +3611,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori built->die = HSpawn_Die; built->use = HRepeater_Use; built->powered = built->active = qtrue; + built->pain = HReactor_Pain; break; case BA_H_REPEATER: |