From 5df191a263526c7ff20f084d6926e4abbec8d153 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 16 May 2016 15:17:11 +0000 Subject: [PATCH] New disability: Hemophiliac causes mercs to bleed a lot faster, even for tiny wounds git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8217 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/IMP Disability Trait.h | 1 + Laptop/email.cpp | 10 ++++++++++ Tactical/Soldier Control.cpp | 26 ++++++++++++++++++++------ Tactical/soldier profile type.h | 1 + Utils/Text.h | 1 + Utils/_ChineseText.cpp | 7 +++++++ Utils/_DutchText.cpp | 7 +++++++ Utils/_EnglishText.cpp | 7 +++++++ Utils/_FrenchText.cpp | 7 +++++++ Utils/_GermanText.cpp | 7 +++++++ Utils/_ItalianText.cpp | 7 +++++++ Utils/_Ja25ChineseText.cpp | 1 + Utils/_Ja25DutchText.cpp | 1 + Utils/_Ja25EnglishText.cpp | 1 + Utils/_Ja25FrenchText.cpp | 1 + Utils/_Ja25GermanText.cpp | 1 + Utils/_Ja25ItalianText.cpp | 1 + Utils/_Ja25PolishText.cpp | 1 + Utils/_Ja25RussianText.cpp | 1 + Utils/_PolishText.cpp | 7 +++++++ Utils/_RussianText.cpp | 7 +++++++ 21 files changed, 97 insertions(+), 6 deletions(-) diff --git a/Laptop/IMP Disability Trait.h b/Laptop/IMP Disability Trait.h index 83ecd1a0..9eaa4453 100644 --- a/Laptop/IMP Disability Trait.h +++ b/Laptop/IMP Disability Trait.h @@ -22,6 +22,7 @@ typedef enum IMP_DISABILITY_PSYCHO, IMP_DISABILITY_DEAF, IMP_DISABILITY_SHORTSIGHTED, + IMP_DISABILITY_BLEEDER, IMP_DISABILITIES_NUMBER, }; diff --git a/Laptop/email.cpp b/Laptop/email.cpp index 4c75e069..6fa96098 100644 --- a/Laptop/email.cpp +++ b/Laptop/email.cpp @@ -4118,6 +4118,16 @@ void HandleIMPCharProfileResultsMessage( void) AddEmailRecordToList( pString ); } + else if ( gMercProfiles[iCurrentIMPSlot].bDisability == HEMOPHILIAC ) + { + swprintf( pString, gzIMPDisabilityTraitEmailTextHemophiliac[0] ); + + AddEmailRecordToList( pString ); + + swprintf( pString, gzIMPDisabilityTraitEmailTextHemophiliac[1] ); + + AddEmailRecordToList( pString ); + } else { // personality tick diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index de389e3f..b593476d 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -19130,11 +19130,15 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier ) { INT8 bBandaged; //,savedOurTurn; INT32 iBlood = NOBLOOD; + BOOLEAN bleeder = FALSE; if ( pSoldier->stats.bLife != 0 ) { + bleeder = DoesMercHaveDisability( pSoldier, HEMOPHILIAC ); + // if merc is hurt beyond the minimum required to bleed, or he's dying - if ( ((pSoldier->bBleeding > MIN_BLEEDING_THRESHOLD) || pSoldier->stats.bLife < OKLIFE) ) + // Flugente: or if they are a hemophiliac + if ( (pSoldier->bBleeding > MIN_BLEEDING_THRESHOLD) || pSoldier->stats.bLife < OKLIFE || bleeder ) { // if he's NOT in the process of being bandaged or DOCTORed if ( (pSoldier->ubServiceCount == 0) && (AnyDoctorWhoCanHealThisPatient( pSoldier, HEALABLE_EVER ) == NULL) ) @@ -19142,7 +19146,7 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier ) // may drop blood whether or not any bleeding takes place this turn if ( pSoldier->bTilesMoved < 1 ) { - iBlood = ((pSoldier->bBleeding - MIN_BLEEDING_THRESHOLD) / BLOODDIVISOR); // + pSoldier->dying; + iBlood = max(0, ((pSoldier->bBleeding - MIN_BLEEDING_THRESHOLD) / BLOODDIVISOR) ); // + pSoldier->dying; if ( iBlood > MAXBLOODQUANTITY ) { iBlood = MAXBLOODQUANTITY; @@ -19153,6 +19157,10 @@ INT32 CheckBleeding( SOLDIERTYPE *pSoldier ) iBlood = NOBLOOD; } + // Flugente: bleeders, well, bleed + if ( bleeder ) + iBlood = min( 1, iBlood ); + // Are we in a different mode? if ( !(gTacticalStatus.uiFlags & TURNBASED) || !(gTacticalStatus.uiFlags & INCOMBAT) ) { @@ -19408,16 +19416,22 @@ void SoldierCollapse( SOLDIERTYPE *pSoldier ) FLOAT CalcSoldierNextBleed( SOLDIERTYPE *pSoldier ) { - INT8 bBandaged; - // calculate how many turns before he bleeds again // bleeding faster the lower life gets, and if merc is running around //pSoldier->nextbleed = 2 + (pSoldier->life / (10 + pSoldier->tilesMoved)); // min = 2 // if bandaged, give 1/2 of the bandaged life points back into equation - bBandaged = pSoldier->stats.bLifeMax - pSoldier->stats.bLife - pSoldier->bBleeding; + INT8 bBandaged = pSoldier->stats.bLifeMax - pSoldier->stats.bLife - pSoldier->bBleeding; - return((FLOAT)1 + (FLOAT)((pSoldier->stats.bLife + bBandaged / 2) / (10 + pSoldier->bTilesMoved))); // min = 1 + FLOAT val = 1.0f; + + // Flugente: hemophiliacs bleed a lot faster + if ( DoesMercHaveDisability( pSoldier, HEMOPHILIAC ) ) + val += ((FLOAT)(pSoldier->stats.bLife) / (FLOAT)(30 + 2 * pSoldier->bTilesMoved)); + else + val += ((FLOAT)(pSoldier->stats.bLife + bBandaged / 2) / (FLOAT)(10 + pSoldier->bTilesMoved)); + + return val; } FLOAT CalcSoldierNextUnmovingBleed( SOLDIERTYPE *pSoldier ) diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h index 12add835..1cdc9ec3 100644 --- a/Tactical/soldier profile type.h +++ b/Tactical/soldier profile type.h @@ -329,6 +329,7 @@ typedef enum // Flugente: more disabilities DEAF, SHORTSIGHTED, + HEMOPHILIAC, NUM_DISABILITIES } PersonalityTrait; diff --git a/Utils/Text.h b/Utils/Text.h index b6de6a93..8ef79e5e 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -344,6 +344,7 @@ extern STR16 sColorChoiceExplanationTexts[]; extern STR16 gzIMPDisabilityTraitText[]; // added by Flugente extern STR16 gzIMPDisabilityTraitEmailTextDeaf[]; // added by Flugente extern STR16 gzIMPDisabilityTraitEmailTextShortSighted[]; +extern STR16 gzIMPDisabilityTraitEmailTextHemophiliac[]; // added by Flugente extern STR16 sEnemyTauntsFireGun[]; extern STR16 sEnemyTauntsFireLauncher[]; extern STR16 sEnemyTauntsThrow[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 6013cdef..72015d09 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7813,6 +7813,7 @@ STR16 gzIMPDisabilityTraitText[]= L"神经错乱", L"聋子", //L"Deaf", L"近视眼", //L"Shortsighted", + L"Hemophiliac", // TODO.Translate L"I.M.P. 性格缺陷", }; @@ -7828,6 +7829,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"因为你在发光的长方体前面花了太久时间。你应该多吃点胡萝卜,你见过戴眼镜的兔子么?没有吧。", // L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= { diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 0212cfb3..34f1054e 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7821,6 +7821,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Psychotic", L"Deaf", L"Shortsighted", + L"Hemophiliac", // TODO.Translate L"I.M.P. Disabilities", }; @@ -7836,6 +7837,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // TODO.Translate // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index d01321a1..858f83a0 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7809,6 +7809,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Psychotic", L"Deaf", L"Shortsighted", + L"Hemophiliac", L"I.M.P. Disabilities", }; @@ -7824,6 +7825,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= { diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 5f2ee8ed..5f61ccf5 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7815,6 +7815,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Psychotique", L"Mauvaise audition", L"Mauvaise vue", + L"Hemophiliac", // TODO.Translate L"IMP : Handicaps", }; @@ -7830,6 +7831,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"C'est ce qui arrive lorsque l'on passe ses journées devant un écran. Vous auriez dû manger plus de carottes. Avez-vous déjà vu un lapin à lunettes ? Improbable, hein ?", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= { diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index a753360a..976532da 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7642,6 +7642,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Psychopath", L"Schwerhörigkeit", L"Kurzsichtigkeit", + L"Bluter", L"Ihre größte Schwäche", }; @@ -7657,6 +7658,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"Das passiert wenn man dauernd nur vor der Glotze rumhängt. Sie hätten mehr Karotten essen sollen. Schon mal einen Hasen mit Brille gesehen? Aha.", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= { diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 5abced89..d2bea90d 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7811,6 +7811,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Psychotic", L"Deaf", L"Shortsighted", + L"Hemophiliac", // TODO.Translate L"I.M.P. Disabilities", }; @@ -7826,6 +7827,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // TODO.Translate // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= diff --git a/Utils/_Ja25ChineseText.cpp b/Utils/_Ja25ChineseText.cpp index 84592b25..2fed797e 100644 --- a/Utils/_Ja25ChineseText.cpp +++ b/Utils/_Ja25ChineseText.cpp @@ -475,6 +475,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"可能会偶尔发疯并把手里武器设在自动后乱喷。\n如果武器不能自动射击将会打击自身士气。",// L"He can go psycho and shoot like mad once per a while\nand can lose morale if unable to do that with given weapon.", L"大大减少听力范围", // L"Drastically reduced hearing.", L"减少视力范围", // L"Reduced sight range.", + L"Drastically increased bleeding.", // TODO.Translate }; diff --git a/Utils/_Ja25DutchText.cpp b/Utils/_Ja25DutchText.cpp index 924c16cb..8c476b42 100644 --- a/Utils/_Ja25DutchText.cpp +++ b/Utils/_Ja25DutchText.cpp @@ -475,6 +475,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Will go psycho and shoot like mad once in a while\nand will lose morale if unable to do so with equipped weapon.", L"Drastically reduced hearing.", L"Reduced sight range.", + L"Drastically increased bleeding.", // TODO.Translate }; diff --git a/Utils/_Ja25EnglishText.cpp b/Utils/_Ja25EnglishText.cpp index 3eb064b5..0fe90d02 100644 --- a/Utils/_Ja25EnglishText.cpp +++ b/Utils/_Ja25EnglishText.cpp @@ -476,6 +476,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Will go psycho and shoot like mad once in a while\nand will lose morale if unable to do so with equipped weapon.", L"Drastically reduced hearing.", L"Reduced sight range.", + L"Drastically increased bleeding.", }; STR16 gzIMPProfileCostText[]= diff --git a/Utils/_Ja25FrenchText.cpp b/Utils/_Ja25FrenchText.cpp index 65839378..ca374391 100644 --- a/Utils/_Ja25FrenchText.cpp +++ b/Utils/_Ja25FrenchText.cpp @@ -475,6 +475,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Il peut devenir psychopathe et tirer comme un fou de temps en temps\net peut perdre du moral, s'il n'est pas capable d'utiliser son arme.", L"Audition considérablement réduite.", L"Distance de vision réduit.", + L"Drastically increased bleeding.", // TODO.Translate }; diff --git a/Utils/_Ja25GermanText.cpp b/Utils/_Ja25GermanText.cpp index 2a664a12..db64b02e 100644 --- a/Utils/_Ja25GermanText.cpp +++ b/Utils/_Ja25GermanText.cpp @@ -477,6 +477,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Dreht manchmal durch und schießt dabei hin und wieder wild um sich.\nVerliert Moral, wenn das mit der ausgerüsteten Waffe nicht möglich ist.", L"Deutlich geringere Hörweite.", L"Geringere Sichtweite.", + L"Drastically increased bleeding.", // TODO.Translate }; STR16 gzIMPProfileCostText[]= diff --git a/Utils/_Ja25ItalianText.cpp b/Utils/_Ja25ItalianText.cpp index b4bdb5e2..b02d2763 100644 --- a/Utils/_Ja25ItalianText.cpp +++ b/Utils/_Ja25ItalianText.cpp @@ -473,6 +473,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Will go psycho and shoot like mad once in a while\nand will lose morale if unable to do so with equipped weapon.", L"Drastically reduced hearing.", L"Reduced sight range.", + L"Drastically increased bleeding.", // TODO.Translate }; diff --git a/Utils/_Ja25PolishText.cpp b/Utils/_Ja25PolishText.cpp index 9d2ac9e9..813656a4 100644 --- a/Utils/_Ja25PolishText.cpp +++ b/Utils/_Ja25PolishText.cpp @@ -475,6 +475,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Will go psycho and shoot like mad once in a while\nand will lose morale if unable to do so with equipped weapon.", L"Drastically reduced hearing.", L"Reduced sight range.", + L"Drastically increased bleeding.", // TODO.Translate }; diff --git a/Utils/_Ja25RussianText.cpp b/Utils/_Ja25RussianText.cpp index ac020d0b..3baff282 100644 --- a/Utils/_Ja25RussianText.cpp +++ b/Utils/_Ja25RussianText.cpp @@ -476,6 +476,7 @@ STR16 gzIMPDisabilitiesHelpTexts[]= L"Иногда бывают приступы помутнения рассудка. \nВ такие моменты он расстреливает весь магазин до последней пули. \nПадает духом, если его оружие этого не позволяет.", L"Значительно пониженный слух.", L"Сниженная дальность видимости.", + L"Drastically increased bleeding.", // TODO.Translate }; STR16 gzIMPProfileCostText[]= diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 9f99dd11..a683c328 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7826,6 +7826,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Psychol", L"Deaf", L"Shortsighted", + L"Hemophiliac", // TODO.Translate L"Niepełnosprawności I.M.P.-a", }; @@ -7841,6 +7842,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= { diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index a5239815..4301d1e5 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7809,6 +7809,7 @@ STR16 gzIMPDisabilityTraitText[]= L"Психопат", //Psychotic L"Глухой", L"Близорукий", + L"Hemophiliac", // TODO.Translate L"I.M.P.: Недостатки", //I.M.P. Disabilities }; @@ -7824,6 +7825,12 @@ STR16 gzIMPDisabilityTraitEmailTextShortSighted[] = L"Это случается, если проводить много времени перед светящимися прямоугольниками. Нужно было есть больше морковок. Вы когда-нибудь видели кролика в очках?", }; +STR16 gzIMPDisabilityTraitEmailTextHemophiliac[] = // TODO.Translate +{ + L"Are you SURE this is the right job for you?", + L"As long as you are so good to never ever get hit, or fight only in fully staffed hospitals, you should be fine.", +}; + // HEADROCK HAM 3.6: Error strings for assigning a merc to a facility STR16 gzFacilityErrorMessage[]= {