mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- Bugfix: The name-tag in Drugs.xml made the drug system not working (by Flugente)
- New drug effect: cyanide damages life as a sideeffect. Currently doesn't kill, but lets you lose consciousness. (by Flugente) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5263 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -473,6 +473,23 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
|
||||
// Keel over...
|
||||
DeductPoints( pSoldier, 0, 20000 );
|
||||
}
|
||||
|
||||
// if we have a life damaging effect, deduct life points
|
||||
if ( pSoldier->drugs.bDrugEffect[ DRUG_TYPE_LIFEDAMAGE ] == 0 && pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_LIFEDAMAGE ] > 0 )
|
||||
{
|
||||
if ( pSoldier->stats.bLife > OKLIFE )
|
||||
{
|
||||
INT8 lifepointdamage = pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_LIFEDAMAGE ];
|
||||
|
||||
INT8 applieddamage = pSoldier->stats.bLife;
|
||||
|
||||
pSoldier->stats.bLife = max(OKLIFE - 1, pSoldier->stats.bLife - lifepointdamage);
|
||||
|
||||
applieddamage -= pSoldier->stats.bLife;
|
||||
|
||||
pSoldier->iHealableInjury += (applieddamage * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user