If a merc's background has <druguse> set, they occasionally consume beneficial drugs in combat for free.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8530 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-02-28 20:01:07 +00:00
parent abb8152d24
commit f4171a3889
13 changed files with 82 additions and 18 deletions
+9 -9
View File
@@ -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
+1 -1
View File
@@ -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] );
}
}
+61
View File
@@ -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<DRUG_EFFECT> vec_drug = NewDrug[Item[inv[bLoop].usItem].drugtype].drug_effects;
std::vector<DRUG_EFFECT>::iterator drug_effects_itend = vec_drug.end();
for ( std::vector<DRUG_EFFECT>::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;
+2
View File
@@ -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;
+1
View File
@@ -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;
}
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)