o Defence chambers now heal the base 10 + a variable 4%

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@415 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-04-25 23:21:34 +00:00
parent df66303212
commit 3be39e1003
2 changed files with 5 additions and 2 deletions

View file

@ -84,6 +84,7 @@
#define kDefenseChamberThinkInterval 2
#define kDefensiveChamberHealRange 400
#define kDefensiveChamberRegenAmount 10
#define kDefensiveChamberRegenPercent 4
#define kDevourDamage 3
#define kDevourRange 100
#define kDistressBeaconCost 15

View file

@ -389,16 +389,18 @@ void AvHDefenseChamber::RegenAliensThink()
{
AvHBaseBuildable* theBuildable = dynamic_cast<AvHBaseBuildable*>(theBaseEntity);
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(theBaseEntity);
float thePercent=BALANCE_VAR(kDefensiveChamberRegenPercent)/100.0f;
float amount=BALANCE_VAR(kDefensiveChamberRegenAmount) + (theBaseEntity->pev->max_health*thePercent);
if(thePlayer && thePlayer->IsAlive())
{
if(thePlayer->Heal(BALANCE_VAR(kDefensiveChamberRegenAmount)))
if(thePlayer->Heal(amount))
{
theNumEntsHealed++;
}
}
else if(theBuildable && theBuildable->GetIsBuilt() && (theBuildable != this))
{
if(theBuildable->Regenerate(BALANCE_VAR(kDefensiveChamberRegenAmount)))
if(theBuildable->Regenerate(amount))
{
theNumEntsHealed++;
}