mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- new drug: etorphine (DRUG_TYPE_STUNANDKILL) stuns the user for its duration. Warning: Lethal if overdosed (lethal dose depends on boytype)
- show 'drugged' symbol for every drug (apart from alcohol) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5991 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -10,10 +10,11 @@
|
||||
#include "points.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h" // SANDRO - had to add this, dammit!
|
||||
#include "Random.h"
|
||||
#include "Text.h"
|
||||
#include "Interface.h"
|
||||
#include "Food.h" // added by Flugente
|
||||
#include "Random.h"
|
||||
#include "Text.h"
|
||||
#include "Interface.h"
|
||||
#include "Food.h" // added by Flugente
|
||||
#include "Animation data.h" // added by Flugente for SoldierBodyTypes
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
@@ -260,8 +261,8 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT32 drugtestflag = (1 << cnt); // comparing with this flag will determine the drug
|
||||
|
||||
// we do not actually test for DRUG_REGENERATION, because that is checked afterwards separately
|
||||
if ( (drugtestflag & DRUG_REGENERATION ) != 0 )
|
||||
// omit DRUG_TYPE_REGENERATION, because that is checked afterwards separately
|
||||
if ( cnt == DRUG_TYPE_REGENERATION )
|
||||
continue;
|
||||
|
||||
// If side effect aret is non-zero....
|
||||
@@ -419,6 +420,97 @@ void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
// 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 ] )
|
||||
{
|
||||
// Keel over...
|
||||
DeductPoints( pSoldier, 0, 20000 );
|
||||
|
||||
UINT8 bodyweight = 10;
|
||||
switch ( pSoldier->ubBodyType )
|
||||
{
|
||||
case REGMALE:
|
||||
case MANCIV:
|
||||
bodyweight = 10;
|
||||
break;
|
||||
|
||||
case BIGMALE:
|
||||
case STOCKYMALE:
|
||||
bodyweight = 12;
|
||||
break;
|
||||
|
||||
case REGFEMALE:
|
||||
bodyweight = 9;
|
||||
break;
|
||||
|
||||
case ADULTFEMALEMONSTER:
|
||||
case AM_MONSTER:
|
||||
bodyweight = 30;
|
||||
break;
|
||||
|
||||
case YAF_MONSTER:
|
||||
case YAM_MONSTER:
|
||||
bodyweight = 20;
|
||||
break;
|
||||
|
||||
case LARVAE_MONSTER:
|
||||
bodyweight = 4;
|
||||
break;
|
||||
|
||||
case INFANT_MONSTER:
|
||||
bodyweight = 10;
|
||||
break;
|
||||
|
||||
case QUEENMONSTER:
|
||||
bodyweight = 100;
|
||||
break;
|
||||
|
||||
case FATCIV:
|
||||
case MINICIV:
|
||||
case DRESSCIV:
|
||||
bodyweight = 8;
|
||||
break;
|
||||
|
||||
case HATKIDCIV:
|
||||
case KIDCIV:
|
||||
bodyweight = 4;
|
||||
break;
|
||||
|
||||
case CRIPPLECIV:
|
||||
bodyweight = 7;
|
||||
break;
|
||||
|
||||
case COW:
|
||||
bodyweight = 20;
|
||||
break;
|
||||
|
||||
case CROW:
|
||||
bodyweight = 1;
|
||||
break;
|
||||
|
||||
case BLOODCAT:
|
||||
bodyweight = 20;
|
||||
break;
|
||||
|
||||
case ROBOTNOWEAPON:
|
||||
case HUMVEE:
|
||||
case TANK_NW:
|
||||
case TANK_NE:
|
||||
case ELDORADO:
|
||||
case ICECREAMTRUCK:
|
||||
case JEEP:
|
||||
// this should not happen anyway...
|
||||
bodyweight = 100;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( pSoldier->drugs.bDrugEffect[ DRUG_TYPE_STUNANDKILL ] > bodyweight )
|
||||
{
|
||||
if ( Chance( 10 * (pSoldier->drugs.bDrugEffect[ DRUG_TYPE_STUNANDKILL ] - bodyweight) ) )
|
||||
pSoldier->EVENT_SoldierGotHit( 0, 400, 0, pSoldier->ubDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pSoldier->bAimShotLocation, 0, -1 );
|
||||
}
|
||||
}
|
||||
|
||||
// if all drug effects have ended, delete flag
|
||||
if ( !MercUnderTheInfluence(pSoldier) )
|
||||
pSoldier->bSoldierFlagMask &= ~SOLDIER_DRUGGED;
|
||||
@@ -568,3 +660,17 @@ BOOLEAN MercUnderTheInfluence( SOLDIERTYPE *pSoldier, UINT8 aDrugType )
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN MercDruggedButNotDrunk( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
for (UINT8 cnt = DRUG_TYPE_ADRENALINE; cnt < DRUG_TYPE_MAX; ++cnt)
|
||||
{
|
||||
if ( cnt == DRUG_TYPE_ALCOHOL )
|
||||
continue;
|
||||
|
||||
if ( MercUnderTheInfluence(pSoldier, cnt) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ enum {
|
||||
DRUG_TYPE_VISION,
|
||||
DRUG_TYPE_TUNNELVISION,
|
||||
DRUG_TYPE_LIFEDAMAGE,
|
||||
DRUG_TYPE_CUREPOISON // 20
|
||||
DRUG_TYPE_CUREPOISON, // 20
|
||||
DRUG_TYPE_STUNANDKILL,
|
||||
};
|
||||
|
||||
// Flugente, 12-04-21
|
||||
@@ -62,7 +63,7 @@ enum {
|
||||
#define DRUG_TUNNELVISION (1 << DRUG_TYPE_TUNNELVISION) //0x00040000 //262144
|
||||
#define DRUG_LIFEDAMAGE (1 << DRUG_TYPE_LIFEDAMAGE) //0x00080000 //524288
|
||||
#define DRUG_CUREPOISON (1 << DRUG_TYPE_CUREPOISON) //0x00100000 //1048576
|
||||
#define DRUG_MISC_8 0x00200000 //2097152
|
||||
#define DRUG_STUNANDKILL (1 << DRUG_TYPE_STUNANDKILL) //0x00200000 //2097152
|
||||
#define DRUG_MISC_9 0x00400000 //4194304
|
||||
#define DRUG_MISC_10 0x00800000 //8388608
|
||||
#define DRUG_MISC_11 0x01000000 //16777216
|
||||
@@ -99,5 +100,6 @@ INT8 GetDrunkLevel( SOLDIERTYPE *pSoldier );
|
||||
INT32 EffectStatForBeingDrunk( SOLDIERTYPE *pSoldier, INT32 iStat );
|
||||
BOOLEAN MercUnderTheInfluence( SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN MercUnderTheInfluence( SOLDIERTYPE *pSoldier, UINT8 aDrugType );
|
||||
BOOLEAN MercDruggedButNotDrunk( SOLDIERTYPE *pSoldier );
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -2274,8 +2274,8 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
// Flugente: add the drug symbol for more drugs
|
||||
if ( MercPtrs[ pFace->ubSoldierID ]->drugs.bDrugEffect[ DRUG_TYPE_ADRENALINE ] || MercPtrs[ pFace->ubSoldierID ]->drugs.bDrugEffect[ DRUG_TYPE_STRENGTH ] || MercPtrs[ pFace->ubSoldierID ]->drugs.bDrugEffect[ DRUG_TYPE_AGILITY ] || MercPtrs[ pFace->ubSoldierID ]->drugs.bDrugEffect[ DRUG_TYPE_DEXTERITY ] || MercPtrs[ pFace->ubSoldierID ]->drugs.bDrugEffect[ DRUG_TYPE_WISDOM ] )
|
||||
// Flugente: add drug symbol if drugged (without alcohol 'drug')
|
||||
if ( MercDruggedButNotDrunk( MercPtrs[ pFace->ubSoldierID ] ) )
|
||||
{
|
||||
DoRightIcon( uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 7 );
|
||||
bNumRightIcons++;
|
||||
|
||||
Reference in New Issue
Block a user