mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user