- 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
+1
View File
@@ -1571,6 +1571,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fDirtSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","DIRT_SYSTEM", FALSE); gGameExternalOptions.fDirtSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","DIRT_SYSTEM", FALSE);
gGameExternalOptions.fFullRepairCleansGun = iniReader.ReadBoolean("Strategic Gameplay Settings","FULL_REPAIR_CLEANS_GUN", FALSE); gGameExternalOptions.fFullRepairCleansGun = iniReader.ReadBoolean("Strategic Gameplay Settings","FULL_REPAIR_CLEANS_GUN", FALSE);
gGameExternalOptions.usSectorDirtDivider = iniReader.ReadInteger("Strategic Gameplay Settings","SECTOR_DIRT_DIVIDER", 1000, 1, 100000); gGameExternalOptions.usSectorDirtDivider = iniReader.ReadInteger("Strategic Gameplay Settings","SECTOR_DIRT_DIVIDER", 1000, 1, 100000);
gGameExternalOptions.iDirtGlobalModifier = iniReader.ReadFloat ("Strategic Gameplay Settings","DIRT_GLOBAL_MODIFIER", 1.25f, 0.1f, 10.0f);
// Flugente: prisoner system // Flugente: prisoner system
gGameExternalOptions.fAllowPrisonerSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_TAKE_PRISONERS", TRUE); gGameExternalOptions.fAllowPrisonerSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_TAKE_PRISONERS", TRUE);
+2 -1
View File
@@ -1164,7 +1164,7 @@ typedef struct
BOOLEAN fDisplayOverheatThermometer; // Should a 'thermometer' for guns and replacable barrels be displayed? BOOLEAN fDisplayOverheatThermometer; // Should a 'thermometer' for guns and replacable barrels be displayed?
UINT8 ubOverheatThermometerRedOffset; // amount of red colour while temperature is below threshold UINT8 ubOverheatThermometerRedOffset; // amount of red colour while temperature is below threshold
FLOAT iCooldownModificatorLonelyBarrel; // Cooldown modificator for barrels left alone in the landscape ;-) FLOAT iCooldownModificatorLonelyBarrel; // Cooldown modificator for barrels left alone in the landscape ;-)
FLOAT iOverheatTemperatureGlobalModfier; // a global modifier to the singel shot temperature value, if one feels that all values should be lower/higher FLOAT iOverheatTemperatureGlobalModfier; // a global modifier to the single shot temperature value, if one feels that all values should be lower/higher
// Flugente: Weapon Mounting // Flugente: Weapon Mounting
BOOLEAN fWeaponResting; // Should it be possible to rest your weapon on structures in crouched position? BOOLEAN fWeaponResting; // Should it be possible to rest your weapon on structures in crouched position?
@@ -1184,6 +1184,7 @@ typedef struct
BOOLEAN fDirtSystem; // allow dirt on items increase the chance for weapon jamming BOOLEAN fDirtSystem; // allow dirt on items increase the chance for weapon jamming
BOOLEAN fFullRepairCleansGun; // repairing a gun up to its current repair threshold also cleans the gun BOOLEAN fFullRepairCleansGun; // repairing a gun up to its current repair threshold also cleans the gun
UINT32 usSectorDirtDivider; // divide a guns dirt factor by this to get dirt increase for every turn UINT32 usSectorDirtDivider; // divide a guns dirt factor by this to get dirt increase for every turn
FLOAT iDirtGlobalModifier; // a global modifier to dirt generation, if one feels that all values should be lower/higher
// Flugente: prisoner related settings // Flugente: prisoner related settings
BOOLEAN fAllowPrisonerSystem; BOOLEAN fAllowPrisonerSystem;
+7 -7
View File
@@ -134,7 +134,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo );
// added by Flugente // added by Flugente
void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel ); void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel );
void CleanWeapons( BOOLEAN fCleanAll ); void CleanWeapons( BOOLEAN fEntireTeam );
void Strip( SOLDIERTYPE * pSoldier ); void Strip( SOLDIERTYPE * pSoldier );
void StartCorpseMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel ); 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 ); 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 ) if ( !gGameExternalOptions.fDirtSystem )
return; return;
@@ -4758,7 +4758,7 @@ void CleanWeapons( BOOLEAN fCleanAll )
return; return;
// if in turnbased mode, perform this action only for the selected merc, and use up APs // 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 ) if ( gusSelectedSoldier == NOBODY )
return; return;
@@ -4766,7 +4766,7 @@ void CleanWeapons( BOOLEAN fCleanAll )
SOLDIERTYPE* pSoldier = MercPtrs[ gusSelectedSoldier ]; SOLDIERTYPE* pSoldier = MercPtrs[ gusSelectedSoldier ];
if ( pSoldier->bActive ) if ( pSoldier->bActive )
pSoldier->CleanWeapon(fCleanAll); pSoldier->CleanWeapon(FALSE);
} }
else // perform action for every merc in this sector 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 the merc is in this sector
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bInSector && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) ) 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(); SectorFillCanteens();
break; break;
case 2: case 2:
// clean a single weapon // clean weapons of selected merc
CleanWeapons(FALSE); CleanWeapons(FALSE);
break; break;
case 3: case 3:
// clean all weapons // clean weapons of entire team
CleanWeapons(TRUE); CleanWeapons(TRUE);
break; break;
case 4: case 4:
+1 -1
View File
@@ -11425,7 +11425,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - 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[2] = GetItemDirtIncreaseFactor( gpItemDescObject, TRUE );
iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0]; iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0];
+4 -1
View File
@@ -14702,10 +14702,13 @@ 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 ) if ( fConsiderAmmo )
dirtincreasefactor *= (1.0f + AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].dirtModificator); 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) // dirt factor has to be >= 0 (items don't clean themselves)
dirtincreasefactor = max(0.0f, dirtincreasefactor); dirtincreasefactor = max(0.0f, dirtincreasefactor);
+1 -1
View File
@@ -3177,7 +3177,7 @@ BOOLEAN RepairIsDone(DEALER_SPECIAL_ITEM* pSpecial)
// fix it up // fix it up
(*iter)[0]->data.objectStatus = 100; (*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.sRepairThreshold = 100;
(*iter)[0]->data.bDirtLevel = 0.0f; (*iter)[0]->data.bDirtLevel = 0.0f;
} }
+4 -5
View File
@@ -14485,7 +14485,7 @@ OBJECTTYPE* SOLDIERTYPE::GetCleaningKit()
return( pObj ); 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 ) void SOLDIERTYPE::CleanWeapon( BOOLEAN fCleanAll )
{ {
// in turnbased, this action costs APs. remove them if possible, otherwise, return // 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 ); 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 // always use up 1% of the cleaning kit (they last too long otherwise)
if ( Random(2) > 0 ) UseKitPoints( pCleaningKit, 1, this );
UseKitPoints( pCleaningKit, 1, this );
if ( gTacticalStatus.uiFlags & TURNBASED ) if ( gTacticalStatus.uiFlags & TURNBASED )
{ {
// use up APs // use up APs
DeductPoints( this, apcost, 0, AFTERACTION_INTERRUPT ); DeductPoints( this, apcost, 0, AFTERACTION_INTERRUPT );
// if fCleanAll is false, only clean one weapon // if fCleanAll is false, only clean first weapon
if (!fCleanAll ) if (!fCleanAll )
return; return;
+4 -1
View File
@@ -11762,7 +11762,7 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature; singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature;
// determine modificator according to attachments // determine modificator according to attachments
FLOAT modificator = gGameExternalOptions.iOverheatTemperatureGlobalModfier; FLOAT modificator = 1.0f;
attachmentList::iterator iterend = (*pObj)[0]->attachments.end(); attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter) 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; modificator += AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].temperatureModificator;
singleshottemperature *= modificator; singleshottemperature *= modificator;
// multiply again for global modifer
singleshottemperature *= gGameExternalOptions.iOverheatTemperatureGlobalModfier;
} }
return singleshottemperature; return singleshottemperature;
+2 -2
View File
@@ -2922,8 +2922,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // added by Flugente: selection of a function to call in tactical
L"你想要做的是什么?", L"你想要做的是什么?",
L"装满水壶", L"装满水壶",
L"清理枪支污垢", L"Clean guns (Merc)",//TODO.Translate
L"清理所有枪支污垢", L"Clean guns (Team)",
L"脱掉衣服", L"脱掉衣服",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2919,8 +2919,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // TODO.Translate // added by Flugente: selection of a function to call in tactical // TODO.Translate
L"What do you want to do?", L"What do you want to do?",
L"Fill canteens", L"Fill canteens",
L"Clean gun", L"Clean guns (Merc)",//TODO.Translate
L"Clean all guns", L"Clean guns (Team)",
L"Take off clothes", L"Take off clothes",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2921,8 +2921,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // added by Flugente: selection of a function to call in tactical
L"What do you want to do?", L"What do you want to do?",
L"Fill canteens", L"Fill canteens",
L"Clean gun", L"Clean guns (Merc)",
L"Clean all guns", L"Clean guns (Team)",
L"Take off clothes", L"Take off clothes",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2926,8 +2926,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // TODO.Translate // added by Flugente: selection of a function to call in tactical // TODO.Translate
L"What do you want to do?", L"What do you want to do?",
L"Fill canteens", L"Fill canteens",
L"Clean gun", L"Clean guns (Merc)",//TODO.Translate
L"Clean all guns", L"Clean guns (Team)",
L"Take off clothes", L"Take off clothes",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2924,8 +2924,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // added by Flugente: selection of a function to call in tactical
L"Was möchten Sie tun?", L"Was möchten Sie tun?",
L"Feldflasche auffüllen", L"Feldflasche auffüllen",
L"Waffe reinigen", L"Clean guns (Merc)",//TODO.Translate
L"Alle Waffen reinigen", L"Clean guns (Team)",
L"Kleidung ausziehen", L"Kleidung ausziehen",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2913,8 +2913,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // TODO.Translate // added by Flugente: selection of a function to call in tactical // TODO.Translate
L"What do you want to do?", L"What do you want to do?",
L"Fill canteens", L"Fill canteens",
L"Clean gun", L"Clean guns (Merc)",//TODO.Translate
L"Clean all guns", L"Clean guns (Team)",
L"Take off clothes", L"Take off clothes",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2930,8 +2930,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // TODO.Translate // added by Flugente: selection of a function to call in tactical // TODO.Translate
L"What do you want to do?", L"What do you want to do?",
L"Fill canteens", L"Fill canteens",
L"Clean gun", L"Clean guns (Merc)",//TODO.Translate
L"Clean all guns", L"Clean guns (Team)",
L"Take off clothes", L"Take off clothes",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2921,8 +2921,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // TODO.Translate // added by Flugente: selection of a function to call in tactical // TODO.Translate
L"Что будем делать?", L"Что будем делать?",
L"Наполнить фляги", L"Наполнить фляги",
L"Почистить оружие", L"Clean guns (Merc)",//TODO.Translate
L"Почистить всё оружие", L"Clean guns (Team)",
L"Снять одежду", L"Снять одежду",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses
+2 -2
View File
@@ -2923,8 +2923,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
// added by Flugente: selection of a function to call in tactical // TODO.Translate // added by Flugente: selection of a function to call in tactical // TODO.Translate
L"What do you want to do?", L"What do you want to do?",
L"Fill canteens", L"Fill canteens",
L"Clean gun", L"Clean guns (Merc)",//TODO.Translate
L"Clean all guns", L"Clean guns (Team)",
L"Take off clothes", L"Take off clothes",
// added by Flugente: decide what to do with the corpses // added by Flugente: decide what to do with the corpses