mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
****************************************************************************
** Merged Source Code from Development trunk, for the Spring 2011 Release ** **************************************************************************** o Development Trunk (Revision: 4444): https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP o This trunk (the official 1.13 source trunk) will only be used for fixing bugs. No new features will be added here. New Features are only included in the Development trunk o !!! After we have fixed a bug here in this trunk, we should MANUALLY merge the bugfix in the development trunk !!! git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4446 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+85
-59
@@ -3376,29 +3376,40 @@ static INT16 GetMinimumStackDurability(const OBJECTTYPE* pObj) {
|
||||
return minDur;
|
||||
}
|
||||
|
||||
//CHRISL: During the repair process, we already attempt to repair the attachments on an item. So rather then adding the attachment to the stack, we want to
|
||||
// add the main item, even if it's just the attachment that actually needs to be repaired. Also, if multiple items in a stack are damaged, we only want to
|
||||
// include the stack once since the repair system already looks through the entire stack.
|
||||
static void CollectRepairableItems(const SOLDIERTYPE* pSoldier, RepairQueue& itemsToFix) {
|
||||
bool foundItem = false;
|
||||
// Iterate over all pocket slots and add items in need of repair
|
||||
for (UINT8 pocketIndex = HELMETPOS; pocketIndex < NUM_INV_SLOTS; ++pocketIndex) {
|
||||
const OBJECTTYPE* pObj = &(const_cast<SOLDIERTYPE *>(pSoldier)->inv[pocketIndex]);
|
||||
if(pObj == NULL || pObj->ubNumberOfObjects == NOTHING || pObj->usItem == NOTHING)
|
||||
continue;
|
||||
|
||||
// Check if item needs repairing
|
||||
BOOLEAN itemAddedToQueue = FALSE;
|
||||
foundItem = false;
|
||||
for (UINT8 stackIndex = 0; stackIndex < pObj->ubNumberOfObjects; ++stackIndex) {
|
||||
// Check the stack item itself
|
||||
if (!itemAddedToQueue && IsItemRepairable(pObj->usItem, (*pObj)[stackIndex]->data.objectStatus)) {
|
||||
itemAddedToQueue = TRUE;
|
||||
if (IsItemRepairable(pObj->usItem, (*pObj)[stackIndex]->data.objectStatus)) {
|
||||
RepairItem item(pObj, pSoldier, (INVENTORY_SLOT) pocketIndex);
|
||||
itemsToFix.push(item);
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for attachments (are there stackable items that can take attachments though?)
|
||||
UINT8 attachmentIndex = 0;
|
||||
for (attachmentList::const_iterator iter = (*pObj)[stackIndex]->attachments.begin(); iter != (*pObj)[stackIndex]->attachments.end(); ++iter, ++attachmentIndex) {
|
||||
if (IsItemRepairable(iter->usItem, (*iter)[attachmentIndex]->data.objectStatus )) {
|
||||
RepairItem item(&(*iter), pSoldier, (INVENTORY_SLOT) pocketIndex);
|
||||
// Send the main item, not the attachment
|
||||
RepairItem item(pObj, pSoldier, (INVENTORY_SLOT) pocketIndex);
|
||||
itemsToFix.push(item);
|
||||
foundItem = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(foundItem)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3627,9 +3638,12 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// now check for attachments after
|
||||
for (attachmentList::iterator iter = (*pObj)[ubLoop]->attachments.begin(); iter != (*pObj)[ubLoop]->attachments.end(); ++iter) {
|
||||
if (RepairObject(pSoldier, pOwner, &(*iter), pubRepairPtsLeft) && iter->exists()) {
|
||||
for (attachmentList::iterator iter = (*pObj)[ubLoop]->attachments.begin(); iter != (*pObj)[ubLoop]->attachments.end(); ++iter)
|
||||
{
|
||||
if (iter->exists() && RepairObject(pSoldier, pOwner, &(*iter), pubRepairPtsLeft))
|
||||
{
|
||||
fSomethingWasRepaired = true;
|
||||
if ( *pubRepairPtsLeft == 0 )
|
||||
{
|
||||
@@ -3638,6 +3652,7 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//CHRISL: Now check and see if this is an LBENODE with items that need repairing
|
||||
if(UsingNewInventorySystem() == true && Item[pObj->usItem].usItemClass == IC_LBEGEAR && pObj->IsActiveLBE(ubLoop) == true)
|
||||
{
|
||||
@@ -8057,65 +8072,76 @@ void BeginRemoveMercFromContract( SOLDIERTYPE *pSoldier )
|
||||
// This function will setup the quote, then start dialogue beginning the actual leave sequence
|
||||
if( ( pSoldier->stats.bLife > 0 ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) )
|
||||
{
|
||||
if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__MERC ) || ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__NPC ) )
|
||||
// WANNE: Nothing to do here, when we want to dismiss the robot
|
||||
BOOLEAN fAmIaRobot = AM_A_ROBOT( pSoldier );
|
||||
if (!fAmIaRobot)
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_RESPONSE_TO_MIGUEL_SLASH_QUOTE_MERC_OR_RPC_LETGO );
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_CONTRACT_ENDING, 1,0 );
|
||||
|
||||
}
|
||||
else
|
||||
// quote is different if he's fired in less than 48 hours
|
||||
if( ( GetWorldTotalMin() - pSoldier->uiTimeOfLastContractUpdate ) < 60 * 48 )
|
||||
{
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC ) )
|
||||
{
|
||||
// Only do this if they want to renew.....
|
||||
if ( WillMercRenew( pSoldier, FALSE ) )
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_DEPART_COMMET_CONTRACT_NOT_RENEWED_OR_TERMINATED_UNDER_48 );
|
||||
}
|
||||
}
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_CONTRACT_ENDING, 1,0 );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC ) )
|
||||
{
|
||||
// Only do this if they want to renew.....
|
||||
if ( WillMercRenew( pSoldier, FALSE ) )
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_DEPARTING_COMMENT_CONTRACT_NOT_RENEWED_OR_48_OR_MORE );
|
||||
}
|
||||
}
|
||||
else if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__MERC ) || ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__NPC ) )
|
||||
if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__MERC ) || ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__NPC ) )
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_RESPONSE_TO_MIGUEL_SLASH_QUOTE_MERC_OR_RPC_LETGO );
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_CONTRACT_ENDING, 1,0 );
|
||||
|
||||
}
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_CONTRACT_ENDING, 1,0 );
|
||||
}
|
||||
|
||||
if( ( GetWorldTotalMin() - pSoldier->uiTimeOfLastContractUpdate ) < 60 * 3 )
|
||||
{
|
||||
// this will cause him give us lame excuses for a while until he gets over it
|
||||
// 3-6 days (but the first 1-2 days of that are spent "returning" home)
|
||||
gMercProfiles[ pSoldier->ubProfile ].ubDaysOfMoraleHangover = (UINT8) (3 + Random(4));
|
||||
|
||||
// if it's an AIM merc, word of this gets back to AIM... Bad rep.
|
||||
if( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
|
||||
else
|
||||
{
|
||||
ModifyPlayerReputation(REPUTATION_EARLY_FIRING);
|
||||
// quote is different if he's fired in less than 48 hours
|
||||
if( ( GetWorldTotalMin() - pSoldier->uiTimeOfLastContractUpdate ) < 60 * 48 )
|
||||
{
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC ) )
|
||||
{
|
||||
// Only do this if they want to renew.....
|
||||
if ( WillMercRenew( pSoldier, FALSE ) )
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_DEPART_COMMET_CONTRACT_NOT_RENEWED_OR_TERMINATED_UNDER_48 );
|
||||
}
|
||||
}
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_CONTRACT_ENDING, 1,0 );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,1 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC ) )
|
||||
{
|
||||
// Only do this if they want to renew.....
|
||||
if ( WillMercRenew( pSoldier, FALSE ) )
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_DEPARTING_COMMENT_CONTRACT_NOT_RENEWED_OR_48_OR_MORE );
|
||||
}
|
||||
}
|
||||
else if( ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__MERC ) || ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__NPC ) )
|
||||
{
|
||||
HandleImportantMercQuote( pSoldier, QUOTE_RESPONSE_TO_MIGUEL_SLASH_QUOTE_MERC_OR_RPC_LETGO );
|
||||
}
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_LOCK_INTERFACE,0 ,MAP_SCREEN ,0 ,0 ,0 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_CONTRACT_ENDING, 1,0 );
|
||||
}
|
||||
}
|
||||
|
||||
if( ( GetWorldTotalMin() - pSoldier->uiTimeOfLastContractUpdate ) < 60 * 3 )
|
||||
{
|
||||
// this will cause him give us lame excuses for a while until he gets over it
|
||||
// 3-6 days (but the first 1-2 days of that are spent "returning" home)
|
||||
gMercProfiles[ pSoldier->ubProfile ].ubDaysOfMoraleHangover = (UINT8) (3 + Random(4));
|
||||
|
||||
// if it's an AIM merc, word of this gets back to AIM... Bad rep.
|
||||
if( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
|
||||
{
|
||||
ModifyPlayerReputation(REPUTATION_EARLY_FIRING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WANNE: When we want to dismiss the robot, simply dismiss, without any special stuff
|
||||
else
|
||||
{
|
||||
StrategicRemoveMerc(pSoldier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11047,7 +11073,7 @@ void SetSoldierAssignment( SOLDIERTYPE *pSoldier, INT8 bAssignment, INT32 iParam
|
||||
|
||||
if( pMilitiaTrainerSoldier == NULL )
|
||||
{
|
||||
if( SectorInfo[ SECTOR( pSoldier->sSectorX, pSoldier->sSectorY ) ].fMilitiaTrainingPaid == FALSE )
|
||||
if( SectorInfo[ SECTOR( pSoldier->sSectorX, pSoldier->sSectorY ) ].fMobileMilitiaTrainingPaid == FALSE )
|
||||
{
|
||||
// show a message to confirm player wants to charge cost
|
||||
HandleInterfaceMessageForCostOfTrainingMilitia( pSoldier );
|
||||
|
||||
@@ -2100,7 +2100,7 @@ void RenderAutoResolve()
|
||||
|
||||
//Render the total battle time elapsed.
|
||||
SetFont( FONT10ARIAL );
|
||||
swprintf( str, L"%s: %dm %02ds",
|
||||
swprintf( str, L"%s: %dm %02ds",
|
||||
gpStrategicString[ STR_AR_TIME_ELAPSED ],
|
||||
gpAR->uiTotalElapsedBattleTimeInMilliseconds/60000,
|
||||
(gpAR->uiTotalElapsedBattleTimeInMilliseconds%60000)/1000 );
|
||||
|
||||
@@ -1043,8 +1043,11 @@ void CreateMouseRegionForPauseOfClock( INT16 sX, INT16 sY )
|
||||
{
|
||||
if( fClockMouseRegionCreated == FALSE )
|
||||
{
|
||||
INT16 sXVal = sX;
|
||||
INT16 sYVal = sY;
|
||||
|
||||
// create a mouse region for pausing of game clock
|
||||
MSYS_DefineRegion( &gClockMouseRegion, (UINT16)( sX ), (UINT16)( sY ),(UINT16)( sX + CLOCK_REGION_WIDTH ), (UINT16)( sY + CLOCK_REGION_HEIGHT ), MSYS_PRIORITY_HIGHEST,
|
||||
MSYS_DefineRegion( &gClockMouseRegion, (UINT16)( sXVal ), (UINT16)( sYVal ),(UINT16)( sX + CLOCK_REGION_WIDTH ), (UINT16)( sY + CLOCK_REGION_HEIGHT), MSYS_PRIORITY_HIGHEST,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, PauseOfClockBtnCallback );
|
||||
|
||||
fClockMouseRegionCreated = TRUE;
|
||||
|
||||
@@ -206,13 +206,14 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
||||
DailyUpdateOfMercSite( (UINT16)GetWorldDay() );
|
||||
break;
|
||||
case EVENT_DAY3_ADD_EMAIL_FROM_SPECK:
|
||||
if ( gGameExternalOptions.fMercDayOne == FALSE && gGameExternalOptions.fAllMercsAvailable == FALSE )
|
||||
// WANNE: This fixes the bug, that Speck did not sent the email on Day 3, when MERC_WEBSITE_ALL_MERCS_AVAILABLE = TRUE!
|
||||
if ( gGameExternalOptions.fMercDayOne == FALSE /* && gGameExternalOptions.fAllMercsAvailable == FALSE */ )
|
||||
{
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1 );
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 );
|
||||
}
|
||||
break;
|
||||
case EVENT_DAY2_ADD_EMAIL_FROM_IMP:
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), -1 );
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), -1, -1);
|
||||
break;
|
||||
//If a merc gets hired and they dont show up immediately, the merc gets added to the queue and shows up
|
||||
// uiTimeTillMercArrives minutes later
|
||||
|
||||
+109
-22
@@ -1399,7 +1399,7 @@ BOOLEAN BOOL;
|
||||
|
||||
static int l_StopVideo(lua_State *L)
|
||||
{
|
||||
|
||||
StopIntroVideo();
|
||||
Test = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -5663,13 +5663,16 @@ int i;
|
||||
UINT16 SextorX;
|
||||
UINT16 SextorY;
|
||||
|
||||
UINT8 SkyDrive;
|
||||
|
||||
for (i= 1; i<=n; i++ )
|
||||
{
|
||||
if (i == 1 ) SextorX = lua_tointeger(L,i);
|
||||
if (i == 2 ) SextorY = lua_tointeger(L,i);
|
||||
if (i == 3 ) SkyDrive = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
SetUpHelicopterForPlayer( SextorX, SextorY );
|
||||
SetUpHelicopterForPlayer( SextorX, SextorY, SkyDrive );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -7209,28 +7212,27 @@ return 0;
|
||||
//AddEmail
|
||||
static int l_AddEmail (lua_State *L)
|
||||
{
|
||||
UINT8 n = lua_gettop(L);
|
||||
int i;
|
||||
UINT8 n = lua_gettop(L);
|
||||
int i;
|
||||
|
||||
|
||||
INT32 iMessageOffset;
|
||||
INT32 iMessageLength;
|
||||
UINT8 ubSender;
|
||||
|
||||
INT32 iCurrentIMPPosition;
|
||||
INT32 iMessageOffset;
|
||||
INT32 iMessageLength;
|
||||
UINT8 ubSender;
|
||||
INT32 iCurrentIMPPosition;
|
||||
INT16 iCurrentShipmentDestinationID = -1;
|
||||
|
||||
for (i= 1; i<=n; i++ )
|
||||
{
|
||||
if (i == 1 ) iMessageOffset = lua_tointeger(L,i);
|
||||
if (i == 2 ) iMessageLength = lua_tointeger(L,i);
|
||||
if (i == 3 ) ubSender = lua_tointeger(L,i);
|
||||
//if (i == 4 ) iDate = lua_tointeger(L,i);
|
||||
if (i == 4 ) iCurrentIMPPosition = lua_tointeger(L,i);
|
||||
if (i == 5) iCurrentShipmentDestinationID = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
AddEmail(iMessageOffset,iMessageLength,ubSender, GetWorldTotalMin(), iCurrentIMPPosition);
|
||||
AddEmail(iMessageOffset,iMessageLength,ubSender, GetWorldTotalMin(), iCurrentIMPPosition, iCurrentShipmentDestinationID);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//AddPreReadEmail
|
||||
@@ -9750,10 +9752,49 @@ static int l_ubMiscFlags2Check (lua_State *L)
|
||||
if (i == 2 ) set = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
Flag = (gMercProfiles[Profile].ubMiscFlags2 & set);
|
||||
if (set == 1)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_DONT_ADD_TO_SECTOR)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 2)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_LEFT_COUNTRY)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 4)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_BANDAGED_TODAY)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 8)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 16)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_NEEDS_TO_SAY_HOSTILE_QUOTE)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 32)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_MARRIED_TO_HICKS)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 64 )
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG2_ASKED_BY_HICKS)
|
||||
Flag = 1;
|
||||
}
|
||||
|
||||
// Set the return value of the function
|
||||
// --> Flag == 0 -> The specified Flag is not set
|
||||
// --> Flag == 1 -> The specified Flag is set
|
||||
lua_pushinteger(L, Flag);
|
||||
|
||||
// Always return 1, this tells LUA that the the function run without a problem.
|
||||
// But THIS is not the return value of the function. The return value is specified in the "lua_pushinteger()" call above!!!
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -9773,7 +9814,48 @@ static int l_ubMiscFlags1Check (lua_State *L)
|
||||
if (i == 2 ) set = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
Flag = (gMercProfiles[Profile].ubMiscFlags & set);
|
||||
if (set == 1)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_RECRUITED)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 2)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_HAVESEENCREATURE)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 4)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_FORCENPCQUOTE)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 8)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_WOUNDEDBYPLAYER)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 16)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_TEMP_NPC_QUOTE_DATA_EXISTS)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 32)
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_SAID_HOSTILE_QUOTE)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 64 )
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_EPCACTIVE)
|
||||
Flag = 1;
|
||||
}
|
||||
else if (set == 128 )
|
||||
{
|
||||
if (gMercProfiles[Profile].ubMiscFlags2 & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS)
|
||||
Flag = 1;
|
||||
}
|
||||
|
||||
//Flag = (gMercProfiles[Profile].ubMiscFlags & set);
|
||||
|
||||
|
||||
lua_pushinteger(L, Flag);
|
||||
@@ -9856,34 +9938,39 @@ static int l_ubMiscFlags2Set(lua_State *L)
|
||||
if (i == 2 ) set = lua_tointeger(L,i);
|
||||
}
|
||||
|
||||
if (set == 0)
|
||||
if (set == 0)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 = 0;
|
||||
}
|
||||
else if (set == 1)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_DONT_ADD_TO_SECTOR);
|
||||
}
|
||||
else if (set == 1)
|
||||
else if (set == 2)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_LEFT_COUNTRY);
|
||||
}
|
||||
else if (set == 2)
|
||||
else if (set == 4)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_BANDAGED_TODAY);
|
||||
}
|
||||
else if (set == 3)
|
||||
else if (set == 8)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE);
|
||||
}
|
||||
else if (set == 4)
|
||||
else if (set == 16)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_NEEDS_TO_SAY_HOSTILE_QUOTE);
|
||||
}
|
||||
else if (set == 5)
|
||||
else if (set == 32)
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_MARRIED_TO_HICKS);
|
||||
}
|
||||
else if (set == 6 )
|
||||
else if (set == 64 )
|
||||
{
|
||||
gMercProfiles[Profile].ubMiscFlags2 &= (~PROFILE_MISC_FLAG2_ASKED_BY_HICKS);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -949,7 +949,7 @@ void UpdateRefuelSiteAvailability( void )
|
||||
}
|
||||
|
||||
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY )
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive )
|
||||
{
|
||||
if( fSkyRiderSetUp == FALSE )
|
||||
{
|
||||
@@ -961,7 +961,7 @@ void SetUpHelicopterForPlayer( INT16 sX, INT16 sY )
|
||||
Assert( iHelicopterVehicleId != -1 );
|
||||
|
||||
SoldierSkyRider.initialize();
|
||||
SoldierSkyRider.ubProfile = SKYRIDER;
|
||||
SoldierSkyRider.ubProfile = SkyDrive; //SKYRIDER;
|
||||
SoldierSkyRider.stats.bLife = 80;
|
||||
|
||||
pSkyRider = &( SoldierSkyRider );
|
||||
@@ -972,7 +972,7 @@ void SetUpHelicopterForPlayer( INT16 sX, INT16 sY )
|
||||
|
||||
fSkyRiderSetUp = TRUE;
|
||||
|
||||
gMercProfiles[ SKYRIDER ].fUseProfileInsertionInfo = FALSE;
|
||||
gMercProfiles[ SkyDrive ].fUseProfileInsertionInfo = FALSE; //SKYRIDER
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -191,7 +191,7 @@ BOOLEAN IsRefuelSiteInSector( INT16 sMapX, INT16 sMapY );
|
||||
void UpdateRefuelSiteAvailability( void );
|
||||
|
||||
// setup helicopter for player
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY );
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive );
|
||||
|
||||
// the intended path of the helicopter
|
||||
INT32 DistanceOfIntendedHelicopterPath( void );
|
||||
|
||||
@@ -1039,6 +1039,10 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
sObjectSourceGridNo = gMapInformation.sCenterGridNo;
|
||||
}
|
||||
|
||||
//CHRISL: Make sure we put the item at the same level as the merc
|
||||
if(gpItemPointerSoldier->exists() == true)
|
||||
pInventoryPoolList[(iCurrentInventoryPoolPage*MAP_INVENTORY_POOL_SLOT_COUNT)+iCounter].ubLevel = gpItemPointerSoldier->pathing.bLevel;
|
||||
|
||||
// set as reachable and set gridno
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_REACHABLE;
|
||||
|
||||
|
||||
@@ -4723,7 +4723,7 @@ void DisplayPositionOfHelicopter( void )
|
||||
RemoveVehicleFromList (iHelicopterVehicleId);
|
||||
InitAVehicle (iHelicopterVehicleId, 13, MAP_ROW_B);
|
||||
fSkyRiderSetUp = FALSE;
|
||||
SetUpHelicopterForPlayer( 13, MAP_ROW_B );
|
||||
SetUpHelicopterForPlayer( 13, MAP_ROW_B , SKYRIDER );
|
||||
pGroup = GetGroup( pVehicleList[ iHelicopterVehicleId ].ubMovementGroup );
|
||||
if (!pGroup) {
|
||||
static bool heliMsg2Given = false;
|
||||
|
||||
@@ -631,7 +631,7 @@ void AddCommonInfoToBox(void)
|
||||
if (ubMilitiaTotal > 0)
|
||||
{
|
||||
// some militia, show total & their breakdown by level
|
||||
swprintf( wString, L"%d (%d/%d/%d)", ubMilitiaTotal,
|
||||
swprintf( wString, L"%d (%d/%d/%d)", ubMilitiaTotal,
|
||||
MilitiaInSectorOfRank(bCurrentTownMineSectorX, bCurrentTownMineSectorY, GREEN_MILITIA),
|
||||
MilitiaInSectorOfRank(bCurrentTownMineSectorX, bCurrentTownMineSectorY, REGULAR_MILITIA),
|
||||
MilitiaInSectorOfRank(bCurrentTownMineSectorX, bCurrentTownMineSectorY, ELITE_MILITIA));
|
||||
|
||||
@@ -61,6 +61,9 @@
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
// marke strogg more mercs
|
||||
extern UINT8 FIRSTmercTOdisplay = 0 ;
|
||||
extern UINT8 maxNumberOfMercVisibleInStrategyList = 0; // WANNE: Max merc displayed in the list depends on the resolution
|
||||
|
||||
// inventory pool position on screen
|
||||
#define MAP_INVEN_POOL_X 300
|
||||
@@ -1065,17 +1068,17 @@ INT16 CharacterIsGettingPathPlotted( INT16 sCharNumber )
|
||||
}
|
||||
|
||||
// is the character a valid one?
|
||||
if( gCharactersList[ sCharNumber ].fValid == FALSE )
|
||||
if( gCharactersList[ sCharNumber + FIRSTmercTOdisplay ].fValid == FALSE )
|
||||
{
|
||||
return ( FALSE );
|
||||
}
|
||||
|
||||
// if the highlighted line character is also selected
|
||||
if ( ( ( giDestHighLine != -1 ) && IsEntryInSelectedListSet ( ( INT8 ) giDestHighLine ) ) ||
|
||||
if ( ( ( giDestHighLine != -1 ) && IsEntryInSelectedListSet ( ( INT8 ) giDestHighLine + FIRSTmercTOdisplay ) ) ||
|
||||
( ( bSelectedDestChar != -1 ) && IsEntryInSelectedListSet ( bSelectedDestChar ) ) )
|
||||
{
|
||||
// then ALL selected lines will be affected
|
||||
if( IsEntryInSelectedListSet( ( INT8 ) sCharNumber ) )
|
||||
if( IsEntryInSelectedListSet( ( INT8 ) sCharNumber + FIRSTmercTOdisplay ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -1083,7 +1086,7 @@ INT16 CharacterIsGettingPathPlotted( INT16 sCharNumber )
|
||||
else
|
||||
{
|
||||
// if he is *the* selected dude
|
||||
if( bSelectedDestChar == sCharNumber )
|
||||
if( bSelectedDestChar == sCharNumber + FIRSTmercTOdisplay )
|
||||
{
|
||||
return ( TRUE );
|
||||
}
|
||||
@@ -1107,16 +1110,18 @@ BOOLEAN IsCharacterSelectedForAssignment( INT16 sCharNumber )
|
||||
}
|
||||
|
||||
// is the character a valid one?
|
||||
if( gCharactersList[ sCharNumber ].fValid == FALSE )
|
||||
if( gCharactersList[ sCharNumber + FIRSTmercTOdisplay ].fValid == FALSE )
|
||||
{
|
||||
return ( FALSE );
|
||||
}
|
||||
|
||||
// if the highlighted line character is also selected
|
||||
if ( ( giAssignHighLine != -1 ) && IsEntryInSelectedListSet ( ( INT8 ) giAssignHighLine ) )
|
||||
// marke strogg more mercs
|
||||
if ( ( giAssignHighLine != -1 ) && IsEntryInSelectedListSet ( ( INT8 ) giAssignHighLine + FIRSTmercTOdisplay ) )
|
||||
{
|
||||
// then ALL selected lines will be affected
|
||||
if( IsEntryInSelectedListSet( ( INT8 ) sCharNumber ) )
|
||||
// marke strogg more mercs
|
||||
if( IsEntryInSelectedListSet( ( INT8 ) sCharNumber + FIRSTmercTOdisplay ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -1142,18 +1147,19 @@ BOOLEAN IsCharacterSelectedForSleep( INT16 sCharNumber )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
// marke strogg more mercs
|
||||
// is the character a valid one?
|
||||
if( gCharactersList[ sCharNumber ].fValid == FALSE )
|
||||
if( gCharactersList[ sCharNumber + FIRSTmercTOdisplay ].fValid == FALSE )
|
||||
{
|
||||
return ( FALSE );
|
||||
}
|
||||
|
||||
// if the highlighted line character is also selected
|
||||
if ( ( giSleepHighLine != -1 ) && IsEntryInSelectedListSet ( ( INT8 ) giSleepHighLine ) )
|
||||
if ( ( giSleepHighLine != -1 ) && IsEntryInSelectedListSet ( ( INT8 ) giSleepHighLine + FIRSTmercTOdisplay ) )
|
||||
{
|
||||
// then ALL selected lines will be affected
|
||||
if( IsEntryInSelectedListSet( ( INT8 ) sCharNumber ) )
|
||||
if( IsEntryInSelectedListSet( ( INT8 ) sCharNumber + FIRSTmercTOdisplay ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -1404,7 +1410,6 @@ void HandleDisplayOfSelectedMercArrows( void )
|
||||
INT16 sYPosition = 0;
|
||||
HVOBJECT hHandle;
|
||||
UINT8 ubCount = 0;
|
||||
INT16 usVehicleCount = 0;
|
||||
|
||||
// blit an arrow by the name of each merc in a selected list
|
||||
if( bSelectedInfoChar == -1 )
|
||||
@@ -1422,37 +1427,32 @@ void HandleDisplayOfSelectedMercArrows( void )
|
||||
{
|
||||
return;
|
||||
}
|
||||
// now blit one by the selected merc
|
||||
sYPosition = Y_START+( bSelectedInfoChar * ( Y_SIZE + 2 ) ) - 1;
|
||||
|
||||
|
||||
if( bSelectedInfoChar >= FIRST_VEHICLE )
|
||||
// marke strogg more merc
|
||||
if ( bSelectedInfoChar - FIRSTmercTOdisplay >= maxNumberOfMercVisibleInStrategyList )
|
||||
{
|
||||
usVehicleCount = bSelectedInfoChar - FIRST_VEHICLE;
|
||||
sYPosition = usVehicleY+( usVehicleCount * ( Y_SIZE + 2) ) - 1;;
|
||||
FIRSTmercTOdisplay = bSelectedInfoChar - (maxNumberOfMercVisibleInStrategyList - 1) ;
|
||||
}
|
||||
|
||||
// now blit one by the selected merc
|
||||
// marke strogg more mercs
|
||||
sYPosition = Y_START+( ( bSelectedInfoChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) ) - 1;
|
||||
|
||||
GetVideoObject( &hHandle, guiSelectedCharArrow );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,SELECTED_CHAR_ARROW_X, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
|
||||
// now run through the selected list of guys, an arrow for each
|
||||
for( ubCount = 0; ubCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; ubCount++ )
|
||||
{
|
||||
if( gCharactersList[ ubCount ].fValid == TRUE )
|
||||
|
||||
// marke strogg more mercs
|
||||
for( ubCount = 0; ubCount < maxNumberOfMercVisibleInStrategyList; ubCount++ )
|
||||
{
|
||||
// marke strogg more mercs
|
||||
if( gCharactersList[ ubCount + FIRSTmercTOdisplay ].fValid == TRUE )
|
||||
{
|
||||
|
||||
// are they in the selected list or int he same mvt group as this guy
|
||||
if( ( IsEntryInSelectedListSet( ubCount ) == TRUE ) || ( ( bSelectedDestChar != - 1 ) ? ( ( Menptr[ gCharactersList[ ubCount ].usSolID ].ubGroupID != 0 ) ? ( Menptr[ gCharactersList[ bSelectedDestChar ].usSolID ].ubGroupID == Menptr[ gCharactersList[ ubCount ].usSolID ].ubGroupID ) : FALSE ) : FALSE ) )
|
||||
if( ( IsEntryInSelectedListSet( ubCount + FIRSTmercTOdisplay ) == TRUE ) || ( ( bSelectedDestChar != - 1 ) ? ( ( Menptr[ gCharactersList[ ubCount + FIRSTmercTOdisplay ].usSolID ].ubGroupID != 0 ) ? ( Menptr[ gCharactersList[ bSelectedDestChar ].usSolID ].ubGroupID == Menptr[ gCharactersList[ ubCount + FIRSTmercTOdisplay ].usSolID ].ubGroupID ) : FALSE ) : FALSE ) )
|
||||
{
|
||||
sYPosition = Y_START+( ubCount * ( Y_SIZE + 2) ) - 1;
|
||||
|
||||
if( ubCount >= FIRST_VEHICLE )
|
||||
{
|
||||
usVehicleCount = ubCount - FIRST_VEHICLE;
|
||||
sYPosition = usVehicleY+( usVehicleCount * ( Y_SIZE + 2) ) - 1;;
|
||||
}
|
||||
|
||||
GetVideoObject( &hHandle, guiSelectedCharArrow );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,SELECTED_CHAR_ARROW_X, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
}
|
||||
@@ -2272,18 +2272,11 @@ void UpdateMapScreenAssignmentPositions( void )
|
||||
// do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
giBoxY = ( Y_START + ( bSelectedAssignChar ) * ( Y_SIZE + 2 ) );
|
||||
|
||||
/* ARM: Removed this - refreshes fine without it, apparently
|
||||
// make sure the menus don't overlap the map screen bottom panel (but where did 102 come from?)
|
||||
if( giBoxY >= ( MAP_BOTTOM_Y - 102 ) )
|
||||
giBoxY = MAP_BOTTOM_Y - 102;
|
||||
*/
|
||||
{
|
||||
// marke strogg more mercs
|
||||
giBoxY = ( Y_START + ( bSelectedAssignChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
AssignmentPosition.iY = giBoxY;
|
||||
|
||||
AttributePosition.iY = TrainPosition.iY = AssignmentPosition.iY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 )* ASSIGN_MENU_TRAIN;
|
||||
@@ -2650,6 +2643,57 @@ void GoToNextCharacterInList( void )
|
||||
}
|
||||
}
|
||||
|
||||
// WANNE: Jump to first character in list when pressing PageUp
|
||||
void GoToFirstCharacterInList( void )
|
||||
{
|
||||
INT32 iCounter = 0, iCount = 0;
|
||||
|
||||
if( fShowDescriptionFlag == TRUE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( bSelectedDestChar != -1 ) || ( fPlotForHelicopter == TRUE ) )
|
||||
{
|
||||
AbortMovementPlottingMode( );
|
||||
}
|
||||
|
||||
// now run through the list and find first prev guy
|
||||
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if ( ( gCharactersList[ iCounter ].fValid ) && ( iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCounter ) )
|
||||
{
|
||||
ChangeSelectedInfoChar( ( INT8 )iCounter, TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WANNE: Jump to last character in list when pressing PageDown
|
||||
void GoToLastCharacterInList( void )
|
||||
{
|
||||
INT32 iCounter = 0, iCount = 0;
|
||||
|
||||
if( fShowDescriptionFlag == TRUE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( bSelectedDestChar != -1 ) || ( fPlotForHelicopter == TRUE ) )
|
||||
{
|
||||
AbortMovementPlottingMode( );
|
||||
}
|
||||
|
||||
// now run through the list and find first prev guy
|
||||
for( iCounter = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1; iCounter > 0; iCounter-- )
|
||||
{
|
||||
if ( ( gCharactersList[ iCounter ].fValid ) && ( iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCounter ) )
|
||||
{
|
||||
ChangeSelectedInfoChar( ( INT8 )iCounter, TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GoToPrevCharacterInList( void )
|
||||
{
|
||||
@@ -2690,7 +2734,6 @@ void GoToPrevCharacterInList( void )
|
||||
|
||||
if( iCount < 0 )
|
||||
{
|
||||
// was FIRST_VEHICLE
|
||||
iCount = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
|
||||
}
|
||||
}
|
||||
@@ -5764,7 +5807,7 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
|
||||
SetUpShutDownMapScreenHelpTextScreenMask( );
|
||||
|
||||
// Add e-mail message
|
||||
AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
|
||||
|
||||
return( TRUE );
|
||||
@@ -6413,6 +6456,12 @@ BOOLEAN CanSoldierMoveWithVehicleId( SOLDIERTYPE *pSoldier, INT32 iVehicle1Id )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// CHRISL: Certain vehicles now have different valid sectors so we don't want to allow try to path for two different vehicles
|
||||
if ( iVehicle1Id != iVehicle2Id )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
pVehicle1 = &( pVehicleList[ iVehicle1Id ] );
|
||||
pVehicle2 = &( pVehicleList[ iVehicle2Id ] );
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@ typedef struct FASTHELPREGION {
|
||||
} FASTHELPREGION;
|
||||
|
||||
|
||||
extern UINT8 FIRSTmercTOdisplay ;
|
||||
extern UINT8 maxNumberOfMercVisibleInStrategyList;
|
||||
|
||||
// String Lengths Defines
|
||||
#define MAX_NAME_LENGTH 10
|
||||
#define MAX_LOCATION_SIZE 8
|
||||
@@ -232,11 +235,6 @@ enum{
|
||||
#define TACT_UPDATE_MERC_Y_OFFSET 4
|
||||
#define TACT_UPDATE_MERC_X_OFFSET 4
|
||||
|
||||
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
// the first vehicle slot in the list
|
||||
#define FIRST_VEHICLE CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS
|
||||
|
||||
class OLD_MERC_LEAVE_ITEM_101
|
||||
{
|
||||
public:
|
||||
@@ -510,6 +508,10 @@ INT32 GetNumberOfPeopleInCharacterList( void );
|
||||
void GoToPrevCharacterInList( void );
|
||||
void GoToNextCharacterInList( void );
|
||||
|
||||
// WANNE: Go to first/last character in list (PageUp/PageDown)
|
||||
void GoToFirstCharacterInList( void );
|
||||
void GoToLastCharacterInList( void );
|
||||
|
||||
// this does the whole miner giving player info speil
|
||||
//void HandleMinerEvent( UINT8 bMinerNumber, INT16 sSectorX, INT16 sSectorY, INT16 sQuoteNumber, BOOLEAN fForceMapscreen );
|
||||
void HandleMinerEvent( UINT8 ubHeadMinerIndex, INT16 sSectorX, INT16 sSectorY, INT16 sQuoteNumber, BOOLEAN fForceMapscreen );
|
||||
|
||||
@@ -222,7 +222,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
//If the player has been to Bobbyr when it was down, and we havent already sent email, send him an email
|
||||
if( LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction == BOBBYR_BEEN_TO_SITE_ONCE && LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction != BOBBYR_ALREADY_SENT_EMAIL )
|
||||
{
|
||||
AddEmail( BOBBYR_NOW_OPEN, BOBBYR_NOW_OPEN_LENGTH, BOBBY_R, GetWorldTotalMin(), -1);
|
||||
AddEmail( BOBBYR_NOW_OPEN, BOBBYR_NOW_OPEN_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, -1);
|
||||
LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction = BOBBYR_ALREADY_SENT_EMAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ void ValidateAndCorrectInBattleCounters( GROUP *pLocGroup )
|
||||
if( ubInvalidGroups || pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle || pSector->ubCreaturesInBattle )
|
||||
{
|
||||
CHAR16 str[ 512 ];
|
||||
swprintf( str, L"Strategic info warning: Sector 'in battle' counters are not clear when they should be. "
|
||||
swprintf( str, L"Strategic info warning: Sector 'in battle' counters are not clear when they should be. "
|
||||
L"If you can provide information on how a previous battle was resolved here or nearby patrol "
|
||||
L"(auto resolve, tactical battle, cheat keys, or retreat),"
|
||||
L"please forward that info (no data files necessary) as well as the following code (very important): "
|
||||
@@ -276,6 +276,17 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
if( gfPreBattleInterfaceActive )
|
||||
return;
|
||||
|
||||
//CHRISL: If for some reason we're not looking at a valid sector, leave the preBattleInterface.
|
||||
if( pBattleGroup != NULL && (pBattleGroup->ubSectorX < MINIMUM_VALID_X_COORDINATE ||
|
||||
pBattleGroup->ubSectorX > MAXIMUM_VALID_X_COORDINATE ||
|
||||
pBattleGroup->ubSectorY < MINIMUM_VALID_Y_COORDINATE ||
|
||||
pBattleGroup->ubSectorY > MAXIMUM_VALID_Y_COORDINATE ||
|
||||
pBattleGroup->ubSectorZ < MINIMUM_VALID_Z_COORDINATE ||
|
||||
pBattleGroup->ubSectorZ > MAXIMUM_VALID_Z_COORDINATE) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gfPersistantPBI = fPersistantPBI;
|
||||
|
||||
if( gfPersistantPBI )
|
||||
|
||||
+15
-16
@@ -246,6 +246,7 @@ UINT8 NumEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||
AssertGE( sSectorY, MINIMUM_VALID_Y_COORDINATE);
|
||||
@@ -257,9 +258,9 @@ UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||
|
||||
// don't count roadblocks as stationary garrison, we want to see how many enemies are in them, not question marks
|
||||
// don't count roadblocks as stationary garrison, we want to see how many enemies are in them, not question marks
|
||||
if ( gGarrisonGroup[ pSector->ubGarrisonID ].ubComposition == ROADBLOCK )
|
||||
{
|
||||
// pretend they're not stationary
|
||||
@@ -1917,11 +1918,10 @@ void EndCaptureSequence( )
|
||||
void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT32 i;
|
||||
BOOLEAN fMadeCorpse;
|
||||
INT32 iNumEnemiesInSector;
|
||||
BOOLEAN fMadeCorpse;
|
||||
INT32 iNumEnemiesInSector;
|
||||
|
||||
|
||||
// TODO.WANNE: Hardcoded grid number
|
||||
// TODO.WANNE: Hardcoded grid number
|
||||
static INT32 sAlmaCaptureGridNos[] = { 9208, 9688, 9215 }; //dnl!!!
|
||||
static INT32 sAlmaCaptureItemsGridNo[] = { 12246, 12406, 13046 }; //dnl!!!
|
||||
|
||||
@@ -1929,19 +1929,18 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
|
||||
|
||||
AssertNotNIL(pSoldier);
|
||||
|
||||
|
||||
// ATE: Check first if ! in player captured sequence already
|
||||
// ATE: Check first if ! in player captured sequence already
|
||||
// CJC Dec 1 2002: fixing multiple captures
|
||||
if ( ( gStrategicStatus.uiFlags & STRATEGIC_PLAYER_CAPTURED_FOR_RESCUE ) && (gStrategicStatus.uiFlags & STRATEGIC_PLAYER_CAPTURED_FOR_ESCAPE) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// ATE: If maximum prisoners captured, return!
|
||||
if ( gStrategicStatus.ubNumCapturedForRescue > 3 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
// ATE: If maximum prisoners captured, return!
|
||||
if ( gStrategicStatus.ubNumCapturedForRescue > 3 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If this is an EPC , just kill them...
|
||||
|
||||
@@ -783,7 +783,7 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
break;
|
||||
/*
|
||||
case FACT_SKYRIDER_CLOSE_TO_CHOPPER:
|
||||
SetUpHelicopterForPlayer( 13, MAP_ROW_B );
|
||||
SetUpHelicopterForPlayer( 13, MAP_ROW_B , SKYRIDER );
|
||||
break;
|
||||
*/
|
||||
case FACT_SPIKE_AT_DOOR:
|
||||
@@ -1121,6 +1121,10 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
gubFact[usFact] = ItemTypeExistsAtLocation( 10472, ROCKET_RIFLE, 0, NULL );
|
||||
break;
|
||||
|
||||
case FACT_PABLO_ALIVE:
|
||||
gubFact[usFact] = gMercProfiles[ PABLO ].bMercStatus != MERC_IS_DEAD;
|
||||
break;
|
||||
|
||||
case FACT_DOREEN_ALIVE:
|
||||
gubFact[usFact] = gMercProfiles[ DOREEN ].bMercStatus != MERC_IS_DEAD;
|
||||
break;
|
||||
|
||||
@@ -985,8 +985,8 @@ void ValidatePlayersAreInOneGroupOnly()
|
||||
pGroup = GetGroup( pSoldier->ubGroupID );
|
||||
Assert( pGroup );
|
||||
Assert( pOtherGroup );
|
||||
swprintf( str, L"%s in %c%d thinks he/she is in group %d in %c%d but isn't. "
|
||||
L"Group %d in %c%d thinks %s is in the group but isn't. %s will be assigned to a unique squad. "
|
||||
swprintf( str, L"%s in %c%d thinks he/she is in group %d in %c%d but isn't. "
|
||||
L"Group %d in %c%d thinks %s is in the group but isn't. %s will be assigned to a unique squad. "
|
||||
L"Please send screenshot, PRIOR save (corrected by time you read this), and any theories.",
|
||||
pSoldier->name, pSoldier->sSectorY + 'A' - 1, pSoldier->sSectorX,
|
||||
pSoldier->ubGroupID, pGroup->ubSectorY + 'A' - 1, pGroup->ubSectorX,
|
||||
@@ -1029,9 +1029,9 @@ void ValidatePlayersAreInOneGroupOnly()
|
||||
Assert( pGroup );
|
||||
Assert( pOtherGroup );
|
||||
|
||||
swprintf( str, L"%s in %c%d has been found in multiple groups. The group he/she is supposed "
|
||||
L"to be in is group %d in %c%d, but %s was also found to be in group %d in %c%d. %s was found in %d groups "
|
||||
L"total. Please send screenshot, PRIOR save (corrected by time you read this), and any theories.",
|
||||
swprintf( str, L"%s in %c%d has been found in multiple groups. The group he/she is supposed "
|
||||
L"to be in is group %d in %c%d, but %s was also found to be in group %d in %c%d. %s was found in %d groups "
|
||||
L"total. Please send screenshot, PRIOR save (corrected by time you read this), and any theories.",
|
||||
pSoldier->name, pSoldier->sSectorY + 'A' - 1, pSoldier->sSectorX,
|
||||
pGroup->ubGroupID, pGroup->ubSectorY + 'A' - 1, pGroup->ubSectorX,
|
||||
pSoldier->name, pOtherGroup->ubGroupID, pOtherGroup->ubSectorY + 'A' - 1, pOtherGroup->ubSectorX,
|
||||
@@ -1040,8 +1040,8 @@ void ValidatePlayersAreInOneGroupOnly()
|
||||
else if( !iGroups )
|
||||
{ //The merc cannot be found in any group! This should never happen! We will assign the merc into his
|
||||
//own unique squad as a correction.
|
||||
swprintf( str, L"%s in %c%d cannot be found in any group. %s will be assigned to a unique group/squad. "
|
||||
L"Please provide details on how you think this may have happened. Send screenshot and PRIOR save. Do not send a save "
|
||||
swprintf( str, L"%s in %c%d cannot be found in any group. %s will be assigned to a unique group/squad. "
|
||||
L"Please provide details on how you think this may have happened. Send screenshot and PRIOR save. Do not send a save "
|
||||
L"you create after this point as the info will have been corrected by then.",
|
||||
pSoldier->name, pSoldier->sSectorY + 'A' - 1, pSoldier->sSectorX, pSoldier->name );
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ void HandleNPCSystemEvent( UINT32 uiEvent )
|
||||
{
|
||||
// KP knows money is gone, hasn't told player, if this event is called then the 2
|
||||
// days are up... send email
|
||||
AddEmail( KING_PIN_LETTER, KING_PIN_LETTER_LENGTH, KING_PIN, GetWorldTotalMin(), -1 );
|
||||
AddEmail( KING_PIN_LETTER, KING_PIN_LETTER_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1 );
|
||||
StartQuest( QUEST_KINGPIN_MONEY, 5, MAP_ROW_D );
|
||||
// add event to send terrorists two days from now
|
||||
AddFutureDayStrategicEvent( EVENT_SET_BY_NPC_SYSTEM, Random( 120 ), FACT_KINGPIN_KNOWS_MONEY_GONE, 2 );
|
||||
@@ -786,7 +786,7 @@ void HandleNPCSystemEvent( UINT32 uiEvent )
|
||||
break;
|
||||
|
||||
case NPC_ACTION_SEND_ENRICO_MIGUEL_EMAIL:
|
||||
AddEmail( ENRICO_MIGUEL, ENRICO_MIGUEL_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1 );
|
||||
AddEmail( ENRICO_MIGUEL, ENRICO_MIGUEL_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1 );
|
||||
break;
|
||||
|
||||
case NPC_ACTION_TIMER_FOR_VEHICLE:
|
||||
|
||||
@@ -469,15 +469,29 @@ void MercDailyUpdate()
|
||||
if (cnt < 170)
|
||||
{
|
||||
// TO DO: send E-mail to player telling him the merc has returned from an assignment
|
||||
AddEmail( ( UINT8 )( iOffset + ( cnt * AIM_REPLY_LENGTH_BARRY ) ), AIM_REPLY_LENGTH_BARRY, ( UINT8 )( 6 + cnt ), GetWorldTotalMin(), -1 );
|
||||
AddEmail( ( UINT8 )( iOffset + ( cnt * AIM_REPLY_LENGTH_BARRY ) ), AIM_REPLY_LENGTH_BARRY, ( UINT8 )( 6 + cnt ), GetWorldTotalMin(), -1, -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT16 iMsgLength = cnt;
|
||||
UINT8 sender = cnt - 119; // SenderNameList.xml
|
||||
// Wildfire mercs
|
||||
if (cnt < 178)
|
||||
{
|
||||
UINT16 iMsgLength = cnt;
|
||||
UINT8 sender = cnt - 119; // SenderNameList.xml
|
||||
|
||||
// Fake Barry Unger mail, but with the msgLength of the WF merc ID -> Correct in PreProcessEmail()
|
||||
AddEmailWFMercLevelUp( ( UINT8 )( iOffset + 0 * AIM_REPLY_LENGTH_BARRY ), iMsgLength, sender, GetWorldTotalMin(), -1 );
|
||||
// Fake Barry Unger mail, but with the msgLength of the WF merc ID -> Correct in PreProcessEmail()
|
||||
AddEmailWFMercAvailable( ( UINT8 )( iOffset + 0 * AIM_REPLY_LENGTH_BARRY ), iMsgLength, sender, GetWorldTotalMin(), -1 );
|
||||
}
|
||||
// Generic mail
|
||||
else
|
||||
{
|
||||
// TODO.RW: Send generic mail
|
||||
UINT16 iMsgLength = cnt;
|
||||
UINT8 sender = cnt - 119; // SenderNameList.xml
|
||||
|
||||
// Fake Barry Unger mail, but with the msgLength of the WF merc ID -> Correct in PreProcessEmail()
|
||||
AddEmailWFMercAvailable( ( UINT8 )( iOffset + 0 * AIM_REPLY_LENGTH_BARRY ), iMsgLength, sender, GetWorldTotalMin(), -1 );
|
||||
}
|
||||
}
|
||||
|
||||
// WANNE: Should we stop time compression. I don't know.
|
||||
|
||||
@@ -4485,16 +4485,16 @@ BOOLEAN GroupWillMoveThroughSector( GROUP *pGroup, UINT8 ubSectorX, UINT8 ubSect
|
||||
dy = wp->y - pGroup->ubSectorY;
|
||||
if( dx && dy )
|
||||
{ //Can't move diagonally!
|
||||
AssertMsg( 0, String( "GroupWillMoveThroughSector() -- Attempting to process waypoint in a diagonal direction from sector %c%d to sector %c%d for group at sector %c%d -- KM:0",
|
||||
pGroup->ubSectorY + 'A', pGroup->ubSectorX, wp->y + 'A' - 1, wp->x, ubOrigY + 'A' - 1, ubOrigX ) );
|
||||
//AssertMsg( 0, String( "GroupWillMoveThroughSector() -- Attempting to process waypoint in a diagonal direction from sector %c%d to sector %c%d for group at sector %c%d -- KM:0",
|
||||
// pGroup->ubSectorY + 'A', pGroup->ubSectorX, wp->y + 'A' - 1, wp->x, ubOrigY + 'A' - 1, ubOrigX ) );
|
||||
pGroup->ubSectorX = ubOrigX;
|
||||
pGroup->ubSectorY = ubOrigY;
|
||||
return TRUE;
|
||||
}
|
||||
if( !dx && !dy ) //Can't move to position currently at!
|
||||
{
|
||||
AssertMsg( 0, String( "GroupWillMoveThroughSector() -- Attempting to process same waypoint at %c%d for group at %c%d -- KM:0",
|
||||
wp->y + 'A' - 1, wp->x, ubOrigY + 'A' - 1, ubOrigX ) );
|
||||
//AssertMsg( 0, String( "GroupWillMoveThroughSector() -- Attempting to process same waypoint at %c%d for group at %c%d -- KM:0",
|
||||
// wp->y + 'A' - 1, wp->x, ubOrigY + 'A' - 1, ubOrigX ) );
|
||||
pGroup->ubSectorX = ubOrigX;
|
||||
pGroup->ubSectorY = ubOrigY;
|
||||
return TRUE;
|
||||
@@ -4859,7 +4859,7 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
|
||||
// SANDRO - STOMP traits - Scouting prevents the ambush of bloodcats
|
||||
BOOLEAN fBloodCatAmbushPrevented = FALSE;
|
||||
// The player has entered the lair
|
||||
if(( PlacementType == BLOODCAT_PLACEMENT_LAIR )&& !gubFact[ FACT_PLAYER_KNOWS_ABOUT_BLOODCAT_LAIR ] )
|
||||
if(( PlacementType == BLOODCAT_PLACEMENT_LAIR )) // Default: Sector I16
|
||||
{
|
||||
// We know about the lair
|
||||
if( gubFact[ FACT_PLAYER_KNOWS_ABOUT_BLOODCAT_LAIR ] )
|
||||
@@ -4877,7 +4877,6 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
|
||||
fBloodCatAmbushPrevented = TRUE;
|
||||
|
||||
gubEnemyEncounterCode = ENTERING_BLOODCAT_LAIR_CODE;
|
||||
gubFact[ FACT_PLAYER_KNOWS_ABOUT_BLOODCAT_LAIR ] = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4896,7 +4895,6 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_BLOODCATS_AMBUSH_PREVENTED] );
|
||||
|
||||
fBloodCatAmbushPrevented = TRUE;
|
||||
|
||||
gubEnemyEncounterCode = NO_ENCOUNTER_CODE;
|
||||
}
|
||||
else
|
||||
@@ -5190,47 +5188,41 @@ BOOLEAN WildernessSectorWithAllProfiledNPCsNotSpokenWith( INT16 sSectorX, INT16
|
||||
for ( ubProfile = 0; ubProfile < NUM_PROFILES; ubProfile++ )
|
||||
{
|
||||
|
||||
if ( gProfilesRPC[ubProfile].ProfilId == ubProfile || gProfilesNPC[ubProfile].ProfilId == ubProfile || gProfilesVehicle[ubProfile].ProfilId == ubProfile)
|
||||
{
|
||||
pProfile = &gMercProfiles[ ubProfile ];
|
||||
|
||||
// skip stiffs
|
||||
if ( ( pProfile->bMercStatus == MERC_IS_DEAD ) || ( pProfile->bLife <= 0 ) )
|
||||
if ( gProfilesRPC[ubProfile].ProfilId == ubProfile || gProfilesNPC[ubProfile].ProfilId == ubProfile || gProfilesVehicle[ubProfile].ProfilId == ubProfile)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
pProfile = &gMercProfiles[ ubProfile ];
|
||||
|
||||
// skip vehicles
|
||||
//if ( ubProfile >= PROF_HUMMER && ubProfile <= PROF_HELICOPTER )
|
||||
if ( gProfilesVehicle[ubProfile].ProfilId == ubProfile )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// in this sector?
|
||||
if ( pProfile->sSectorX == sSectorX && pProfile->sSectorY == sSectorY && pProfile->bSectorZ == bSectorZ )
|
||||
{
|
||||
// if we haven't talked to him yet, and he's not currently recruired/escorted by player (!)
|
||||
if ( ( pProfile->ubLastDateSpokenTo == 0 ) &&
|
||||
!(pProfile->ubMiscFlags & (PROFILE_MISC_FLAG_RECRUITED | PROFILE_MISC_FLAG_EPCACTIVE) ) )
|
||||
// skip stiffs
|
||||
if ( ( pProfile->bMercStatus == MERC_IS_DEAD ) || ( pProfile->bLife <= 0 ) )
|
||||
{
|
||||
// then this is a guy we need to stop for...
|
||||
fFoundSomebody = TRUE;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
||||
// skip vehicles
|
||||
//if ( ubProfile >= PROF_HUMMER && ubProfile <= PROF_HELICOPTER )
|
||||
if ( gProfilesVehicle[ubProfile].ProfilId == ubProfile )
|
||||
{
|
||||
// already spoke to this guy, don't prompt about this sector again, regardless of status of other NPCs here
|
||||
// (although Hamous wanders around, he never shares the same wilderness sector as other important NPCs)
|
||||
return( FALSE );
|
||||
continue;
|
||||
}
|
||||
|
||||
// in this sector?
|
||||
if ( pProfile->sSectorX == sSectorX && pProfile->sSectorY == sSectorY && pProfile->bSectorZ == bSectorZ )
|
||||
{
|
||||
// if we haven't talked to him yet, and he's not currently recruired/escorted by player (!)
|
||||
if ( ( pProfile->ubLastDateSpokenTo == 0 ) &&
|
||||
!(pProfile->ubMiscFlags & (PROFILE_MISC_FLAG_RECRUITED | PROFILE_MISC_FLAG_EPCACTIVE) ) )
|
||||
{
|
||||
// then this is a guy we need to stop for...
|
||||
fFoundSomebody = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// already spoke to this guy, don't prompt about this sector again, regardless of status of other NPCs here
|
||||
// (although Hamous wanders around, he never shares the same wilderness sector as other important NPCs)
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return( fFoundSomebody );
|
||||
|
||||
@@ -211,7 +211,7 @@ void HandleEnricoEmail(void)
|
||||
// if creatures have attacked a mine (doesn't care if they're still there or not at the moment)
|
||||
if (HasAnyMineBeenAttackedByMonsters() && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_CREATURES))
|
||||
{
|
||||
AddEmail(ENRICO_CREATURES, ENRICO_CREATURES_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_CREATURES, ENRICO_CREATURES_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_CREATURES;
|
||||
return; // avoid any other E-mail at the same time
|
||||
}
|
||||
@@ -219,21 +219,21 @@ void HandleEnricoEmail(void)
|
||||
|
||||
if ((ubCurrentProgress >= SOME_PROGRESS_THRESHOLD) && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_SOME_PROGRESS))
|
||||
{
|
||||
AddEmail(ENRICO_PROG_20, ENRICO_PROG_20_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_PROG_20, ENRICO_PROG_20_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_SOME_PROGRESS;
|
||||
return; // avoid any setback E-mail at the same time
|
||||
}
|
||||
|
||||
if ((ubCurrentProgress >= ABOUT_HALFWAY_THRESHOLD) && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_ABOUT_HALFWAY))
|
||||
{
|
||||
AddEmail(ENRICO_PROG_55, ENRICO_PROG_55_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_PROG_55, ENRICO_PROG_55_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_ABOUT_HALFWAY;
|
||||
return; // avoid any setback E-mail at the same time
|
||||
}
|
||||
|
||||
if ((ubCurrentProgress >= NEARLY_DONE_THRESHOLD) && !(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_NEARLY_DONE))
|
||||
{
|
||||
AddEmail(ENRICO_PROG_80, ENRICO_PROG_80_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_PROG_80, ENRICO_PROG_80_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_NEARLY_DONE;
|
||||
return; // avoid any setback E-mail at the same time
|
||||
}
|
||||
@@ -243,7 +243,7 @@ void HandleEnricoEmail(void)
|
||||
(((ubHighestProgress - ubCurrentProgress) >= MINOR_SETBACK_THRESHOLD) && (gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_FLAG_SETBACK_OVER))) &&
|
||||
!(gStrategicStatus.usEnricoEmailFlags & ENRICO_EMAIL_SENT_MAJOR_SETBACK))
|
||||
{
|
||||
AddEmail(ENRICO_SETBACK, ENRICO_SETBACK_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_SETBACK, ENRICO_SETBACK_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_MAJOR_SETBACK;
|
||||
}
|
||||
else
|
||||
@@ -251,7 +251,7 @@ void HandleEnricoEmail(void)
|
||||
if (((ubHighestProgress - ubCurrentProgress) >= MINOR_SETBACK_THRESHOLD) &&
|
||||
!(gStrategicStatus.usEnricoEmailFlags & (ENRICO_EMAIL_SENT_MINOR_SETBACK | ENRICO_EMAIL_SENT_MAJOR_SETBACK)))
|
||||
{
|
||||
AddEmail(ENRICO_SETBACK_2, ENRICO_SETBACK_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(ENRICO_SETBACK_2, ENRICO_SETBACK_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_MINOR_SETBACK;
|
||||
}
|
||||
else
|
||||
@@ -314,15 +314,15 @@ void HandleEnricoEmail(void)
|
||||
switch( bComplaint )
|
||||
{
|
||||
case 3:
|
||||
AddEmail(LACK_PLAYER_PROGRESS_3, LACK_PLAYER_PROGRESS_3_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(LACK_PLAYER_PROGRESS_3, LACK_PLAYER_PROGRESS_3_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_LACK_PROGRESS3;
|
||||
break;
|
||||
case 2:
|
||||
AddEmail(LACK_PLAYER_PROGRESS_2, LACK_PLAYER_PROGRESS_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(LACK_PLAYER_PROGRESS_2, LACK_PLAYER_PROGRESS_2_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_LACK_PROGRESS2;
|
||||
break;
|
||||
default:
|
||||
AddEmail(LACK_PLAYER_PROGRESS_1, LACK_PLAYER_PROGRESS_1_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1);
|
||||
AddEmail(LACK_PLAYER_PROGRESS_1, LACK_PLAYER_PROGRESS_1_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
gStrategicStatus.usEnricoEmailFlags |= ENRICO_EMAIL_SENT_LACK_PROGRESS1;
|
||||
break;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
@@ -104,7 +104,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
@@ -165,7 +165,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
@@ -226,7 +226,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
@@ -291,7 +291,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
|
||||
@@ -431,8 +431,9 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI
|
||||
{
|
||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||
|
||||
// WANNE: BUGZILLA #357: Fixed assertion when miltia dies.
|
||||
// damn well better have that many around to remove!
|
||||
Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubRank ] >= ubHowMany);
|
||||
//Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubRank ] >= ubHowMany);
|
||||
|
||||
//KM : July 21, 1999 patch fix
|
||||
if( pSectorInfo->ubNumberOfCivsAtLevel[ ubRank ] < ubHowMany )
|
||||
|
||||
+208
-558
File diff suppressed because it is too large
Load Diff
@@ -2928,13 +2928,16 @@ void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY,
|
||||
// Are we in Omerta!
|
||||
if ( sSectorX == gWorldSectorX && gWorldSectorX == 9 && sSectorY == gWorldSectorY && gWorldSectorY == 1 && bSectorZ == gbWorldSectorZ && gbWorldSectorZ == 0 )
|
||||
{
|
||||
// TODO.WANNE: Hardcoded grid number
|
||||
// Try another location and walk into map
|
||||
pSoldier->sInsertionGridNo = 4379;//dnl!!!
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
pSoldier->sInsertionGridNo = gMapInformation.sNorthGridNo;
|
||||
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
//pSoldier->sInsertionGridNo = gMapInformation.sNorthGridNo;
|
||||
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
pSoldier->sInsertionGridNo = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
}
|
||||
break;
|
||||
case INSERTION_CODE_CHOPPER:
|
||||
@@ -2945,6 +2948,7 @@ void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY,
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
// TODO.WANNE: Hardcoded grid number
|
||||
pSoldier->sInsertionGridNo = 12880;//dnl!!!
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Improper insertion code %d given to UpdateMercsInSector", pSoldier->ubStrategicInsertionCode ) );
|
||||
break;
|
||||
@@ -3705,8 +3709,16 @@ BEGINNING_LOOP:
|
||||
{
|
||||
if ( !OK_CONTROLLABLE_MERC( curr->pSoldier ) )
|
||||
{
|
||||
RemoveCharacterFromSquads( curr->pSoldier );
|
||||
goto BEGINNING_LOOP;
|
||||
if(OK_CONTROL_MERC(curr->pSoldier) && curr->pSoldier->bAssignment == VEHICLE && pGroup->fVehicle)
|
||||
{
|
||||
//CHRISL: passengers in a vehicle movement group will not pass the OK_CONTROLLABLE_MERC check because their assignment is not "ON_DUTY".
|
||||
// The above conditions should allow passengers in a vehicle movement group to remain in the group.
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveCharacterFromSquads( curr->pSoldier );
|
||||
goto BEGINNING_LOOP;
|
||||
}
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user