mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
HAM5.5b2 merged in!
Notes: -There may still be bugs!! (In fact, I almost guarantee it -- there's -Ammo box code added to HR's crate code -Splitting a crate/box also automatically refills half empty magazines -new pathing arrows for map screen not included -code for scouts to know where enemies are going doesn't appear to work... but i'm not sure it was completed. -lots of gobledy gook (chinese?) comments turned back to english -also added Bob's popups -other languages besides english still need to have there language.cpp files updated with array changes -AI enhancements by Warmsteel (reloading, suppression, roaming, avoiding gas, and other fixes) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5181 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -103,6 +103,9 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
|
||||
// Flashbang effect on soldier
|
||||
UINT8 DetermineFlashbangEffect( SOLDIERTYPE *pSoldier, INT8 ubExplosionDir, BOOLEAN fInBuilding);
|
||||
|
||||
// HEADROCK HAM 5.1: Explosion Fragments launcher
|
||||
void FireFragments( SOLDIERTYPE * pThrower, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem );
|
||||
|
||||
extern INT8 gbSAMGraphicList[ MAX_NUMBER_OF_SAMS ];
|
||||
extern void AddToShouldBecomeHostileOrSayQuoteList( UINT8 ubID );
|
||||
extern void RecompileLocalMovementCostsForWall( INT32 sGridNo, UINT8 ubOrientation );
|
||||
@@ -338,12 +341,17 @@ void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32
|
||||
ExpParams.bLevel = bLevel;
|
||||
|
||||
GenerateExplosion( &ExpParams );
|
||||
|
||||
// HEADROCK HAM 5.1: Launch fragments from the explosion.
|
||||
if (Explosive[ Item[ usItem ].ubClassIndex ].usNumFragments > 0 )
|
||||
{
|
||||
// HEADROCK HAM 5: Deactivated until the release of HAM 5.1.
|
||||
FireFragments( MercPtrs[ubOwner], sX, sY, sZ, usItem );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void IgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel )
|
||||
{
|
||||
InternalIgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, usItem, TRUE, bLevel );
|
||||
@@ -4349,6 +4357,43 @@ UINT8 DetermineFlashbangEffect( SOLDIERTYPE *pSoldier, INT8 ubExplosionDir, BOOL
|
||||
return ( FIRE_WEAPON_BLINDED_AND_DEAFENED );
|
||||
}
|
||||
|
||||
|
||||
// HEADROCK HAM 5.1: This handles launching fragments out of an explosion. The number of fragments is read from
|
||||
// the Explosives.XML file, and they each have a set amount of damage and range as well. They are currently
|
||||
// fired at completely random trajectories.
|
||||
void FireFragments( SOLDIERTYPE * pThrower, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem )
|
||||
{
|
||||
UINT16 usNumFragments = Explosive[Item[usItem].ubClassIndex].usNumFragments;
|
||||
UINT16 ubFragRange = Explosive[Item[usItem].ubClassIndex].ubFragRange;
|
||||
|
||||
AssertMsg( ubFragRange > 0 , "Fragmentation data lacks range property!" );
|
||||
|
||||
for (UINT16 x = 0; x < usNumFragments; x++)
|
||||
{
|
||||
FLOAT dRandomX = ((FLOAT)Random(2000) / 1000.0f) - 1.0f;
|
||||
FLOAT dRandomY = ((FLOAT)Random(2000) / 1000.0f) - 1.0f;
|
||||
FLOAT dRandomZ = ((FLOAT)Random(2000) / 1000.0f) - 1.0f;
|
||||
|
||||
FLOAT dDeltaX = (dRandomX * ubFragRange);
|
||||
FLOAT dDeltaY = (dRandomY * ubFragRange);
|
||||
FLOAT dDeltaZ = ((dRandomZ * 25.6f) * 50 );
|
||||
|
||||
FLOAT dRangeMultiplier = 10; // Arbitrary, but gives good results.
|
||||
|
||||
FLOAT dEndX = (FLOAT)(sX + (dDeltaX * dRangeMultiplier));
|
||||
FLOAT dEndY = (FLOAT)(sY + (dDeltaY * dRangeMultiplier));
|
||||
FLOAT dEndZ = (FLOAT)(sZ + (dDeltaZ * dRangeMultiplier));
|
||||
|
||||
// Add some randomness to the start coordinates as well, so that not all fragments fly from the same point
|
||||
// in space.
|
||||
FLOAT dStartX = (FLOAT)sX + (dRandomX * ((FLOAT)Random(4)+1.0f));
|
||||
FLOAT dStartY = (FLOAT)sY + (dRandomY * ((FLOAT)Random(4)+1.0f));
|
||||
FLOAT dStartZ = (FLOAT)sZ + (dRandomZ * ((FLOAT)Random(4)+1.0f));
|
||||
|
||||
FireFragmentGivenTarget( pThrower, dStartX, dStartY, dStartZ, dEndX, dEndY, dEndZ, usItem );
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
|
||||
//-- UB
|
||||
|
||||
Reference in New Issue
Block a user