mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 07:11:38 +00:00
Mantis: 0001125
o Added a 0.4 second cooldown to hive +use git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@483 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
42ecbf1f4c
commit
3c6b1bdfc1
3 changed files with 15 additions and 1 deletions
|
@ -914,7 +914,7 @@ void AvHHive::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_T
|
|||
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(inActivator);
|
||||
|
||||
|
||||
if(thePlayer && (thePlayer->pev->team == this->pev->team) && (thePlayer->GetUser3() != AVH_USER3_ALIEN_EMBRYO))
|
||||
if(thePlayer && (thePlayer->pev->team == this->pev->team) && (thePlayer->GetUser3() != AVH_USER3_ALIEN_EMBRYO) && thePlayer->GetCanUseHive() )
|
||||
{
|
||||
vector<int> theHives;
|
||||
vector<int> theHivesUnderAttack;
|
||||
|
@ -982,6 +982,7 @@ void AvHHive::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_T
|
|||
|
||||
if(AvHSUGetIsEnoughRoomForHull(theOriginToSpawn, AvHMUGetHull(false, thePlayer->pev->iuser3), thePlayer->edict()))
|
||||
{
|
||||
thePlayer->SetTimeOfLastHiveUse(gpGlobals->time);
|
||||
thePlayer->SetPosition(theOriginToSpawn);
|
||||
thePlayer->pev->velocity = Vector(0, 0, 0);
|
||||
|
||||
|
|
|
@ -1887,6 +1887,14 @@ bool AvHPlayer::GetCanReceiveResources() const
|
|||
return theCanReceiveResources;
|
||||
}
|
||||
|
||||
bool AvHPlayer::GetCanUseHive() const {
|
||||
return (gpGlobals->time > this->mTimeOfLastHiveUse + 0.4f );
|
||||
}
|
||||
|
||||
void AvHPlayer::SetTimeOfLastHiveUse(float time) {
|
||||
this->mTimeOfLastHiveUse=time;
|
||||
}
|
||||
|
||||
int AvHPlayer::GetEffectivePlayerClass()
|
||||
{
|
||||
AvHPlayerClass theEffectivePlayerClass = PLAYERCLASS_NONE;
|
||||
|
@ -3410,7 +3418,9 @@ void AvHPlayer::Init()
|
|||
this->mTimeLastJoinTeam = -1;
|
||||
// tankefugl
|
||||
|
||||
this->mTimeOfLastHiveUse = -1;
|
||||
// alien upgrades
|
||||
|
||||
this->mTimeOfLastRegeneration = -1;
|
||||
this->mTimeOfLastPheromone = -1;
|
||||
this->mMaxGallopSpeed = 0;
|
||||
|
|
|
@ -233,6 +233,8 @@ public:
|
|||
void SetSkin(int inSkin);
|
||||
bool GetCanCommand(string& outErrorMessage);
|
||||
bool GetCanReceiveResources() const;
|
||||
bool GetCanUseHive() const;
|
||||
void SetTimeOfLastHiveUse(float time);
|
||||
|
||||
void SetPlayMode(AvHPlayMode inPlayMode, bool inForceSpawn = false);
|
||||
bool GetHasBeenSpectator(void) const;
|
||||
|
@ -625,6 +627,7 @@ private:
|
|||
// tankefugl
|
||||
|
||||
// alien upgrades
|
||||
float mTimeOfLastHiveUse;
|
||||
float mTimeOfLastRegeneration;
|
||||
float mTimeOfLastPheromone;
|
||||
|
||||
|
|
Loading…
Reference in a new issue