- DIRT_GLOBAL_MODIFIER is a global modifier to dirt generation

- second cleaning button in menu now orders entire team to clean their guns
- global overheating modifier now also multiplies attachment modifiers
- cleaning kits always use up 1% on use


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5913 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-03-10 01:15:19 +00:00
parent 16d0d1ea8a
commit 6c0d94dadd
17 changed files with 42 additions and 35 deletions
+7 -7
View File
@@ -134,7 +134,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo );
// added by Flugente
void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel );
void CleanWeapons( BOOLEAN fCleanAll );
void CleanWeapons( BOOLEAN fEntireTeam );
void Strip( SOLDIERTYPE * pSoldier );
void StartCorpseMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel );
@@ -4748,7 +4748,7 @@ void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGr
DoMessageBox( MSG_BOX_BASIC_MEDIUM_BUTTONS, TacticalStr[ FUNCTION_SELECTION_STR ], GAME_SCREEN, MSG_BOX_FLAG_GENERIC_EIGHT_BUTTONS, TacticalFunctionSelectionMessageBoxCallBack, NULL );
}
void CleanWeapons( BOOLEAN fCleanAll )
void CleanWeapons( BOOLEAN fEntireTeam )
{
if ( !gGameExternalOptions.fDirtSystem )
return;
@@ -4758,7 +4758,7 @@ void CleanWeapons( BOOLEAN fCleanAll )
return;
// if in turnbased mode, perform this action only for the selected merc, and use up APs
if ( gTacticalStatus.uiFlags & TURNBASED )
if ( !fEntireTeam || gTacticalStatus.uiFlags & TURNBASED )
{
if ( gusSelectedSoldier == NOBODY )
return;
@@ -4766,7 +4766,7 @@ void CleanWeapons( BOOLEAN fCleanAll )
SOLDIERTYPE* pSoldier = MercPtrs[ gusSelectedSoldier ];
if ( pSoldier->bActive )
pSoldier->CleanWeapon(fCleanAll);
pSoldier->CleanWeapon(FALSE);
}
else // perform action for every merc in this sector
{
@@ -4782,7 +4782,7 @@ void CleanWeapons( BOOLEAN fCleanAll )
//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(fCleanAll);
pSoldier->CleanWeapon(TRUE);
}
}
}
@@ -4905,11 +4905,11 @@ void TacticalFunctionSelectionMessageBoxCallBack( UINT8 ubExitValue )
SectorFillCanteens();
break;
case 2:
// clean a single weapon
// clean weapons of selected merc
CleanWeapons(FALSE);
break;
case 3:
// clean all weapons
// clean weapons of entire team
CleanWeapons(TRUE);
break;
case 4:
+1 -1
View File
@@ -11425,7 +11425,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
iFloatModifier[0] = Item[ gpItemDescObject->usItem ].dirtIncreaseFactor;
iFloatModifier[0] = Item[ gpItemDescObject->usItem ].dirtIncreaseFactor * gGameExternalOptions.iDirtGlobalModifier;
iFloatModifier[2] = GetItemDirtIncreaseFactor( gpItemDescObject, TRUE );
iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0];
+4 -1
View File
@@ -14702,9 +14702,12 @@ FLOAT GetItemDirtIncreaseFactor( OBJECTTYPE * pObj, BOOLEAN fConsiderAmmo )
}
}
// ammo modifies how much dirt a single shot makes, but only while shooting
// ammo modifies how much dirt a single shot makes, but only while shooting, not when a gun gets dirty due to environmental effects
if ( fConsiderAmmo )
dirtincreasefactor *= (1.0f + AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].dirtModificator);
// multiply again for global modifer
dirtincreasefactor *= gGameExternalOptions.iDirtGlobalModifier;
// dirt factor has to be >= 0 (items don't clean themselves)
dirtincreasefactor = max(0.0f, dirtincreasefactor);
+1 -1
View File
@@ -3177,7 +3177,7 @@ BOOLEAN RepairIsDone(DEALER_SPECIAL_ITEM* pSpecial)
// fix it up
(*iter)[0]->data.objectStatus = 100;
// Flugente: shopkeepers will also restore an item's repair threshold
// Flugente: shopkeepers will also restore an item's repair threshold and clean it
(*iter)[0]->data.sRepairThreshold = 100;
(*iter)[0]->data.bDirtLevel = 0.0f;
}
+4 -5
View File
@@ -14485,7 +14485,7 @@ OBJECTTYPE* SOLDIERTYPE::GetCleaningKit()
return( pObj );
}
// use cleaning kits to clean weapons in inventory. fCleanAll = TRUE: clean all eapons found, otherwise just the first one
// use cleaning kits to clean weapons in inventory. fCleanAll = TRUE: clean all weapons found, otherwise just the first one
void SOLDIERTYPE::CleanWeapon( BOOLEAN fCleanAll )
{
// in turnbased, this action costs APs. remove them if possible, otherwise, return
@@ -14526,16 +14526,15 @@ void SOLDIERTYPE::CleanWeapon( BOOLEAN fCleanAll )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[WEAPON_CLEANING_STR], this->name, Item[pObj->usItem].szItemName );
// 33% chance to use up 1% of the cleaning kit
if ( Random(2) > 0 )
UseKitPoints( pCleaningKit, 1, this );
// always use up 1% of the cleaning kit (they last too long otherwise)
UseKitPoints( pCleaningKit, 1, this );
if ( gTacticalStatus.uiFlags & TURNBASED )
{
// use up APs
DeductPoints( this, apcost, 0, AFTERACTION_INTERRUPT );
// if fCleanAll is false, only clean one weapon
// if fCleanAll is false, only clean first weapon
if (!fCleanAll )
return;
+4 -1
View File
@@ -11762,7 +11762,7 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature;
// determine modificator according to attachments
FLOAT modificator = gGameExternalOptions.iOverheatTemperatureGlobalModfier;
FLOAT modificator = 1.0f;
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
@@ -11777,6 +11777,9 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
modificator += AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].temperatureModificator;
singleshottemperature *= modificator;
// multiply again for global modifer
singleshottemperature *= gGameExternalOptions.iOverheatTemperatureGlobalModfier;
}
return singleshottemperature;