MERGED source code from development trunk revision 4545 up to latest current revision 4882

Development Trunk: https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP
A detailed list of all the features (changes) is visible in the history log of the development trunk:

INFO: The source code for the official 2011 release (4870) has been branched here:
https://ja2svn.dyndns.org/source/ja2/branches/JA2_rev.4870_2011

This commit contains the following features:

*** Externalized Vehicles ***
o Now with this feature we can add/remove vehicles
o New XML File: TableData\Vehicles.xml
o Added a new function parameter to lua file Scripts\Overhead lua to set up the helicopter in method: SetUpHelicopterForPlayer()
o Added example mini (Docs\Externalized Vehicles Example.zip) mod which adds 2 additional vehicles (hummer and ice-cream truck to sector A9)

*** Up to 255 save slots ***
- There is a "Next" and "Prev" button where you can scroll through the save slots
- It is now possible to load the automatic save (SAVE_EVERY_N_HOURS) from the load screen. This is the first slot after the quickload slot
- Added the 2 alternate players end turn saves (which can be enabled/disabled in option screen) to the save/load game form

*** New Feature: Externalized emails from Emails.edt to XML***
o This feature can be enabled/disabled in the Source:
--> See email.cpp: If "ReadXMLEmail" == FALSE, then normal way (read from Email.edt) otherwise read from XML files
o 2 new XML files: TableData\Email\EmailMercAvailable.xml and EmailMercLevelUp.xml
o Renamed SenderNamesList.xml to EmailSenderNamesList.xml and moved from TableData folder to TableData\Email folder
o Names for mercenaries are get from the file MercProfiles.xml and different names get from the file EmailSenderNamesList.xml

*** Externalized Hidden Towns (Tixa, Orta) ***
o Now it is possible to add new hidden towns (locations)
o See file: TableData/Map/Cities.xml
o New variable in TableData/Map/Cities.xml
- hiddenTown:   0 = show on strategy map, 1 = Hide on strategy map
- townIcon:     1 = on, 0 = off (This is the icon you see on the strategy map)
- szIconFile:   The path to the sti icon file (eg: interface\prison.sti, interface\my_icon.sti)
- iconPosition: The x,y position of the icon on the strategy map

*** Encyclopedia and Briefing Room, reachable from the laptop ***
o 2 new ja2_options.ini properties: BRIEFING_ROOM, ENCYCLOPEDIA
o demonstration video: http://www.youtube.com/watch?v=7CIXdXWLrAo
o Added Example usage of the Briefing Room
- Extract it in your JA2 1.13 folder and use the latest development executable
- The briefing room can be reached from the laptop. Enter SN5631 for the code and then click the "Exit" button
- See "Info_BriefingRoom.txt" and "BriefingRoom_Mission1.png"

*** Improved interrupt system (IIS) ***
o This system changes the way interrupts work. See: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290787#Post290787
o Option system (see ja2_options.ini: IMPROVED_INTERRUPT_SYSTEM)
o A few more settings for the interrupt system in ja2_options.ini
o INFO: Multiplayer games always use the "old" interrupt system, not matter what the user selects in the ja2_options.ini

*** Walking and sidestepping with weapon raised ***
o Enable/disable the walking/sidestepping with raised weapon in ja2_options.ini: ALLOW_WALKING_WITH_WEAPON_RAISED
o You can set an AP/BP modifier when walking/sidestepping with weapon raised in APBPConstants.ini: AP_MODIFIER_WEAPON_READY
o The following feature apply when you walk/sidestep with weapon raised:
-> limited angle of view, but you can see more farther when the weapon has a scope
-> better change for interrupts if you see an enemy
-> less APs and BPs when shooting, because the weapon is already raised
-> It should cost more APs when walking. Maybe you can export the additional AP and BP modifier to the APBPConstants.ini

*** Increase squad size to 8 (800x600) and 8 and 10 (1024x768) ***
o Squad sizes (dependend on the screen resolution) can be selected in the start new game screen
o In a multiplayer game, the squad size will always be 6, because it does not work with more soldiers/squad

