- New Quest: if Kingpin is unaware Maria escaped with the player's help, he enlists the player to kill the DaSilvas

- Moved civ factions for mod compatibility (UC)

Does not break savegame compatibility.
Requires GameDir >= r2252.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7889 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-06-13 17:26:16 +00:00
parent e77f8f2bd6
commit eff368f099
18 changed files with 467 additions and 162 deletions
+38 -42
View File
@@ -494,7 +494,7 @@ UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLE
#else
INT8 bTownId;
INT8 bCivHint;
INT8 bCivHint;
INT8 bMineId;
#endif
@@ -508,26 +508,25 @@ UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLE
(*pubCivHintToUse) = 0;
ubCivType = GetCivType( pCiv );
for( iCounter2 = NON_CIV_GROUP; iCounter2 < NUM_CIV_GROUPS; iCounter2++ )
{
if ( pCiv->ubCivilianGroup < NUM_CIV_GROUPS )
{
#ifdef JA2UB
if (pCiv->ubCivilianGroup > UNNAMED_CIV_GROUP_19 && pCiv->ubCivilianGroup == iCounter2)
if ( pCiv->ubCivilianGroup > UNNAMED_CIV_GROUP_19 )
#else
if (pCiv->ubCivilianGroup > QUEENS_CIV_GROUP && pCiv->ubCivilianGroup == iCounter2)
if ( pCiv->ubCivilianGroup > QUEENS_CIV_GROUP )
#endif
{
if ( pCiv->aiData.bNeutral )
{
if ( pCiv->aiData.bNeutral )
{
return( FileEDTQUoteID = iCounter2*2 +10);
}
else
{
return( FileEDTQUoteID = iCounter2*2 + 11);
}
}
return(FileEDTQUoteID = pCiv->ubCivilianGroup * 2 + 10);
}
else
{
return(FileEDTQUoteID = pCiv->ubCivilianGroup * 2 + 11);
}
}
}
#ifdef JA2UB
if( ubCivType != CIV_TYPE_ENEMY )
@@ -747,7 +746,7 @@ UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLE
// If we are in medunna, and queen is dead, use these...
if ( bTownId == MEDUNA && CheckFact( FACT_QUEEN_DEAD, 0 ) )
{
return( CIV_QUOTE_DEIDRANNA_DEAD );
return( CIV_QUOTE_DEIDRANNA_DEAD );
}
// if in a town
@@ -767,44 +766,42 @@ UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLE
}
}
// ATE: OK, check if we should look for a civ hint....
if ( fCanUseHints )
{
bCivHint = ConsiderCivilianQuotes( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, FALSE );
bCivHint = ConsiderCivilianQuotes( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, FALSE );
}
else
{
bCivHint = -1;
bCivHint = -1;
}
// ATE: check miners......
if ( pCiv->ubSoldierClass == SOLDIER_CLASS_MINER )
{
bMiners = TRUE;
bMiners = TRUE;
// If not a civ hint available...
if ( bCivHint == -1 )
{
// Check if they are under our control...
// Should I go talk to miner?
// Not done yet.
// Are they working for us?
bMineId = GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
if ( PlayerControlsMine( bMineId ) )
// If not a civ hint available...
if ( bCivHint == -1 )
{
return( CIV_QUOTE_MINERS_FOR_PLAYER );
}
else
{
return( CIV_QUOTE_MINERS_NOT_FOR_PLAYER );
// Check if they are under our control...
// Should I go talk to miner?
// Not done yet.
// Are they working for us?
bMineId = GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
if ( PlayerControlsMine( bMineId ) )
{
return( CIV_QUOTE_MINERS_FOR_PLAYER );
}
else
{
return( CIV_QUOTE_MINERS_NOT_FOR_PLAYER );
}
}
}
}
// Is one availible?
// If we are to say low loyalty, do chance
@@ -855,8 +852,7 @@ UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLE
return( CIV_QUOTE_KIDS_HIGH_LOYALTY );
}
}
// All purpose quote here....
if ( ubCivType == CIV_TYPE_ADULT )
{
+3 -3
View File
@@ -361,10 +361,10 @@ enum
UNNAMED_CIV_GROUP_19,
ASSASSIN_CIV_GROUP, // Flugente: enemy assassins belong to this group
POW_PRISON_CIV_GROUP, // Flugente: prisoners of war the player caught are in this group
VOLUNTEER_CIV_GROUP, // Flugente: civilians that the player recruited
UNNAMED_CIV_GROUP_22,
UNNAMED_CIV_GROUP_23,
UNNAMED_CIV_GROUP_24,
UNNAMED_CIV_GROUP_25,
VOLUNTEER_CIV_GROUP, // Flugente: civilians that the player recruited
BOUNTYHUNTER_CIV_GROUP, // Flugente: hostile bounty hunters
UNNAMED_CIV_GROUP_26,
UNNAMED_CIV_GROUP_27,
UNNAMED_CIV_GROUP_28,
+49 -1
View File
@@ -3843,6 +3843,33 @@ void HandleNPCTeamMemberDeath( SOLDIERTYPE *pSoldierOld )
// If this was a volunteer, then we definetly reduce our volunteer pool
if ( pSoldierOld->bTeam == CIV_TEAM && pSoldierOld->ubCivilianGroup == VOLUNTEER_CIV_GROUP )
AddVolunteers( -1 );
// if this was a bounty hunter, and no other bounty hunters exist in this sector, we must have wiped out a bounty hunter group
if ( pSoldierOld->bTeam == CIV_TEAM && pSoldierOld->ubCivilianGroup == BOUNTYHUNTER_CIV_GROUP )
{
if ( !IsCivFactionMemberAliveInSector( BOUNTYHUNTER_CIV_GROUP ) )
{
if ( SECTOR( pSoldierOld->sSectorX, pSoldierOld->sSectorY ) == GetFact( FACT_BOUNTYHUNTER_SECTOR_1 ) )
SetFactTrue( FACT_BOUNTYHUNTER_KILLED_1 );
if ( SECTOR( pSoldierOld->sSectorX, pSoldierOld->sSectorY ) == GetFact( FACT_BOUNTYHUNTER_SECTOR_2 ) )
SetFactTrue( FACT_BOUNTYHUNTER_KILLED_2 );
}
}
// if Angel an Maria are dead and the bounty hunter quest is still ongoing, then finish it
if ( gubQuest[QUEST_KINGPIN_ANGEL_MARIA] == QUESTINPROGRESS )
{
if ( pSoldierOld->ubProfile == ANGEL && gMercProfiles[MARIA].bMercStatus == MERC_IS_DEAD ||
pSoldierOld->ubProfile == MARIA && gMercProfiles[ANGEL].bMercStatus == MERC_IS_DEAD )
{
// send Email from kingpin with a delay
AddStrategicEvent( EVENT_KINGPIN_BOUNTY_END_KILLEDTHEM, GetWorldTotalMin( ) + 60 * (1 + Random( 6 )), 0 );
// remove 'other
DeleteStrategicEvent( EVENT_KINGPIN_BOUNTY_END_TIME_PASSED, 0 );
}
}
}
else if ( pSoldierOld->bTeam == MILITIA_TEAM )
{
@@ -11179,4 +11206,25 @@ BOOLEAN CoweringShockLevel( SOLDIERTYPE * pSoldier )
}
return FALSE;
}
}
// Flugente: is any member of a specific civilian faction still alive in the current sector?
BOOLEAN IsCivFactionMemberAliveInSector( UINT8 usCivilianGroup )
{
SOLDIERTYPE *pSoldier = NULL;
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
UINT16 cnt = gTacticalStatus.Team[CIV_TEAM].bFirstID;
// look for all mercs on the same team,
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[CIV_TEAM].bLastID; ++cnt, ++pSoldier )
{
if ( pSoldier->bActive && (pSoldier->sSectorX == gWorldSectorX) && (pSoldier->sSectorY == gWorldSectorY) && (pSoldier->bSectorZ == gbWorldSectorZ) )
{
if ( pSoldier->ubCivilianGroup == usCivilianGroup && pSoldier->stats.bLife > 0 )
return TRUE;
}
}
return FALSE;
}
+3
View File
@@ -424,5 +424,8 @@ BOOLEAN GetRandomUnknownVIPSector( UINT16& aSector );
void DeleteVIP( INT16 sMapX, INT16 sMapY );
void VIPFleesToMeduna();
// Flugente: is any member of a specific civilian faction still alive in the current sector?
BOOLEAN IsCivFactionMemberAliveInSector( UINT8 usCivilianGroup );
#endif
+89 -68
View File
@@ -1339,70 +1339,7 @@ BOOLEAN TacticalCopySoldierFromProfile( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STR
{
pSoldier->usSoldierFlagMask |= (SOLDIER_COVERT_SOLDIER|SOLDIER_COVERT_NPC_SPECIAL|SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS);
UINT8 rnd = Random(11);
// Vest
switch ( rnd )
{
case 0:
SET_PALETTEREP_ID( pSoldier->VestPal, "BROWNVEST" );
break;
case 1:
SET_PALETTEREP_ID( pSoldier->VestPal, "greyVEST" );
break;
case 2:
SET_PALETTEREP_ID( pSoldier->VestPal, "GREENVEST" );
break;
case 3:
SET_PALETTEREP_ID( pSoldier->VestPal, "JEANVEST" );
break;
case 4:
SET_PALETTEREP_ID( pSoldier->VestPal, "REDVEST" );
break;
case 5:
SET_PALETTEREP_ID( pSoldier->VestPal, "BLUEVEST" );
break;
case 6:
SET_PALETTEREP_ID( pSoldier->VestPal, "YELLOWVEST" );
break;
case 7:
SET_PALETTEREP_ID( pSoldier->VestPal, "WHITEVEST" );
break;
case 8:
SET_PALETTEREP_ID( pSoldier->VestPal, "BLACKSHIRT" );
break;
case 9:
SET_PALETTEREP_ID( pSoldier->VestPal, "GYELLOWSHIRT" );
break;
default:
SET_PALETTEREP_ID( pSoldier->VestPal, "PURPLESHIRT" );
break;
}
rnd = Random(6);
// Pants
switch ( rnd )
{
case 0:
SET_PALETTEREP_ID( pSoldier->PantsPal, "GREENPANTS" );
break;
case 1:
SET_PALETTEREP_ID( pSoldier->PantsPal, "JEANPANTS" );
break;
case 2:
SET_PALETTEREP_ID( pSoldier->PantsPal, "TANPANTS" );
break;
case 3:
SET_PALETTEREP_ID( pSoldier->PantsPal, "BLACKPANTS" );
break;
case 4:
SET_PALETTEREP_ID( pSoldier->PantsPal, "BLUEPANTS" );
break;
default:
SET_PALETTEREP_ID( pSoldier->PantsPal, "BEIGEPANTS" );
break;
}
SetClothes( pSoldier, Random( 11 ), Random( 6 ) );
}
return( TRUE );
@@ -1503,6 +1440,46 @@ INT32 ChooseHairColor( UINT8 usBodyType, INT32 skin )
return hair;
}
// Flugente: set palettes for vest/shirt
void SetClothes( SOLDIERTYPE* pSoldier, INT8 aVest, INT8 aPants )
{
if ( !pSoldier )
return;
// Vest
if ( aVest >= 0 && aVest < 11 )
{
switch ( aVest )
{
case 0: SET_PALETTEREP_ID( pSoldier->VestPal, "BROWNVEST" ); break;
case 1: SET_PALETTEREP_ID( pSoldier->VestPal, "greyVEST" ); break;
case 2: SET_PALETTEREP_ID( pSoldier->VestPal, "GREENVEST" ); break;
case 3: SET_PALETTEREP_ID( pSoldier->VestPal, "JEANVEST" ); break;
case 4: SET_PALETTEREP_ID( pSoldier->VestPal, "REDVEST" ); break;
case 5: SET_PALETTEREP_ID( pSoldier->VestPal, "BLUEVEST" ); break;
case 6: SET_PALETTEREP_ID( pSoldier->VestPal, "YELLOWVEST" ); break;
case 7: SET_PALETTEREP_ID( pSoldier->VestPal, "WHITEVEST" ); break;
case 8: SET_PALETTEREP_ID( pSoldier->VestPal, "BLACKSHIRT" ); break;
case 9: SET_PALETTEREP_ID( pSoldier->VestPal, "GYELLOWSHIRT" ); break;
default: SET_PALETTEREP_ID( pSoldier->VestPal, "PURPLESHIRT" ); break;
}
}
// Pants
if ( aPants >= 0 && aPants < 6 )
{
switch ( aPants )
{
case 0: SET_PALETTEREP_ID( pSoldier->PantsPal, "GREENPANTS" ); break;
case 1: SET_PALETTEREP_ID( pSoldier->PantsPal, "JEANPANTS" ); break;
case 2: SET_PALETTEREP_ID( pSoldier->PantsPal, "TANPANTS" ); break;
case 3: SET_PALETTEREP_ID( pSoldier->PantsPal, "BLACKPANTS" ); break;
case 4: SET_PALETTEREP_ID( pSoldier->PantsPal, "BLUEPANTS" ); break;
default: SET_PALETTEREP_ID( pSoldier->PantsPal, "BEIGEPANTS" ); break;
}
}
}
void GeneratePaletteForSoldier( SOLDIERTYPE *pSoldier, UINT8 ubSoldierClass, UINT8 ubTeam )
{
INT32 skin, hair;
@@ -3336,7 +3313,50 @@ SOLDIERTYPE* TacticalCreateCreature( INT8 bCreatureBodyType )
return TacticalCreateSoldier( &pp, &ubID );
}
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwsie they just blend in
// Flugente: create an armed civilian
SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass )
{
BASIC_SOLDIERCREATE_STRUCT bp;
SOLDIERCREATE_STRUCT pp;
UINT8 ubID;
SOLDIERTYPE * pSoldier = NULL;
// this needs the covert ops trait, and thus the new trait system
if ( !gGameOptions.fNewTraitSystem )
return NULL;
// not in autoresolve!
if ( guiCurrentScreen == AUTORESOLVE_SCREEN )
return NULL;
memset( &bp, 0, sizeof(BASIC_SOLDIERCREATE_STRUCT) );
RandomizeRelativeLevel( &(bp.bRelativeAttributeLevel), usSoldierClass );
RandomizeRelativeLevel( &(bp.bRelativeEquipmentLevel), usSoldierClass );
bp.bTeam = CIV_TEAM;
bp.bOrders = FARPATROL;
bp.bAttitude = (INT8)Random( MAXATTITUDES );
bp.bBodyType = Random( 4 );
bp.ubSoldierClass = usSoldierClass;
CreateDetailedPlacementGivenBasicPlacementInfo( &pp, &bp );
pSoldier = TacticalCreateSoldier( &pp, &ubID );
if ( pSoldier )
{
// send soldier to centre of map, roughly
pSoldier->aiData.sNoiseGridno = (CENTRAL_GRIDNO + (Random( CENTRAL_RADIUS * 2 + 1 ) - CENTRAL_RADIUS) + (Random( CENTRAL_RADIUS * 2 + 1 ) - CENTRAL_RADIUS) * WORLD_COLS);
pSoldier->aiData.ubNoiseVolume = MAX_MISC_NOISE_DURATION;
// random clothes
SetClothes( pSoldier, Random( 11 ), Random( 6 ) );
pSoldier->CreateSoldierPalettes( );
}
return(pSoldier);
}
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwise they just blend in
SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype)
{
BASIC_SOLDIERCREATE_STRUCT bp;
@@ -3978,10 +3998,11 @@ UINT8 GetLocationModifier( UINT8 ubSoldierClass )
#endif
BOOLEAN fSuccess;
// Flugente: why do we always crash the game if something does not work?
// where is all this taking place?
fSuccess = GetCurrentBattleSectorXYZ( &sSectorX, &sSectorY, &sSectorZ );
Assert( fSuccess );
if ( !GetCurrentBattleSectorXYZ( &sSectorX, &sSectorY, &sSectorZ ) )
return 0;
#ifdef JA2UB
//Ja25 UB
//switch on the sector, to determine modifer
+7
View File
@@ -447,10 +447,14 @@ SOLDIERTYPE* TacticalCreateCreature( INT8 bCreatureBodyType );
SOLDIERTYPE* TacticalCreateEnemyTank();
SOLDIERTYPE* TacticalCreateJeep();
// Flugente: create an armed civilian
SOLDIERTYPE* TacticalCreateArmedCivilian( UINT8 usSoldierClass = SOLDIER_CLASS_ARMY );
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwise they just blend in
SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype);
void CreateAssassin(UINT8 disguisetype);
// create a prisoner (in a prison cell) in the current sector
void CreatePrisonerOfWar();
// randomly generates a relative level rating (attributes or equipment)
@@ -557,4 +561,7 @@ BOOLEAN AssignTraitsToSoldier( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCre
INT32 ChooseHairColor( UINT8 usBodyType, INT32 skin );
// Flugente: set palettes for vest/shirt
void SetClothes(SOLDIERTYPE* pSoldier, INT8 aVest, INT8 aPants);
#endif
+9
View File
@@ -57,6 +57,7 @@
#include "CampaignStats.h" // added by Flugente
#include "Town Militia.h" // added by Flugente
#include "PreBattle Interface.h" // added by Flugente
#include "LuaInitNPCs.h" // added by Flugente
BOOLEAN gfOriginalList = TRUE;
@@ -951,8 +952,12 @@ UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
// Flugente: spawn prisoners of war in prison sectors
if ( bTeam == CIV_TEAM )
{
SectorAddPrisonersofWar(gWorldSectorX, gWorldSectorY, gbWorldSectorZ);
LuaHandleSectorTacticalEntry( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
}
//There aren't any basic placements of desired team, so exit.
return ubNumAdded;
}
@@ -1002,8 +1007,12 @@ UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
// Flugente: spawn prisoners of war in prison sectors
if ( bTeam == CIV_TEAM )
{
SectorAddPrisonersofWar(gWorldSectorX, gWorldSectorY, gbWorldSectorZ);
LuaHandleSectorTacticalEntry( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
}
return ubNumAdded;
}
+3
View File
@@ -65,4 +65,7 @@ void SectorAddAssassins( INT16 sMapX, INT16 sMapY, INT16 sMapZ );
// Flugente: decide wether to create prisoners of war in a sector. Not to be confused with player POWs
void SectorAddPrisonersofWar( INT16 sMapX, INT16 sMapY, INT16 sMapZ );
// Flugente: add script-defined civilians if Lua functions say so
void SectorAddLuaCivilians( INT16 sMapX, INT16 sMapY, INT16 sMapZ );
#endif