*** 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
+96 -4
View File
@@ -279,7 +279,7 @@ BOOLEAN HandleAutoBandage( )
// Deque all game events
DequeAllGameEvents( TRUE );
while (DequeueEvent(&InputEvent) == TRUE)
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if ( InputEvent.usEvent == KEY_UP )
{
@@ -1078,6 +1078,45 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// find a free slot
if( iDoctorList[ iCounter ] != -1 )
{
if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
if ((iDoctorList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ))
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else
{
// grab filename of face
if ((iDoctorList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ))
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
/*
if ( ( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if ( ( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
@@ -1088,9 +1127,18 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
*/
// load the face
AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
// AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] ) )
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
}
iNumberOfDoctors++;
}
@@ -1101,6 +1149,43 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// find a free slot
if( iPatientList[ iCounter ] != -1 )
{
if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
if ((iPatientList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ))
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else
{
// grab filename of face
if ((iPatientList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ))
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
/*
if ( ( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if ( ( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
@@ -1111,10 +1196,17 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
*/
// load the face
AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
// AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] ) )
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
}
}
}
+42 -44
View File
@@ -779,7 +779,7 @@ void ChangeStat( MERCPROFILESTRUCT *pProfile, SOLDIERTYPE *pSoldier, UINT8 ubSta
// DEF: 03/06/99 Now sets an event that will be processed later in the day
// ubEmailOffset = MERC_UP_LEVEL_BIFF + MERC_UP_LEVEL_LENGTH_BIFF * ( ubMercMercIdValue );
// AddEmail( ubEmailOffset, MERC_UP_LEVEL_LENGTH_BIFF, SPECK_FROM_MERC, GetWorldTotalMin() );
AddStrategicEvent( EVENT_MERC_MERC_WENT_UP_LEVEL_EMAIL_DELAY, GetWorldTotalMin( ) + 60 + Random( 60 ), ubMercMercIdValue );
fChangeSalary = TRUE;
@@ -1996,57 +1996,55 @@ void MERCMercWentUpALevelSendEmail( UINT8 ubMercMercIdValue )
// Read from EmailMercAvailable.xml
if ( ReadXMLEmail == TRUE )
{
oMerc = ubMercMercIdValue;
iMerc = oMerc * 1;
if ( oMerc != 0 )
pMerc = oMerc + 1;
else
pMerc = 0;
if ( gProfilesMERC[ubMercMercIdValue].ProfilId == ubMercMercIdValue )
AddEmailTypeXML( pMerc, iMerc, iMerc, GetWorldTotalMin(), -1 , TYPE_EMAIL_MERC_LEVEL_UP);
oMerc = ubMercMercIdValue;
iMerc = oMerc * 1;
if ( oMerc != 0 )
pMerc = oMerc + 1;
else
pMerc = 0;
if ( gProfilesMERC[ubMercMercIdValue].ProfilId == ubMercMercIdValue )
AddEmailTypeXML( pMerc, iMerc, iMerc, GetWorldTotalMin(), -1 , TYPE_EMAIL_MERC_LEVEL_UP);
}
else
{
// TODO.RW: This workaround should not be needed anymore, because we now have all the emails externalized to XML files (TableData\Email)
// Read from Email.edt and sender (nickname) from MercProfiles.xml
// WANNE: TODO: Tex, Biggins, Stoggy and Gaston have special handling because they are the new MERC merc in 1.13
// There is no letter template in Email.edt. We have them hardcoded in the source code.
if (ubMercMercIdValue == 124 || ubMercMercIdValue == 125 || ubMercMercIdValue == 126 || ubMercMercIdValue == 127)
// Read from Email.edt and sender (nickname) from MercProfiles.xml
// WANNE: TODO: Tex, Biggins, Stoggy and Gaston have special handling because they are the new MERC merc in 1.13
// There is no letter template in Email.edt. We have them hardcoded in the source code.
if (ubMercMercIdValue == 124 || ubMercMercIdValue == 125 || ubMercMercIdValue == 126 || ubMercMercIdValue == 127)
{
// Gaston
if (ubMercMercIdValue == 124)
{
// Gaston
if (ubMercMercIdValue == 124)
{
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_GASTON;
}
// Stogie
else if (ubMercMercIdValue == 125)
{
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_STOGIE;
}
// Tex
else if (ubMercMercIdValue == 126)
{
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_TEX;
}
// Biggens
else if (ubMercMercIdValue == 127)
{
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_BIGGENS;
}
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_GASTON;
}
else
// Stogie
else if (ubMercMercIdValue == 125)
{
iMsgLength = MERC_UP_LEVEL_LENGTH_BIFF;
ubEmailOffset = MERC_UP_LEVEL_BIFF + MERC_UP_LEVEL_LENGTH_BIFF * ( ubMercMercIdValue );
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_STOGIE;
}
// Tex
else if (ubMercMercIdValue == 126)
{
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_TEX;
}
// Biggens
else if (ubMercMercIdValue == 127)
{
ubEmailOffset = MERC_UP_LEVEL_BIFF;
iMsgLength = MERC_UP_LEVEL_BIGGENS;
}
}
else
{
iMsgLength = MERC_UP_LEVEL_LENGTH_BIFF;
ubEmailOffset = MERC_UP_LEVEL_BIFF + MERC_UP_LEVEL_LENGTH_BIFF * ( ubMercMercIdValue );
}
AddEmail( ubEmailOffset, iMsgLength, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT_NAME_MERC);
AddEmail( ubEmailOffset, iMsgLength, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT_NAME_MERC);
}
#endif
+13 -5
View File
@@ -2222,12 +2222,12 @@ void DisplayTextForExternalNPC( UINT8 ubCharacterNum, STR16 zQuoteStr )
if ( guiCurrentScreen == MAP_SCREEN )
{
sLeft = ( gsExternPanelXPosition + 97 );
sLeft = ( gsExternPanelXPosition + 97 + xResOffset );
gsTopPosition = gsExternPanelYPosition;
}
else
{
sLeft = ( 110 );
sLeft = ( 110 + xResOffset );
}
ExecuteTacticalTextBox( sLeft, gTalkPanel.zQuoteStr );
@@ -2250,8 +2250,16 @@ void HandleTacticalTextUI( INT32 iFaceIndex, SOLDIERTYPE *pSoldier, STR16 zQuote
#else
swprintf( zText, L"\"%s\"", zQuoteStr );
#endif
sLeft = 110;
// TODO.RW: Wenn wir in tactical sind, dann normal. In strategy den offset dazurechnen!
if ( guiCurrentScreen == GAME_SCREEN )
{
sLeft = 110;
}
else
{
sLeft = 110 + xResOffset;
}
//previous version
//sLeft = 110;
@@ -2345,7 +2353,7 @@ void HandleExternNPCSpeechFace( INT32 iIndex )
if ( guiCurrentScreen != MAP_SCREEN )
{
// Setup video overlay!
VideoOverlayDesc.sLeft = 10;
VideoOverlayDesc.sLeft = 10 + xResOffset;
VideoOverlayDesc.sTop = 20;
VideoOverlayDesc.sRight = VideoOverlayDesc.sLeft + 99;
VideoOverlayDesc.sBottom = VideoOverlayDesc.sTop + 98;
@@ -2357,7 +2365,7 @@ void HandleExternNPCSpeechFace( INT32 iIndex )
{
// Setup video overlay!
VideoOverlayDesc.sLeft = gsExternPanelXPosition;
VideoOverlayDesc.sLeft = gsExternPanelXPosition + xResOffset;
VideoOverlayDesc.sTop = gsExternPanelYPosition;
VideoOverlayDesc.sRight = VideoOverlayDesc.sLeft + 99;
+141 -1
View File
@@ -180,6 +180,25 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
// Check if we are a big-face....
if ( uiInitFlags & FACE_BIGFACE )
{
if ( ( iFaceFileID < 100 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\b%02d.sti", iFaceFileID );
}
else if ( ( iFaceFileID > 99 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\b%03d.sti", iFaceFileID );
}
else if( iFaceFileID < 100 )
{
sprintf( VObjectDesc.ImageFile, "FACES\\b%02d.sti", iFaceFileID );
}
else if( iFaceFileID > 99 )
{
sprintf( VObjectDesc.ImageFile, "FACES\\b%03d.sti", iFaceFileID );
}
/*
// The filename is the profile ID!
if( iFaceFileID < 100 )
{
@@ -189,7 +208,7 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
{
sprintf( VObjectDesc.ImageFile, "FACES\\b%03d.sti", iFaceFileID );
}
*/
// ATE: Check for profile - if elliot , use special face :)
if ( usMercProfileID == ELLIOT )
{
@@ -260,6 +279,106 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
if (gGameExternalOptions.fShowCamouflageFaces == TRUE )
{
if ( ( iFaceFileID < 100 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\%02d.sti", iFaceFileID );
if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\WoodCamo\\%02d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\UrbanCamo\\%02d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\DesertCamo\\%02d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\SnowCamo\\%02d.sti", iFaceFileID );
}
if (!FileExists(VObjectDesc.ImageFile))
sprintf( VObjectDesc.ImageFile, "IMPFACES\\%02d.sti", iFaceFileID );
}
else if ( ( iFaceFileID > 99 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\%03d.sti", iFaceFileID );
if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\Woodcamo\\%03d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\UrbanCamo\\%03d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\DesertCamo\\%03d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\SnowCamo\\%03d.sti", iFaceFileID );
}
if (!FileExists(VObjectDesc.ImageFile))
sprintf( VObjectDesc.ImageFile, "IMPFACES\\%03d.sti", iFaceFileID );
}
else if( iFaceFileID < 100 )
{
sprintf( VObjectDesc.ImageFile, "FACES\\%02d.sti", iFaceFileID );
if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\WoodCamo\\%02d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\UrbanCamo\\%02d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\DesertCamo\\%02d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\SnowCamo\\%02d.sti", iFaceFileID );
}
if (!FileExists(VObjectDesc.ImageFile))
sprintf( VObjectDesc.ImageFile, "FACES\\%02d.sti", iFaceFileID );
}
else if( iFaceFileID > 99 )
{
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\Woodcamo\\%03d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\UrbanCamo\\%03d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\DesertCamo\\%03d.sti", iFaceFileID );
}
else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
{
sprintf( VObjectDesc.ImageFile, "FACES\\SnowCamo\\%03d.sti", iFaceFileID );
}
if (!FileExists(VObjectDesc.ImageFile))
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
}
/*
if( iFaceFileID < 100 )
{
// The filename is the profile ID!
@@ -311,9 +430,29 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
}
*/
}
else if (gGameExternalOptions.fShowCamouflageFaces == FALSE )
{
if ( ( iFaceFileID < 100 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\%02d.sti", iFaceFileID );
}
else if ( ( iFaceFileID > 99 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFACES\\%03d.sti", iFaceFileID );
}
else if( iFaceFileID < 100 )
{
sprintf( VObjectDesc.ImageFile, "FACES\\%02d.sti", iFaceFileID );
}
else if( iFaceFileID > 99 )
{
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
}
/*
if( iFaceFileID < 100 )
{
// The filename is the profile ID!
@@ -323,6 +462,7 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
{
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
}
*/
}
}
+5
View File
@@ -2292,6 +2292,11 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
// IF SO, DONT'T ADD!
bTerrainID = GetTerrainType( *psGridNo );
// 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( bTerrainID) && ubLevel > 0 )
bTerrainID = FLAT_GROUND;
if ( TERRAIN_IS_WATER( bTerrainID) )
{
// if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS )
+10 -3
View File
@@ -1002,13 +1002,20 @@ void SetUIMouseCursor( )
if ( fOkForExit )
{
if ( gfUIConfirmExitArrows )
if ( gGameExternalOptions.fGridExitInTurnBased || ( gTacticalStatus.uiFlags & REALTIME ) || !( gTacticalStatus.uiFlags & INCOMBAT ) )
{
guiNewUICursor = CONFIRM_EXIT_GRID_UICURSOR;
if ( gfUIConfirmExitArrows )
{
guiNewUICursor = CONFIRM_EXIT_GRID_UICURSOR;
}
else
{
guiNewUICursor = EXIT_GRID_UICURSOR;
}
}
else
{
guiNewUICursor = EXIT_GRID_UICURSOR;
guiNewUICursor = NOEXIT_GRID_UICURSOR;
}
}
else
File diff suppressed because it is too large Load Diff
+376 -143
View File
@@ -139,6 +139,8 @@ INT16 ITEMDESC_WIDTH;
extern int SM_ITEMDESC_START_X;
extern int SM_ITEMDESC_START_Y;
extern int INV_REGION_Y;
#define CAMO_REGION_HEIGHT 75
#define CAMO_REGION_WIDTH 75
@@ -411,6 +413,8 @@ extern void StartSKIDescriptionBox( void );
void UpdateItemHatches();
void ShadowNIVPanel();
extern void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot );
UINT8 ubRGBItemCyclePlacedItemColors[] =
@@ -523,7 +527,7 @@ INV_DESC_REGIONS gItemDescGenHeaderRegions[3]; // Header text regions for variou
INV_DESC_REGIONS gItemDescGenIndexRegions[3][4]; // Index text regions for various parts of the General Tab
INV_DESC_REGIONS gItemDescGenRegions[NUM_UDB_GEN_LINES * 2][4]; // Data regions, 4 sub-columns each
INV_DESC_REGIONS gItemDescGenSecondaryRegions[26]; // Secondary data regions, 3x5
INV_DESC_REGIONS gItemDescTextRegions[7]; // Main description regions
INV_DESC_REGIONS gItemDescTextRegions[8]; // Main description regions
INV_DESC_REGIONS gItemDescAdvIndexRegions[1][4];
INV_DESC_REGIONS gItemDescAdvRegions[NUM_UDB_ADV_LINES][4]; // Advanced data regions, 4 sub-columns each
@@ -1035,7 +1039,8 @@ void InitInventoryNew()
ResetInvData();
if(iResolution == 0){
if (iResolution >= _640x480 && iResolution < _800x600)
{
InitInvData(gSMInvData[0], FALSE, INV_BAR_DX, INV_BAR_DY, HEAD_INV_SLOT_WIDTH, HEAD_INV_SLOT_HEIGHT, 0, 0); // HELMETPOS
InitInvData(gSMInvData[1], FALSE, INV_BAR_DX, INV_BAR_DY, VEST_INV_SLOT_WIDTH, VEST_INV_SLOT_HEIGHT, 0, 0); // VESTPOS
InitInvData(gSMInvData[2], FALSE, INV_BAR_DX, INV_BAR_DY, LEGS_INV_SLOT_WIDTH, LEGS_INV_SLOT_HEIGHT, 0, 0); // LEGPOS
@@ -1679,14 +1684,14 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
// CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon
if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
{
newX = ((UsingNewInventorySystem() == false)) ? 217 : 114;
newX = ((UsingNewInventorySystem() == false)) ? (xResOffset + 217) : ((SCREEN_WIDTH - xResSize)/2 + 114);
newY = ((UsingNewInventorySystem() == false)) ? sY : (sY - 1);
BltVideoObjectFromIndex( guiSAVEBUFFER, guiSecItemHiddenVO, UsingNewInventorySystem(), newX, newY, VO_BLT_SRCTRANSPARENCY, NULL );
RestoreExternBackgroundRect( newX, newY, 72, 28 );
}
else
{
newX = ((UsingNewInventorySystem() == false)) ? 14 : 6;
{
newX = ((UsingNewInventorySystem() == false)) ? (14 + xResOffset) : (6 + xResOffset);
newY = ((UsingNewInventorySystem() == false)) ? 218 : 217;
BltVideoObjectFromIndex( guiSAVEBUFFER, guiMapInvSecondHandBlockout, UsingNewInventorySystem(), newX, newY, VO_BLT_SRCTRANSPARENCY, NULL );
RestoreExternBackgroundRect( newX, newY, 102, 24 );
@@ -2638,6 +2643,33 @@ void INVRenderSilhouette( UINT32 uiBuffer, INT16 PocketIndex, INT16 SilIndex, IN
}
}
// Flugente FTW 1: Function to get the number of the item condition string
UINT8 GetTemperatureString( FLOAT overheatpercentage, UINT32* apRed, UINT32* apGreen, UINT32* abBlue )
{
*apRed = (UINT32) ( 100 + 155 * ( (max(1.0, overheatpercentage) - 1.0)/(max(1.0, overheatpercentage)) ) );
*apGreen = 0;
*abBlue = 0;
if (overheatpercentage < 0.17) // very low
return 0;
else if (overheatpercentage < 0.33) // low
return 1;
else if (overheatpercentage < 0.5) // medium
return 2;
else if (overheatpercentage < 0.67) // high
return 3;
else if (overheatpercentage < 0.83) // very high
return 4;
else if (overheatpercentage < 1.0) // dangerous
return 5;
else if (overheatpercentage < 2.0) // CRITICAL
return 6;
else // DRAMATIC
return 7;
// Default: unknown
return 8;
}
void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObject, INT16 sX, INT16 sY, INT16 sWidth, INT16 sHeight, UINT8 fDirtyLevel, UINT8 *pubHighlightCounter, UINT8 ubStatusIndex, BOOLEAN fOutline, INT16 sOutlineColor, UINT8 iter )
{
@@ -2743,6 +2775,10 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
sNewY = sY + sHeight - 10;
sNewX = sX + 1;
// Flugente: If we display the thermometer for overheating, move the ammo counter a bit to the right
if ( gGameOptions.fWeaponOverheating == TRUE && gGameExternalOptions.fDisplayOverheatThermometer == TRUE )
sNewX = sX + 6;
SetFontForeground ( AmmoTypes[(*pObject)[iter]->data.gun.ubGunAmmoType].fontColour );
//switch ((*pObject)[iter]->data.gun.ubGunAmmoType)
//{
@@ -2790,6 +2826,8 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
sNewX = sX + 1;
SetFontForeground( FONT_MCOLOR_DKGRAY );
// Display 'JAMMED' if we are jammed
@@ -2866,7 +2904,41 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
}
// Flugente FTW 1
if ( gGameOptions.fWeaponOverheating == TRUE && gGameExternalOptions.fDisplayOverheatThermometer == TRUE && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || Item[pObject->usItem].barrel == TRUE ) )
{
FLOAT overheatjampercentage = GetGunOverheatJamPercentage( pObject);
UINT32 red, green, blue;
UINT8 TemperatureStringNum = GetTemperatureString( overheatjampercentage, &red, &green, &blue );
UINT16 colour = Get16BPPColor( FROMRGB( red, green, blue ) );
DrawItemUIBarEx( pObject, DRAW_ITEM_TEMPERATURE, sX, sY + sHeight-1, ITEMDESC_ITEM_STATUS_WIDTH, sHeight-1, colour, colour, TRUE, guiSAVEBUFFER );
}
// display symbol if we are leaning our weapon on something
// display only if eapon resting is allowed, display is allowed, item is a gun/launcher, we are a person, we hold the gun in our hand, and we are resting the gun
if ( gGameExternalOptions.fWeaponResting && gGameExternalOptions.fDisplayWeaponRestingIndicator && pItem->usItemClass & (IC_GUN | IC_LAUNCHER) && pSoldier && pSoldier->bActive && pSoldier->bInSector && &(pSoldier->inv[pSoldier->ubAttackingHand]) == pObject && pSoldier->IsWeaponMounted() )
{
SetRGBFontForeground( 95, 160, 154 );
sNewY = sY + sHeight - 24;
swprintf( pStr, L"M" );
// Get length of string
uiStringLength=StringPixLength(pStr, ITEM_FONT );
sNewX = sX + 25;
if ( uiBuffer == guiSAVEBUFFER )
{
RestoreExternBackgroundRect( sNewX, sNewY, 15, 15 );
}
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
}
if((UsingNewInventorySystem() == true))
@@ -3085,7 +3157,7 @@ void InitItemDescriptionBoxStartCoords( BOOLEAN fIsEnhanced, BOOLEAN fUsingNAS )
if(fUsingNAS){
if( UsingNewInventorySystem() == true ) // NIV
{
ITEMDESC_START_X = 115;
ITEMDESC_START_X = INTERFACE_START_X + 115;
ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
ITEMDESC_HEIGHT = 195;
ITEMDESC_WIDTH = 335;
@@ -3094,53 +3166,46 @@ void InitItemDescriptionBoxStartCoords( BOOLEAN fIsEnhanced, BOOLEAN fUsingNAS )
{
ITEMDESC_HEIGHT = 193;
ITEMDESC_WIDTH = 430;
ITEMDESC_START_X = 214;
ITEMDESC_START_X = INTERFACE_START_X + 214;
ITEMDESC_START_Y = (1-(ITEMDESC_HEIGHT-INV_INTERFACE_HEIGHT) + INV_INTERFACE_START_Y);
}
if(UsingNewInventorySystem() == true && (guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == SHOPKEEPER_SCREEN))
{
if(iResolution == 0)
if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_WIDTH = 526;
else if(iResolution == 1)
else if (iResolution < _1024x768)
ITEMDESC_WIDTH = 686;
else if(iResolution == 2)
else
ITEMDESC_WIDTH = 910;
}
//CHRISL: This allows EDB to work in Strategic OIV mode
if(guiCurrentScreen == MAP_SCREEN)
{
if(iResolution == 0) // 640x480 res
if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_HEIGHT = 268;
else if(iResolution == 2 || UsingNewInventorySystem() == true) // 1024x768 or NIV
else if(iResolution >= _1024x768 || UsingNewInventorySystem() == true) // 1024x768 or NIV
ITEMDESC_HEIGHT = 490;
else if(iResolution == 1) // 800x600
else if (iResolution < _1024x768)
ITEMDESC_HEIGHT = (mode > 0) ? 490 : 373;
ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution != 0)) ? 272 : 272;
ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution >= _800x600)) ? 272 : 272;
}
} else {
}
else
{
if( UsingNewInventorySystem() == true ) // ODB/NIV
{
//if (guiCurrentItemDescriptionScreen != SHOPKEEPER_SCREEN)
{
// HEADROCK HAM 4:
ITEMDESC_START_X = 115;
ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
ITEMDESC_HEIGHT = 195;
ITEMDESC_WIDTH = 335; // OIV only
}
//else
//{
// ITEMDESC_START_X = 259;
// ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
// ITEMDESC_HEIGHT = guiCurrentItemDescriptionScreen == SHOPKEEPER_SCREEN ? 133 : 195;
// ITEMDESC_WIDTH = 320; // OIV only
//}
// HEADROCK HAM 4:
ITEMDESC_START_X = INTERFACE_START_X + 115;
ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
ITEMDESC_HEIGHT = 195;
ITEMDESC_WIDTH = 335; // OIV only
}
else // ODB/OIV
{
ITEMDESC_START_X = 214;
ITEMDESC_START_X = INTERFACE_START_X + 214;
ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
ITEMDESC_HEIGHT = 133;
ITEMDESC_WIDTH = 320; // OIV only
@@ -3148,24 +3213,25 @@ void InitItemDescriptionBoxStartCoords( BOOLEAN fIsEnhanced, BOOLEAN fUsingNAS )
if(UsingNewInventorySystem() == true && guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == SHOPKEEPER_SCREEN)
{
if(iResolution == 0)
if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_WIDTH = 526;
else if(iResolution == 1)
else if (iResolution < _1024x768)
ITEMDESC_WIDTH = 686;
else if(iResolution == 2)
else
ITEMDESC_WIDTH = 910;
}
//CHRISL: This allows EDB to work in Strategic OIV mode
if(guiCurrentScreen == MAP_SCREEN)
{
if(iResolution == 0) // 640x480 res
if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_HEIGHT = 268;
else if(iResolution == 2 || UsingNewInventorySystem() == true) // 1024x768 or NIV
else if(iResolution >= _1024x768 || UsingNewInventorySystem() == true) // 1024x768 or NIV
ITEMDESC_HEIGHT = 490;
else if(iResolution == 1) // 800x600
else if (iResolution < _1024x768)
ITEMDESC_HEIGHT = 373;
ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution != 0)) ? 272 : 272;
ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution >= _800x600)) ? 272 : 272;
}
}
}
@@ -4002,7 +4068,7 @@ void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason)
gfItemAmmoDown = FALSE;
//CHRISL: We dont' want to be able to reload guns using the ammo crate from this function
if(gpItemPointer != NULL && Item[gpItemPointer->usItem].ammocrate)
if(gpItemPointer != NULL && Magazine[Item[gpItemPointer->usItem].ubClassIndex].ubMagType >= AMMO_BOX)
{
fInterfacePanelDirty = DIRTYLEVEL2;
btn->uiFlags &= (~BUTTON_CLICKED_ON );
@@ -4378,60 +4444,6 @@ void ItemDescAttachmentsCallback( MOUSE_REGION * pRegion, INT32 iReason )
}
}
/*INT8 DetermineShowBox( )
INT8 DetermineShowBox( )
{
if(gpItemDescObject == NULL)
return 0;
if(iResolution == 0)
return 0;
else if(UsingNewInventorySystem() == false) //OIV
{
if (UsingEDBSystem() == 2)
{
if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_EXPLOSV|IC_AMMO|IC_ARMOUR|IC_PUNCH) && UsingEDBSystem() > 0 )
return(UsingNewAttachmentSystem()==true ? 8 : 6);
else
return(UsingNewAttachmentSystem()==true ? 9 : 7);
}
else if (guiCurrentItemDescriptionScreen == MAP_SCREEN)
{
if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_EXPLOSV|IC_AMMO|IC_ARMOUR|IC_PUNCH) && UsingEDBSystem() > 0 )
return(UsingNewAttachmentSystem()==true ? 7 : 6);
else
if(UsingEDBSystem() > 0)
return(UsingNewAttachmentSystem()==true ? 8 : 1);
else
return(UsingNewAttachmentSystem()==true ? 6 : 1);
}
else
return(UsingNewAttachmentSystem()==true ? 5 : 0);
}
else if(UsingNewInventorySystem() == true) //NIV
{
if(gpItemDescObject->IsActiveLBE(gubItemDescStatusIndex))
return (gpItemDescObject->GetLBEPointer(gubItemDescStatusIndex)->lbeClass + (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 1 : 0));
else if(Item[gpItemDescObject->usItem].usItemClass == IC_LBEGEAR)
return (LoadBearingEquipment[Item[gpItemDescObject->usItem].ubClassIndex].lbeClass + (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 1 : 0));
else if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_EXPLOSV|IC_AMMO|IC_ARMOUR|IC_PUNCH) && UsingEDBSystem() > 0 ){
if(UsingNewAttachmentSystem()==true)
return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 7 : 8);
else
return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 6 : 5);
}else{
if(UsingNewAttachmentSystem()==true && UsingEDBSystem() > 0 && Item[gpItemDescObject->usItem].usItemClass != IC_MONEY)
return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 8 : 9);
else if(UsingNewAttachmentSystem()==true && Item[gpItemDescObject->usItem].usItemClass != IC_MONEY)
return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 6 : 5);
else
return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 1 : 0);
}
}
return 0;
}*/
INT8 DetermineShowBox( )
{
INT8 bShowBox = 0;
@@ -4441,7 +4453,7 @@ INT8 DetermineShowBox( )
if(gpItemDescObject == NULL)
return 0;
if(iResolution == 0)
if (iResolution >= _640x480 && iResolution < _800x600)
return 0;
if(UsingEDBSystem() <= 0)
@@ -4593,7 +4605,7 @@ INT8 DetermineShowLBE( )
if(gpItemDescObject == NULL)
return -1;
if(iResolution == 0)
if (iResolution >= _640x480 && iResolution < _800x600)
return -1;
if(!UsingNewInventorySystem())
@@ -4731,7 +4743,18 @@ void RenderItemDescriptionBox( )
else
{
if(guiItemDescBoxBackground != 0)
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, iResolution, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
{
if (iResolution >= _640x480 && iResolution < _800x600)
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, 0, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else if (iResolution < _1024x768)
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, 1, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, 2, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
// WANNE: Yes here we want to overlay image!
//ShadowNIVPanel();
}
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBox, showBox, gsInvDescX, gsInvDescY, VO_BLT_SRCTRANSPARENCY, NULL );
}
@@ -4844,6 +4867,18 @@ void RenderItemDescriptionBox( )
sCenX = sCenX + gItemDescAttachmentsXY[cnt].sBarDx;
sCenY = sCenY + gItemDescAttachmentsXY[cnt].sBarDy;
DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex );
if ( gGameOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[ (iter)->usItem ].barrel == TRUE) ) // Flugente FTW 1.1
{
FLOAT overheatjampercentage = GetGunOverheatJamPercentage( &(*iter));
UINT32 red, green, blue;
UINT8 TemperatureStringNum = GetTemperatureString( overheatjampercentage, &red, &green, &blue );
UINT16 colour = Get16BPPColor( FROMRGB( red, green, blue ) );
DrawItemUIBarEx( &(*iter), DRAW_ITEM_TEMPERATURE, sCenX+4, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, colour, colour, TRUE, guiSAVEBUFFER );
}
}
}
@@ -4998,6 +5033,43 @@ void RenderItemDescriptionBox( )
////////// label
if (UsingEDBSystem())
{
// Flugente FTW 1: display temperature string
if ( gGameOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].barrel == TRUE ) )
{
// UDB system displays a string with colored condition text.
int regionindex = 7;
SetFontForeground( ForegroundColor );
swprintf( pStr, L"%s", gTemperatureDesc[0] ); // "Temperature is "
mprintf( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, pStr );
// Record length
INT16 indent = StringPixLength( gTemperatureDesc[0], ITEMDESC_FONT );
FLOAT overheatjampercentage = GetGunOverheatJamPercentage( gpItemDescObject);
UINT32 red, green, blue;
UINT8 TemperatureStringNum = GetTemperatureString( overheatjampercentage, &red, &green, &blue );
swprintf( pStr, L"%s", gTemperatureDesc[TemperatureStringNum+1 ] );
// text is coloured only in case of danger
if ( overheatjampercentage >= 1.0 )
SetRGBFontForeground( red, green, blue );
mprintf( gItemDescTextRegions[regionindex].sLeft+indent+2, gItemDescTextRegions[regionindex].sTop, pStr );
// Record length
indent += StringPixLength( gTemperatureDesc[TemperatureStringNum + 1], ITEMDESC_FONT );
SetFontForeground( ForegroundColor );
swprintf( pStr, L"%s", gTemperatureDesc[10] ); // "."
mprintf( gItemDescTextRegions[regionindex].sLeft + indent + 2, gItemDescTextRegions[regionindex].sTop, pStr );
// to get the text to the left side...
swprintf( pStr, L"");
FindFontRightCoordinates( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, gItemDescTextRegions[regionindex].sRight - gItemDescTextRegions[regionindex].sLeft ,gItemDescTextRegions[regionindex].sBottom - gItemDescTextRegions[regionindex].sTop ,pStr, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY, pStr );
}
// UDB system displays a string with colored condition text.
SetFontForeground( ForegroundColor );
swprintf( pStr, L"%s", gConditionDesc[0] ); // "In "
@@ -5508,7 +5580,7 @@ void RenderLBENODEItems( OBJECTTYPE *pObj, int subObject )
int usX, usY;
// Start by verifying that this item is an LBENODE
if(Item[pObj->usItem].usItemClass != IC_LBEGEAR || iResolution == 0)
if(Item[pObj->usItem].usItemClass != IC_LBEGEAR || (iResolution >= _640x480 && iResolution < _800x600))
return;
// Set selected merc
@@ -7058,7 +7130,8 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
INT16 sItemWidth = 0;
static CHAR16 pStr[ 512 ];
//sOffSetX = xResOffset;
RenderBackpackButtons(DEACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
if( guiCurrentScreen == MAP_SCREEN )
{
@@ -7071,7 +7144,7 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
}
// Set some globals
gsItemPopupInvX = sInvX;
gsItemPopupInvX = sInvX + xResOffset;
gsItemPopupInvY = sInvY;
gsItemPopupInvWidth = sInvWidth;
gsItemPopupInvHeight = sInvHeight;
@@ -7094,14 +7167,14 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
strcpy( VObjectDesc.ImageFile, "INTERFACE\\extra_inventory.STI" );
CHECKF( AddVideoObject( &VObjectDesc, &guiItemPopupBoxes) );
if(UsingNewInventorySystem() == true)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
strcpy( VObjectDesc.ImageFile, "INTERFACE\\infobox_background.sti" );
CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );
}
else
guiItemDescBoxBackground = 0;
//if(UsingNewInventorySystem() == true)
//{
// /*VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// strcpy( VObjectDesc.ImageFile, "INTERFACE\\infobox_background.sti" );
// CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );*/
//}
//else
// guiItemDescBoxBackground = 0;
// Get size
GetVideoObject( &hVObject, guiItemPopupBoxes );
@@ -7205,7 +7278,7 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
gfInItemStackPopup = TRUE;
//Reserict mouse cursor to panel
aRect.iLeft = sInvX + sOffSetX;
aRect.iLeft = sInvX + xResOffset;
aRect.iTop = sInvY + sOffSetY;
aRect.iRight = aRect.iLeft + sItemWidth * usPopupWidth;
aRect.iBottom = aRect.iTop + (INT32)(ceil((float)cnt/(float)sItemWidth)+1) * usPopupHeight;
@@ -7227,9 +7300,39 @@ void EndItemStackPopupWithItemInHand( )
}
}
void ShadowNIVPanel()
{
// WANNE: Instead of blitting the sti overlap interface, shade the inventory. Looks much better and is the same than in OIV
UINT16 startX1, startX2, startX3;
UINT16 startY1, startY2, startY3;
UINT16 endX1, endX2, endX3;
UINT16 endY1, endY2, endY3;
// First rectangle
startX1 = gsItemPopupInvX;
startY1 = gsItemPopupInvY;
endX1 = SCREEN_WIDTH - xResOffset;
endY1 = startY1 + 109;
ShadowVideoSurfaceRect( FRAME_BUFFER, startX1, startY1, endX1 , endY1 );
// Second rectangle
startX2 = startX1;
startY2 = endY1;
endX2 = SCREEN_WIDTH - xResOffset - 155;
endY2 = SCREEN_HEIGHT;
ShadowVideoSurfaceRect( FRAME_BUFFER, startX2, startY2, endX2 , endY2 );
// Third rectangle
startX3 = startX1 - 140;
startY3 = startY1 + 65;
endX3 = startX3 + 140;
endY3 = SCREEN_HEIGHT;
ShadowVideoSurfaceRect( FRAME_BUFFER, startX3, startY3, endX3 , endY3 );
}
void RenderItemStackPopup( BOOLEAN fFullRender )
{
ETRLEObject *pTrav;
ETRLEObject *pTrav;
UINT32 usHeight, usWidth;
HVOBJECT hVObject;
UINT32 cnt;
@@ -7261,8 +7364,20 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
{
if(UsingNewInventorySystem() == false || guiCurrentScreen == MAP_SCREEN)
ShadowVideoSurfaceRect( FRAME_BUFFER, gsItemPopupInvX, gsItemPopupInvY, gsItemPopupInvX + gsItemPopupInvWidth , gsItemPopupInvY + gsItemPopupInvHeight );
else if(UsingNewInventorySystem() == true && iResolution != 0 && guiItemDescBoxBackground != 0 && guiCurrentScreen != MAP_SCREEN)
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, iResolution, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else if(UsingNewInventorySystem() == true && iResolution >= _800x600 /* && guiItemDescBoxBackground != 0 */ && guiCurrentScreen != MAP_SCREEN)
{
ShadowNIVPanel();
/*
if(iResolution >= _640x480 && iResolution < _800x600)
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 0, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else if (iResolution < _1024x768)
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 1, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 2, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
*/
}
}
}
@@ -7294,7 +7409,7 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
sItemWidth -= 1;
usWidth = 58;
sWidth = 43;
image = 1;
image = 1;
}
}
@@ -7305,9 +7420,9 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
sX = (INT16)(gsItemPopupX + ( cnt % sItemWidth * usWidth ));
sY = (INT16)(gsItemPopupY + sOffSetY + ( cnt / sItemWidth * usHeight ));
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemPopupBoxes, image, (INT16)sX, ( INT16 )sY, VO_BLT_SRCTRANSPARENCY, NULL );
if ( cnt < gpItemPopupObject->ubNumberOfObjects )
{
{
// CHRISL: Coord updates to work with mutliple rows
//sX = (INT16)(gsItemPopupX + ( cnt * usWidth ) + 11);
//sY = (INT16)( gsItemPopupY + 3 );
@@ -7324,7 +7439,7 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
}
//RestoreExternBackgroundRect( gsItemPopupInvX, gsItemPopupInvY, gsItemPopupInvWidth, gsItemPopupInvHeight );
InvalidateRegion( gsItemPopupInvX, gsItemPopupInvY, gsItemPopupInvX + gsItemPopupInvWidth, gsItemPopupInvY + gsItemPopupInvHeight );
InvalidateRegion( gsItemPopupInvX, INV_REGION_Y, gsItemPopupInvX + gsItemPopupInvWidth, INV_REGION_Y + gsItemPopupInvHeight );
}
@@ -7387,16 +7502,16 @@ BOOLEAN InitKeyRingPopup( SOLDIERTYPE *pSoldier, INT16 sInvX, INT16 sInvY, INT16
RenderBackpackButtons(DEACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
if( guiCurrentScreen == MAP_SCREEN )
{
gsKeyRingPopupInvX = 0;
sKeyRingItemWidth = MAP_KEY_RING_ROW_WIDTH;
gsKeyRingPopupInvX = xResOffset;
sKeyRingItemWidth = MAP_KEY_RING_ROW_WIDTH;
sOffSetX = 40;
sOffSetY = 15;
}
else
{
// Set some globals
gsKeyRingPopupInvX = sInvX + TACTICAL_INVENTORY_KEYRING_GRAPHIC_OFFSET_X;
sKeyRingItemWidth = KEY_RING_ROW_WIDTH;
// Set some globals
gsKeyRingPopupInvX = xResOffset + sInvX + TACTICAL_INVENTORY_KEYRING_GRAPHIC_OFFSET_X;
sKeyRingItemWidth = KEY_RING_ROW_WIDTH;
sOffSetY = 8;
}
@@ -7413,9 +7528,9 @@ BOOLEAN InitKeyRingPopup( SOLDIERTYPE *pSoldier, INT16 sInvX, INT16 sInvY, INT16
if(UsingNewInventorySystem() == true)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
/*VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
strcpy( VObjectDesc.ImageFile, "INTERFACE\\infobox_background.sti" );
CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );
CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );*/
}
else
guiItemDescBoxBackground = 0;
@@ -7513,10 +7628,20 @@ void RenderKeyRingPopup( BOOLEAN fFullRender )
{
if(UsingNewInventorySystem() == false || guiCurrentScreen == MAP_SCREEN)
ShadowVideoSurfaceRect( FRAME_BUFFER, 0, gsKeyRingPopupInvY, gsKeyRingPopupInvX + gsKeyRingPopupInvWidth , gsKeyRingPopupInvY + gsKeyRingPopupInvHeight );
else if(UsingNewInventorySystem() == true && iResolution != 0 && guiItemDescBoxBackground != 0 && guiCurrentScreen != MAP_SCREEN)
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, iResolution, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
}
else if(UsingNewInventorySystem() == true && iResolution >= _800x600 /* && guiItemDescBoxBackground != 0 */ && guiCurrentScreen != MAP_SCREEN)
{
ShadowNIVPanel();
/*
if (iResolution >= _640x480 && iResolution < _800x600)
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 0, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else if (iResolution < _1024x768)
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 1, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
else
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 2, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
*/
}
}
}
gTempObject.usItem = KEY_1;
@@ -7626,11 +7751,42 @@ UINT32 GetInterfaceGraphicForItem( INVTYPE *pItem )
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP2ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP2ITEMS,
L"Failed to retrieve P2 item image" );
}
else
else if ( pItem->ubGraphicType == 3 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP3ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP3ITEMS,
L"Failed to retrieve P3 item image" );
}
//MM: New item tileslots start here
else if ( pItem->ubGraphicType == 4 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP4ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP4ITEMS,
L"Failed to retrieve P4 item image" );
}
else if ( pItem->ubGraphicType == 5 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP5ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP5ITEMS,
L"Failed to retrieve P5 item image" );
}
else if ( pItem->ubGraphicType == 6 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP6ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP6ITEMS,
L"Failed to retrieve P6 item image" );
}
else if ( pItem->ubGraphicType == 7 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP7ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP7ITEMS,
L"Failed to retrieve P7 item image" );
}
else if ( pItem->ubGraphicType == 8 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP8ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP8ITEMS,
L"Failed to retrieve P8 item image" );
}
else
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP9ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP9ITEMS,
L"Failed to retrieve P9 item image" );
}
return id;
}
@@ -7654,10 +7810,35 @@ UINT16 GetTileGraphicForItem( INVTYPE *pItem )
{
GetTileIndexFromTypeSubIndex( P2ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else
else if ( pItem->ubGraphicType == 3 )
{
GetTileIndexFromTypeSubIndex( P3ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
//MM: New item tileslots start here
else if ( pItem->ubGraphicType == 4 )
{
GetTileIndexFromTypeSubIndex( P4ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 5 )
{
GetTileIndexFromTypeSubIndex( P5ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 6 )
{
GetTileIndexFromTypeSubIndex( P6ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 7 )
{
GetTileIndexFromTypeSubIndex( P7ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else if ( pItem->ubGraphicType == 8 )
{
GetTileIndexFromTypeSubIndex( P8ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
else
{
GetTileIndexFromTypeSubIndex( P9ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
if ( pItem->ubClassIndex >= M900 )
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("GetTileGraphicForItem: db index %d",usIndex));
@@ -7715,22 +7896,7 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo )
sprintf( zName, "p2item%d", ubGraphic );
}
}
/*
#ifdef JA2UB
else if ( pItem->ubGraphicType == 9 ) // UB Items
{
if ( ubGraphic < 10 )
{
sprintf( zName, "GUN_UB0%d", ubGraphic );
}
else
{
sprintf( zName, "GUN_UB%d", ubGraphic );
}
}
#endif
*/
else
else if ( pItem->ubGraphicType == 3 )
{
if ( ubGraphic < 10 )
{
@@ -7741,6 +7907,73 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo )
sprintf( zName, "p3item%d", ubGraphic );
}
}
//MM: New item tileslots start here
else if ( pItem->ubGraphicType == 4 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p4item0%d", ubGraphic );
}
else
{
sprintf( zName, "p4item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 5 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p5item0%d", ubGraphic );
}
else
{
sprintf( zName, "p5item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 6 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p6item0%d", ubGraphic );
}
else
{
sprintf( zName, "p6item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 7 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p7item0%d", ubGraphic );
}
else
{
sprintf( zName, "p7item%d", ubGraphic );
}
}
else if ( pItem->ubGraphicType == 8 )
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p8item0%d", ubGraphic );
}
else
{
sprintf( zName, "p8item%d", ubGraphic );
}
}
else
{
if ( ubGraphic < 10 )
{
sprintf( zName, "p9item0%d", ubGraphic );
}
else
{
sprintf( zName, "p9item%d", ubGraphic );
}
}
//Load item
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+2 -2
View File
@@ -20,7 +20,7 @@
#define HEAD_INV_SLOT_HEIGHT 24
#define NUM_UDB_GEN_LINES 12
#define NUM_UDB_ADV_LINES 12
#define NUM_UDB_ADV_LINES 13 // Flugente FTW 1.1: 12->13
// HEADROCK HAM 4: These rectangle definitions are used in UDB to determine locations for icons, data, and tooltip
// regions. They replace the plethora of region data provided in EDB.
@@ -37,7 +37,7 @@ extern INV_DESC_REGIONS gItemDescGenHeaderRegions[3]; // Header text regions for
extern INV_DESC_REGIONS gItemDescGenIndexRegions[3][4]; // Index text regions for various parts of the General Tab
extern INV_DESC_REGIONS gItemDescGenRegions[NUM_UDB_GEN_LINES * 2][4]; // Data regions, 4 sub-columns each
extern INV_DESC_REGIONS gItemDescGenSecondaryRegions[26]; // Secondary data regions, 3x5 for now (possible 3x6?)
extern INV_DESC_REGIONS gItemDescTextRegions[7]; // Main description regions
extern INV_DESC_REGIONS gItemDescTextRegions[8]; // Main description regions
extern INV_DESC_REGIONS gItemDescAdvIndexRegions[1][4];
extern INV_DESC_REGIONS gItemDescAdvRegions[NUM_UDB_ADV_LINES][4]; // Advanced data regions, 4 sub-columns each
+250 -76
View File
@@ -1404,10 +1404,16 @@ UINT16 GetSMPanelCurrentMerc( )
// CHRISL: New functions to define initial settings for New Inventory system
void InitNewInventorySystem( )
{
INTERFACE_WIDTH = 640;
if (iResolution >= _640x480 && iResolution < _800x600)
INTERFACE_WIDTH = 640;
else if (iResolution < _1024x768)
INTERFACE_WIDTH = 800;
else
INTERFACE_WIDTH = 1024;
INTERFACE_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2;
INTERFACE_HEIGHT = 120;
INV_INTERFACE_HEIGHT = 200;
INTERFACE_START_X = 0;
INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
}
@@ -1415,10 +1421,16 @@ void InitNewInventorySystem( )
// CHRISL: New functions to define initial settings for Old Inventory system
void InitOldInventorySystem( )
{
INTERFACE_WIDTH = 640;
if (iResolution >= _640x480 && iResolution < _800x600)
INTERFACE_WIDTH = 640;
else if (iResolution < _1024x768)
INTERFACE_WIDTH = 800;
else
INTERFACE_WIDTH = 1024;
INTERFACE_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2;
INTERFACE_HEIGHT = 120;
INV_INTERFACE_HEIGHT = 140;
INTERFACE_START_X = 0;
INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
}
@@ -1532,9 +1544,12 @@ BOOLEAN InitializeSMPanelCoordsOld()
SM_STEALTHMODE_X = ( 187 + INTERFACE_START_X );
SM_STEALTHMODE_Y = ( 73 + INV_INTERFACE_START_Y );
SM_DONE_X = (SCREEN_WIDTH - 97);//( 543 + INTERFACE_START_X );
SM_DONE_X = xResOffset + (xResSize - 97);
SM_MAPSCREEN_X = xResOffset + (xResSize - 51);
INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
LOCATION_NAME_X = xResOffset + (xResSize - 92);
SM_DONE_Y = ( 4 + INV_INTERFACE_START_Y );
SM_MAPSCREEN_X = (SCREEN_WIDTH - 51);//( 589 + INTERFACE_START_X );
SM_MAPSCREEN_Y = ( 4 + INV_INTERFACE_START_Y );
SM_POSITIONB_X = ( 106 + INTERFACE_START_X );
@@ -1598,13 +1613,11 @@ BOOLEAN InitializeSMPanelCoordsOld()
STATS_TEXT_FONT_COLOR = 5;
// ow and te clock and location i will put it here
INTERFACE_CLOCK_X = (SCREEN_WIDTH - 86); //( 554 + INTERFACE_START_X );
INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
LOCATION_NAME_X = (SCREEN_WIDTH - 92); //( 548 + INTERFACE_START_X );
LOCATION_NAME_Y = ( 65 + INTERFACE_START_Y );
// Keyring
KEYRING_X = 494; //487;
// Keyring
KEYRING_X = xResOffset + 494;
KEYRING_Y = (105 + INV_INTERFACE_START_Y);
// so we got everything "dynamic" now we just return TRUE
@@ -1623,7 +1636,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
to allow the new inventory interface to function properly. Also altered many of the interface coords
so that the new interface would line up correctly.*/
// Inventory slots
if(iResolution == 0){
if (iResolution >= _640x480 && iResolution < _800x600)
{
gSMInvPocketXY[0].sX = INTERFACE_START_X + 239; gSMInvPocketXY[0].sY = INV_INTERFACE_START_Y + 68; // HELMETPOS
gSMInvPocketXY[1].sX = INTERFACE_START_X + 239; gSMInvPocketXY[1].sY = INV_INTERFACE_START_Y + 96; // VESTPOS
gSMInvPocketXY[2].sX = INTERFACE_START_X + 239; gSMInvPocketXY[2].sY = INV_INTERFACE_START_Y + 157; // LEGPOS
@@ -1680,7 +1694,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
gSMInvPocketXY[53].sX = INTERFACE_START_X + 559; gSMInvPocketXY[53].sY = INV_INTERFACE_START_Y + 58; // SMALLPOCK29
gSMInvPocketXY[54].sX = INTERFACE_START_X + 559; gSMInvPocketXY[54].sY = INV_INTERFACE_START_Y + 82; // SMALLPOCK30
}
else if(iResolution == 1){
else if (iResolution < _1024x768)
{
gSMInvPocketXY[0].sX = INTERFACE_START_X + 258; gSMInvPocketXY[0].sY = INV_INTERFACE_START_Y + 68; // HELMETPOS
gSMInvPocketXY[1].sX = INTERFACE_START_X + 258; gSMInvPocketXY[1].sY = INV_INTERFACE_START_Y + 97; // VESTPOS
gSMInvPocketXY[2].sX = INTERFACE_START_X + 258; gSMInvPocketXY[2].sY = INV_INTERFACE_START_Y + 157; // LEGPOS
@@ -1737,7 +1752,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
gSMInvPocketXY[53].sX = INTERFACE_START_X + 693; gSMInvPocketXY[53].sY = INV_INTERFACE_START_Y + 58; // SMALLPOCK29
gSMInvPocketXY[54].sX = INTERFACE_START_X + 693; gSMInvPocketXY[54].sY = INV_INTERFACE_START_Y + 82; // SMALLPOCK30
}
else if(iResolution == 2){
else
{
//1024x768 resolution
gSMInvPocketXY[0].sX = INTERFACE_START_X + 258; gSMInvPocketXY[0].sY = INV_INTERFACE_START_Y + 68; // HELMETPOS
gSMInvPocketXY[1].sX = INTERFACE_START_X + 258; gSMInvPocketXY[1].sY = INV_INTERFACE_START_Y + 97; // VESTPOS
@@ -1841,11 +1857,13 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_SELMERC_PLATE_HEIGHT = 65;
SM_SELMERC_PLATE_WIDTH = 83;
if(iResolution == 0){
if (iResolution >= _640x480 && iResolution < _800x600)
{
SM_BODYINV_X = ( 141 + INTERFACE_START_X );
SM_BODYINV_Y = ( 68 + INV_INTERFACE_START_Y );
}
else{
else
{
SM_BODYINV_X = ( 151 + INTERFACE_START_X );
SM_BODYINV_Y = ( 68 + INV_INTERFACE_START_Y );
}
@@ -1879,24 +1897,18 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_NEXTMERCB_Y = ( 130 + INV_INTERFACE_START_Y );
SM_OPTIONSB_X = ( 10 + INTERFACE_START_X );
SM_OPTIONSB_Y = ( 165 + INV_INTERFACE_START_Y );
// CHRISL: Backpack buttons
if(iResolution == 0){
SM_DROPPACK_X = ( 504 + INTERFACE_START_X );
SM_DROPPACK_Y = ( 39 + INV_INTERFACE_START_Y );
SM_ZIPPER_X = ( 482 + INTERFACE_START_X );
SM_ZIPPER_Y = ( 39 + INV_INTERFACE_START_Y );
}
else{
SM_DROPPACK_X = ( 612 + INTERFACE_START_X );
SM_DROPPACK_Y = ( 39 + INV_INTERFACE_START_Y );
SM_ZIPPER_X = ( 590 + INTERFACE_START_X );
SM_ZIPPER_Y = ( 39 + INV_INTERFACE_START_Y );
}
SM_DROPPACK_X = ( 612 + INTERFACE_START_X );
SM_DROPPACK_Y = ( 39 + INV_INTERFACE_START_Y );
SM_ZIPPER_X = ( 590 + INTERFACE_START_X );
SM_ZIPPER_Y = ( 39 + INV_INTERFACE_START_Y );
SM_MAPSCREEN_X = xResOffset + (xResSize - 146); // 152
SM_DONE_X = xResOffset + (xResSize - 146); // 152
INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
LOCATION_NAME_X = xResOffset + (xResSize - 92);
// WANNE 2
SM_DONE_X = (SCREEN_WIDTH - 146); // 152
SM_DONE_Y = ( 118 + INV_INTERFACE_START_Y );
SM_MAPSCREEN_X = (SCREEN_WIDTH - 146); // 152
SM_MAPSCREEN_Y = ( 140 + INV_INTERFACE_START_Y );
SM_POSITIONB_X = ( 106 + INTERFACE_START_X );
@@ -1907,7 +1919,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_PERCENT_WIDTH = 20;
SM_PERCENT_HEIGHT = 10;
if(iResolution == 0){
if (iResolution >= _640x480 && iResolution < _800x600)
{
SM_ARMOR_X = ( 245 + INTERFACE_START_X );
SM_ARMOR_Y = ( 141 + INV_INTERFACE_START_Y );
SM_ARMOR_LABEL_X = ( 260 + INTERFACE_START_X );
@@ -1915,7 +1928,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_ARMOR_PERCENT_X = ( 265 + INTERFACE_START_X );
SM_ARMOR_PERCENT_Y = ( 141 + INV_INTERFACE_START_Y );
}
else{
else
{
SM_ARMOR_X = ( 264 + INTERFACE_START_X );
SM_ARMOR_Y = ( 141 + INV_INTERFACE_START_Y );
SM_ARMOR_LABEL_X = ( 279 + INTERFACE_START_X );
@@ -1971,13 +1985,11 @@ BOOLEAN InitializeSMPanelCoordsNew()
STATS_TEXT_FONT_COLOR = 5;
// ow and te clock and location i will put it here
INTERFACE_CLOCK_X = (SCREEN_WIDTH - 86);
INTERFACE_CLOCK_Y = ( 117 + INV_INTERFACE_START_Y );
LOCATION_NAME_X = (SCREEN_WIDTH - 92);
LOCATION_NAME_Y = ( 89 + INTERFACE_START_Y );
//Keyring
KEYRING_X = 217; // 209
KEYRING_X = xResOffset + 217; //209;
KEYRING_Y = (5 + INV_INTERFACE_START_Y);
// so we got everything "dynamic" now we just return TRUE
@@ -1999,15 +2011,15 @@ BOOLEAN InitializeSMPanel( )
// failing the CHECKF after this will cause you to lose your mouse
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
if (iResolution == 0)
if (iResolution >= _640x480 && iResolution < _800x600)
{
strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel.STI" );
strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel.STI" );
}
else if (iResolution == 1)
else if (iResolution < _1024x768)
{
strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel_800x600.STI" );
}
else if (iResolution == 2)
else
{
strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel_1024x768.STI" );
}
@@ -3408,15 +3420,156 @@ BOOLEAN UIHandleItemPlacement( UINT8 ubHandPos, UINT16 usOldItemIndex, UINT16 us
}
//Jenilee
INT32 uiLastHandPos = -1;
#define SLOT_NONE 0
#define SLOT_HANDS 1
#define SLOT_EQUIPMENT 2
#define SLOT_VEST 3
#define SLOT_RIG 4
#define SLOT_CPACK 5
#define SLOT_BPACK 6
#define SLOT_SLING 7
#define SLOT_KNIFE 8
#define SLOT_FACE 9
STR16 uiSlotTypeName[] =
{
L"", //0
L"Hands", //1
L"Equipment", //2
L"Vest", //3
L"Leg Rig", //4
L"Combat Pack", //5
L"Backpack", //6
L"Sling", //7
L"Knife", //8
L"Face", //9
L"Large Pocket", //10
L"Small Pocket" //11
};
INT16 uiNIVSlotType[NUM_INV_SLOTS] = {
2, 2, 2, //0-2
9, 9, //3-4
1, 1, //5-6
2, 2, 2, 2, 2, //7-11
7, //12
8, //13
5, 5, 5, //14-16
6, 6, 6, 6, //17-20
3, 3, //21-22
4, 4, //23-24
3, 3, 3, 3, 3, //25-29
3, 3, 3, 3, 3, //30-34
4, 4, 4, 4, //35-38
4, 4, 4, 4, //39-42
5, 5, 5, 5, //43-46
6, 6, 6, 6, //47-50
6, 6, 6, 6 //51-54
};
UINT16 uiOIVSlotType[NUM_INV_SLOTS] = {
2, 2, 2, //0-2
9, 9, //3-4
1, 1, //5-6
0, 0, 0, 0, 0, 0, 0, //7-13
10, 10, 10, 10, //14-17
0, 0, 0, 0, 0, 0, 0, //18-24
11, 11, 11, 11, 11, 11, 11, 11, //25-32
0, 0, 0, 0, 0, 0, 0, 0, //33-40
0, 0, 0, 0, 0, 0, 0, 0, //41-48
0, 0, 0, 0, 0, 0 //49-54
};
UINT32 GetInvMovementCost(UINT16 item, UINT32 old_pos, UINT32 new_pos)
{
if (!(gTacticalStatus.uiFlags & INCOMBAT) || //Not in combat
(old_pos == -1 || new_pos == -1)|| //Either position is invalid
(old_pos == new_pos)) //Old position same as new position
return 0;
INT16 src_type;
INT16 dst_type;
if (UsingNewInventorySystem() == TRUE)
{
src_type = uiNIVSlotType[old_pos];
dst_type = uiNIVSlotType[new_pos];
}
else
{
src_type = uiOIVSlotType[old_pos];
dst_type = uiOIVSlotType[new_pos];
}
if (src_type == dst_type) //Moving to same lbe type
return 0;
//If these 2 arrays are initiated outside the function, APBPConstants will not have been initialized, and all values will be 0
INT16 uiAPCostFromSlot[12] =
{
APBPConstants[AP_INV_FROM_NONE],
APBPConstants[AP_INV_FROM_HANDS],
APBPConstants[AP_INV_FROM_EQUIPMENT],
APBPConstants[AP_INV_FROM_VEST],
APBPConstants[AP_INV_FROM_RIG],
APBPConstants[AP_INV_FROM_CPACK],
APBPConstants[AP_INV_FROM_BPACK],
APBPConstants[AP_INV_FROM_SLING],
APBPConstants[AP_INV_FROM_KNIFE],
APBPConstants[AP_INV_FROM_FACE],
APBPConstants[AP_INV_FROM_BIG_POCKET],
APBPConstants[AP_INV_FROM_SMALL_POCKET]
};
INT16 uiAPCostToSlot[12] =
{
APBPConstants[AP_INV_TO_NONE],
APBPConstants[AP_INV_TO_HANDS],
APBPConstants[AP_INV_TO_EQUIPMENT],
APBPConstants[AP_INV_TO_VEST],
APBPConstants[AP_INV_TO_RIG],
APBPConstants[AP_INV_TO_CPACK],
APBPConstants[AP_INV_TO_BPACK],
APBPConstants[AP_INV_TO_SLING],
APBPConstants[AP_INV_TO_KNIFE],
APBPConstants[AP_INV_TO_FACE],
APBPConstants[AP_INV_TO_BIG_POCKET],
APBPConstants[AP_INV_TO_SMALL_POCKET]
};
FLOAT Weight_Divisor = gGameExternalOptions.uWeightDivisor;
UINT16 weight_modifier;
if (Weight_Divisor != 0)
weight_modifier = DynamicAdjustAPConstants((int)((Item[item].ubWeight) / Weight_Divisor),(int)((Item[item].ubWeight) / Weight_Divisor));
else
weight_modifier = 0;
UINT32 cost = 0;
cost += uiAPCostFromSlot[src_type];
cost += uiAPCostToSlot[dst_type];
cost += weight_modifier;
if (cost > APBPConstants[AP_INV_MAX_COST])
cost = APBPConstants[AP_INV_MAX_COST];
#ifdef _DEBUG
CHAR16 szTemp[255];
swprintf(szTemp, L"Moving item from %s to %s (costs: %d/%d/%d/%d)", uiSlotTypeName[src_type], uiSlotTypeName[dst_type], uiAPCostFromSlot[src_type], uiAPCostToSlot[dst_type], weight_modifier, cost);
ScreenMsg(FONT_MCOLOR_LTGREEN, MSG_CHAT, szTemp);
#endif
return cost;
}
void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
{
UINT32 uiHandPos;
// Copyies of values
UINT16 usOldItemIndex, usNewItemIndex;
UINT16 usItemPrevInItemPointer;
UINT16 usCostToMoveItem = 0; //Jenilee
BOOLEAN fNewItem = FALSE;
static BOOLEAN fRightDown = FALSE;
static BOOLEAN fLeftDown = FALSE;
static bool INV_AP_COST = bool(gGameOptions.fInventoryCostsAP);
uiHandPos = MSYS_GetRegionUserData( pRegion, 0 );
@@ -3510,6 +3663,10 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
usOldItemIndex = gpSMCurrentMerc->inv[ uiHandPos ].usItem;
//Jenilee: remember our last selected slot
uiLastHandPos = uiHandPos;
// move item into the mouse cursor
BeginItemPointer( gpSMCurrentMerc, (UINT8)uiHandPos );
@@ -3536,8 +3693,23 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
if ( ubSrcID == ubDestID )
{
if (INV_AP_COST)
//Jenilee: determine the cost of moving this item around in our inventory
usCostToMoveItem = GetInvMovementCost(gpItemPointer->usItem, uiLastHandPos, uiHandPos);
if (gpSMCurrentMerc->bActionPoints >= usCostToMoveItem)
{
fOKToGo = TRUE;
uiLastHandPos = uiHandPos;
}
else //we dont have enough APs to move it to this slot, show a warning message
{
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[NOT_ENOUGH_APS_STR]);
fOKToGo = FALSE;
}
// We are doing this ourselve, continue
fOKToGo = TRUE;
// fOKToGo = TRUE;
}
else
{
@@ -3655,6 +3827,10 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
// try to place the item in the cursor into this inventory slot
if ( UIHandleItemPlacement( (UINT8) uiHandPos, usOldItemIndex, usNewItemIndex, fDeductPoints ) )
{
//Jenilee: pay the price
//just make sure to handle that if we are putting it back in the SAME slot, the cost should be 0!!!
gpSMCurrentMerc->bActionPoints -= usCostToMoveItem;
RenderBackpackButtons(ACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
// it worked! if we're in the SKI...
if( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE )
@@ -4719,17 +4895,19 @@ void BtnPositionShowCallback(GUI_BUTTON *btn,INT32 reason)
BOOLEAN InitializeTEAMPanelCoords( )
{
TM_FACE_WIDTH = 48;
TM_FACE_HEIGHT = 43;
TM_APPANEL_HEIGHT = 56;
TM_APPANEL_WIDTH = 16;
TM_ENDTURN_X = (SCREEN_WIDTH - 131); //( 507 + INTERFACE_START_X );
TM_ENDTURN_X = xResOffset + (xResSize - 131);
TM_ROSTERMODE_X = xResOffset + (xResSize - 131);
TM_DISK_X = xResOffset + (xResSize - 131);
INTERFACE_CLOCK_TM_X = xResOffset + (xResSize - 86 );
LOCATION_NAME_TM_X = xResOffset + (xResSize - 92 );
TM_ENDTURN_Y = ( 9 + INTERFACE_START_Y );
TM_ROSTERMODE_X = (SCREEN_WIDTH - 131); //( 507 + INTERFACE_START_X );
TM_ROSTERMODE_Y = ( 45 + INTERFACE_START_Y );
TM_DISK_X = (SCREEN_WIDTH - 131); //( 507 + INTERFACE_START_X );
TM_DISK_Y = ( 81 + INTERFACE_START_Y );
TM_NAME_WIDTH = 60;
@@ -4846,9 +5024,8 @@ BOOLEAN InitializeTEAMPanelCoords( )
// ufff to much copy&paste :D
*/
// CHRISL: New definitions for the team panel clock and location coordinates
INTERFACE_CLOCK_TM_X = ( SCREEN_WIDTH - 86 );
INTERFACE_CLOCK_TM_Y = ( 99 + INTERFACE_START_Y );
LOCATION_NAME_TM_X = ( SCREEN_WIDTH - 92 );
LOCATION_NAME_TM_Y = ( 65 + INTERFACE_START_Y );
return ( TRUE );
@@ -4883,37 +5060,34 @@ BOOLEAN InitializeTEAMPanel( )
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
//SQUAD10 FIX: Use panels with more slots if SquadSize at current resolution is > 6
switch (iResolution)
if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
else if (iResolution < _1024x768)
{
case 0:
FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
break;
case 1:
if (gGameOptions.ubSquadSize > 6)
{
FilenameForBPP("INTERFACE\\bottom_bar_8_800x600.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("INTERFACE\\bottom_bar_800x600.sti", VObjectDesc.ImageFile);
}
break;
case 2:
if (gGameOptions.ubSquadSize > 8)
{
FilenameForBPP("INTERFACE\\bottom_bar_10_1024x768.sti", VObjectDesc.ImageFile);
}
else if (gGameOptions.ubSquadSize > 6)
{
FilenameForBPP("INTERFACE\\bottom_bar_8_1024x768.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("INTERFACE\\bottom_bar_1024x768.sti", VObjectDesc.ImageFile);
}
break;
default:
FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
if (gGameOptions.ubSquadSize > 6)
{
FilenameForBPP("INTERFACE\\bottom_bar_8_800x600.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("INTERFACE\\bottom_bar_800x600.sti", VObjectDesc.ImageFile);
}
}
else
{
if (gGameOptions.ubSquadSize > 8)
{
FilenameForBPP("INTERFACE\\bottom_bar_10_1024x768.sti", VObjectDesc.ImageFile);
}
else if (gGameOptions.ubSquadSize > 6)
{
FilenameForBPP("INTERFACE\\bottom_bar_8_1024x768.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("INTERFACE\\bottom_bar_1024x768.sti", VObjectDesc.ImageFile);
}
}
CHECKF( AddVideoObject( &VObjectDesc, &guiTEAMPanel ) );
+17 -4
View File
@@ -20,6 +20,7 @@
#include "line.h"
#include "WCheck.h"
#include "Vehicles.h"
#include "GameSettings.h"
#endif
#define LIFE_BAR_SHADOW FROMRGB( 108, 12, 12 )
@@ -388,7 +389,7 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
if ( ubStatus >= DRAW_ITEM_STATUS_ATTACHMENT1 )
{
sValue = 0;
sValue = 0;
OBJECTTYPE* pAttachment = (*pObject)[iter]->GetAttachmentAtIndex( ubStatus - DRAW_ITEM_STATUS_ATTACHMENT1 );
if (pAttachment->exists()) {
sValue = (*pAttachment)[iter]->data.objectStatus;
@@ -427,10 +428,23 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
sValue =100;
}
// Flugente FTW 1.2
if ( ubStatus == DRAW_ITEM_TEMPERATURE )
{
sValue = (INT16) (100 * GetGunOverheatJamPercentage( pObject) );
// if temperature is 0 or below, do not display anything
if ( sValue < 1)
return;
// cut off temperature at 100%, otherwise the bar will be out of its box
sValue = min(sValue, 100);
}
// ATE: Subtract 1 to exagerate bad status
if ( sValue < 100 && sValue > 1 )
{
sValue--;
sValue--;
}
// Erase what was there
@@ -441,8 +455,7 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
// FIRST DO BREATH
dPercentage = (FLOAT)sValue / (FLOAT)100;
dEnd = dPercentage * sHeight;
+1
View File
@@ -7,6 +7,7 @@
#define DRAW_ITEM_STATUS_ATTACHMENT2 201
#define DRAW_ITEM_STATUS_ATTACHMENT3 202
#define DRAW_ITEM_STATUS_ATTACHMENT4 203
#define DRAW_ITEM_TEMPERATURE 204 // Flugente FTW 1.2
void DrawMoraleUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer );
void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer );
+69 -83
View File
@@ -105,9 +105,6 @@ CIV_NAMES_VALUES zCivGroupName[NUM_CIV_GROUPS];
BOOLEAN gfInMovementMenu = FALSE;
INT32 giMenuAnchorX, giMenuAnchorY;
#define PROG_BAR_START_X 5
//*ddd
//#define PROG_BAR_START_Y 2
@@ -285,7 +282,6 @@ UINT32 CalcUIMessageDuration( STR16 wString );
BOOLEAN InitializeFaceGearGraphics()
{
VSURFACE_DESC vs_desc;
VOBJECT_DESC VObjectDesc;
char fileName[500];
@@ -382,10 +378,8 @@ BOOLEAN InitializeTacticalInterface( )
VSURFACE_DESC vs_desc;
VOBJECT_DESC VObjectDesc;
UINT32 iCounter2;
//UINT32 iCounter2;
char fileName[500];
// CHRISL: Setup default interface coords based on inventory system in use
if((UsingNewInventorySystem() == true))
{
@@ -4333,36 +4327,35 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
UINT32 uiBarToUseInUpDate=0;
BOOLEAN fDoLimitBar = FALSE;
FLOAT dNumStepsPerEnemy, dLength, dCurSize;
INT16 iProgBarLength = SCREEN_WIDTH - 13;
INT16 iProgBarLength;
STR fn;
memset( &VObjectDesc, 0, sizeof( VObjectDesc ) );
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
switch (iResolution)
if (iResolution >= _640x480 && iResolution < _800x600)
{
case 0: //640
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\rect_Thin.sti";
else
fn = "INTERFACE\\rect.sti";
break;
case 1: //800
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\rect_800x600Thin.sti";
else
fn = "INTERFACE\\rect_800x600.sti";
break;
case 2:
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\rect_1024x768Thin.sti";
else
fn = "INTERFACE\\rect_1024x768.sti";
break;
default:
AssertMsg( 0, "Invalid resolution");
return;
break;
iProgBarLength = 640 - 13;
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\rect_Thin.sti";
else
fn = "INTERFACE\\rect.sti";
}
else if (iResolution < _1024x768)
{
iProgBarLength = 800 - 13;
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\rect_800x600Thin.sti";
else
fn = "INTERFACE\\rect_800x600.sti";
}
else
{
iProgBarLength = 1024 - 13;
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\rect_1024x768Thin.sti";
else
fn = "INTERFACE\\rect_1024x768.sti";
}
FilenameForBPP(fn, VObjectDesc.ImageFile);
@@ -4373,30 +4366,26 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
AssertMsg(0, fn );
}
switch (iResolution)
if (iResolution >= _640x480 && iResolution < _800x600)
{
case 0: //640
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebargreen_Thin.sti";
else
fn = "INTERFACE\\timebargreen.sti";
break;
case 1: //800
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebargreen_800x600Thin.sti";
else
fn = "INTERFACE\\timebargreen_800x600.sti";
break;
case 2:
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebargreen_1024x768Thin.sti";
else
fn = "INTERFACE\\timebargreen_1024x768.sti";
break;
default:
AssertMsg( 0, "Invalid resolution");
return;
break;
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebargreen_Thin.sti";
else
fn = "INTERFACE\\timebargreen.sti";
}
else if (iResolution < _1024x768)
{
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebargreen_800x600Thin.sti";
else
fn = "INTERFACE\\timebargreen_800x600.sti";
}
else
{
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebargreen_1024x768Thin.sti";
else
fn = "INTERFACE\\timebargreen_1024x768.sti";
}
FilenameForBPP(fn, VObjectDesc.ImageFile);
@@ -4406,30 +4395,26 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
AssertMsg(0, fn );
}
switch (iResolution)
if (iResolution >= _640x480 && iResolution < _800x600)
{
case 0: //640
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebaryellow_Thin.sti";
else
fn = "INTERFACE\\timebaryellow.sti";
break;
case 1: //800
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebaryellow_800x600Thin.sti";
else
fn = "INTERFACE\\timebaryellow_800x600.sti";
break;
case 2:
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebaryellow_1024x768Thin.sti";
else
fn = "INTERFACE\\timebaryellow_1024x768.sti";
break;
default:
AssertMsg( 0, "Invalid resolution");
return;
break;
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebaryellow_Thin.sti";
else
fn = "INTERFACE\\timebaryellow.sti";
}
else if (iResolution < _1024x768)
{
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebaryellow_800x600Thin.sti";
else
fn = "INTERFACE\\timebaryellow_800x600.sti";
}
else
{
if (gGameExternalOptions.fSmallSizeProgressbar)
fn = "INTERFACE\\timebaryellow_1024x768Thin.sti";
else
fn = "INTERFACE\\timebaryellow_1024x768.sti";
}
FilenameForBPP(fn, VObjectDesc.ImageFile);
@@ -4450,8 +4435,8 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
case MILITIA_INTERRUPT_MESSAGE:
case AIR_RAID_TURN_MESSAGE:
// Render rect into surface
BltVideoObjectFromIndex( uiSurface, uiBAR, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
// Render rect into surface
BltVideoObjectFromIndex( uiSurface, uiBAR, 0, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
@@ -4461,8 +4446,8 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
case PLAYER_INTERRUPT_MESSAGE:
// Render rect into surface
BltVideoObjectFromIndex( uiSurface, uiINTBAR, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
// Render rect into surface
BltVideoObjectFromIndex( uiSurface, uiINTBAR, 0, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
@@ -4472,7 +4457,8 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
case PLAYER_TURN_MESSAGE:
BltVideoObjectFromIndex( uiSurface, uiPLAYERBAR, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
// Render rect into surface
BltVideoObjectFromIndex( uiSurface, uiPLAYERBAR, 0, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
@@ -4494,7 +4480,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
dNumStepsPerEnemy = (FLOAT)( (FLOAT)iProgBarLength / (FLOAT)gTacticalStatus.usTactialTurnLimitMax );
// Render end peice
sBarX = PROG_BAR_START_X;
sBarX = (SCREEN_WIDTH - xResSize) / 2 + 5;
BltVideoObjectFromIndex( uiSurface, uiBarToUseInUpDate, 1, sBarX, PROG_BAR_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
// Determine Length
+96
View File
@@ -16,12 +16,29 @@ UINT32 guiGUNSM;
UINT32 guiP1ITEMS;
UINT32 guiP2ITEMS;
UINT32 guiP3ITEMS;
//MM: New item tileslots start here
UINT32 guiP4ITEMS;
UINT32 guiP5ITEMS;
UINT32 guiP6ITEMS;
UINT32 guiP7ITEMS;
UINT32 guiP8ITEMS;
UINT32 guiP9ITEMS;
// new item image handles
MDItemVideoObjects g_oGUNSM;
MDItemVideoObjects g_oP1ITEMS;
MDItemVideoObjects g_oP2ITEMS;
MDItemVideoObjects g_oP3ITEMS;
//MM: New item tileslots start here
MDItemVideoObjects g_oP4ITEMS;
MDItemVideoObjects g_oP5ITEMS;
MDItemVideoObjects g_oP6ITEMS;
MDItemVideoObjects g_oP7ITEMS;
MDItemVideoObjects g_oP8ITEMS;
MDItemVideoObjects g_oP9ITEMS;
/******************************************************************************/
MDItemVideoObjects::MDItemVideoObjects()
@@ -154,6 +171,85 @@ bool RegisterItemImages()
return false;
}
//MM: New item tileslots start here
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp4items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP4ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp4items.sti" );
}
else if(!g_oP4ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP4ITEMS/*.png"))
{
return false;
}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp5items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP5ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp5items.sti" );
}
else if(!g_oP5ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP5ITEMS/*.png"))
{
return false;
}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp6items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP6ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp6items.sti" );
}
else if(!g_oP6ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP6ITEMS/*.png"))
{
return false;
}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp7items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP7ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp7items.sti" );
}
else if(!g_oP7ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP7ITEMS/*.png"))
{
return false;
}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp8items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP8ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp8items.sti" );
}
else if(!g_oP8ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP8ITEMS/*.png"))
{
return false;
}
// LOAD INTERFACE ITEM PICTURES
if(!g_bUsePngItemImages)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\mdp9items.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &guiP9ITEMS ) )
AssertMsg(0, "Missing INTERFACE\\mdp9items.sti" );
}
else if(!g_oP9ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP9ITEMS/*.png"))
{
return false;
}
return true;
}
+17
View File
@@ -26,12 +26,29 @@ extern UINT32 guiGUNSM;
extern UINT32 guiP1ITEMS;
extern UINT32 guiP2ITEMS;
extern UINT32 guiP3ITEMS;
//MM: New item tileslots start here
extern UINT32 guiP4ITEMS;
extern UINT32 guiP5ITEMS;
extern UINT32 guiP6ITEMS;
extern UINT32 guiP7ITEMS;
extern UINT32 guiP8ITEMS;
extern UINT32 guiP9ITEMS;
// new item image handles
extern MDItemVideoObjects g_oGUNSM;
extern MDItemVideoObjects g_oP1ITEMS;
extern MDItemVideoObjects g_oP2ITEMS;
extern MDItemVideoObjects g_oP3ITEMS;
//MM: New item tileslots start here
extern MDItemVideoObjects g_oP4ITEMS;
extern MDItemVideoObjects g_oP5ITEMS;
extern MDItemVideoObjects g_oP6ITEMS;
extern MDItemVideoObjects g_oP7ITEMS;
extern MDItemVideoObjects g_oP8ITEMS;
extern MDItemVideoObjects g_oP9ITEMS;
bool RegisterItemImages();
#endif // _ITERFACEITEMIMAGES_H_
+4
View File
@@ -1023,6 +1023,7 @@ ObjectData::ObjectData(const ObjectData& src)
this->bTrap = src.bTrap;
this->fUsed = src.fUsed;
this->ubImprintID = src.ubImprintID;
this->bTemperature = src.bTemperature;
//copy over the union
this->gun = src.gun;
@@ -1041,6 +1042,7 @@ ObjectData& ObjectData::operator =(const ObjectData& src)
this->bTrap = src.bTrap;
this->fUsed = src.fUsed;
this->ubImprintID = src.ubImprintID;
this->bTemperature = src.bTemperature;
//copy over the union
this->gun = src.gun;
@@ -1312,6 +1314,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
(*this)[0]->data.bTrap = src.bTrap; // 1-10 exp_lvl to detect
(*this)[0]->data.ubImprintID = src.ubImprintID; // ID of merc that item is imprinted on
(*this)[0]->data.fUsed = src.fUsed; // flags for whether the item is used or not
(*this)[0]->data.bTemperature = 0.0;
if(src.usItem == OWNERSHIP)//dnl ch29 120909
{
@@ -1342,6 +1345,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
(*this)[x]->data.bTrap = src.bTrap; // 1-10 exp_lvl to detect
(*this)[x]->data.ubImprintID = src.ubImprintID; // ID of merc that item is imprinted on
(*this)[x]->data.fUsed = src.fUsed; // flags for whether the item is used or not
(*this)[x]->data.bTemperature = 0.0;
}
}
+29 -14
View File
@@ -444,8 +444,15 @@ public:
INT8 bTrap; // 1-10 exp_lvl to detect
UINT8 fUsed; // flags for whether the item is used or not
UINT8 ubImprintID; // ID of merc that item is imprinted on
};
// Flugente: due do inconsistencies with WF maps, where data from a map is laoded differently, I had to add this marker.
// New values, like bTemperature, have to come after this. And please, don't destroy ObjectData's POD-ness.
char endOfPOD;
FLOAT bTemperature; // Flugente FTW 1.2: temperature of gun
};
// Flugente: needed for reading WF maps
#define SIZEOF_OBJECTDATA_POD (offsetof(ObjectData, endOfPOD))
typedef std::list<OBJECTTYPE> attachmentList;
class StackedObjectData {
@@ -688,7 +695,7 @@ typedef struct
UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT8 ubPerPocket;
UINT8 ItemSize;
UINT16 ItemSize;
UINT16 usPrice;
UINT8 ubCoolness;
INT8 bReliability;
@@ -731,7 +738,6 @@ typedef struct
BOOLEAN gasmask;
BOOLEAN lockbomb;
BOOLEAN flare;
BOOLEAN ammocrate;
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
@@ -843,6 +849,14 @@ typedef struct
FLOAT projectionfactor;
BOOLEAN speeddot;
// Flugente FTW 1.2
BOOLEAN barrel; // item can be used on some guns as an exchange barrel
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
} INVTYPE;
// CHRISL: Added new structures to handle LBE gear and the two new XML files that will be needed to deal
@@ -1307,7 +1321,7 @@ typedef enum
DEFAULT_CPACK = 442,
DEFAULT_BPACK = 448,
MAXITEMS = 5001
MAXITEMS = 16001
} ITEMDEFINE;
/* CHRISL: Arrays to track ic group information. These allow us to determine which LBE slots control which pockets and
@@ -1330,15 +1344,15 @@ const INT8 vehicleInv[NUM_INV_SLOTS]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
// Determines the default pocket
const INT16 icDefault[NUM_INV_SLOTS] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,
DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK,
DEFAULT_VEST, DEFAULT_VEST,
DEFAULT_THIGH, DEFAULT_THIGH,
DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST,
DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH,
DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,
DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK};
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,//0-13
DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,//14,15,16
DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK,//17,18,19,20
DEFAULT_VEST, DEFAULT_VEST,//21,22
DEFAULT_THIGH, DEFAULT_THIGH,//23,24
DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST,//24-34
DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH,//35-42
DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,//43,44,45,46
DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK};//47+
#define FIRST_HELMET STEEL_HELMET
#define LAST_HELMET SPECTRA_HELMET_Y
@@ -1417,7 +1431,8 @@ typedef enum
EASY_MERGE,
ELECTRONIC_MERGE,
USE_ITEM,
USE_ITEM_HARD
USE_ITEM_HARD,
TEMPERATURE
} MergeType;
extern UINT16 Merge[MAXITEMS+1][6];
+89 -24
View File
@@ -1260,7 +1260,7 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
// CHRISL: Restrict system specific items
if( (UsingNewInventorySystem() == true) )
{
if(Item[usItemIndex].ItemSize == 99)
if(Item[usItemIndex].ItemSize == gGameExternalOptions.guiOIVSizeNumber)
return FALSE;
}
else
@@ -1430,7 +1430,7 @@ UINT8 ItemSlotLimit( OBJECTTYPE * pObject, INT16 bSlot, SOLDIERTYPE *pSoldier, B
else if(pSoldier != NULL && (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE))
return (max(1, LBEPocketType[VEHICLE_POCKET_TYPE].ItemCapacityPerSize[__min(gGameExternalOptions.guiMaxItemSize,Item[pObject->usItem].ItemSize)])); //JMich
else
return (max(1, min(255,LBEPocketType[VEHICLE_POCKET_TYPE].ItemCapacityPerSize[__min(34,Item[pObject->usItem].ItemSize)]*4)));
return (max(1, min(255,LBEPocketType[VEHICLE_POCKET_TYPE].ItemCapacityPerSize[__min(gGameExternalOptions.guiMaxItemSize,Item[pObject->usItem].ItemSize)]*4)));
}
if (UsingNewInventorySystem() == false) {
@@ -1480,7 +1480,7 @@ UINT8 ItemSlotLimit( OBJECTTYPE * pObject, INT16 bSlot, SOLDIERTYPE *pSoldier, B
}
else
iSize = Item[pObject->usItem].ItemSize;
iSize = __min(iSize,34);
iSize = __min(iSize,gGameExternalOptions.guiMaxItemSize);
ubSlotLimit = LBEPocketType[pIndex].ItemCapacityPerSize[iSize];
//this could be changed, we know guns are physically able to stack
@@ -2734,23 +2734,24 @@ UINT16 CalculateItemSize( OBJECTTYPE *pObject )
// Determine default ItemSize based on item and attachments
cisIndex = pObject->usItem;
iSize = Item[cisIndex].ItemSize;
if(iSize>34)
iSize = 34;
if(iSize>gGameExternalOptions.guiMaxItemSize)
iSize = gGameExternalOptions.guiMaxItemSize;
//for each object in the stack, hopefully there is only 1
for (int numStacked = 0; numStacked < pObject->ubNumberOfObjects; ++numStacked) {
//some weapon attachments can adjust the ItemSize of a weapon
if(iSize<10) {
if(iSize<gGameExternalOptions.guiMaxWeaponSize) {
for (attachmentList::iterator iter = (*pObject)[numStacked]->attachments.begin(); iter != (*pObject)[numStacked]->attachments.end(); ++iter) {
if (iter->exists() == true) {
iSize += Item[iter->usItem].itemsizebonus;
// CHRISL: This is to catch things if we try and reduce ItemSize when we're already at 0
if(iSize > 34 || iSize < 0)
iSize = 0;
if(iSize > 9)
iSize = 9;
}
}
if(iSize > gGameExternalOptions.guiMaxItemSize || iSize < 0) //JMich
iSize = 0;
if(iSize > gGameExternalOptions.guiMaxWeaponSize) //JMich
iSize = gGameExternalOptions.guiMaxWeaponSize; //JMich
}
// LBENODE has it's ItemSize adjusted based on what it's storing
@@ -3580,6 +3581,7 @@ INT8 FindAmmoToReload( SOLDIERTYPE * pSoldier, INT8 bWeaponIn, INT8 bExcludeSlot
{
OBJECTTYPE * pObj;
INT8 bSlot;
UINT16 magSize;
if (pSoldier == NULL)
{
@@ -3594,13 +3596,12 @@ INT8 FindAmmoToReload( SOLDIERTYPE * pSoldier, INT8 bWeaponIn, INT8 bExcludeSlot
if ( Item[pObj->usItem].usItemClass == IC_GUN && !Item[pObj->usItem].cannon )
{
// look for same ammo as before
//bSlot = FindObjExcludingSlot( pSoldier, (*pObj)[0]->data.gun.usGunAmmoItem, bExcludeSlot );
//if (bSlot != NO_SLOT)
//{
// reload using this ammo!
// return( bSlot );
//}
//MM: make reload use crates/boxes if not in combat...
if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
magSize = GetMagSize(pObj);
else
magSize = ANY_MAGSIZE;
// look for any ammo that matches which is of the same calibre and magazine size
bSlot = FindAmmo( pSoldier, Weapon[pObj->usItem].ubCalibre, GetMagSize(pObj), GetAmmoType(pObj), bExcludeSlot );
if (bSlot != NO_SLOT)
@@ -4839,6 +4840,28 @@ BOOLEAN OBJECTTYPE::AttachObjectNAS( SOLDIERTYPE * pSoldier, OBJECTTYPE * pAttac
pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 );
}
break;
case TEMPERATURE:
{
// check if this can work
if ( Item[ this->usItem ].usItemClass == IC_GUN && Item[pAttachment->usItem].barrel == TRUE )
{
FLOAT guntemperature = (*this)[subObject]->data.bTemperature;
FLOAT barreltemperature = (*pAttachment)[0]->data.bTemperature;
(*pAttachment)[0]->data.bTemperature = guntemperature;
(*this)[subObject]->data.bTemperature = barreltemperature;
}
UINT16 usOldItem = this->usItem;
this->usItem = usResult;
//WarmSteel - Replaced this with one that also checks default attachments, otherwise you could not replace built-in bonuses with default inseperable attachments.
//RemoveProhibitedAttachments(pSoldier, this, usResult);
ReInitMergedItem(pSoldier, this, usOldItem);
}
break;
case ELECTRONIC_MERGE:
if ( pSoldier )
{
@@ -5841,7 +5864,7 @@ BOOLEAN PlaceObject( SOLDIERTYPE * pSoldier, INT8 bPos, OBJECTTYPE * pObj )
if (Weapon[pInSlot->usItem].ubCalibre == Magazine[Item[pObj->usItem].ubClassIndex].ubCalibre)
{
//CHRISL: Work differently with ammo crates but only when not in combat
if(Item[pObj->usItem].ammocrate == TRUE)
if(Magazine[Item[pObj->usItem].ubClassIndex].ubMagType >= AMMO_BOX)
{
if(!(gTacticalStatus.uiFlags & INCOMBAT))
{
@@ -5958,7 +5981,7 @@ BOOLEAN PlaceObject( SOLDIERTYPE * pSoldier, INT8 bPos, OBJECTTYPE * pObj )
}
// CHRISL: When holding ammo and clicking on an appropriate ammo crate, add ammo to crate
if(Item[pInSlot->usItem].ammocrate == TRUE && Item[pObj->usItem].usItemClass == IC_AMMO)
if(Magazine[Item[pInSlot->usItem].ubClassIndex].ubMagType >= AMMO_BOX && Item[pObj->usItem].usItemClass == IC_AMMO && Magazine[Item[pObj->usItem].ubClassIndex].ubMagType < AMMO_BOX )
{
if(Magazine[Item[pInSlot->usItem].ubClassIndex].ubCalibre == Magazine[Item[pObj->usItem].ubClassIndex].ubCalibre &&
Magazine[Item[pInSlot->usItem].ubClassIndex].ubAmmoType == Magazine[Item[pObj->usItem].ubClassIndex].ubAmmoType)
@@ -7096,6 +7119,9 @@ BOOLEAN CreateGun( UINT16 usItem, INT16 bStatus, OBJECTTYPE * pObj )
pStackedObject->data.gun.bGunStatus = bStatus;
pStackedObject->data.ubImprintID = NO_PROFILE;
// Flugente FTW 1: temperature on creation is 0
pStackedObject->data.bTemperature = 0.0;
if (Weapon[ usItem ].ubWeaponClass == MONSTERCLASS)
{
pStackedObject->data.gun.ubGunShotsLeft = GetMagSize(pObj);
@@ -11402,10 +11428,18 @@ UINT8 AllowedAimingLevelsNCTH( SOLDIERTYPE *pSoldier, INT32 sGridNo )
aimLevels = 4;
}
}
// HEADROCK HAM 4: This modifier from the weapon and its attachments replaces the generic bipod bonus.
aimLevels += GetAimLevelsModifier( &pSoldier->inv[pSoldier->ubAttackingHand], gAnimControl[ pSoldier->usAnimState ].ubHeight );
// HEADROCK HAM 4: This modifier from the weapon and its attachments replaces the generic bipod bonus.
UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
stance = ANIM_PRONE;
INT32 moda = GetAimLevelsModifier( &pSoldier->inv[pSoldier->ubAttackingHand], stance );
INT32 modb = GetAimLevelsModifier( &pSoldier->inv[pSoldier->ubAttackingHand], gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
aimLevels += (INT32) ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
aimLevels += GetAimLevelsTraitModifier( pSoldier, &pSoldier->inv[pSoldier->ubAttackingHand]);
aimLevels = __max(1, aimLevels);
@@ -11543,12 +11577,18 @@ UINT8 AllowedAimingLevels(SOLDIERTYPE * pSoldier, INT32 sGridNo)
}
// Determine whether a bipod is being used (prone)
if (GetBipodBonus(&pSoldier->inv[pSoldier->ubAttackingHand])>0 && gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
stance = ANIM_PRONE;
if (GetBipodBonus(&pSoldier->inv[pSoldier->ubAttackingHand])>0 && stance == ANIM_PRONE )
{
fUsingBipod = TRUE;
}
// don't break compatibility, let the users choose
if (gGameExternalOptions.iAimLevelsCompatibilityOption != 0)
sScopeBonus = OldWayOfCalculatingScopeBonus(pSoldier);
@@ -12366,3 +12406,28 @@ static UINT16 OldWayOfCalculatingScopeBonus(SOLDIERTYPE *pSoldier)
return max(0, GetMinRangeForAimBonus(& pSoldier->inv[pSoldier->ubAttackingHand])
* gGameExternalOptions.iAimLevelsCompatibilityOption / gGameExternalOptions.ubStraightSightRange);
}
// Flugente FTW 1.2
FLOAT GetItemCooldownFactor( OBJECTTYPE * pObj )
{
FLOAT cooldownfactor = Item[pObj->usItem].usOverheatingCooldownFactor; // ... get item-specific cooldown factor ...
FLOAT modificator = 1.0;
if ( pObj->exists() == true )
{
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
{
if (iter->exists())
{
modificator += Item[iter->usItem].overheatCooldownModificator;
}
}
}
cooldownfactor *= modificator;
return cooldownfactor;
}
+7
View File
@@ -15,6 +15,10 @@ class SOLDIERTYPE;
#define NIGHTSIGHTGOGGLES_BONUS 2 * STRAIGHT_RATIO
#define UVGOGGLES_BONUS 4 * STRAIGHT_RATIO
extern UINT8 SlotToPocket[7];
extern BOOLEAN WeaponInHand( SOLDIERTYPE * pSoldier );
@@ -426,6 +430,9 @@ INT16 ReduceCamoFromSoldier( SOLDIERTYPE * pSoldier, INT16 iCamoToRemove, INT16
BOOLEAN HasExtendedEarOn( SOLDIERTYPE * pSoldier );
BOOLEAN UseTotalMedicalKitPoints( SOLDIERTYPE * pSoldier, UINT16 usPointsToConsume );
// Flugente FTW 1.2
FLOAT GetItemCooldownFactor( OBJECTTYPE * pObj );
#endif
+58 -6
View File
@@ -7048,10 +7048,18 @@ void CalcTargetMovementOffset( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, OBJE
// beginning to compensate for the target's speed, pointing the gun ahead of the target ("Leading the target").
UINT8 uiTilesForMaxPenalty = (100-uiCombinedSkill) / (100 / gGameCTHConstants.MOVEMENT_TRACKING_DIFFICULTY);
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
stance = ANIM_PRONE;
// Add a percentage-based modifier from the weapon and its attachments. Movement tracking devices will
// provide faster compensation for target movement, allowing the shooter to begin adjusting the muzzle
// after the target moves a smaller number of tiles.
uiTilesForMaxPenalty += (INT16)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
INT32 moda = (INT32)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, stance )) / 100;
INT32 modb = (INT32)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
uiTilesForMaxPenalty += (UINT8)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
if (uiTilesForMaxPenalty == 0)
{
@@ -7208,7 +7216,15 @@ void CalcRangeCompensationOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetY,
// The weapon and/or its attachments can increase our skill by a certain percentage. Windage sights on long-range
// weapons (like sniper rifles and launchers) are sometimes designed specifically for this purpose.
iCombinedSkill += (iCombinedSkill * GetDropCompensationModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
stance = ANIM_PRONE;
FLOAT moda = (iCombinedSkill * GetDropCompensationModifier( pWeapon, stance )) / 100;
FLOAT modb = (iCombinedSkill * GetDropCompensationModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
iCombinedSkill += ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
// Limit this to a scale of 0-100.
UINT32 uiCombinedSkill = (UINT32)__max(__min(iCombinedSkill,100), 0);
@@ -7533,8 +7549,16 @@ UINT32 CalcCounterForceFrequency(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon)
iCounterForceFrequency += bDifference;
}
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
stance = ANIM_PRONE;
// Percent Modifier from weapon and its attachments
iCounterForceFrequency += (iCounterForceFrequency * GetCounterForceFrequencyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
FLOAT moda = (iCounterForceFrequency * GetCounterForceFrequencyModifier( pWeapon, stance )) / 100;
FLOAT modb = (iCounterForceFrequency * GetCounterForceFrequencyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
iCounterForceFrequency += ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
// Limit to 1-100.
iCounterForceFrequency = __min(100, iCounterForceFrequency);
@@ -7600,7 +7624,17 @@ UINT32 CalcCounterForceAccuracy(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, UINT
// Add the effects from the weapon and its attachments. A foregrip or bipod are very useful for this.
// Attachment bonuses are applied as a percentage to the accuracy of the shooter.
INT32 iModifier = GetCounterForceAccuracyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubHeight );
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
stance = ANIM_PRONE;
INT32 moda = GetCounterForceAccuracyModifier( pWeapon, stance );
INT32 modb = GetCounterForceAccuracyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight );
INT32 iModifier = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
UINT32 uiCounterForceAccuracy = (UINT32)(iCounterForceAccuracy + ((iCounterForceAccuracy * iModifier) / 100));
// Now add the effect of the AutoWeapons skill. It "bridges" a portion of the gap between shooter's actual accuracy
@@ -7708,7 +7742,17 @@ void CalcPreRecoilOffset( SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, FLOAT *dMu
INT8 bGunRecoilX;
INT8 bGunRecoilY;
FLOAT dDistanceRatio = (FLOAT)(uiRange / gGameCTHConstants.NORMAL_RECOIL_DISTANCE);
FLOAT iCounterForceMax = CalcCounterForceMax(pShooter, pWeapon);
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
stance = ANIM_PRONE;
FLOAT moda = CalcCounterForceMax(pShooter, pWeapon, stance);
FLOAT modb = CalcCounterForceMax(pShooter, pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight);
FLOAT iCounterForceMax = ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
UINT32 uiCounterForceAccuracy = CalcCounterForceAccuracy(pShooter, pWeapon, uiRange, FALSE, true);
UINT32 uiCounterForceFrequency = CalcCounterForceFrequency(pShooter, pWeapon);
@@ -7955,8 +7999,16 @@ void CalcRecoilOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetX, FLOAT *dMuz
// maximum counter-force that can be applied. By default, it is based primarily on the strength of the shooter,
// although agility is also helpful.
FLOAT iCounterForceMax = CalcCounterForceMax(pShooter, pWeapon);
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
stance = ANIM_PRONE;
FLOAT moda = CalcCounterForceMax(pShooter, pWeapon, stance);
FLOAT modb = CalcCounterForceMax(pShooter, pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight);
FLOAT iCounterForceMax = ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
// iCounterForceMax is now the absolute limit.
// STEP 2: Now we need to determine how accurate the shooter is when applying counter-force. He won't always apply
+3 -3
View File
@@ -1890,7 +1890,7 @@ BOOLEAN ExecuteOverhead( )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - hack! - resolve possible pending interrupt
if(GetSoldier(&pSoldier, gusSelectedSoldier) && gGameExternalOptions.fImprovedInterruptSystem )
if(GetSoldier(&pSoldier, gusSelectedSoldier) && gGameOptions.fImprovedInterruptSystem )
{
if ( pSoldier->bActive )
{
@@ -2831,7 +2831,7 @@ BOOLEAN HandleAtNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for movement type of interupt, resolve it here
if ( gGameExternalOptions.fImprovedInterruptSystem )
if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, MOVEMENT_INTERRUPT ) )
{
@@ -8662,7 +8662,7 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for after-shot type of interupt, try to resolve it now
if ( gGameExternalOptions.fImprovedInterruptSystem )
if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, AFTERSHOT_INTERRUPT ) )
{
+9 -1
View File
@@ -4440,8 +4440,16 @@ INT32 PlotPath( SOLDIERTYPE *pSold, INT32 sDestGridNo, INT8 bCopyRoute, INT8 bPl
usMovementModeToUseForAPs = usMovementMode;
// 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
UINT8 ubTerrainID = gpWorldLevelData[ sTempGrid ].ubTerrainID;
if ( TERRAIN_IS_WATER( ubTerrainID) && pSold->pathing.bLevel > 0 )
ubTerrainID = FLAT_GROUND;
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
if ( TERRAIN_IS_WATER( gpWorldLevelData[ sTempGrid ].ubTerrainID) )
if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementModeToUseForAPs = WALKING;
}
+40 -9
View File
@@ -284,8 +284,15 @@ INT16 TerrainBreathPoints(SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bDir, UINT
iPoints = iPoints * BreathPointAdjustmentForCarriedWeight( pSoldier ) / 100;
// 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
UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
ubTerrainID = FLAT_GROUND;
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
if ( TERRAIN_IS_WATER( gpWorldLevelData[ sGridNo ].ubTerrainID) )
if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementMode = WALKING;
}
@@ -359,13 +366,22 @@ INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 u
// Tile cost should not be reduced based on movement mode...
if ( sSwitchValue == TRAVELCOST_FENCE )
{
return( sTileCost );
return( sTileCost );
}
// 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
UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
ubTerrainID = FLAT_GROUND;
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
if ( TERRAIN_IS_WATER( gpWorldLevelData[ sGridNo ].ubTerrainID) )
if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementMode = WALKING;
usMovementMode = WALKING;
}
// so, then we must modify it for other movement styles and accumulate
@@ -503,8 +519,17 @@ INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir,
{
return( sTileCost );
}
// 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
UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
ubTerrainID = FLAT_GROUND;
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
if ( TERRAIN_IS_WATER( gpWorldLevelData[ sGridNo ].ubTerrainID) )
if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementMode = WALKING;
}
@@ -848,7 +873,7 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, UINT8 ub
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - Interrupt counter
if( gGameExternalOptions.fImprovedInterruptSystem && sAPCost > 0 && ubInterruptType != DISABLED_INTERRUPT )
if( gGameOptions.fImprovedInterruptSystem && sAPCost > 0 && ubInterruptType != DISABLED_INTERRUPT )
{
UINT8 ubPointsRegistered = 0;
UINT16 uCnt = 0;
@@ -892,8 +917,9 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, UINT8 ub
// adjust by range to target
//INT32 iRange = GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, pSoldier->sGridNo ); // calculate actual range
//INT16 iDistVisible = (pOpponent->GetMaxDistanceVisible(pOpponent->sGridNo, pOpponent->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE); // how far do we see
ubPointsRegistered -= ( 25 * GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, pSoldier->sGridNo ) /
(pOpponent->GetMaxDistanceVisible(pOpponent->sGridNo, pOpponent->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE) ); // -1% registered by 4% of the difference of how far we can see and how far is the target
INT16 iDistVisible = pOpponent->GetMaxDistanceVisible(pOpponent->sGridNo, pOpponent->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE; // -1% registered by 4% of the difference of how far we can see and how far is the target
iDistVisible = max(iDistVisible, CELL_X_SIZE);
ubPointsRegistered -= ( 25 * GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, pSoldier->sGridNo ) / iDistVisible );
if ( gGameOptions.fNewTraitSystem )
{
@@ -2232,12 +2258,17 @@ INT8 PtsToMoveDirection(SOLDIERTYPE *pSoldier, INT8 bDirection )
// ATE: Check if the new place is watter and we were tying to run....
bOverTerrainType = GetTerrainType( sGridNo );
// 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( bOverTerrainType) && pSoldier->pathing.bLevel > 0 )
bOverTerrainType = FLAT_GROUND;
if ( TERRAIN_IS_WATER( bOverTerrainType) )
{
usMoveModeToUse = WALKING;
}
sCost = ActionPointCost( pSoldier, sGridNo, bDirection , usMoveModeToUse );
sCost = ActionPointCost( pSoldier, sGridNo, bDirection , usMoveModeToUse );
if ( gubWorldMovementCosts[ sGridNo ][ bDirection ][ pSoldier->pathing.bLevel ] != TRAVELCOST_FENCE )
{
+12 -2
View File
@@ -1043,8 +1043,18 @@ ATM:
gubArrayOfEmployedMercs[ gubNumberMercsInArray ] = pSoldier->ubProfile;
//Create the string for the face file name
//sprintf( zTemp, "FACES\\33FACE\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
if ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile )
{
sprintf( zTemp, "IMPFACES\\33FACE\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
}
else
{
sprintf( zTemp, "FACES\\33FACE\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
}
//While we are at it, add their small face
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP( zTemp, VObjectDesc.ImageFile);
@@ -1728,7 +1738,7 @@ void GetShopKeeperInterfaceUserInput()
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
while( DequeueEvent( &Event ) )
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// HOOK INTO MOUSE HOOKS
/* removed warning condition C4060 (jonathanl)
+9 -3
View File
@@ -599,7 +599,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for after-attack type of interupt, try to resolve it now
else if ( gGameExternalOptions.fImprovedInterruptSystem )
else if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, AFTERACTION_INTERRUPT ) )
{
@@ -2052,7 +2052,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for before-attack type of interupt, try to resolve it now
if ( gGameExternalOptions.fImprovedInterruptSystem )
if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, BEFORESHOT_INTERRUPT ) )
{
@@ -2667,7 +2667,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for after-attack type of interupt, try to resolve it now
if ( gGameExternalOptions.fImprovedInterruptSystem )
if ( gGameOptions.fImprovedInterruptSystem )
{
ResolvePendingInterrupt( pSoldier, AFTERACTION_INTERRUPT );
}
@@ -4135,6 +4135,12 @@ BOOLEAN OKFallDirection( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT
}
bOverTerrainType = GetTerrainType( sGridNo);
// 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( bOverTerrainType) && bLevel > 0 )
bOverTerrainType = FLAT_GROUND;
//NOT ok if in water....
if ( TERRAIN_IS_WATER( bOverTerrainType) )
{
+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) //
+2
View File
@@ -1318,6 +1318,8 @@ public:
BOOLEAN IsValidSecondHandShot( void );
BOOLEAN IsValidSecondHandShotForReloadingPurposes( void );
BOOLEAN SoldierCarriesTwoHandedWeapon( void );
void SoldierInventoryCoolDown( void ); // Flugente FTW 1: Cool down all items in inventory
BOOLEAN IsWeaponMounted( void );
}; // SOLDIERTYPE;
+3 -9
View File
@@ -996,12 +996,6 @@ void DecideActiveTerrorists( void )
break;
}
//////////////////////////////////////////////////////////////////////////
// this makes no sense now, we just set the exact number of them below
//if ( gGameExternalOptions.fEnableAllTerrorists )
// uiChance = 100;
//////////////////////////////////////////////////////////////////////////
// add at least 2 more
ubNumAdditionalTerrorists = 2;
for (ubLoop = 0; ubLoop < (MAX_ADDITIONAL_TERRORISTS - 3); ubLoop++) // -3 instead of -2 because we increased MAX_ADDITIONAL_TERRORISTS above by 1
@@ -1013,8 +1007,8 @@ void DecideActiveTerrorists( void )
}
/////////////////////////////////////////////////////
// Added so with ENABLE_ALL_TERRORISTS you really get all of them (5 + Charlie)
if ( gGameOptions.fEnableAllTerrorists )
// Added, so with ENABLE_ALL_TERRORISTS you really get all of them (5 + Charlie)
if ( gGameExternalOptions.fEnableAllTerrorists )
ubNumAdditionalTerrorists = 5;
/////////////////////////////////////////////////////
@@ -1037,7 +1031,7 @@ void DecideActiveTerrorists( void )
ubTerrorist = gubTerrorists[ ubLoop ];
// random 40% chance of adding this terrorist if not yet placed
if ( ( gMercProfiles[ ubTerrorist ].sSectorX == 0 ) && (( Random( 100 ) < 40 ) || gGameOptions.fEnableAllTerrorists ) ) // also added the check because it makes no sense to choose randomly which terrorist will be in game, all of them should
if ( ( gMercProfiles[ ubTerrorist ].sSectorX == 0 ) && (( Random( 100 ) < 40 ) || gGameExternalOptions.fEnableAllTerrorists ) ) // also added the check because it makes no sense to choose randomly which terrorist will be in game, all of them should
{
//fFoundSpot = FALSE;
// Since there are 5 spots per terrorist and a maximum of 5 terrorists, we
+5
View File
@@ -480,6 +480,11 @@ BOOLEAN HandleNextTile( SOLDIERTYPE *pSoldier, INT8 bDirection, INT32 sGridNo, I
bOverTerrainType = GetTerrainType( sGridNo );
// 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( bOverTerrainType) && pSoldier->pathing.bLevel > 0 )
bOverTerrainType = FLAT_GROUND;
// Check if we are going into water!
if ( TERRAIN_IS_WATER( bOverTerrainType) )
{
+1 -1
View File
@@ -620,7 +620,7 @@ void RenderSectorExitMenu( )
gsGlobalCursorYOffset = 0;
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
while( DequeueEvent( &Event ) )
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( Event.usEvent == KEY_DOWN )
{
+4
View File
@@ -151,6 +151,8 @@ void HandleTacticalEndTurn( )
// OK, Do a number of things here....
// Every few turns......
SetFastForwardMode(FALSE); // Cancel FF at end of battle
// Get time elasped
uiTime = GetWorldTotalSeconds( );
@@ -269,6 +271,8 @@ void HandleTacticalEndTurn( )
HandleRPCDescription( );
#endif
// Flugente FTW 1: Cool down all items not in a soldier's inventory
CoolDownWorldItems();
}
+10 -10
View File
@@ -290,24 +290,24 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\lib\VS2010\$(Configuration)\</OutDir>
<IntDir>..\build\VS2010\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MapEditorD|Win32'">
<OutDir>..\lib\VS2010\$(Configuration)\</OutDir>
<IntDir>..\build\VS2010\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IntDir>..\build\VS2010\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>..\lib\VS2010\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MapEditor|Win32'">
<IntDir>..\build\VS2010\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>..\lib\VS2010\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Relese_WithDebugInfo|Win32'">
<IntDir>..\build\VS2010\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>..\lib\VS2010\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
+137 -66
View File
@@ -166,6 +166,7 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"StartPlayerTeamTurn");
// SOLDIERTYPE *pSoldier;
// EV_S_BEGINTURN SBeginTurn;
SetFastForwardMode(FALSE);
// Start the turn of player charactors
@@ -486,6 +487,20 @@ void BeginTeamTurn( UINT8 ubTeam )
if( !LightningEndOfTurn( ubTeam ) )return;
//end rain
// disable for our turn and enable for other teams
if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] )
{
if (is_networked)
{
// Only allow fast forward mode on enemy team!
SetFastForwardMode( (ubTeam == ENEMY_TEAM) );
}
else
{
// Allow fast forward mode on all teams except our team!
SetFastForwardMode( (ubTeam != OUR_TEAM) );
}
}
while( 1 )
{
@@ -812,6 +827,9 @@ void StartInterrupt( void )
UINT8 ubInterrupters = 0;
INT32 iSquad, iCounter;
// disable ff mode
SetFastForwardMode(FALSE);
// build string for display of who gets interrupt
//while( 1 )
for( iCounter = 0; iCounter <= MAX_NUM_SOLDIERS; iCounter++ )
@@ -833,83 +851,122 @@ void StartInterrupt( void )
}
}
wcscpy( sTemp, Message[ STR_INTERRUPT_FOR ] );
// TODO: check here to see if we really can do anything with available mercs on this team
// if not then end interrupt. Probably should check if actions for for the interrupter but then we
// would lose potential XP for being able to radio rest of team about enemy from the interrupt
// Theoretically ubInterrupter is enemy causing interrupt
// build string in separate loop here, want to linearly process squads...
for ( iSquad = 0; iSquad < NUMBER_OF_SQUADS; iSquad++ )
BOOL handleInterrupt = TRUE;
if (ubInterrupter != NOBODY)
{
for ( iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++ )
{
pTempSoldier = Squad[ iSquad ][ iCounter ];
if ( pTempSoldier && pTempSoldier->bActive && pTempSoldier->bInSector && !pTempSoldier->aiData.bMoved )
{
// then this guy got an interrupt...
ubInterrupters++;
if ( ubInterrupters > 6 )
{
// flush... display string, then clear it (we could have 20 names!)
// add comma to end, we know we have another person after this...
wcscat( sTemp, L", " );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
wcscpy( sTemp, L"" );
ubInterrupters = 1;
}
handleInterrupt = FALSE;
if ( ubInterrupters > 1 )
// build string in separate loop here, want to linearly process squads...
SOLDIERTYPE *pInterruptedSoldier = MercPtrs[ubInterrupter];
for ( iSquad = 0; iSquad < NUMBER_OF_SQUADS; iSquad++ )
{
for ( iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++ )
{
pTempSoldier = Squad[ iSquad ][ iCounter ];
if ( pTempSoldier && pTempSoldier->bActive && pTempSoldier->bInSector && !pTempSoldier->aiData.bMoved )
{
wcscat( sTemp, L", " );
INT16 ubMinAPcost = MinAPsToAttack(pSoldier,pInterruptedSoldier->sGridNo,ADDTURNCOST);
// if we don't have enough APs left to shoot even a snap-shot at this guy
if (ubMinAPcost < pSoldier->bActionPoints)
{
handleInterrupt = TRUE;
}
}
wcscat( sTemp, pTempSoldier->name );
}
}
}
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
DebugMsg( TOPIC_JA2INTERRUPT, DBG_LEVEL_3, String("INTERRUPT: starting interrupt for %d", ubFirstInterrupter ) );
// gusSelectedSoldier should become the topmost guy on the interrupt list
//gusSelectedSoldier = ubFirstInterrupter;
// Remove deadlock message
EndDeadlockMsg( );
// Select guy....
SelectSoldier( ubFirstInterrupter, TRUE, TRUE );
// ATE; Slide to guy who got interrupted!
SlideTo( NOWHERE, gubLastInterruptedGuy, NOBODY, SETLOCATOR);
// Dirty panel interface!
fInterfacePanelDirty = DIRTYLEVEL2;
gTacticalStatus.ubCurrentTeam = pSoldier->bTeam;
// Signal UI done enemy's turn
guiPendingOverrideEvent = LU_ENDUILOCK;
if (is_networked)
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
HandleTacticalUI( );
InitPlayerUIBar( TRUE );
//AddTopMessage( PLAYER_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
PlayJA2Sample( ENDTURN_1, RATE_11025, MIDVOLUME, 1, MIDDLEPAN );
// report any close call quotes for us here
for ( iCounter = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; iCounter <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; iCounter++ )
if (!handleInterrupt)
{
if ( OK_INSECTOR_MERC( MercPtrs[ iCounter ] ) )
// no mercs can take even a snapshot at the guy
EndInterrupt(TRUE);
}
else
{
wcscpy( sTemp, Message[ STR_INTERRUPT_FOR ] );
// build string in separate loop here, want to linearly process squads...
ubInterrupters = 0;
for ( iSquad = 0; iSquad < NUMBER_OF_SQUADS; iSquad++ )
{
if ( MercPtrs[ iCounter ]->flags.fCloseCall )
for ( iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++ )
{
if ( MercPtrs[ iCounter ]->bNumHitsThisTurn == 0 && !(MercPtrs[ iCounter ]->usQuoteSaidExtFlags & SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL) && Random( 3 ) == 0 )
pTempSoldier = Squad[ iSquad ][ iCounter ];
if ( pTempSoldier && pTempSoldier->bActive && pTempSoldier->bInSector && !pTempSoldier->aiData.bMoved )
{
// say close call quote!
TacticalCharacterDialogue( MercPtrs[ iCounter ], QUOTE_CLOSE_CALL );
MercPtrs[ iCounter ]->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL;
// then this guy got an interrupt...
ubInterrupters++;
if ( ubInterrupters > 6 )
{
// flush... display string, then clear it (we could have 20 names!)
// add comma to end, we know we have another person after this...
wcscat( sTemp, L", " );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
wcscpy( sTemp, L"" );
ubInterrupters = 1;
}
if ( ubInterrupters > 1 )
{
wcscat( sTemp, L", " );
}
wcscat( sTemp, pTempSoldier->name );
}
}
}
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
DebugMsg( TOPIC_JA2INTERRUPT, DBG_LEVEL_3, String("INTERRUPT: starting interrupt for %d", ubFirstInterrupter ) );
// gusSelectedSoldier should become the topmost guy on the interrupt list
//gusSelectedSoldier = ubFirstInterrupter;
// Remove deadlock message
EndDeadlockMsg( );
// Select guy....
SelectSoldier( ubFirstInterrupter, TRUE, TRUE );
// ATE; Slide to guy who got interrupted!
SlideTo( NOWHERE, gubLastInterruptedGuy, NOBODY, SETLOCATOR);
// Dirty panel interface!
fInterfacePanelDirty = DIRTYLEVEL2;
gTacticalStatus.ubCurrentTeam = pSoldier->bTeam;
// Signal UI done enemy's turn
guiPendingOverrideEvent = LU_ENDUILOCK;
if (is_networked)
guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
HandleTacticalUI( );
InitPlayerUIBar( TRUE );
//AddTopMessage( PLAYER_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
PlayJA2Sample( ENDTURN_1, RATE_11025, MIDVOLUME, 1, MIDDLEPAN );
// report any close call quotes for us here
for ( iCounter = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; iCounter <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; iCounter++ )
{
if ( OK_INSECTOR_MERC( MercPtrs[ iCounter ] ) )
{
if ( MercPtrs[ iCounter ]->flags.fCloseCall )
{
if ( MercPtrs[ iCounter ]->bNumHitsThisTurn == 0 && !(MercPtrs[ iCounter ]->usQuoteSaidExtFlags & SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL) && Random( 3 ) == 0 )
{
// say close call quote!
TacticalCharacterDialogue( MercPtrs[ iCounter ], QUOTE_CLOSE_CALL );
MercPtrs[ iCounter ]->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL;
}
MercPtrs[ iCounter ]->flags.fCloseCall = FALSE;
}
MercPtrs[ iCounter ]->flags.fCloseCall = FALSE;
}
}
}
@@ -969,7 +1026,7 @@ void StartInterrupt( void )
//if ( gTacticalStatus.ubCurrentTeam == OUR_TEAM )//hayden
// if ( pSoldier->bTeam > OUR_TEAM && pSoldier->bTeam < 6) // cheap disable
// SANDRO - we don't use the "hidden interrupt" feature with IIS
if (!is_networked && gTacticalStatus.ubCurrentTeam == OUR_TEAM && !gGameExternalOptions.fImprovedInterruptSystem
if (!is_networked && gTacticalStatus.ubCurrentTeam == OUR_TEAM && !gGameOptions.fImprovedInterruptSystem
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_CURRENTLY
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_THIS_TURN )
{
@@ -1357,6 +1414,20 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
fInterfacePanelDirty = DIRTYLEVEL2;
}
if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] )
{
if (is_networked)
{
// Only allow fast forward mode on enemy team!
SetFastForwardMode( (gTacticalStatus.ubCurrentTeam == ENEMY_TEAM) );
}
else
{
// Allow fast forward mode on all teams except our team!
SetFastForwardMode( (gTacticalStatus.ubCurrentTeam != OUR_TEAM) );
}
}
}
@@ -2365,7 +2436,7 @@ void ResolveInterruptsVs( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType)
// add this guy to everyone's interrupt queue
AddToIntList(ubIntList[ubSmallestSlot],TRUE,TRUE);
// SANDRO - for IIS, reset counter if we got here
if ( gGameExternalOptions.fImprovedInterruptSystem )
if ( gGameOptions.fImprovedInterruptSystem )
{
// reset the counter
MercPtrs[ ubIntList[ubSmallestSlot] ]->aiData.ubInterruptCounter[pSoldier->ubID] = 0;
+267 -47
View File
@@ -116,8 +116,10 @@
#include "Strategic AI.h"
#endif
#include "Quest Debug System.h"
#include "Quest Debug System.h"
#include "connect.h"
#include "fresh_header.h"
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
class SOLDIERTYPE;
@@ -190,7 +192,11 @@ BOOLEAN gfNextFireJam = FALSE;
INT16 brstmode = 0; //dddd
extern INT16 ITEMDESC_START_X;
extern INT16 ITEMDESC_START_Y;
#include "fresh_header.h"
BOOLEAN gfMouseLockedOnBorder = FALSE;
extern int iWindowedMode;
//Little functions called by keyboard input
void SwapGoggles(SOLDIERTYPE *pTeamSoldier);
@@ -1550,29 +1556,62 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
#endif
// It is not allowed in a network game to go to the load screen, because if you cancel the load screen it is always your turn!
// BEGIN: by Lejardo for mouse-locking in game screen
// WANNE: If the game runs in windowed mode, the user can "lock" / "unlock" the mouse cursor
if (iWindowedMode)
{
SGPRect LJDRect;
if ((InputEvent.usEvent == KEY_DOWN ) && ( InputEvent.usParam == 'z' || InputEvent.usParam == 'y'))
{
if( (InputEvent.usKeyState & CTRL_DOWN) && !(InputEvent.usKeyState & ALT_DOWN))
{
// Unlock the mouse cursor
if (gfMouseLockedOnBorder)
{
FreeMouseCursor();
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_WINDOWED_MODE_RELEASE_MOUSE] );
}
// Lock the mouse cursor
else
{
LJDRect.iLeft = 0;
LJDRect.iTop = 0;
LJDRect.iRight = SCREEN_WIDTH;
LJDRect.iBottom = SCREEN_HEIGHT;
RestrictMouseCursor( &LJDRect );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_WINDOWED_MODE_LOCK_MOUSE] );
}
gfMouseLockedOnBorder = !gfMouseLockedOnBorder;
}
}
}
// END: by Lejardo for mouse-locking in game screen
// WANNE: Just disabled for now, because we don't need it yet.
/*
// WANNE: If the game hangs on enemy turn, just press ALT + CTRL + E and the game will continue with enemy turn!!
if ( (InputEvent.usEvent == KEY_DOWN )&& (InputEvent.usKeyState & CTRL_DOWN) && ( InputEvent.usParam == 'e') )
{
if( InputEvent.usKeyState & ALT_DOWN )
{
if (gTacticalStatus.ubCurrentTeam != 0)
{
if( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
{
EndTurn( 1 );
}
}
}
}
*/
if (!is_networked)
{
// WANNE: Just disabled for now
/*
// WANNE: If the game hangs on enemy turn, just press ALT + CTRL + E and the game will continue with enemy turn!!
if ( (InputEvent.usEvent == KEY_DOWN )&& (InputEvent.usKeyState & CTRL_DOWN) && ( InputEvent.usParam == 'e') )
{
if( InputEvent.usKeyState & ALT_DOWN )
{
if (gTacticalStatus.ubCurrentTeam != 0)
{
if( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
{
EndTurn( 1 );
}
}
}
}
*/
/// Allow to load everywhere
// Allow to load everywhere
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'l') )
{
if( InputEvent.usKeyState & ALT_DOWN )
@@ -1593,7 +1632,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
else if( InputEvent.usKeyState & CTRL_DOWN )
{
// WANNE: Do not allow saving via the save screen when it is not our turn,
// because there is an explit when you close the save window without saving, you can move your merc even it is not your turn
// because there is an exploit when you close the save window without saving, you can move your merc even it is not your turn
// IF UI HAS LOCKED, ONLY ALLOW EXIT!
if ( gfDisableRegionActive || gfUserTurnRegionActive )
{
@@ -1609,7 +1648,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
}
}
}
}
}
if (is_networked)
@@ -1668,8 +1707,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
overide_turn();
}
}
}
}
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'k') )
@@ -1686,8 +1724,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
// OJW - 090209 - ingame chat
if (InputEvent.usEvent == KEY_UP && InputEvent.usParam == 'y')
{
OpenChatMsgBox();
continue;
if( !(InputEvent.usKeyState & ALT_DOWN) && !(InputEvent.usKeyState & CTRL_DOWN))
{
OpenChatMsgBox();
continue;
}
}
} // end is_networked
@@ -2541,14 +2582,23 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
case 'A':
//CHRISL: Ammo Crate
if ( fCtrl )
//MM: Ammo Box
if(!(gTacticalStatus.fEnemyInSector))
{
if(!(gTacticalStatus.fEnemyInSector))
INT32 crateItem;
INT32 worldItem;
UINT8 magType;
bool mergeSuccessful, ammoPresent;
OBJECTTYPE newCrate;
ammoPresent = true;
if (fCtrl)
magType = AMMO_CRATE;
else
magType = AMMO_BOX;
while (ammoPresent)
{
INT32 crateItem;
INT32 worldItem;
bool mergeSuccessful;
OBJECTTYPE newCrate;
//look through all sector items for ammo.
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
{
@@ -2557,20 +2607,25 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
if(Item[gWorldItems[wItem].object.usItem].usItemClass == IC_AMMO && gWorldItems[wItem].bVisible == TRUE && gWorldItems[wItem].fExists && (gWorldItems[wItem].usFlags & WORLD_ITEM_REACHABLE) && !(gWorldItems[wItem].usFlags & WORLD_ITEM_ARMED_BOMB))
{
worldItem = gWorldItems[wItem].object.usItem;
//we don't want to do anything if the world item is already an ammo crate
if(Item[worldItem].ammocrate == TRUE)
//we don't want to do anything if the world item is already an ammo crate/box
if(Magazine[Item[worldItem].ubClassIndex].ubMagType == magType)
continue;
//we have a valid, ammo item. Look through Items.xml and see if we have an ammo crate for
// this ammo type
for(int iLoop = 0; iLoop < MAXITEMS; iLoop++)
{
//if ammocrate && calibers match && Ammo Types match
if(Item[iLoop].ammocrate == TRUE && Magazine[Item[iLoop].ubClassIndex].ubCalibre == Magazine[Item[worldItem].ubClassIndex].ubCalibre && Magazine[Item[iLoop].ubClassIndex].ubAmmoType == Magazine[Item[worldItem].ubClassIndex].ubAmmoType)
if (Item[iLoop].usItemClass == 0)
break; //no more valid items after this point
//if ammo crate && calibers match && Ammo Types match
if(Item[iLoop].usItemClass == IC_AMMO && Magazine[Item[iLoop].ubClassIndex].ubMagType == magType && Magazine[Item[iLoop].ubClassIndex].ubCalibre == Magazine[Item[worldItem].ubClassIndex].ubCalibre && Magazine[Item[iLoop].ubClassIndex].ubAmmoType == Magazine[Item[worldItem].ubClassIndex].ubAmmoType)
{
crateItem = iLoop;
break;
}
}
//if we found a crateItem in the list, we first want to see if we already have an item created
if(crateItem != 0)
{
@@ -2588,9 +2643,10 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
break;
}
}
}
//no crates in sector inventory. search merc inventories
if(mergeSuccessful == false)
if(!mergeSuccessful)
{
for(int loop=0; loop<(int)gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs; loop++)
{
@@ -2616,7 +2672,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
//no crates in merc inventory. create a new sector item
if(mergeSuccessful == false)
if(!mergeSuccessful)
{
CreateAmmo(crateItem, &newCrate, 0);
DistributeStatus(&gWorldItems[wItem].object, &newCrate, Magazine[Item[crateItem].ubClassIndex].ubMagSize);
@@ -2629,10 +2685,29 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
}
else // MM: no crate item, so we must be missing a crate item from the xmls. Set ammoPresent to false to avoid infinitely looping.
ammoPresent = false;
}
}
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
//MM: loop through ammo multiple times, as boxes and crates may take a few passes to fill
ammoPresent = false;
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
{
if(Item[gWorldItems[wItem].object.usItem].usItemClass == IC_AMMO && gWorldItems[wItem].bVisible == TRUE && gWorldItems[wItem].fExists && (gWorldItems[wItem].usFlags & WORLD_ITEM_REACHABLE) && !(gWorldItems[wItem].usFlags & WORLD_ITEM_ARMED_BOMB))
{
worldItem = gWorldItems[wItem].object.usItem;
if(Magazine[Item[worldItem].ubClassIndex].ubMagType == magType)
continue;
ammoPresent = true;
break;
}
}
StackAndSort(TRUE);
}
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
}
break;
case 'J':
@@ -3043,6 +3118,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
SeperateItems();
if( fCtrl )
StackAndSort( TRUE );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
break;
case 'D':
@@ -3134,6 +3210,18 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
break;
case 'H':
// swap primary & secondary hand
if ( gusSelectedSoldier != NOBODY && !AM_A_ROBOT( MercPtrs[ gusSelectedSoldier ] ))
{
SOLDIERTYPE *pSoldier = MercPtrs[ gusSelectedSoldier ];
UINT16 usOldHandItem = pSoldier->inv[HANDPOS].usItem;
SwapHandItems( pSoldier );
pSoldier->ReLoadSoldierAnimationDueToHandItemChange( usOldHandItem, pSoldier->inv[HANDPOS].usItem );
fCharacterInfoPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
}
break;
case 'h':
if ( fAlt )
{
@@ -3276,12 +3364,49 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
SOLDIERTYPE *pSoldier = MercPtrs[ gusSelectedSoldier ];
BOOLEAN handFit = (CanItemFitInPosition(pSoldier, &pSoldier->inv[HANDPOS], GUNSLINGPOCKPOS, FALSE) || (pSoldier->inv[HANDPOS].exists() == false && pSoldier->inv[SECONDHANDPOS].exists() == false));
BOOLEAN slingFit = (CanItemFitInPosition(pSoldier, &pSoldier->inv[GUNSLINGPOCKPOS], HANDPOS, FALSE) || pSoldier->inv[GUNSLINGPOCKPOS].exists() == false);
if(Item[pSoldier->inv[GUNSLINGPOCKPOS].usItem].twohanded && pSoldier->inv[SECONDHANDPOS].exists() == true)
handFit = FALSE;
if( handFit == TRUE && slingFit == TRUE)
{
SwapObjs(&pSoldier->inv[HANDPOS], &pSoldier->inv[GUNSLINGPOCKPOS]);
HandleTacticalEffectsOfEquipmentChange(pSoldier, HANDPOS, pSoldier->inv[GUNSLINGPOCKPOS].usItem, pSoldier->inv[HANDPOS].usItem);
if (gGameOptions.fInventoryCostsAP)
{
UINT8 APCost = 0;
if (pSoldier->inv[GUNSLINGPOCKPOS].exists())
{
APCost += ( APBPConstants [ AP_INV_FROM_SLING ] + APBPConstants [ AP_INV_TO_HANDS ] );
if (gGameExternalOptions.uWeightDivisor != 0)
APCost += DynamicAdjustAPConstants((int)((Item[pSoldier->inv[GUNSLINGPOCKPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor),(int)((Item[pSoldier->inv[GUNSLINGPOCKPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor));
}
if (pSoldier->inv[HANDPOS].exists())
{
APCost += ( APBPConstants [ AP_INV_TO_SLING ] + APBPConstants [ AP_INV_FROM_HANDS ] );
if (gGameExternalOptions.uWeightDivisor != 0)
APCost += DynamicAdjustAPConstants((int)((Item[pSoldier->inv[HANDPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor),(int)((Item[pSoldier->inv[HANDPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor));
}
APCost = __min(APCost, APBPConstants[AP_INV_MAX_COST]);
if (pSoldier->bActionPoints >= APCost)
{
// SANDRO - I dared to change this to use the apropriate function, as that function is actually important for IIS
//pSoldier->bActionPoints -= APCost;
DeductPoints( pSoldier, APCost, 0 );
SwapObjs(&pSoldier->inv[HANDPOS], &pSoldier->inv[GUNSLINGPOCKPOS]);
HandleTacticalEffectsOfEquipmentChange(pSoldier, HANDPOS, pSoldier->inv[GUNSLINGPOCKPOS].usItem, pSoldier->inv[HANDPOS].usItem);
}
else
{
CHAR16 zOutputString[512];
swprintf( zOutputString, New113Message[MSG113_INVENTORY_APS_INSUFFICIENT], APCost, pSoldier->bActionPoints);
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, zOutputString );
}
}
else
{
SwapObjs(&pSoldier->inv[HANDPOS], &pSoldier->inv[GUNSLINGPOCKPOS]);
HandleTacticalEffectsOfEquipmentChange(pSoldier, HANDPOS, pSoldier->inv[GUNSLINGPOCKPOS].usItem, pSoldier->inv[HANDPOS].usItem);
}
}
fCharacterInfoPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
@@ -3694,7 +3819,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
SOLDIERTYPE *pTeamSoldier;
INT8 bLoop;
OBJECTTYPE *pGun, *pAmmo;
UINT16 bullets;
OBJECTTYPE *pGun, *pAmmo, *pAmmoMags;
// Search for soldier
for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++)
@@ -3747,6 +3873,96 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
}
//MM: loop thru the soldiers again (lazy copy/paste :p). could do it all at once, but then there may not be enough ammo from the world items to fill everyone's guns first
for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++)
{
if ( OK_CONTROLLABLE_MERC( pTeamSoldier ) && pTeamSoldier->bAssignment == CurrentSquad( ) && !AM_A_ROBOT( pTeamSoldier ) )
{
// Search for ammo in soldier inventory
for (UINT32 bLoop2 = 0; bLoop2 < pTeamSoldier->inv.size(); bLoop2++)
{
if ( Item[pTeamSoldier->inv[bLoop2].usItem].usItemClass & IC_AMMO )
{
pAmmoMags = &(pTeamSoldier->inv[bLoop2]);
for ( UINT16 stackMag = 0; stackMag < (*pAmmoMags).ubNumberOfObjects; stackMag++ )
{
if ( (*pAmmoMags)[stackMag]->data.ubShotsLeft < Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize )
{
// Search for ammo in sector
for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ )
{
if ( (gWorldItems[ uiLoop ].bVisible == TRUE) && (gWorldItems[ uiLoop ].fExists) && (gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_REACHABLE) && !(gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_ARMED_BOMB) )//item exists, is reachable, is visible and is not trapped
{
if ( ( Item[ gWorldItems[ uiLoop ].object.usItem ].usItemClass & IC_AMMO ) ) // the item is ammo
{
pAmmo = &( gWorldItems[ uiLoop ].object );
if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubCalibre == Magazine[Item[pAmmo->usItem].ubClassIndex].ubCalibre ) // same calibre
{
// same ammo type
if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubAmmoType == Magazine[Item[pAmmo->usItem].ubClassIndex].ubAmmoType )
{
bullets = Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize - (*pAmmoMags)[stackMag]->data.ubShotsLeft;
if ((*pAmmo)[0]->data.ubShotsLeft < bullets)
bullets = (*pAmmo)[0]->data.ubShotsLeft;
(*pAmmoMags)[stackMag]->data.ubShotsLeft += bullets;
(*pAmmo)[0]->data.ubShotsLeft -= bullets;
fCharacterInfoPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
}
if ((*pAmmo)[0]->data.ubShotsLeft == 0)
{
RemoveItemFromPool( gWorldItems[ uiLoop ].sGridNo, uiLoop, gWorldItems[ uiLoop ].ubLevel );
}
}
}
}
}
//MM: if magazines still are partly empty, look through inventory for boxes and crates
if ( (*pAmmoMags)[stackMag]->data.ubShotsLeft < Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize )
{
for (UINT32 uiLoop = 0; uiLoop < pTeamSoldier->inv.size(); uiLoop++)
{
if ( (Item[pTeamSoldier->inv[uiLoop].usItem].usItemClass & IC_AMMO) && Magazine[Item[pTeamSoldier->inv[uiLoop].usItem].ubClassIndex].ubMagType >= AMMO_BOX )
{
pAmmo = &(pTeamSoldier->inv[uiLoop]);
if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubCalibre == Magazine[Item[pAmmo->usItem].ubClassIndex].ubCalibre ) // same calibre
{
// same ammo type
if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubAmmoType == Magazine[Item[pAmmo->usItem].ubClassIndex].ubAmmoType )
{
bullets = Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize - (*pAmmoMags)[stackMag]->data.ubShotsLeft;
if ((*pAmmo)[0]->data.ubShotsLeft < bullets)
bullets = (*pAmmo)[0]->data.ubShotsLeft;
(*pAmmoMags)[stackMag]->data.ubShotsLeft += bullets;
(*pAmmo)[0]->data.ubShotsLeft -= bullets;
fCharacterInfoPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
}
if ((*pAmmo)[0]->data.ubShotsLeft == 0)
DeleteObj(pAmmo);
}
}
}
}
}
}
}
}
}
}
}
else
{
@@ -3858,6 +4074,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
case 'S':
StackAndSort( TRUE );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
break;
case 's':
@@ -4144,7 +4361,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
//else if( gusSelectedSoldier != NOBODY )
break;
case 'z':
if( fCtrl )
if( fCtrl && fAlt )
{
if ( INFORMATION_CHEAT_LEVEL( ) )
{
@@ -4451,6 +4668,10 @@ BOOLEAN HandleCheckForExitArrowsInput( BOOLEAN fAdjustConfirm )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, str );
gubLoneMercAttemptingToAbandonEPCs = FALSE;
}
else if( !gGameExternalOptions.fGridExitInTurnBased && ( gTacticalStatus.uiFlags & TURNBASED ) && ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ CANNOT_LEAVE_IN_TURN_MODE_STR ] );
}
else
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ MERC_IS_TOO_FAR_AWAY_STR ], MercPtrs[ gusSelectedSoldier ]->name );
@@ -6398,7 +6619,6 @@ void StackAndSort( BOOLEAN fRestrictToAmmo )
}
NotifySoldiersToLookforItems( );
//HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
}
}
+320 -26
View File
@@ -334,7 +334,8 @@ bool gbForceWeaponNotReady = false;
bool gbForceWeaponReady = false;
// Flugente: define for maximum temperature
#define OVERHEATING_MAX_TEMPERATURE 60000.0
enum
{
@@ -423,7 +424,10 @@ weaponStartElementHandle(void *userData, const XML_Char *name, const XML_Char **
strcmp(name, "bRecoilX") == 0 || // HEADROCK HAM 4:
strcmp(name, "bRecoilY") == 0 || // HEADROCK HAM 4:
strcmp(name, "ubRecoilDelay") == 0 || // HEADROCK HAM 4:
strcmp(name, "Handling") == 0)) // CHRISL HAM 4:
strcmp(name, "Handling") == 0 || // CHRISL HAM 4
strcmp(name, "usOverheatingJamThreshold") == 0 || // Flugente FTW 1
strcmp(name, "usOverheatingDamageThreshold") == 0 || // Flugente FTW 1
strcmp(name, "usOverheatingSingleShotTemperature") == 0)) // Flugente FTW 1
{
pData->curElement = WEAPON_ELEMENT_WEAPON_PROPERY;
@@ -688,6 +692,21 @@ weaponEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.ubHandling = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "usOverheatingJamThreshold") == 0) // Flugente FTW 1
{
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.usOverheatingJamThreshold = (FLOAT) atof(pData->szCharData);
}
else if(strcmp(name, "usOverheatingDamageThreshold") == 0) // Flugente FTW 1
{
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.usOverheatingDamageThreshold = (FLOAT) atof(pData->szCharData);
}
else if(strcmp(name, "usOverheatingSingleShotTemperature") == 0) // Flugente FTW 1
{
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.usOverheatingSingleShotTemperature = (FLOAT) atof(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -861,8 +880,10 @@ BOOLEAN WriteWeaponStats()
FilePrintf(hFile,"\t\t<ubAimLevels>%d</ubAimLevels>\r\n", Weapon[cnt].ubAimLevels );
FilePrintf(hFile,"\t\t<EasyUnjam>%d</EasyUnjam>\r\n", Weapon[cnt].EasyUnjam);
FilePrintf(hFile,"\t\t<Handling>%d</Handling>\r\n", Weapon[cnt].ubHandling);
FilePrintf(hFile,"\t\t<usOverheatingJamThreshold>%4.2f</usOverheatingJamThreshold>\r\n", Weapon[cnt].usOverheatingJamThreshold); // Flugente FTW 1
FilePrintf(hFile,"\t\t<usOverheatingDamageThreshold>%4.2f</usOverheatingDamageThreshold>\r\n", Weapon[cnt].usOverheatingDamageThreshold);
FilePrintf(hFile,"\t\t<usOverheatingSingleShotTemperature>%4.2f</usOverheatingSingleShotTemperature>\r\n", Weapon[cnt].usOverheatingSingleShotTemperature);
FilePrintf(hFile,"\t</WEAPON>\r\n");
}
@@ -1137,7 +1158,7 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
// should jams apply to enemies?
if (pSoldier->flags.uiStatusFlags & SOLDIER_PC)
{
if ( Item[pSoldier->usAttackingWeapon].usItemClass == IC_GUN && !EXPLOSIVE_GUN( pSoldier->usAttackingWeapon ) )
if ( Item[pSoldier->usAttackingWeapon].usItemClass == IC_GUN && !EXPLOSIVE_GUN( pSoldier->usAttackingWeapon ) && !(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO) )
{
pObj = &(pSoldier->inv[pSoldier->ubAttackingHand]);
if ((*pObj)[0]->data.gun.bGunAmmoStatus > 0)
@@ -1148,6 +1169,19 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
int condition = (*pObj)[0]->data.gun.bGunStatus;
int invertedBaseJamChance = condition + (reliability * 2) -
gGameExternalOptions.ubWeaponReliabilityReductionPerRainIntensity * gbCurrentRainIntensity;
// Flugente FTW 1: If overheating is allowed, a gun will be prone to more overheating if its temperature is high
if ( gGameOptions.fWeaponOverheating )
{
FLOAT overheatjampercentage = GetGunOverheatJamPercentage( pObj ); // how much above the gun's usOverheatingJamThreshold are we? ...
int overheatjamfactor = (int)(100* overheatjampercentage); // We need an integer value and rough percentages
overheatjamfactor = max(0, overheatjamfactor - 100); // If we haven't reached the OverheatJamThreshold, no increased chance of jamming because of overheating
invertedBaseJamChance -= overheatjamfactor; // lower invertedBaseJamChance (thereby increasing jamChance later on)
}
if (invertedBaseJamChance < 0)
invertedBaseJamChance = 0;
else if (invertedBaseJamChance > 100)
@@ -2075,6 +2109,20 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
pSoldier->bDoBurst++;
}
INT16 iOverheatReliabilityMalus = 0;
// Flugente FTW 1: Increase Weapon Temperature
if ( gGameOptions.fWeaponOverheating )
{
FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) ); // ... how much above the gun's usOverheatingDamageThreshold are we? ...
if ( overheatjampercentage > 1.0 )
{
iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
}
GunIncreaseHeat( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) );
}
// CJC: since jamming is no longer affected by reliability, increase chance of status going down for really unreliabile guns
//INT16 ammoReliability = 0; // Madd: ammo reliability affects gun
@@ -2084,7 +2132,8 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
// ammoReliability = Item[(*pGun)[0]->data.gun.usGunAmmoItem].bReliability;
//}
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * GetReliability( &(pSoldier->inv[pSoldier->ubAttackingHand]) ), 0);
// Flugente FTW 1: Added a malus to reliability for overheated guns
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * GetReliability( &(pSoldier->inv[pSoldier->ubAttackingHand]) ) - iOverheatReliabilityMalus, 0);
if ( !PreRandom( uiDepreciateTest ) && ( pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.objectStatus > 1) )
{
@@ -2625,6 +2674,20 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
pSoldier->bDoBurst++;
}
INT16 iOverheatReliabilityMalus = 0;
// Flugente FTW 1: Increase Weapon Temperature
if ( gGameOptions.fWeaponOverheating )
{
FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( &(pSoldier->inv[ pSoldier->ubAttackingHand ])); // ... how much above the gun's usOverheatingDamageThreshold are we? ...
if ( overheatjampercentage > 1.0 )
{
iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
}
GunIncreaseHeat( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) );
}
/* //WarmSteel - Replaced with GetReliability( pObj )
// CJC: since jamming is no longer affected by reliability, increase chance of status going down for really unreliabile guns
INT16 ammoReliability = 0; // Madd: ammo reliability affects gun
@@ -2637,7 +2700,8 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
}
*/
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * ( GetReliability( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) ) ), 0);
// Flugente FTW 1: Added a malus to reliability for overheated guns
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * ( GetReliability( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) ) ) - iOverheatReliabilityMalus, 0);
if ( !PreRandom( uiDepreciateTest ) && ( pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.objectStatus > 1) )
{
@@ -3654,9 +3718,28 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
// RemoveAttachment( pObj, bAttachPos);
//}
// Flugente fix: until now, pobj was always used to determine wether the explosive weapon will fail - but in the case of underbarrel weapons that wasn't the gun fired
// we now determine the real weapon being fired
OBJECTTYPE* pgunobj = pObj;
if ( pSoldier->bWeaponMode & (WM_ATTACHED_GL|WM_ATTACHED_GL_BURST|WM_ATTACHED_GL_AUTO) )
{
// firing an attached weapon
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
{
if ( iter->exists() && Item[ iter->usItem ].usItemClass & (IC_LAUNCHER|IC_LAUNCHER) )
{
pgunobj = &(*iter);
break;
}
}
}
// ATE: Check here if the launcher should fail 'cause of bad status.....
if ( WillExplosiveWeaponFail( pSoldier, pObj ) )
if ( WillExplosiveWeaponFail( pSoldier, pgunobj ) )
{
if ( gGameOptions.fWeaponOverheating )
GunIncreaseHeat( pgunobj );
// Explode dude!
// So we still should have ABC > 0
@@ -3673,6 +3756,9 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
return( FALSE );
}
if ( gGameOptions.fWeaponOverheating )
GunIncreaseHeat( pgunobj );
if ( Weapon[ usItemNum ].sSound != NO_WEAPON_SOUND )
{
if (Item[ usItemNum ].usItemClass == IC_GUN )
@@ -4517,6 +4603,12 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
FLOAT iGunBaseDifficulty = iGunDifficulty;
FLOAT iGunAimDifficulty = iGunDifficulty;
UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
stance = ANIM_PRONE;
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// CALCULATE LINE OF SIGHT
@@ -4618,8 +4710,10 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
iChance = (INT32)iCombinedSkill;
// Add a flat Base bonus from the item and its attachments.
iChance += GetFlatBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
INT32 moda = GetFlatBaseModifier( pInHand, stance );
INT32 modb = GetFlatBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
iChance += (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
// We now begin adding up factors that may increase or decrease Base CTH. They are pooled together to form a percentage
// value.
@@ -4856,8 +4950,10 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
}
// Percent based modifier from the gun and its attachments
iGunBaseDifficulty += (iGunBaseDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
FLOAT umoda = (iGunBaseDifficulty * GetPercentHandlingModifier( pInHand, stance )) / 100;
FLOAT umodb = (iGunBaseDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
iGunBaseDifficulty += ((gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100);
// End gun difficulty modifiers
/////////////////////////////////////////////
@@ -5013,8 +5109,10 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
}
// Percentage based-modifier from the weapon and its attachments
iBaseModifier += GetPercentBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
umoda = (iGunBaseDifficulty * GetPercentBaseModifier( pInHand, stance )) / 100;
umodb = (iGunBaseDifficulty * GetPercentBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
iBaseModifier += ((gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100);
////////////////////////////////////
// Finish BASE CTH calculation:
@@ -5158,7 +5256,9 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
iGunAimDifficulty += iTempPenalty;
}
iGunAimDifficulty += (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
FLOAT umoda = (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, stance )) / 100;
FLOAT umodb = (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
iGunAimDifficulty += (gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100;
// End Gun Handling modifiers
//////////////////////////////////////////
@@ -5313,9 +5413,11 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
{
iAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
}
// Percent modifier from the weapon and its attachments
iAimModifier += GetPercentAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
INT32 moda = GetPercentAimModifier( pInHand, stance );
INT32 modb = GetPercentAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
iAimModifier += (gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100;
// Calculate final max aiming
@@ -5331,7 +5433,9 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
UINT32 uiCap = (UINT32)iCombinedSkill;
// Add percent-based modifier from the gun and its attachments
uiCap += (INT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
UINT32 uimoda = (UINT32)(uiCap * GetPercentCapModifier( pInHand, stance )) / 100;
UINT32 uimodb = (UINT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
uiCap += (UINT32)((gGameExternalOptions.ubProneModifierPercentage * uimoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * uimodb)/100);
// Add bonuses from Sniper Skill. Applies only when using a scope at or above its "best" range.
INT16 sDifference = 99 - uiCap;
@@ -5412,7 +5516,9 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
{
iAimPoints += iAimPointFraction * (ubAllowedAimingLevels-x);
// Add Flat Modifier from the weapon and its attachments
iAimPoints += GetFlatAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
INT32 moda = GetFlatAimModifier( pInHand, stance );
INT32 modb = GetFlatAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
iAimPoints += (gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100;
}
// Finally, add the appropriate number of CTH points to our chance-to-hit, and limit it into good values.
@@ -5838,6 +5944,12 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
MAX_TARGET_COWERING_PENALTY = gGameExternalOptions.usMaxTargetCoweringPenalty;
/////////////////////////////////////////////////////////////////////////////////////
UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
// Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
stance = ANIM_PRONE;
/////////////////////////////////////////////////////////////////////////////////////
// Assign range variables -- all range values are in units (10 units = 1 tile)
iRange = GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sGridNo ); // calculate actual range
@@ -6027,7 +6139,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
break;
case ANIM_STAND:
// if we are prone and at close range, then penalize shots to the torso or head!
if ( iRange <= MIN_PRONE_RANGE && gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
if ( iRange <= MIN_PRONE_RANGE && stance == ANIM_PRONE )
{
if ( ubAimPos == AIM_SHOT_RANDOM || ubAimPos == AIM_SHOT_GLAND )
{
@@ -6285,8 +6397,35 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
{
iBonus = AIM_BONUS_CROUCHING;
}
// if our weapon is rested, factor in the prone position
if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight != stance )
{
INT32 pronebonus = iRange / 10;
if (pronebonus > AIM_BONUS_PRONE)
{
pronebonus = AIM_BONUS_PRONE;
}
iBonus = (INT32)((gGameExternalOptions.ubProneModifierPercentage * pronebonus + (100 - gGameExternalOptions.ubProneModifierPercentage) * iBonus)/100);
}
iChance += iBonus;
}
else if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_STAND )
{
// if our weapon is rested, factor in the prone position
if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight != stance )
{
iBonus = iRange / 10;
if (iBonus > AIM_BONUS_PRONE)
{
iBonus = AIM_BONUS_PRONE;
}
iChance += (INT32)((gGameExternalOptions.ubProneModifierPercentage * iBonus )/100);
}
}
// if shooter is prone, he aims even better, except at really close range
else if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
{
@@ -6300,6 +6439,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
iChance += iBonus;
}
}
//Madd: inherent weapon accuracy bonus
//iChance += Weapon[usInHand].bAccuracy;
/////////////////////////////////////////////////////////////////////////////////////
@@ -6363,14 +6503,20 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
Bipods also grant their flat CTH bonus so we don't need to mess this that here*/
if(gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier)
{
iBonus = GetBurstToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
INT16 moda = GetBurstToHitBonus(pInHand, stance == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
INT16 modb = GetBurstToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
iBonus = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
iPenalty = Weapon[pInHand->usItem].ubBurstPenalty * (pSoldier->bDoBurst - 1) * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
iPenalty = max(0, (iPenalty * (100 - iBonus))/100 );
}
else
{
// Snap: bipod may reduce burst penalty
iPenalty = GetBurstPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
INT16 moda = GetBurstPenalty(pInHand, stance == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
INT16 modb = GetBurstPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
iPenalty = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
if(gGameExternalOptions.bAimedBurstEnabled)
iPenalty += Weapon[usInHand].ubBurstPenalty * (pSoldier->bDoBurst - 1) * gGameExternalOptions.uAimedBurstPenalty;
}
@@ -6399,14 +6545,20 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
Bipods also grant their flat CTH bonus so we don't need to mess this that here*/
if(gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier)
{
iBonus = GetAutoToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
INT16 moda = GetAutoToHitBonus(pInHand, stance == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
INT16 modb = GetAutoToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
iBonus = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
iPenalty = Weapon[pInHand->usItem].AutoPenalty * (pSoldier->bDoBurst - 1) * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
iPenalty = max(0, (iPenalty * (100 - iBonus))/100 );
}
else
{
// Snap: bipod may reduce auto penalty
iPenalty = GetAutoPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
INT16 moda = GetAutoPenalty(pInHand, stance == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
INT16 modb = GetAutoPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
iPenalty = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
if(gGameExternalOptions.bAimedBurstEnabled)
iPenalty += Weapon[usInHand].AutoPenalty * (pSoldier->bDoBurst - 1) * gGameExternalOptions.uAimedBurstPenalty;
}
@@ -6606,7 +6758,10 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
/////////////////////////////////////////////////////////////////////////////////////
// Equipment Modifiers
iChance += GetGearToHitBonus ( pSoldier );
iChance += GetToHitBonus( pInHand, iRange, bLightLevel,gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE && iRange > MIN_PRONE_RANGE );
INT16 moda = GetToHitBonus( pInHand, iRange, bLightLevel, stance && iRange > MIN_PRONE_RANGE );
INT16 modb = GetToHitBonus( pInHand, iRange, bLightLevel, gAnimControl[ pSoldier->usAnimState ].ubEndHeight && iRange > MIN_PRONE_RANGE );
iChance += (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
@@ -10444,7 +10599,19 @@ BOOLEAN WillExplosiveWeaponFail( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj )
{
if ( pSoldier->bTeam == gbPlayerNum || pSoldier->bVisible == 1 )
{
if ( (INT8)(PreRandom( 40 ) + PreRandom( 40 ) ) > (*pObj)[0]->data.objectStatus )
// malus for overheating
INT16 iOverheatMalus = 0;
if ( gGameOptions.fWeaponOverheating )
{
FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( pObj);
if ( overheatjampercentage > 1.0 )
iOverheatMalus = (INT16)floor(5*overheatjampercentage*overheatjampercentage);
iOverheatMalus = max(0, iOverheatMalus - 1);
}
if ( (INT8)(PreRandom( 40 ) + PreRandom( 40 ) + iOverheatMalus) > (*pObj)[0]->data.objectStatus )
{
// Do second dice roll
if ( PreRandom( 2 ) == 1 )
@@ -10840,3 +11007,130 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
gCTHDisplay.FinalMagFactor = iHighestMagFactor;
}
// Flugente FTW 1: Increase temperature of gun in ubAttackingHand
void GunIncreaseHeat( OBJECTTYPE *pObj )
{
if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) // if item is a gun pr launcher...
{
FLOAT guntemperature = (*pObj)[0]->data.bTemperature; // ... get current temperature ...
FLOAT singleshottemperature = GetSingleShotTemperature( pObj ); // ... get temperature rise ...
FLOAT newguntemperature = min(guntemperature + singleshottemperature, (FLOAT)(OVERHEATING_MAX_TEMPERATURE) ); // ... calculate new temperature ...
(*pObj)[0]->data.bTemperature = newguntemperature; // ... apply new temperature
#ifdef JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Gun temperature increased from %4.2f to %4.2f", guntemperature, newguntemperature );
#endif
}
}
// Flugente: Overheating Weapons
FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
{
FLOAT singleshottemperature = 0.0;
if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
{
singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature;
// determine modificator according to attachments
FLOAT modificator = 1.0;
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
{
if (iter->exists())
{
modificator += Item[iter->usItem].overheatTemperatureModificator;
}
}
// determine modificator according to ammo
modificator += AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].temperatureModificator;
singleshottemperature *= modificator;
}
return singleshottemperature;
}
// Flugente FTW 1: Get percentage: temperature/damagethreshold
FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj )
{
FLOAT damagethreshold = GetOverheatDamageThreshold(pObj);
FLOAT temperature = (*pObj)[0]->data.bTemperature;
// to avert nonsense...
damagethreshold = max( (FLOAT)(1.0), damagethreshold);
return temperature/ damagethreshold ;
}
// Flugente FTW 1: Get percentage: temperature/jamthreshold
FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj )
{
FLOAT jamthreshold = GetOverheatJamThreshold(pObj);
FLOAT temperature = (*pObj)[0]->data.bTemperature;
// to avert nonsense...
jamthreshold = max( (FLOAT)(1.0), jamthreshold);
return temperature/ jamthreshold ;
}
FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj )
{
FLOAT jamthreshold = (FLOAT) (OVERHEATING_MAX_TEMPERATURE / 4.0);
if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
{
jamthreshold = Weapon[ pObj->usItem ].usOverheatingJamThreshold;
// determine modificator according to attachments
FLOAT modificator = 1.0;
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
{
if (iter->exists())
{
modificator += Item[iter->usItem].overheatJamThresholdModificator;
}
}
jamthreshold *= modificator;
}
return jamthreshold;
}
FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj )
{
FLOAT damagethreshold = (FLOAT) (OVERHEATING_MAX_TEMPERATURE / 4.0);
if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
{
damagethreshold = Weapon[ pObj->usItem ].usOverheatingDamageThreshold;
// determine modificator according to attachments
FLOAT modificator = 1.0;
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
{
if (iter->exists())
{
modificator += Item[iter->usItem].overheatDamageThresholdModificator;
}
}
damagethreshold *= modificator;
}
return damagethreshold;
}
+23
View File
@@ -125,6 +125,14 @@ enum
AMMO9H
};
enum
{
AMMO_MAGAZINE = 0,
AMMO_BULLET,
AMMO_BOX,
AMMO_CRATE
};
enum
{
AMMO_REGULAR = 0,
@@ -184,6 +192,7 @@ typedef struct
BOOLEAN acidic;
INT16 lockBustingPower;
BOOLEAN tracerEffect;
FLOAT temperatureModificator; // Flugente FTW 1.1: modificator for weapon temperature
//zilpin: pellet spread patterns externalized in XML
INT32 spreadPattern;
@@ -308,12 +317,18 @@ typedef struct
// chooses automatically based on the type of gun (see AllowedAimingLevels() ).
UINT8 ubHandling; // CHRISL HAM 4: This value replaces ubReadyTime for determining a weapons base handling characteristics.
// Flugente FTW 1
FLOAT usOverheatingJamThreshold; // if a gun's temperature is above this treshold, it is increasingly prone to jamming
FLOAT usOverheatingDamageThreshold; // if a gun is fired while its temperature is above this value, it degrades much faster
FLOAT usOverheatingSingleShotTemperature; // a single shot raises a gun's temperature by this amount
} WEAPONTYPE;
typedef struct
{
UINT8 ubCalibre;
UINT16 ubMagSize;
UINT8 ubAmmoType;
UINT8 ubMagType;
UINT32 uiIndex;
} MAGTYPE;
@@ -426,4 +441,12 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
// HEADROCK HAM 4: This gets the Z of a target regardless of what's there.
FLOAT GetTargetZPos( SOLDIERTYPE *pShooter, INT32 sTargetGridNo );
// Flugente: Overheating Weapons
void GunIncreaseHeat( OBJECTTYPE *pObj );
FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj );
FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj ); // Flugente FTW 1: Get percentage: temperature/damagethreshold
FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj ); // Flugente FTW 1: Get percentage: temperature/jamthreshold
FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj );
FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj );
#endif
+61
View File
@@ -809,3 +809,64 @@ void RefreshWorldItemsIntoItemPools( WORLDITEM * pItemList, INT32 iNumberOfItems
}
}
// Flugente FTW 1: Cool down all items in the world (no, really)
void CoolDownWorldItems( void )
{
if ( gGameOptions.fWeaponOverheating ) // if Overheating is used ...
{
for( UINT32 uiCount = 0; uiCount < guiNumWorldItems; ++uiCount ) // ... for all items in the world ...
{
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
{
// ... if Item exists and is a gun, a launcher or a barrel ...
if (Item[gWorldItems[ uiCount ].object.usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gWorldItems[ uiCount ].object.usItem].barrel == TRUE )
{
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... 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 guntemperature = (*pObj)[i]->data.bTemperature; // ... get temperature ...
FLOAT cooldownfactor = GetItemCooldownFactor(pObj); // ... get item cooldown factor provided of attachments ...
if ( Item[gWorldItems[ uiCount ].object.usItem].barrel == TRUE ) // ... a barrel lying around cools down a bit faster ...
cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;
FLOAT newguntemperatre = max(0.0, guntemperature - cooldownfactor); // ... calculate new temperature ...
(*pObj)[i]->data.bTemperature = newguntemperatre; // ... set new temperature
#if 0//def JA2TESTVERSION
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", guntemperature, newguntemperatre );
#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"World: Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature );
#endif
// we assume that there can exist only 1 UGL per weapon
break;
}
}
}
}
}
}
}
}
}
+1
View File
@@ -119,5 +119,6 @@ extern void FindPanicBombsAndTriggers( void );
extern INT32 FindWorldItemForBombInGridNo( INT32 sGridNo, INT8 bLevel);
void RefreshWorldItemsIntoItemPools( WORLDITEM * pItemList, INT32 iNumberOfItems );
void CoolDownWorldItems( void ); // Flugente FTW 1: Cool down all items in the world (no, really)
#endif
+3
View File
@@ -236,6 +236,8 @@ typedef PARSE_STAGE;
#define ENCYCLOPEDIAQUESTSFILENAME "Encyclopedia\\EncyclopediaQuests.xml"
#define BRIEFINGROOMFILENAME "BriefingRoom\\BriefingRoom.xml"
#define OLDAIMARCHIVEFILENAME "OldAIMArchive.xml"
extern BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN WriteItemStats();
@@ -457,4 +459,5 @@ extern void InitNewVehicles ();
extern BOOLEAN ReadInLanguageLocation(STR fileName, BOOLEAN localizedVersion, LANGUAGE_LOCATION *Lang, UINT32 FileType2 );
extern BOOLEAN ReadInAimOldArchive(STR fileName, BOOLEAN localizedVersion);
#endif
+8 -1
View File
@@ -78,7 +78,8 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
strcmp(name, "lockBustingPower") == 0 ||
strcmp(name, "acidic") == 0 ||
strcmp(name, "tracerEffect") == 0 ||
strcmp(name, "monsterSpit") == 0 ))
strcmp(name, "monsterSpit") == 0 ||
strcmp(name, "temperatureModificator") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -276,6 +277,11 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curAmmoType.tracerEffect = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "temperatureModificator") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.temperatureModificator = (FLOAT) atof(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -397,6 +403,7 @@ BOOLEAN WriteAmmoTypeStats()
FilePrintf(hFile,"\t\t<ignoreArmour>%d</ignoreArmour>\r\n", AmmoTypes[cnt].ignoreArmour );
FilePrintf(hFile,"\t\t<lockBustingPower>%d</lockBustingPower>\r\n", AmmoTypes[cnt].lockBustingPower );
FilePrintf(hFile,"\t\t<tracerEffect>%d</tracerEffect>\r\n", AmmoTypes[cnt].tracerEffect );
FilePrintf(hFile,"\t\t<temperatureModificator>%4.2f</temperatureModificator>\r\n", AmmoTypes[cnt].temperatureModificator );
FilePrintf(hFile,"\t</AMMOTYPE>\r\n");
+78 -18
View File
@@ -28,20 +28,48 @@ typedef lbepocketParseData;
BOOLEAN onlyLocalizedText;
BOOLEAN lbepocketStartElementHandleLoop(const XML_Char *name, lbepocketParseData * pData) //Tais
{
UINT8 i=0;
CHAR8 str1 [40] = "";
CHAR8 str2 [40] = "";
for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
{
sprintf(str1,"ItemCapacityPerSize.%d",i);
sprintf(str2,"ItemCapacityPerSize%d",i);
if(strcmp(name, str1)==0||strcmp(name, str2)==0)
{
//DBrot: same routine as the actual reading part below, but no data is read here, only the validity check
CHAR8 refstr[20] = "ItemCapacityPerSize";
UINT8 pos = 19;
if(strncmp(refstr, name, 19) == 0){
if(name[pos]=='.'){
pos++;
}
CHAR8 index[5] = "\0\0\0\0";
UINT8 i = 0;
while(name[pos]!='\0' && i < 5){
index[i]=name[pos];
pos++;
i++;
}
UINT16 size = (UINT16) atol(index);
if(size<=gGameExternalOptions.guiMaxItemSize){
return true;
}
}
return false;
}
/* DBrot: Replaced with a more efficient way
UINT16 i=0;
CHAR8 str1 [40] = "";
for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
{
sprintf(str1,"ItemCapacityPerSize%d",i);
if(strcmp(name, str1)==0)
{
return true;
}
}
for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
{
sprintf(str1,"ItemCapacityPerSize.%d",i);
if(strcmp(name, str1)==0)
{
return true;
}
}
return false;
}*/
static void XMLCALL
lbepocketStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
@@ -138,9 +166,8 @@ lbepocketCharacterDataHandle(void *userData, const XML_Char *str, int len)
static void XMLCALL
lbepocketEndElementHandle(void *userData, const XML_Char *name)
{
UINT8 i=0;
CHAR8 str1 [40] = "";
CHAR8 str2 [40] = "";
//UINT16 i=0;
//CHAR8 str1 [40] = "";
lbepocketParseData * pData = (lbepocketParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth) //we're at the end of an element that we've been reading
@@ -194,19 +221,52 @@ lbepocketParseData * pData = (lbepocketParseData *)userData;
pData->curLBEPocket.pRestriction = (UINT32) atol(pData->szCharData);
} //Tais fixed this.
else
{
{ //DBrot: Enhanced parsing routine to avoid excessive load times for larger (~1000) numbers of item sizes
//-test the prefix if we have an "ItemCapacityPerSize###" tag
//-get the only significant portion of that tag, the item size in question
//-convert it to a useable index, check against max_item_size and get the data
CHAR8 refstr[20] = "ItemCapacityPerSize";
UINT8 pos = 19;
if(strncmp(refstr, name, 19) == 0){
if(name[pos]=='.'){
pos++;
}
CHAR8 index[5] = "\0\0\0\0";
UINT8 i = 0;
while(name[pos]!='\0' && i < 5){
index[i]=name[pos];
pos++;
i++;
}
UINT16 size = (UINT16) atol(index);
if(size<=gGameExternalOptions.guiMaxItemSize){
pData->curElement = ELEMENT;
pData->curLBEPocket.ItemCapacityPerSize[size] = (UINT8) atol(pData->szCharData);
}
}
}
/* DBrot: Replaced with a more efficient way
for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
{
sprintf(str1,"ItemCapacityPerSize.%d",i);
sprintf(str2,"ItemCapacityPerSize%d",i);
if(strcmp(name, str1)==0||strcmp(name, str2)==0)
sprintf(str1,"ItemCapacityPerSize%d",i);
if(strcmp(name, str1)==0)
{
pData->curElement = ELEMENT;
pData->curLBEPocket.ItemCapacityPerSize[i] = (UINT8) atol(pData->szCharData);
break;
}
}
}
for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
{
sprintf(str1,"ItemCapacityPerSize.%d",i);
if(strcmp(name, str1)==0)
{
pData->curElement = ELEMENT;
pData->curLBEPocket.ItemCapacityPerSize[i] = (UINT8) atol(pData->szCharData);
break;
}
}
}*/
/* JMich - these are no longer needed
else if(strcmp(name, "ItemCapacityPerSize.0") == 0 || strcmp(name, "ItemCapacityPerSize0") == 0)
{
@@ -460,7 +520,7 @@ BOOLEAN ReadInLBEPocketStats(STR fileName, BOOLEAN localizedVersion)
}
BOOLEAN WriteLBEPocketEquipmentStats()
{
UINT8 i;
UINT16 i;
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"writelbepocketsstats");
HWFILE hFile;
+8 -1
View File
@@ -50,7 +50,8 @@ magazineStartElementHandle(void *userData, const XML_Char *name, const XML_Char
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "ubCalibre") == 0 ||
strcmp(name, "ubMagSize") == 0 ||
strcmp(name, "ubAmmoType") == 0 ))
strcmp(name, "ubAmmoType") == 0 ||
strcmp(name, "ubMagType") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -117,6 +118,11 @@ magazineEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curMagazine.ubAmmoType = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "ubMagType") == 0)
{
pData->curElement = ELEMENT;
pData->curMagazine.ubMagType = (UINT8) atol(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -213,6 +219,7 @@ BOOLEAN WriteMagazineStats()
FilePrintf(hFile,"\t\t<ubCalibre>%d</ubCalibre>\r\n", Magazine[cnt].ubCalibre );
FilePrintf(hFile,"\t\t<ubMagSize>%d</ubMagSize>\r\n", Magazine[cnt].ubMagSize );
FilePrintf(hFile,"\t\t<ubAmmoType>%d</ubAmmoType>\r\n", Magazine[cnt].ubAmmoType );
FilePrintf(hFile,"\t\t<ubMagType>%d</ubMagType>\r\n", Magazine[cnt].ubMagType );
FilePrintf(hFile,"\t</MAGAZINE>\r\n");
}
+8
View File
@@ -72,6 +72,7 @@ MercStartingGearStartElementHandle(void *userData, const XML_Char *name, const X
}
else if(pData->curElement == ELEMENT_SUBLIST &&
(strcmp(name, "mAbsolutePrice") == 0 ||
strcmp(name, "mGearKitName") == 0 ||
strcmp(name, "mPriceMod") == 0 ||
strcmp(name, "mHelmet") == 0 ||
strcmp(name, "mHelmetStatus") == 0 ||
@@ -209,6 +210,7 @@ MercStartingGearEndElementHandle(void *userData, const XML_Char *name)
//CHRISL: after writing the gearkit, we need to clear gear data so it won't inadvertantly be reused
pData->curMercStartingGear.PriceModifier = 0;
pData->curMercStartingGear.AbsolutePrice = -1;
pData->curMercStartingGear.mGearKitName[0] = '\0';
for(unsigned int i = 0; i < pData->curMercStartingGear.inv.size(); i++)
{
pData->curMercStartingGear.inv[i] = 0;
@@ -237,6 +239,12 @@ MercStartingGearEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT_SUBLIST;
pData->curMercStartingGear.AbsolutePrice = (int) atol(pData->szCharData);
}
else if(strcmp(name, "mGearKitName") == 0)
{
pData->curElement = ELEMENT_SUBLIST;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curMercStartingGear.mGearKitName, sizeof(pData->curMercStartingGear.mGearKitName)/sizeof(pData->curMercStartingGear.mGearKitName[0]) );
pData->curMercStartingGear.mGearKitName[sizeof(pData->curMercStartingGear.mGearKitName)/sizeof(pData->curMercStartingGear.mGearKitName[0]) - 1] = '\0';
}
else if(strcmp(name, "mHelmet") == 0)
{
pData->curElement = ELEMENT_SUBLIST;
+77 -25
View File
@@ -56,6 +56,8 @@
#include "Ja25_Tactical.h"
#endif
#include "connect.h"
//rain
//#define VIS_DIST_DECREASE_PER_RAIN_INTENSITY 20
//end rain
@@ -868,7 +870,7 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
if ((gTacticalStatus.uiFlags & TURNBASED) &&
(gTacticalStatus.uiFlags & INCOMBAT) &&
(ubSightFlags & SIGHT_INTERRUPT) &&
(!gGameExternalOptions.fImprovedInterruptSystem || gGameExternalOptions.fAllowInstantInterruptsOnSight ) )
(!gGameOptions.fImprovedInterruptSystem || gGameExternalOptions.fAllowInstantInterruptsOnSight ) )
{
ResolveInterruptsVs( pSoldier, SIGHTINTERRUPT );
}
@@ -896,9 +898,13 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
RadioSightings(pSoldier,EVERYBODY, MILITIA_TEAM);
#endif*/
//ddd{
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
RadioSightings(pSoldier,EVERYBODY, MILITIA_TEAM);
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
RadioSightings(pSoldier,EVERYBODY, MILITIA_TEAM);
//haydent
if(is_networked && pSoldier->bSide == 0 && pSoldier->bTeam != OUR_TEAM)
RadioSightings(pSoldier,EVERYBODY, OUR_TEAM);
//ddd}
// if it's our local player's merc
if (PTR_OURTEAM)
@@ -1403,15 +1409,23 @@ void EndMuzzleFlash( SOLDIERTYPE * pSoldier )
*/
//ddd{
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{ if ( pSoldier->bTeam != gbPlayerNum && pSoldier->bTeam != MILITIA_TEAM )
pSoldier->bVisible = 0; // indeterminate state
//haydent
if(is_networked && pSoldier->bSide == 0)
{
//stay visible
}
else
{
if ( pSoldier->bTeam != gbPlayerNum )
pSoldier->bVisible = 0; // indeterminate state
}
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{ if ( pSoldier->bTeam != gbPlayerNum && pSoldier->bTeam != MILITIA_TEAM )
pSoldier->bVisible = 0; // indeterminate state
}
else
{
if ( pSoldier->bTeam != gbPlayerNum )
pSoldier->bVisible = 0; // indeterminate state
}
}//haydent
//ddd}
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
@@ -1454,6 +1468,9 @@ else
pSoldier->bVisible = TRUE; // yes, still seen
}
//ddd}
//haydent
if(is_networked && pOtherSoldier->bSide == 0 && pOtherSoldier->bTeam != OUR_TEAM)pSoldier->bVisible = TRUE; // yes, still seen
}
}
}
@@ -1814,16 +1831,24 @@ void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT
}
*/
//ddd{
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{ if ( (pSoldier->bTeam == gbPlayerNum || pSoldier->bTeam == MILITIA_TEAM) && !(pOpponent->bTeam == gbPlayerNum || pOpponent->bTeam == MILITIA_TEAM ) )
pOpponent->bVisible = 0;
//haydent
if(is_networked && pSoldier->bSide == 0)
{
//stay visible
}
else
{ if ( pSoldier->bTeam == gbPlayerNum && pOpponent->bTeam != gbPlayerNum )
pOpponent->bVisible = 0;
}
//ddd}
{
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{ if ( (pSoldier->bTeam == gbPlayerNum || pSoldier->bTeam == MILITIA_TEAM) && !(pOpponent->bTeam == gbPlayerNum || pOpponent->bTeam == MILITIA_TEAM ) )
pOpponent->bVisible = 0;
}
else
{
if ( pSoldier->bTeam == gbPlayerNum && pOpponent->bTeam != gbPlayerNum )
pOpponent->bVisible = 0;
}
//ddd}
}//haydent
}
}
#ifdef TESTOPPLIST
@@ -2591,6 +2616,10 @@ else
if (PTR_OURTEAM && (pOpponent->bVisible <= 0))
SEE_MENT = TRUE;
}
//haydent
if((is_networked && pSoldier->bSide == 0 && pSoldier->bTeam != OUR_TEAM) && (pOpponent->bVisible <= 0))SEE_MENT = TRUE;
//ddd}
/*comm by ddd
@@ -2770,16 +2799,28 @@ void OtherTeamsLookForMan(SOLDIERTYPE *pOpponent)
}
*/
//ddd{
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{
if ((pOpponent->bTeam != gbPlayerNum && pOpponent->bTeam != MILITIA_TEAM) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
pOpponent->bVisible = 0;
//haydent
if(is_networked && pOpponent->bSide == 0)
{
//stay visible
}
else
{
if ((pOpponent->bTeam != gbPlayerNum) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
pOpponent->bVisible = 0;
}
if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{
if ((pOpponent->bTeam != gbPlayerNum && pOpponent->bTeam != MILITIA_TEAM) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
pOpponent->bVisible = 0;
}
else
{
if ((pOpponent->bTeam != gbPlayerNum) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
pOpponent->bVisible = 0;
}
}//haydent
//ddd}
#ifdef TESTOPPLIST
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3,
@@ -3269,6 +3310,14 @@ void BetweenTurnsVisibilityAdjustments(void)
{
//ddd{
BOOLEAN SEE_MENT = FALSE;
if(is_networked && pSoldier->bSide == 0)//haydent
{
//stay visible
}
else
{
if (gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{if (!PTR_OURTEAM && pSoldier->bTeam != MILITIA_TEAM)
SEE_MENT = TRUE;
@@ -3276,6 +3325,8 @@ void BetweenTurnsVisibilityAdjustments(void)
else
{ if (!PTR_OURTEAM) SEE_MENT = TRUE;
}
}//haydent
//ddd}
/*comm by ddd
#ifdef WE_SEE_WHAT_MILITIA_SEES_AND_VICE_VERSA
@@ -3284,6 +3335,7 @@ void BetweenTurnsVisibilityAdjustments(void)
if (!PTR_OURTEAM)
#endif
*/
if(SEE_MENT)
{
// check if anyone on our team currently sees him (exclude NOBODY)
+1
View File
@@ -337,6 +337,7 @@ public:
UINT16 mIndex;
INT16 PriceModifier;
INT16 AbsolutePrice;
CHAR16 mGearKitName[80];
CHAR8 mName[80];
char endOfPOD; // marker for end of POD (plain old data)
std::vector<int> inv;