From 9edcd360a5677626577ae806b72e362d3fdaff91 Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 20 Sep 2012 19:36:31 +0000 Subject: [PATCH] - water from swamp sectors is now less poisonous. Also lowered the amount of poison bad food gives. - fix: igniting explosives in inventory now correctly triggers faction hostilities. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5579 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Food.cpp | 15 ++++++++++++--- Tactical/Food.h | 8 -------- Tactical/Interface Items.cpp | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Tactical/Food.cpp b/Tactical/Food.cpp index 56f6694c..b12ee881 100644 --- a/Tactical/Food.cpp +++ b/Tactical/Food.cpp @@ -37,6 +37,15 @@ extern BOOLEAN IsVehicle(SOLDIERTYPE *pSoldier); extern SECTOR_EXT_DATA SectorExternalData[256][4]; +#define FOOD_BAD_THRESHOLD 0.5f // must be > 0 !!!!! +#define FOOD_BAD_THRESHOLD_INVERSE 1.0f/FOOD_BAD_THRESHOLD + +#define FOOD_MORALE_DRINK_TO_FOOD_RATIO 1.0f +#define FOOD_FACILITY_WATER_FACTOR 3.0f // in a facility that serves food, only the food value is specified in the xml. drink value is food value multiplied by this + +#define FOOD_POW_MULTIPLICATOR 1.2f // multiplicator to the water we get when POWs (so many times our water digestion rate, so we will barely survive) +#define FOOD_WATER_POISONOUS_TEMPERATURE 20000.0f // termperature value of water taken out of swamps etc. + // 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] = @@ -130,8 +139,8 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, BOOLEAN fForce, B INT32 maxpts = max(Food[foodtype].bFoodPoints, Food[foodtype].bDrinkPoints); // divide by 100 (poison sum is in [0, 99] - // multiply with FOOD_BAD_THRESHOLD for more reasonable values - INT8 poisonadd = (INT8)(0.01 * maxpts * (1.0 - foodcondition) * FOOD_BAD_THRESHOLD ); + // multiply with 0.25 for more reasonable values + INT8 poisonadd = (INT8)(0.01 * 0.25 * maxpts * (1.0 - foodcondition) ); pSoldier->AddPoison(poisonadd); } @@ -754,7 +763,7 @@ void SectorFillCanteens( void ) // if the water in this sector is poisoned, we add a different temperature - resulting in worsening of the item's decay status if ( waterquality == WATER_POISONOUS ) - addtemperature = 0.0f; + addtemperature = FOOD_WATER_POISONOUS_TEMPERATURE; // first step: fill all canteens in inventories INT8 bMercID, bLastTeamID; diff --git a/Tactical/Food.h b/Tactical/Food.h index afa0126a..504e981e 100644 --- a/Tactical/Food.h +++ b/Tactical/Food.h @@ -3,19 +3,11 @@ #include "soldier control.h" -#define FOOD_BAD_THRESHOLD 0.5f // must be > 0 !!!!! -#define FOOD_BAD_THRESHOLD_INVERSE 1.0f/FOOD_BAD_THRESHOLD - #define FOOD_MIN - 20000 #define FOOD_MAX 10000 #define DRINK_MIN - 20000 #define DRINK_MAX 10000 -#define FOOD_MORALE_DRINK_TO_FOOD_RATIO 1.0f -#define FOOD_FACILITY_WATER_FACTOR 3.0f - -#define FOOD_POW_MULTIPLICATOR 1.2f // multiplicator to the water we get when POWs (so many times our water digestion rate, so we will barely survive) - typedef enum { FOOD_STUFFED, diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index ada740c6..11d5b056 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -13017,7 +13017,7 @@ void TransformationMenuPopup_Arm( OBJECTTYPE* pObj ) if ( screen == GAME_SCREEN ) { // ignite explosions manually - this item is not in the WorldBombs-structure, so we can't add it to the queue - IgniteExplosion( (*pObj)[0]->data.misc.ubBombOwner - 2, gpItemDescSoldier->sX, gpItemDescSoldier->sY, (INT16) (gpWorldLevelData[gpItemDescSoldier->sGridNo].sHeight), gpItemDescSoldier->sGridNo, pObj->usItem, gpItemDescSoldier->pathing.bLevel, gpItemDescSoldier->ubDirection ); + IgniteExplosion( gpItemDescSoldier->ubID, gpItemDescSoldier->sX, gpItemDescSoldier->sY, (INT16) (gpWorldLevelData[gpItemDescSoldier->sGridNo].sHeight), gpItemDescSoldier->sGridNo, pObj->usItem, gpItemDescSoldier->pathing.bLevel, gpItemDescSoldier->ubDirection ); } else {