Disease update:

- <InfectionChance_WOUND_FIRE> can cause infections when taking fire damage
- <InfectionChance_WOUND_GAS> can cause infections when taking non-fire gas damage
- <fSpecialFlagLimitedUseArms> causes the infected to be unable to use one arm
- <fSpecialFlagLimitedUseLegs> causes the infected to be unable to run, and walk and travel slowly
- JA2_options.ini option DISEASE_SEVERE_LIMITATIONS controls whether <fSpecialFlagContractDisability>, <fSpecialFlagLimitedUseArms> and <fSpecialFlagLimitedUseLegs> are used

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=22099&goto=360451&#msg_360451

- Gas damage split up in fire and non-fire damage.
- Flamethrower projectile damaged is affected by fire resistance.

Requires GameDir >= r2553.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8828 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2020-06-25 22:42:44 +00:00
parent 4e86046d0c
commit 098dc8e280
36 changed files with 694 additions and 89 deletions
+16 -9
View File
@@ -77,11 +77,22 @@ void HandleDisease()
{
if ( pSoldier->sDiseasePoints[i] > 0 )
{
// add disease points - some diseases can reverse on certain states
INT32 pointgain = Disease[i].sInfectionPtsGainPerHour;
// if the arm/leg is severely wounded, a splint increases the healing speed (assuming the gain is negative to begin with and doesn't reverse)
if ( gGameExternalOptions.fDiseaseSevereLimitations
&& Disease[i].usDiseaseProperties & (DISEASE_PROPERTY_LIMITED_USE_ARMS| DISEASE_PROPERTY_LIMITED_USE_LEGS)
&& ( pSoldier->sDiseaseFlag[i] & (SOLDIERDISEASE_SPLINTAPPLIED_ARM| SOLDIERDISEASE_SPLINTAPPLIED_LEG) ) )
{
pointgain *= 2;
}
// some diseases can reverse on certain states
if ( pSoldier->sDiseaseFlag[i] & SOLDIERDISEASE_REVERSEAL )
pSoldier->AddDiseasePoints( i, -Disease[i].sInfectionPtsGainPerHour );
else
pSoldier->AddDiseasePoints( i, Disease[i].sInfectionPtsGainPerHour );
pointgain *= -1;
// add disease points - some diseases can reverse on certain states
pSoldier->AddDiseasePoints( i, pointgain );
}
}
}
@@ -192,10 +203,6 @@ void HandlePossibleInfection( SOLDIERTYPE *pSoldier, SOLDIERTYPE* pOtherSoldier,
int max = fStrategicOnly ? 1 : NUM_DISEASES;
for ( int i = 0; i < max; ++i )
{
// do not infect us if we are already infected
if ( !(Disease[i].usDiseaseProperties & DISEASE_PROPERTY_CANREINFECT) && pSoldier->sDiseasePoints[i] > 0 )
continue;
// chance of infection by insects
FLOAT dChance = Disease[i].dInfectionChance[aInfectionType];
@@ -223,7 +230,7 @@ void HandlePossibleInfection( SOLDIERTYPE *pSoldier, SOLDIERTYPE* pOtherSoldier,
dChance *= (1.0f - pSoldier->GetDiseaseContactProtection( ));
}
// chances ca be smaller than 1%, so we use a trick here by altering ou 'chance function'. This allows to have much smaller chances, as for diseases, 1% can be way too high.
// chances can be smaller than 1%, so we use a trick here by altering our 'chance function'. This allows to have much smaller chances, as for diseases, 1% can be way too high.
if ( Random( 10000 ) < dChance * 100 )
{
// infect us