Whether a gun shoots fire or fire retardant is now set on the ammo with the <ammoflag>-tag, not the gun.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9144 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2021-07-15 18:22:53 +00:00
parent 320328a441
commit e6ea95eb8b
14 changed files with 99 additions and 41 deletions
+34
View File
@@ -2414,6 +2414,24 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + cnt ] );
cnt++;
}
////////////////// Ammo with white smoke trail
if ( AmmoTypes[Magazine[Item[gpItemDescObject->usItem].ubClassIndex].ubAmmoType].ammoflag & AMMO_TRAIL_WHITESMOKE )
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[49], szUDBGenSecondaryStatsExplanationsTooltipText[49] );
SetRegionFastHelpText( &( gUDBFasthelpRegions[iFirstDataRegion + cnt] ), pStr );
MSYS_EnableRegion( &gUDBFasthelpRegions[iFirstDataRegion + cnt] );
cnt++;
}
////////////////// Ammo with fire trail
if ( AmmoTypes[Magazine[Item[gpItemDescObject->usItem].ubClassIndex].ubAmmoType].ammoflag & AMMO_TRAIL_FIRE )
{
swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[50], szUDBGenSecondaryStatsExplanationsTooltipText[50] );
SetRegionFastHelpText( &( gUDBFasthelpRegions[iFirstDataRegion + cnt] ), pStr );
MSYS_EnableRegion( &gUDBFasthelpRegions[iFirstDataRegion + cnt] );
cnt++;
}
}
if (Item[ gpItemDescObject->usItem ].usItemClass & IC_EXPLOSV)
@@ -6108,6 +6126,22 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject )
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 36, gItemDescGenSecondaryRegions[cnt].sLeft+sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
////////////////// Ammo with white smoke trail
if ( ( AmmoTypes[Magazine[Item[gpItemDescObject->usItem].ubClassIndex].ubAmmoType].ammoflag & AMMO_TRAIL_WHITESMOKE && !fComparisonMode ) ||
( fComparisonMode && AmmoTypes[Magazine[Item[gpComparedItemDescObject->usItem].ubClassIndex].ubAmmoType].ammoflag & AMMO_TRAIL_WHITESMOKE ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 46, gItemDescGenSecondaryRegions[cnt].sLeft + sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
////////////////// Ammo with fire trail
if ( ( AmmoTypes[Magazine[Item[gpItemDescObject->usItem].ubClassIndex].ubAmmoType].ammoflag & AMMO_TRAIL_FIRE && !fComparisonMode ) ||
( fComparisonMode && AmmoTypes[Magazine[Item[gpComparedItemDescObject->usItem].ubClassIndex].ubAmmoType].ammoflag & AMMO_TRAIL_FIRE ) )
{
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 47, gItemDescGenSecondaryRegions[cnt].sLeft + sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
cnt++;
}
}
if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_EXPLOSV))
-1
View File
@@ -779,7 +779,6 @@ extern OBJECTTYPE gTempObject;
// extended flagmask to UINT64
#define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag
#define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases
#define FIREEXTINGUISHER 0x0000000400000000 // this item is a fire extinguisher, which results in a white trail of smoke when firing
// ----------------------------------------------------------------
+24 -24
View File
@@ -4819,16 +4819,16 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
else if ( usHandItem == FLAMETHROWER )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
else if ( Item[usHandItem].usItemFlag & FIREEXTINGUISHER )
else if ( AmmoTypes[( *pObjAttHand )[0]->data.gun.ubGunAmmoType].ammoflag & AMMO_TRAIL_WHITESMOKE )
{
usBulletFlags |= BULLET_FLAG_WHITESMOKE;
ubSpreadIndex = 2;
}
else if ( AmmoTypes[( *pObjAttHand )[0]->data.gun.ubGunAmmoType].ammoflag & AMMO_TRAIL_FIRE )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
// HEADROCK HAM B2.5: Set tracer effect on/off for individual bullets in a Tracer Magazine, as part of the
// New Tracer System.
else if (gGameExternalOptions.ubRealisticTracers > 0 && gGameExternalOptions.ubNumBulletsPerTracer > 0 && (pFirer->bDoAutofire > 0 || pFirer->bDoBurst > 0)
@@ -5318,16 +5318,16 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
else if ( usHandItem == FLAMETHROWER )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
else if ( Item[usHandItem].usItemFlag & FIREEXTINGUISHER )
else if ( AmmoTypes[( *pObjAttHand )[0]->data.gun.ubGunAmmoType].ammoflag & AMMO_TRAIL_WHITESMOKE )
{
usBulletFlags |= BULLET_FLAG_WHITESMOKE;
ubSpreadIndex = 2;
}
else if ( AmmoTypes[( *pObjAttHand )[0]->data.gun.ubGunAmmoType].ammoflag & AMMO_TRAIL_FIRE )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
// HEADROCK HAM B2.5: Set tracer effect on/off for individual bullets in a Tracer Magazine, as part of the
// New Tracer System.
else if (gGameExternalOptions.ubRealisticTracers > 0 && gGameExternalOptions.ubNumBulletsPerTracer > 0 && (pFirer->bDoAutofire > 0 || pFirer->bDoBurst > 0)
@@ -6004,16 +6004,16 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
else if ( usItem == FLAMETHROWER )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
else if ( Item[usItem].usItemFlag & FIREEXTINGUISHER )
else if ( AmmoTypes[ammotype].ammoflag & AMMO_TRAIL_WHITESMOKE )
{
usBulletFlags |= BULLET_FLAG_WHITESMOKE;
ubSpreadIndex = 2;
}
else if ( AmmoTypes[ammotype].ammoflag & AMMO_TRAIL_FIRE )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
// Flugente: anti-materiel ammo
if ( AmmoTypes[ammotype].ammoflag & AMMO_ANTIMATERIEL )
@@ -6589,16 +6589,16 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
{
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
}
else if ( usItem == FLAMETHROWER )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
else if ( Item[usItem].usItemFlag & FIREEXTINGUISHER )
else if ( AmmoTypes[ammotype].ammoflag & AMMO_TRAIL_WHITESMOKE )
{
usBulletFlags |= BULLET_FLAG_WHITESMOKE;
ubSpreadIndex = 2;
}
else if ( AmmoTypes[ammotype].ammoflag & AMMO_TRAIL_FIRE )
{
usBulletFlags |= BULLET_FLAG_FLAME;
ubSpreadIndex = 2;
}
// Flugente: anti-materiel ammo
if ( AmmoTypes[ammotype].ammoflag & AMMO_ANTIMATERIEL )
+4 -2
View File
@@ -5959,8 +5959,10 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
{
ubReason = TAKE_DAMAGE_VEHICLE_TRAUMA;
}
// Flugente: it would be more reasonable to check for the ammo or gun details, but that's what is used in other locations
else if ( usWeaponIndex == FLAMETHROWER )
// Flugente: check the ammo
else if ( ubAttackerID != NOBODY
&& MercPtrs[ubAttackerID]->inv[HANDPOS].exists()
&& AmmoTypes[*&( MercPtrs[ubAttackerID]->inv[HANDPOS] )[0]->data.gun.ubGunAmmoType].ammoflag & AMMO_TRAIL_FIRE )
{
ubReason = TAKE_DAMAGE_GAS_FIRE;
+3 -3
View File
@@ -165,10 +165,10 @@ enum
#define AMMO_CRYO 0x00000001 //1 // this ammo shock-freezes target
#define AMMO_BLIND 0x00000002 //2 // this ammo will blind if it hits the head
#define AMMO_ANTIMATERIEL 0x00000004 //4 // this ammo is anti-materiel, bullets can destroy structures
/*#define CONCERTINA 0x00000008 //8
#define AMMO_TRAIL_WHITESMOKE 0x00000008 //8 // this ammo leaves a trail of white smoke
#define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in
#define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat
#define AMMO_TRAIL_FIRE 0x00000010 //16 // this ammo leaves a trail of fire
/*#define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat
#define COW_MEAT 0x00000040 //64 // retrieve this by gutting a cow
#define BELT_FED 0x00000080 //128 // item can be fed externally