*** MERGED source code from development trunk revision 4890 up to latest current revision 5105 ***

Development Trunk (now obsolete): 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: There will be no further development in the development source trunk, so is obsolete from now on!

This commit contains the following features (bugfixes are not listed):

- New Feature: Show merc ranks in Strategy Screen before merc name
o Toggle on/off in the ingame options screen
o For each experience level (0-10) there are defined rank names in the language specific text files
o Additional language text that is not translated yet is marked with // TODO.Translate

- New Feature: Faster Bobby Ray Shipments
o This feature is selectable in the ja2_options.ini
o When activated Bobby Ray shipments will be really fast
-> Overnight Express: 5 - 7 hours
-> Air Service: 10, 12 or 14 hours
-> Standard Service: 15, 18 or 21 hours
o In a multiplayer game, this feature is disabled (because shipment arrive immediately in the destination sector)

- New Feature: AP cost for manipulating the merc inventory
o This feature is selectable in the start new game screen
o For example, putting a weapon from hand in the backpack costs APs
o The AP costs are defined in the APBPConstants.ini
o In a multiplayer game, this feature is disabled

- New Feature: Added possibility to set individual Gear Kit names
o Set individual names in the optional new tag <mGearKitName> inside the <GEARKIT> root element (File: TableData\MercStartingGear.xml)

- New Feature: Externalized the maximum purchase amount (JA2 vanilla: 10) for Bobby Rays purchases per shipment
o Define the max. amount in the ja2_options.ini: BOBBY_RAY_MAX_PURCHASE_AMOUNT, Range: 10 - 100)
o Nice scrolling bars to scroll through all the purchases

- New Feature: Now it is possible to walk on "water" tiles or handle those tiles like "normal" tiles 
o (instead of showing the swimming animation and counting the APs for swimming), when the soldier is located on the second level (level > 0)

- New Feature: Externalized AIM Veterans laptop site
o Add maximum of 4 pages
o Add  new AIM to veterans page, and remove AIM from veterans page.
o New XML file: OldAIMArchive.xml (language specific XML files: *.OldAIMArchive.xml)

- New Feature: Added possibility to choose from 254 IMP faces
o Modified IMPPortraits.xml
o Added new GameDir folder "IMPFaces" which contains the IMP face portraits
o Moved IMP faces in the new "IMPFaces" folder

- New Feature: ARSP - All Resolution Support Project
o See here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298698&page=1
o Support any kind of screen resolution. This works by choosing the matching full supported resolution (640x480, 800x600, 1024x768) and then centering the graphics
o See ja2.ini for defining the screen resolution

- New Feature: AI Turn Speed Up (FF-MOD)
o see here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298699#Post298699
o When this feature is activated it allows fast enemy turns
o New entry in ja2.ini to enable this feature: HIGHSPEED_TIMER = TRUE
o Turn on/off auto fast turns in ingame options
o New ja2_options.ini settings for fine tuning: [Clock Settings] ini block

- New Feature: "Lock" / "Release" mouse cursor in tactical windowed mode, so the mouse can stay within window boundary
o This is very helpful for doing scrolling with the mouse (by moving the mouse to the window edge) in windowed mode
o You can toggle on/off the feature by pressing CTRL + Z. It is also possible to press CTRL + Y. So the user can decide which fits better :)
o Whenever you toggle on/off a screen message appears on the tactical log to notify the player

- New Feature: Weapon overheating
o Basically, every shot fired from a gun increases its temperature. On higher temperatures, the gun jams more frequently
o On/off toggle in the ingame options
o Graphical thermometer indication on the weapon picture
o New ja2_options.ini section with a few options, Section: [Tactical Weapon Overheating Settings]
o XML changes (New Tags)
--> AmmoTypes.xml: <temperatureModificator>
--> Items.xml: <barrel>, <usOverheatingCooldownFactor>
--> Weapons.xml: <usOverheatingJamThreshold>, <usOverheatingDamageThreshold>, <usOverheatingSingleShotTemperature>
o Added a few barells to Items.xml (end of the file)
o more infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=301059&page=1

- New Feature: Resting weapons on a surfaces
o You can now rest your weapon on crates, low walls, rocks, debris, open windows etc. while you are crouched. Resting will give yu the superior gun handling modifiers from PRONE position.
o A little 'A' on your gun indicates if you are resting it or not.
o Both settings can be turned on and off in Ja2_Options.ini under 'Tactical Gameplay Settings'

- New Feature: Externalized option on whether mercs can exit sector using grid exit in turn based mode
o new ja2_options.ini property: GRID_EXIT_IN_TURNBASED
o This ini setting does not affect leaving sectors on map edges

