diff --git a/GameVersion.cpp b/GameVersion.cpp index 9d35f5e5..58c273f7 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.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8530 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8530 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8530 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8530 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8530 (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.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8530 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8530 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.8529 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.8530 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 18.02.27" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 18.02.28" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Tactical/Drugs And Alcohol.cpp b/Tactical/Drugs And Alcohol.cpp index ab1e5a0d..da4aa2a7 100644 --- a/Tactical/Drugs And Alcohol.cpp +++ b/Tactical/Drugs And Alcohol.cpp @@ -196,7 +196,7 @@ BOOLEAN ApplyDrugs_New( SOLDIERTYPE *pSoldier, UINT16 usItem, UINT16 uStatusUsed } else { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_DRUG], pSoldier->GetName( ) ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_DRUG], pSoldier->GetName( ), ShortItemNames[usItem] ); } } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index a4899e92..89eabdf5 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -7796,6 +7796,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou // this has to happen before CalculateCarriedWeight(), otherwise strength modfiers will not be detected correctly this->SoldierPropertyUpkeep( ); + // Flugente: drug users might consume useful drugs on their own in combat + this->DrugAutoUse(); + this->sWeightCarriedAtTurnStart = (INT16)CalculateCarriedWeight( this ); UnusedAPsToBreath( this ); @@ -17503,6 +17506,9 @@ void SOLDIERTYPE::SoldierPropertyUpkeep( ) if ( this->usSkillCooldown[SOLDIER_COOLDOWN_CRYO] ) this->usSkillCooldown[SOLDIER_COOLDOWN_CRYO]--; + if ( this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] ) + this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT]--; + // if soldier was seen this turn, increase his observed counter if ( this->usSoldierFlagMask & SOLDIER_ENEMY_OBSERVEDTHISTURN ) { @@ -19979,6 +19985,61 @@ void SOLDIERTYPE::StopChatting() } } +void SOLDIERTYPE::DrugAutoUse() +{ + if ( !this->HasBackgroundFlag( BACKGROUND_DRUGUSE ) ) + return; + + if ( !( gTacticalStatus.uiFlags & (INCOMBAT| TURNBASED) ) ) + return; + + if ( this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] ) + return; + + INT8 invsize = (INT8)inv.size(); // remember inventorysize, so we don't call size() repeatedly + for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) + { + if ( inv[bLoop].exists() && Item[inv[bLoop].usItem].drugtype ) + { + // use portionsize, if none was entered, use full item + UINT8 portionsize = Item[inv[bLoop].usItem].usPortionSize; + if ( !portionsize ) + portionsize = 100; + + // how much of this item do we use up + UINT8 usable = min( portionsize, ( this->inv[bLoop] )[0]->data.objectStatus ); + if ( !usable ) + continue; + + std::vector vec_drug = NewDrug[Item[inv[bLoop].usItem].drugtype].drug_effects; + + std::vector::iterator drug_effects_itend = vec_drug.end(); + for ( std::vector::iterator drug_effects_it = vec_drug.begin(); drug_effects_it != drug_effects_itend; ++drug_effects_it ) + { + if ( ( *drug_effects_it ).size > 0 ) + { + if ( ( *drug_effects_it ).effect == DRUG_EFFECT_HP && this->bBleeding > 1 && ( *drug_effects_it ).size * ( *drug_effects_it ).duration * usable / 100 < this->bBleeding * 2 ) + { + ApplyConsumable( this, &( this->inv[bLoop] ), TRUE, FALSE ); + + this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] += 6; + + return; + } + else if ( ( *drug_effects_it ).effect == DRUG_EFFECT_BP && this->bBreath < 50 ) + { + ApplyConsumable( this, &( this->inv[bLoop] ), TRUE, FALSE ); + + this->usSkillCooldown[SOLDIER_COOLDOWN_DRUGUSER_COMBAT] += 6; + + return; + } + } + } + } + } +} + INT32 CheckBleeding( SOLDIERTYPE *pSoldier ) { INT8 bBandaged; //,savedOurTurn; diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index bb2e0b76..9ea3610d 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -619,6 +619,7 @@ enum { SOLDIER_COOLDOWN_COVERTOPS_TEMPORARYOVERT_APS, SOLDIER_COOLDOWN_CRYO, // counts how many turns character will be frozen SOLDIER_COOLDOWN_INTEL_PENALTY, // after being discovered, we can't gain intel from the assignment for this many hours + SOLDIER_COOLDOWN_DRUGUSER_COMBAT, // after a drug user deliberately took drugs, he will not do so on his own for a while SOLDIER_COOLDOWN_MAX = 20, // enough space for fillers }; @@ -1981,6 +1982,7 @@ public: FLOAT GetIntelGain(); void StopChatting(); + void DrugAutoUse(); ////////////////////////////////////////////////////////////////////////////// }; // SOLDIERTYPE; diff --git a/Tactical/Soldier Create.cpp b/Tactical/Soldier Create.cpp index d3251b40..d98e752b 100644 --- a/Tactical/Soldier Create.cpp +++ b/Tactical/Soldier Create.cpp @@ -2094,6 +2094,7 @@ void InitSoldierStruct( SOLDIERTYPE *pSoldier ) pSoldier->bBulletsLeft = 0; pSoldier->bVehicleUnderRepairID = -1; pSoldier->sFacilityTypeOperated = -1; // HEADROCK HAM 3.6: Facility Operated + pSoldier->usChatPartnerID = NOBODY; } diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index cc5bc863..1de499cc 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -6791,7 +6791,7 @@ STR16 pMessageStrings[] = L"磁盘空间不足。只有%sMB可用空间,《铁血联盟2》需要%sMB。", L"从AIM雇佣了%s", //"Hired %s from AIM", L"%s抓住了%s.", //"%s has caught %s.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s打了针剂。", //"%s has taken the drug.", //'Merc name' has taken the drug + L"%s has taken %s.", // TODO.Translate L"%s没有医疗技能", //"%s has no medical skill",//'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 4d716a74..13b7cfe6 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -6804,7 +6804,7 @@ STR16 pMessageStrings[] = L"Schijfruimte raakt op. Er is slects %s MB vrij en Jagged Alliance 2 v1.13 heeft %s MB nodig.", L"%s ingehuurd van AIM", L"%s heeft %s gevangen.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s heeft de drug genomen.", //'Merc name' has taken the drug + L"%s heeft %s genomen.", //'Merc name' has taken the drug L"%s heeft geen medische kennis", //'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index d65091cb..5b61440c 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -6792,7 +6792,7 @@ STR16 pMessageStrings[] = L"You are running low on disk space. You only have %sMB free and Jagged Alliance 2 v1.13 requires %sMB.", L"Hired %s from AIM", L"%s has caught %s.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s has taken the drug.", //'Merc name' has taken the drug + L"%s has taken %s.", //'Merc name' has taken 'item name' L"%s has no medical skill",//40 'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 6fbb18f1..2fbd560a 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -6804,7 +6804,7 @@ STR16 pMessageStrings[] = L"Espace disque insuffisant. Il ne vous reste que %s Mo de libre et Jagged Alliance 2 nécessite %s Mo.", L"%s embauché(e) sur le site AIM", L"%s prend %s.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s a pris la drogue.", //'Merc name' has taken the drug + L"%s a pris %s.", //'Merc name' has taken the drug L"%s n'a aucune compétence médicale.",//'Merc name' has non medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index e0e3fa6e..a861b124 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -6640,7 +6640,7 @@ STR16 pMessageStrings[] = L"%s von AIM angeheuert", L"%s hat %s gefangen.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s hat die Droge genommen.", //'Merc name' has taken the drug + L"%s hat %s eingenommen.", //'Merc name' has taken 'item name' L"%s hat keine medizinischen Fähigkeiten",//40 //'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 8ca16e26..a1e68179 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -6788,7 +6788,7 @@ STR16 pMessageStrings[] = L"Lo spazio su disco si sta esaurendo. Avete liberi solo %s MB e Jagged Alliance 2 v1.13 ne richiede %s.", L"Arruolato %s dall'A.I.M.", L"%s ha preso %s.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s ha assunto della droga.", //'Merc name' has taken the drug + L"%s ha assunto %s.", //'Merc name' has taken 'item name' L"%s non ha alcuna abilità medica",//'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index cba1fee3..aca8a4bb 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -6803,7 +6803,7 @@ STR16 pMessageStrings[] = L"Brak miejsca na dysku twardym. Na dysku wolne jest %s MB, a wymagane jest przynajmniej %s MB.", L"Najęto - %s z A.I.M.", L"%s złapał(a) %s", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s zaaplikował(a) sobie lekarstwo", //'Merc name' has taken the drug + L"%s has taken %s.", // TODO.Translate L"%s nie posiada wiedzy medycznej",//40 'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD) diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index c6752e37..8b898706 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -6792,7 +6792,7 @@ STR16 pMessageStrings[] = L"У вас заканчивается свободное дисковое пространство. На диске есть всего %sMб свободного места, а для Jagged Alliance 2 требуется %s Mб.", L"Из A.I.M. нанят боец %s.", L"%s ловит %s.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item. - L"%s принимает препарат.", //'Merc name' has taken the drug + L"%s has taken %s.", // TODO.Translate L"%s: отсутствуют навыки в медицине.",//40 'Merc name' has no medical skill. //CDRom errors (such as ejecting CD while attempting to read the CD)