mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
New feature: advanced repair/dirt system
- items now have an internal repair value that can be lowered through damage taken. They can only be repaired up to that value by your mercs, onyl smiths can fully restore it to 100% - guns get dirty over time, especially when shooting. Thsi can cause them to jam. Use cleaning kits (item #1576) to clean them by pressing 'Alt' + '.' - more on this feature in http://www.bears-pit.com/board/ubbthreads.php/topics/308926/New_feature_advanced_repair_di.html#Post308926 - this requires GameDir revision 1496 or higher WARING! THIS BREAKS SAVEGAME COMPATIBIITY! git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5480 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+3
-6
@@ -22,7 +22,6 @@
|
||||
#include "Campaign Types.h"
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "environment.h"
|
||||
//#include "Game Clock.h"
|
||||
#include "WorldDat.h"
|
||||
#include "Facilities.h"
|
||||
#endif
|
||||
@@ -33,13 +32,11 @@ class SOLDIERTYPE;
|
||||
|
||||
extern MoraleEvent gbMoraleEvent[NUM_MORALE_EVENTS];
|
||||
|
||||
UINT8 gSectorWaterType[256][4];
|
||||
|
||||
//extern BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse );
|
||||
//extern BOOLEAN TacticalRemoveSoldier( UINT16 usSoldierIndex );
|
||||
extern BOOLEAN GetSectorFlagStatus( INT16 sMapX, INT16 sMapY, UINT8 bMapZ, UINT32 uiFlagToSet );
|
||||
extern BOOLEAN IsVehicle(SOLDIERTYPE *pSoldier);
|
||||
|
||||
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||
|
||||
// these midifiers are applied separately for both food and water
|
||||
// apart from the ubStatDamageChance values, be careful not to set any modifiers below -50 or above 0 unless you know what you are doing!!!
|
||||
FoodMoraleMod FoodMoraleMods[NUM_FOOD_MORALE_TYPES] =
|
||||
@@ -724,7 +721,7 @@ UINT8 GetWaterQuality(INT16 asMapX, INT16 asMapY, INT8 asMapZ)
|
||||
UINT8 ubSectorId = SECTOR(asMapX, asMapY);
|
||||
if (asMapZ == 0 && ubSectorId >= 0 && ubSectorId < 256 )
|
||||
{
|
||||
waterquality = gSectorWaterType[ubSectorId][asMapZ];
|
||||
waterquality = SectorExternalData[ubSectorId][asMapZ].usWaterType;
|
||||
}
|
||||
|
||||
return waterquality;
|
||||
|
||||
@@ -4607,6 +4607,8 @@ BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot )
|
||||
// item breaks, and becomes unusable... so its status is reduced
|
||||
// to somewhere between 1 and the 1 less than USABLE
|
||||
(*pObj)[0]->data.objectStatus = (INT8) ( 1 + Random( USABLE - 1 ) );
|
||||
|
||||
(*pObj)[0]->data.sRepairThreshold = min( (*pObj)[0]->data.objectStatus, (*pObj)[0]->data.sRepairThreshold - 2*Random(10) );
|
||||
}
|
||||
}
|
||||
else // it's already unusable
|
||||
|
||||
+323
-219
@@ -1890,7 +1890,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
CHAR16 pStr[1000];
|
||||
|
||||
///////////////// PRIMARY DATA - ICONS
|
||||
for (cnt = 0; cnt < 5; cnt++)
|
||||
for (cnt = 0; cnt < 6; cnt++)
|
||||
{
|
||||
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
|
||||
(INT16)(gItemDescGenRegions[cnt][0].sLeft),
|
||||
@@ -1923,7 +1923,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 2 ] );
|
||||
}
|
||||
|
||||
if ( gGameOptions.fWeaponOverheating ) // Flugente FTW 1.1
|
||||
if ( gGameOptions.fWeaponOverheating ) // Flugente
|
||||
{
|
||||
//////////////////// TEMPERATURE MODIFICATOR
|
||||
{
|
||||
@@ -1932,7 +1932,15 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
}
|
||||
|
||||
//////////////////// POISON PERCENTAGE
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 4 ] );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 4 ] );
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem ) // Flugente
|
||||
{
|
||||
//////////////////// DIRT MODIFICATOR
|
||||
{
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 5 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3702,10 +3710,11 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
cnt++;
|
||||
}
|
||||
}*/
|
||||
// Flugente FTW 1.1:
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
|
||||
// Flugente
|
||||
if ( gGameOptions.fWeaponOverheating || gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || ( Item[gpItemDescObject->usItem].barrel == TRUE ) || ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ))
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
@@ -3732,7 +3741,13 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
}
|
||||
}
|
||||
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
{
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
///////////////////// SINGLE SHOT TEMPERATURE
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
@@ -3798,33 +3813,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
cnt++;
|
||||
}
|
||||
else if ( Item[gpItemDescObject->usItem].barrel == TRUE ) // for barrel items
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
|
||||
iRegionsCreated++;
|
||||
|
||||
for (cnt2 = 1; cnt2 < 4; cnt2++)
|
||||
{
|
||||
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
|
||||
MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
|
||||
|
||||
MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
|
||||
SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
|
||||
|
||||
iRegionsCreated++;
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
|
||||
{
|
||||
///////////////////// COOLDOWN FACTOR
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
@@ -3837,33 +3826,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
|
||||
// other stuff: various overheat modificators
|
||||
if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) )
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
|
||||
iRegionsCreated++;
|
||||
|
||||
for (cnt2 = 1; cnt2 < 4; cnt2++)
|
||||
{
|
||||
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
|
||||
MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
|
||||
|
||||
MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
|
||||
SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
|
||||
|
||||
iRegionsCreated++;
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
|
||||
{
|
||||
///////////////////// TEMPERATURE MODIFICATOR
|
||||
if ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 )
|
||||
{
|
||||
@@ -3914,52 +3877,61 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
|
||||
}
|
||||
}
|
||||
|
||||
//#ifdef ENABLE_ZOMBIES
|
||||
// Flugente Zombies
|
||||
//if ( gGameSettings.fOptions[TOPTION_ZOMBIES] )
|
||||
//{
|
||||
if(!cnt) cnt += 2;
|
||||
if(!cnt) cnt += 2;
|
||||
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
|
||||
iRegionsCreated++;
|
||||
|
||||
for (cnt2 = 1; cnt2 < 4; cnt2++)
|
||||
{
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
|
||||
MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
|
||||
|
||||
MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
|
||||
SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
|
||||
|
||||
iRegionsCreated++;
|
||||
|
||||
for (cnt2 = 1; cnt2 < 4; cnt2++)
|
||||
{
|
||||
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
|
||||
(INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
|
||||
MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
|
||||
|
||||
MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
|
||||
SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
|
||||
|
||||
iRegionsCreated++;
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
}
|
||||
++cnt;
|
||||
|
||||
///////////////////// poison percentage
|
||||
// only draw if item is poisoned in any way
|
||||
if ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) )
|
||||
///////////////////// poison percentage
|
||||
// only draw if item is poisoned in any way
|
||||
if ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) )
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 56 ], szUDBAdvStatsExplanationsTooltipText[ 56 ]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
///////////////////// DIRT MODIFICATOR
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 56 ], szUDBAdvStatsExplanationsTooltipText[ 56 ]);
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
//}
|
||||
//#endif
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 57 ], szUDBAdvStatsExplanationsTooltipText[ 57 ]);
|
||||
}
|
||||
SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
|
||||
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
gubDescBoxTotalAdvLines = (UINT8)cnt;
|
||||
}
|
||||
@@ -4348,22 +4320,24 @@ void DrawAmmoStats( OBJECTTYPE * gpItemDescObject )
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAmmoIcon, 2, gItemDescGenRegions[2][0].sLeft+sOffsetX, gItemDescGenRegions[2][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
if ( gGameOptions.fWeaponOverheating ) // Flugente FTW 1.1
|
||||
if ( gGameOptions.fWeaponOverheating ) // Flugente
|
||||
{
|
||||
//////////////// TEMPERATURE MODIFICATOR
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAmmoIcon, 16, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
}
|
||||
//#ifdef ENABLE_ZOMBIES
|
||||
//if ( gGameSettings.fOptions[TOPTION_ZOMBIES] ) // Flugente Zombies
|
||||
//{
|
||||
//////////////// POISON PERCENTAGE
|
||||
//{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWH40KIcon, 6, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
//}
|
||||
//}
|
||||
//#endif
|
||||
|
||||
//////////////// POISON PERCENTAGE
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWH40KIcon, 6, gItemDescGenRegions[4][0].sLeft+sOffsetX, gItemDescGenRegions[4][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem ) // Flugente
|
||||
{
|
||||
//////////////// DIRT MODIFICATOR
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAmmoIcon, 17, gItemDescGenRegions[5][0].sLeft+sOffsetX, gItemDescGenRegions[5][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
DrawSecondaryStats( gpItemDescObject );
|
||||
}
|
||||
@@ -5160,12 +5134,20 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
|
||||
}
|
||||
*/
|
||||
|
||||
// Flugente FTW 1.1
|
||||
// Flugente
|
||||
// new line is necessary
|
||||
if ( gGameOptions.fWeaponOverheating || gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gpItemDescObject->usItem].barrel == TRUE || ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) )
|
||||
{
|
||||
++cnt; // for the new index-line
|
||||
}
|
||||
}
|
||||
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
{
|
||||
if( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
++cnt; // for the new index-line
|
||||
///////////////////// SINGLE SHOT TEMPERATURE
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
@@ -5196,7 +5178,6 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
|
||||
}
|
||||
else if( Item[gpItemDescObject->usItem].barrel == TRUE ) // for barrel items
|
||||
{
|
||||
++cnt; // for the new index-line
|
||||
///////////////////// COOLDOWN FACTOR
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
@@ -5208,7 +5189,6 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
|
||||
// for overheat modifiers on attachments and wherenot
|
||||
if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) )
|
||||
{
|
||||
++cnt; // for the new index-line
|
||||
///////////////////// TEMPERATURE MODIFICATOR
|
||||
if ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 )
|
||||
{
|
||||
@@ -5251,26 +5231,33 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
|
||||
}
|
||||
}
|
||||
|
||||
//#ifdef ENABLE_ZOMBIES
|
||||
// Flugente Zombies
|
||||
// if ( gGameSettings.fOptions[TOPTION_ZOMBIES] )
|
||||
// {
|
||||
if(!cnt) cnt += 2;
|
||||
if(!cnt) cnt += 2;
|
||||
|
||||
++cnt; // for the new index-line
|
||||
++cnt; // for the new index-line
|
||||
|
||||
///////////////////// poison percentage
|
||||
// only draw if item is poisoned in any way
|
||||
if ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) )
|
||||
///////////////////// poison percentage
|
||||
// only draw if item is poisoned in any way
|
||||
if ( Item[gpItemDescObject->usItem].bPoisonPercentage != 0 || ( (Item[gpItemDescObject->usItem].usItemClass & IC_GUN) && AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage != 0 ) )
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWH40KIcon, 6, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
///////////////////// DIRT MODIFICATOR
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoWH40KIcon, 6, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 55, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
//}
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
void DrawMiscStats( OBJECTTYPE * gpItemDescObject )
|
||||
@@ -7630,7 +7617,7 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
|
||||
}
|
||||
|
||||
|
||||
if ( gGameOptions.fWeaponOverheating ) // Flugente FTW 1.1
|
||||
if ( gGameOptions.fWeaponOverheating ) // Flugente
|
||||
{
|
||||
///////////////////// TEMPERATURE MODIFICATOR
|
||||
// Set line to draw into
|
||||
@@ -7691,26 +7678,83 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
|
||||
//#ifdef ENABLE_ZOMBIES
|
||||
// if ( gGameSettings.fOptions[TOPTION_ZOMBIES] ) // Flugente Zombies
|
||||
// {
|
||||
///////////////////// POISON PERCENTAGE
|
||||
///////////////////// POISON PERCENTAGE
|
||||
// Set line to draw into
|
||||
ubNumLine = 4;
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescGenRegions[ubNumLine][1].sTop;
|
||||
sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop;
|
||||
|
||||
// base modificator
|
||||
INT16 basevalue = AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage;
|
||||
INT16 modificator = 0; // Does not exist (yet?)
|
||||
INT16 finalvalue = basevalue - modificator;
|
||||
|
||||
// Print base value
|
||||
SetFontForeground( 5 );
|
||||
sLeft = gItemDescGenRegions[ubNumLine][1].sLeft;
|
||||
sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft;
|
||||
swprintf( pStr, L"%d", basevalue );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
|
||||
// modifier
|
||||
SetFontForeground( 5 );
|
||||
if ( modificator > 0 )
|
||||
{
|
||||
SetFontForeground( ITEMDESC_FONTPOSITIVE );
|
||||
swprintf( pStr, L"%d", modificator );
|
||||
}
|
||||
else if ( modificator < 0 )
|
||||
{
|
||||
SetFontForeground( ITEMDESC_FONTNEGATIVE );
|
||||
swprintf( pStr, L"%d", modificator );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, L"--" );
|
||||
}
|
||||
|
||||
sLeft = gItemDescGenRegions[ubNumLine][2].sLeft;
|
||||
sWidth = gItemDescGenRegions[ubNumLine][2].sRight - sLeft;
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
|
||||
// Print final value
|
||||
SetFontForeground( FONT_MCOLOR_WHITE );
|
||||
sLeft = gItemDescGenRegions[ubNumLine][3].sLeft;
|
||||
sWidth = gItemDescGenRegions[ubNumLine][3].sRight - sLeft;
|
||||
swprintf( pStr, L"%d", finalvalue );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem ) // Flugente
|
||||
{
|
||||
///////////////////// DIRT MODIFICATOR
|
||||
// Set line to draw into
|
||||
ubNumLine = 4;
|
||||
ubNumLine = 5;
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescGenRegions[ubNumLine][1].sTop;
|
||||
sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop;
|
||||
|
||||
// base modificator
|
||||
INT16 basevalue = AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].poisonPercentage;
|
||||
INT16 modificator = 0; // Does not exist (yet?)
|
||||
INT16 finalvalue = basevalue - modificator;
|
||||
FLOAT basevalue = AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].dirtModificator;
|
||||
FLOAT modificator = 0; // Does not exist (yet?)
|
||||
FLOAT finalvalue = basevalue - modificator;
|
||||
|
||||
// Print base value
|
||||
SetFontForeground( 5 );
|
||||
if ( basevalue > 0.0 )
|
||||
{
|
||||
SetFontForeground( ITEMDESC_FONTNEGATIVE );
|
||||
}
|
||||
else if ( basevalue < 0.0 )
|
||||
{
|
||||
SetFontForeground( ITEMDESC_FONTPOSITIVE );
|
||||
}
|
||||
sLeft = gItemDescGenRegions[ubNumLine][1].sLeft;
|
||||
sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft;
|
||||
swprintf( pStr, L"%d", basevalue );
|
||||
swprintf( pStr, L"%3.2f", basevalue );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
|
||||
@@ -7718,13 +7762,13 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
|
||||
SetFontForeground( 5 );
|
||||
if ( modificator > 0 )
|
||||
{
|
||||
SetFontForeground( ITEMDESC_FONTPOSITIVE );
|
||||
swprintf( pStr, L"%d", modificator );
|
||||
SetFontForeground( ITEMDESC_FONTNEGATIVE );
|
||||
swprintf( pStr, L"%3.2f", modificator );
|
||||
}
|
||||
else if ( modificator < 0 )
|
||||
{
|
||||
SetFontForeground( ITEMDESC_FONTNEGATIVE );
|
||||
swprintf( pStr, L"%d", modificator );
|
||||
SetFontForeground( ITEMDESC_FONTPOSITIVE );
|
||||
swprintf( pStr, L"%3.2f", modificator );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7740,11 +7784,10 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
|
||||
SetFontForeground( FONT_MCOLOR_WHITE );
|
||||
sLeft = gItemDescGenRegions[ubNumLine][3].sLeft;
|
||||
sWidth = gItemDescGenRegions[ubNumLine][3].sRight - sLeft;
|
||||
swprintf( pStr, L"%d", finalvalue );
|
||||
swprintf( pStr, L"%3.2f", finalvalue );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
// }
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
else if (gubDescBoxPage == 2)
|
||||
{
|
||||
@@ -10939,10 +10982,10 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
||||
}
|
||||
*/
|
||||
|
||||
// Flugente FTW 1.1
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
// Flugente: draw a new description line
|
||||
if ( gGameOptions.fWeaponOverheating || gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || ( Item[gpItemDescObject->usItem].barrel == TRUE ) )
|
||||
{
|
||||
///////////////////////////////////////////////////// INDEXES
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
@@ -10968,7 +11011,14 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
{
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
///////////////////// SINGLE SHOT TEMPERATURE
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
@@ -11266,91 +11316,145 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
|
||||
}
|
||||
|
||||
// Flugente Zombies
|
||||
//#ifdef USE_ZOMBIES
|
||||
// if ( gGameSettings.fOptions[TOPTION_ZOMBIES] )
|
||||
//{
|
||||
///////////////////////////////////////////////////// INDEXES
|
||||
if(!cnt) cnt += 2;
|
||||
///////////////////////////////////////////////////// INDEXES
|
||||
if(!cnt) cnt += 2;
|
||||
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
SetFontForeground( FONT_MCOLOR_WHITE );
|
||||
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
|
||||
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
|
||||
|
||||
// Repeatedly draw each index: four separate column headers per index.
|
||||
for (UINT8 i = 0; i < 4; i++)
|
||||
{
|
||||
// Select "PROPERTY", "0", "+" or "=" as appropriate.
|
||||
swprintf(pStr, L"%s", gzItemDescGenIndexes[ i ]);
|
||||
|
||||
sLeft = gItemDescAdvRegions[cnt-sFirstLine][i].sLeft;
|
||||
sWidth = gItemDescAdvRegions[cnt-sFirstLine][i].sRight - sLeft;
|
||||
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
|
||||
///////////////////// poison percentage
|
||||
iModifier[0] = Item[gpItemDescObject->usItem].bPoisonPercentage;
|
||||
|
||||
UINT8 ammotype = (*gpItemDescObject)[0]->data.gun.ubGunAmmoType; // ... get type of ammunition used ...
|
||||
|
||||
iModifier[1] = AmmoTypes[ammotype].poisonPercentage;
|
||||
iModifier[2] = iModifier[0] + iModifier[1];
|
||||
|
||||
// only draw if item is poisoned in any way
|
||||
if ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 )
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
|
||||
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
|
||||
|
||||
// Print Values
|
||||
for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
|
||||
{
|
||||
SetRGBFontForeground( 0, 255, 0 );
|
||||
sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
|
||||
sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
|
||||
if (iModifier[cnt2] > 0)
|
||||
{
|
||||
swprintf( pStr, L"%d", iModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else if (iFloatModifier[cnt2] < 0)
|
||||
{
|
||||
swprintf( pStr, L"%d", iModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, L"--" );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
}
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
///////////////////// DIRT MODIFICATOR
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
SetFontForeground( FONT_MCOLOR_WHITE );
|
||||
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
|
||||
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
|
||||
|
||||
// Repeatedly draw each index: four separate column headers per index.
|
||||
for (UINT8 i = 0; i < 4; i++)
|
||||
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
|
||||
|
||||
iFloatModifier[0] = Item[ gpItemDescObject->usItem ].dirtIncreaseFactor;
|
||||
iFloatModifier[2] = GetItemDirtIncreaseFactor( gpItemDescObject, TRUE );
|
||||
iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0];
|
||||
|
||||
// Print Values
|
||||
for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
|
||||
{
|
||||
// Select "PROPERTY", "0", "+" or "=" as appropriate.
|
||||
swprintf(pStr, L"%s", gzItemDescGenIndexes[ i ]);
|
||||
SetFontForeground( 5 );
|
||||
sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
|
||||
sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
|
||||
if (iFloatModifier[cnt2] > 0)
|
||||
{
|
||||
if ( cnt2 == 1 )
|
||||
SetFontForeground( ITEMDESC_FONTNEGATIVE );
|
||||
|
||||
sLeft = gItemDescAdvRegions[cnt-sFirstLine][i].sLeft;
|
||||
sWidth = gItemDescAdvRegions[cnt-sFirstLine][i].sRight - sLeft;
|
||||
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else if (iFloatModifier[cnt2] < 0)
|
||||
{
|
||||
if ( cnt2 == 1 )
|
||||
SetFontForeground( ITEMDESC_FONTPOSITIVE );
|
||||
|
||||
swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, L"--" );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
}
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
}
|
||||
++cnt;
|
||||
|
||||
///////////////////// poison percentage
|
||||
iModifier[0] = Item[gpItemDescObject->usItem].bPoisonPercentage;
|
||||
|
||||
UINT8 ammotype = (*gpItemDescObject)[0]->data.gun.ubGunAmmoType; // ... get type of ammunition used ...
|
||||
|
||||
iModifier[1] = AmmoTypes[ammotype].poisonPercentage;
|
||||
iModifier[2] = iModifier[0] + iModifier[1];
|
||||
|
||||
// only draw if item is poisoned in any way
|
||||
if ( iModifier[0] != 0 || iModifier[1] != 0 || iModifier[2] != 0 )
|
||||
{
|
||||
if (cnt >= sFirstLine && cnt < sLastLine)
|
||||
{
|
||||
// Set Y coordinates
|
||||
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
|
||||
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
|
||||
|
||||
// Print Values
|
||||
for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
|
||||
{
|
||||
SetRGBFontForeground( 0, 255, 0 );
|
||||
sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
|
||||
sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
|
||||
if (iModifier[cnt2] > 0)
|
||||
{
|
||||
swprintf( pStr, L"%d", iModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else if (iFloatModifier[cnt2] < 0)
|
||||
{
|
||||
swprintf( pStr, L"%d", iModifier[cnt2] );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
#ifdef CHINESE
|
||||
wcscat( pStr, ChineseSpecString1 );
|
||||
#else
|
||||
wcscat( pStr, L"%" );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( pStr, L"--" );
|
||||
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
|
||||
}
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
//}
|
||||
//#endif
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawMiscValues( OBJECTTYPE * gpItemDescObject )
|
||||
|
||||
+254
-30
@@ -3865,7 +3865,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
||||
gprintfinvalidate( sNewX, sNewY, pStr );
|
||||
}
|
||||
|
||||
// Flugente FTW 1
|
||||
// Flugente
|
||||
if ( gGameOptions.fWeaponOverheating == TRUE && gGameExternalOptions.fDisplayOverheatThermometer == TRUE && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || Item[pObject->usItem].barrel == TRUE ) )
|
||||
{
|
||||
OBJECTTYPE* pObjShown = pObject;
|
||||
@@ -11394,8 +11394,10 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
CHAR16 pStr[ 500 ];
|
||||
UINT16 usItem = pObject->usItem;
|
||||
INT32 iNumAttachments = 0;
|
||||
INT16 sValue;
|
||||
INT16 sValue;
|
||||
FLOAT fWeight;
|
||||
INT16 sThreshold = 100;
|
||||
FLOAT bDirt = 0.0f;
|
||||
|
||||
if( pSoldier != NULL )
|
||||
{
|
||||
@@ -11461,6 +11463,15 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight = 0.1f;
|
||||
}
|
||||
|
||||
if ( Item[pObject->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR) )
|
||||
{
|
||||
if ( gGameExternalOptions.fAdvRepairSystem )
|
||||
sThreshold = (*pObject)[subObject]->data.sRepairThreshold;
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
bDirt = 100 * (*pObject)[subObject]->data.bDirtLevel / OVERHEATING_MAX_TEMPERATURE;
|
||||
}
|
||||
|
||||
switch( Item[ usItem ].usItemClass )
|
||||
{
|
||||
case MONEY:
|
||||
@@ -11529,12 +11540,96 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
FLOAT accuracymalus = (FLOAT)((max(1.0, overheatdamagepercentage) - 1.0) * 0.1);
|
||||
accuracyheatmultiplicator = (FLOAT)max(0.0, 1.0 - accuracymalus);
|
||||
}
|
||||
|
||||
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItem ].nAccuracy:Weapon[ usItem ].bAccuracy);
|
||||
accuracy = (INT8)(accuracy * accuracyheatmultiplicator);
|
||||
|
||||
//Info for weapons
|
||||
//swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
|
||||
|
||||
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItem ].nAccuracy:Weapon[ usItem ].bAccuracy);
|
||||
accuracy = (INT8)(accuracy * accuracyheatmultiplicator);
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && gGameExternalOptions.fDirtSystem && ( sThreshold < 100 || bDirt > 0 ) )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString8,
|
||||
#else
|
||||
swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s\n%s %.2f%%",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString(), //Weight units
|
||||
gWeaponStatsDesc[ 18 ], //Dirt String
|
||||
bDirt //Dirt
|
||||
);
|
||||
}
|
||||
else if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString11,
|
||||
#else
|
||||
swprintf( pStr, L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
else if ( gGameExternalOptions.fDirtSystem && bDirt > 0 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString12,
|
||||
#else
|
||||
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s\n%s %.2f%%",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString(), //Weight units
|
||||
gWeaponStatsDesc[ 18 ], //Dirt String
|
||||
bDirt //Dirt
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString4,
|
||||
#else
|
||||
@@ -11559,6 +11654,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -11601,9 +11697,89 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
}
|
||||
|
||||
//Info for weapons
|
||||
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItem ].nAccuracy:Weapon[ usItem ].bAccuracy);
|
||||
accuracy = (INT8)(accuracy * accuracyheatmultiplicator);
|
||||
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItem ].nAccuracy:Weapon[ usItem ].bAccuracy);
|
||||
accuracy = (INT8)(accuracy * accuracyheatmultiplicator);
|
||||
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && gGameExternalOptions.fDirtSystem && ( sThreshold < 100 || bDirt > 0 ) )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s\n %s %.2f%%",
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s\n%s %.2f%%",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString(), //Weight units
|
||||
gWeaponStatsDesc[ 18 ], //Dirt String
|
||||
bDirt //Dirt
|
||||
);
|
||||
}
|
||||
else if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, L"%s [%d%£¥(%d%£¥)]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
else if ( gGameExternalOptions.fDirtSystem && bDirt > 0 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s\n %s %.2f%%",
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s\n%s %.2f%%",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 9 ], //Accuracy String
|
||||
accuracy,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject),
|
||||
gWeaponStatsDesc[ 10 ], //Range String
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject, NULL )/10 : GunRange( pObject, NULL ), // SANDRO - added argument //Modified Range
|
||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GetModifiedGunRange(usItem)/10 : GetModifiedGunRange(usItem), //Gun Range
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
apStr, //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString(), //Weight units
|
||||
gWeaponStatsDesc[ 18 ], //Dirt String
|
||||
bDirt //Dirt
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, L"%s [%d%£¥]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
|
||||
#else
|
||||
@@ -11625,6 +11801,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -11632,22 +11809,45 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
case IC_THROWING_KNIFE:
|
||||
case IC_PUNCH:
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString5,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
#endif
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString9,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject), //Melee damage
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
sThreshold,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject), //Melee damage
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString5,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ],
|
||||
sValue,
|
||||
gWeaponStatsDesc[ 11 ], //Damage String
|
||||
GetDamage(pObject), //Melee damage
|
||||
gWeaponStatsDesc[ 6 ], //AP String
|
||||
BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], pObject, pSoldier ), //AP's
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -11729,12 +11929,35 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString6,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && sThreshold < 100 )
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString10,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
sThreshold, //repair threshold
|
||||
pInvPanelTitleStrings[ 4 ], //Protection string
|
||||
iProtection, //Protection rating in % based on best armor
|
||||
Armour[ Item[ usItem ].ubClassIndex ].ubProtection, //Protection (raw data)
|
||||
Armour[ Item[ usItem ].ubClassIndex ].ubProtection * sValue / 100,
|
||||
pInvPanelTitleStrings[ 3 ], //Camo string
|
||||
GetCamoBonus(pObject)+GetUrbanCamoBonus(pObject)+GetDesertCamoBonus(pObject)+GetSnowCamoBonus(pObject), //Camo bonus
|
||||
gWeaponStatsDesc[ 12 ], //Weight string
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString6,
|
||||
#else
|
||||
swprintf( pStr, L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s",
|
||||
#endif
|
||||
|
||||
ItemNames[ usItem ], //Item long name
|
||||
sValue, //Item condition
|
||||
@@ -11748,6 +11971,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -493,7 +493,7 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
|
||||
sValue =100;
|
||||
}
|
||||
|
||||
// Flugente FTW 1.2
|
||||
// Flugente
|
||||
if ( ubStatus == DRAW_ITEM_TEMPERATURE )
|
||||
{
|
||||
// the food item bar always has full size
|
||||
@@ -534,6 +534,18 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
|
||||
dEnd = dPercentage * sHeight;
|
||||
dStart = sYPos;
|
||||
|
||||
// Flugente: draw sRepairThreshold in the background
|
||||
if ( gGameExternalOptions.fAdvRepairSystem && ubStatus != DRAW_ITEM_TEMPERATURE && Item[pObject->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR) )
|
||||
{
|
||||
FLOAT repairthresholdend = sHeight * (FLOAT)(*pObject)[0]->data.sRepairThreshold / (FLOAT)100;
|
||||
|
||||
usLineColor = Get16BPPColor( FROMRGB( 57, 56, 41 ) );
|
||||
RectangleDraw( TRUE, sXPos, (INT32)(dStart - repairthresholdend), sXPos, (INT32)( dStart - sHeight ) , usLineColor, pDestBuf );
|
||||
|
||||
usLineColor = Get16BPPColor( FROMRGB( 57, 56, 41 ) );
|
||||
RectangleDraw( TRUE, sXPos + 1, (INT32)(dStart - repairthresholdend), sXPos + 1, (INT32)( dStart - sHeight ) , usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
//usLineColor = Get16BPPColor( STATUS_BAR );
|
||||
usLineColor = sColor1;
|
||||
RectangleDraw( TRUE, sXPos, (INT32)dStart, sXPos, (INT32)( dStart - dEnd ) , usLineColor, pDestBuf );
|
||||
|
||||
+15
-1
@@ -1029,7 +1029,10 @@ ObjectData::ObjectData(const ObjectData& src)
|
||||
this->ubDirection = src.ubDirection;
|
||||
this->ubWireNetworkFlag = src.ubWireNetworkFlag;
|
||||
this->bDefuseFrequency = src.bDefuseFrequency;
|
||||
|
||||
this->sRepairThreshold = src.sRepairThreshold;
|
||||
this->bDirtLevel = src.bDirtLevel;
|
||||
this->sObjectFlag = src.sObjectFlag;
|
||||
|
||||
//copy over the union
|
||||
this->gun = src.gun;
|
||||
|
||||
@@ -1053,6 +1056,9 @@ ObjectData& ObjectData::operator =(const ObjectData& src)
|
||||
this->ubDirection = src.ubDirection;
|
||||
this->ubWireNetworkFlag = src.ubWireNetworkFlag;
|
||||
this->bDefuseFrequency = src.bDefuseFrequency;
|
||||
this->sRepairThreshold = src.sRepairThreshold;
|
||||
this->bDirtLevel = src.bDirtLevel;
|
||||
this->sObjectFlag = src.sObjectFlag;
|
||||
|
||||
//copy over the union
|
||||
this->gun = src.gun;
|
||||
@@ -1342,6 +1348,10 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
|
||||
(*this)[0]->data.owner.ubOwnerCivGroup = src.ugYucky.ubOwnerCivGroup;
|
||||
}
|
||||
|
||||
(*this)[0]->data.sRepairThreshold = 100;
|
||||
(*this)[0]->data.bDirtLevel = 0.0f;
|
||||
(*this)[0]->data.sObjectFlag = 0;
|
||||
|
||||
//it's unlikely max will get less over the versions, but still, check the min
|
||||
for (int x = 0; x < OLD_MAX_ATTACHMENTS_101; ++x)
|
||||
{
|
||||
@@ -1372,6 +1382,10 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
|
||||
{
|
||||
(*this)[x]->data.bTemperature = OVERHEATING_MAX_TEMPERATURE;
|
||||
}
|
||||
|
||||
(*this)[x]->data.sRepairThreshold = 100;
|
||||
(*this)[x]->data.bDirtLevel = 0.0f;
|
||||
(*this)[x]->data.sObjectFlag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-2
@@ -222,6 +222,7 @@ typedef enum
|
||||
|
||||
// Flugente: define for maximum temperature
|
||||
#define OVERHEATING_MAX_TEMPERATURE 60000.0f
|
||||
#define DIRT_MIN_TO_CLEAN 10.0f // minimum dirt until we consider cleaning (as weapons constantly get dirtier, this prevents a gun from being constantly cleaned)
|
||||
|
||||
//forward declaration
|
||||
class OBJECTTYPE;
|
||||
@@ -478,6 +479,12 @@ public:
|
||||
UINT8 ubDirection; // direction the bomb faces (for directional explosives)
|
||||
UINT32 ubWireNetworkFlag; // flags for the tripwire network
|
||||
INT8 bDefuseFrequency; // frequency for defusing, >=0 values used only
|
||||
|
||||
// Flugente: advanced repair/dirt system
|
||||
INT16 sRepairThreshold; // repair only possible up to this value
|
||||
FLOAT bDirtLevel; // counter for how dirty a gun is
|
||||
|
||||
INT32 sObjectFlag; // used to notify of various states that apply to this object, but not the item in general
|
||||
};
|
||||
// Flugente: needed for reading WF maps
|
||||
#define SIZEOF_OBJECTDATA_POD (offsetof(ObjectData, endOfPOD))
|
||||
@@ -725,9 +732,9 @@ extern OBJECTTYPE gTempObject;
|
||||
#define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally
|
||||
#define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots
|
||||
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
|
||||
/*#define ENEMY_NET_4_LVL_3 0x00000800 //2048
|
||||
#define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit
|
||||
|
||||
#define ENEMY_NET_1_LVL_4 0x00001000 //4096
|
||||
/*#define ENEMY_NET_1_LVL_4 0x00001000 //4096
|
||||
#define ENEMY_NET_2_LVL_4 0x00002000 //8192
|
||||
#define ENEMY_NET_3_LVL_4 0x00004000 //16384
|
||||
#define ENEMY_NET_4_LVL_4 0x00008000 //32768
|
||||
@@ -1018,6 +1025,10 @@ typedef struct
|
||||
UINT8 DisarmModifier;
|
||||
INT8 RepairModifier;
|
||||
|
||||
// Flugente: advanced repair/dirt system
|
||||
UINT8 usDamageChance; // chance that damage to the status will also damage the repair threshold
|
||||
FLOAT dirtIncreaseFactor; // one shot causes this much dirt on a gun
|
||||
|
||||
} INVTYPE;
|
||||
|
||||
// CHRISL: Added new structures to handle LBE gear and the two new XML files that will be needed to deal
|
||||
|
||||
+54
-2
@@ -1258,6 +1258,10 @@ DRUGTYPE Drug[DRUG_TYPE_MAX];
|
||||
|
||||
FOODTYPE Food[FOOD_TYPE_MAX];
|
||||
|
||||
SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||
|
||||
|
||||
|
||||
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
|
||||
{
|
||||
if ( Item[usItemIndex].ubCoolness == 0 && !fIgnoreCoolness )
|
||||
@@ -3160,6 +3164,9 @@ void SwapObjs(SOLDIERTYPE* pSoldier, int slot, OBJECTTYPE* pObject, BOOLEAN fPer
|
||||
|
||||
void DamageObj( OBJECTTYPE * pObj, INT8 bAmount, UINT8 subObject )
|
||||
{
|
||||
// Flugente: lower repair threshold
|
||||
(*pObj)[subObject]->data.sRepairThreshold = max(1, (*pObj)[subObject]->data.sRepairThreshold - bAmount/3);
|
||||
|
||||
//usually called from AttachObject, where the attachment is known to be a single item,
|
||||
//and the attachment is only being attached to the top of the stack
|
||||
if (bAmount >= (*pObj)[subObject]->data.objectStatus)
|
||||
@@ -7520,8 +7527,12 @@ 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
|
||||
// Flugente: temperature on creation is 0
|
||||
pStackedObject->data.bTemperature = 0.0f;
|
||||
|
||||
pStackedObject->data.sRepairThreshold = (200 + bStatus)/3; // arbitrary threshold
|
||||
pStackedObject->data.bDirtLevel = 0.0f;
|
||||
pStackedObject->data.sObjectFlag = 0;
|
||||
|
||||
if (Weapon[ usItem ].ubWeaponClass == MONSTERCLASS)
|
||||
{
|
||||
@@ -7650,6 +7661,12 @@ BOOLEAN CreateItem( UINT16 usItem, INT16 bStatus, OBJECTTYPE * pObj )
|
||||
if(UsingNewAttachmentSystem()==true)
|
||||
InitItemAttachments(pObj);
|
||||
|
||||
if (Item[ usItem ].usItemClass == IC_ARMOUR)
|
||||
(*pObj)[0]->data.sRepairThreshold = (200 + bStatus)/3; // arbitrary threshold
|
||||
else
|
||||
(*pObj)[0]->data.sRepairThreshold = 100;
|
||||
|
||||
(*pObj)[0]->data.bDirtLevel = 0.0f;
|
||||
}
|
||||
if (fRet)
|
||||
{
|
||||
@@ -8347,6 +8364,8 @@ BOOLEAN DamageItem( OBJECTTYPE * pObject, INT32 iDamage, BOOLEAN fOnGround )
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pObject)[bLoop]->data.sRepairThreshold = max(1, (*pObject)[bLoop]->data.sRepairThreshold - bDamage/3);
|
||||
|
||||
(*pObject)[bLoop]->data.objectStatus -= bDamage;
|
||||
if ((*pObject)[bLoop]->data.objectStatus < 1)
|
||||
{
|
||||
@@ -8595,7 +8614,8 @@ void WaterDamage( SOLDIERTYPE *pSoldier )
|
||||
|
||||
if ( pSoldier->MercInDeepWater( ) )
|
||||
{
|
||||
for ( bLoop = 0; bLoop < (INT8) pSoldier->inv.size(); bLoop++ )
|
||||
INT8 invsize = (INT8) pSoldier->inv.size();
|
||||
for ( bLoop = 0; bLoop < invsize; ++bLoop )
|
||||
{
|
||||
if (pSoldier->inv[bLoop].exists() == false) {
|
||||
continue;
|
||||
@@ -8619,6 +8639,11 @@ void WaterDamage( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
pSoldier->inv[bLoop][0]->data.objectStatus = 1;
|
||||
}
|
||||
|
||||
if ( Random(100) < Item[pSoldier->inv[ bLoop ].usItem].usDamageChance )
|
||||
{
|
||||
pSoldier->inv[bLoop][0]->data.sRepairThreshold = max(1, pSoldier->inv[bLoop][0]->data.sRepairThreshold - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14348,4 +14373,31 @@ INT8 GetNumberAltFireAimLevels( SOLDIERTYPE * pSoldier, INT32 iGridNo )
|
||||
bAltAimLevels += 1;
|
||||
|
||||
return bAltAimLevels ;
|
||||
}
|
||||
|
||||
// get dirt increase for object with attachments, fConsiderAmmo: with ammo
|
||||
FLOAT GetItemDirtIncreaseFactor( OBJECTTYPE * pObj, BOOLEAN fConsiderAmmo )
|
||||
{
|
||||
FLOAT dirtincreasefactor = Item[pObj->usItem].dirtIncreaseFactor;
|
||||
|
||||
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())
|
||||
{
|
||||
dirtincreasefactor += Item[iter->usItem].dirtIncreaseFactor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ammo modifies how much dirt a single shot makes, but only while shooting
|
||||
if ( fConsiderAmmo )
|
||||
dirtincreasefactor *= (1.0f + AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].dirtModificator);
|
||||
|
||||
// dirt factor has to be >= 0 (items don't clean themselves)
|
||||
dirtincreasefactor = max(0.0f, dirtincreasefactor);
|
||||
|
||||
return dirtincreasefactor;
|
||||
}
|
||||
+11
-1
@@ -446,7 +446,7 @@ INT16 ReduceCamoFromSoldier( SOLDIERTYPE * pSoldier, INT16 iCamoToRemove, INT16
|
||||
BOOLEAN HasExtendedEarOn( SOLDIERTYPE * pSoldier );
|
||||
BOOLEAN UseTotalMedicalKitPoints( SOLDIERTYPE * pSoldier, UINT16 usPointsToConsume );
|
||||
|
||||
// Flugente FTW 1.2
|
||||
// Flugente
|
||||
FLOAT GetItemCooldownFactor( OBJECTTYPE * pObj );
|
||||
void GetScopeLists( OBJECTTYPE * pObj, std::map<INT8, OBJECTTYPE*>& arScopeMap );
|
||||
|
||||
@@ -479,6 +479,16 @@ OBJECTTYPE* GetExternalFeedingObject(SOLDIERTYPE* pSoldier, OBJECTTYPE * pObject
|
||||
|
||||
BOOLEAN DeductBulletViaExternalFeeding(SOLDIERTYPE* pSoldier, OBJECTTYPE * pObject);
|
||||
|
||||
// Flugente: additional xml data for sectors
|
||||
typedef struct
|
||||
{
|
||||
UINT8 usWaterType; // type of water source in this sector
|
||||
UINT16 usNaturalDirt; // extra dirt percentage when firing in this sector
|
||||
} SECTOR_EXT_DATA;
|
||||
|
||||
// get dirt increase for object with attachments, fConsiderAmmo: with ammo
|
||||
FLOAT GetItemDirtIncreaseFactor( OBJECTTYPE * pObj, BOOLEAN fConsiderAmmo = TRUE );
|
||||
|
||||
//DBrot: get the volume of all attached pouches
|
||||
UINT8 GetVolumeAlreadyTaken(OBJECTTYPE * pObj);
|
||||
INT16 GetPocketFromAttachment(OBJECTTYPE * pObj, UINT8 pMap);
|
||||
|
||||
+10
-2
@@ -2690,6 +2690,9 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend
|
||||
// just break it...
|
||||
pTarget->inv[ bHeadSlot ][0]->data.objectStatus = 1;
|
||||
}
|
||||
|
||||
// Flugente: also lower the repair threshold
|
||||
pTarget->inv[ bHeadSlot ][0]->data.sRepairThreshold = max(pTarget->inv[ bHeadSlot ][0]->data.objectStatus, pTarget->inv[ bHeadSlot ][0]->data.sRepairThreshold - iImpact / 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5761,10 +5764,10 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
||||
|
||||
if ( overheatjampercentage > 1.0 )
|
||||
iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
|
||||
|
||||
GunIncreaseHeat( pObj );
|
||||
}
|
||||
|
||||
GunIncreaseHeat( pObj );
|
||||
|
||||
// Flugente : Added a malus to reliability for overheated guns
|
||||
// HEADROCK HAM 5: Variable NCTH base change
|
||||
UINT32 uiDepreciateTest = 0;
|
||||
@@ -5782,6 +5785,11 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObj)[0]->data.objectStatus > 1) )
|
||||
{
|
||||
(*pObj)[0]->data.objectStatus--;
|
||||
|
||||
if ( Random(100) < Item[pObj->usItem].usDamageChance )
|
||||
{
|
||||
(*pObj)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
}
|
||||
///////////////////////// OVERHEATING AND STATUS REDUCTION ////////////////////////////
|
||||
|
||||
|
||||
@@ -995,6 +995,8 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
|
||||
{
|
||||
(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20);
|
||||
(*pObj)[0]->data.objectStatus = min(max((*pObj)[0]->data.objectStatus,1),100); // never below 1% or above 100%
|
||||
|
||||
(*pObj)[0]->data.sRepairThreshold = max(1, min(100, ((*pObj)[0]->data.objectStatus + 200)/3 ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3168,6 +3168,10 @@ BOOLEAN RepairIsDone(DEALER_SPECIAL_ITEM* pSpecial)
|
||||
{
|
||||
// make its condition 100%
|
||||
RepairItem.ItemObject[0]->data.objectStatus = 100;
|
||||
|
||||
// Flugente: shopkeepers will also restore an item's repair threshold
|
||||
RepairItem.ItemObject[0]->data.sRepairThreshold = 100;
|
||||
RepairItem.ItemObject[0]->data.bDirtLevel = 0.0f;
|
||||
}
|
||||
|
||||
// max condition of all permanent attachments on it
|
||||
@@ -3176,6 +3180,10 @@ BOOLEAN RepairIsDone(DEALER_SPECIAL_ITEM* pSpecial)
|
||||
{
|
||||
// fix it up
|
||||
(*iter)[0]->data.objectStatus = 100;
|
||||
|
||||
// Flugente: shopkeepers will also restore an item's repair threshold
|
||||
(*iter)[0]->data.sRepairThreshold = 100;
|
||||
(*iter)[0]->data.bDirtLevel = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,8 @@ extern INT16 DirIncrementer[8];
|
||||
extern BOOLEAN AddSoldierToSectorNoCalculateDirectionUseAnimation( UINT8 ubID, UINT16 usAnimState, UINT16 usAnimCode );
|
||||
#endif
|
||||
|
||||
// Flugente: external sector data
|
||||
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||
|
||||
// Enumerate extended directions
|
||||
enum
|
||||
@@ -13551,7 +13553,7 @@ BOOLEAN SOLDIERTYPE::SoldierCarriesTwoHandedWeapon( void )
|
||||
// Flugente: Cool down/decay all items in inventory
|
||||
void SOLDIERTYPE::SoldierInventoryCoolDown(void)
|
||||
{
|
||||
if ( !gGameOptions.fWeaponOverheating && !gGameOptions.fFoodSystem )
|
||||
if ( !gGameOptions.fWeaponOverheating && !gGameExternalOptions.fDirtSystem && !gGameOptions.fFoodSystem )
|
||||
return;
|
||||
|
||||
// one hour has 60 minutes, with 12 5-second-intervals (cooldown values are based on 5-second values)
|
||||
@@ -13561,6 +13563,16 @@ void SOLDIERTYPE::SoldierInventoryCoolDown(void)
|
||||
if ( gbWorldSectorZ > 0 )
|
||||
fooddecaymod *= 0.8f;
|
||||
|
||||
// get sector-specific dirt threshold
|
||||
UINT16 sectormod = 0;
|
||||
UINT8 ubSectorId = SECTOR(gWorldSectorX, gWorldSectorY);
|
||||
if ( gbWorldSectorZ > 0 )
|
||||
sectormod = 100;
|
||||
else if ( ubSectorId >= 0 && ubSectorId < 256 )
|
||||
{
|
||||
sectormod = SectorExternalData[ubSectorId][gbWorldSectorZ].usNaturalDirt;
|
||||
}
|
||||
|
||||
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 ...
|
||||
@@ -13610,6 +13622,28 @@ void SOLDIERTYPE::SoldierInventoryCoolDown(void)
|
||||
}
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fDirtSystem && ( (Item[pObj->usItem].usItemClass & IC_WEAPON) || (Item[pObj->usItem].usItemClass & IC_ARMOUR) ) )
|
||||
{
|
||||
FLOAT dirtincreasefactor = GetItemDirtIncreaseFactor(pObj, FALSE); // ... get dirt increase factor ...
|
||||
|
||||
// the current sector determines how much dirt increases
|
||||
dirtincreasefactor *= (sectormod)/100;
|
||||
|
||||
dirtincreasefactor /= gGameExternalOptions.usSectorDirtDivider;
|
||||
|
||||
// items in pockets are a bit protected from dirt
|
||||
if ( bLoop > KNIFEPOCKPOS )
|
||||
dirtincreasefactor /= 3.0f;
|
||||
|
||||
if ( dirtincreasefactor > 0.0f ) // ... item can get dirtier ...
|
||||
{
|
||||
for(INT16 i = 0; i < pObj->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
|
||||
{
|
||||
(*pObj)[i]->data.bDirtLevel = max(0.0f, min( OVERHEATING_MAX_TEMPERATURE, (*pObj)[i]->data.bDirtLevel + dirtincreasefactor) ); // set new temperature
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( gGameOptions.fFoodSystem && Item[pObj->usItem].foodtype > 0 )
|
||||
{
|
||||
if ( Food[Item[pObj->usItem].foodtype].usDecayRate > 0.0f ) // ... if the food can decay...
|
||||
@@ -13962,6 +13996,9 @@ void SOLDIERTYPE::InventoryExplosion( void )
|
||||
{
|
||||
INT16 status = (*iter)[0]->data.objectStatus;
|
||||
(*iter)[0]->data.objectStatus = max(1, (INT16)(status/2));
|
||||
|
||||
INT16 rtstatus = (*iter)[0]->data.sRepairThreshold;
|
||||
(*iter)[0]->data.sRepairThreshold = max(1, (INT16)(rtstatus/2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14270,6 +14307,96 @@ BOOLEAN SOLDIERTYPE::IsFeedingExternal(UINT8* pubId1, UINT16* pGunSlot1, UINT16
|
||||
return( isFeeding );
|
||||
}
|
||||
|
||||
// Flugente: return a cleaning kit from our inventory
|
||||
OBJECTTYPE* SOLDIERTYPE::GetCleaningKit()
|
||||
{
|
||||
OBJECTTYPE* pObj = NULL;
|
||||
|
||||
INT8 invsize = (INT8)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 canteen (that can have drink points) ...
|
||||
if (inv[bLoop].exists() == true && HasItemFlag(inv[bLoop].usItem, CLEANING_KIT) )
|
||||
{
|
||||
pObj = &(inv[bLoop]); // ... get pointer for this item ...
|
||||
|
||||
return( pObj );
|
||||
}
|
||||
}
|
||||
|
||||
return( pObj );
|
||||
}
|
||||
|
||||
// use any cleaning kits to clean weapons in inventory
|
||||
void SOLDIERTYPE::CleanWeapon()
|
||||
{
|
||||
// in turnbased, this action costs APs. remove them if possible, otherwise, return
|
||||
INT16 apcost = APBPConstants[AP_FORTIFICATION];
|
||||
|
||||
if ( gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
if ( !EnoughPoints( this, apcost, 0, TRUE ) )
|
||||
return;
|
||||
}
|
||||
|
||||
OBJECTTYPE* pCleaningKit = GetCleaningKit();
|
||||
|
||||
if ( pCleaningKit )
|
||||
{
|
||||
INT8 invsize = (INT8)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 (inv[bLoop].exists() && (Item[inv[bLoop].usItem].usItemClass & IC_WEAPON) )
|
||||
{
|
||||
OBJECTTYPE* pObj = &(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 ...
|
||||
{
|
||||
if ( (*pObj)[i]->data.bDirtLevel > DIRT_MIN_TO_CLEAN ) // ... if weapon is at least a bit dirty ...
|
||||
{
|
||||
// have to recheck for a cleaning kit, as we might have used it up if cleaning a stack of weapons
|
||||
pCleaningKit = GetCleaningKit();
|
||||
|
||||
if ( pCleaningKit )
|
||||
{
|
||||
if ( (*pObj)[i]->data.bDirtLevel > 0 )
|
||||
{
|
||||
(*pObj)[i]->data.bDirtLevel = 0.0f;
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s cleaned %s", this->name, Item[pObj->usItem].szItemName );
|
||||
|
||||
// 33% chance to use up 1% of the cleaning kit
|
||||
if ( Random(2) > 0 )
|
||||
UseKitPoints( pCleaningKit, 1, this );
|
||||
|
||||
if ( gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
// use up APs
|
||||
DeductPoints( this, apcost, 0, AFTERACTION_INTERRUPT );
|
||||
|
||||
// only clean one weapon, we don't want to clean weapons if we didn't plan to
|
||||
return;
|
||||
|
||||
// get out of here if we dont have enough APs for another cleaning operation
|
||||
//if ( !EnoughPoints( this, apcost, 0, TRUE ) )
|
||||
//return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT8 bBandaged; //,savedOurTurn;
|
||||
|
||||
@@ -1450,6 +1450,12 @@ public:
|
||||
|
||||
// Flugente: do we currently provide ammo (pAmmoSlot) for someone else's (pubId) gun (pGunSlot)?
|
||||
BOOLEAN IsFeedingExternal(UINT8* pubId1, UINT16* pGunSlot1, UINT16* pAmmoSlot1, UINT8* pubId2, UINT16* pGunSlot2, UINT16* pAmmoSlot2);
|
||||
|
||||
// Flugente: return a cleaning kit from our inventory
|
||||
OBJECTTYPE* GetCleaningKit();
|
||||
|
||||
// use any cleaning kits to clean weapons in inventory
|
||||
void CleanWeapon();
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}; // SOLDIERTYPE;
|
||||
|
||||
@@ -131,6 +131,7 @@ BOOLEAN LoadTempNpcQuoteInfoForNPCFromTempFile( UINT8 ubNpcId );
|
||||
UINT32 GetLastTimePlayerWasInSector();
|
||||
UINT32 GetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ); // Flugente: get time for another sector
|
||||
void SetLastTimePlayerWasInSector();
|
||||
void SetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ); // Flugente: set last time sector was visited
|
||||
|
||||
|
||||
extern void InitLoadedWorld( );
|
||||
@@ -1378,6 +1379,35 @@ void SetLastTimePlayerWasInSector()
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: set last time sector was visited
|
||||
void SetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ)
|
||||
{
|
||||
if( !sMapZ )
|
||||
SectorInfo[ SECTOR( sMapX,sMapY) ].uiTimeCurrentSectorWasLastLoaded = GetWorldTotalMin();
|
||||
else if( sMapZ > 0 )
|
||||
{
|
||||
UNDERGROUND_SECTORINFO *pTempNode = gpUndergroundSectorInfoHead;
|
||||
|
||||
pTempNode = gpUndergroundSectorInfoHead;
|
||||
|
||||
//loop through and look for the right underground sector
|
||||
while( pTempNode )
|
||||
{
|
||||
if( ( pTempNode->ubSectorX == sMapX ) &&
|
||||
( pTempNode->ubSectorY == sMapY ) &&
|
||||
( pTempNode->ubSectorZ == sMapZ ) )
|
||||
{
|
||||
//set the flag indicating that ther is a temp item file exists for the sector
|
||||
pTempNode->uiTimeCurrentSectorWasLastLoaded = GetWorldTotalMin();
|
||||
return; //break out
|
||||
}
|
||||
pTempNode = pTempNode->next;
|
||||
}
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Failed to Set the 'uiTimeCurrentSectorWasLastLoaded' for an underground sector" );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UINT32 GetLastTimePlayerWasInSector()
|
||||
|
||||
@@ -225,6 +225,7 @@ void ToggleZBuffer();
|
||||
void TogglePlanningMode();
|
||||
void SetBurstMode();
|
||||
void SetScopeMode( INT32 usMapPos );
|
||||
void CleanWeapons();
|
||||
void ObliterateSector();
|
||||
void RandomizeMercProfile();
|
||||
void CreateNextCivType();
|
||||
@@ -4462,13 +4463,14 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
else if ( fAlt )
|
||||
{
|
||||
CleanWeapons();
|
||||
|
||||
/*// Flugente: spawn items while debugging
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
static UINT16 usitem = 1075;
|
||||
static UINT16 usitem = 1576;
|
||||
static INT16 status = 100;
|
||||
static FLOAT temperature = 00000.0;
|
||||
static FLOAT temperature = 0.0;
|
||||
|
||||
OBJECTTYPE newobj;
|
||||
CreateItem( usitem, status, &newobj );
|
||||
@@ -5277,6 +5279,46 @@ void SetScopeMode( INT32 usMapPos )
|
||||
}
|
||||
}
|
||||
|
||||
void CleanWeapons()
|
||||
{
|
||||
if ( !gGameExternalOptions.fDirtSystem )
|
||||
return;
|
||||
|
||||
// no functionality if not in tactical or in combat, or nobody is here
|
||||
if ( guiCurrentScreen != GAME_SCREEN || (gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
return;
|
||||
|
||||
// if in turnbased mode, perform this action only for the selected merc, and use up APs
|
||||
if ( gTacticalStatus.uiFlags & TURNBASED )
|
||||
{
|
||||
if ( gusSelectedSoldier == NOBODY )
|
||||
return;
|
||||
|
||||
SOLDIERTYPE* pSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
|
||||
if ( pSoldier->bActive )
|
||||
pSoldier->CleanWeapon();
|
||||
}
|
||||
else // peform action for every merc in this sector
|
||||
{
|
||||
UINT8 bMercID, bLastTeamID;
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
|
||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
// loop through all mercs
|
||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; ++bMercID, ++pSoldier )
|
||||
{
|
||||
//if the merc is in this sector
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bInSector && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
|
||||
{
|
||||
pSoldier->CleanWeapon();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ObliterateSector()
|
||||
{
|
||||
INT32 cnt;
|
||||
|
||||
+105
-22
@@ -49,6 +49,7 @@
|
||||
#include "Soldier Functions.h" // added by SANDRO
|
||||
#include "Drugs And Alcohol.h" // HEADROCK HAM 4: Get drunk level
|
||||
#include "LOS.h" // HEADROCK HAM 4: Required for new shooting mechanism. Alternately, maybe move the functions to LOS.h.
|
||||
#include "Campaign Types.h" // added by Flugente
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
@@ -61,6 +62,7 @@ class SOLDIERTYPE;
|
||||
extern INT8 gbCurrentRainIntensity;
|
||||
//end rain
|
||||
|
||||
extern SECTOR_EXT_DATA SectorExternalData[256][4]; // added by Flugente
|
||||
|
||||
// HEADROCK HAM B1: Externalized both values to INI
|
||||
//#define MINCHANCETOHIT 1
|
||||
@@ -1172,7 +1174,7 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
|
||||
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
|
||||
// Flugente: 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? ...
|
||||
@@ -1184,6 +1186,16 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
|
||||
invertedBaseJamChance -= overheatjamfactor; // lower invertedBaseJamChance (thereby increasing jamChance later on)
|
||||
}
|
||||
|
||||
// Flugente: dirt can also influence a gun's jamming behaviour
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
FLOAT dirtpercentage = (*pObj)[0]->data.bDirtLevel / OVERHEATING_MAX_TEMPERATURE;
|
||||
|
||||
int dirtjamfactor = (int)(100 * dirtpercentage*dirtpercentage);
|
||||
|
||||
invertedBaseJamChance -= dirtjamfactor;
|
||||
}
|
||||
|
||||
if (invertedBaseJamChance < 0)
|
||||
invertedBaseJamChance = 0;
|
||||
else if (invertedBaseJamChance > 100)
|
||||
@@ -1796,8 +1808,15 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
uiDepreciateTest = max(0,BASIC_DEPRECIATE_CHANCE + 3 * (Item[ iter->usItem ].bReliability + ammoReliability));
|
||||
}
|
||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjAttHand)[0]->data.objectStatus > 1) )
|
||||
{
|
||||
(*pA)[0]->data.objectStatus--;
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"rel =%d ",Item[ iter->usItem ].bReliability );
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"rel =%d ",Item[ iter->usItem ].bReliability );
|
||||
|
||||
if ( Random(100) < Item[pA->usItem].usDamageChance )
|
||||
{
|
||||
(*pA)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1815,7 +1834,14 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
if ( pAttachment )
|
||||
{
|
||||
// reduce status and see if it falls off
|
||||
(*pAttachment)[0]->data.objectStatus -= (INT8) Random( 2 );
|
||||
INT8 reduction = (INT8) Random( 2 );
|
||||
(*pAttachment)[0]->data.objectStatus -= reduction;
|
||||
|
||||
// Flugente: reduce repair threshold
|
||||
if ( reduction > 0 && Random(100) < Item[pAttachment->usItem].usDamageChance )
|
||||
{
|
||||
(*pAttachment)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
|
||||
if ( (*pAttachment)[0]->data.objectStatus - Random( 35 ) - Random( 35 ) < USABLE )
|
||||
{
|
||||
@@ -2131,17 +2157,17 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
}
|
||||
|
||||
INT16 iOverheatReliabilityMalus = 0;
|
||||
// Flugente FTW 1: Increase Weapon Temperature
|
||||
// Flugente: Increase Weapon Temperature
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
{
|
||||
FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( pObjAttHand ); // ... how much above the gun's usOverheatingDamageThreshold are we? ...
|
||||
|
||||
if ( overheatjampercentage > 1.0 )
|
||||
iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
|
||||
|
||||
GunIncreaseHeat( pObjAttHand );
|
||||
}
|
||||
|
||||
GunIncreaseHeat( pObjAttHand );
|
||||
|
||||
// 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
|
||||
|
||||
@@ -2167,6 +2193,12 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjAttHand)[0]->data.objectStatus > 1) )
|
||||
{
|
||||
(*pObjAttHand)[0]->data.objectStatus--;
|
||||
|
||||
// Flugente: reduce repair threshold
|
||||
if ( Random(100) < Item[pObjAttHand->usItem].usDamageChance )
|
||||
{
|
||||
(*pObjAttHand)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
}
|
||||
|
||||
// reduce monster smell (gunpowder smell)
|
||||
@@ -2368,8 +2400,16 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
uiDepreciateTest = __max(0,BASIC_DEPRECIATE_CHANCE + 3 * (Item[ iter->usItem ].bReliability + ammoReliability));
|
||||
}
|
||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjUsed)[0]->data.objectStatus > 1) )
|
||||
{
|
||||
(*pA)[0]->data.objectStatus--;
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"rel =%d ",Item[ iter->usItem ].bReliability );
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"rel =%d ",Item[ iter->usItem ].bReliability );
|
||||
|
||||
// Flugente: reduce repair threshold
|
||||
if ( Random(100) < Item[pA->usItem].usDamageChance )
|
||||
{
|
||||
(*pA)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2387,7 +2427,14 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
if ( pAttachment->exists() )
|
||||
{
|
||||
// reduce status and see if it falls off
|
||||
(*pAttachment)[0]->data.objectStatus -= (INT8) Random( 2 );
|
||||
INT8 reduction = (INT8) Random( 2 );
|
||||
(*pAttachment)[0]->data.objectStatus -= reduction;
|
||||
|
||||
// Flugente: reduce repair threshold
|
||||
if ( reduction > 0 && Random(100) < Item[pAttachment->usItem].usDamageChance )
|
||||
{
|
||||
(*pAttachment)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
|
||||
if ( (*pAttachment)[0]->data.objectStatus - Random( 35 ) - Random( 35 ) < USABLE )
|
||||
{
|
||||
@@ -2738,10 +2785,10 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
|
||||
if ( overheatjampercentage > 1.0 )
|
||||
iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
|
||||
|
||||
GunIncreaseHeat( pObjUsed );
|
||||
}
|
||||
|
||||
GunIncreaseHeat( pObjUsed );
|
||||
|
||||
/* //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
|
||||
@@ -2770,6 +2817,12 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjUsed)[0]->data.objectStatus > 1) )
|
||||
{
|
||||
(*pObjUsed)[0]->data.objectStatus--;
|
||||
|
||||
// Flugente: reduce repair threshold
|
||||
if ( Random(100) < Item[pObjUsed->usItem].usDamageChance )
|
||||
{
|
||||
(*pObjUsed)[0]->data.sRepairThreshold--;
|
||||
}
|
||||
}
|
||||
|
||||
// reduce monster smell (gunpowder smell)
|
||||
@@ -2887,6 +2940,11 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
||||
bMaxDrop = __max( bMaxDrop, 2 );
|
||||
|
||||
(*pObj)[0]->data.objectStatus -= (INT8) Random( bMaxDrop ); // 0 to (maxDrop - 1)
|
||||
|
||||
if ( bMaxDrop > 0 )
|
||||
{
|
||||
(*pObj)[0]->data.sRepairThreshold = max((*pObj)[0]->data.objectStatus, (*pObj)[0]->data.sRepairThreshold - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// SANDRO - new merc records - times wounded (stabbed)
|
||||
@@ -3808,8 +3866,7 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
|
||||
// ATE: Check here if the launcher should fail 'cause of bad status.....
|
||||
if ( WillExplosiveWeaponFail( pSoldier, pgunobj ) )
|
||||
{
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
GunIncreaseHeat( pgunobj );
|
||||
GunIncreaseHeat( pgunobj );
|
||||
// Explode dude!
|
||||
|
||||
// So we still should have ABC > 0
|
||||
@@ -3826,7 +3883,6 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
GunIncreaseHeat( pgunobj );
|
||||
|
||||
if ( Weapon[ usItemNum ].sSound != NO_WEAPON_SOUND )
|
||||
@@ -11530,22 +11586,49 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
|
||||
|
||||
}
|
||||
|
||||
// Flugente FTW 1: Increase temperature of gun in ubAttackingHand
|
||||
// Flugente: Increase temperature/dirt of gun in ubAttackingHand due to firing a shot
|
||||
void GunIncreaseHeat( OBJECTTYPE *pObj )
|
||||
{
|
||||
if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) // if item is a gun pr launcher...
|
||||
if ( gGameOptions.fWeaponOverheating )
|
||||
{
|
||||
FLOAT guntemperature = (*pObj)[0]->data.bTemperature; // ... get current temperature ...
|
||||
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 singleshottemperature = GetSingleShotTemperature( pObj ); // ... get temperature rise ...
|
||||
|
||||
FLOAT newguntemperature = min(guntemperature + singleshottemperature, OVERHEATING_MAX_TEMPERATURE ); // ... calculate new temperature ...
|
||||
FLOAT newguntemperature = min(guntemperature + singleshottemperature, OVERHEATING_MAX_TEMPERATURE ); // ... calculate new temperature ...
|
||||
|
||||
(*pObj)[0]->data.bTemperature = newguntemperature; // ... apply 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 );
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Gun temperature increased from %4.2f to %4.2f", guntemperature, newguntemperature );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// firing a gun also increases dirt
|
||||
if ( gGameExternalOptions.fDirtSystem )
|
||||
{
|
||||
FLOAT dirtincreasefactor = GetItemDirtIncreaseFactor(pObj, TRUE); // ... get dirt increase factor ...
|
||||
|
||||
// get sector-specific dirt threshold
|
||||
UINT16 sectormod = 0;
|
||||
UINT8 ubSectorId = SECTOR(gWorldSectorX, gWorldSectorY);
|
||||
if ( gbWorldSectorZ > 0 )
|
||||
sectormod = 100;
|
||||
else if ( ubSectorId >= 0 && ubSectorId < 256 )
|
||||
{
|
||||
sectormod = SectorExternalData[ubSectorId][gbWorldSectorZ].usNaturalDirt;
|
||||
}
|
||||
|
||||
// the current sector determines how much dirt increases
|
||||
dirtincreasefactor *= (sectormod)/100;
|
||||
|
||||
if ( dirtincreasefactor > 0.0f ) // ... item can get dirtier ...
|
||||
{
|
||||
(*pObj)[0]->data.bDirtLevel = min((*pObj)[0]->data.bDirtLevel + dirtincreasefactor, OVERHEATING_MAX_TEMPERATURE ); // dirt and overheating use the same threshold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11579,7 +11662,7 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
|
||||
return singleshottemperature;
|
||||
}
|
||||
|
||||
// Flugente FTW 1: Get percentage: temperature/damagethreshold
|
||||
// Flugente: Get percentage: temperature/damagethreshold
|
||||
FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj )
|
||||
{
|
||||
FLOAT damagethreshold = GetOverheatDamageThreshold(pObj);
|
||||
@@ -11592,7 +11675,7 @@ FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj )
|
||||
return temperature/ damagethreshold ;
|
||||
}
|
||||
|
||||
// Flugente FTW 1: Get percentage: temperature/jamthreshold
|
||||
// Flugente: Get percentage: temperature/jamthreshold
|
||||
FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj )
|
||||
{
|
||||
FLOAT jamthreshold = GetOverheatJamThreshold(pObj);
|
||||
|
||||
+3
-2
@@ -214,8 +214,9 @@ typedef struct
|
||||
BOOLEAN acidic;
|
||||
INT16 lockBustingPower;
|
||||
BOOLEAN tracerEffect;
|
||||
FLOAT temperatureModificator; // Flugente FTW 1.1: modificator for weapon temperature
|
||||
INT16 poisonPercentage; // Flugente FTW 1.1: modificator for weapon temperature
|
||||
FLOAT temperatureModificator; // Flugente: modificator for weapon temperature
|
||||
INT16 poisonPercentage; // Flugente: modificator for weapon temperature
|
||||
FLOAT dirtModificator; // Flugente: modificator for weapon temperature
|
||||
|
||||
//zilpin: pellet spread patterns externalized in XML
|
||||
INT32 spreadPattern;
|
||||
|
||||
+36
-29
@@ -80,7 +80,8 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
strcmp(name, "tracerEffect") == 0 ||
|
||||
strcmp(name, "monsterSpit") == 0 ||
|
||||
strcmp(name, "temperatureModificator") == 0 ||
|
||||
strcmp(name, "PoisonPercentage") == 0 ))
|
||||
strcmp(name, "PoisonPercentage") == 0 ||
|
||||
strcmp(name, "dirtModificator") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
@@ -292,6 +293,11 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->curAmmoType.poisonPercentage = max(0, pData->curAmmoType.poisonPercentage);
|
||||
pData->curAmmoType.poisonPercentage = min(100, pData->curAmmoType.poisonPercentage);
|
||||
}
|
||||
else if(strcmp(name, "dirtModificator") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curAmmoType.dirtModificator = (FLOAT) atof(pData->szCharData);
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
@@ -384,37 +390,38 @@ BOOLEAN WriteAmmoTypeStats()
|
||||
|
||||
FilePrintf(hFile,"\t<AMMOTYPE>\r\n");
|
||||
|
||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
||||
FilePrintf(hFile,"\t\t<fontColour>%d</fontColour>\r\n", AmmoTypes[cnt].fontColour );
|
||||
FilePrintf(hFile,"\t\t<grayed>%d</grayed>\r\n", AmmoTypes[cnt].grayed );
|
||||
FilePrintf(hFile,"\t\t<offNormal>%d</offNormal>\r\n", AmmoTypes[cnt].offNormal );
|
||||
FilePrintf(hFile,"\t\t<onNormal>%d</onNormal>\r\n", AmmoTypes[cnt].onNormal );
|
||||
FilePrintf(hFile,"\t\t<structureImpactReductionMultiplier>%d</structureImpactReductionMultiplier>\r\n", AmmoTypes[cnt].structureImpactReductionMultiplier );
|
||||
FilePrintf(hFile,"\t\t<structureImpactReductionDivisor>%d</structureImpactReductionDivisor>\r\n", AmmoTypes[cnt].structureImpactReductionDivisor );
|
||||
FilePrintf(hFile,"\t\t<armourImpactReductionMultiplier>%d</armourImpactReductionMultiplier>\r\n", AmmoTypes[cnt].armourImpactReductionMultiplier );
|
||||
FilePrintf(hFile,"\t\t<armourImpactReductionDivisor>%d</armourImpactReductionDivisor>\r\n", AmmoTypes[cnt].armourImpactReductionDivisor );
|
||||
FilePrintf(hFile,"\t\t<beforeArmourDamageMultiplier>%d</beforeArmourDamageMultiplier>\r\n", AmmoTypes[cnt].beforeArmourDamageMultiplier );
|
||||
FilePrintf(hFile,"\t\t<beforeArmourDamageDivisor>%d</beforeArmourDamageDivisor>\r\n", AmmoTypes[cnt].beforeArmourDamageDivisor );
|
||||
FilePrintf(hFile,"\t\t<afterArmourDamageMultiplier>%d</afterArmourDamageMultiplier>\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier );
|
||||
FilePrintf(hFile,"\t\t<afterArmourDamageDivisor>%d</afterArmourDamageDivisor>\r\n", AmmoTypes[cnt].afterArmourDamageDivisor );
|
||||
FilePrintf(hFile,"\t\t<zeroMinimumDamage>%d</zeroMinimumDamage>\r\n", AmmoTypes[cnt].zeroMinimumDamage );
|
||||
FilePrintf(hFile,"\t\t<canGoThrough>%d</canGoThrough>\r\n", AmmoTypes[cnt].canGoThrough );
|
||||
FilePrintf(hFile,"\t\t<standardIssue>%d</standardIssue>\r\n", AmmoTypes[cnt].standardIssue );
|
||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
||||
FilePrintf(hFile,"\t\t<fontColour>%d</fontColour>\r\n", AmmoTypes[cnt].fontColour );
|
||||
FilePrintf(hFile,"\t\t<grayed>%d</grayed>\r\n", AmmoTypes[cnt].grayed );
|
||||
FilePrintf(hFile,"\t\t<offNormal>%d</offNormal>\r\n", AmmoTypes[cnt].offNormal );
|
||||
FilePrintf(hFile,"\t\t<onNormal>%d</onNormal>\r\n", AmmoTypes[cnt].onNormal );
|
||||
FilePrintf(hFile,"\t\t<structureImpactReductionMultiplier>%d</structureImpactReductionMultiplier>\r\n", AmmoTypes[cnt].structureImpactReductionMultiplier );
|
||||
FilePrintf(hFile,"\t\t<structureImpactReductionDivisor>%d</structureImpactReductionDivisor>\r\n", AmmoTypes[cnt].structureImpactReductionDivisor );
|
||||
FilePrintf(hFile,"\t\t<armourImpactReductionMultiplier>%d</armourImpactReductionMultiplier>\r\n", AmmoTypes[cnt].armourImpactReductionMultiplier );
|
||||
FilePrintf(hFile,"\t\t<armourImpactReductionDivisor>%d</armourImpactReductionDivisor>\r\n", AmmoTypes[cnt].armourImpactReductionDivisor );
|
||||
FilePrintf(hFile,"\t\t<beforeArmourDamageMultiplier>%d</beforeArmourDamageMultiplier>\r\n", AmmoTypes[cnt].beforeArmourDamageMultiplier );
|
||||
FilePrintf(hFile,"\t\t<beforeArmourDamageDivisor>%d</beforeArmourDamageDivisor>\r\n", AmmoTypes[cnt].beforeArmourDamageDivisor );
|
||||
FilePrintf(hFile,"\t\t<afterArmourDamageMultiplier>%d</afterArmourDamageMultiplier>\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier );
|
||||
FilePrintf(hFile,"\t\t<afterArmourDamageDivisor>%d</afterArmourDamageDivisor>\r\n", AmmoTypes[cnt].afterArmourDamageDivisor );
|
||||
FilePrintf(hFile,"\t\t<zeroMinimumDamage>%d</zeroMinimumDamage>\r\n", AmmoTypes[cnt].zeroMinimumDamage );
|
||||
FilePrintf(hFile,"\t\t<canGoThrough>%d</canGoThrough>\r\n", AmmoTypes[cnt].canGoThrough );
|
||||
FilePrintf(hFile,"\t\t<standardIssue>%d</standardIssue>\r\n", AmmoTypes[cnt].standardIssue );
|
||||
FilePrintf(hFile,"\t\t<numberOfBullets>%d</numberOfBullets>\r\n", AmmoTypes[cnt].numberOfBullets );
|
||||
FilePrintf(hFile,"\t\t<multipleBulletDamageMultiplier>%d</multipleBulletDamageMultiplier>\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier );
|
||||
FilePrintf(hFile,"\t\t<multipleBulletDamageDivisor>%d</multipleBulletDamageDivisor>\r\n", AmmoTypes[cnt].multipleBulletDamageDivisor );
|
||||
FilePrintf(hFile,"\t\t<highExplosive>%d</highExplosive>\r\n", AmmoTypes[cnt].highExplosive );
|
||||
FilePrintf(hFile,"\t\t<explosionSize>%d</explosionSize>\r\n", AmmoTypes[cnt].explosionSize );
|
||||
FilePrintf(hFile,"\t\t<antiTank>%d</antiTank>\r\n", AmmoTypes[cnt].antiTank );
|
||||
FilePrintf(hFile,"\t\t<dart>%d</dart>\r\n", AmmoTypes[cnt].dart );
|
||||
FilePrintf(hFile,"\t\t<knife>%d</knife>\r\n", AmmoTypes[cnt].knife );
|
||||
FilePrintf(hFile,"\t\t<monsterSpit>%d</monsterSpit>\r\n", AmmoTypes[cnt].monsterSpit );
|
||||
FilePrintf(hFile,"\t\t<acidic>%d</acidic>\r\n", AmmoTypes[cnt].acidic );
|
||||
FilePrintf(hFile,"\t\t<ignoreArmour>%d</ignoreArmour>\r\n", AmmoTypes[cnt].ignoreArmour );
|
||||
FilePrintf(hFile,"\t\t<multipleBulletDamageMultiplier>%d</multipleBulletDamageMultiplier>\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier );
|
||||
FilePrintf(hFile,"\t\t<multipleBulletDamageDivisor>%d</multipleBulletDamageDivisor>\r\n", AmmoTypes[cnt].multipleBulletDamageDivisor );
|
||||
FilePrintf(hFile,"\t\t<highExplosive>%d</highExplosive>\r\n", AmmoTypes[cnt].highExplosive );
|
||||
FilePrintf(hFile,"\t\t<explosionSize>%d</explosionSize>\r\n", AmmoTypes[cnt].explosionSize );
|
||||
FilePrintf(hFile,"\t\t<antiTank>%d</antiTank>\r\n", AmmoTypes[cnt].antiTank );
|
||||
FilePrintf(hFile,"\t\t<dart>%d</dart>\r\n", AmmoTypes[cnt].dart );
|
||||
FilePrintf(hFile,"\t\t<knife>%d</knife>\r\n", AmmoTypes[cnt].knife );
|
||||
FilePrintf(hFile,"\t\t<monsterSpit>%d</monsterSpit>\r\n", AmmoTypes[cnt].monsterSpit );
|
||||
FilePrintf(hFile,"\t\t<acidic>%d</acidic>\r\n", AmmoTypes[cnt].acidic );
|
||||
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\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\t<PoisonPercentage>%d</PoisonPercentage>\r\n", AmmoTypes[cnt].poisonPercentage );
|
||||
FilePrintf(hFile,"\t\t<dirtModificator>%4.2f</dirtModificator>\r\n", AmmoTypes[cnt].dirtModificator );
|
||||
|
||||
|
||||
FilePrintf(hFile,"\t</AMMOTYPE>\r\n");
|
||||
|
||||
Reference in New Issue
Block a user