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:
Flugente
2012-08-18 00:03:40 +00:00
parent 50b849997b
commit 8275a1231b
39 changed files with 1285 additions and 377 deletions
+30
View File
@@ -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()