Drivable Cars update (by anv):

- Streamlined vehicle controls - no more selecting driver and vehicle separately, switching displayed APs and other esoteric activities. To move vehicle just select its driver and you're good to go. If you click on vehicle in tactical, also its driver will be selected automatically. Besides driving car, driver can perform other actions normally.
- Vehicle's APs, health and fuel are displayed on the steering wheel - thanks to Buggler for idea. Vehicle APs are treated as a resource (so if car changes driver mid-turn, it won't go any further than it would).
- Added option Tactical Interface Settings > ADD_PASSENGER_TO_ANY_SQUAD. If you order passenger to exit vehicle by clicking on the seat belt, he'll be added to new squad, so if you ordered six passengers to exit one by one, you'd end up with six new squads. With ADD_PASSENGER_TO_ANY_SQUAD = TRUE, passenger will be added to any existing squad with empty slot if possible.
- Added option Tactical Interface Settings > PASSENGER_LEAVING_SWITCH_TO_NEW_SQUAD. If you order passenger to exit vehicle by clicking on the seat belt, by default you get switched to his new squad. With PASSENGER_LEAVING_SWITCH_TO_NEW_SQUAD = FALSE you'll switch only if exiting passenger is the selected one.
- Cosmetic fix: changed display above vehicle from "*Merc's name* (VEHICLE)" to "*Merc's name* (*Vehicle's name*)" and colour from yellow to white (since mercs in vehicle are controllable and yellow is reserved for mercs on assignments).
- Fixed passengers rotation. Again.
- Fixed vehicles getting "tired" - lowered APs due to fuel below max. They can move the same as long as they have any fuel.
- Fixed unrelated bug: clicking on any empty slot in team panel would select merc with id 0.
- Fixed unrelated bug: switching to squad with less mercs would cause team panel to still show skill tooltips for mercs from previous squad on empty slots.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7204 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-05-13 20:50:16 +00:00
parent 9a23f84bae
commit 1fe56555eb
17 changed files with 368 additions and 156 deletions
+28 -23
View File
@@ -1957,7 +1957,7 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
}
// If tired, reduce action points accordingly (by up to 1/2)
if (this->bBreath < 100)
if (this->bBreath < 100 && !( this->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
ubPoints -= (ubPoints * (100 - this->bBreath)) / 200;
if (this->sWeightCarriedAtTurnStart > 100)
@@ -7879,27 +7879,13 @@ void SOLDIERTYPE::TurnSoldier( void )
// If we are a vehicle... DON'T TURN!
// anv: YES PLIZ DO
if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE )
{
//if ( this->ubBodyType != TANK_NW && this->ubBodyType != TANK_NE )
//{
// return;
//}
// need to turn around passengers inside
INT32 iId = this->bVehicleID;
// Loop through passengers and update each guy's rotation
for( INT32 iCounter = 0; iCounter < gNewVehicle[ pVehicleList[ iId ].ubVehicleType ].iNewSeatingCapacities; iCounter++ )
{
if( pVehicleList[ iId ].pPassengers[ iCounter ] != NULL )
{
pVehicleList[ iId ].pPassengers[ iCounter ]->flags.fDontChargeTurningAPs = TRUE;
pVehicleList[ iId ].pPassengers[ iCounter ]->EVENT_SetSoldierDesiredDirection( this->pathing.bDesiredDirection );
//pVehicleList[ iId ].pPassengers[ iCounter ]->pathing.bDesiredDirection = this->pathing.bDesiredDirection;
}
}
}
//if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE )
//{
// if ( this->ubBodyType != TANK_NW && this->ubBodyType != TANK_NE )
// {
// return;
// }
//}
//else // Lesh: patch for "Bug: Enemy turns around in turn based mode!"
{
// in case of errors in turning tasks
@@ -8207,6 +8193,25 @@ void SOLDIERTYPE::TurnSoldier( void )
// This is needed for prone animations as well as any multi-tiled structs
if ( fDoDirectionChange )
{
if ( this->flags.uiStatusFlags & SOLDIER_VEHICLE )
{
// need to turn around passengers inside
INT32 iId = this->bVehicleID;
// check which side vehicle turned
INT16 bDirectionChange = QuickestDirection( this->ubDirection, this->pathing.bDesiredDirection );
// Loop through passengers and update each guy's rotation
for( INT32 iCounter = 0; iCounter < gNewVehicle[ pVehicleList[ iId ].ubVehicleType ].iNewSeatingCapacities; iCounter++ )
{
if( pVehicleList[ iId ].pPassengers[ iCounter ] != NULL )
{
pVehicleList[ iId ].pPassengers[ iCounter ]->flags.fDontChargeTurningAPs = TRUE;
pVehicleList[ iId ].pPassengers[ iCounter ]->EVENT_SetSoldierDesiredDirection( ( pVehicleList[ iId ].pPassengers[ iCounter ]->pathing.bDesiredDirection + bDirectionChange + NUM_WORLD_DIRECTIONS ) % NUM_WORLD_DIRECTIONS );
}
}
}
// If the soldier is not crawling or multi-tiled, he should be allowed to turn in place. Even if there is some
// obstacle he shouldn't be standing on.
if ( OKToAddMercToWorld( this, (INT8)sDirection ) )
@@ -8228,7 +8233,7 @@ void SOLDIERTYPE::TurnSoldier( void )
this->EVENT_SetSoldierDirection( sDirection );
if ( this->ubBodyType != LARVAE_MONSTER && !this->MercInWater( ) && this->bOverTerrainType != DIRT_ROAD && this->bOverTerrainType != PAVED_ROAD )
if ( this->ubBodyType != LARVAE_MONSTER && !this->MercInWater( ) && this->bOverTerrainType != DIRT_ROAD && this->bOverTerrainType != PAVED_ROAD && !( this->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) ))
{
PlaySoldierFootstepSound( this );
}