diff --git a/Editor/EditorItems.cpp b/Editor/EditorItems.cpp index 376485fb..f6e68fcb 100644 --- a/Editor/EditorItems.cpp +++ b/Editor/EditorItems.cpp @@ -964,7 +964,10 @@ void AddSelectedItemToWorld( INT32 sGridNo ) else { if(gTempObject.usItem != OWNERSHIP)//dnl ch35 110909 + { (*pObject)[0]->data.objectStatus = (INT8)(70 + Random( 26 )); + (*pObject)[0]->data.sRepairThreshold = max(1, min(100, (100 + (*pObject)[0]->data.objectStatus)/2 )); + } } if( pItem->usItemClass & IC_GUN ) { diff --git a/Editor/EditorMercs.cpp b/Editor/EditorMercs.cpp index 0e188bd9..edd7702b 100644 --- a/Editor/EditorMercs.cpp +++ b/Editor/EditorMercs.cpp @@ -2813,7 +2813,10 @@ void AddNewItemToSelectedMercsInventory( BOOLEAN fCreate ) //randomize the status on non-ammo items. if( !(Item[ gpSelected->pDetailedPlacement->Inv[ gbMercSlotTypes[ gbCurrSelect ] ].usItem ].usItemClass & IC_AMMO) ) + { gpSelected->pDetailedPlacement->Inv[ gbMercSlotTypes[ gbCurrSelect ] ][0]->data.objectStatus = (INT8)(80 + Random( 21 )); + gpSelected->pDetailedPlacement->Inv[ gbMercSlotTypes[ gbCurrSelect ] ][0]->data.sRepairThreshold = max(1, min(100, (100 + gpSelected->pDetailedPlacement->Inv[ gbMercSlotTypes[ gbCurrSelect ] ][0]->data.objectStatus)/2 )); + } if( gusMercsNewItemIndex ) { diff --git a/GameSettings.cpp b/GameSettings.cpp index 03b86c15..0e77d35a 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1540,7 +1540,12 @@ void LoadGameExternalOptions() gGameExternalOptions.ubFacilityDangerRate = iniReader.ReadInteger("Strategic Gameplay Settings","FACILITY_DANGER_RATE", 50, 0, 100); // 2Points: Use new repair algorithm (Items are priorized based on type and damage to item, starting from equipped weapons, going to armor, then inventory) - gGameExternalOptions.fAdditionalRepairMode = iniReader.ReadBoolean("Strategic Gameplay Settings", "ADDITIONAL_REPAIR_MODE", FALSE); + gGameExternalOptions.fAdditionalRepairMode = iniReader.ReadBoolean("Strategic Gameplay Settings", "ADDITIONAL_REPAIR_MODE", FALSE); + + // Flugente: advanced repair/dirt system + gGameExternalOptions.fAdvRepairSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ADVANCED_REPAIR", FALSE); + gGameExternalOptions.fDirtSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","DIRT_SYSTEM", FALSE); + gGameExternalOptions.usSectorDirtDivider = iniReader.ReadInteger("Strategic Gameplay Settings","SECTOR_DIRT_DIVIDER", 1000, 1, 100000); // CHRISL: Determine how Skyrider should handle landing in enemy occupied sectors gGameExternalOptions.ubSkyriderHotLZ = iniReader.ReadInteger("Strategic Gameplay Settings", "ALLOW_SKYRIDER_HOT_LZ", 0); @@ -2434,6 +2439,7 @@ void LoadGameAPBPConstants() APBPConstants[AP_FORTIFICATION] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_FORTIFICATION",80),80); APBPConstants[AP_EAT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_EAT",80),80); + APBPConstants[AP_CLEANINGKIT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_CLEANINGKIT",80),80); SetupMaxActionPointsAnimation(); #undef ReadInteger diff --git a/GameSettings.h b/GameSettings.h index 54941304..c95794aa 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1142,6 +1142,11 @@ typedef struct // Flugente: External Feeding UINT8 ubExternalFeeding; // allow external feeding of guns (0 = no, 1 = only for others, 2 = we can also fed ourselves) + + // Flugente: advanced repair/dirt system + BOOLEAN fAdvRepairSystem; // allow thresholds to repairing + BOOLEAN fDirtSystem; // allow dirt on items increase the chance for weapon jamming + UINT32 usSectorDirtDivider; // divide a guns dirt factor by this to get dirt increase for every turn // Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed) UINT8 ubAllowAlternativeWeaponHolding; diff --git a/Init.h b/Init.h index 74f5278e..8408bab4 100644 --- a/Init.h +++ b/Init.h @@ -199,6 +199,7 @@ AP_JUMPWALL, AP_JUMPOFFWALL, AP_FORTIFICATION, AP_EAT, +AP_CLEANINGKIT, TOTAL_APBP_VALUES }; #endif diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 30ac8e5f..f8a9f48a 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -1741,7 +1741,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile) numBytesRead = ReadFieldByField(hFile, &this->sLastTarget, sizeof(sLastTarget), sizeof(INT32), numBytesRead); if(guiCurrentSaveGameVersion >= NCTH_DATATYPE_CHANGE){ - // Flugente: Sandro increased the size of these 4 varisbles to 2 (was 1) when the version got to DUAL_BURST_ADDED. + // Flugente: Sandro increased the size of these 4 variables to 2 (was 1) when the version got to DUAL_BURST_ADDED. // So if we load an old game, we set the second value to 0.0f and pretend we read it. This way old savegames will be savegame compatible if(guiCurrentSaveGameVersion < DUAL_BURST_ADDED) { diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 694ed1ac..827063b5 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -358,7 +358,7 @@ UINT8 GetMinHealingSkillNeeded( SOLDIERTYPE *pPatient ); UINT16 HealPatient( SOLDIERTYPE *pPatient, SOLDIERTYPE * pDoctor, UINT16 usHealAmount ); // can item be repaired? -BOOLEAN IsItemRepairable( UINT16 usItem, INT16 bStatus ); +BOOLEAN IsItemRepairable( UINT16 usItem, INT16 bStatus, INT16 bThreshold ); // does another merc have a repairable item on them? OBJECTTYPE* FindRepairableItemOnOtherSoldier( SOLDIERTYPE * pSoldier, UINT8 ubPassType ); @@ -3587,7 +3587,7 @@ static void CollectRepairableItems(const SOLDIERTYPE* pSoldier, RepairQueue& ite foundItem = false; for (UINT8 stackIndex = 0; stackIndex < pObj->ubNumberOfObjects; ++stackIndex) { // Check the stack item itself - if (IsItemRepairable(pObj->usItem, (*pObj)[stackIndex]->data.objectStatus)) { + if (IsItemRepairable(pObj->usItem, (*pObj)[stackIndex]->data.objectStatus, (*pObj)[stackIndex]->data.sRepairThreshold)) { RepairItem item(pObj, pSoldier, (INVENTORY_SLOT) pocketIndex); itemsToFix.push(item); break; @@ -3596,7 +3596,7 @@ static void CollectRepairableItems(const SOLDIERTYPE* pSoldier, RepairQueue& ite // Check for attachments (are there stackable items that can take attachments though?) UINT8 attachmentIndex = 0; for (attachmentList::const_iterator iter = (*pObj)[stackIndex]->attachments.begin(); iter != (*pObj)[stackIndex]->attachments.end(); ++iter, ++attachmentIndex) { - if (IsItemRepairable(iter->usItem, (*iter)[attachmentIndex]->data.objectStatus )) { + if (IsItemRepairable(iter->usItem, (*iter)[attachmentIndex]->data.objectStatus, (*iter)[attachmentIndex]->data.sRepairThreshold )) { // Send the main item, not the attachment RepairItem item(pObj, pSoldier, (INVENTORY_SLOT) pocketIndex); itemsToFix.push(item); @@ -3692,7 +3692,7 @@ OBJECTTYPE* FindRepairableItemInLBENODE( OBJECTTYPE * pObj, UINT8 subObject) OBJECTTYPE* FindRepairableItemInSpecificPocket( OBJECTTYPE * pObj, UINT8 subObject) { AssertNotNIL(pObj); - if ( IsItemRepairable( pObj->usItem, (*pObj)[subObject]->data.objectStatus ) ) + if ( IsItemRepairable( pObj->usItem, (*pObj)[subObject]->data.objectStatus, (*pObj)[subObject]->data.sRepairThreshold ) ) { return( pObj ); } @@ -3700,7 +3700,7 @@ OBJECTTYPE* FindRepairableItemInSpecificPocket( OBJECTTYPE * pObj, UINT8 subObje // have to check for attachments after... for (attachmentList::iterator iter = (*pObj)[subObject]->attachments.begin(); iter != (*pObj)[subObject]->attachments.end(); ++iter) { // if it's repairable and NEEDS repairing - if ( IsItemRepairable( iter->usItem, (*iter)[subObject]->data.objectStatus ) && iter->exists() ) { + if ( IsItemRepairable( iter->usItem, (*iter)[subObject]->data.objectStatus, (*iter)[subObject]->data.sRepairThreshold ) && iter->exists() ) { return( &(*iter) ); } } @@ -3708,8 +3708,8 @@ OBJECTTYPE* FindRepairableItemInSpecificPocket( OBJECTTYPE * pObj, UINT8 subObje return( 0 ); } - -void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, UINT8 * pubRepairPtsLeft ) +// Flugente: changed this function so that it repairs items up to a variable threshold instead of always 100%. This will only happen if the option gGameExternalOptions.fAdvRepairSystem is used +void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, INT16 sThreshold, UINT8 * pubRepairPtsLeft ) { INT16 sRepairCostAdj; UINT16 usDamagePts, usPtsFixed; @@ -3719,7 +3719,7 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, UI AssertNotNIL (pubRepairPtsLeft); // get item's repair ease, for each + point is 10% easier, each - point is 10% harder to repair - sRepairCostAdj = 100 - ( 10 * Item[ usItem ].bRepairEase ); + sRepairCostAdj = sThreshold - ( 10 * Item[ usItem ].bRepairEase ); // make sure it ain't somehow gone too low! if (sRepairCostAdj < 10) @@ -3743,7 +3743,7 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, UI } // how many points of damage is the item down by? - usDamagePts = 100 - *pbStatus; + usDamagePts = sThreshold - *pbStatus; // adjust that by the repair cost adjustment percentage usDamagePts = (usDamagePts * sRepairCostAdj) / 100; @@ -3751,8 +3751,8 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, UI // do we have enough pts to fully repair the item? if ( *pubRepairPtsLeft >= usDamagePts ) { - // fix it to 100% - *pbStatus = 100; + // fix it up to the threshold (max 100%) + *pbStatus = sThreshold; *pubRepairPtsLeft -= usDamagePts; } else // not enough, partial fix only, if any at all @@ -3766,10 +3766,10 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, UI { *pbStatus += usPtsFixed; - // make sure we don't somehow end up over 100 - if ( *pbStatus > 100 ) + // make sure we don't somehow end up over the threshold + if ( *pbStatus > sThreshold ) { - *pbStatus = 100; + *pbStatus = sThreshold; } } @@ -3790,22 +3790,32 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE * for ( ubLoop = 0; ubLoop < ubItemsInPocket; ubLoop++ ) { // if it's repairable and NEEDS repairing - if ( IsItemRepairable( pObj->usItem, (*pObj)[ubLoop]->data.objectStatus ) ) + if ( IsItemRepairable( pObj->usItem, (*pObj)[ubLoop]->data.objectStatus, (*pObj)[ubLoop]->data.sRepairThreshold ) ) { /////////////////////////////////////////////////////////////////////////////////////////////////////// // SANDRO - merc records, num items repaired // Actually we check if we repaired at least 5% of status, otherwise the item is not considered broken ubBeforeRepair = (UINT8)((*pObj)[ubLoop]->data.objectStatus); - // repairable, try to repair it - DoActualRepair( pSoldier, pObj->usItem, &((*pObj)[ubLoop]->data.objectStatus), pubRepairPtsLeft ); + // Flugente: if using the new advanced repair system, we can only repair up to the repair threshold + INT16 threshold = 100; + if ( gGameExternalOptions.fAdvRepairSystem && ( (Item[pObj->usItem].usItemClass & IC_WEAPON) || (Item[pObj->usItem].usItemClass & IC_ARMOUR) ) ) + threshold = (*pObj)[ubLoop]->data.sRepairThreshold; + + // repairable, try to repair it + DoActualRepair( pSoldier, pObj->usItem, &((*pObj)[ubLoop]->data.objectStatus), threshold, pubRepairPtsLeft ); + // if the item was repaired to full status and the repair wa at least 5%, add a point - if ( (*pObj)[ubLoop]->data.objectStatus == 100 && (((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 4 )) + if ( (*pObj)[ubLoop]->data.objectStatus == threshold && (((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 4 )) { gMercProfiles[ pSoldier->ubProfile ].records.usItemsRepaired++; + + // if item was fully repaired, consider it cleaned + if ( gGameExternalOptions.fDirtSystem ) + (*pObj)[ubLoop]->data.bDirtLevel = 0.0f; } // if the item was now repaired to a status of 96-99 and the repair was at least 2%, add a point, consider the item repaired (no points will be awarded for it anyway) - else if ( (*pObj)[ubLoop]->data.objectStatus > 95 && (*pObj)[ubLoop]->data.objectStatus < 100 && ((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 1) + else if ( (*pObj)[ubLoop]->data.objectStatus > threshold - 5 && (*pObj)[ubLoop]->data.objectStatus < threshold && ((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 1) { gMercProfiles[ pSoldier->ubProfile ].records.usItemsRepaired++; } @@ -4142,14 +4152,20 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier ) -BOOLEAN IsItemRepairable( UINT16 usItem, INT16 bStatus ) +BOOLEAN IsItemRepairable( UINT16 usItem, INT16 bStatus, INT16 bThreshold ) { // check to see if item can/needs to be repaired // if ( ( bStatus < 100) && ( Item[ usItem ].fFlags & ITEM_REPAIRABLE ) ) - if ( ( bStatus < 100) && ( Item[ usItem ].repairable ) ) + if ( ( bStatus < 100) && ( Item[ usItem ].repairable ) ) { - // yep - return ( TRUE ); + if ( gGameExternalOptions.fAdvRepairSystem ) + { + if ( ( ((Item[usItem].usItemClass & IC_WEAPON) != 0) || Item[usItem].usItemClass == IC_ARMOUR ) && bStatus < bThreshold ) + return ( TRUE ); + } + else + // yep + return ( TRUE ); } // nope diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 33b82a2a..29d04adf 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -48,6 +48,11 @@ class OBJECTTYPE; class SOLDIERTYPE; +// Flugente: external sector data +extern SECTOR_EXT_DATA SectorExternalData[256][4]; + +extern void SetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ); // Flugente: set last time sector was visited + //dnl ch51 081009 UINT8 gInventoryPoolIndex = '0'; std::vector pInventoryPoolListQ[INVPOOLLISTNUM]; @@ -5069,6 +5074,14 @@ void SectorInventoryCooldownFunctions( INT16 sMapX, INT16 sMapY, INT16 sMapZ ) //Save the Items to the the file SaveWorldItemsToTempItemFile( sMapX, sMapY, (INT8)sMapZ, uiTotalNumberOfRealItems, pTotalSectorList ); } + + HandleSectorCooldownFunctions( sMapX, sMapY, (INT8)sMapZ, pTotalSectorList, uiTotalNumberOfRealItems, TRUE ); + + //Save the time the player was last in the sector + SetLastTimePlayerWasInSector( sMapX, sMapY, (INT8)sMapZ ); + + //Save the Items to the the file + SaveWorldItemsToTempItemFile( sMapX, sMapY, (INT8)sMapZ, uiTotalNumberOfRealItems, pTotalSectorList ); } // Flugente: handle various cooldwon functions over an array of items in a specific sector. @@ -5077,7 +5090,7 @@ void SectorInventoryCooldownFunctions( INT16 sMapX, INT16 sMapY, INT16 sMapZ ) void HandleSectorCooldownFunctions( INT16 sMapX, INT16 sMapY, INT8 sMapZ, WORLDITEM* pWorldItem, UINT32 size, BOOLEAN fWithMinutes ) { // if not using overheating or food system, no point in all this - if ( !gGameOptions.fWeaponOverheating && !gGameOptions.fFoodSystem ) + if ( !gGameOptions.fWeaponOverheating && !gGameExternalOptions.fDirtSystem && !gGameOptions.fFoodSystem ) return; UINT32 tickspassed = 1; @@ -5105,6 +5118,16 @@ void HandleSectorCooldownFunctions( INT16 sMapX, INT16 sMapY, INT8 sMapZ, WORLDI if ( sMapZ > 0 ) foofdecaymod *= 0.8f; + // get sector-specific dirt threshold + UINT16 sectormod = 0; + UINT8 ubSectorId = SECTOR(sMapX, sMapY); + if ( sMapZ > 0 ) + sectormod = 100; + else if ( ubSectorId >= 0 && ubSectorId < 256 ) + { + sectormod = SectorExternalData[ubSectorId][sMapZ].usNaturalDirt; + } + for( UINT32 uiCount = 0; uiCount < size; ++uiCount ) // ... for all items in the world ... { if( pWorldItem[ uiCount ].fExists ) // ... if item exists ... @@ -5158,6 +5181,24 @@ void HandleSectorCooldownFunctions( INT16 sMapX, INT16 sMapY, INT8 sMapZ, WORLDI } } + 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; + + 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 + tickspassed * dirtincreasefactor) ); // set new temperature + } + } + } + if ( gGameOptions.fFoodSystem && Item[pWorldItem[ uiCount ].object.usItem].foodtype > 0 ) // ... if it is food and the food system is active ... { if ( Food[Item[pObj->usItem].foodtype].usDecayRate > 0.0f ) // ... if the food can decay... diff --git a/Strategic/XML_SectorNames.cpp b/Strategic/XML_SectorNames.cpp index e030fda2..f69bbb1b 100644 --- a/Strategic/XML_SectorNames.cpp +++ b/Strategic/XML_SectorNames.cpp @@ -19,8 +19,8 @@ // Four different sector names, used at different times. extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH]; -// Flugente: To determine wether a sector has water in it. -extern UINT8 gSectorWaterType[256][4]; +// Flugente: external sector data +extern SECTOR_EXT_DATA SectorExternalData[256][4]; // moved to lua //extern CHAR16 gzSectorUndergroundNames1[256][4][MAX_SECTOR_NAME_LENGTH]; @@ -46,6 +46,7 @@ typedef struct CHAR16 szCurExploredName[MAX_SECTOR_NAME_LENGTH]; CHAR16 szCurDetailedExploredName[MAX_SECTOR_NAME_LENGTH]; UINT8 sWaterType; + UINT16 usNaturalDirt; UINT32 currentDepth; UINT32 maxReadDepth; } SectorNameParseData; @@ -70,10 +71,15 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char ** // Initiate Array by setting first character to 0. for (UINT16 x = 0; x < 256; x++) { - gSectorWaterType[x][0] = 0; - gSectorWaterType[x][1] = 0; - gSectorWaterType[x][2] = 0; - gSectorWaterType[x][3] = 0; + SectorExternalData[x][0].usWaterType = 0; + SectorExternalData[x][1].usWaterType = 0; + SectorExternalData[x][2].usWaterType = 0; + SectorExternalData[x][3].usWaterType = 0; + + SectorExternalData[x][0].usNaturalDirt = 0; + SectorExternalData[x][1].usNaturalDirt = 0; + SectorExternalData[x][2].usNaturalDirt = 0; + SectorExternalData[x][3].usNaturalDirt = 0; if (Sector_Level == 0 ) { @@ -121,7 +127,8 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char ** strcmp(name, "szDetailedUnexploredName") == 0 || strcmp(name, "szExploredName") == 0 || strcmp(name, "szDetailedExploredName") == 0 || - strcmp(name, "sWaterType") == 0 )) + strcmp(name, "sWaterType") == 0 || + strcmp(name, "usNaturalDirt") == 0 )) { pData->curElement = SECTORNAME_ELEMENT; @@ -174,10 +181,15 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name) wcscpy(gzSectorNames[ubSectorId][2], pData->szCurExploredName); wcscpy(gzSectorNames[ubSectorId][3], pData->szCurDetailedExploredName); - gSectorWaterType[ubSectorId][0] = pData->sWaterType; - gSectorWaterType[ubSectorId][1] = pData->sWaterType; - gSectorWaterType[ubSectorId][2] = pData->sWaterType; - gSectorWaterType[ubSectorId][3] = pData->sWaterType; + SectorExternalData[ubSectorId][0].usWaterType = pData->sWaterType; + SectorExternalData[ubSectorId][1].usWaterType = pData->sWaterType; + SectorExternalData[ubSectorId][2].usWaterType = pData->sWaterType; + SectorExternalData[ubSectorId][3].usWaterType = pData->sWaterType; + + SectorExternalData[ubSectorId][0].usNaturalDirt = pData->usNaturalDirt; + SectorExternalData[ubSectorId][1].usNaturalDirt = pData->usNaturalDirt; + SectorExternalData[ubSectorId][2].usNaturalDirt = pData->usNaturalDirt; + SectorExternalData[ubSectorId][3].usNaturalDirt = pData->usNaturalDirt; } // moved to lua //else if (Sector_Level == 1 ) @@ -211,10 +223,15 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name) wcscpy(gzSectorNames[ubSectorId][2], pData->szCurExploredName); wcscpy(gzSectorNames[ubSectorId][3], pData->szCurDetailedExploredName); - gSectorWaterType[ubSectorId][0] = pData->sWaterType; - gSectorWaterType[ubSectorId][1] = pData->sWaterType; - gSectorWaterType[ubSectorId][2] = pData->sWaterType; - gSectorWaterType[ubSectorId][3] = pData->sWaterType; + SectorExternalData[ubSectorId][0].usWaterType = pData->sWaterType; + SectorExternalData[ubSectorId][1].usWaterType = pData->sWaterType; + SectorExternalData[ubSectorId][2].usWaterType = pData->sWaterType; + SectorExternalData[ubSectorId][3].usWaterType = pData->sWaterType; + + SectorExternalData[ubSectorId][0].usNaturalDirt = pData->usNaturalDirt; + SectorExternalData[ubSectorId][1].usNaturalDirt = pData->usNaturalDirt; + SectorExternalData[ubSectorId][2].usNaturalDirt = pData->usNaturalDirt; + SectorExternalData[ubSectorId][3].usNaturalDirt = pData->usNaturalDirt; } // moved to lua //else if (Sector_Level == 1 ) @@ -293,6 +310,12 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name) pData->sWaterType = (UINT8) atol(pData->szCharData); } + else if(strcmp(name, "usNaturalDirt") == 0) + { + pData->curElement = SECTORNAME_ELEMENT_SECTOR; + pData->usNaturalDirt = (UINT16) atoi(pData->szCharData); + } + pData->maxReadDepth--; } diff --git a/Tactical/Food.cpp b/Tactical/Food.cpp index d9012ed0..f39190cc 100644 --- a/Tactical/Food.cpp +++ b/Tactical/Food.cpp @@ -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; diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index ba008820..ad90e1db 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -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 diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 2fa385b1..65813612 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -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 ) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 02e1eb66..04b90a5f 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -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; diff --git a/Tactical/Interface Utils.cpp b/Tactical/Interface Utils.cpp index 7b75de4b..28cdd0d0 100644 --- a/Tactical/Interface Utils.cpp +++ b/Tactical/Interface Utils.cpp @@ -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 ); diff --git a/Tactical/Item Types.cpp b/Tactical/Item Types.cpp index 698b65c6..a38b33db 100644 --- a/Tactical/Item Types.cpp +++ b/Tactical/Item Types.cpp @@ -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; } } diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index 0805b88e..70e5190d 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -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 diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index d2f5de1d..7e0acda3 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -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; } \ No newline at end of file diff --git a/Tactical/Items.h b/Tactical/Items.h index ef5faba7..048dea4b 100644 --- a/Tactical/Items.h +++ b/Tactical/Items.h @@ -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& 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); diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 8a997fcf..4e232315 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -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 //////////////////////////// diff --git a/Tactical/Rotting Corpses.cpp b/Tactical/Rotting Corpses.cpp index ccdc8a54..657cfb37 100644 --- a/Tactical/Rotting Corpses.cpp +++ b/Tactical/Rotting Corpses.cpp @@ -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 )); } } diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp index 5b728c1f..df4b354e 100644 --- a/Tactical/ShopKeeper Interface.cpp +++ b/Tactical/ShopKeeper Interface.cpp @@ -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; } } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 03f2ad87..e1769636 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -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; diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 9b6573d5..3bd34f00 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -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; diff --git a/Tactical/Tactical Save.cpp b/Tactical/Tactical Save.cpp index f7031665..2ba844b8 100644 --- a/Tactical/Tactical Save.cpp +++ b/Tactical/Tactical Save.cpp @@ -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() diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 7389dcba..466d4a2c 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -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; diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 48ec603d..86785336 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -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); diff --git a/Tactical/Weapons.h b/Tactical/Weapons.h index d41b44ca..ef68fa71 100644 --- a/Tactical/Weapons.h +++ b/Tactical/Weapons.h @@ -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; diff --git a/Tactical/XML_AmmoTypes.cpp b/Tactical/XML_AmmoTypes.cpp index 39e08e93..d09ac6a3 100644 --- a/Tactical/XML_AmmoTypes.cpp +++ b/Tactical/XML_AmmoTypes.cpp @@ -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\r\n"); - FilePrintf(hFile,"\t\t%d\r\n", cnt ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].fontColour ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].grayed ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].offNormal ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].onNormal ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].structureImpactReductionMultiplier ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].structureImpactReductionDivisor ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].armourImpactReductionMultiplier ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].armourImpactReductionDivisor ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].beforeArmourDamageMultiplier ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].beforeArmourDamageDivisor ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].afterArmourDamageDivisor ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].zeroMinimumDamage ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].canGoThrough ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].standardIssue ); + FilePrintf(hFile,"\t\t%d\r\n", cnt ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].fontColour ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].grayed ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].offNormal ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].onNormal ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].structureImpactReductionMultiplier ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].structureImpactReductionDivisor ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].armourImpactReductionMultiplier ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].armourImpactReductionDivisor ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].beforeArmourDamageMultiplier ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].beforeArmourDamageDivisor ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].afterArmourDamageDivisor ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].zeroMinimumDamage ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].canGoThrough ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].standardIssue ); FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].numberOfBullets ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].multipleBulletDamageDivisor ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].highExplosive ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].explosionSize ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].antiTank ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].dart ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].knife ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].monsterSpit ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].acidic ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].ignoreArmour ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].multipleBulletDamageDivisor ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].highExplosive ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].explosionSize ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].antiTank ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].dart ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].knife ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].monsterSpit ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].acidic ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].ignoreArmour ); FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].lockBustingPower ); - FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].tracerEffect ); - FilePrintf(hFile,"\t\t%4.2f\r\n", AmmoTypes[cnt].temperatureModificator ); + FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].tracerEffect ); + FilePrintf(hFile,"\t\t%4.2f\r\n", AmmoTypes[cnt].temperatureModificator ); FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].poisonPercentage ); + FilePrintf(hFile,"\t\t%4.2f\r\n", AmmoTypes[cnt].dirtModificator ); FilePrintf(hFile,"\t\r\n"); diff --git a/Utils/Text.h b/Utils/Text.h index 36b39d3f..75bd1d3e 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -620,8 +620,8 @@ extern STR16 gTemperatureDesc[ 11 ]; extern STR16 gFoodDesc[ 8 ]; extern CHAR16 gMoneyStatsDesc[][ 14 ]; -// HEADROCK: Altered value to 16 //WarmSteel - And I need 17. -extern CHAR16 gWeaponStatsDesc[][ 17 ]; +// HEADROCK: Altered value to 16 //WarmSteel - And I need 17. // Flugente: 17->19 +extern CHAR16 gWeaponStatsDesc[][ 19 ]; // HEADROCK: Added externs for Item Description Box icon and stat tooltips // Note that I've inflated some of these to 20 to avoid issues. extern STR16 gzWeaponStatsFasthelp[ 32 ]; @@ -636,14 +636,14 @@ extern STR16 szUDBGenWeaponsStatsTooltipText[ 23 ]; extern STR16 szUDBGenWeaponsStatsExplanationsTooltipText[ 23 ]; extern STR16 szUDBGenArmorStatsTooltipText[ 3 ]; extern STR16 szUDBGenArmorStatsExplanationsTooltipText[ 3 ]; -extern STR16 szUDBGenAmmoStatsTooltipText[ 5 ]; // Flugente Overheating: 3->4 poison: 4->5 -extern STR16 szUDBGenAmmoStatsExplanationsTooltipText[ 5 ]; // Flugente Overheating: 3->4 poison: 4->5 +extern STR16 szUDBGenAmmoStatsTooltipText[ 6 ]; // Flugente Overheating: 3->4 poison: 4->5 dirt: 5->6 +extern STR16 szUDBGenAmmoStatsExplanationsTooltipText[ 6 ]; // Flugente Overheating: 3->4 poison: 4->5 dirt: 5->6 extern STR16 szUDBGenExplosiveStatsTooltipText[ 22 ]; extern STR16 szUDBGenExplosiveStatsExplanationsTooltipText[ 22 ]; extern STR16 szUDBGenSecondaryStatsTooltipText[ 31 ]; // Flugente Food System: 26 -> 28 external feeding: 28->30 JMich_SkillsModifiers: 31 for Defusal kit extern STR16 szUDBGenSecondaryStatsExplanationsTooltipText[ 31 ]; // Flugente Food System: 26 -> 28 external feeding: 28->30 JMich_SkillsModifiers: 31 for Defusal kit -extern STR16 szUDBAdvStatsTooltipText[ 57 ]; // Flugente Overheating Weapons: 48->56 poison: 56->57 -extern STR16 szUDBAdvStatsExplanationsTooltipText[ 57 ]; // Flugente Overheating Weapons: 48->56 poison: 56->57 +extern STR16 szUDBAdvStatsTooltipText[ 58 ]; // Flugente Overheating Weapons: 48->56 poison: 56->57 dirt: 57->58 +extern STR16 szUDBAdvStatsExplanationsTooltipText[ 58 ]; // Flugente Overheating Weapons: 48->56 poison: 56->57 dirt: 57->58 extern STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[ 52 ]; // Flugente Overheating Weapons: 48->52 // Headrock: End Externs @@ -2149,6 +2149,9 @@ extern STR16 ChineseSpecString4; extern STR16 ChineseSpecString5; extern STR16 ChineseSpecString6; extern STR16 ChineseSpecString7; +extern STR16 ChineseSpecString8; +extern STR16 ChineseSpecString9; +extern STR16 ChineseSpecString10; enum { diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index 646b5390..15f0c5e4 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -268,6 +268,8 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at strcmp(name, "PoisonPercentage") == 0 || strcmp(name, "ItemFlag") == 0 || strcmp(name, "FoodType") == 0 || + strcmp(name, "DamageChance") == 0 || + strcmp(name, "DirtIncreaseFactor") == 0 || strcmp(name, "fFlags") == 0 || //JMich_SkillModifiers: Adding new flags @@ -1375,6 +1377,16 @@ itemEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; pData->curItem.RepairModifier = (INT8) atol(pData->szCharData); } + else if(strcmp(name, "DamageChance") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.usDamageChance = (UINT8) atol(pData->szCharData); + } + else if(strcmp(name, "DirtIncreaseFactor") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.dirtIncreaseFactor = (FLOAT) atof(pData->szCharData); + } pData->maxReadDepth--; } @@ -1990,6 +2002,8 @@ BOOLEAN WriteItemStats() FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].blockironsight ); + FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].bPoisonPercentage ); + FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].usItemFlag ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].foodtype ); @@ -2003,6 +2017,9 @@ BOOLEAN WriteItemStats() // Flugente poison system FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].bPoisonPercentage ); + FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].usDamageChance ); + FilePrintf(hFile,"\t\t%4.2f\r\n", Item[cnt].dirtIncreaseFactor ); + FilePrintf(hFile,"\t\r\n"); } FilePrintf(hFile,"\r\n"); diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 9029203e..c392ec6f 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2444,7 +2444,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"状态: ", @@ -2469,6 +2469,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = L"连发/5AP: ", //15 L"剩余弹药:", //16 L"默认:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6513,6 +6514,11 @@ STR16 ChineseSpecString4 = L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) STR16 ChineseSpecString5 = L"%s [%d%%]\n%s %d\n%s %d\n%s %1.1f %s"; STR16 ChineseSpecString6 = L"%s [%d%%]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s"; STR16 ChineseSpecString7 = L"%s [%d%%]\n%s %1.1f %s"; +STR16 ChineseSpecString8 = 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%%"; // added by Flugente +STR16 ChineseSpecString9 = L"%s [%d%%(%d%%)]\n%s %d\n%s %d\n%s %1.1f %s"; // added by Flugente +STR16 ChineseSpecString10 = L"%s [%d%%(%d%%)]\n%s %d%% (%d/%d)\n%s %d%%\n%s %1.1f %s"; // added by Flugente +STR16 ChineseSpecString11 = L"%s (%s) [%d%%(%d%%)]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s"; // added by Flugente +STR16 ChineseSpecString12 = 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%%"; // added by Flugente // Following strings added - SANDRO STR16 pSkillTraitBeginIMPStrings[] = @@ -6971,6 +6977,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|爆|炸|力|(|炸|子|儿|)", L"|过|热|修|正", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6980,6 +6987,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \n该值是子弹在击中目标前已经造成的潜在伤害的倍率。\n \n大于1的数值可以增加伤害,\n反之则减少伤害。\n \n该数值越高越好。", L"\n \n子弹温度系数。\n \n该数值越低越好。", L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7167,6 +7175,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|卡|壳|阈|值", L"|损|坏|阈|值", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7229,6 +7238,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \n武器的卡壳阈值增加了(百分比)。\n \n该数值越高越好。", L"\n \n武器的损坏阈值增加了(百分比)。\n \n该数值越高越好。", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index f8cd620b..87af13ac 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2441,7 +2441,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2466,6 +2466,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = // TODO.Translate L"Default:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6967,6 +6968,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6976,6 +6978,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7163,6 +7166,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7225,6 +7229,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index dad7a4bc..8ed8fd6a 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2444,7 +2444,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2469,6 +2469,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = L"AUTO/5:", //15 L"Remaining ammo:", //16 L"Default:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente }; @@ -6958,6 +6959,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6967,6 +6969,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7154,7 +7157,8 @@ STR16 szUDBAdvStatsTooltipText[]= L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|e|r", L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", - L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", + L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", + L"|D|i|r|t |M|o|d|i|f|i|e|r", }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7217,6 +7221,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 2affd8e7..1336a110 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2445,7 +2445,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Etat :", @@ -2468,6 +2468,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = L"AUTO/5:", //15 L"Munit. rest. :", //16 L"Par défaut :", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6942,6 +6943,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6951,6 +6953,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nMultiplicateur de potentiel de dégâts juste avant\nl'impact de la balle.\n \nAvec une valeur supérieure à 1.0, la balle fera de lourds dégâts\nUne valeur inférieure à 1.0 fera des dégâts moindre.\n \nValeur élevée recommandée.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7138,6 +7141,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7200,6 +7204,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index e93c97e0..b5e649e5 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2452,7 +2452,7 @@ STR16 sKeyDescriptionStrings[2]= }; //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2476,6 +2476,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = L"Verf. Munition:", //16 L"Standard:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6786,6 +6787,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|E|x|p|l|o|s|i|o|n |v|o|r |E|i|n|s|c|h|l|a|g", L"|T|e|m|p|e|r|a|t|u|r |M|o|d|i|f|i|k|a|t|o|r", L"|G|i|f|t|-|I|n|d|i|k|a|t|o|r", + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6795,6 +6797,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nEin Multiplikator zum Schadenspotential der Kugel,\nder vor dem Treffen des Zieles angewandt wird.\n \nWerte über 1.0 erhöhen, Werte unter 1.0 reduzieren den Schaden.\n \nHöher ist besser.", L"\n \nProzentuale zusätzliche Hitze\ndurch diese Munitionsart.\n \nNiedriger ist besser.", L"\n \nGibt die Anzahl in Prozent an,\nob der eingetretene Schaden einer Kugel auch eine Vergiftung verursacht.", + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -6982,6 +6985,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|M|o|d|i|f|i|k|a|t|o|r|-|L|a|d|e|h|e|m|m|u|n|g|s|s|c|h|r|a|n|k|e", L"|M|o|d|i|f|i|k|a|t|o|r|-|H|i|t|z|e|s|c|h|a|d|e|n|s|s|c|h|r|a|n|k|e", L"|G|i|f|t|-|I|n|d|i|k|a|t|o|r", + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7044,6 +7048,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nLadehemmungsschranke wird um diesen Prozentsatz erhöht.\n \nHöher ist besser.", L"\n \nHitzeschadensschranke wird um diesen Prozentsatz erhöht.\n \nHöher is besser.", L"\n \nDies ist der prozentuelle Schaden der durch\nden vergifteten Gegenstand verursacht wird.\n\nDieser Schaden hängt natürlich davon ab,\noder der Feind eine Gift-Resistenz hat oder nicht.", + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 28d69107..04a3a7f0 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2436,7 +2436,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Stato:", @@ -2461,6 +2461,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = // TODO.Translate L"Default:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6954,6 +6955,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6963,6 +6965,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7150,6 +7153,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7212,6 +7216,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 9ec91e0d..f95786a4 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2452,7 +2452,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Stan:", @@ -2476,6 +2476,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = L"Remaining ammo:", //16 // TODO.Translate L"DomyŚlne:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6966,6 +6967,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6975,6 +6977,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7162,6 +7165,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7224,6 +7228,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index dbb7bfb1..1a1fc4a9 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2445,7 +2445,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Состояние:", @@ -2469,6 +2469,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = L"Осталось патрон:", //16 //Remaining ammo L"Предустановка:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente // TODO.Translate }; @@ -6934,6 +6935,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|П|р|е|д|в|а|р|и|т|е|л|ь|н|о|е |в|л|и|я|н|и|е |в|з|р|ы|в|а", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6943,6 +6945,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7130,6 +7133,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7192,6 +7196,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]= diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index d35d8b37..f0de3a4c 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -2445,7 +2445,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -CHAR16 gWeaponStatsDesc[][ 17 ] = +CHAR16 gWeaponStatsDesc[][ 19 ] = { // HEADROCK: Changed this for Extended Description project L"Status:", @@ -2470,6 +2470,7 @@ CHAR16 gWeaponStatsDesc[][ 17 ] = // TODO.Translate L"Default:", //17 //WarmSteel - So we can also display default attachments + L"Dirt:", // 18 //added by Flugente }; @@ -6971,6 +6972,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]= L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n", L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate }; STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= @@ -6980,6 +6982,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]= L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.", L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate L"\n \nDetermines what percentage of a\nbullet's damage will be poisonous.", // TODO.Translate + L"\n \nAdditional dirt generated by this ammunition.\n \nLower is better.", // TODO.Translate }; STR16 szUDBGenExplosiveStatsTooltipText[]= @@ -7167,6 +7170,7 @@ STR16 szUDBAdvStatsTooltipText[]= L"|J|a|m |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|D|a|m|a|g|e |T|h|r|e|s|h|o|l|d |M|o|d|i|f|i|e|r", L"|P|o|i|s|o|n |P|e|r|c|e|n|t|a|g|e", // TODO.Translate + L"|D|i|r|t |M|o|d|i|f|i|e|r", // TODO.Translate }; // Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular. @@ -7229,6 +7233,7 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]= L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.", L"\n \nThis is the percentage of damage dealt\nby this item that will be poisonous.\n\nUsefulness depends on wether enemy\nhas poison resistance or absorption.", // TODO.Translate + L"\n \nA single shot causes this much dirt.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate }; STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=