mirror of
https://github.com/ENSL/NS.git
synced 2024-11-13 00:24: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);
|
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> theHives;
|
||||||
vector<int> theHivesUnderAttack;
|
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()))
|
if(AvHSUGetIsEnoughRoomForHull(theOriginToSpawn, AvHMUGetHull(false, thePlayer->pev->iuser3), thePlayer->edict()))
|
||||||
{
|
{
|
||||||
|
thePlayer->SetTimeOfLastHiveUse(gpGlobals->time);
|
||||||
thePlayer->SetPosition(theOriginToSpawn);
|
thePlayer->SetPosition(theOriginToSpawn);
|
||||||
thePlayer->pev->velocity = Vector(0, 0, 0);
|
thePlayer->pev->velocity = Vector(0, 0, 0);
|
||||||
|
|
||||||
|
|
|
@ -1887,6 +1887,14 @@ bool AvHPlayer::GetCanReceiveResources() const
|
||||||
return theCanReceiveResources;
|
return theCanReceiveResources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AvHPlayer::GetCanUseHive() const {
|
||||||
|
return (gpGlobals->time > this->mTimeOfLastHiveUse + 0.4f );
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvHPlayer::SetTimeOfLastHiveUse(float time) {
|
||||||
|
this->mTimeOfLastHiveUse=time;
|
||||||
|
}
|
||||||
|
|
||||||
int AvHPlayer::GetEffectivePlayerClass()
|
int AvHPlayer::GetEffectivePlayerClass()
|
||||||
{
|
{
|
||||||
AvHPlayerClass theEffectivePlayerClass = PLAYERCLASS_NONE;
|
AvHPlayerClass theEffectivePlayerClass = PLAYERCLASS_NONE;
|
||||||
|
@ -3410,7 +3418,9 @@ void AvHPlayer::Init()
|
||||||
this->mTimeLastJoinTeam = -1;
|
this->mTimeLastJoinTeam = -1;
|
||||||
// tankefugl
|
// tankefugl
|
||||||
|
|
||||||
|
this->mTimeOfLastHiveUse = -1;
|
||||||
// alien upgrades
|
// alien upgrades
|
||||||
|
|
||||||
this->mTimeOfLastRegeneration = -1;
|
this->mTimeOfLastRegeneration = -1;
|
||||||
this->mTimeOfLastPheromone = -1;
|
this->mTimeOfLastPheromone = -1;
|
||||||
this->mMaxGallopSpeed = 0;
|
this->mMaxGallopSpeed = 0;
|
||||||
|
|
|
@ -233,6 +233,8 @@ public:
|
||||||
void SetSkin(int inSkin);
|
void SetSkin(int inSkin);
|
||||||
bool GetCanCommand(string& outErrorMessage);
|
bool GetCanCommand(string& outErrorMessage);
|
||||||
bool GetCanReceiveResources() const;
|
bool GetCanReceiveResources() const;
|
||||||
|
bool GetCanUseHive() const;
|
||||||
|
void SetTimeOfLastHiveUse(float time);
|
||||||
|
|
||||||
void SetPlayMode(AvHPlayMode inPlayMode, bool inForceSpawn = false);
|
void SetPlayMode(AvHPlayMode inPlayMode, bool inForceSpawn = false);
|
||||||
bool GetHasBeenSpectator(void) const;
|
bool GetHasBeenSpectator(void) const;
|
||||||
|
@ -625,6 +627,7 @@ private:
|
||||||
// tankefugl
|
// tankefugl
|
||||||
|
|
||||||
// alien upgrades
|
// alien upgrades
|
||||||
|
float mTimeOfLastHiveUse;
|
||||||
float mTimeOfLastRegeneration;
|
float mTimeOfLastRegeneration;
|
||||||
float mTimeOfLastPheromone;
|
float mTimeOfLastPheromone;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue