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
+46 -1
View File
@@ -6175,6 +6175,12 @@ BOOLEAN CanItemFitInPosition( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj, INT8 bPos
switch( bPos )
{
case SECONDHANDPOS:
// Flugente: disease can stop us from using our arms normally
if ( gGameExternalOptions.fDisease
&& gGameExternalOptions.fDiseaseSevereLimitations
&& pSoldier->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_ARMS ) )
return FALSE;
if (Item[pSoldier->inv[HANDPOS].usItem].twohanded )
{
return( FALSE );
@@ -6183,6 +6189,12 @@ BOOLEAN CanItemFitInPosition( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj, INT8 bPos
case HANDPOS:
if (Item[ pObj->usItem ].twohanded )
{
// Flugente: disease can stop us from using our arms normally
if ( gGameExternalOptions.fDisease
&& gGameExternalOptions.fDiseaseSevereLimitations
&& pSoldier->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_ARMS ) )
return FALSE;
if ( pSoldier->inv[HANDPOS].exists() && pSoldier->inv[SECONDHANDPOS].exists() )
{
// two items in hands; try moving the second one so we can swap
@@ -9173,7 +9185,40 @@ void SwapHandItems( SOLDIERTYPE * pSoldier )
BOOLEAN fOk;
CHECKV( pSoldier );
if (pSoldier->inv[HANDPOS].exists() == false || pSoldier->inv[SECONDHANDPOS].exists() == false)
// Flugente: disease can stop us from using our arms normally
if ( gGameExternalOptions.fDisease
&& gGameExternalOptions.fDiseaseSevereLimitations
&& pSoldier->HasDiseaseWithFlag( DISEASE_PROPERTY_LIMITED_USE_ARMS ) )
{
// if we only have one usable hand, drop item in main hand to inventory
if ( pSoldier->inv[HANDPOS].exists() )
{
// must move the item in the main hand elsewhere in the inventory
fOk = AutoPlaceObject( pSoldier, &( pSoldier->inv[HANDPOS] ), FALSE, HANDPOS );
if ( !fOk )
{
return;
}
}
// if we somehow had an item in our second hand (which shouldn't be possible to begin with), drop it to inventory if twohanded
if ( TwoHandedItem( pSoldier->inv[SECONDHANDPOS].usItem ) )
{
// must move the item in the main hand elsewhere in the inventory
fOk = AutoPlaceObject( pSoldier, &( pSoldier->inv[SECONDHANDPOS] ), FALSE, SECONDHANDPOS );
if ( !fOk )
{
return;
}
// the main hand is now empty so a swap is going to work...
}
// whatever is in the second hand can be swapped to the main hand!
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
}
else if (pSoldier->inv[HANDPOS].exists() == false || pSoldier->inv[SECONDHANDPOS].exists() == false)
{
// whatever is in the second hand can be swapped to the main hand!
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );