mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
New feature: radio operator trait allows calling in artillery, requesting reinforcements, scanning for enemies and a few other skills.
Also includes mechansim for easy implementation of new skills. For more info see http://www.bears-pit.com/board/ubbthreads.php/topics/327348.html#Post327348 Requires GameDir >= r1848. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6547 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2867,3 +2867,38 @@ INT32 RandomGridFromRadius( INT32 sSweetGridNo, INT8 ubMinRadius, INT8 ubMaxRadi
|
||||
|
||||
return( sGridNo );
|
||||
}
|
||||
|
||||
UINT32 GetArtilleryTargetGridNo( UINT32 sTargetGridNo, INT8 bRadius )
|
||||
{
|
||||
return RandomGridFromRadius( sTargetGridNo, 1, bRadius );
|
||||
}
|
||||
|
||||
BOOLEAN GetArtilleryLaunchParams( UINT32 sStartingGridNo, UINT32 sTargetGridNo, INT16 sStartZ, INT16 sEndZ, UINT16 usLauncher, OBJECTTYPE* pObj, FLOAT* pdForce, FLOAT* pdDegrees)
|
||||
{
|
||||
FLOAT dMagForce, dMaxForce, dMinForce;
|
||||
FLOAT dDegrees = OUTDOORS_START_ANGLE;
|
||||
INT16 sMinRange = MIN_MORTAR_RANGE;
|
||||
|
||||
sStartZ = 256;
|
||||
|
||||
// Find force for basic
|
||||
INT32 sFinalGridNo = 0;
|
||||
FindBestForceForTrajectory( sStartingGridNo, sTargetGridNo, sStartZ, sEndZ, dDegrees, pObj, &sFinalGridNo, &dMagForce );
|
||||
|
||||
INT32 uiMaxRange = GetModifiedGunRange(usLauncher) / CELL_X_SIZE;
|
||||
|
||||
dMaxForce = CalculateForceFromRange( NULL, (INT16) uiMaxRange, (FLOAT)( PI/4 ) );
|
||||
|
||||
if ( dMagForce > dMaxForce )
|
||||
dMagForce = dMaxForce;
|
||||
|
||||
dMinForce = CalculateForceFromRange( NULL, (INT16)( sMinRange / 10 ), (FLOAT)( PI / 4 ) );
|
||||
|
||||
if ( dMagForce < dMinForce )
|
||||
dMagForce = dMinForce;
|
||||
|
||||
(*pdForce) = dMagForce;
|
||||
(*pdDegrees) = dDegrees;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user