diff --git a/GameVersion.cpp b/GameVersion.cpp index effd3027..f54182d6 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -15,9 +15,9 @@ #ifdef JA2EDITOR #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.6823 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7057 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.6823 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7057 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.6670 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7057 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.6670 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7057 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.6670 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7057 (Development Build)" }; #endif #elif defined CRIPPLED_VERSION @@ -46,16 +46,16 @@ //RELEASE BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.6670 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7057 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.6670 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7057 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.6670 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.7057 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 13.11.30" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 14.03.12" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Strategic/Hourly Update.cpp b/Strategic/Hourly Update.cpp index 19587c2c..fd8bc470 100644 --- a/Strategic/Hourly Update.cpp +++ b/Strategic/Hourly Update.cpp @@ -515,12 +515,14 @@ void HourlyStealUpdate() { pSoldier = MercPtrs[ cnt ]; - if ( pSoldier && !pSoldier->flags.fBetweenSectors && pSoldier->bActive && pSoldier->bInSector && !pSoldier->flags.fMercAsleep && !(gTacticalStatus.fEnemyInSector || guiCurrentScreen == GAME_SCREEN ) ) + // merc must be alive, not travelling and awake. If he is in the currently loaded sector, we may not be in tactical (we would see an item suddenly disappearing) and not in combat + if ( pSoldier && !pSoldier->flags.fBetweenSectors && pSoldier->bActive && !pSoldier->flags.fMercAsleep && + !( ( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) ) && (gTacticalStatus.fEnemyInSector || guiCurrentScreen == GAME_SCREEN )) ) { if ( pSoldier->HasBackgroundFlag( BACKGROUND_SCROUNGING ) ) { - // 20% chance that we'll steal something - if ( Chance(20) ) + // 50% chance that we'll steal something + if ( Chance(50) ) { // anv: snitches prevent scrounging in the same sector for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 ) @@ -562,7 +564,7 @@ void HourlyStealUpdate() std::vector pWorldItem;//dnl ch75 271013 BOOLEAN fReturn = FALSE; - if( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) ) + if ( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) ) { uiTotalNumberOfRealItems = guiNumWorldItems; @@ -591,7 +593,7 @@ void HourlyStealUpdate() } } - FLOAT bestpriceweightratio = 50.0f; // msut have a value of at least 50$/100 gram + FLOAT bestpriceweightratio = 50.0f; // must have a value of at least 50$/100 gram OBJECTTYPE* pTargetObj = NULL; for( UINT32 uiCount = 0; uiCount < uiTotalNumberOfRealItems; ++uiCount ) // ... for all items in the world ... { @@ -604,8 +606,15 @@ void HourlyStealUpdate() // test wether item is reachable and useable by militia if ( (pWorldItem[ uiCount ].usFlags & WORLD_ITEM_REACHABLE) ) { + // of course we prefer money above everything else + if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass == IC_MONEY ) + { + // give it a high enough value + bestpriceweightratio = 1000.0f; + pTargetObj = &(pWorldItem[ uiCount ].object); + } // ignore objects without weight (how does that happen anyway? careless modders...) - if ( Item[pWorldItem[ uiCount ].object.usItem].ubWeight ) + else if ( Item[pWorldItem[ uiCount ].object.usItem].ubWeight ) { if ( (FLOAT)(Item[pWorldItem[ uiCount ].object.usItem].usPrice) / (FLOAT)(Item[pWorldItem[ uiCount ].object.usItem].ubWeight) > bestpriceweightratio ) { diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index dc16aaab..2992e545 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -1805,8 +1805,8 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo ) if ( iResult >= 0 ) { // Less explosives gain for placing tripwire - if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire == 1 ) - StatChange( pSoldier, EXPLODEAMT, 5, FALSE ); + if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire ) + StatChange( pSoldier, EXPLODEAMT, 1, FALSE ); else // EXPLOSIVES GAIN (25): Place a bomb, or buried and armed a mine StatChange( pSoldier, EXPLODEAMT, 25, FALSE ); @@ -6872,38 +6872,36 @@ BOOLEAN RemoveFortification( INT32 sGridNo ) INT32 CheckBombDisarmChance(void) { - // NB owner grossness... bombs 'owned' by the enemy are stored with side value 1 in - // the map. So if we want to detect a bomb placed by the player, owner is > 1, and - // owner - 2 gives the ID of the character who planted it - if ( gTempObject[0]->data.misc.ubBombOwner > 1 && ( (INT32)gTempObject[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && gTempObject[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) ) + // NB owner grossness... bombs 'owned' by the enemy are stored with side value 1 in + // the map. So if we want to detect a bomb placed by the player, owner is > 1, and + // owner - 2 gives the ID of the character who planted it + if ( gTempObject[0]->data.misc.ubBombOwner > 1 && ( (INT32)gTempObject[0]->data.misc.ubBombOwner - 2 >= gTacticalStatus.Team[ OUR_TEAM ].bFirstID && gTempObject[0]->data.misc.ubBombOwner - 2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID ) ) + { + // Flugente: get a tripwire-related bonus if we have a wire cutter in our hands + INT8 wirecutterbonus = 0; + if ( ( (&gpBoobyTrapSoldier->inv[HANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpBoobyTrapSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) ) { - // Flugente: get a tripwire-related bonus if we have a wire cutter in our hands - INT8 wirecutterbonus = 0; - if ( ( (&gpBoobyTrapSoldier->inv[HANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[HANDPOS].usItem ].wirecutters == 1 ) || ( (&gpBoobyTrapSoldier->inv[SECONDHANDPOS])->exists() && Item[ gpBoobyTrapSoldier->inv[SECONDHANDPOS].usItem ].wirecutters == 1 ) ) - { - // + 10 if item gets activated by tripwire - if ( Item[gTempObject.usItem].tripwireactivation == 1 ) - wirecutterbonus += 10; - // + 10 if item is tripwire - if ( Item[gTempObject.usItem].tripwire == 1 ) - wirecutterbonus += 10; - } + // + 10 if item gets activated by tripwire + if ( Item[gTempObject.usItem].tripwireactivation == 1 ) + wirecutterbonus += 10; + // + 10 if item is tripwire + if ( Item[gTempObject.usItem].tripwire == 1 ) + wirecutterbonus += 10; + } - if ( gTempObject[0]->data.misc.ubBombOwner - 2 == gpBoobyTrapSoldier->ubID ) - { - // my own boobytrap! - return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 40 + wirecutterbonus ); - } - else - { - // our team's boobytrap! - return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 20 + wirecutterbonus ); - } + if ( gTempObject[0]->data.misc.ubBombOwner - 2 == gpBoobyTrapSoldier->ubID ) + { + // my own boobytrap! + return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 40 + wirecutterbonus ); } else { - return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 0 ); + // our team's boobytrap! + return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 20 + wirecutterbonus ); } + } + + return SkillCheck( gpBoobyTrapSoldier, DISARM_TRAP_CHECK, 0 ); } void ExtendedDisarmMessageBox(void) diff --git a/Tactical/Interface.h b/Tactical/Interface.h index b52d1bc0..69a49f05 100644 --- a/Tactical/Interface.h +++ b/Tactical/Interface.h @@ -173,6 +173,7 @@ enum { BG_PERC_CTH_MAX, BG_PERC_HEARING_NIGHT, BG_PERC_HEARING_DAY, + BG_TRAP_DISARM, // approaches BG_PERC_APPROACH_FRIENDLY, diff --git a/Tactical/SkillCheck.cpp b/Tactical/SkillCheck.cpp index 04d7bb48..0dbbb2f4 100644 --- a/Tactical/SkillCheck.cpp +++ b/Tactical/SkillCheck.cpp @@ -455,6 +455,10 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) } iSkill += EffectiveDexterity( pSoldier, FALSE ) * 2; iSkill += EffectiveExpLevel( pSoldier ) * 10; + + // Flugente: backgrounds + iSkill += pSoldier->GetBackgroundValue(BG_TRAP_DISARM); + iSkill = iSkill / 10; // bring the value down to a percentage //JMich_SkillModifiers: Adding a Disarm Trap bonus bSlot = FindDisarmKit( pSoldier); @@ -621,7 +625,7 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) } break; case ATTACH_POWER_PACK: // added by Flugente - // technicians can attach it, other people can' + // technicians can attach it, other people can't if ( HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT )) iSkill = 100; else diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 56062491..3899ba32 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -17022,7 +17022,7 @@ INT16 SOLDIERTYPE::GetAPBonus() if ( this->pathing.bLevel ) bonus += this->GetBackgroundValue(BG_HEIGHT); - + return bonus; } @@ -17039,7 +17039,7 @@ UINT8 SOLDIERTYPE::GetMoraleThreshold() { UINT8 threshold = 100; UINT8 moraledamage = 0; - + moraledamage = (moraledamage * (100 - GetFearResistanceBonus())) / 100; return min(threshold, max(0, threshold - moraledamage)); @@ -17421,8 +17421,6 @@ BOOLEAN SOLDIERTYPE::UseRadio() BOOLEAN SOLDIERTYPE::HasMortar() { - UINT16 mortaritem = 0; - INT8 invsize = (INT8)inv.size(); // remember inventorysize, so we don't call size() repeatedly for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) { @@ -21432,7 +21430,7 @@ BOOLEAN SectorJammed() INT32 lastid = MAX_NUM_SOLDIERS; for ( pSoldier = MercPtrs[ cnt ]; cnt < lastid; ++cnt, ++pSoldier) { - if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->IsJamming() ) + if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->stats.bLife > 0 && pSoldier->IsJamming() ) return TRUE; } @@ -21447,7 +21445,7 @@ BOOLEAN PlayerTeamIsScanning() INT32 lastid = gTacticalStatus.Team[ OUR_TEAM ].bLastID; for ( pSoldier = MercPtrs[ cnt ]; cnt < lastid; ++cnt, ++pSoldier) { - if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->IsScanning() ) + if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && pSoldier->stats.bLife > 0 && pSoldier->IsScanning() ) return TRUE; } diff --git a/Tactical/XML_Background.cpp b/Tactical/XML_Background.cpp index 631f3dba..a99f4d12 100644 --- a/Tactical/XML_Background.cpp +++ b/Tactical/XML_Background.cpp @@ -116,6 +116,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha strcmp(name, "increased_maxcth") == 0 || strcmp(name, "hearing_night") == 0 || strcmp(name, "hearing_day") == 0 || + strcmp(name, "disarm_trap") == 0 || strcmp(name, "approach_friendly") == 0 || strcmp(name, "approach_direct") == 0 || strcmp(name, "approach_threaten") == 0 || @@ -471,6 +472,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; pData->curBackground.value[BG_PERC_HEARING_DAY] = min(2, max(-5, (INT16) atol(pData->szCharData) )); } + else if(strcmp(name, "disarm_trap") == 0) + { + pData->curElement = ELEMENT; + pData->curBackground.value[BG_TRAP_DISARM] = min(50, max(-50, (INT16) atol(pData->szCharData) )); + } else if(strcmp(name, "approach_friendly") == 0) { pData->curElement = ELEMENT; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index c876841d..113504f9 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -8103,6 +8103,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%%最大准确度(CTH)\n", //L" %s%d%% max CTH\n", L" %s%d夜晚听力范围\n", //L" %s%d hearing range during the night\n", L" %s%d白天听力范围\n", //L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%%友好对话效果\n", //L" %s%d%% effectiveness to friendly approach\n", L" %s%d%%直接对话效果\n", //L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 31786c35..fe2481be 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -8117,6 +8117,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index e47c6db6..dc17fe5b 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -8100,6 +8100,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 6dbfc08f..cb160d54 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -8100,6 +8100,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% de chance de toucher maximum\n", L" %s%d en audition pendant la nuit\n", L" %s%d en audition pendant la journée\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% d'efficacité dans une approche amicale\n", L" %s%d%% d'efficacité dans une approche directe\n", diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 97bc5d71..9bf0c45f 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7927,6 +7927,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index ebd7364c..49c1f276 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -8109,6 +8109,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index dbbfa9cb..1273e55f 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -8127,6 +8127,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 2fdb4ba5..07dc30af 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -8105,6 +8105,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n", diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index b163f61d..4209bccc 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -8117,6 +8117,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% max CTH\n", L" %s%d hearing range during the night\n", L" %s%d hearing range during the day\n", + L" %s%d effectivity at disarming traps\n", // TODO.Translate L" %s%d%% effectiveness to friendly approach\n", L" %s%d%% effectiveness to direct approach\n",