************************************************************

* Merged Source Code from Development Trunk: Revision 4063 *
************************************************************
- Source Code is merged from: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP
- This will be the Source for the Beta 2011 Test

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4064 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-01-18 09:11:09 +00:00
parent 44e1646410
commit 91087ca8c0
469 changed files with 118108 additions and 24678 deletions
+112 -11
View File
@@ -331,6 +331,23 @@ BOOLEAN CheckNPCIsEPC( UINT8 ubProfileID )
return( (pNPC->ubWhatKindOfMercAmI == MERC_TYPE__EPC ) );
}
BOOLEAN CheckNPCIsRPC( UINT8 ubProfileID )
{
SOLDIERTYPE * pNPC;
if ( gMercProfiles[ ubProfileID ].bMercStatus == MERC_IS_DEAD )
{
return( FALSE );
}
pNPC = FindSoldierByProfileID( ubProfileID, TRUE );
if (!pNPC)
{
return( FALSE );
}
return( (pNPC->ubWhatKindOfMercAmI == MERC_TYPE__NPC ) );
}
BOOLEAN NPCInRoom( UINT8 ubProfileID, UINT8 ubRoomID )
{
SOLDIERTYPE * pNPC;
@@ -914,10 +931,10 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
case FACT_RECEIVING_INCOME_FROM_DCAC:
gubFact[usFact] = (
( PredictDailyIncomeFromAMine( MINE_DRASSEN ) > 0 ) &&
( PredictDailyIncomeFromAMine( MINE_ALMA ) > 0 ) &&
( PredictDailyIncomeFromAMine( MINE_CAMBRIA ) > 0 ) &&
( PredictDailyIncomeFromAMine( MINE_CHITZENA ) > 0 ) );
( PredictDailyIncomeFromAMine( MINE_DRASSEN, TRUE ) > 0 ) &&
( PredictDailyIncomeFromAMine( MINE_ALMA, TRUE ) > 0 ) &&
( PredictDailyIncomeFromAMine( MINE_CAMBRIA, TRUE ) > 0 ) &&
( PredictDailyIncomeFromAMine( MINE_CHITZENA, TRUE ) > 0 ) );
break;
case FACT_PLAYER_BEEN_TO_K4:
@@ -994,15 +1011,21 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
break;
case FACT_PLAYER_OWNS_2_TOWNS_INCLUDING_OMERTA:
gubFact[usFact] = ( ( GetNumberOfWholeTownsUnderControl() == 3 ) && IsTownUnderCompleteControlByPlayer( OMERTA ) );
gubFact[usFact] = ( ( GetNumberOfWholeTownsUnderControl() == gGameExternalOptions.ubEarlyRebelsRecruitment[1] || gGameExternalOptions.ubEarlyRebelsRecruitment[0] == 1
|| ( gubQuest[QUEST_FOOD_ROUTE] == QUESTDONE && gGameExternalOptions.ubEarlyRebelsRecruitment[0] == 4 ) ) && IsTownUnderCompleteControlByPlayer( OMERTA ) );
break;
case FACT_PLAYER_OWNS_3_TOWNS_INCLUDING_OMERTA:
gubFact[usFact] = ( ( GetNumberOfWholeTownsUnderControl() == 5 ) && IsTownUnderCompleteControlByPlayer( OMERTA ) );
gubFact[usFact] = ( ( GetNumberOfWholeTownsUnderControl() == gGameExternalOptions.ubEarlyRebelsRecruitment[2] || gGameExternalOptions.ubEarlyRebelsRecruitment[0] == 1
|| ( gubQuest[QUEST_FOOD_ROUTE] == QUESTDONE && gGameExternalOptions.ubEarlyRebelsRecruitment[0] == 4 ) ) && IsTownUnderCompleteControlByPlayer( OMERTA ) );
break;
case FACT_PLAYER_OWNS_4_TOWNS_INCLUDING_OMERTA:
gubFact[usFact] = ( ( GetNumberOfWholeTownsUnderControl() >= 6 ) && IsTownUnderCompleteControlByPlayer( OMERTA ) );
gubFact[usFact] = ( ( GetNumberOfWholeTownsUnderControl() >= gGameExternalOptions.ubEarlyRebelsRecruitment[3] || gGameExternalOptions.ubEarlyRebelsRecruitment[0] == 1
|| ( gubQuest[QUEST_FOOD_ROUTE] == QUESTDONE && gGameExternalOptions.ubEarlyRebelsRecruitment[0] == 4 ) ) && IsTownUnderCompleteControlByPlayer( OMERTA ) );
// silversurfer: this is the highest requirement and therefore we will automatically enable recruitment of Miguel
if ( gubFact[usFact] )
SetFactTrue(40); // Miguel will now be willing to join and so will the other RPC
break;
case FACT_PLAYER_FOUGHT_THREE_TIMES_TODAY:
@@ -1224,8 +1247,8 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
gubFact[usFact] = !BoxerExists();
break;
case 245: // Can dimitri be recruited? should be true if already true, OR if Miguel has been recruited already
gubFact[usFact] = ( gubFact[usFact] || FindSoldierByProfileID( MIGUEL, TRUE ) );
case 245: // Can dimitri be recruited? should be true if already true, OR if Miguel has been recruited already OR is available for recruitment
gubFact[usFact] = ( gubFact[usFact] || FindSoldierByProfileID( MIGUEL, TRUE ) || gubFact[40] );
/*
case FACT_:
gubFact[usFact] = ;
@@ -1269,8 +1292,67 @@ void EndQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY )
void InternalEndQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN fUpdateHistory )
{
if ( gubQuest[ubQuest ] == QUESTINPROGRESS )
// SANDRO merc records - quests handled counter
if ( gubQuest[ubQuest] != QUESTDONE && fUpdateHistory ) // only public quests
{
switch (ubQuest)
{
case QUEST_FOOD_ROUTE :
// food quest is handled differently (completing when spoken to father Walker)
break;
case QUEST_DELIVER_LETTER :
case QUEST_LEATHER_SHOP_DREAM :
GiveQuestRewardPoint( sSectorX, sSectorY, 3, NO_PROFILE );
break;
case QUEST_ESCORT_SKYRIDER :
case QUEST_CHOPPER_PILOT :
case QUEST_FREE_CHILDREN :
case QUEST_RESCUE_MARIA :
case QUEST_FIND_SCIENTIST :
case QUEST_DELIVER_VIDEO_CAMERA :
case QUEST_FIND_HERMIT :
GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE );
break;
case QUEST_FREE_DYNAMO :
// don't give Dynamo reward for himself
if( gMercProfiles[ DYNAMO ].bMercStatus != MERC_IS_DEAD )
GiveQuestRewardPoint( sSectorX, sSectorY, 4, DYNAMO );
break;
case QUEST_KINGPIN_IDOL :
case QUEST_CHITZENA_IDOL :
case QUEST_HELD_IN_ALMA :
case QUEST_RUNAWAY_JOEY :
case QUEST_ESCORT_TOURISTS :
GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE );
break;
case QUEST_ARMY_FARM :
case QUEST_KINGPIN_MONEY :
GiveQuestRewardPoint( sSectorX, sSectorY, 6, NO_PROFILE );
break;
case QUEST_BLOODCATS :
GiveQuestRewardPoint( sSectorX, sSectorY, 7, NO_PROFILE );
break;
case QUEST_INTERROGATION : // we get here only if wiped out enemies after interrogation
case QUEST_CREATURES :
GiveQuestRewardPoint( sSectorX, sSectorY, 8, NO_PROFILE );
break;
case QUEST_KILL_TERRORISTS : // only reduced experiences if we chosen Slay over Carmen
if( gMercProfiles[ CARMEN ].bMercStatus == MERC_IS_DEAD )
GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE );
else
GiveQuestRewardPoint( sSectorX, sSectorY, 9, NO_PROFILE );
break;
case QUEST_KILL_DEIDRANNA :
GiveQuestRewardPoint( sSectorX, sSectorY, 25, NO_PROFILE );
break;
default :
GiveQuestRewardPoint( sSectorX, sSectorY, 4, NO_PROFILE );
break;
}
}
if ( gubQuest[ubQuest ] == QUESTINPROGRESS )
{
gubQuest[ubQuest] = QUESTDONE;
if ( fUpdateHistory )
@@ -1290,7 +1372,6 @@ void InternalEndQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN fU
gMercProfiles[ MADAME ].bNPCData = 0;
gMercProfiles[ MADAME ].bNPCData2 = 0;
}
};
void InitQuestEngine()
@@ -1390,7 +1471,27 @@ BOOLEAN LoadQuestInfoFromSavedGameFile( HWFILE hFile )
return( TRUE );
}
// SANDRO - a function to add quest-done point to merc records, and award some exp possibly
void GiveQuestRewardPoint( INT16 sQuestSectorX, INT16 sQuestsSectorY, INT8 bExpReward, UINT8 bException )
{
ScreenMsg( FONT_MCOLOR_LTBLUE, MSG_TESTVERSION, L"QUEST COMPLETED - Adding to merc records and awarding experiences (%d).", (bExpReward * gGameExternalOptions.usAwardSpecialExpForQuests) );
for ( UINT8 i = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; i <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; i++ )
{
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife >= CONSCIOUSNESS && !(MercPtrs[ i ]->flags.uiStatusFlags & SOLDIER_VEHICLE) && MercPtrs[ i ]->ubProfile != NO_PROFILE &&
MercPtrs[ i ]->sSectorX == sQuestSectorX && MercPtrs[ i ]->sSectorY == sQuestsSectorY && !MercPtrs[ i ]->flags.fBetweenSectors && MercPtrs[ i ]->bTeam == gbPlayerNum &&
MercPtrs[ i ]->bAssignment != IN_TRANSIT && MercPtrs[ i ]->bAssignment != ASSIGNMENT_DEAD && gMercProfiles[ MercPtrs[ i ]->ubProfile ].ubBodyType != 21 ) // != ROBOTNOWEAPON )
{
if ( MercPtrs[ i ]->ubProfile != bException )
{
gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.ubQuestsHandled++;
if ( bExpReward > 0 && gGameExternalOptions.usAwardSpecialExpForQuests > 0 )
StatChange( MercPtrs[ i ], EXPERAMT, (bExpReward * gGameExternalOptions.usAwardSpecialExpForQuests), FALSE );
}
}
}
}