mirror of
https://github.com/unknownworlds/NS.git
synced 2024-11-22 20:51:36 +00:00
Mantis: 1017
o new Balance variable kPointsPerArmouryHealth, value is 10 o Armoury now supplies 10 health every use ( once per 0.9 seconds ) git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@111 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
4a31413948
commit
c07b28de9d
5 changed files with 23 additions and 12 deletions
|
@ -232,6 +232,7 @@
|
|||
#define kPheromonesBaseDistance 500
|
||||
#define kPheromonesLevelDistance 200
|
||||
#define kPointsPerHealth 50
|
||||
#define kPointsPerArmouryHealth 10
|
||||
#define kPrimalScreamRange 500
|
||||
#define kPrototypeLabBuildTime 20
|
||||
#define kPrototypeLabCost 40
|
||||
|
|
|
@ -577,11 +577,15 @@ void AvHHealth::Spawn(void)
|
|||
this->pev->iuser3 = AVH_USER3_MARINEITEM;
|
||||
}
|
||||
|
||||
BOOL AvHHealth::GiveHealth(CBaseEntity* inOther)
|
||||
BOOL AvHHealth::GiveHealth(CBaseEntity* inOther, float points)
|
||||
{
|
||||
BOOL theSuccess = FALSE;
|
||||
|
||||
float thePointsPerHealth = BALANCE_VAR(kPointsPerHealth);
|
||||
// puzl: 1017
|
||||
// Amount of health to give is now a paramater to allow us to vary the resupply amount for the armoury
|
||||
|
||||
// float thePointsPerHealth = BALANCE_VAR(kPointsPerHealth)
|
||||
|
||||
|
||||
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(inOther);
|
||||
if(thePlayer && thePlayer->GetIsRelevant() && thePlayer->GetIsMarine())
|
||||
|
@ -589,7 +593,7 @@ BOOL AvHHealth::GiveHealth(CBaseEntity* inOther)
|
|||
float thePlayerMaxHealth = AvHPlayerUpgrade::GetMaxHealth(thePlayer->pev->iuser4, thePlayer->GetUser3(), thePlayer->GetExperienceLevel());
|
||||
if(thePlayer->pev->health < thePlayerMaxHealth)
|
||||
{
|
||||
float thePointsGiven = min(thePointsPerHealth, (thePlayerMaxHealth - thePlayer->pev->health));
|
||||
float thePointsGiven = min(points, (thePlayerMaxHealth - thePlayer->pev->health));
|
||||
|
||||
thePlayer->pev->health += thePointsGiven;
|
||||
|
||||
|
@ -613,7 +617,8 @@ BOOL AvHHealth::GiveHealth(CBaseEntity* inOther)
|
|||
|
||||
void AvHHealth::Touch(CBaseEntity* inOther)
|
||||
{
|
||||
if(AvHHealth::GiveHealth(inOther))
|
||||
// puzl: 1017 medpack health amount
|
||||
if(AvHHealth::GiveHealth(inOther, BALANCE_VAR(kPointsPerHealth)))
|
||||
{
|
||||
UTIL_Remove(this);
|
||||
}
|
||||
|
@ -2323,10 +2328,12 @@ void AvHArmory::ResupplyUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE
|
|||
{
|
||||
if(thePlayer->GetCanBeResupplied())
|
||||
{
|
||||
// Give health back occasionally
|
||||
bool theGiveHealthIfNeeded = (RANDOM_LONG(0, 3) == 0);
|
||||
|
||||
thePlayer->Resupply(theGiveHealthIfNeeded);
|
||||
// puzl: 1017
|
||||
// // Give health back occasionally
|
||||
// bool theGiveHealthIfNeeded = (RANDOM_LONG(0, 3) == 0);
|
||||
//
|
||||
// resupply gives 10 health each use
|
||||
thePlayer->Resupply(true);
|
||||
|
||||
// Always play "getting ammo" sound when ammo or health are needed, to indicate to player when to stop pressing +use
|
||||
EMIT_SOUND(thePlayer->edict(), CHAN_WEAPON, kArmoryResupplySound, .3f, ATTN_NORM);
|
||||
|
|
|
@ -126,7 +126,8 @@ private:
|
|||
class AvHHealth : public AvHPlayerEquipment
|
||||
{
|
||||
public:
|
||||
static BOOL GiveHealth(CBaseEntity* inOther);
|
||||
// puzl: 1017 GiveHealth now takes the amount as a paramater.
|
||||
static BOOL GiveHealth(CBaseEntity* inOther, float points);
|
||||
|
||||
void Precache( void );
|
||||
void Spawn( void );
|
||||
|
|
|
@ -8355,7 +8355,6 @@ bool AvHPlayer::GetCanBeResupplied() const
|
|||
theCanBeResupplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
return theCanBeResupplied;
|
||||
}
|
||||
|
||||
|
@ -8373,7 +8372,8 @@ bool AvHPlayer::Resupply(bool inGiveHealth)
|
|||
|
||||
if(inGiveHealth)
|
||||
{
|
||||
if(AvHHealth::GiveHealth(this))
|
||||
// puzl: 1017 armoury gives 10 health per use
|
||||
if(AvHHealth::GiveHealth(this, BALANCE_VAR(kPointsPerArmouryHealth)))
|
||||
{
|
||||
// Play event for each person helped
|
||||
//PLAYBACK_EVENT_FULL(0, this->edict(), gPhaseInEventID, 0, this->pev->origin, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );
|
||||
|
|
|
@ -536,7 +536,9 @@ void AvHSUResupplyFriendliesInRange(int inNumEntitiesToCreate, AvHPlayer* inPlay
|
|||
|
||||
// Give player entity
|
||||
//AvHSUBuildTechForPlayer(inMessageID, thePlayer->pev->origin, inPlayer);
|
||||
BOOL theHelpedPlayer = AvHHealth::GiveHealth(thePlayer);
|
||||
|
||||
// puzl: 1017 combat resupply amount
|
||||
BOOL theHelpedPlayer = AvHHealth::GiveHealth(thePlayer, BALANCE_VAR(kPointsPerHealth));
|
||||
|
||||
if(!theHelpedPlayer)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue