Driveable vehicle Update: Externalized vehicle seats (by anv)

- externalised vehicle seats (TableData\Vehicles.xml) influence position of passenger, field of view, ability to shoot and being hidden,
- seat can chosen by using ctrl+RMB on vehicle (ctrl + LMB just takes the first visible seat)
- seats can be changed or swapped while inside vehicle,
- remade JSD files for cars,
- vehicles aren't transparent anymore,
- vehicles are louder than people, depending how fast they move.
see: http://www.bears-pit.com/board/ubbthreads.php/topics/332790/5.html


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7212 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-05-18 15:26:15 +00:00
parent cf1b9982ba
commit bbff053fc5
35 changed files with 1209 additions and 144 deletions
+34
View File
@@ -48,6 +48,7 @@
#include "drugs and alcohol.h"
#include "Interface.h"
#include "Explosion Control.h"//dnl ch40 200909
#include "Vehicles.h"
#endif
#ifdef JA2UB
@@ -1217,6 +1218,18 @@ INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
return( 0 );
}
// anv: some places in vehicle don't give passenger any view outside
INT8 bSeatIndex = GetSeatIndexFromSoldier( pSoldier );
if( bSeatIndex != (-1) )
{
SOLDIERTYPE *pVehicle = GetSoldierStructureForVehicle( pSoldier ->iVehicleId );
// need to check this even if bSubjectDir is DIRECTION_IRRELEVANT
if( gNewVehicle[ pVehicleList[ pSoldier->iVehicleId ].ubVehicleType ].VehicleSeats[ bSeatIndex ].fBlockedView )
{
return( 0 );
}
}
if ( bFacingDir == DIRECTION_IRRELEVANT && TANK( pSoldier ) )
{
// always calculate direction for tanks so we have something to work with
@@ -5296,6 +5309,8 @@ void DebugSoldierPage4( )
//
#define MAX_MOVEMENT_NOISE 9
#define VEHICLE_FAST_MOVEMENT_NOISE 25
#define VEHICLE_NORMAL_MOVEMENT_NOISE 15
UINT8 MovementNoise( SOLDIERTYPE *pSoldier )
{
@@ -5303,6 +5318,25 @@ UINT8 MovementNoise( SOLDIERTYPE *pSoldier )
UINT8 ubMaxVolume, ubVolume, ubBandaged, ubEffLife;
INT8 bInWater = FALSE;
// anv: vehicle and passengers
if( pSoldier->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
{
return( 0 );
}
else if( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) )
{
if( pSoldier->usAnimState == RUNNING )
{
// driving fast makes engine work louder
return( VEHICLE_FAST_MOVEMENT_NOISE );
}
else
{
return( VEHICLE_NORMAL_MOVEMENT_NOISE );
}
}
// anv: additional tile properties
// modify amount of noise and stealth difficulty depending on surface type