*** Added UB-1.13 source code ***
o Merged the UB-1.13 source code (Revision: 4721) from svn: http://subversion.assembla.com/svn/ub-source113
o If you want to build UB-EXE or UB-MapEditor, just enable the 2 defines (JA2UB and JA2UBMAPS) in "builddefines.h"
o The UB-Verion reads from "ja2_UB.ini" instead of "ja2.ini"
o There are 2 new XML files
- Layout\LayoutMainMenu.xml
- MapAction\ActionItems.xml
o There are 2 new LUA-Script files
- Scripts\ExplosionControl.lua
- Scripts\InterfaceDialogue.lua

*** Hide enemy health text / enemy hit count ***
o ja2_options.ini: HIDE_ENEMY_HEALTH_TEXT, HIDE_ENEMY_HIT_COUNT
o both new settings only have effect in a singleplayer game
o see: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=128840&page=1


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-01-18 11:19:01 +00:00
parent c42d68ff0f
commit e64d5a2fa6
264 changed files with 40710 additions and 2771 deletions
+159 -5
View File
@@ -52,6 +52,14 @@
#include "MilitiaSquads.h"
#include "Vehicles.h"
#ifdef JA2UB
#include "Ja25Update.h"
#include "Ja25 Strategic Ai.h"
//#include "Map Screen Interface Map.h"
//extern JA25_SECTOR_AI *gJa25AiSectorStruct;
#endif
#include "connect.h"
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
@@ -1700,7 +1708,11 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
if( fExceptionQueue || fCheckForBattle && gTacticalStatus.fEnemyInSector &&
FindMovementGroupInSector( (UINT8)gWorldSectorX, (UINT8)gWorldSectorY, TRUE ) &&
(pGroup->ubNextX != gWorldSectorX || pGroup->ubNextY != gWorldSectorY || gbWorldSectorZ > 0 ) ||
#ifdef JA2UB
//Ja25: NO meanwhiles
#else
AreInMeanwhile() ||
#endif
//KM : Aug 11, 1999 -- Patch fix: Added additional checks to prevent a 2nd battle in the case
// where the player is involved in a potential battle with bloodcats/civilians
fCheckForBattle && HostileCiviliansPresent() ||
@@ -1710,12 +1722,16 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
//QUEUE BATTLE!
//Delay arrival by a random value ranging from 3-5 minutes, so it doesn't get the player
//too suspicious after it happens to him a few times, which, by the way, is a rare occurrence.
#ifdef JA2UB
/*Ja25: No meanwhiles*/
#else
if( AreInMeanwhile() )
{
pGroup->uiArrivalTime ++; //tack on only 1 minute if we are in a meanwhile scene. This effectively
//prevents any battle from occurring while inside a meanwhile scene.
}
else
#endif
{
pGroup->uiArrivalTime += Random(3) + 3;
}
@@ -1802,13 +1818,27 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
{
// check for discovering secret locations
INT8 bTownId = GetTownIdForSector( pGroup->ubSectorX, pGroup->ubSectorY );
if ( gfHiddenTown[ bTownId ] == FALSE )
{
gfHiddenTown[ bTownId ] = TRUE;
if ( gfIconTown[ bTownId ] == TRUE )
gfDrawHiddenTown[ bTownId ] = TRUE;
}
#ifdef JA2UB
//Ja25: No tixa, orta or sam site
#else
/*
if( bTownId == TIXA )
SetTixaAsFound();
else if( bTownId == ORTA )
SetOrtaAsFound();
else if( IsThisSectorASAMSector( pGroup->ubSectorX, pGroup->ubSectorY, 0 ) )
else
*/
if( IsThisSectorASAMSector( pGroup->ubSectorX, pGroup->ubSectorY, 0 ) )
SetSAMSiteAsFound( GetSAMIdFromSector( pGroup->ubSectorX, pGroup->ubSectorY, 0 ) );
#endif
}
@@ -1982,7 +2012,8 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
if ( GroupAtFinalDestination( pGroup ) && ( pGroup->ubSectorZ == 0 ) && !fNeverLeft )
{
// HEADROCK HAM 3.6: Messages are no longer yellow by default.
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, pMessageStrings[ MSG_ARRIVE ], pVehicleStrings[ pVehicleList[ iVehId ].ubVehicleType ], pMapVertIndex[ pGroup->ubSectorY ], pMapHortIndex[ pGroup->ubSectorX ] );
// ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, pMessageStrings[ MSG_ARRIVE ], pVehicleStrings[ pVehicleList[ iVehId ].ubVehicleType ], pMapVertIndex[ pGroup->ubSectorY ], pMapHortIndex[ pGroup->ubSectorX ] );
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, pMessageStrings[ MSG_ARRIVE ], gNewVehicle[ pVehicleList[ iVehId ].ubVehicleType ].NewVehicleStrings, pMapVertIndex[ pGroup->ubSectorY ], pMapHortIndex[ pGroup->ubSectorX ] );
}
}
}
@@ -2053,6 +2084,41 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
}
}
}
#ifdef JA2UB
/*
//if the enemy group is at its final destination
if( !pGroup->fPlayer && GroupAtFinalDestination( pGroup ) )
{
// Check to see if this is an AI sector
INT16 sJa25SaiSectorValue = GetJA25SectorID( pGroup->ubSectorX, pGroup->ubSectorY, pGroup->ubSectorZ );
if ( sJa25SaiSectorValue != -1 )
{
// If we were told to attack, reset flag
if ( gJa25AiSectorStruct[ sJa25SaiSectorValue ].fEnemyEnrouteToAttack )
{
gJa25AiSectorStruct[ sJa25SaiSectorValue ].fEnemyEnrouteToAttack = FALSE;
}
}
*/
//add the enemies to the sector
/*
SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ].ubNumAdmins += pGroup->pEnemyGroup->ubNumAdmins;
SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ].ubNumTroops += pGroup->pEnemyGroup->ubNumTroops;
SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ].ubNumElites += pGroup->pEnemyGroup->ubNumElites;
if( fBattleGoingToStart )
{
SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ].ubAdminsInBattle = pGroup->pEnemyGroup->ubNumAdmins;
SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ].ubTroopsInBattle = pGroup->pEnemyGroup->ubNumTroops;
SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ].ubElitesInBattle = pGroup->pEnemyGroup->ubNumElites;
}
*/
//}
#endif
gfWaitingForInput = FALSE;
}
@@ -2063,10 +2129,15 @@ void HandleNonCombatGroupArrival( GROUP *pGroup, BOOLEAN fMainGroup, BOOLEAN fNe
{
// if any mercs are actually in the group
#ifdef JA2UB
//Ja25 No strategic ai
#else
if( StrategicAILookForAdjacentGroups( pGroup ) )
{ //The routine actually just deleted the enemy group (player's don't get deleted), so we are done!
return;
}
#endif
if( pGroup->fPlayer )
{
@@ -2679,7 +2750,11 @@ void RemovePGroup( GROUP *pGroup )
}
else
{
#ifdef JA2UB
//Ja25 No strategic ai
#else
RemoveGroupFromStrategicAILists( pGroup->ubGroupID );
#endif
MemFree( pGroup->pEnemyGroup );
}
@@ -2983,6 +3058,7 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
//Determine the group's method(s) of tranportation. If more than one,
//we will always use the highest time.
// WANNE: If we have an old savegame (from the dev. trunk, where the skyrider can only move on roads), just change the "pGroup->ubTransportationMask" to 16 for the heli to fix it in the savegame
fFoot = (UINT8)(pGroup->ubTransportationMask & FOOT);
fCar = (UINT8)(pGroup->ubTransportationMask & CAR);
fTruck = (UINT8)(pGroup->ubTransportationMask & TRUCK);
@@ -4349,7 +4425,12 @@ void ResetMovementForEnemyGroup( GROUP *pGroup )
}
if( !pGroup->fBetweenSectors || !pGroup->ubNextX || !pGroup->ubNextY )
{ //Reset the group's assignment by moving it to the group's original sector as it's pending group.
#ifdef JA2UB
//Ja25 No strategic ai
#else
RepollSAIGroup( pGroup );
#endif
return;
}
@@ -4751,6 +4832,11 @@ void RandomizePatrolGroupLocation( GROUP *pGroup )
//roll the dice to see if this will become an ambush random encounter.
BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
{
#ifdef JA2UB
//Ja25: No BLoodcat ambushes
return( FALSE );
#else
SECTORINFO *pSector;
INT32 iHoursElapsed;
UINT8 ubSectorID;
@@ -4929,6 +5015,7 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
gubEnemyEncounterCode = NO_ENCOUNTER_CODE;
return FALSE;
}
#endif
}
void NotifyPlayerOfBloodcatBattle( UINT8 ubSectorX, UINT8 ubSectorY )
@@ -5132,7 +5219,13 @@ BOOLEAN HandlePlayerGroupEnteringSectorToCheckForNPCsOfNote( GROUP *pGroup )
// get the strategic sector value
sStrategicSector = sSectorX + MAP_WORLD_X * sSectorY;
#ifdef JA2UB
// ATE: if this is a custom map, return Ja25 UB
if ( SectorInfo[ SECTOR( sSectorY, sSectorX ) ].fCustomSector )
{
return( FALSE );
}
#endif
// skip towns/pseudo-towns (anything that shows up on the map as being special)
if( StrategicMap[ sStrategicSector ].bNameId != BLANK_SECTOR )
{
@@ -5397,4 +5490,65 @@ BOOLEAN ScoutIsPresentInSquad( INT16 ubSectorNumX, INT16 ubSectorNumY )
}
return ( fScoutPresent );
}
}
#ifdef JA2UB
GROUP* CreateNewEnemyGroupDepartingFromSectorUsingZLevel( UINT32 uiSector, UINT8 ubSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites )
{
GROUP *pNew;
AssertMsg( uiSector >= 0 && uiSector <= 255, String( "CreateNewEnemyGroup with out of range value of %d", uiSector ) );
pNew = (GROUP*)MemAlloc( sizeof( GROUP ) );
AssertMsg( pNew, "MemAlloc failure during CreateNewEnemyGroup." );
memset( pNew, 0, sizeof( GROUP ) );
pNew->pEnemyGroup = (ENEMYGROUP*)MemAlloc( sizeof( ENEMYGROUP ) );
AssertMsg( pNew->pEnemyGroup, "MemAlloc failure during enemy group creation." );
memset( pNew->pEnemyGroup, 0, sizeof( ENEMYGROUP ) );
pNew->pWaypoints = NULL;
pNew->ubSectorX = (UINT8)SECTORX( uiSector );
pNew->ubSectorY = (UINT8)SECTORY( uiSector );
pNew->ubSectorZ = ubSectorZ;
pNew->ubOriginalSector = (UINT8)uiSector;
pNew->fPlayer = FALSE;
pNew->ubMoveType = CIRCULAR;
pNew->ubNextWaypointID = 0;
pNew->ubFatigueLevel = 100;
pNew->ubRestAtFatigueLevel = 0;
pNew->pEnemyGroup->ubNumAdmins = ubNumAdmins;
pNew->pEnemyGroup->ubNumTroops = ubNumTroops;
pNew->pEnemyGroup->ubNumElites = ubNumElites;
pNew->ubGroupSize = (UINT8)(ubNumAdmins + ubNumTroops + ubNumElites);
pNew->ubTransportationMask = FOOT;
pNew->fVehicle = FALSE;
pNew->ubCreatedSectorID = pNew->ubOriginalSector;
pNew->ubSectorIDOfLastReassignment = 255;
/*
#ifdef JA2BETAVERSION
{
UINT16 str[ 512 ];
//if( PlayerMercsInSector( pNew->ubSectorX, pNew->ubSectorY, pNew->ubSectorZ ) || CountAllMilitiaInSector( pNew->ubSectorX, pNew->ubSectorY ) )
//{
// swprintf( str, L"Attempting to send enemy troops from player occupied location. "
// L"Please ALT+TAB out of the game before doing anything else and send 'Strategic Decisions.txt' "
// L"and this message. You'll likely need to revert to a previous save. If you can reproduce this "
// L"with a save close to this event, that would really help me! -- KM:0" );
// DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL );
//}
if( pNew->ubGroupSize > 25 )
{
swprintf( str, L"Strategic AI warning: Creating an enemy group containing %d soldiers "
L"(%d admins, %d troops, %d elites) in sector %c%d. This message is a temporary test message "
L"to evaluate a potential problems with very large enemy groups.",
pNew->ubGroupSize, ubNumAdmins, ubNumTroops, ubNumElites,
pNew->ubSectorY + 'A' - 1, pNew->ubSectorX );
DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL );
}
}
#endif
*/
if( AddGroupToList( pNew ) )
return pNew;
return NULL;
}
#endif