diff --git a/main/Balance.txt b/main/Balance.txt index fee9ebc..bad7f66 100644 --- a/main/Balance.txt +++ b/main/Balance.txt @@ -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 diff --git a/main/source/mod/AvHMarineEquipment.cpp b/main/source/mod/AvHMarineEquipment.cpp index 1fd2962..ddbaefb 100644 --- a/main/source/mod/AvHMarineEquipment.cpp +++ b/main/source/mod/AvHMarineEquipment.cpp @@ -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(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); diff --git a/main/source/mod/AvHMarineEquipment.h b/main/source/mod/AvHMarineEquipment.h index 45af5a2..7d6341f 100644 --- a/main/source/mod/AvHMarineEquipment.h +++ b/main/source/mod/AvHMarineEquipment.h @@ -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 ); diff --git a/main/source/mod/AvHPlayer.cpp b/main/source/mod/AvHPlayer.cpp index 41bac71..66b8262 100644 --- a/main/source/mod/AvHPlayer.cpp +++ b/main/source/mod/AvHPlayer.cpp @@ -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 ); diff --git a/main/source/mod/AvHServerUtil.cpp b/main/source/mod/AvHServerUtil.cpp index fc9143f..d006856 100644 --- a/main/source/mod/AvHServerUtil.cpp +++ b/main/source/mod/AvHServerUtil.cpp @@ -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) {