mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
- new feature: backgrounds allow more personalisation of mercenaries
- background feature replaces overheating on startup screen, moved overheating opion to ini WARNING: GameDir revision >= 1748 is required. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6353 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include "Auto Resolve.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Quests.h"
|
||||
#include "Interface.h" // added by Flugente for zBackground
|
||||
#endif
|
||||
|
||||
#include "MilitiaSquads.h"
|
||||
@@ -3208,31 +3209,53 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
{
|
||||
// see if we have any ranger here
|
||||
UINT8 ubRangerHere = 0;
|
||||
UINT8 ustravelbackground_foot = 0;
|
||||
UINT8 ustravelbackground_car = 0;
|
||||
UINT8 ustravelbackground_air = 0;
|
||||
|
||||
curr = pGroup->pPlayerList;
|
||||
while( curr )
|
||||
{
|
||||
pSoldier = curr->pSoldier;
|
||||
if( HAS_SKILL_TRAIT( pSoldier, RANGER_NT ))
|
||||
ubRangerHere += NUM_SKILL_TRAITS( pSoldier, RANGER_NT );
|
||||
|
||||
// Flugente: backgrounds
|
||||
ustravelbackground_foot = max(ustravelbackground_foot, pSoldier->GetBackgroundValue(BG_TRAVEL_FOOT));
|
||||
ustravelbackground_car = max(ustravelbackground_car, pSoldier->GetBackgroundValue(BG_TRAVEL_CAR));
|
||||
ustravelbackground_air = max(ustravelbackground_air, pSoldier->GetBackgroundValue(BG_TRAVEL_AIR));
|
||||
|
||||
curr = curr->next;
|
||||
}
|
||||
// yes, we have...
|
||||
if( ubRangerHere > 0 )
|
||||
if( ubRangerHere || ustravelbackground_foot || ustravelbackground_car || ustravelbackground_air )
|
||||
{
|
||||
// no more than certain number of simultaneous bonuses
|
||||
ubRangerHere = min( gSkillTraitValues.ubRAMaxBonusesToTravelSpeed, ubRangerHere );
|
||||
|
||||
// on foot, the bonus should be higher
|
||||
if( fFoot )
|
||||
{
|
||||
// however, we cannot be quicker than the helicopter
|
||||
iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ( ubRangerHere * gSkillTraitValues.ubRAGroupTimeSpentForTravellingFoot )) / 100));
|
||||
|
||||
iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ustravelbackground_foot) / 100));
|
||||
}
|
||||
// all other types (except air)
|
||||
else if ( fAir )
|
||||
{
|
||||
// however, we cannot be quicker than the helicopter
|
||||
iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ( ubRangerHere * gSkillTraitValues.ubRAGroupTimeSpentForTravellingVehicle )) / 100));
|
||||
|
||||
// yes, this background allows us to fly faster :-)
|
||||
iBestTraverseTime = max( 9, (iBestTraverseTime * (100 - ustravelbackground_air) / 100));
|
||||
}
|
||||
else
|
||||
{
|
||||
// however, we cannot be quicker than the helicopter
|
||||
iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ( ubRangerHere * gSkillTraitValues.ubRAGroupTimeSpentForTravellingVehicle )) / 100));
|
||||
|
||||
iBestTraverseTime = max( 10, (iBestTraverseTime * (100 - ustravelbackground_car) / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user