- Rework/Update: Ammo boxes and Ammo crates
o Ammo crate items added for remaining calibers.  Tweaked prices to correspond to magazines, tweaked capacities and weights to be reasonable (~800 or less).
o Shift-R reload now looks at both boxes and crates in sector items and merc's inventory to reload, and tops off magazines in inventory as well.  Only possible outside of combat.
o Ctrl-Shift-A still creates crates as per usual, with some fixes to ensure all ammo is caught on the first press.
o Shift-A now creates ammo boxes in the same loop.  They mostly behave like crates, but fit in mercs inventories.
o Ammo boxes are available to purchase at BR and tony, sam, etc.  Individual magazines/drums/etc are no longer available.
o Removed ammo crate xml tag.  Added ubMagType tag to Magazines array.  This allows us to differentiate between magazines, bullets, boxes and crates.
o Changed ammo filtering in BR's to display boxes appropriately.  Added back the "Mag:" display (changed text to "Size:")
o Added ja2set.dat.xml file (WF map version in WF maps folder) to be used instead of ja2set.dat file (ja2.ini setting added) For now, if you want to play vanilla instead, just change the setting in the ini (see comments in file).
o Added P4-P9Items image files (up to 5k images each) and tileslots.  1.13 core items will continue to use Guns and P1-P3Items for the foreseeable future.  P4-P9 can be used by customizers/modders to avoid conflicts with Guns/P1-P3 items.  TODO: Need to discuss a strategy for this in the forums.
o Added in Ambient/0.bad and 32.bad to avoid an exception in the code.
o Updated the XML Editor
o Standardized the text on all the ammo items.

