mirror of
https://github.com/ENSL/NS.git
synced 2025-03-21 01:41:29 +00:00
o Aliens can now trigger 'the enemy approaches' by attacking it. friendly fire does not change behaviour. Leap does not trigger it at all.
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@435 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
9f5794660a
commit
96709be82c
3 changed files with 19 additions and 2 deletions
|
@ -252,7 +252,8 @@ typedef enum
|
|||
ALERT_NEW_TRAIT = 13,
|
||||
ALERT_ORDER_NEEDED = 14,
|
||||
ALERT_ORDER_COMPLETE = 15,
|
||||
ALERT_MAX_ALERTS = 16
|
||||
ALERT_HIVE_DEFEND = 16,
|
||||
ALERT_MAX_ALERTS = 17
|
||||
} AvHAlertType;
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -1071,6 +1071,16 @@ bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBas
|
|||
{
|
||||
*outScalar = theScalar;
|
||||
}
|
||||
|
||||
if(!theTeamsAreDifferent && !AvHSUGetIsExternalClassName(STRING(inReceiver->pev->classname)))
|
||||
{
|
||||
AvHHive *theHive=(AvHHive *)dynamic_cast<const AvHHive *>(inReceiver);
|
||||
if ( theHive != NULL && !this->GetIsEntityUnderAttack(theHive->entindex()) ) {
|
||||
theCanDoDamage=false;
|
||||
GetGameRules()->TriggerAlert((AvHTeamNumber)inAttacker->pev->team, ALERT_HIVE_DEFEND, theHive->entindex());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return theCanDoDamage;
|
||||
}
|
||||
|
@ -3597,6 +3607,10 @@ void AvHGamerules::TriggerAlert(AvHTeamNumber inTeamNumber, AvHAlertType inAlert
|
|||
{
|
||||
theSound = HUD_SOUND_ALIEN_NEW_TRAIT;
|
||||
}
|
||||
else if(inAlertType == ALERT_HIVE_DEFEND)
|
||||
{
|
||||
theSound = HUD_SOUND_ALIEN_ENEMY_APPROACHES;
|
||||
}
|
||||
|
||||
if(theSound != HUD_SOUND_INVALID)
|
||||
{
|
||||
|
@ -3619,7 +3633,7 @@ void AvHGamerules::TriggerAlert(AvHTeamNumber inTeamNumber, AvHAlertType inAlert
|
|||
}
|
||||
|
||||
// Add entity to our list of entities that are under attack
|
||||
if(((inAlertType == ALERT_UNDER_ATTACK) || (inAlertType == ALERT_PLAYER_ENGAGE) || (inAlertType == ALERT_HIVE_DYING)) && (inEntIndex > 0))
|
||||
if(((inAlertType == ALERT_UNDER_ATTACK) || (inAlertType == ALERT_PLAYER_ENGAGE) || (inAlertType == ALERT_HIVE_DYING)|| (inAlertType == ALERT_HIVE_DEFEND) ) && (inEntIndex > 0))
|
||||
{
|
||||
// This will update current time longer if continually attacked
|
||||
const float kUnderAttackDuration = 5.0f;
|
||||
|
|
|
@ -697,6 +697,7 @@ bool AvHSUGetIsOftRepeatedAlert(AvHAlertType inAlertType)
|
|||
{
|
||||
case ALERT_UNDER_ATTACK:
|
||||
case ALERT_HIVE_DYING:
|
||||
case ALERT_HIVE_DEFEND:
|
||||
case ALERT_PLAYER_ENGAGE:
|
||||
case ALERT_SENTRY_FIRING:
|
||||
case ALERT_SENTRY_DAMAGED:
|
||||
|
@ -722,6 +723,7 @@ bool AvHSUGetIsUrgentAlert(AvHAlertType inAlertType)
|
|||
case ALERT_LOW_RESOURCES:
|
||||
case ALERT_UNDER_ATTACK:
|
||||
case ALERT_HIVE_DYING:
|
||||
case ALERT_HIVE_DEFEND:
|
||||
|
||||
// These must always be played because they don't have any notification on the commander UI
|
||||
case ALERT_RESEARCH_COMPLETE:
|
||||
|
|
Loading…
Reference in a new issue