mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user