- New Multiplayer Feature: Sharing same FOV (field of view) in a coop/team-dm (for friendly teams) game
o You will also see enemies, that your teammate sees

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5108 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-03-23 18:46:54 +00:00
parent ab80b4e191
commit 7ca53fadc7
177 changed files with 9625 additions and 3428 deletions
+182 -21
View File
@@ -4503,6 +4503,13 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
}
// WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
// This should fix "problems" for special modified maps
if ( (TERRAIN_IS_WATER( this->bOverTerrainType) || TERRAIN_IS_WATER( this->bOldOverTerrainType)) && this->pathing.bLevel > 0 )
{
this->bOverTerrainType = FLAT_GROUND;
this->bOldOverTerrainType = FLAT_GROUND;
}
// OK, If we were not in deep water but we are now, handle deep animations!
if ( TERRAIN_IS_DEEP_WATER( this->bOverTerrainType) && !TERRAIN_IS_DEEP_WATER( this->bOldOverTerrainType) )
@@ -4510,20 +4517,17 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
// Based on our current animation, change!
switch( this->usAnimState )
{
case WALKING:
case WALKING_PISTOL_RDY:
case WALKING_RIFLE_RDY:
case WALKING_DUAL_RDY:
case RUNNING:
// IN deep water, swim!
// Make transition from low to deep
this->EVENT_InitNewSoldierAnim( LOW_TO_DEEP_WATER, 0 , FALSE );
this->usPendingAnimation = DEEP_WATER_SWIM;
this->usDontUpdateNewGridNoOnMoveAnimChange = 1;
PlayJA2Sample( ENTER_DEEP_WATER_1, RATE_11025, SoundVolume( MIDVOLUME, this->sGridNo ), 1, SoundDir( this->sGridNo ) );
case WALKING:
case WALKING_PISTOL_RDY:
case WALKING_RIFLE_RDY:
case WALKING_DUAL_RDY:
case RUNNING:
// IN deep water, swim!
// Make transition from low to deep
this->EVENT_InitNewSoldierAnim( LOW_TO_DEEP_WATER, 0 , FALSE );
this->usPendingAnimation = DEEP_WATER_SWIM;
this->usDontUpdateNewGridNoOnMoveAnimChange = 1;
PlayJA2Sample( ENTER_DEEP_WATER_1, RATE_11025, SoundVolume( MIDVOLUME, this->sGridNo ), 1, SoundDir( this->sGridNo ) );
}
}
@@ -4532,7 +4536,7 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
{
WaterDamage( this );
}
// OK, If we were in deep water but we are NOT now, handle mid animations!
if ( !TERRAIN_IS_DEEP_WATER( this->bOverTerrainType) && TERRAIN_IS_DEEP_WATER( this->bOldOverTerrainType) )
{
@@ -4702,7 +4706,7 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - hack! - an interrupt pending before shot
if ( gGameExternalOptions.fImprovedInterruptSystem )
if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( this, BEFORESHOT_INTERRUPT ) )
{
@@ -7294,6 +7298,11 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
this->sOldXPos = sStartPosX;
this->sOldYPos = sStartPosY;
// Flugente FTW 1: Cool down all weapons in inventory
if ( gGameOptions.fWeaponOverheating )
{
this->SoldierInventoryCoolDown();
}
}
// UTILITY FUNCTIONS CALLED BY OVERHEAD.H
@@ -10811,8 +10820,11 @@ void ReleaseSoldiersAttacker( SOLDIERTYPE *pSoldier )
BOOLEAN SOLDIERTYPE::MercInWater( void )
{
// WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
// This should fix "problems" for special modified maps
// Our water texture , for now is of a given type
if ( TERRAIN_IS_WATER( this->bOverTerrainType))
if ( TERRAIN_IS_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -10824,8 +10836,11 @@ BOOLEAN SOLDIERTYPE::MercInWater( void )
BOOLEAN SOLDIERTYPE::MercInShallowWater( void )
{
// WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
// This should fix "problems" for special modified maps
// Our water texture , for now is of a given type
if ( TERRAIN_IS_SHALLOW_WATER( this->bOverTerrainType))
if ( TERRAIN_IS_SHALLOW_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -10838,8 +10853,11 @@ BOOLEAN SOLDIERTYPE::MercInShallowWater( void )
BOOLEAN SOLDIERTYPE::MercInDeepWater( void )
{
// WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
// This should fix "problems" for special modified maps
// Our water texture , for now is of a given type
if ( TERRAIN_IS_DEEP_WATER( this->bOverTerrainType))
if ( TERRAIN_IS_DEEP_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -10851,8 +10869,11 @@ BOOLEAN SOLDIERTYPE::MercInDeepWater( void )
BOOLEAN SOLDIERTYPE::MercInHighWater( void )
{
// WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
// This should fix "problems" for special modified maps
// Our water texture , for now is of a given type
if ( TERRAIN_IS_HIGH_WATER( this->bOverTerrainType))
if ( TERRAIN_IS_HIGH_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -12858,10 +12879,148 @@ BOOLEAN SOLDIERTYPE::SoldierCarriesTwoHandedWeapon( void )
}
return( FALSE );
}
// Flugente FTW 1: Cool down all items in inventory
void SOLDIERTYPE::SoldierInventoryCoolDown(void)
{
INT8 invsize = (INT8)this->inv.size(); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
{
// ... if Item exists and is a gun, a launcher or a barrel ...
if (this->inv[bLoop].exists() == true && ( Item[this->inv[bLoop].usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[this->inv[bLoop].usItem].barrel == TRUE ) )
{
OBJECTTYPE * pObj = &(this->inv[bLoop]); // ... get pointer for this item ...
if ( pObj != NULL ) // ... if pointer is not obviously useless ...
{
for(INT16 i = 0; i < pObj->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
{
FLOAT temperature = (*pObj)[i]->data.bTemperature; // ... get temperature of item ...
FLOAT cooldownfactor = GetItemCooldownFactor(pObj); // ... get cooldown factor ...
FLOAT newtemperature = max(0.0, temperature - cooldownfactor); // ... calculate new temperature ...
(*pObj)[i]->data.bTemperature = newtemperature; // ... set new temperature
#if 0//def JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature );
#endif
// for every objects, we also have to check wether there are weapon attachments (eg. underbarrel grenade launchers), and cool them down too
attachmentList::iterator iterend = (*pObj)[i]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[i]->attachments.begin(); iter != iterend; ++iter)
{
if ( iter->exists() && Item[ iter->usItem ].usItemClass & (IC_LAUNCHER|IC_LAUNCHER) )
{
FLOAT temperature = (*iter)[i]->data.bTemperature; // ... get temperature of item ...
FLOAT cooldownfactor = GetItemCooldownFactor( &(*iter) ); // ... get cooldown factor ...
FLOAT newtemperature = max(0.0, temperature - cooldownfactor); // ... calculate new temperature ...
(*iter)[i]->data.bTemperature = newtemperature; // ... set new temperature
#if 0//def JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature );
#endif
// we assume that there can exist only 1 UGL per weapon
break;
}
}
}
}
}
}
}
// Flugente: determien if we can rest our weapon on something. This can only happen when STANDING/CROUCHED. As a result, we get superior handling modifiers (we apply the PRONE modfiers)
BOOLEAN SOLDIERTYPE::IsWeaponMounted( void )
{
BOOLEAN applybipod = FALSE;
// not possible if already prone
if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_PRONE )
return( FALSE );
BOOLEAN onroof = FALSE;
// not possible to get this bonus on a roof, as there are no objects on the roof on which we could rest our gun
if ( this->pathing.bLevel == 1 )
onroof = TRUE;
// we determine the height of the next tile in our direction. Because of the way structures are handled, we sometimes have to take the very tile we're occupying right now
INT32 nextGridNoinSight = this->sGridNo;
if ( this->ubDirection == NORTH || this->ubDirection == SOUTHWEST || this->ubDirection == WEST || this->ubDirection == NORTHWEST )
nextGridNoinSight = NewGridNo( nextGridNoinSight, DirectionInc( this->ubDirection ) );
INT8 adjacenttileheight = GetTallestStructureHeight( nextGridNoinSight, FALSE );
// if the tile actually has a bit of height, we can rest our gun on it
if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_CROUCH && (adjacenttileheight == 1 || adjacenttileheight == 2 ) )
{
// now we really want to check the next tile
nextGridNoinSight = NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) );
// for some nefarious reason, trees also have height 2, so we have to check for that too...
STRUCTURE * pStructure = FindStructure( nextGridNoinSight, STRUCTURE_TREE );
if (!pStructure)
{
// for some reason I find EXTREMELY FRUSTRATING, we might get a heigth of 2 on a totally empty tile... so we check if we could occupy the tile
if ( !IsLocationSittable( nextGridNoinSight, onroof ) )
// resting our gun on people would be rude - only allow if nobody is there
if( WhoIsThere2( nextGridNoinSight, onroof ) == NOBODY )
applybipod = TRUE;
}
}
else if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_CROUCH && adjacenttileheight == 4)
{
// tile is as high as a building, but there might be a window, we could look through that
// note that we also check for STRUCTURE_OPEN - the window has to be open (smashed)
STRUCTURE * pStructure = FindStructure( nextGridNoinSight, STRUCTURE_WALLNWINDOW );
if ( pStructure )
{
if ( ( this->ubDirection == SOUTH || this->ubDirection == NORTH )
&& (pStructure->ubWallOrientation == OUTSIDE_TOP_LEFT || pStructure->ubWallOrientation == INSIDE_TOP_LEFT )
&& pStructure->fFlags & STRUCTURE_WALLNWINDOW && pStructure->fFlags & STRUCTURE_OPEN )
{
applybipod = TRUE;
}
else if ( ( this->ubDirection == EAST || this->ubDirection == WEST )
&& ( pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT || pStructure->ubWallOrientation == INSIDE_TOP_RIGHT )
&& pStructure->fFlags & STRUCTURE_WALLNWINDOW && pStructure->fFlags & STRUCTURE_OPEN )
{
applybipod = TRUE;
}
else if ( ( this->ubDirection == SOUTHWEST || this->ubDirection == NORTHWEST || this->ubDirection == SOUTHEAST || this->ubDirection == NORTHEAST)
&& (pStructure->ubWallOrientation == OUTSIDE_TOP_LEFT || pStructure->ubWallOrientation == INSIDE_TOP_LEFT || pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT || pStructure->ubWallOrientation == INSIDE_TOP_RIGHT)
&& pStructure->fFlags & STRUCTURE_WALLNWINDOW && pStructure->fFlags & STRUCTURE_OPEN )
{
applybipod = TRUE;
}
}
}
else if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_STAND && adjacenttileheight == 3 )
{
// now we really want to check the next tile
nextGridNoinSight = NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) );
// for some nefarious reason, trees also have height 2, so we have to check for that too...
STRUCTURE * pStructure = FindStructure( nextGridNoinSight, STRUCTURE_TREE );
if (!pStructure)
{
// for some reason I find EXTREMELY FRUSTRATING, we might get a heigth of 2 on a totally empty tile... so we check if we could occupy the tile
if ( !IsLocationSittable( nextGridNoinSight, onroof ) )
// resting our gun on people would be rude - only allow if nobody is there
if( WhoIsThere2( nextGridNoinSight, onroof ) == NOBODY )
applybipod = TRUE;
}
}
return( applybipod );
}
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
{
@@ -14985,6 +15144,8 @@ BOOLEAN ResolvePendingInterrupt( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType )
continue; // not enemy
if ( CONSIDERED_NEUTRAL( pSoldier, pInterrupter ) )
continue; // neutral
if ( CONSIDERED_NEUTRAL( pInterrupter, pSoldier ) )
continue; // neutral
/////////////////////////////////////////////////////////////
// Calculate Reaction Time (i.e. interrupt counter length) //