o Alien flashlight does not reset at death.

o Mantis 517: Changed the web render settings to values that work irrespective of alien flashlight setting.
o Changed the behaviour of hive/MC teleportation
- Friendly fire never triggers 'the hive is under attack'.
- Aliens must +use a growing hive to trigger 'the enemy approaches'.


git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@555 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-07-30 10:19:58 +00:00
parent 40c70b1d2c
commit 0cd4983b6a
8 changed files with 36 additions and 24 deletions

View file

@ -607,7 +607,7 @@ void AvHMovementChamber::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCa
{
bool theHiveIsUnderAttack = GetGameRules()->GetIsEntityUnderAttack(theEntity->entindex());
if(theEntity->GetIsActive() || theHiveIsUnderAttack)
if(theEntity->GetIsActive() || theHiveIsUnderAttack || theEntity->GetEmergencyUse() )
{
float theCurrentDistance = VectorDistance(theEntity->pev->origin, inActivator->pev->origin);
bool theHiveIsFarther = (theCurrentDistance > theFarthestDistance);

View file

@ -1693,7 +1693,7 @@ void AvHWebStrand::Precache(void)
void AvHWebStrand::Setup(const Vector& inPointOne, const Vector& inPointTwo)
{
// Create a new entity with CBeam private data
this->BeamInit(kWebStrandSprite, kWebStrandWidth);
this->BeamInit(kWebStrandSprite, 40); //kWebStrandWidth);
this->PointsInit(inPointOne, inPointTwo);
this->SetColor( 255, 255, 255 );
@ -1703,6 +1703,9 @@ void AvHWebStrand::Setup(const Vector& inPointOne, const Vector& inPointTwo)
this->SetBrightness( 8 );
this->pev->classname = MAKE_STRING(kesTeamWebStrand);
this->pev->rendermode = kRenderNormal;
this->pev->renderfx = kRenderFxFlickerFast;
this->pev->renderamt = 20;
}
void AvHWebStrand::Spawn(void)
@ -1737,6 +1740,9 @@ void AvHWebStrand::StrandThink()
this->SetColor( 255, 255, 255 );
this->SetFrame(1);
this->mSolid=true;
this->pev->rendermode = kRenderTransAdd;
this->pev->renderfx = kRenderFxNone;
this->pev->renderamt = 30;
SetThink(NULL);
}
void AvHWebStrand::StrandExpire()

View file

@ -977,7 +977,7 @@ BOOL AvHGamerules::FPlayerCanRespawn( CBasePlayer *pPlayer )
return theCanRespawn;
}
bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar, bool triggerHiveDefend)
bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar)
{
bool theCanDoDamage = false;
@ -1071,19 +1071,6 @@ bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBas
{
*outScalar = theScalar;
}
if ( triggerHiveDefend ) {
if(!theTeamsAreDifferent && !AvHSUGetIsExternalClassName(STRING(inReceiver->pev->classname)) && theGameHasStarted )
{
AvHHive *theHive=(AvHHive *)dynamic_cast<const AvHHive *>(inReceiver);
if ( theHive != NULL ) {
theCanDoDamage=false;
if ( !this->GetIsEntityUnderAttack(theHive->entindex()) )
GetGameRules()->TriggerAlert((AvHTeamNumber)inAttacker->pev->team, ALERT_HIVE_DEFEND, theHive->entindex());
}
}
}
}
return theCanDoDamage;
}

View file

@ -186,7 +186,7 @@ public:
virtual BOOL FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker );
// TODO: Add splash damage parameter and outgoing float percentage damage? This way splash damage could do some damage in non-tourny mode?
virtual bool CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar = NULL, bool triggerHiveDefend = true);
virtual bool CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar = NULL);
//virtual edict_t* GetPlayerSpawnSpot( CBasePlayer *pPlayer );
virtual void PlayerThink( CBasePlayer *pPlayer );

View file

