mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Deleted Feature: The poison feature has been made obsolete by the disease feature and has been removed.
GameDir >= r2245 is recommended. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7870 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -793,10 +793,6 @@ void ChangeBaseSoldierStats( SOLDIERTYPE *pSoldier )
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bBreath = 100;
|
||||
|
||||
pSoldier->bPoisonSum = 0;
|
||||
pSoldier->bPoisonLife = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
|
||||
pSoldier->stats.bMarksmanship = (UINT8)(sBaseStat[sCurBaseDiff] + (UINT16)(Random(BASE_STAT_DEVIATION * 2)-BASE_STAT_DEVIATION));
|
||||
pSoldier->stats.bMedical = (UINT8)(sBaseStat[sCurBaseDiff] + (UINT16)(Random(BASE_STAT_DEVIATION * 2)-BASE_STAT_DEVIATION));
|
||||
pSoldier->stats.bMechanical = (UINT8)(sBaseStat[sCurBaseDiff] + (UINT16)(Random(BASE_STAT_DEVIATION * 2)-BASE_STAT_DEVIATION));
|
||||
|
||||
+1
-8
@@ -1660,13 +1660,7 @@ void LoadGameExternalOptions()
|
||||
gGameExternalOptions.fZombieRiseWithArmour = iniReader.ReadBoolean("Tactical Zombie Settings", "ZOMBIE_RISE_WITH_ARMOUR", TRUE);
|
||||
gGameExternalOptions.fZombieOnlyHeadShotsPermanentlyKill = iniReader.ReadBoolean("Tactical Zombie Settings", "ZOMBIE_ONLY_HEADSHOTS_PERMANENTLY_KILL", TRUE);
|
||||
#endif
|
||||
|
||||
//################# Tactical Poison Settings ##################
|
||||
gGameExternalOptions.ubPoisonBaseMedicalSkillToCure = iniReader.ReadInteger("Tactical Poison Settings", "POISON_BASE_MEDICAL_SKILL_TO_CURE", 50, 1, 100);
|
||||
gGameExternalOptions.sPoisonMedicalPtsToCureMultiplicator = iniReader.ReadFloat("Tactical Poison Settings", "POISON_MEDICAL_POINTS_TO_CURE_MULTIPLICATOR", 0.5f, 0.1f, 10.0f);
|
||||
gGameExternalOptions.sZombiePoisonDamagePercentage = iniReader.ReadInteger("Tactical Poison Settings", "ZOMBIE_POISON_DAMAGE_PERCENTAGE", 50, 0, 100);
|
||||
gGameExternalOptions.sPoisonInfectionDamageMultiplier = iniReader.ReadFloat("Tactical Poison Settings", "POISON_INFECTION_DAMAGE_MULTIPLIER", 4.0, 1.0, 10.0);
|
||||
|
||||
|
||||
//################# Tactical Fortification Settings ##################
|
||||
gGameExternalOptions.fFortificationAllowInHostileSector = iniReader.ReadBoolean("Tactical Fortification Settings", "FORTIFICATION_ALLOW_IN_HOSTILE_SECTOR", FALSE);
|
||||
gGameExternalOptions.fRoofCollapse = iniReader.ReadBoolean( "Tactical Fortification Settings", "ROOF_COLLAPSE", TRUE );
|
||||
@@ -1683,7 +1677,6 @@ void LoadGameExternalOptions()
|
||||
|
||||
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
|
||||
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
|
||||
gGameExternalOptions.usFoodMaxPoisoning = iniReader.ReadInteger("Tactical Food Settings", "FOOD_MAX_POISONING", 5, 0, 100);
|
||||
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
|
||||
|
||||
//################# Disease Settings ##################
|
||||
|
||||
+2
-10
@@ -394,13 +394,7 @@ typedef struct
|
||||
BOOLEAN fZombieRiseWithArmour;
|
||||
BOOLEAN fZombieOnlyHeadShotsPermanentlyKill;
|
||||
#endif
|
||||
|
||||
// Flugente: poison settings
|
||||
INT32 ubPoisonBaseMedicalSkillToCure;
|
||||
FLOAT sPoisonMedicalPtsToCureMultiplicator;
|
||||
INT16 sZombiePoisonDamagePercentage;
|
||||
FLOAT sPoisonInfectionDamageMultiplier;
|
||||
|
||||
|
||||
// Flugente: fortification settings
|
||||
BOOLEAN fFortificationAllowInHostileSector;
|
||||
|
||||
@@ -419,9 +413,7 @@ typedef struct
|
||||
|
||||
BOOLEAN fFoodDecayInSectors;
|
||||
FLOAT sFoodDecayModificator;
|
||||
|
||||
UINT8 usFoodMaxPoisoning;
|
||||
|
||||
|
||||
BOOLEAN fFoodEatingSounds;
|
||||
|
||||
// Flugente: disease settings
|
||||
|
||||
+9
-9
@@ -15,9 +15,9 @@
|
||||
#ifdef JA2EDITOR
|
||||
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7870 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7870 (Development Build)" };
|
||||
#endif
|
||||
|
||||
// ------------------------------
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
//DEBUG BUILD VERSION
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7870 (Development Build)" };
|
||||
#elif defined (JA113DEMO)
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7870 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7870 (Development Build)" };
|
||||
#endif
|
||||
|
||||
#elif defined CRIPPLED_VERSION
|
||||
@@ -46,16 +46,16 @@
|
||||
|
||||
//RELEASE BUILD VERSION
|
||||
#ifdef JA2UB
|
||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7870 (Development Build)" };
|
||||
#elif defined (JA113DEMO)
|
||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7870 (Development Build)" };
|
||||
#else
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.7868 (Development Build)" };
|
||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.7870 (Development Build)" };
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
CHAR8 czVersionNumber[16] = { "Build 15.05.19" }; //YY.MM.DD
|
||||
CHAR8 czVersionNumber[16] = { "Build 15.05.20" }; //YY.MM.DD
|
||||
CHAR16 zTrackingNumber[16] = { L"Z" };
|
||||
|
||||
// SAVE_GAME_VERSION is defined in header, change it there
|
||||
|
||||
@@ -3729,7 +3729,7 @@ void recieveEXPLOSIONDAMAGE (RPCParameters *rpcParameters)
|
||||
|
||||
// can use DishOutGasDamage() as it is dependant on the local state of the gas cloud which is not always in sync
|
||||
// but we have the definite results of damage on a merc, so :
|
||||
pSoldier->SoldierTakeDamage( ANIM_STAND, exp->sWoundAmt, 0, exp->sBreathAmt, TAKE_DAMAGE_GAS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_STAND, exp->sWoundAmt, exp->sBreathAmt, TAKE_DAMAGE_GAS, NOBODY, NOWHERE, 0, TRUE );
|
||||
}
|
||||
else if (exp->ubDamageFunc == 2)
|
||||
{
|
||||
@@ -4567,7 +4567,7 @@ void recieveDISCONNECT(RPCParameters* rpcParameters)
|
||||
if ( !pTeamSoldier->aiData.bNeutral && (pTeamSoldier->bTeam == iNetbTeam ) )
|
||||
{
|
||||
// KIll......
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 0, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -2134,11 +2134,11 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
||||
numBytesRead = ReadFieldByField(hFile, &this->wornSnowCamo, sizeof(wornSnowCamo), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->sFacilityTypeOperated, sizeof(sFacilityTypeOperated), sizeof(INT16), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bScopeMode, sizeof(bScopeMode), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bPoisonBleeding, sizeof(bPoisonBleeding), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bPoisonLife, sizeof(bPoisonLife), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bPoisonSum, sizeof(bPoisonSum), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bPoisonResistance, sizeof(bPoisonResistance), sizeof(INT16), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bPoisonAbsorption, sizeof(bPoisonAbsorption), sizeof(INT16), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT8_1, sizeof(bUnusedINT8_1), sizeof(INT8), numBytesRead );
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT8_2, sizeof(bUnusedINT8_2), sizeof(INT8), numBytesRead );
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT8_3, sizeof(bUnusedINT8_3), sizeof(INT8), numBytesRead );
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT16_4, sizeof(bUnusedINT16_4), sizeof(INT16), numBytesRead );
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bUnusedINT16_5, sizeof(bUnusedINT16_5), sizeof(INT16), numBytesRead );
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bExtraStrength, sizeof(bExtraStrength), sizeof(INT16), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->bExtraDexterity, sizeof(bExtraDexterity), sizeof(INT16), numBytesRead);
|
||||
|
||||
+26
-166
@@ -1276,10 +1276,6 @@ BOOLEAN CanCharacterPatient( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: check if poisoned
|
||||
if ( pSoldier->bPoisonSum > 0 )
|
||||
return( TRUE );
|
||||
|
||||
if ( pSoldier->HasDisease( TRUE, TRUE ) )
|
||||
return TRUE;
|
||||
|
||||
@@ -3286,13 +3282,13 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
// instead of normal damage take breath damage
|
||||
//pSoldier->SoldierTakeDamage( 0, 0, 0, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
//pSoldier->SoldierTakeDamage( 0, 0, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->bBreath = max( 0, pSoldier->bBreath - usDamageTaken );
|
||||
// he drowned?
|
||||
if( pSoldier->bBreath = 0 )
|
||||
{
|
||||
// dead
|
||||
pSoldier->SoldierTakeDamage( 0, 100, 0, 100, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, 100, 100, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
ScreenMsg( FONT_DKRED, MSG_INTERFACE, pSnitchPrisonExposedStrings[ SNITCH_PRISON_EXPOSED_DEAD_DROWN], pSoldier->GetName() );
|
||||
}
|
||||
else
|
||||
@@ -3317,7 +3313,7 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
// he's dead?
|
||||
pSoldier->SoldierTakeDamage( 0, usDamageTaken, 0, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, usDamageTaken, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
if( pSoldier->stats.bLife == 0 )
|
||||
{
|
||||
ScreenMsg( FONT_DKRED, MSG_INTERFACE, pSnitchPrisonExposedStrings[ SNITCH_PRISON_EXPOSED_DEAD_BEATEN], pSoldier->GetName() );
|
||||
@@ -3343,7 +3339,7 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier)
|
||||
usDamageTaken += Random(10);
|
||||
}
|
||||
}
|
||||
pSoldier->SoldierTakeDamage( 0, usDamageTaken, 0, usDamageTaken, TAKE_DAMAGE_BLADE, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, usDamageTaken, usDamageTaken, TAKE_DAMAGE_BLADE, NOBODY, NOWHERE, 0, TRUE );
|
||||
// he's dead?
|
||||
if( pSoldier->stats.bLife == 0 )
|
||||
{
|
||||
@@ -3371,13 +3367,13 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
// instead of normal damage take breath damage
|
||||
//pSoldier->SoldierTakeDamage( 0, 0, 0, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
//pSoldier->SoldierTakeDamage( 0, 0, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->bBreath = max( 0, pSoldier->bBreath - usDamageTaken );
|
||||
// he's strangled?
|
||||
if( pSoldier->bBreath == 0 )
|
||||
{
|
||||
// dead
|
||||
pSoldier->SoldierTakeDamage( 0, 100, 0, 100, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, 100, 100, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE );
|
||||
ScreenMsg( FONT_DKRED, MSG_INTERFACE, pSnitchPrisonExposedStrings[ SNITCH_PRISON_EXPOSED_DEAD_STRANGLED], pSoldier->GetName() );
|
||||
}
|
||||
else
|
||||
@@ -3508,7 +3504,7 @@ void UpdatePatientsWhoAreDoneHealing( void )
|
||||
if( pTeamSoldier->bActive )
|
||||
{
|
||||
// patient who doesn't need healing or curing
|
||||
if ( (pTeamSoldier->bAssignment == PATIENT) && (pTeamSoldier->stats.bLife == pTeamSoldier->stats.bLifeMax) && (pTeamSoldier->bPoisonSum == 0) && pTeamSoldier->HasDisease(TRUE, TRUE) )
|
||||
if ( (pTeamSoldier->bAssignment == PATIENT) && (pTeamSoldier->stats.bLife == pTeamSoldier->stats.bLifeMax) && pTeamSoldier->HasDisease(TRUE, TRUE) )
|
||||
{
|
||||
// Flugente: stats can also be damaged
|
||||
if ( !gGameOptions.fFoodSystem || (gGameOptions.fFoodSystem && pSoldier->bFoodLevel > FoodMoraleMods[FOOD_NORMAL].bThreshold && pSoldier->bDrinkLevel > FoodMoraleMods[FOOD_NORMAL].bThreshold) )
|
||||
@@ -3787,21 +3783,8 @@ BOOLEAN CanSoldierBeHealedByDoctor( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pDoctor,
|
||||
// if we have no damaged stat and don't need healing
|
||||
if ( !fHealDamagedStat && !fDisease && (pSoldier->stats.bLife == pSoldier->stats.bLifeMax) )
|
||||
{
|
||||
// if we are poisoned
|
||||
if ( pSoldier->bPoisonSum )
|
||||
{
|
||||
// if using the new trait system, Doctor skill is needed
|
||||
if ( gGameOptions.fNewTraitSystem && ( NUM_SKILL_TRAITS( pDoctor, DOCTOR_NT ) == 0 ) )
|
||||
{
|
||||
// we may have the medical stats, but we lack the skills!
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// cannot be healed
|
||||
return( FALSE );
|
||||
}
|
||||
// cannot be healed
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
@@ -3815,12 +3798,6 @@ UINT8 GetMinHealingSkillNeeded( SOLDIERTYPE *pPatient )
|
||||
// less than ok life, return skill needed
|
||||
return( gGameExternalOptions.ubBaseMedicalSkillToDealWithEmergency + ( gGameExternalOptions.ubMultiplierForDifferenceInLifeValueForEmergency * ( OKLIFE - pPatient->stats.bLife ) ) );
|
||||
}
|
||||
// if at full life, only poison needs to be removed
|
||||
else if ( pPatient->stats.bLife == pPatient->stats.bLifeMax && pPatient->bPoisonSum > 0 )
|
||||
{
|
||||
// skill to remove poison needed
|
||||
return( gGameExternalOptions.ubPoisonBaseMedicalSkillToCure );
|
||||
}
|
||||
|
||||
// only need some skill
|
||||
return 1;
|
||||
@@ -3840,19 +3817,16 @@ UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealA
|
||||
// for determining what medical actions will be taken
|
||||
BOOLEAN fWillHealLife = FALSE;
|
||||
BOOLEAN fWillRepairStats = FALSE;
|
||||
BOOLEAN fWillCurePoison = FALSE;
|
||||
BOOLEAN fWillCureDisease = FALSE;
|
||||
|
||||
// how much has to be used to completely heal?
|
||||
INT32 sHundredsToHeal = 0;
|
||||
INT32 sHundredsToRepair = 0;
|
||||
INT32 sHundredsToPoisonCure = 0;
|
||||
INT32 sHundredsToDiseaseCure = 0;
|
||||
|
||||
// how much do we actually use?
|
||||
INT32 sHundredsToHeal_Used = 0;
|
||||
INT32 sHundredsToRepair_Used = 0;
|
||||
INT32 sHundredsToPoisonCure_Used = 0;
|
||||
INT32 sHundredsToDiseaseCure_Used = 0;
|
||||
|
||||
INT8 bMedFactor = 1; // basic medical factor
|
||||
@@ -3893,14 +3867,7 @@ UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealA
|
||||
if ( fWillHealLife )
|
||||
ubReturnDamagedStatRate -= ((ubReturnDamagedStatRate * gSkillTraitValues.ubDORepStPenaltyIfAlsoHealing) / 100);
|
||||
}
|
||||
|
||||
//////// DETERMINE POISON CURE ////////////////////
|
||||
if ( pPatient->bPoisonSum && pDoctor->stats.bMedical >= gGameExternalOptions.ubPoisonBaseMedicalSkillToCure )
|
||||
{
|
||||
fWillCurePoison = TRUE;
|
||||
sHundredsToPoisonCure = 100 * pPatient->bPoisonSum * gGameExternalOptions.sPoisonMedicalPtsToCureMultiplicator;
|
||||
}
|
||||
|
||||
|
||||
//////// DETERMINE DISEASE CURE ////////////////////
|
||||
if ( pPatient->HasDisease( TRUE, TRUE ) )
|
||||
{
|
||||
@@ -3957,17 +3924,7 @@ UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealA
|
||||
|
||||
pPatient->stats.bLife = min( pPatient->stats.bLifeMax, (pPatient->stats.bLife + bPointsHealed) );
|
||||
}
|
||||
|
||||
// potentially increase bPoisonLife: as life points are healed, unhealed poison points become healed poison points
|
||||
if ( pPatient->bPoisonSum > 0 )
|
||||
{
|
||||
// check if there are unhealed poison points
|
||||
if ( pPatient->bPoisonLife < pPatient->bPoisonSum )
|
||||
{
|
||||
pPatient->bPoisonLife = min( pPatient->bPoisonSum, (pPatient->bPoisonLife + bPointsHealed) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// when being healed normally, reduce insta-healable HPs value
|
||||
if ( pPatient->iHealableInjury > 0 && bPointsHealed > 0 )
|
||||
{
|
||||
@@ -3991,32 +3948,7 @@ UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealA
|
||||
|
||||
RegainDamagedStats( pPatient, (sHundredsToRepair_Used * ubReturnDamagedStatRate / 100) );
|
||||
}
|
||||
|
||||
/////////////////////////// POISON CURE ////////////////////////////////////
|
||||
if ( fWillCurePoison && ptsleft > 0 )
|
||||
{
|
||||
// determine how many points we use on stat repair
|
||||
if ( ptsleft < sHundredsToPoisonCure )
|
||||
sHundredsToPoisonCure_Used = ptsleft;
|
||||
else
|
||||
sHundredsToPoisonCure_Used = sHundredsToPoisonCure;
|
||||
|
||||
// use up points
|
||||
ptsleft -= sHundredsToPoisonCure_Used;
|
||||
|
||||
pPatient->sFractLife += sHundredsToPoisonCure_Used / gGameExternalOptions.sPoisonMedicalPtsToCureMultiplicator;
|
||||
|
||||
if ( pPatient->sFractLife >= 100 )
|
||||
{
|
||||
// convert fractions into full points
|
||||
INT8 bPoisonPointsHealed = (pPatient->sFractLife / 100);
|
||||
pPatient->sFractLife %= 100;
|
||||
|
||||
pPatient->bPoisonSum = max( 0, (pPatient->bPoisonSum - bPoisonPointsHealed) );
|
||||
pPatient->bPoisonLife = max( 0, (pPatient->bPoisonLife - bPoisonPointsHealed) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////// DISEASE CURE ////////////////////////////////////
|
||||
if ( fWillCureDisease && ptsleft > 0 )
|
||||
{
|
||||
@@ -4055,7 +3987,7 @@ UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealA
|
||||
}
|
||||
|
||||
// Finally use all kit points (we are sure, we have that much)
|
||||
if ( UseTotalMedicalKitPoints( pDoctor, max(1, ((sHundredsToHeal_Used + sHundredsToRepair_Used + sHundredsToPoisonCure_Used + sHundredsToDiseaseCure_Used) * bMedFactor) / 100) ) == FALSE )
|
||||
if ( UseTotalMedicalKitPoints( pDoctor, max(1, ((sHundredsToHeal_Used + sHundredsToRepair_Used + sHundredsToDiseaseCure_Used) * bMedFactor) / 100) ) == FALSE )
|
||||
{
|
||||
// throw message if this went wrong for feedback on debugging
|
||||
#ifdef JA2TESTVERSION
|
||||
@@ -4064,10 +3996,10 @@ UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealA
|
||||
}
|
||||
|
||||
// if ouput > input, then something's awry...
|
||||
if ( (sHundredsToHeal_Used + sHundredsToRepair_Used + sHundredsToPoisonCure_Used + sHundredsToDiseaseCure_Used) > usHealAmount )
|
||||
if ( (sHundredsToHeal_Used + sHundredsToRepair_Used + sHundredsToDiseaseCure_Used) > usHealAmount )
|
||||
ScreenMsg( FONT_MCOLOR_RED, MSG_TESTVERSION, L"Warning! HealPatient uses more points than it should!" );
|
||||
|
||||
return (sHundredsToHeal_Used + sHundredsToRepair_Used + sHundredsToPoisonCure_Used + sHundredsToDiseaseCure_Used);
|
||||
return (sHundredsToHeal_Used + sHundredsToRepair_Used + sHundredsToDiseaseCure_Used);
|
||||
}
|
||||
|
||||
|
||||
@@ -4137,17 +4069,7 @@ void HealHospitalPatient( SOLDIERTYPE *pPatient, UINT16 usHealingPtsLeft )
|
||||
|
||||
// heal person the amount / POINT_COST_PER_HEALTH_BELOW_OKLIFE
|
||||
pPatient->stats.bLife += ( bPointsToUse / gGameExternalOptions.ubPointCostPerHealthBelowOkLife );
|
||||
|
||||
// potentially increase bPoisonLife: as life points are healed, unhealed poinson points become healed poison points
|
||||
if ( pPatient->bPoisonSum > 0 )
|
||||
{
|
||||
// check if there are unhealed poison points
|
||||
if ( pPatient->bPoisonLife < pPatient->bPoisonSum )
|
||||
{
|
||||
pPatient->bPoisonLife = min( pPatient->bPoisonSum, (pPatient->bPoisonLife + ( bPointsToUse / gGameExternalOptions.ubPointCostPerHealthBelowOkLife ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// SANDRO - doctor trait - when being healed normally, reduce insta-healable HPs value
|
||||
if ( gGameOptions.fNewTraitSystem && pPatient->iHealableInjury > 0 )
|
||||
{
|
||||
@@ -4173,17 +4095,7 @@ void HealHospitalPatient( SOLDIERTYPE *pPatient, UINT16 usHealingPtsLeft )
|
||||
|
||||
// heal person the amount
|
||||
pPatient->stats.bLife += bPointsToUse;
|
||||
|
||||
// potentially increase bPoisonLife: as life points are healed, unhealed poinson points become healed poison points
|
||||
if ( pPatient->bPoisonSum > 0 )
|
||||
{
|
||||
// check if there are unhealed poison points
|
||||
if ( pPatient->bPoisonLife < pPatient->bPoisonSum )
|
||||
{
|
||||
pPatient->bPoisonLife = min( pPatient->bPoisonSum, (pPatient->bPoisonLife + bPointsToUse) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// SANDRO - doctor trait - when being healed normally, reduce insta-healable HPs value
|
||||
if ( gGameOptions.fNewTraitSystem && pPatient->iHealableInjury > 0 )
|
||||
{
|
||||
@@ -4192,22 +4104,9 @@ void HealHospitalPatient( SOLDIERTYPE *pPatient, UINT16 usHealingPtsLeft )
|
||||
pPatient->iHealableInjury = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// are here still points left to cure poison?
|
||||
if ( usHealingPtsLeft > 0 )
|
||||
{
|
||||
UINT16 usPoisonToCure = pPatient->bPoisonSum;
|
||||
|
||||
if ( usPoisonToCure > usHealingPtsLeft )
|
||||
usPoisonToCure = usHealingPtsLeft;
|
||||
|
||||
usHealingPtsLeft -= usPoisonToCure;
|
||||
|
||||
pPatient->bPoisonSum = max( 0, (pPatient->bPoisonSum - usPoisonToCure));
|
||||
}
|
||||
|
||||
|
||||
// if this patient is fully healed and cured
|
||||
if ( pPatient->stats.bLife == pPatient->stats.bLifeMax && pPatient->bPoisonSum == 0 )
|
||||
if ( pPatient->stats.bLife == pPatient->stats.bLifeMax )
|
||||
{
|
||||
AssignmentDone( pPatient, TRUE, TRUE );
|
||||
}
|
||||
@@ -7782,7 +7681,6 @@ void HandleNaturalHealing( void )
|
||||
void HandleHealingByNaturalCauses( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT32 uiPercentHealth = 0;
|
||||
UINT32 uiPercentPoison = 0;
|
||||
INT8 bActivityLevelDivisor = 0;
|
||||
UINT16 usFacilityModifier = 100;
|
||||
UINT8 ubAssignmentType = 0;
|
||||
@@ -7800,7 +7698,7 @@ void HandleHealingByNaturalCauses( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
// lost any pts?
|
||||
if ( pSoldier->stats.bLife == pSoldier->stats.bLifeMax && pSoldier->bPoisonLife == 0 && !pSoldier->HasDisease( FALSE, FALSE ) )
|
||||
if ( pSoldier->stats.bLife == pSoldier->stats.bLifeMax && !pSoldier->HasDisease( FALSE, FALSE ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -7850,10 +7748,7 @@ void HandleHealingByNaturalCauses( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// what percentage of health is he down to
|
||||
uiPercentHealth = ( pSoldier->stats.bLife * 100 ) / pSoldier->stats.bLifeMax;
|
||||
|
||||
// how much is he poisoned?
|
||||
uiPercentPoison = ( pSoldier->bPoisonSum * 100 ) / pSoldier->stats.bLifeMax;
|
||||
|
||||
|
||||
// SANDRO - experimental - increase health regeneration of soldiers when doctors are around
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
@@ -7894,12 +7789,7 @@ void HandleHealingByNaturalCauses( SOLDIERTYPE *pSoldier )
|
||||
// gain that many hundredths of life points back, divided by the activity level modifier
|
||||
pSoldier->sFractLife += ( INT16 ) ((( uiPercentHealth / bActivityLevelDivisor ) * usFacilityModifier) / 100 );
|
||||
}
|
||||
|
||||
// Flugente: reduce gained life because of poison
|
||||
// poison resistance reduces poison damage
|
||||
// a high activity level (stress) increases poisoning
|
||||
pSoldier->sFractLife -= ( INT16 ) ( (uiPercentPoison * (100 - pSoldier->GetPoisonResistance())/100) * gGameExternalOptions.sPoisonInfectionDamageMultiplier * ((99 + bActivityLevelDivisor)/100) );
|
||||
|
||||
|
||||
// Flugente: diseases can lower health regen
|
||||
for ( int i = 0; i < NUM_DISEASES; ++i )
|
||||
{
|
||||
@@ -7915,26 +7805,11 @@ void UpDateSoldierLife( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
// update soldier life, make sure we don't go out of bounds
|
||||
INT8 sAddedLife = pSoldier->sFractLife/100;
|
||||
|
||||
// if sAddedLife, it must be poison damage
|
||||
if ( sAddedLife < 0 )
|
||||
{
|
||||
// it is hereby possible to heal yourself through poison, if you have high absorption ( > 100%)
|
||||
INT8 sPoisonAbsorped = - (INT8) ( sAddedLife * (pSoldier->GetPoisonAbsorption()/100) );
|
||||
|
||||
sAddedLife += sPoisonAbsorped;
|
||||
|
||||
// if we're not fully poisoned, we are now poisoned a bit more, even if we won life thanks to absorption
|
||||
if ( pSoldier->bPoisonSum < pSoldier->stats.bLifeMax )
|
||||
{
|
||||
pSoldier->bPoisonSum += abs(sAddedLife);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INT8 oldlife = pSoldier->stats.bLife;
|
||||
pSoldier->stats.bLife += sAddedLife;
|
||||
|
||||
// if we fall below OKLIFE (can only be because of poison), we start bleeding again...
|
||||
// if we fall below OKLIFE, we start bleeding again...
|
||||
if ( pSoldier->stats.bLife < OKLIFE && oldlife >= OKLIFE && sAddedLife < 0 )
|
||||
{
|
||||
/*pSoldier->stats.bLife = 0;
|
||||
@@ -7942,11 +7817,6 @@ void UpDateSoldierLife( SOLDIERTYPE *pSoldier )
|
||||
HandleSoldierDeath( pSoldier, &fMadeCorpse );*/
|
||||
|
||||
pSoldier->bBleeding = pSoldier->stats.bLifeMax - pSoldier->stats.bLife;
|
||||
pSoldier->bPoisonBleeding = pSoldier->bPoisonSum - pSoldier->bPoisonLife;
|
||||
|
||||
/*pSoldier->bPoisonSum = 0;
|
||||
pSoldier->bPoisonLife = 0;
|
||||
pSoldier->bPoisonBleeding = 0;*/
|
||||
}
|
||||
|
||||
// SANDRO - when being healed normally, reduce insta-healable HPs value
|
||||
@@ -7967,7 +7837,7 @@ void UpDateSoldierLife( SOLDIERTYPE *pSoldier )
|
||||
// reduce
|
||||
pSoldier->stats.bLife = pSoldier->stats.bLifeMax;
|
||||
|
||||
// only set sFractLife to be 0 if > 0, saving possible poison damage
|
||||
// only set sFractLife to be 0 if > 0
|
||||
if ( pSoldier->sFractLife > 0 )
|
||||
pSoldier->sFractLife = 0;
|
||||
|
||||
@@ -14902,10 +14772,8 @@ void SetSoldierAssignment( SOLDIERTYPE *pSoldier, INT8 bAssignment, INT32 iParam
|
||||
case( ASSIGNMENT_HOSPITAL ):
|
||||
if( CanCharacterPatient( pSoldier ) )
|
||||
{
|
||||
|
||||
pSoldier->bOldAssignment = pSoldier->bAssignment;
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
|
||||
// set dirty flag
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -14925,8 +14793,7 @@ void SetSoldierAssignment( SOLDIERTYPE *pSoldier, INT8 bAssignment, INT32 iParam
|
||||
{
|
||||
SetTimeOfAssignmentChangeForMerc( pSoldier );
|
||||
}
|
||||
|
||||
|
||||
|
||||
RebuildCurrentSquad( );
|
||||
|
||||
ChangeSoldiersAssignment( pSoldier, ASSIGNMENT_HOSPITAL );
|
||||
@@ -16578,7 +16445,6 @@ void BandageBleedingDyingPatientsBeingTreated( )
|
||||
|
||||
// stop bleeding automatically
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
|
||||
if ( pSoldier->stats.bLife < OKLIFE )
|
||||
{
|
||||
@@ -16588,13 +16454,7 @@ void BandageBleedingDyingPatientsBeingTreated( )
|
||||
pSoldier->iHealableInjury -= ((OKLIFE - pSoldier->stats.bLife) * 100);
|
||||
}
|
||||
|
||||
// convert poison points to poison life points
|
||||
INT8 oldlife = pSoldier->stats.bLife;
|
||||
|
||||
pSoldier->stats.bLife = OKLIFE;
|
||||
|
||||
INT8 lifegained = OKLIFE - oldlife;
|
||||
pSoldier->bPoisonLife = min(pSoldier->bPoisonSum, pSoldier->bPoisonLife + lifegained);
|
||||
}
|
||||
}
|
||||
else // assigned to DOCTOR/PATIENT
|
||||
|
||||
@@ -748,9 +748,6 @@ void RefreshMerc( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
pSoldier->stats.bLife = pSoldier->stats.bLifeMax;
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bPoisonSum = 0;
|
||||
pSoldier->bPoisonLife = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
pSoldier->iHealableInjury = 0; // added by SANDRO
|
||||
pSoldier->bBreath = pSoldier->bBreathMax = 100;
|
||||
pSoldier->sBreathRed = 0;
|
||||
@@ -1245,51 +1242,27 @@ void RenderSoldierCellBars( SOLDIERCELL *pCell )
|
||||
//HEALTH BAR
|
||||
if( !pCell->pSoldier->stats.bLife )
|
||||
return;
|
||||
|
||||
//yellow one for bleeding
|
||||
iStartY = pCell->yp + 29 - 25*pCell->pSoldier->stats.bLifeMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+37, iStartY, pCell->xp+38, pCell->yp+29, Get16BPPColor( FROMRGB( 107, 107, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+38, iStartY, pCell->xp+39, pCell->yp+29, Get16BPPColor( FROMRGB( 222, 181, 115 ) ) );
|
||||
|
||||
// poisoned bleeding in purple
|
||||
if ( pCell->pSoldier->bPoisonBleeding )
|
||||
{
|
||||
iStartY = pCell->yp + 29 - 25*(pCell->pSoldier->stats.bLifeMax - pCell->pSoldier->bBleeding + pCell->pSoldier->bPoisonBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+37, iStartY, pCell->xp+38, pCell->yp+29, Get16BPPColor( FROMRGB( 107, 57, 107 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+38, iStartY, pCell->xp+39, pCell->yp+29, Get16BPPColor( FROMRGB( 222, 115, 181 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//pink one for bandaged.
|
||||
iStartY = pCell->yp + 29 - 25*(pCell->pSoldier->stats.bLifeMax - pCell->pSoldier->bBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+37, iStartY, pCell->xp+38, pCell->yp+29, Get16BPPColor( FROMRGB( 156, 57, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+38, iStartY, pCell->xp+39, pCell->yp+29, Get16BPPColor( FROMRGB( 222, 132, 132 ) ) );
|
||||
|
||||
// get amount of poisoned bandage
|
||||
INT8 bPoisonBandage = pCell->pSoldier->bPoisonSum - pCell->pSoldier->bPoisonBleeding - pCell->pSoldier->bPoisonLife;
|
||||
if ( bPoisonBandage )
|
||||
{
|
||||
// poisoned bandage in bright green
|
||||
iStartY = pCell->yp + 29 - 25*(pCell->pSoldier->stats.bLife + bPoisonBandage)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+37, iStartY, pCell->xp+38, pCell->yp+29, Get16BPPColor( FROMRGB( 57, 156, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+38, iStartY, pCell->xp+39, pCell->yp+29, Get16BPPColor( FROMRGB( 132, 222, 132 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//red one for actual health
|
||||
iStartY = pCell->yp + 29 - 25*pCell->pSoldier->stats.bLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+37, iStartY, pCell->xp+38, pCell->yp+29, Get16BPPColor( FROMRGB( 107, 8, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+38, iStartY, pCell->xp+39, pCell->yp+29, Get16BPPColor( FROMRGB( 206, 0, 0 ) ) );
|
||||
|
||||
// poisoned life
|
||||
if ( pCell->pSoldier->bPoisonLife )
|
||||
{
|
||||
iStartY = pCell->yp + 29 - 25*pCell->pSoldier->bPoisonLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+37, iStartY, pCell->xp+38, pCell->yp+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+38, iStartY, pCell->xp+39, pCell->yp+29, Get16BPPColor( FROMRGB( 0, 206, 0 ) ) );
|
||||
}
|
||||
|
||||
//BREATH BAR
|
||||
iStartY = pCell->yp + 29 - 25*pCell->pSoldier->bBreathMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+41, iStartY, pCell->xp+42, pCell->yp+29, Get16BPPColor( FROMRGB( 8, 8, 132 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+42, iStartY, pCell->xp+43, pCell->yp+29, Get16BPPColor( FROMRGB( 8, 8, 107 ) ) );
|
||||
|
||||
//MORALE BAR
|
||||
iStartY = pCell->yp + 29 - 25*pCell->pSoldier->aiData.bMorale/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+45, iStartY, pCell->xp+46, pCell->yp+29, Get16BPPColor( FROMRGB( 8, 156, 8 ) ) );
|
||||
|
||||
@@ -1769,7 +1769,7 @@ void HandleRisksForSoldierFacilityAssignment( SOLDIERTYPE *pSoldier, UINT8 ubFac
|
||||
if (Result < 0)
|
||||
{
|
||||
// Soldier is suffering direct unbandaged injury.
|
||||
pSoldier->SoldierTakeDamage( 0, abs(Result), 0, abs(Result), TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, FALSE );
|
||||
pSoldier->SoldierTakeDamage( 0, abs(Result), abs(Result), TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, FALSE );
|
||||
fBadResult = TRUE;
|
||||
|
||||
// SANDRO - add to merc records - facility accidents counter
|
||||
|
||||
@@ -2017,17 +2017,7 @@ void UpdateCharRegionHelpText( void )
|
||||
{
|
||||
// person (health/energy/morale)
|
||||
GetMoraleString( pSoldier, pMoraleStr );
|
||||
|
||||
if ( pSoldier->bPoisonSum )
|
||||
{
|
||||
INT8 bPoisonBandaged = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
swprintf( sString, L"%s: %d/%d, %s: %d/%d/%d - %d, %s: %d/%d, %s: %s",
|
||||
pMapScreenStatusStrings[ 0 ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax,
|
||||
pMapScreenStatusStrings[ 5 ], pSoldier->bPoisonBleeding, bPoisonBandaged, pSoldier->bPoisonLife, pSoldier->bPoisonSum,
|
||||
pMapScreenStatusStrings[ 1 ], pSoldier->bBreath, pSoldier->bBreathMax,
|
||||
pMapScreenStatusStrings[ 2 ], pMoraleStr );
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
swprintf( sString, L"%s: %d/%d, %s: %d/%d, %s: %s",
|
||||
pMapScreenStatusStrings[ 0 ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax,
|
||||
@@ -5528,48 +5518,21 @@ void RenderSoldierSmallFaceForUpdatePanel( INT32 iIndex, INT32 iX, INT32 iY )
|
||||
if( !pSoldier->stats.bLife )
|
||||
return;
|
||||
|
||||
|
||||
//yellow one for bleeding
|
||||
iStartY = iY + 29 - 27*pSoldier->stats.bLifeMax/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+36, iStartY, iX+37, iY+29, Get16BPPColor( FROMRGB( 107, 107, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+37, iStartY, iX+38, iY+29, Get16BPPColor( FROMRGB( 222, 181, 115 ) ) );
|
||||
|
||||
if ( pSoldier->bPoisonBleeding )
|
||||
{
|
||||
// poisoned bleeding in purple
|
||||
iStartY = iY + 29 - 27*(pSoldier->stats.bLifeMax - pSoldier->bBleeding + pSoldier->bPoisonBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+36, iStartY, iX+37, iY+29, Get16BPPColor( FROMRGB( 107, 57, 107 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+37, iStartY, iX+38, iY+29, Get16BPPColor( FROMRGB( 222, 115, 181 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//pink one for bandaged.
|
||||
iStartY = iY + 29 - 27*(pSoldier->stats.bLifeMax - pSoldier->bBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+36, iStartY, iX+37, iY+29, Get16BPPColor( FROMRGB( 156, 57, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+37, iStartY, iX+38, iY+29, Get16BPPColor( FROMRGB( 222, 132, 132 ) ) );
|
||||
|
||||
// get amount of poisoned bandage
|
||||
INT8 bPoisonBandage = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
if ( bPoisonBandage )
|
||||
{
|
||||
// poisoned bandage in bright green
|
||||
iStartY = iY + 29 - 27*(pSoldier->stats.bLife + bPoisonBandage)/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+36, iStartY, iX+37, iY+29, Get16BPPColor( FROMRGB( 57, 156, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+37, iStartY, iX+38, iY+29, Get16BPPColor( FROMRGB( 132, 222, 132 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//red one for actual health
|
||||
iStartY = iY + 29 - 27*pSoldier->stats.bLife/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+36, iStartY, iX+37, iY+29, Get16BPPColor( FROMRGB( 107, 8, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+37, iStartY, iX+38, iY+29, Get16BPPColor( FROMRGB( 206, 0, 0 ) ) );
|
||||
|
||||
// poisoned life
|
||||
if ( pSoldier->bPoisonLife )
|
||||
{
|
||||
iStartY = iY + 29 - 27*pSoldier->bPoisonLife/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+36, iStartY, iX+37, iY+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+37, iStartY, iX+38, iY+29, Get16BPPColor( FROMRGB( 0, 206, 0 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//BREATH BAR
|
||||
iStartY = iY + 29 - 27*pSoldier->bBreathMax/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+39, iStartY, iX+40, iY+29, Get16BPPColor( FROMRGB( 8, 8, 132 ) ) );
|
||||
@@ -5579,9 +5542,6 @@ void RenderSoldierSmallFaceForUpdatePanel( INT32 iIndex, INT32 iX, INT32 iY )
|
||||
iStartY = iY + 29 - 27*pSoldier->aiData.bMorale/100;
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+42, iStartY, iX+43, iY+29, Get16BPPColor( FROMRGB( 8, 156, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, iX+43, iStartY, iX+44, iY+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ContinueUpdateButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
@@ -2585,7 +2585,6 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
|
||||
|
||||
//Bandaging him would prevent him from dying (due to low HP)
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
|
||||
// wake him up
|
||||
if ( pSoldier->flags.fMercAsleep )
|
||||
@@ -2605,21 +2604,7 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
pSoldier->stats.bLife += (INT8)(10 - Random( 21 ) );
|
||||
}
|
||||
|
||||
// adjust poison points
|
||||
INT8 lifechanged = pSoldier->stats.bLife - oldlife;
|
||||
if ( lifechanged < 0 )
|
||||
{
|
||||
// add a bit of poisoning...
|
||||
pSoldier->bPoisonSum = min(pSoldier->bPoisonSum + 10, pSoldier->stats.bLifeMax);
|
||||
|
||||
pSoldier->bPoisonLife = min(pSoldier->bPoisonSum, pSoldier->stats.bLife);
|
||||
}
|
||||
else if ( lifechanged > 0)
|
||||
{
|
||||
pSoldier->bPoisonLife = min(pSoldier->bPoisonSum, pSoldier->stats.bLife);
|
||||
}
|
||||
|
||||
|
||||
// SANDRO - make the lost life insta-healable
|
||||
pSoldier->iHealableInjury = ((pSoldier->stats.bLifeMax - pSoldier->stats.bLife) * 100);
|
||||
|
||||
|
||||
@@ -1211,7 +1211,6 @@ BOOLEAN RemoveFacesForAutoBandage( void )
|
||||
|
||||
BOOLEAN RenderSoldierSmallFaceForAutoBandagePanel( INT32 iIndex, INT16 sCurrentXPosition, INT16 sCurrentYPosition )
|
||||
{
|
||||
|
||||
INT32 iStartY = 0;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
INT32 iCounter = 0, iIndexCount = 0;
|
||||
@@ -1230,12 +1229,12 @@ BOOLEAN RenderSoldierSmallFaceForAutoBandagePanel( INT32 iIndex, INT16 sCurrentX
|
||||
BltVideoObject( FRAME_BUFFER , hHandle , 0, sCurrentXPosition+2, sCurrentYPosition+2, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
|
||||
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; ++iCounter )
|
||||
{
|
||||
// find a free slot
|
||||
if( iDoctorList[ iCounter ] != -1 )
|
||||
{
|
||||
iIndexCount++;
|
||||
++iIndexCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1254,49 +1253,22 @@ BOOLEAN RenderSoldierSmallFaceForAutoBandagePanel( INT32 iIndex, INT16 sCurrentX
|
||||
// is the merc alive?
|
||||
if( !pSoldier->stats.bLife )
|
||||
return( FALSE );
|
||||
|
||||
|
||||
|
||||
//yellow one for bleeding
|
||||
iStartY = sCurrentYPosition + 29 - 27*pSoldier->stats.bLifeMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+36, iStartY, sCurrentXPosition+37, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 107, 107, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+37, iStartY, sCurrentXPosition+38, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 222, 181, 115 ) ) );
|
||||
|
||||
// poisoned bleeding in purple
|
||||
if ( pSoldier->bPoisonBleeding )
|
||||
{
|
||||
iStartY = sCurrentYPosition + 29 - 27*(pSoldier->stats.bLifeMax - pSoldier->bBleeding + pSoldier->bPoisonBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+36, iStartY, sCurrentXPosition+37, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 107, 57, 107 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+37, iStartY, sCurrentXPosition+38, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 222, 115, 181 ) ) );
|
||||
}
|
||||
|
||||
//pink one for bandaged.
|
||||
iStartY = sCurrentYPosition + 29 - 27*(pSoldier->stats.bLifeMax - pSoldier->bBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+36, iStartY, sCurrentXPosition+37, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 156, 57, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+37, iStartY, sCurrentXPosition+38, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 222, 132, 132 ) ) );
|
||||
|
||||
// get amount of poisoned bandage
|
||||
INT8 bPoisonBandage = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
if ( bPoisonBandage )
|
||||
{
|
||||
// poisoned bandage in bright green
|
||||
iStartY = sCurrentYPosition + 29 - 27*(pSoldier->stats.bLife + bPoisonBandage)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+36, iStartY, sCurrentXPosition+37, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 57, 156, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+37, iStartY, sCurrentXPosition+38, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 132, 222, 132 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//red one for actual health
|
||||
iStartY = sCurrentYPosition + 29 - 27*pSoldier->stats.bLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+36, iStartY, sCurrentXPosition+37, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 107, 8, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+37, iStartY, sCurrentXPosition+38, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 206, 0, 0 ) ) );
|
||||
|
||||
// poisoned life
|
||||
if ( pSoldier->bPoisonLife )
|
||||
{
|
||||
iStartY = sCurrentYPosition + 29 - 27*pSoldier->bPoisonLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+36, iStartY, sCurrentXPosition+37, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+37, iStartY, sCurrentXPosition+38, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 0, 206, 0 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//BREATH BAR
|
||||
iStartY = sCurrentYPosition + 29 - 27*pSoldier->bBreathMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sCurrentXPosition+39, iStartY, sCurrentXPosition+40, sCurrentYPosition+29, Get16BPPColor( FROMRGB( 8, 8, 132 ) ) );
|
||||
|
||||
@@ -359,7 +359,6 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
|
||||
if ( pSoldier->bRegenerationCounter > 0)
|
||||
{
|
||||
// increase life
|
||||
pSoldier->bPoisonLife = max(pSoldier->bPoisonSum, pSoldier->bPoisonLife + pSoldier->stats.bLife - __min( pSoldier->stats.bLife + LIFE_GAIN_PER_REGEN_POINT, pSoldier->stats.bLifeMax ) );
|
||||
pSoldier->stats.bLife = __min( pSoldier->stats.bLife + LIFE_GAIN_PER_REGEN_POINT, pSoldier->stats.bLifeMax );
|
||||
|
||||
//SANDRO - Insta-healable injury reduction
|
||||
@@ -371,14 +370,12 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
|
||||
if ( pSoldier->stats.bLife == pSoldier->stats.bLifeMax )
|
||||
{
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
pSoldier->iHealableInjury = 0;
|
||||
}
|
||||
else if ( pSoldier->bBleeding + pSoldier->stats.bLife > pSoldier->stats.bLifeMax )
|
||||
{
|
||||
// got to reduce amount of bleeding
|
||||
pSoldier->bBleeding = (pSoldier->stats.bLifeMax - pSoldier->stats.bLife);
|
||||
pSoldier->bPoisonBleeding = min(pSoldier->bPoisonBleeding, (pSoldier->stats.bLifeMax - pSoldier->stats.bLife));
|
||||
}
|
||||
|
||||
// decrement counter
|
||||
@@ -416,25 +413,7 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
pSoldier->EVENT_SoldierGotHit( 0, 10, 0, pSoldier->ubDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pSoldier->bAimShotLocation, 0, -1 );
|
||||
}
|
||||
|
||||
// if we took an antidote, reduce poisoning
|
||||
if ( pSoldier->drugs.bDrugEffect[ DRUG_TYPE_CUREPOISON ] > 0 )
|
||||
{
|
||||
if ( pSoldier->bPoisonSum > 0 )
|
||||
{
|
||||
if ( pSoldier->bPoisonBleeding > 0 )
|
||||
{
|
||||
pSoldier->bPoisonBleeding--;
|
||||
}
|
||||
else if ( pSoldier->bPoisonLife > 0 )
|
||||
{
|
||||
pSoldier->bPoisonLife--;
|
||||
}
|
||||
|
||||
pSoldier->bPoisonSum--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// etorphine stuns while it lasts. It can also damage and possibly kill the target if overdosed. The dosage depends on our bodytype
|
||||
if ( pSoldier->drugs.bDrugEffect[ DRUG_TYPE_STUNANDKILL ] )
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ enum {
|
||||
DRUG_TYPE_VISION,
|
||||
DRUG_TYPE_TUNNELVISION,
|
||||
DRUG_TYPE_LIFEDAMAGE,
|
||||
DRUG_TYPE_CUREPOISON, // 20
|
||||
DRUG_TYPE_CUREPOISON, // 20 // not used anymore!
|
||||
DRUG_TYPE_STUNANDKILL,
|
||||
};
|
||||
|
||||
|
||||
+3
-22
@@ -170,16 +170,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, BOOLEAN fForce, B
|
||||
|
||||
// determine the max nutritional value
|
||||
INT32 maxpts = max(Food[foodtype].bFoodPoints, Food[foodtype].bDrinkPoints);
|
||||
|
||||
// divide by 100 (poison sum is in [0, 99]
|
||||
// multiply with 0.25 for more reasonable values
|
||||
INT8 poisonadd = (INT8)(maxpts * (1.0 - foodcondition) * 0.025 );
|
||||
|
||||
// added a max threshold to food poisoning
|
||||
poisonadd = min(poisonadd, gGameExternalOptions.usFoodMaxPoisoning),
|
||||
|
||||
pSoldier->AddPoison(poisonadd);
|
||||
|
||||
|
||||
// we might get a disease from this...
|
||||
FLOAT modifier = 1.0f - 2 * foodcondition;
|
||||
HandlePossibleInfection( pSoldier, NULL, type == AP_EAT ? INFECTION_TYPE_BADFOOD : INFECTION_TYPE_BADWATER, modifier );
|
||||
@@ -456,12 +447,7 @@ void HourlyFoodSituationUpdate( SOLDIERTYPE *pSoldier )
|
||||
pSoldier->stats.bLifeMax = max(2, pSoldier->stats.bLifeMax - numberofreduces);
|
||||
pSoldier->stats.bLife = min(pSoldier->stats.bLife, pSoldier->stats.bLifeMax);
|
||||
pSoldier->bBleeding = min(pSoldier->bBleeding, pSoldier->stats.bLifeMax);
|
||||
|
||||
// adjust poison values
|
||||
pSoldier->bPoisonSum = min(pSoldier->bPoisonSum, pSoldier->stats.bLifeMax);
|
||||
pSoldier->bPoisonLife = min(pSoldier->bPoisonLife, pSoldier->bPoisonSum);
|
||||
pSoldier->bPoisonBleeding = min(pSoldier->bPoisonBleeding, pSoldier->bBleeding);
|
||||
|
||||
|
||||
pSoldier->usStarveDamageHealth += oldlife - pSoldier->stats.bLifeMax;
|
||||
|
||||
// Update Profile
|
||||
@@ -542,12 +528,7 @@ void HourlyFoodSituationUpdate( SOLDIERTYPE *pSoldier )
|
||||
pSoldier->stats.bLifeMax = max(2, pSoldier->stats.bLifeMax - numberofreduces);
|
||||
pSoldier->stats.bLife = min(pSoldier->stats.bLife, pSoldier->stats.bLifeMax);
|
||||
pSoldier->bBleeding = min(pSoldier->bBleeding, pSoldier->stats.bLifeMax);
|
||||
|
||||
// adjust poison values
|
||||
pSoldier->bPoisonSum = min(pSoldier->bPoisonSum, pSoldier->stats.bLifeMax);
|
||||
pSoldier->bPoisonLife = min(pSoldier->bPoisonLife, pSoldier->bPoisonSum);
|
||||
pSoldier->bPoisonBleeding = min(pSoldier->bPoisonBleeding, pSoldier->bBleeding);
|
||||
|
||||
|
||||
pSoldier->usStarveDamageHealth += oldlife - pSoldier->stats.bLifeMax;
|
||||
|
||||
// Update Profile
|
||||
|
||||
@@ -5347,7 +5347,7 @@ void SetOffBoobyTrapInMapScreen( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject )
|
||||
}
|
||||
|
||||
// injure the inventory character
|
||||
pSoldier->SoldierTakeDamage( 0, ubPtsDmg, 0, ubPtsDmg, TAKE_DAMAGE_EXPLOSION, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, ubPtsDmg, ubPtsDmg, TAKE_DAMAGE_EXPLOSION, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
// play the sound
|
||||
PlayJA2Sample( EXPLOSION_1, RATE_11025, BTNVOLUME, 1, MIDDLEPAN );
|
||||
|
||||
@@ -2277,7 +2277,6 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
DeleteTalkingMenu();
|
||||
SetSoldierNeutral( pSoldier );
|
||||
pSoldier->bBleeding = 0; // make sure he doesn't bleed now...
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
RecalculateOppCntsDueToBecomingNeutral( pSoldier );
|
||||
if ( gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
@@ -4515,10 +4514,7 @@ UINT32 CalcPatientMedicalCost( SOLDIERTYPE * pSoldier )
|
||||
// charge additional $25 for every point below OKLIFE he is
|
||||
uiCost += ( 25 * ( OKLIFE - pSoldier->stats.bLife ) );
|
||||
}
|
||||
|
||||
// charge additional $13 for every poison point that has to be cured
|
||||
uiCost += 13 * pSoldier->bPoisonSum;
|
||||
|
||||
|
||||
// also charge $2 for each point of bleeding that must be stopped
|
||||
if ( pSoldier->bBleeding > 0 )
|
||||
{
|
||||
|
||||
@@ -1945,9 +1945,6 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////// POISON PERCENTAGE
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 4 ] );
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem ) // Flugente
|
||||
{
|
||||
//////////////////// DIRT MODIFICATOR
|
||||
@@ -4037,21 +4034,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////// poison percentage
|
||||
// only draw if item is poisoned in any way
|
||||
if ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) )
|
||||
{
|
||||
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here?
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 56 ], szUDBAdvStatsExplanationsTooltipText[ 56 ]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
///////////////////// DIRT MODIFICATOR
|
||||
@@ -4642,9 +4625,6 @@ void DrawAmmoStats( OBJECTTYPE * gpItemDescObject )
|
||||
}
|
||||
}
|
||||
|
||||
//////////////// POISON PERCENTAGE
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWH40KIcon, 0, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem ) // Flugente
|
||||
{
|
||||
//////////////// DIRT MODIFICATOR
|
||||
@@ -5737,20 +5717,7 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////// poison percentage
|
||||
// only draw if item is poisoned in any way
|
||||
if ( ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) ) ||
|
||||
( fComparisonMode && ( Item[gpComparedItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpComparedItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) ) ) )
|
||||
{
|
||||
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // new index line here?
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWH40KIcon, 0, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ||
|
||||
@@ -8998,42 +8965,7 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
|
||||
DrawPropertyValueInColourFloat( Comparedfinalvalue - finalvalue, ubNumLine, 3, fComparisonMode, FALSE, FALSE, 0, 0.0f, 2 );
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////// POISON PERCENTAGE
|
||||
// Set line to draw into
|
||||
ubNumLine = 4;
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescGenRegions[ubNumLine][1].sTop;
|
||||
sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop;
|
||||
|
||||
// base modificator
|
||||
INT16 basevalue = AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage;
|
||||
INT16 modificator = 0; // Does not exist (yet?)
|
||||
INT16 finalvalue = basevalue - modificator;
|
||||
|
||||
if( !fComparisonMode )
|
||||
{
|
||||
// Print base value
|
||||
DrawPropertyValueInColour( basevalue, ubNumLine, 1, fComparisonMode, FALSE, TRUE );
|
||||
// Print modifier
|
||||
DrawPropertyTextInColour( L"--", ubNumLine, 2, fComparisonMode );
|
||||
// Print final value
|
||||
DrawPropertyValueInColour( finalvalue, ubNumLine, 3, fComparisonMode, FALSE, TRUE, FONT_MCOLOR_WHITE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// base modificator
|
||||
INT16 Comparedbasevalue = AmmoTypes[Magazine[ Item[ gpComparedItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage;
|
||||
INT16 Comparedmodificator = 0; // Does not exist (yet?)
|
||||
INT16 Comparedfinalvalue = Comparedbasevalue - Comparedmodificator;
|
||||
// Print difference in base value
|
||||
DrawPropertyValueInColour( Comparedbasevalue - basevalue, ubNumLine, 1, fComparisonMode, FALSE, TRUE );
|
||||
// Print difference in modifier
|
||||
DrawPropertyTextInColour( L"=", ubNumLine, 2 );
|
||||
// Print difference in final value
|
||||
DrawPropertyValueInColour( Comparedfinalvalue - finalvalue, ubNumLine, 3, fComparisonMode, FALSE, TRUE );
|
||||
}
|
||||
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem ) // Flugente
|
||||
{
|
||||
///////////////////// DIRT MODIFICATOR
|
||||
@@ -13818,78 +13750,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
||||
///////////////////// DAMAGE THRESHOLD MODIFIER
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente Zombies
|
||||
///////////////////// poison percentage
|
||||
iModifier[0] = Item[gpItemDescObject->usItem].bPoisonPercentage;
|
||||
|
||||
UINT8 ammotype = (*gpItemDescObject)[0]->data.gun.ubGunAmmoType; // ... get type of ammunition used ...
|
||||
|
||||
iModifier[1] = AmmoTypes[ammotype].poisonPercentage;
|
||||
iModifier[2] = iModifier[0] + iModifier[1];
|
||||
|
||||
if( fComparisonMode )
|
||||
{
|
||||
iComparedModifier[0] = Item[gpComparedItemDescObject->usItem].bPoisonPercentage;
|
||||
|
||||
UINT8 comparedammotype = (*gpComparedItemDescObject)[0]->data.gun.ubGunAmmoType;
|
||||
|
||||
iComparedModifier[1] = AmmoTypes[comparedammotype].poisonPercentage;
|
||||
iComparedModifier[2] = iComparedModifier[0] + iComparedModifier[1];
|
||||
}
|
||||
|
||||
// only draw if item is poisoned in any way
|
||||
if ( ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 ) ||
|
||||
( fComparisonMode && ( iComparedModifier[0] != 0 || iComparedModifier[1] != 0 || iComparedModifier[2] != 0 ) ) )
|
||||
{
|
||||
if (!fDrawGenIndexes) fDrawGenIndexes = ++cnt; // insert Indexes here?
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
|
||||
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
|
||||
|
||||
// Print Values
|
||||
for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
|
||||
{
|
||||
SetRGBFontForeground( 0, 255, 0 );
|
||||
sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
|
||||
sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
|
||||
if( fComparisonMode )
|
||||
{
|
||||
iModifier[cnt2] = iComparedModifier[cnt2] - iModifier[cnt2];
|
||||
}
|
||||
if (iModifier[cnt2] > 0)
|
||||
{
|
||||
swprintf( pStr, L"%d", iModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else if (iFloatModifier[cnt2] < 0)
|
||||
{
|
||||
swprintf( pStr, L"%d", iModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, L"--" );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
}
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if ( ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ||
|
||||
@@ -13997,7 +13858,6 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
||||
if ( iFloatModifier[0] < 0.5f )
|
||||
{
|
||||
iModifier[1] = (INT16)( max( Food[fFoodtype].bFoodPoints, Food[fFoodtype].bDrinkPoints ) * (1.0 - iFloatModifier[0]) * 0.025 );//Poison formula coppied from food.cpp
|
||||
iModifier[1] = min( iModifier[1], gGameExternalOptions.usFoodMaxPoisoning );
|
||||
}
|
||||
else
|
||||
iModifier[1] = 0;
|
||||
@@ -14010,7 +13870,6 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
||||
if ( iComparedFloatModifier[0] < 0.5f )
|
||||
{
|
||||
iComparedModifier[1] = (INT16)( max( Food[fComparedFoodtype].bFoodPoints, Food[fComparedFoodtype].bDrinkPoints ) * (1.0 - iComparedFloatModifier[0]) * 0.025 );//Poison formula coppied from food.cpp
|
||||
iComparedModifier[1] = min( iComparedModifier[1], gGameExternalOptions.usFoodMaxPoisoning );
|
||||
}
|
||||
else
|
||||
iComparedModifier[1] = 0;
|
||||
|
||||
@@ -14499,30 +14499,20 @@ void UpdateMercBodyRegionHelpText( )
|
||||
{
|
||||
// person (health/energy/morale)
|
||||
GetMoraleString( pSoldier, pMoraleStr );
|
||||
|
||||
if ( pSoldier->bPoisonSum )
|
||||
{
|
||||
INT8 bPoisonBandaged = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
swprintf( sString, L"%s: %d/%d, %s: %d/%d/%d - %d, %s: %d/%d, %s: %s",
|
||||
pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax,
|
||||
pMapScreenStatusStrings[5], pSoldier->bPoisonBleeding, bPoisonBandaged, pSoldier->bPoisonLife, pSoldier->bPoisonSum,
|
||||
pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax,
|
||||
pMapScreenStatusStrings[2], pMoraleStr );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( sString, L"%s: %d/%d, %s: %d/%d, %s: %s",
|
||||
pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax,
|
||||
pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax,
|
||||
pMapScreenStatusStrings[2], pMoraleStr );
|
||||
}
|
||||
|
||||
{
|
||||
swprintf( sString, L"%s: %d/%d, %s: %d/%d, %s: %s",
|
||||
pMapScreenStatusStrings[0], pSoldier->stats.bLife, pSoldier->stats.bLifeMax,
|
||||
pMapScreenStatusStrings[1], pSoldier->bBreath, pSoldier->bBreathMax,
|
||||
pMapScreenStatusStrings[2], pMoraleStr );
|
||||
}
|
||||
|
||||
pSoldier->PrintFoodDesc( sString, TRUE );
|
||||
|
||||
pSoldier->PrintDiseaseDesc( sString, TRUE );
|
||||
}
|
||||
pSoldier->PrintDiseaseDesc( sString, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetRegionFastHelpText( &gSMInvCamoRegion, sString );
|
||||
}
|
||||
|
||||
@@ -2976,27 +2976,13 @@ void RenderSMPanel( BOOLEAN *pfDirty )
|
||||
// Flugente: food info if food system is active
|
||||
if ( gGameOptions.fFoodSystem && gpSMCurrentMerc->ubProfile != ROBOT && !IsVehicle(gpSMCurrentMerc) )
|
||||
{
|
||||
// Flugente: added a display for poison, only show text if actually poisoned
|
||||
if ( gpSMCurrentMerc->bPoisonSum > 0 )
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_POISON_AND_FOOD_POPUPTEXT ], gpSMCurrentMerc->stats.bLife, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bPoisonSum, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bBreath, gpSMCurrentMerc->bBreathMax, pMoraleStr, (INT32)(100*(gpSMCurrentMerc->bDrinkLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%", (INT32)(100*(gpSMCurrentMerc->bFoodLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%" );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_FOOD_POPUPTEXT ], gpSMCurrentMerc->stats.bLife, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bBreath, gpSMCurrentMerc->bBreathMax, pMoraleStr, (INT32)(100*(gpSMCurrentMerc->bDrinkLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%", (INT32)(100*(gpSMCurrentMerc->bFoodLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%" );
|
||||
}
|
||||
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_FOOD_POPUPTEXT ], gpSMCurrentMerc->stats.bLife, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bBreath, gpSMCurrentMerc->bBreathMax, pMoraleStr, (INT32)(100*(gpSMCurrentMerc->bDrinkLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%", (INT32)(100*(gpSMCurrentMerc->bFoodLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%" );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Flugente: added a display for poison, only show text if actually poisoned
|
||||
if ( gpSMCurrentMerc->bPoisonSum > 0 )
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_POISON_POPUPTEXT ], gpSMCurrentMerc->stats.bLife, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bPoisonSum, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bBreath, gpSMCurrentMerc->bBreathMax, pMoraleStr );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_POPUPTEXT ], gpSMCurrentMerc->stats.bLife, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bBreath, gpSMCurrentMerc->bBreathMax, pMoraleStr );
|
||||
}
|
||||
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_POPUPTEXT ], gpSMCurrentMerc->stats.bLife, gpSMCurrentMerc->stats.bLifeMax, gpSMCurrentMerc->bBreath, gpSMCurrentMerc->bBreathMax, pMoraleStr );
|
||||
}
|
||||
|
||||
{
|
||||
@@ -5573,27 +5559,11 @@ void RenderTEAMPanel( BOOLEAN fDirty )
|
||||
|
||||
if ( gGameOptions.fFoodSystem && pSoldier->ubProfile != ROBOT && !IsVehicle(pSoldier) )
|
||||
{
|
||||
// Flugente: added a display for poison, only show text if actually poisoned
|
||||
if ( pSoldier->bPoisonSum > 0 )
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_POISON_AND_FOOD_POPUPTEXT ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, pSoldier->bPoisonSum, pSoldier->stats.bLifeMax, pSoldier->bBreath, pSoldier->bBreathMax, pMoraleStr, (INT32)(100*(pSoldier->bDrinkLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%", (INT32)(100*(pSoldier->bFoodLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%" );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_FOOD_POPUPTEXT ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, pSoldier->bBreath, pSoldier->bBreathMax, pMoraleStr, (INT32)(100*(pSoldier->bDrinkLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%", (INT32)(100*(pSoldier->bFoodLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%" );
|
||||
}
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_FOOD_POPUPTEXT ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, pSoldier->bBreath, pSoldier->bBreathMax, pMoraleStr, (INT32)(100*(pSoldier->bDrinkLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%", (INT32)(100*(pSoldier->bFoodLevel - FOOD_MIN) / FOOD_HALF_RANGE), L"%" );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Flugente: added a display for poison, only show text if actually poisoned
|
||||
if ( pSoldier->bPoisonSum > 0 )
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_WITH_POISON_POPUPTEXT ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, pSoldier->bPoisonSum, pSoldier->stats.bLifeMax, pSoldier->bBreath, pSoldier->bBreathMax, pMoraleStr );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_POPUPTEXT ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, pSoldier->bBreath, pSoldier->bBreathMax, pMoraleStr );
|
||||
}
|
||||
swprintf( pStr, TacticalStr[ MERC_VITAL_STATS_POPUPTEXT ], pSoldier->stats.bLife, pSoldier->stats.bLifeMax, pSoldier->bBreath, pSoldier->bBreathMax, pMoraleStr );
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -29,13 +29,6 @@
|
||||
#define BLEEDING_BAR_SHADOW FROMRGB( 128, 128, 60 )
|
||||
#define BLEEDING_BAR FROMRGB( 240, 240, 20 )
|
||||
|
||||
#define POISON_LIFE_BAR_SHADOW FROMRGB( 12, 108, 12 )
|
||||
#define POISON_LIFE_BAR FROMRGB( 0, 200, 0 )
|
||||
#define POISON_BANDAGE_BAR_SHADOW FROMRGB( 80, 186, 80 )
|
||||
#define POISON_BANDAGE_BAR FROMRGB( 152, 252, 152 )
|
||||
#define POISON_BLEEDING_BAR_SHADOW FROMRGB( 128, 60, 128 )
|
||||
#define POISON_BLEEDING_BAR FROMRGB( 240, 20, 240 )
|
||||
|
||||
#define CURR_BREATH_BAR_SHADOW FROMRGB( 17, 24, 170 ) // the lt blue current breath
|
||||
#define CURR_BREATH_BAR FROMRGB( 46, 51, 243 )
|
||||
#define CURR_MAX_BREATH FROMRGB( 0, 0, 0 ) // the current max breath, black
|
||||
@@ -183,24 +176,7 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
|
||||
usLineColor = Get16BPPColor( LIFE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
|
||||
// poisoned life first
|
||||
if ( pSoldier->bPoisonLife )
|
||||
{
|
||||
dPercentage = (FLOAT)pSoldier->bPoisonLife / (FLOAT)100;
|
||||
FLOAT dpoisonStart = (FLOAT)( dstart1 );
|
||||
FLOAT dpoisonEnd = dPercentage * sHeight;
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_LIFE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dpoisonStart, sXPos, (INT32)( dpoisonStart - dpoisonEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_LIFE_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dpoisonStart, sXPos + 1, (INT32)( dpoisonStart - dpoisonEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_LIFE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dpoisonStart, sXPos + 2, (INT32)( dpoisonStart - dpoisonEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
|
||||
// NOW DO BANDAGE
|
||||
|
||||
// Calculate bandage
|
||||
@@ -223,24 +199,6 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
// get amount of poisoned bandage
|
||||
INT8 bPoisonBandage = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
if ( bPoisonBandage )
|
||||
{
|
||||
dPercentage = (FLOAT)bPoisonBandage / (FLOAT)100;
|
||||
FLOAT dpoisonStart = (FLOAT)( dstart2 );
|
||||
FLOAT dpoisonEnd = dPercentage * sHeight;
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_BANDAGE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dpoisonStart, sXPos, (INT32)( dpoisonStart - dpoisonEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_BANDAGE_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dpoisonStart, sXPos + 1, (INT32)( dpoisonStart - dpoisonEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_BANDAGE_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dpoisonStart, sXPos + 2, (INT32)( dpoisonStart - dpoisonEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
// NOW DO BLEEDING
|
||||
FLOAT dstart3 = dStart - dEnd;
|
||||
if ( pSoldier->bBleeding )
|
||||
@@ -259,23 +217,6 @@ void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWi
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dStart, sXPos + 2, (INT32)( dStart - dEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
// poisoned bleeding
|
||||
if ( pSoldier->bPoisonBleeding )
|
||||
{
|
||||
dPercentage = (FLOAT)pSoldier->bPoisonBleeding / (FLOAT)100;
|
||||
FLOAT dpoisonStart = (FLOAT)( dstart3 );
|
||||
FLOAT dpoisonEnd = dPercentage * sHeight;
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_BLEEDING_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dpoisonStart, sXPos, (INT32)( dpoisonStart - dpoisonEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_BLEEDING_BAR );
|
||||
RectangleDraw( TRUE, sXPos+ 1, (INT32)dpoisonStart, sXPos + 1, (INT32)( dpoisonStart - dpoisonEnd ), usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( POISON_BLEEDING_BAR_SHADOW );
|
||||
RectangleDraw( TRUE, sXPos+ 2, (INT32)dpoisonStart, sXPos + 2, (INT32)( dpoisonStart - dpoisonEnd ), usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
UnLockVideoSurface( uiBuffer );
|
||||
}
|
||||
|
||||
|
||||
+4
-32
@@ -3500,7 +3500,6 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
INT8 bBandage;
|
||||
INT8 bPoisonBandage;
|
||||
INT16 color8;
|
||||
INT16 color16;
|
||||
|
||||
@@ -3535,10 +3534,7 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
|
||||
|
||||
// get amt bandaged
|
||||
bBandage = pSoldier->stats.bLifeMax - pSoldier->stats.bLife - pSoldier->bBleeding;
|
||||
|
||||
// get amount of poisoned bandage
|
||||
bPoisonBandage = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
|
||||
|
||||
// NOW DO BLEEDING
|
||||
if ( pSoldier->bBleeding )
|
||||
{
|
||||
@@ -3546,42 +3542,18 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1, (INT32)dWidth, sHeight, COLOR_RED, Get16BPPColor( FROMRGB( 240, 240, 20 ) ), pDestBuf );
|
||||
}
|
||||
|
||||
// poisoned bleeding
|
||||
if ( pSoldier->bPoisonBleeding )
|
||||
{
|
||||
dPercentage = (FLOAT)( pSoldier->stats.bLifeMax - pSoldier->bBleeding + pSoldier->bPoisonBleeding )/ (FLOAT)100;
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1, (INT32)dWidth, sHeight, COLOR_GREEN, Get16BPPColor( FROMRGB( 240, 20, 240 ) ), pDestBuf );
|
||||
}
|
||||
|
||||
|
||||
if( bBandage )
|
||||
{
|
||||
dPercentage = (FLOAT)( pSoldier->stats.bLife + bBandage ) / (FLOAT)100;
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1, (INT32)dWidth, sHeight, COLOR_RED, Get16BPPColor( FROMRGB( 222, 132, 132 ) ), pDestBuf );
|
||||
}
|
||||
|
||||
// poisoned bandage
|
||||
if ( bPoisonBandage )
|
||||
{
|
||||
dPercentage = (FLOAT)( pSoldier->stats.bLife + bPoisonBandage )/ (FLOAT)100;
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1, (INT32)dWidth, sHeight, COLOR_GREEN, Get16BPPColor( FROMRGB( 132, 222, 132 ) ), pDestBuf );
|
||||
}
|
||||
|
||||
|
||||
dPercentage = (FLOAT)pSoldier->stats.bLife / (FLOAT)100;
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1, (INT32)dWidth, sHeight, COLOR_RED, Get16BPPColor( FROMRGB( 200, 0, 0 ) ), pDestBuf );
|
||||
|
||||
// poisoned life
|
||||
if ( pSoldier->bPoisonLife )
|
||||
{
|
||||
dPercentage = (FLOAT)( pSoldier->bPoisonLife )/ (FLOAT)100;
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1, (INT32)dWidth, sHeight, COLOR_GREEN, Get16BPPColor( FROMRGB( 0, 200, 0 ) ), pDestBuf );
|
||||
}
|
||||
|
||||
|
||||
dPercentage = (FLOAT)( pSoldier->bBreathMax ) / (FLOAT)100;
|
||||
dWidth = dPercentage * sWidth;
|
||||
DrawBar( sXPos + 3, sYPos + 1 + interval, (INT32)dWidth, sHeight, COLOR_BLUE, Get16BPPColor( FROMRGB( 20, 20, 150 ) ), pDestBuf );
|
||||
|
||||
@@ -148,7 +148,6 @@ enum {
|
||||
BG_TRAVEL_BOAT,
|
||||
|
||||
// resistances
|
||||
BG_RESI_POISON,
|
||||
BG_RESI_FEAR,
|
||||
BG_RESI_SUPPRESSION,
|
||||
BG_RESI_PHYSICAL,
|
||||
|
||||
@@ -1125,10 +1125,7 @@ typedef struct
|
||||
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
|
||||
|
||||
BOOLEAN blockironsight; // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
|
||||
|
||||
// Flugente poison system
|
||||
INT16 bPoisonPercentage;
|
||||
|
||||
|
||||
UINT32 usItemFlag; // bitflags to store various item properties (better than introducing 32 BOOLEAN values). If I only had thought of this earlier....
|
||||
|
||||
// Flugente: food type
|
||||
|
||||
+2
-2
@@ -703,7 +703,7 @@ void HandleDoorTrap( SOLDIERTYPE * pSoldier, DOOR * pDoor )
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Trap gone off %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( "!!!!!!! Trap gone off\n" );
|
||||
|
||||
pSoldier->SoldierTakeDamage( 0, (UINT16) (10 + PreRandom( 10 )), 0, (UINT16) ((3 + PreRandom( 3 ) * 1000)), TAKE_DAMAGE_ELECTRICITY, NOBODY, pDoor->sGridNo, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, (UINT16) (10 + PreRandom( 10 )), (UINT16) ((3 + PreRandom( 3 ) * 1000)), TAKE_DAMAGE_ELECTRICITY, NOBODY, pDoor->sGridNo, 0, TRUE );
|
||||
break;
|
||||
|
||||
case SUPER_ELECTRIC:
|
||||
@@ -718,7 +718,7 @@ void HandleDoorTrap( SOLDIERTYPE * pSoldier, DOOR * pDoor )
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Trap gone off %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( "!!!!!!! Trap gone off\n" );
|
||||
|
||||
pSoldier->SoldierTakeDamage( 0, (UINT16) (20 + PreRandom( 20 )), 0, (UINT16) ((6 + PreRandom( 6 ) * 1000)), TAKE_DAMAGE_ELECTRICITY, NOBODY, pDoor->sGridNo, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, (UINT16) (20 + PreRandom( 20 )), (UINT16) ((6 + PreRandom( 6 ) * 1000)), TAKE_DAMAGE_ELECTRICITY, NOBODY, pDoor->sGridNo, 0, TRUE );
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@@ -7398,12 +7398,10 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
||||
if (pTeamSoldier->iHealableInjury < 0)
|
||||
pTeamSoldier->iHealableInjury = 0;
|
||||
|
||||
pTeamSoldier->bPoisonLife = min(pTeamSoldier->bPoisonSum, pTeamSoldier->bPoisonLife + OKLIFE - pTeamSoldier->stats.bLife);
|
||||
pTeamSoldier->stats.bLife = OKLIFE;
|
||||
}
|
||||
|
||||
pTeamSoldier->bBleeding = 0; // let's think, the autobandage was done for the militia too
|
||||
pTeamSoldier->bPoisonBleeding = 0;
|
||||
}
|
||||
}
|
||||
gTacticalStatus.Team[ MILITIA_TEAM ].bAwareOfOpposition = FALSE;
|
||||
@@ -8137,13 +8135,13 @@ BOOLEAN KillIncompacitatedEnemyInSector( )
|
||||
// KIll......
|
||||
// SANDRO - if the soldier is bleeding out, consider this damage as done by the last attacker
|
||||
if ( pTeamSoldier->ubAttackerID != NOBODY )
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 0, 100, TAKE_DAMAGE_BLOODLOSS, pTeamSoldier->ubAttackerID, NOWHERE, 0, TRUE );
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 100, TAKE_DAMAGE_BLOODLOSS, pTeamSoldier->ubAttackerID, NOWHERE, 0, TRUE );
|
||||
else if ( pTeamSoldier->ubPreviousAttackerID != NOBODY )
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 0, 100, TAKE_DAMAGE_BLOODLOSS, pTeamSoldier->ubPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 100, TAKE_DAMAGE_BLOODLOSS, pTeamSoldier->ubPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
else if ( pTeamSoldier->ubNextToPreviousAttackerID != NOBODY )
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 0, 100, TAKE_DAMAGE_BLOODLOSS, pTeamSoldier->ubNextToPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 100, TAKE_DAMAGE_BLOODLOSS, pTeamSoldier->ubNextToPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
else
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 0, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pTeamSoldier->SoldierTakeDamage( ANIM_CROUCH, pTeamSoldier->stats.bLife, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
fReturnVal = TRUE;
|
||||
}
|
||||
|
||||
@@ -2722,12 +2722,11 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
|
||||
MercCreateStruct.fOnRoof = pCorpse->def.bLevel > 0 ? TRUE : FALSE;
|
||||
|
||||
// add important stats according to difficulty level
|
||||
// bLife is actually lower than bLifeMax. Because zombies have poison absorption, they can and will heal themselves over time, thereby gaining more life if they are not put down fast
|
||||
switch( gGameExternalOptions.sZombieDifficultyLevel )
|
||||
{
|
||||
case 4:
|
||||
MercCreateStruct.bLifeMax = (INT8)( 70 + Random( 30 ) );
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax - (INT8)(10 + Random(15));
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax;
|
||||
MercCreateStruct.bAgility = (INT8)( 50 + Random( 10 ) );
|
||||
MercCreateStruct.bDexterity = (INT8)( 60 + Random( 15 ) );
|
||||
MercCreateStruct.bStrength = (INT8)( 80 + Random( 20 ) );
|
||||
@@ -2735,7 +2734,7 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
|
||||
|
||||
case 3:
|
||||
MercCreateStruct.bLifeMax = (INT8)( 60 + Random( 20 ) );
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax - (INT8)(10 + Random(10));
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax;
|
||||
MercCreateStruct.bAgility = (INT8)( 40 + Random( 10 ) );
|
||||
MercCreateStruct.bDexterity = (INT8)( 45 + Random( 10 ) );
|
||||
MercCreateStruct.bStrength = (INT8)( 60 + Random( 20 ) );
|
||||
@@ -2743,7 +2742,7 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
|
||||
|
||||
case 2:
|
||||
MercCreateStruct.bLifeMax = (INT8)( 45 + Random( 15 ) );
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax - (INT8)(5 + Random(10));
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax;
|
||||
MercCreateStruct.bAgility = (INT8)( 30 + Random( 5 ) );
|
||||
MercCreateStruct.bDexterity = (INT8)( 30 + Random( 10 ) );
|
||||
MercCreateStruct.bStrength = (INT8)( 45 + Random( 20 ) );
|
||||
@@ -2752,7 +2751,7 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
|
||||
case 1:
|
||||
default:
|
||||
MercCreateStruct.bLifeMax = (INT8)( 35 + Random( 10 ) );
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax - (INT8)(5 + Random(5));
|
||||
MercCreateStruct.bLife = MercCreateStruct.bLifeMax;
|
||||
MercCreateStruct.bAgility = (INT8)( 15 + Random( 5 ) );
|
||||
MercCreateStruct.bDexterity = (INT8)( 15 + Random( 5 ) );
|
||||
MercCreateStruct.bStrength = (INT8)( 30 + Random( 20 ) );
|
||||
@@ -2803,21 +2802,7 @@ UINT8 GetNearestRottingCorpseAIWarning( INT32 sGridNo )
|
||||
pNewSoldier->aiData.bOrders = SEEKENEMY;
|
||||
pNewSoldier->aiData.bAttitude = AGGRESSIVE;
|
||||
|
||||
////////////// stuff for poisoning ///////////////////////////////////
|
||||
// this is important - by declaring the gap between bLife and bLifeMax as bBleeding, the zombies will bleed (even more if they are damaged)
|
||||
// all their lifepoints are also poisoned. Thereby all bleeding damage will be poisoned bleeding damage
|
||||
// as they have bPoisonAbsorption of at least 200%, they will absorp this poison damage
|
||||
// This leads to them GAINING life through bleeding
|
||||
// They can thereby regain their health in battle (although not very fast)
|
||||
pNewSoldier->bBleeding = pNewSoldier->stats.bLifeMax - pNewSoldier->stats.bLife;
|
||||
|
||||
pNewSoldier->bPoisonSum = pNewSoldier->stats.bLifeMax;
|
||||
pNewSoldier->bPoisonLife = pNewSoldier->stats.bLife;
|
||||
pNewSoldier->bPoisonBleeding = pNewSoldier->bPoisonSum - pNewSoldier->bPoisonLife;
|
||||
// zombies get 200% poison absorption, but no resistance to it, as it would reduce their healing
|
||||
pNewSoldier->bPoisonResistance = 0;
|
||||
pNewSoldier->bPoisonAbsorption = 0; // Flugente: Screw this, we use GetPoisonAbsorption() instead... I declare this variable dead until further notice
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
pNewSoldier->bBleeding = 0;
|
||||
|
||||
#ifdef ENABLE_ZOMBIES
|
||||
if ( !memcmp( pCorpse->name, TacticalStr[ CIV_TEAM_MINER_NAME ], sizeof(pCorpse->name) )
|
||||
|
||||
@@ -1768,25 +1768,25 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
fStarving = TRUE;
|
||||
|
||||
// If it's an injured animation and we are not in the threashold....
|
||||
if ( ( pAnimDef->ubFlags & RANDOM_ANIM_INJURED ) && pSoldier->stats.bLife >= INJURED_CHANGE_THREASHOLD && pSoldier->bPoisonSum <= 0 && !fStarving )
|
||||
if ( ( pAnimDef->ubFlags & RANDOM_ANIM_INJURED ) && pSoldier->stats.bLife >= INJURED_CHANGE_THREASHOLD && !fStarving )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// If we need to do an injured one, don't do any others...
|
||||
if ( !( pAnimDef->ubFlags & RANDOM_ANIM_INJURED ) && (pSoldier->stats.bLife < INJURED_CHANGE_THREASHOLD || pSoldier->bPoisonSum > 0 || fStarving) )
|
||||
if ( !( pAnimDef->ubFlags & RANDOM_ANIM_INJURED ) && (pSoldier->stats.bLife < INJURED_CHANGE_THREASHOLD || fStarving) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// If it's a drunk animation and we are not in the threashold....
|
||||
if ( ( pAnimDef->ubFlags & RANDOM_ANIM_DRUNK ) && GetDrunkLevel( pSoldier ) < BORDERLINE && pSoldier->bPoisonSum <= 0 && !fStarving )
|
||||
if ( ( pAnimDef->ubFlags & RANDOM_ANIM_DRUNK ) && GetDrunkLevel( pSoldier ) < BORDERLINE && !fStarving )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// If we need to do an injured one, don't do any others...
|
||||
if ( !( pAnimDef->ubFlags & RANDOM_ANIM_DRUNK ) && (GetDrunkLevel( pSoldier ) >= BORDERLINE || pSoldier->bPoisonSum > 0 || fStarving) )
|
||||
if ( !( pAnimDef->ubFlags & RANDOM_ANIM_DRUNK ) && (GetDrunkLevel( pSoldier ) >= BORDERLINE || fStarving) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
+33
-242
@@ -1021,13 +1021,7 @@ SOLDIERTYPE& SOLDIERTYPE::operator=(const OLDSOLDIERTYPE_101& src)
|
||||
this->wornSnowCamo = __min( (100 - gGameExternalOptions.bCamoKitArea), src.wornSnowCamo );
|
||||
|
||||
this->bScopeMode = USE_BEST_SCOPE;
|
||||
|
||||
this->bPoisonBleeding = 0;
|
||||
this->bPoisonLife = 0;
|
||||
this->bPoisonSum = 0;
|
||||
this->bPoisonResistance = 0;
|
||||
this->bPoisonAbsorption = 0;
|
||||
|
||||
|
||||
this->bFoodLevel = 0;
|
||||
this->bDrinkLevel = 0;
|
||||
this->usStarveDamageHealth = 0;
|
||||
@@ -1714,7 +1708,7 @@ void HandleSystemNewAISituation( SOLDIERTYPE *pSoldier, BOOLEAN fResetABC );
|
||||
UINT16 *CreateEnemyGlow16BPPPalette( SGPPaletteEntry *pPalette, UINT32 rscale, UINT32 gscale, BOOLEAN fAdjustGreen );
|
||||
UINT16 *CreateEnemyGreyGlow16BPPPalette( SGPPaletteEntry *pPalette, UINT32 rscale, UINT32 gscale, BOOLEAN fAdjustGreen );
|
||||
|
||||
void SoldierBleed( SOLDIERTYPE *pSoldier, BOOLEAN fBandagedBleed, BOOLEAN fAllowPoisoning );
|
||||
void SoldierBleed( SOLDIERTYPE *pSoldier, BOOLEAN fBandagedBleed );
|
||||
INT32 CheckBleeding( SOLDIERTYPE *pSoldier );
|
||||
|
||||
void EVENT_InternalSetSoldierDesiredDirection( SOLDIERTYPE *pSoldier, UINT8 ubNewDirection, BOOLEAN fInitalMove, UINT16 usAnimState );
|
||||
@@ -6027,16 +6021,12 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
|
||||
// OK, If we are a vehicle.... damage vehicle...( people inside... )
|
||||
if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
this->SoldierTakeDamage( ANIM_CROUCH, sDamage, 0, sBreathLoss, ubReason, this->ubAttackerID, NOWHERE, FALSE, TRUE );
|
||||
this->SoldierTakeDamage( ANIM_CROUCH, sDamage, sBreathLoss, ubReason, this->ubAttackerID, NOWHERE, FALSE, TRUE );
|
||||
return;
|
||||
}
|
||||
|
||||
INT16 poisondamage = 0;
|
||||
if ( ubAttackerID != NOBODY )
|
||||
poisondamage = (INT16)((sDamage * MercPtrs[ubAttackerID]->GetPoisonDamagePercentage( )) / 100);
|
||||
|
||||
// DEDUCT LIFE
|
||||
ubCombinedLoss = this->SoldierTakeDamage( ANIM_CROUCH, sDamage, poisondamage, sBreathLoss, ubReason, this->ubAttackerID, NOWHERE, FALSE, TRUE );
|
||||
// DEDUCT LIFE
|
||||
ubCombinedLoss = this->SoldierTakeDamage( ANIM_CROUCH, sDamage, sBreathLoss, ubReason, this->ubAttackerID, NOWHERE, FALSE, TRUE );
|
||||
|
||||
// ATE: OK, Let's check our ASSIGNMENT state,
|
||||
// If anything other than on a squad or guard, make them guard....
|
||||
@@ -9432,7 +9422,7 @@ void SOLDIERTYPE::BeginSoldierClimbWindow( void )
|
||||
WindowHit( sNewGridNo, pStructure->usStructureID, (this->ubDirection == SOUTH || this->ubDirection == EAST), TRUE );
|
||||
|
||||
// we get a bit of damage for jumping through a window
|
||||
this->SoldierTakeDamage( 0, 2 + Random( 4 ), 0, 1000, TAKE_DAMAGE_ELECTRICITY, NOBODY, sNewGridNo, 0, TRUE );
|
||||
this->SoldierTakeDamage( 0, 2 + Random( 4 ), 1000, TAKE_DAMAGE_ELECTRICITY, NOBODY, sNewGridNo, 0, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9758,12 +9748,12 @@ void HandleTakeDamageDeath( SOLDIERTYPE *pSoldier, UINT8 bOldLife, UINT8 ubReaso
|
||||
}
|
||||
|
||||
|
||||
UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPoisonAdd, INT16 sBreathLoss, UINT8 ubReason, UINT8 ubAttacker, INT32 sSourceGrid, INT16 sSubsequent, BOOLEAN fShowDamage )
|
||||
UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBreathLoss, UINT8 ubReason, UINT8 ubAttacker, INT32 sSourceGrid, INT16 sSubsequent, BOOLEAN fShowDamage )
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
if ( is_networked ) {
|
||||
CHAR tmpMPDbgString[512];
|
||||
sprintf( tmpMPDbgString, "SoldierTakeDamage ( bHeight : %i , sLifeDeduct : %i , sPoisonAdd : %i , sBreathLoss : %i , ubReason : %i , ubAttacker : %i , sSourceGrid : %i , sSubsequent : %i , fShowDamage : %i )\n", bHeight, sLifeDeduct, sPoisonAdd, sBreathLoss, ubReason, ubAttacker, sSourceGrid, sSubsequent, fShowDamage );
|
||||
sprintf( tmpMPDbgString, "SoldierTakeDamage ( bHeight : %i , sLifeDeduct : %i , sBreathLoss : %i , ubReason : %i , ubAttacker : %i , sSourceGrid : %i , sSubsequent : %i , fShowDamage : %i )\n", bHeight, sLifeDeduct, sBreathLoss, ubReason, ubAttacker, sSourceGrid, sSubsequent, fShowDamage );
|
||||
MPDebugMsg( tmpMPDbgString );
|
||||
}
|
||||
#endif
|
||||
@@ -9776,13 +9766,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
UINT16 usItemFlags = 0; // Kaiden: Needed for the reveal all items after combat code from UB.
|
||||
|
||||
this->ubLastDamageReason = ubReason;
|
||||
|
||||
// check: poison damage cannot be higher than damage
|
||||
sPoisonAdd = min( sPoisonAdd, sLifeDeduct );
|
||||
|
||||
// reduce poison damage by poison resistance
|
||||
sPoisonAdd = (INT16)(sPoisonAdd * (100 - this->GetPoisonResistance( )) / 100);
|
||||
|
||||
|
||||
// Flugente: dynamic opinions
|
||||
if ( ubAttacker != NOBODY && MercPtrs[ubAttacker] )
|
||||
{
|
||||
@@ -9821,12 +9805,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
|
||||
// Deduct life!, Show damage if we want!
|
||||
bOldLife = this->stats.bLife;
|
||||
|
||||
// we need this to relation to decide how to redistribute poison points
|
||||
FLOAT dpoisonliferelation = 1.0;
|
||||
if ( bOldLife > 0 )
|
||||
dpoisonliferelation = (FLOAT)(this->bPoisonLife / bOldLife);
|
||||
|
||||
|
||||
// OK, If we are a vehicle.... damage vehicle...( people inside... )
|
||||
if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
@@ -9950,41 +9929,14 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
if ( sLifeDeduct > this->stats.bLife )
|
||||
{
|
||||
this->stats.bLife = 0;
|
||||
|
||||
this->bPoisonSum = 0;
|
||||
this->bPoisonLife = 0;
|
||||
this->bPoisonBleeding = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we might have poison absorption
|
||||
INT16 sLifeGainAbsorption = (INT16)((sPoisonAdd * this->GetPoisonAbsorption( )) / 100);
|
||||
|
||||
// life reduction gets reduced itself by life gained through absorption
|
||||
sLifeDeduct -= sLifeGainAbsorption;
|
||||
|
||||
// poison points however get increased by absorped life points (poison was absorbed, not resisted)
|
||||
INT16 poisongained = sPoisonAdd + sLifeGainAbsorption;
|
||||
|
||||
// Decrease Health
|
||||
this->stats.bLife -= sLifeDeduct;
|
||||
|
||||
// life may increase by poison absorption, so make sure it doesn't rise too much
|
||||
// make sure it doesn't rise too much
|
||||
this->stats.bLife = min( this->stats.bLife, this->stats.bLifeMax );
|
||||
|
||||
// increase poisoning
|
||||
this->bPoisonSum = min( this->stats.bLifeMax, this->bPoisonSum + poisongained );
|
||||
|
||||
// increase poison life if we gained life through absorption
|
||||
if ( sLifeGainAbsorption > 0 )
|
||||
this->bPoisonLife = min( this->bPoisonSum, this->bPoisonLife + sLifeGainAbsorption );
|
||||
|
||||
// if no life was lost, also add sPoisonAdd to bPoisonLife
|
||||
if ( sLifeDeduct <= 0 )
|
||||
this->bPoisonLife = min( this->bPoisonSum, this->bPoisonLife + sPoisonAdd );
|
||||
else
|
||||
// we reduce bPoisonLife according to old percentage of poison life to life
|
||||
this->bPoisonLife -= (INT8)(dpoisonliferelation * sLifeDeduct);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -10009,8 +9961,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
|
||||
// ATE: Put some logic in here to allow enemies to die quicker.....
|
||||
// Are we an enemy?
|
||||
// zombies don't die suddenly, as they regenerate health by bloodloss and poison. You have to make sure they die!
|
||||
if ( this->bSide != gbPlayerNum && !this->aiData.bNeutral && this->ubProfile == NO_PROFILE && !this->IsZombie( ) )
|
||||
if ( this->bSide != gbPlayerNum && !this->aiData.bNeutral && this->ubProfile == NO_PROFILE )
|
||||
{
|
||||
// ATE: Give them a chance to fall down...
|
||||
if ( this->stats.bLife > 0 && this->stats.bLife < (OKLIFE - 1) )
|
||||
@@ -10023,10 +9974,6 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
{
|
||||
// Kill!
|
||||
this->stats.bLife = 0;
|
||||
|
||||
this->bPoisonSum = 0;
|
||||
this->bPoisonLife = 0;
|
||||
this->bPoisonBleeding = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -10036,10 +9983,6 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
{
|
||||
// Kill!
|
||||
this->stats.bLife = 0;
|
||||
|
||||
this->bPoisonSum = 0;
|
||||
this->bPoisonLife = 0;
|
||||
this->bPoisonBleeding = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10063,10 +10006,6 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
if ( this->stats.bLife < 0 )
|
||||
{
|
||||
this->stats.bLife = 0;
|
||||
|
||||
this->bPoisonSum = 0;
|
||||
this->bPoisonLife = 0;
|
||||
this->bPoisonBleeding = 0;
|
||||
}
|
||||
|
||||
// Flugente: note we received a fresh wound
|
||||
@@ -10114,28 +10053,20 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
|
||||
{
|
||||
// HTH does 1 pt bleeding per hit
|
||||
this->bBleeding = this->bBleeding + 1;
|
||||
|
||||
// add poison point according to poison/life relation
|
||||
this->bPoisonBleeding += (INT8)(dpoisonliferelation);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we would actually bleed _less_ after applying the damage received (poison absorption), we reduce bleeding only if the new bBandage would be zero
|
||||
// we reduce bleeding only if the new bBandage would be zero
|
||||
// by this, we can continue bleeding, and eventually bleeding
|
||||
// the normal behaviour is unchanged, as this case can't happen without poison absorption
|
||||
if ( sLifeDeduct < 0 )
|
||||
{
|
||||
INT8 oldBleeding = this->bBleeding;
|
||||
this->bBleeding = min( this->bBleeding, this->stats.bLifeMax - this->stats.bLife );
|
||||
this->bPoisonBleeding = max( 0, this->bPoisonBleeding - (oldBleeding - this->bBleeding) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this->bBleeding = this->stats.bLifeMax - (this->stats.bLife + bBandage);
|
||||
|
||||
// we increase bPoisonLife according to old percentage of poison life to life
|
||||
this->bPoisonBleeding += (INT8)(dpoisonliferelation * sLifeDeduct);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11004,7 +10935,7 @@ BOOLEAN SOLDIERTYPE::CheckSoldierHitRoof( void )
|
||||
//this->EVENT_InitNewSoldierAnim( FALLFORWARD_ROOF, 0 , FALSE );
|
||||
|
||||
// Deduct hitpoints/breath for falling!
|
||||
this->SoldierTakeDamage( ANIM_CROUCH, 100, 0, 5000, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
this->SoldierTakeDamage( ANIM_CROUCH, 100, 5000, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
fReturnVal = TRUE;
|
||||
|
||||
@@ -11019,7 +10950,7 @@ BOOLEAN SOLDIERTYPE::CheckSoldierHitRoof( void )
|
||||
this->usPendingAnimation = FALLOFF;
|
||||
|
||||
// Deduct hitpoints/breath for falling!
|
||||
this->SoldierTakeDamage( ANIM_CROUCH, 100, 0, 5000, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
this->SoldierTakeDamage( ANIM_CROUCH, 100, 5000, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
fReturnVal = TRUE;
|
||||
}
|
||||
@@ -11881,9 +11812,6 @@ void SOLDIERTYPE::ReviveSoldier( void )
|
||||
|
||||
this->stats.bLife = this->stats.bLifeMax;
|
||||
this->bBleeding = 0;
|
||||
this->bPoisonBleeding = 0;
|
||||
this->bPoisonLife = 0;
|
||||
this->bPoisonSum = 0;
|
||||
this->iHealableInjury = 0; // added by SANDRO
|
||||
this->ubDesiredHeight = ANIM_STAND;
|
||||
|
||||
@@ -12396,11 +12324,8 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio
|
||||
INT16 breathdamage = (INT16)(500 + Random( 1500 ));
|
||||
if ( pTSoldier->bBreath - breathdamage < 0 )
|
||||
breathdamage = pTSoldier->bBreath;
|
||||
|
||||
INT16 poisondamage = (INT16)((damage * this->GetPoisonDamagePercentage( )) / 100);
|
||||
|
||||
// zombies do ~50% poison damage
|
||||
pTSoldier->SoldierTakeDamage( 0, damage, poisondamage, breathdamage, TAKE_DAMAGE_HANDTOHAND, this->ubID, pTSoldier->sGridNo, 0, TRUE );
|
||||
|
||||
pTSoldier->SoldierTakeDamage( 0, damage, breathdamage, TAKE_DAMAGE_HANDTOHAND, this->ubID, pTSoldier->sGridNo, 0, TRUE );
|
||||
|
||||
if ( pTSoldier->stats.bLife == 0 )
|
||||
{
|
||||
@@ -13027,10 +12952,6 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
|
||||
|
||||
// use up appropriate # of actual healing points
|
||||
ubPtsLeft -= (2 * ubBelowOKlife);
|
||||
|
||||
// raise bPoisonLife, reduce bPoisonBleeding
|
||||
pVictim->bPoisonLife = min( pVictim->bPoisonLife + ubBelowOKlife, pVictim->bPoisonSum );
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - ubBelowOKlife );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -13046,17 +12967,12 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
|
||||
pVictim->bBleeding -= (ubPtsLeft / 2);
|
||||
|
||||
ubPtsLeft = ubPtsLeft % 2; // if ptsLeft was odd, ptsLeft = 1
|
||||
|
||||
// raise bPoisonLife, reduce bPoisonBleeding
|
||||
pVictim->bPoisonLife = min( pVictim->bPoisonLife + (ubPtsLeft / 2), pVictim->bPoisonSum );
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - (ubPtsLeft / 2) );
|
||||
}
|
||||
|
||||
// this should never happen any more, but make sure bleeding not negative
|
||||
if ( pVictim->bBleeding < 0 )
|
||||
{
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
}
|
||||
|
||||
// if this healing brought the patient out of the worst of it, cancel dying
|
||||
@@ -13149,13 +13065,11 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
|
||||
if ( pVictim->bBleeding >= (usLifeReturned / 100) )
|
||||
{
|
||||
pVictim->bBleeding -= (usLifeReturned / 100);
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - (usLifeReturned / 100) );
|
||||
uiMedcost += (usLifeReturned / 200); // add medkit points cost for unbandaged part
|
||||
}
|
||||
else
|
||||
{
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
uiMedcost += max( 0, (((usLifeReturned / 100) - pVictim->bBleeding) / 2) ); // add medkit points cost for unbandaged part
|
||||
}
|
||||
}
|
||||
@@ -13164,7 +13078,6 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
|
||||
pVictim->stats.bLife = pVictim->stats.bLifeMax;
|
||||
pVictim->iHealableInjury = 0;
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
}
|
||||
// Reduce max breath based on life returned
|
||||
if ( (pVictim->bBreathMax - (((usLifeReturned / 100) * gSkillTraitValues.usDOSurgeryMaxBreathLoss) / 100)) <= BREATHMAX_ABSOLUTE_MINIMUM )
|
||||
@@ -13195,12 +13108,10 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1
|
||||
{
|
||||
ubPtsLeft -= pVictim->bBleeding;
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
}
|
||||
else // bandage what we can
|
||||
{
|
||||
pVictim->bBleeding -= ubPtsLeft;
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - ubPtsLeft );
|
||||
ubPtsLeft = 0;
|
||||
}
|
||||
|
||||
@@ -14702,86 +14613,6 @@ BOOLEAN SOLDIERTYPE::IsZombie( void )
|
||||
#endif
|
||||
}
|
||||
|
||||
INT16 SOLDIERTYPE::GetPoisonResistance( void )
|
||||
{
|
||||
// Flugente: resistance can per definition only be between -100 and 100 (at least that's my definition)
|
||||
INT16 val = bPoisonResistance;
|
||||
|
||||
val += this->GetBackgroundValue( BG_RESI_POISON );
|
||||
|
||||
val = max( -100, val );
|
||||
val = min( 100, val );
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
INT16 SOLDIERTYPE::GetPoisonAbsorption( void )
|
||||
{
|
||||
// Flugente: absorption can per definition only be >= 0 (at least that's my definition)
|
||||
INT16 val = bPoisonAbsorption;
|
||||
|
||||
#ifdef ENABLE_ZOMBIES
|
||||
if ( IsZombie( ) )
|
||||
val += 200;
|
||||
#endif
|
||||
|
||||
val = max( 0, val );
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
INT16 SOLDIERTYPE::GetPoisonDamagePercentage( void )
|
||||
{
|
||||
// Flugente: this percentage has to be between 0% and 100%
|
||||
INT16 val = 0;
|
||||
|
||||
// zombies poison damage percentage is externalised
|
||||
if ( IsZombie( ) )
|
||||
val += gGameExternalOptions.sZombiePoisonDamagePercentage;
|
||||
|
||||
if ( this->usAttackingWeapon )
|
||||
{
|
||||
val += Item[this->usAttackingWeapon].bPoisonPercentage;
|
||||
|
||||
if ( Item[this->usAttackingWeapon].usItemClass == IC_GUN )
|
||||
{
|
||||
// check for modificators (attachments, poisoned ammunition)
|
||||
// check for poisoned ammunition
|
||||
UINT8 ammotype = this->inv[this->ubAttackingHand][0]->data.gun.ubGunAmmoType;
|
||||
val += AmmoTypes[ammotype].poisonPercentage;
|
||||
|
||||
// check for attachments with a bonus to poison (currently, none exist)
|
||||
}
|
||||
}
|
||||
|
||||
val = max( 0, val );
|
||||
val = min( 100, val );
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
// add poison
|
||||
void SOLDIERTYPE::AddPoison( INT8 sPoisonAmount )
|
||||
{
|
||||
if ( sPoisonAmount < 1 )
|
||||
return;
|
||||
|
||||
INT8 oldpoisonsum = this->bPoisonSum;
|
||||
this->bPoisonSum = min( this->bPoisonSum + sPoisonAmount, this->stats.bLifeMax );
|
||||
|
||||
// recalc really added poison
|
||||
sPoisonAmount = max( 0, this->bPoisonSum - oldpoisonsum );
|
||||
|
||||
INT8 oldpoisonlife = this->bPoisonLife;
|
||||
this->bPoisonLife = min( this->bPoisonLife + sPoisonAmount, this->bPoisonSum );
|
||||
|
||||
INT8 poisontolife = max( 0, this->bPoisonLife - oldpoisonlife );
|
||||
|
||||
INT8 oldpoisonbleed = this->bPoisonBleeding;
|
||||
this->bPoisonBleeding = min( this->bPoisonBleeding + (sPoisonAmount - poisontolife), this->bPoisonSum );
|
||||
}
|
||||
|
||||
// reset the extra stat variables
|
||||
void SOLDIERTYPE::ResetExtraStats( )
|
||||
{
|
||||
@@ -14848,7 +14679,7 @@ void SOLDIERTYPE::InventoryExplosion( void )
|
||||
// Play sound
|
||||
PlayJA2SampleFromFile( "Sounds\\Explode1.wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
|
||||
|
||||
SoldierTakeDamage( 0, damage, 0, breathdamage, TAKE_DAMAGE_EXPLOSION, this->ubID, sGridNo, 0, TRUE );
|
||||
SoldierTakeDamage( 0, damage, breathdamage, TAKE_DAMAGE_EXPLOSION, this->ubID, sGridNo, 0, TRUE );
|
||||
|
||||
if ( stats.bLife <= 0 )
|
||||
{
|
||||
@@ -17409,12 +17240,7 @@ void SOLDIERTYPE::SoldierPropertyUpkeep( )
|
||||
|
||||
if ( HasBackgroundFlag( BACKGROUND_EXP_UNDERGROUND ) && this->bSectorZ )
|
||||
++bExtraExpLevel;
|
||||
|
||||
// Flugente: as pows received faulty poison values, we apply a very simple fix:
|
||||
// remove in a few revisions - the code has already been fixed, so this won't be necessary anymore soon^^
|
||||
this->bPoisonLife = min( this->bPoisonLife, this->bPoisonSum );
|
||||
this->bPoisonBleeding = min( this->bPoisonBleeding, this->bBleeding );
|
||||
|
||||
|
||||
// if we are dead or dying, we cannot continue radio work
|
||||
if ( this->stats.bLife < OKLIFE )
|
||||
this->SwitchOffRadio( );
|
||||
@@ -19077,8 +18903,7 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
if ( pSoldier->stats.bLife != 0 )
|
||||
{
|
||||
// if merc is hurt beyond the minimum required to bleed, or he's dying
|
||||
// Flugente: also allow bleeding if we would regenerate health through it, which happens when we have enough absorption and are poisoned enough (only guaranteed if fully poisoned)
|
||||
if ( ((pSoldier->bBleeding > MIN_BLEEDING_THRESHOLD) || pSoldier->stats.bLife < OKLIFE) || (pSoldier->bPoisonSum == pSoldier->stats.bLifeMax && pSoldier->GetPoisonAbsorption( ) >= 200) )
|
||||
if ( ((pSoldier->bBleeding > MIN_BLEEDING_THRESHOLD) || pSoldier->stats.bLife < OKLIFE) )
|
||||
{
|
||||
// if he's NOT in the process of being bandaged or DOCTORed
|
||||
if ( (pSoldier->ubServiceCount == 0) && (AnyDoctorWhoCanHealThisPatient( pSoldier, HEALABLE_EVER ) == NULL) )
|
||||
@@ -19120,7 +18945,7 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
// just bleeding through existing bandages
|
||||
pSoldier->bBleeding++;
|
||||
|
||||
SoldierBleed( pSoldier, TRUE, TRUE );
|
||||
SoldierBleed( pSoldier, TRUE );
|
||||
}
|
||||
else // soldier is either not bandaged at all or is dying
|
||||
{
|
||||
@@ -19147,13 +18972,7 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
// bleeding while "dying" costs a PERMANENT point of life each time!
|
||||
pSoldier->stats.bLifeMax--;
|
||||
pSoldier->bBleeding = max( 0, pSoldier->bBleeding - 1 );
|
||||
|
||||
// the lost point might be poisoned
|
||||
pSoldier->bPoisonSum = max( 0, pSoldier->bPoisonSum - 1 );
|
||||
|
||||
// also adjust poisoned bleeding
|
||||
pSoldier->bPoisonBleeding = max( 0, pSoldier->bPoisonBleeding - 1 );
|
||||
|
||||
|
||||
if ( pSoldier->iHealableInjury >= 100 ) // added check for insta-healable injury - SANDRO
|
||||
pSoldier->iHealableInjury -= 100;
|
||||
}
|
||||
@@ -19162,16 +18981,15 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
// either way, a point of life (health) is lost because of bleeding
|
||||
// Flugente: not true anymore! We might be fully bandaged, not bleeding, but still receive poison damage that will lower our life. So check if we're bleeding!
|
||||
if ( pSoldier->bBleeding )
|
||||
{
|
||||
// This will also update the life bar
|
||||
SoldierBleed( pSoldier, FALSE, TRUE );
|
||||
SoldierBleed( pSoldier, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// just to update everything, like going unconscious or dying
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 0, 0, 0, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 0, 0, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -19195,7 +19013,7 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
|
||||
void SoldierBleed( SOLDIERTYPE *pSoldier, BOOLEAN fBandagedBleed, BOOLEAN fAllowPoisoning )
|
||||
void SoldierBleed( SOLDIERTYPE *pSoldier, BOOLEAN fBandagedBleed )
|
||||
{
|
||||
// OK, here make some stuff happen for bleeding
|
||||
// A banaged bleed does not show damage taken , just through existing bandages
|
||||
@@ -19212,33 +19030,21 @@ void SoldierBleed( SOLDIERTYPE *pSoldier, BOOLEAN fBandagedBleed, BOOLEAN fAllow
|
||||
{
|
||||
SetInfoChar( pSoldier->ubID );
|
||||
}
|
||||
}
|
||||
|
||||
// if poisoning is allowed, if we are poisoned and we can be sure that we are really bleeding (safety reasons), there is a chance that the poisoning spreads
|
||||
// this simply means that the new Bleeding point will also be a poisoned bleeding point
|
||||
INT16 poisondamage = 0;
|
||||
if ( fAllowPoisoning && pSoldier->bPoisonSum > 0 && pSoldier->bBleeding )
|
||||
{
|
||||
INT8 bleedingpercentagepoison = (INT8)(100 * pSoldier->bPoisonSum / pSoldier->stats.bLifeMax);
|
||||
|
||||
if ( (INT8)Random( 100 ) < bleedingpercentagepoison )
|
||||
poisondamage = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// If we are already dead, don't show damage!
|
||||
if ( !fBandagedBleed )
|
||||
{
|
||||
// SANDRO - if the soldier is bleeding out, consider this damage as done by the last attacker
|
||||
if ( pSoldier->ubAttackerID != NOBODY )
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, poisondamage, 100, TAKE_DAMAGE_BLOODLOSS, pSoldier->ubAttackerID, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, 100, TAKE_DAMAGE_BLOODLOSS, pSoldier->ubAttackerID, NOWHERE, 0, TRUE );
|
||||
else if ( pSoldier->ubPreviousAttackerID != NOBODY )
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, poisondamage, 100, TAKE_DAMAGE_BLOODLOSS, pSoldier->ubPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, 100, TAKE_DAMAGE_BLOODLOSS, pSoldier->ubPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
else if ( pSoldier->ubNextToPreviousAttackerID != NOBODY )
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, poisondamage, 100, TAKE_DAMAGE_BLOODLOSS, pSoldier->ubNextToPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, 100, TAKE_DAMAGE_BLOODLOSS, pSoldier->ubNextToPreviousAttackerID, NOWHERE, 0, TRUE );
|
||||
else
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, poisondamage, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, 1, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22703,10 +22509,6 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
|
||||
// reduce bleeding by the same number of life points healed up
|
||||
pVictim->bBleeding -= bBelowOKlife;
|
||||
|
||||
// Flugente: increase bPoisonLife, decrease bPoisonBleeding
|
||||
pVictim->bPoisonLife = min( pVictim->bPoisonSum, pVictim->bPoisonLife + bBelowOKlife );
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - bBelowOKlife );
|
||||
|
||||
// use up appropriate # of actual healing points
|
||||
bPtsLeft -= (2 * bBelowOKlife);
|
||||
}
|
||||
@@ -22721,11 +22523,7 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
|
||||
}
|
||||
pVictim->stats.bLife += (bPtsLeft / 2);
|
||||
pVictim->bBleeding -= (bPtsLeft / 2);
|
||||
|
||||
// Flugente: increase bPoisonLife, decrease bPoisonBleeding
|
||||
pVictim->bPoisonLife = min( pVictim->bPoisonSum, pVictim->bPoisonLife + (bPtsLeft / 2) );
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - (bPtsLeft / 2) );
|
||||
|
||||
|
||||
bPtsLeft = bPtsLeft % 2; // if ptsLeft was odd, ptsLeft = 1
|
||||
}
|
||||
|
||||
@@ -22733,7 +22531,6 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
|
||||
if ( pVictim->bBleeding < 0 )
|
||||
{
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
}
|
||||
|
||||
// if this healing brought the patient out of the worst of it, cancel dying
|
||||
@@ -22808,27 +22605,22 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
|
||||
if ( (pVictim->stats.bLife + (iLifeReturned / 100)) <= pVictim->stats.bLifeMax )
|
||||
{
|
||||
pVictim->stats.bLife += (iLifeReturned / 100);
|
||||
pVictim->bPoisonLife = min( pVictim->bPoisonSum, pVictim->bPoisonLife + (iLifeReturned / 100) );
|
||||
if ( pVictim->bBleeding >= (iLifeReturned / 100) )
|
||||
{
|
||||
pVictim->bBleeding -= (iLifeReturned / 100);
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - (iLifeReturned / 100) );
|
||||
uiMedcost += (iLifeReturned / 200); // add medkit points cost for unbandaged part
|
||||
}
|
||||
else
|
||||
{
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
uiMedcost += max( 0, (((iLifeReturned / 100) - pVictim->bBleeding) / 2) ); // add medkit points cost for unbandaged part
|
||||
}
|
||||
}
|
||||
else // this shouldn't even happen, but we still want to have it here for sure
|
||||
{
|
||||
pVictim->stats.bLife = pVictim->stats.bLifeMax;
|
||||
pVictim->bPoisonLife = pVictim->bPoisonSum;
|
||||
pVictim->iHealableInjury = 0;
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
}
|
||||
// Reduce max breath based on life returned
|
||||
if ( (pVictim->bBreathMax - (((iLifeReturned / 100) * gSkillTraitValues.usDOSurgeryMaxBreathLoss) / 100)) <= BREATHMAX_ABSOLUTE_MINIMUM )
|
||||
@@ -22853,17 +22645,16 @@ UINT32 VirtualSoldierDressWound( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVictim, OB
|
||||
// DON'T spend any APs/kit pts to cure bleeding until merc is no longer dying
|
||||
//if ( bPtsLeft && pVictim->bBleeding && !pVictim->dying)
|
||||
if ( bPtsLeft && pVictim->bBleeding )
|
||||
{ // if we have enough points to bandage all remaining bleeding this turn
|
||||
{
|
||||
// if we have enough points to bandage all remaining bleeding this turn
|
||||
if ( bPtsLeft >= pVictim->bBleeding )
|
||||
{
|
||||
bPtsLeft -= pVictim->bBleeding;
|
||||
pVictim->bBleeding = 0;
|
||||
pVictim->bPoisonBleeding = 0;
|
||||
}
|
||||
else // bandage what we can
|
||||
{
|
||||
pVictim->bBleeding -= bPtsLeft;
|
||||
pVictim->bPoisonBleeding = max( 0, pVictim->bPoisonBleeding - bPtsLeft );
|
||||
bPtsLeft = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1442,14 +1442,13 @@ public:
|
||||
INT8 bScopeMode;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// Flugente Zombies: Added variables for the poison system
|
||||
INT8 bPoisonBleeding; // The number of bleeding points that are also poison points
|
||||
//INT8 bPoisonBandaged; // The number of bandaged lifepoints that are also poison points
|
||||
INT8 bPoisonLife; // The number of Lifepoints that are also poison points
|
||||
INT8 bPoisonSum; // The sum of poison points;
|
||||
// Flugente: this was the location of required variables required for the now removed poison feature. They can be used again
|
||||
INT8 bUnusedINT8_1;
|
||||
INT8 bUnusedINT8_2;
|
||||
INT8 bUnusedINT8_3;
|
||||
|
||||
INT16 bPoisonResistance; // poison resistance reduces the amount of poison damage received. It is applied before poison absorption
|
||||
INT16 bPoisonAbsorption; // for x points of poison damage received, you gain x * (bPoisonAbsorption / 100) poison life points
|
||||
INT16 bUnusedINT16_4;
|
||||
INT16 bUnusedINT16_5;
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
// Flugente: new variables for extra stats
|
||||
@@ -1600,8 +1599,7 @@ public:
|
||||
void ChangeSoldierStance( UINT8 ubDesiredStance );
|
||||
void StopSoldier( void );
|
||||
void ReviveSoldier( void );
|
||||
// Flugente: added poison damage, which should be smaller or equal than sLifeDeduct
|
||||
UINT8 SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPoisonAdd, INT16 sBreathDeduct, UINT8 ubReason, UINT8 ubAttacker, INT32 sSourceGrid, INT16 sSubsequent, BOOLEAN fShowDamage );
|
||||
UINT8 SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sBreathDeduct, UINT8 ubReason, UINT8 ubAttacker, INT32 sSourceGrid, INT16 sSubsequent, BOOLEAN fShowDamage );
|
||||
|
||||
|
||||
// Palette functions for soldiers
|
||||
@@ -1712,17 +1710,7 @@ public:
|
||||
|
||||
// Flugente: Zombies
|
||||
BOOLEAN IsZombie( void );
|
||||
|
||||
// Flugente: poison system
|
||||
// These functions might one day be modified by traits etc. We'll keep that in these functions and not clutter the rest of the code
|
||||
INT16 GetPoisonResistance( void );
|
||||
INT16 GetPoisonAbsorption( void );
|
||||
// returns the poison percentage of the damage we will be doing with the weapon currently in our hand
|
||||
INT16 GetPoisonDamagePercentage( void );
|
||||
|
||||
// add poison
|
||||
void AddPoison( INT8 sPoisonAmount );
|
||||
|
||||
|
||||
// reset the extra stat variables
|
||||
void ResetExtraStats();
|
||||
|
||||
|
||||
@@ -4174,7 +4174,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
// Get life back
|
||||
pSoldier->stats.bLife = pSoldier->stats.bLifeMax;
|
||||
pSoldier->bBleeding = 0;
|
||||
pSoldier->bPoisonBleeding = 0;
|
||||
|
||||
// SANDRO - erase insta-healable injury
|
||||
pSoldier->iHealableInjury = 0;
|
||||
|
||||
|
||||
@@ -1395,7 +1395,7 @@ BOOLEAN InjurePersonInVehicle( INT32 iId, SOLDIERTYPE *pSoldier, UINT8 ubPointsO
|
||||
}
|
||||
|
||||
// otherwise hurt them
|
||||
pSoldier->SoldierTakeDamage( 0, ubPointsOfDmg, 0, ubPointsOfDmg, TAKE_DAMAGE_GUNFIRE, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, ubPointsOfDmg, ubPointsOfDmg, TAKE_DAMAGE_GUNFIRE, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
pSoldier->HandleSoldierTakeDamageFeedback( );
|
||||
|
||||
@@ -1424,7 +1424,7 @@ BOOLEAN KillPersonInVehicle( INT32 iId, SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
// otherwise hurt them
|
||||
pSoldier->SoldierTakeDamage( 0, 100, 0, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( 0, 100, 100, TAKE_DAMAGE_BLOODLOSS, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -261,7 +261,6 @@ typedef struct
|
||||
INT16 lockBustingPower;
|
||||
BOOLEAN tracerEffect;
|
||||
FLOAT temperatureModificator; // Flugente: modificator for weapon temperature
|
||||
INT16 poisonPercentage; // Flugente: modificator for weapon temperature
|
||||
FLOAT dirtModificator; // Flugente: modificator for dirt generation
|
||||
|
||||
//zilpin: pellet spread patterns externalized in XML
|
||||
|
||||
@@ -80,7 +80,6 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
strcmp(name, "tracerEffect") == 0 ||
|
||||
strcmp(name, "monsterSpit") == 0 ||
|
||||
strcmp(name, "temperatureModificator") == 0 ||
|
||||
strcmp(name, "PoisonPercentage") == 0 ||
|
||||
strcmp(name, "dirtModificator") == 0 ||
|
||||
strcmp(name, "ammoflag" ) == 0 ||
|
||||
strcmp(name, "dDamageModifierLife" ) == 0 ||
|
||||
@@ -287,15 +286,6 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAmmoType.temperatureModificator = (FLOAT) atof(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "PoisonPercentage") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAmmoType.poisonPercentage = (INT16) atol(pData->szCharData);
|
||||
|
||||
// check: poisonPercentage must be between 0 and 100, fit bad values
|
||||
pData->curAmmoType.poisonPercentage = max(0, pData->curAmmoType.poisonPercentage);
|
||||
pData->curAmmoType.poisonPercentage = min(100, pData->curAmmoType.poisonPercentage);
|
||||
}
|
||||
else if(strcmp(name, "dirtModificator") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
@@ -444,7 +434,6 @@ BOOLEAN WriteAmmoTypeStats()
|
||||
FilePrintf(hFile,"\t\t<lockBustingPower>%d</lockBustingPower>\r\n", AmmoTypes[cnt].lockBustingPower );
|
||||
FilePrintf(hFile,"\t\t<tracerEffect>%d</tracerEffect>\r\n", AmmoTypes[cnt].tracerEffect );
|
||||
FilePrintf(hFile,"\t\t<temperatureModificator>%4.2f</temperatureModificator>\r\n", AmmoTypes[cnt].temperatureModificator );
|
||||
FilePrintf(hFile,"\t\t<PoisonPercentage>%d</PoisonPercentage>\r\n", AmmoTypes[cnt].poisonPercentage );
|
||||
FilePrintf(hFile,"\t\t<dirtModificator>%4.2f</dirtModificator>\r\n", AmmoTypes[cnt].dirtModificator );
|
||||
FilePrintf(hFile,"\t\t<ammoflag>%d</ammoflag>\r\n", AmmoTypes[cnt].ammoflag );
|
||||
FilePrintf(hFile,"\t\t<dDamageModifierLife>%4.2f</dDamageModifierLife>\r\n", AmmoTypes[cnt].dDamageModifierLife );
|
||||
|
||||
@@ -92,7 +92,6 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
|
||||
strcmp(name, "travel_car") == 0 ||
|
||||
strcmp(name, "travel_air") == 0 ||
|
||||
strcmp(name, "travel_boat") == 0 ||
|
||||
strcmp(name, "resistance_poison") == 0 ||
|
||||
strcmp(name, "resistance_fear") == 0 ||
|
||||
strcmp(name, "resistance_suppression") == 0 ||
|
||||
strcmp(name, "resistance_physical") == 0 ||
|
||||
@@ -359,12 +358,7 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curBackground.value[BG_TRAVEL_BOAT] = min(XML_BACKGROUND_TRAVEL_MAX, max(-XML_BACKGROUND_TRAVEL_MAX, (INT8) atol(pData->szCharData) ));
|
||||
}
|
||||
else if(strcmp(name, "resistance_poison") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curBackground.value[BG_RESI_POISON] = min(XML_BACKGROUND_RESI_MAX, max(-XML_BACKGROUND_RESI_MAX, (INT8) atol(pData->szCharData) ));
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "resistance_fear") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
@@ -4173,7 +4173,6 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
{
|
||||
// reduce bleeding by 1 point per AP (in RT, APs will get recalculated so it's okay)
|
||||
pSoldier->bBleeding = __max( 0, pSoldier->bBleeding - (pSoldier->bActionPoints/2) );
|
||||
pSoldier->bPoisonBleeding = max(0, pSoldier->bPoisonBleeding - __max( 0, pSoldier->bBleeding - (pSoldier->bActionPoints/2) ) );
|
||||
return( AI_ACTION_NONE ); // will end-turn/wait depending on whether we're in TB or realtime
|
||||
}
|
||||
#ifdef RECORDNET
|
||||
|
||||
@@ -2160,7 +2160,7 @@ BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, IN
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"ExpControl pSoldier->flags.fHitByGasFlags: %d", pSoldier->flags.fHitByGasFlags );
|
||||
|
||||
// a gas effect, take damage directly...
|
||||
pSoldier->SoldierTakeDamage( ANIM_STAND, sWoundAmt, 0, sBreathAmt, TAKE_DAMAGE_GAS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_STAND, sWoundAmt, sBreathAmt, TAKE_DAMAGE_GAS, NOBODY, NOWHERE, 0, TRUE );
|
||||
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
@@ -2635,7 +2635,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
|
||||
break;
|
||||
}
|
||||
// a gas effect, take damage directly...
|
||||
pSoldier->SoldierTakeDamage( ANIM_STAND, sWoundAmt, 0, sBreathAmt, TAKE_DAMAGE_GAS, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_STAND, sWoundAmt, sBreathAmt, TAKE_DAMAGE_GAS, NOBODY, NOWHERE, 0, TRUE );
|
||||
if ( pSoldier->stats.bLife >= CONSCIOUSNESS )
|
||||
{
|
||||
pSoldier->DoMercBattleSound( (INT8)( BATTLE_SOUND_HIT1 + Random( 2 ) ) );
|
||||
@@ -5675,7 +5675,7 @@ void SoldierDropThroughRoof( SOLDIERTYPE* pSoldier, INT32 sGridNo )
|
||||
|
||||
// take damage
|
||||
UINT32 damage = 15 + Random( 5 ) + Random( 23 );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, damage, 0, damage * 100, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, damage, damage * 100, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
}
|
||||
|
||||
gridnoarmourvector GetConnectedRoofGridnoArmours( INT32 sGridNo )
|
||||
@@ -5913,7 +5913,7 @@ void RoofDestruction( INT32 sGridNo )
|
||||
|
||||
// take damage
|
||||
UINT32 damage = 10 + Random( 3 ) + Random( 10 );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, damage, 0, damage * 100, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
pSoldier->SoldierTakeDamage( ANIM_CROUCH, damage, damage * 100, TAKE_DAMAGE_FALLROOF, NOBODY, NOWHERE, 0, TRUE );
|
||||
}
|
||||
|
||||
// if there is a person here, drop them to the ground...
|
||||
|
||||
@@ -694,53 +694,30 @@ void RenderTacticalPlacementGUI()
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, giMercPanelImage, 0, xp, yp, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, gMercPlacement[ i ].uiVObjectID, 0, xp+2, yp+2, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
//HEALTH BAR
|
||||
|
||||
if( !pSoldier->stats.bLife )
|
||||
continue;
|
||||
|
||||
//yellow one for bleeding
|
||||
iStartY = yp + 29 - 27*pSoldier->stats.bLifeMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 107, 107, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 222, 181, 115 ) ) );
|
||||
|
||||
// poisoned bleeding in purple
|
||||
if ( pSoldier->bPoisonBleeding )
|
||||
{
|
||||
iStartY = yp + 29 - 27*(pSoldier->stats.bLifeMax - pSoldier->bBleeding + pSoldier->bPoisonBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 107, 57, 107 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 222, 115, 181 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//pink one for bandaged.
|
||||
iStartY = yp + 29 - 27*(pSoldier->stats.bLifeMax - pSoldier->bBleeding)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 156, 57, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 222, 132, 132 ) ) );
|
||||
|
||||
// get amount of poisoned bandage
|
||||
INT8 bPoisonBandage = pSoldier->bPoisonSum - pSoldier->bPoisonBleeding - pSoldier->bPoisonLife;
|
||||
if ( bPoisonBandage )
|
||||
{
|
||||
// poisoned bandage in bright green
|
||||
iStartY = yp + 29 - 27*(pSoldier->stats.bLife + bPoisonBandage)/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 57, 156, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 132, 222, 132 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//red one for actual health
|
||||
iStartY = yp + 29 - 27*pSoldier->stats.bLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 107, 8, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 206, 0, 0 ) ) );
|
||||
|
||||
// poisoned life
|
||||
if ( pSoldier->bPoisonLife )
|
||||
{
|
||||
iStartY = yp + 29 - 27*pSoldier->bPoisonLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 0, 206, 0 ) ) );
|
||||
}
|
||||
|
||||
|
||||
//BREATH BAR
|
||||
iStartY = yp + 29 - 27*pSoldier->bBreathMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+39, iStartY, xp+40, yp+29, Get16BPPColor( FROMRGB( 8, 8, 132 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+40, iStartY, xp+41, yp+29, Get16BPPColor( FROMRGB( 8, 8, 107 ) ) );
|
||||
|
||||
//MORALE BAR
|
||||
iStartY = yp + 29 - 27*pSoldier->aiData.bMorale/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+42, iStartY, xp+43, yp+29, Get16BPPColor( FROMRGB( 8, 156, 8 ) ) );
|
||||
|
||||
@@ -1914,7 +1914,7 @@ BOOLEAN DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason,
|
||||
// handle structure revenge - damage to vehicle
|
||||
if ( ubOwner != NOBODY && MercPtrs[ubOwner] && !TANK( MercPtrs[ubOwner] ) )
|
||||
{
|
||||
MercPtrs[ ubOwner ]->SoldierTakeDamage( 0, Random(max(0,(ubBaseArmour-10)/5))+max(0,(ubBaseArmour-10)/5), 0, 0, TAKE_DAMAGE_STRUCTURE_EXPLOSION, NOBODY, MercPtrs[ ubOwner ]->sGridNo, 0, TRUE );
|
||||
MercPtrs[ ubOwner ]->SoldierTakeDamage( 0, Random(max(0,(ubBaseArmour-10)/5))+max(0,(ubBaseArmour-10)/5), 0, TAKE_DAMAGE_STRUCTURE_EXPLOSION, NOBODY, MercPtrs[ ubOwner ]->sGridNo, 0, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1059,9 +1059,7 @@ enum
|
||||
CHOOSE_DETONATE_AND_REMOTE_DEFUSE_FREQUENCY_STR,
|
||||
CHOOSE_TRIPWIRE_NETWORK,
|
||||
|
||||
MERC_VITAL_STATS_WITH_POISON_POPUPTEXT,
|
||||
MERC_VITAL_STATS_WITH_FOOD_POPUPTEXT,
|
||||
MERC_VITAL_STATS_WITH_POISON_AND_FOOD_POPUPTEXT,
|
||||
|
||||
FUNCTION_SELECTION_STR,
|
||||
FILL_CANTEEN_STR,
|
||||
|
||||
+2
-13
@@ -260,7 +260,6 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
|
||||
strcmp(name, "Directional") == 0 ||
|
||||
strcmp(name, "DrugType") == 0 ||
|
||||
strcmp(name, "BlockIronSight") == 0 ||
|
||||
strcmp(name, "PoisonPercentage") == 0 ||
|
||||
strcmp(name, "ItemFlag") == 0 ||
|
||||
strcmp(name, "FoodType") == 0 ||
|
||||
strcmp(name, "DamageChance") == 0 ||
|
||||
@@ -1353,11 +1352,6 @@ itemEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curItem.blockironsight = (BOOLEAN) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "PoisonPercentage") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curItem.bPoisonPercentage = (INT16) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ItemFlag") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
@@ -2078,9 +2072,7 @@ BOOLEAN WriteItemStats()
|
||||
FilePrintf(hFile,"\t\t<DrugType>%d</DrugType>\r\n", Item[cnt].drugtype );
|
||||
|
||||
FilePrintf(hFile,"\t\t<BlockIronSight>%d</BlockIronSight>\r\n", Item[cnt].blockironsight );
|
||||
|
||||
FilePrintf(hFile,"\t\t<PoisonPercentage>%d</PoisonPercentage>\r\n", Item[cnt].bPoisonPercentage );
|
||||
|
||||
|
||||
FilePrintf(hFile,"\t\t<ItemFlag>%d</ItemFlag>\r\n", Item[cnt].usItemFlag );
|
||||
|
||||
FilePrintf(hFile,"\t\t<FoodType>%d</FoodType>\r\n", Item[cnt].foodtype );
|
||||
@@ -2090,10 +2082,7 @@ BOOLEAN WriteItemStats()
|
||||
FilePrintf(hFile, "\t\t<CrowbarModifier>%d</CrowbarModifier>\r\n", Item[cnt].CrowbarModifier );
|
||||
FilePrintf(hFile, "\t\t<DisarmModifier>%d</DisarmModifier>\r\n", Item[cnt].DisarmModifier );
|
||||
FilePrintf(hFile, "\t\t<RepairModifier>%d</RepairModifier>\r\n", Item[cnt].RepairModifier );
|
||||
|
||||
// Flugente poison system
|
||||
FilePrintf(hFile,"\t\t<PoisonPercentage>%d</PoisonPercentage>\r\n", Item[cnt].bPoisonPercentage );
|
||||
|
||||
|
||||
FilePrintf(hFile,"\t\t<DamageChance>%d</DamageChance>\r\n", Item[cnt].usDamageChance );
|
||||
FilePrintf(hFile,"\t\t<DirtIncreaseFactor>%4.2f</DirtIncreaseFactor>\r\n", Item[cnt].dirtIncreaseFactor );
|
||||
|
||||
|
||||
@@ -3323,13 +3323,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"设置引爆频率 (1 - 4) 和拆除频率 (A - D):", //L"Set detonation frequency (1 - 4) and defusing frequency (A - D):",
|
||||
L"设置引爆时间回合数 (1 - 4) 和拆除频率 (A - D):", //L"Set detonation time in turns (1 - 4) and defusing frequency (A - D):",
|
||||
L"选择绊线的分层 (1 - 4) 和网格 (A - D):", //L"Select tripwire hierarchy (1 - 4) and network (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning
|
||||
L"生命: %d/%d\n毒性: %d/%d\n精力: %d/%d\n士气: %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"生命: %d/%d\n精力: %d/%d\n士气: %s\n口渴: %d%s\n饥饿: %d%s",
|
||||
L"生命: %d/%d\n毒性: %d/%d\n精力: %d/%d\n士气: %s\n口渴: %d%s\n饥饿: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"你想要做的是什么?",
|
||||
@@ -8237,7 +8233,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%%坐飞机速度\n", //L" %s%d%% travel speed on air vehicles\n",
|
||||
L" %s%d%%坐船速度\n", //L" %s%d%% travel speed on water vehicles\n",
|
||||
|
||||
L" %s%d%%中毒耐性\n", //L" %s%d%% poison resistance\n",
|
||||
L" %s%d%%畏惧抵制\n", //L" %s%d%% fear resistance\n",
|
||||
L" %s%d%%压制忍耐\n", //L" %s%d%% suppression resistance\n",
|
||||
L" %s%d%%近战抗性\n", //L" %s%d%% physical resistance\n",
|
||||
|
||||
@@ -3321,13 +3321,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Set detonation frequency (1 - 4) and defusing frequency (A - D):",
|
||||
L"Set detonation time in turns (1 - 4) and defusing frequency (A - D):",
|
||||
L"Select tripwire hierarchy (1 - 4) and network (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning // TODO.Translate
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"What do you want to do?",
|
||||
@@ -8250,7 +8246,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% travel speed on air vehicles\n",
|
||||
L" %s%d%% travel speed on water vehicles\n",
|
||||
|
||||
L" %s%d%% poison resistance\n",
|
||||
L" %s%d%% fear resistance\n",
|
||||
L" %s%d%% suppression resistance\n",
|
||||
L" %s%d%% physical resistance\n",
|
||||
|
||||
@@ -3323,13 +3323,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Set detonation frequency (1 - 4) and defusing frequency (A - D):",
|
||||
L"Set detonation time in turns (1 - 4) and defusing frequency (A - D):",
|
||||
L"Select tripwire hierarchy (1 - 4) and network (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"What do you want to do?",
|
||||
@@ -8235,7 +8231,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% travel speed on air vehicles\n",
|
||||
L" %s%d%% travel speed on water vehicles\n",
|
||||
|
||||
L" %s%d%% poison resistance\n",
|
||||
L" %s%d%% fear resistance\n",
|
||||
L" %s%d%% suppression resistance\n",
|
||||
L" %s%d%% physical resistance\n",
|
||||
|
||||
@@ -3327,13 +3327,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Régler la fréquence de détonation (1-4) et désamorçage (A-D) :",
|
||||
L"Régler le nombre de tours avant l'explosion (1-4) et désamorçage (A-D) :",
|
||||
L"Régler l'ordre des fils (1-4) et du réseau (A-D) :",
|
||||
|
||||
// added by Flugente to display health and poisoning
|
||||
L"Santé : %d/%d\nPoison : %d/%d\nÉnergie : %d/%d\nMoral : %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Santé : %d/%d\nÉnergie : %d/%d\nMoral : %s\nSoif : %d%s\nFaim : %d%s",
|
||||
L"Santé : %d/%d\nPoison : %d/%d\nÉnergie : %d/%d\nMoral : %s\nSoif : %d%s\nFaim : %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"Que voulez-vous faire ?",
|
||||
@@ -8236,7 +8232,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% de vitesse dans les voyages aériens\n",
|
||||
L" %s%d%% de vitesse dans les voyages sur l'eau\n",
|
||||
|
||||
L" %s%d%% de résistance au poison\n",
|
||||
L" %s%d%% de résistance à la peur\n",
|
||||
L" %s%d%% de résistance au tir de couverture\n",
|
||||
L" %s%d%% de résistance physique\n",
|
||||
|
||||
@@ -3330,12 +3330,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Detonations-Zeit (in Züge) (1 - 4) und die Entschärfungs-Frequenz (A - D):",
|
||||
L"Stolperdraht-Hierarchie (1 - 4) und das Netzwerk (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning
|
||||
L"Gesundheit: %d/%d\nGift: %d/%d\nAusdauer: %d/%d\nMoral: %s",
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Gesundheit: %d/%d\nAusdauer: %d/%d\nMoral: %s\nWasser: %d%s\nEssen: %d%s",
|
||||
L"Ges.: %d/%d\nGift: %d/%d\nAusd.: %d/%d\nMoral: %s\nWasser: %d%s\nEssen: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"Was möchten Sie tun?",
|
||||
@@ -8067,7 +8063,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% travel speed on air vehicles\n",
|
||||
L" %s%d%% travel speed on water vehicles\n",
|
||||
|
||||
L" %s%d%% poison resistance\n",
|
||||
L" %s%d%% fear resistance\n",
|
||||
L" %s%d%% suppression resistance\n",
|
||||
L" %s%d%% physical resistance\n",
|
||||
|
||||
@@ -3316,13 +3316,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Set detonation frequency (1 - 4) and defusing frequency (A - D):",
|
||||
L"Set detonation time in turns (1 - 4) and defusing frequency (A - D):",
|
||||
L"Select tripwire hierarchy (1 - 4) and network (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning // TODO.Translate
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"What do you want to do?",
|
||||
@@ -8245,7 +8241,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% travel speed on air vehicles\n",
|
||||
L" %s%d%% travel speed on water vehicles\n",
|
||||
|
||||
L" %s%d%% poison resistance\n",
|
||||
L" %s%d%% fear resistance\n",
|
||||
L" %s%d%% suppression resistance\n",
|
||||
L" %s%d%% physical resistance\n",
|
||||
|
||||
@@ -3331,13 +3331,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Set detonation frequency (1 - 4) and defusing frequency (A - D):",
|
||||
L"Set detonation time in turns (1 - 4) and defusing frequency (A - D):",
|
||||
L"Select tripwire hierarchy (1 - 4) and network (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning // TODO.Translate
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"What do you want to do?",
|
||||
@@ -8262,7 +8258,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% travel speed on air vehicles\n",
|
||||
L" %s%d%% travel speed on water vehicles\n",
|
||||
|
||||
L" %s%d%% poison resistance\n",
|
||||
L" %s%d%% fear resistance\n",
|
||||
L" %s%d%% suppression resistance\n",
|
||||
L" %s%d%% physical resistance\n",
|
||||
|
||||
@@ -3320,13 +3320,9 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
|
||||
L"Установите частоту активации (1 - 4) и частоту деактивации (A - D):",
|
||||
L"Установите время до активации в ходах (1 - 4) и частоту деактивации (A - D):",
|
||||
L"Выберите уровень (1 - 4) и сеть (A - D):",
|
||||
|
||||
// added by Flugente to display health and poisoning
|
||||
L"Здоровье: %d/%d\nЯд: %d/%d\nЭнергия: %d/%d\nБоевой дух: %s",
|
||||
|
||||
|
||||
// added by Flugente to display food status
|
||||
L"Здоровье: %d/%d\nЭнергия: %d/%d\nБоевой дух: %s\nВода: %d%s\nПища: %d%s",
|
||||
L"Здоровье: %d/%d\nЯд: %d/%d\nЭнергия: %d/%d\nБоевой дух: %s\nВода: %d%s\nПища: %d%s",
|
||||
|
||||
// added by Flugente: selection of a function to call in tactical
|
||||
L"Что будем делать?",
|
||||
@@ -8232,7 +8228,6 @@ STR16 szBackgroundText_Value[]=
|
||||
L" %s%d%% скорость движения на воздушном транспорте\n",
|
||||
L" %s%d%% скорость движения на водном транспорте\n",
|
||||
|
||||
L" %s%d%% сопротивление яду\n",
|
||||
L" %s%d%% сопротивление страху\n",
|
||||
L" %s%d%% сопротивление подавлению\n",
|
||||
L" %s%d%% физическое сопротивление\n",
|
||||
|
||||
Reference in New Issue
Block a user