@ -114,7 +114,8 @@ AvHHive::AvHHive() : AvHBaseBuildable(TECH_HIVE, ALIEN_BUILD_HIVE, kesTeamHive,
this->mTechnology = MESSAGE_NULL;
this->mEnergy = 0.0f;
this->mLastTimeScannedHives=-1.0f;
this->mTeleportHiveIndex=-1;;
this->mTimeEmergencyUseEnabled=-1.0f;
this->mTeleportHiveIndex=-1;
}
@ -676,7 +677,8 @@ int AvHHive::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float
}
else
{
GetGameRules()->TriggerAlert((AvHTeamNumber)this->pev->team, ALERT_UNDER_ATTACK, this->entindex());
if ( pevAttacker->team != this->pev->team )
GetGameRules()->TriggerAlert((AvHTeamNumber)this->pev->team, ALERT_UNDER_ATTACK, this->entindex());
}
if((this->mTimeLastWoundSound == -1) || ((this->mTimeLastWoundSound + kWoundSoundInterval) < gpGlobals->time))
@ -904,10 +906,23 @@ void AvHHive::HiveTouch(CBaseEntity* inOther)
AvHBaseBuildable::BuildableTouch(inOther);
}
void AvHHive::SetEmergencyUse() {
if ( !this->GetEmergencyUse() ) {
GetGameRules()->TriggerAlert((AvHTeamNumber)this->pev->team, ALERT_HIVE_DEFEND, this->entindex());
}
this->mTimeEmergencyUseEnabled=gpGlobals->time;
}
bool AvHHive::GetEmergencyUse() const {
return ( this->mTimeEmergencyUseEnabled > gpGlobals->time - 5.0f ); //BALANCE_VAR(kHiveEmergencyInterval)
}
void AvHHive::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_TYPE inUseType, float inValue)
{
if ( this->GetIsSpawning() )
if ( this->GetIsSpawning() ) {
this->SetEmergencyUse();
return;
}
const float kHiveScanInterval = 1.0f;
@ -928,7 +943,7 @@ void AvHHive::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_T
{
bool theHiveIsUnderAttack = GetGameRules()->GetIsEntityUnderAttack(theEntity->entindex());
// allow teleport to any built hive, or unbuilt hives under attack.
if(!theEntity->GetIsSpawning() || ( theEntity->GetIsSpawning() && theHiveIsUnderAttack ) )
if(!theEntity->GetIsSpawning() || ( theEntity->GetIsSpawning() && ( theHiveIsUnderAttack || theEntity->GetEmergencyUse()) ) )
{
theHives.push_back(theEntity->entindex());
if ( theHiveIsUnderAttack )

View file

@ -156,6 +156,9 @@ public:
virtual void Spawn();
virtual void SetEmergencyUse();
virtual bool GetEmergencyUse() const;
void EXPORT TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_TYPE inUseType, float inValue);
//virtual void UpdateReinforcements();
@ -182,6 +185,7 @@ private:
float mTimeOfNextUmbra;
float mEnergy;
float mLastTimeScannedHives;
float mTimeEmergencyUseEnabled;
int mTeleportHiveIndex;
};

View file

@ -150,7 +150,7 @@ void AvHParasiteGun::FireProjectiles(void)
{
float theScalar = 1.0f;
bool theCanDoDamageTo = GetGameRules()->CanEntityDoDamageTo(this->m_pPlayer, theEntityHit, &theScalar, false);
bool theCanDoDamageTo = GetGameRules()->CanEntityDoDamageTo(this->m_pPlayer, theEntityHit, &theScalar);
theScalar *= AvHPlayerUpgrade::GetAlienRangedDamageUpgrade(this->m_pPlayer->pev->iuser4);

View file

@ -856,7 +856,7 @@ void AvHPlayer::ClearRoleAbilities()
this->pev->iuser4 &= ~MASK_ALIEN_EMBRYO;
this->pev->iuser4 &= ~MASK_ALIEN_MOVEMENT;
this->mIsScreaming = false;
this->mAlienSightActive = false;
//this->mAlienSightActive = false;
this->mDesiredRoomType = 0;
}
@ -4593,7 +4593,7 @@ void AvHPlayer::Killed( entvars_t *pevAttacker, int iGib )
this->mTimeToBeUnensnared = -1;
this->mLastTimeEnsnared = -1;
this->mAlienSightActive = false;
//this->mAlienSightActive = false;
this->mEvolution = MESSAGE_NULL;
this->SetUsedKilled(false);