From 13a8319fbb98bc9412c402dc1b6adae36da4f607 Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Thu, 3 Aug 2006 23:55:44 +0000 Subject: [PATCH] -ammo weights affected by # bullets remaining -added code to support urban, desert and snow camo 2 issues: 1. Need to test this to make sure it works, since I'm at work. I'll test it all out tonight. 2. There is no Snow terrain type. Anyone have any great ideas on how to test for it? git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@399 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/IMP Confirm.cpp | 2 +- Strategic/Strategic Merc Handler.cpp | 51 +++++++++--- Strategic/mapscreen.cpp | 2 +- Tactical/Animation Control.cpp | 27 +++++-- Tactical/Interface Panels.cpp | 2 +- Tactical/Item Types.h | 3 + Tactical/Items.cpp | 114 ++++++++++++++++++++++----- Tactical/LOS.cpp | 42 ++++++++-- Tactical/Rotting Corpses.cpp | 36 ++++++++- Tactical/Rotting Corpses.h | 19 +++-- Tactical/Soldier Control.h | 14 +++- Tactical/Soldier Create.cpp | 20 ++++- Tactical/Soldier Profile.cpp | 3 + Tactical/soldier profile type.h | 3 + TileEngine/TileEngine.vcproj | 3 + Utils/XML_Items.cpp | 21 +++++ 16 files changed, 305 insertions(+), 57 deletions(-) diff --git a/Laptop/IMP Confirm.cpp b/Laptop/IMP Confirm.cpp index 893d5201..8a4239b3 100644 --- a/Laptop/IMP Confirm.cpp +++ b/Laptop/IMP Confirm.cpp @@ -549,7 +549,7 @@ void GiveItemsToPC( UINT8 ubProfileId ) GiveIMPRandomItems(pProfile,IMP_KNIFING); } - if (PROFILE_HAS_SKILL_TRAIT(pProfile, CAMOUFLAGED)) + if (PROFILE_HAS_SKILL_TRAIT(pProfile, CAMOUFLAGED)) // TODO: Madd - other camouflage types, once we figure out a way to enable more traits { // MakeProfileInvItemAnySlot(pProfile, CAMOUFLAGEKIT, 100, 1); GiveIMPRandomItems(pProfile,IMP_CAMOUFLAGED); diff --git a/Strategic/Strategic Merc Handler.cpp b/Strategic/Strategic Merc Handler.cpp index 8e6c76fa..098cbd98 100644 --- a/Strategic/Strategic Merc Handler.cpp +++ b/Strategic/Strategic Merc Handler.cpp @@ -1048,7 +1048,7 @@ void HourlyCamouflageUpdate( void ) { INT8 bMercID, bLastTeamID; SOLDIERTYPE * pSoldier; - + BOOLEAN camoWoreOff = FALSE; bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID; @@ -1064,16 +1064,49 @@ void HourlyCamouflageUpdate( void ) if (pSoldier->bCamo <= 0) { pSoldier->bCamo = 0; - // Reload palettes.... - if ( pSoldier->bInSector ) - { - CreateSoldierPalettes( pSoldier ); - } - - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_CAMMO_WORN_OFF], pSoldier->name ); - DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 ); + camoWoreOff = TRUE; } } + if( ( pSoldier->urbanCamo > 0) && ( !( HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_URBAN) ) ) ) + { + pSoldier->urbanCamo -= 2; + if (pSoldier->urbanCamo <= 0) + { + pSoldier->urbanCamo = 0; + camoWoreOff = TRUE; + } + } + if( ( pSoldier->desertCamo > 0) && ( !( HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_DESERT) ) ) ) + { + pSoldier->desertCamo -= 2; + if (pSoldier->desertCamo <= 0) + { + pSoldier->desertCamo = 0; + camoWoreOff = TRUE; + } + } + if( ( pSoldier->snowCamo > 0) && ( !( HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_SNOW) ) ) ) + { + pSoldier->snowCamo -= 2; + if (pSoldier->snowCamo <= 0) + { + pSoldier->snowCamo = 0; + camoWoreOff = TRUE; + } + } + + if ( camoWoreOff ) + { + // Reload palettes.... + if ( pSoldier->bInSector ) + { + CreateSoldierPalettes( pSoldier ); + } + + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_CAMMO_WORN_OFF], pSoldier->name ); + DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 ); + } + // if the merc has non-zero monster smell, degrade it by 1 if ( pSoldier->bMonsterSmell > 0 ) { diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index b6f082d1..a21efac2 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -6811,7 +6811,7 @@ void BltCharInvPanel() mprintf( usX, usY, sString ); // Display camo value - swprintf( sString, L"%3d", max(0, min ((pSoldier->bCamo + pSoldier->wornCamo ),100 )) ); + swprintf( sString, L"%3d", max(0, min ((pSoldier->bCamo + pSoldier->wornCamo + pSoldier->urbanCamo+pSoldier->wornUrbanCamo+pSoldier->desertCamo+pSoldier->wornDesertCamo+pSoldier->snowCamo+pSoldier->wornSnowCamo ),100 )) ); FindFontRightCoordinates(MAP_CAMMO_X, MAP_CAMMO_Y, MAP_PERCENT_WIDTH, MAP_PERCENT_HEIGHT, sString, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, sString ); diff --git a/Tactical/Animation Control.cpp b/Tactical/Animation Control.cpp index d2cbc950..b6918964 100644 --- a/Tactical/Animation Control.cpp +++ b/Tactical/Animation Control.cpp @@ -1056,7 +1056,6 @@ ANIMSUBTYPE gDoubleHandledSub = STANDING, RGMDBLBREATH, BGMDBLBREATH, RGMDBLBREATH, RGFDBLBREATH }; - void InitAnimationSurfacesPerBodytype( ) { INT32 cnt1, cnt2; @@ -3209,18 +3208,36 @@ INT8 GetBodyTypePaletteSubstitutionCode( SOLDIERTYPE *pSoldier, UINT8 ubBodyType return( 0 ); } - // Check for cammo... + + // Check for camo... + + //stealth has priority if ( GetWornStealth(pSoldier) >= 50 ) { strcpy( zColFilename, "ANIMS\\stealth.col" ); return( 1 ); } - else if ( ( pSoldier->bCamo + pSoldier->wornCamo ) >= 50 ) + + int urban = pSoldier->urbanCamo + pSoldier->wornUrbanCamo; + int jungle = pSoldier->bCamo + pSoldier->wornCamo; + int desert = pSoldier->desertCamo + pSoldier->wornDesertCamo; + int snow = pSoldier->snowCamo + pSoldier->wornSnowCamo; + int total = urban + jungle + desert + snow; + + // display camo depending on which is higher + if ( total >= 50 ) { - strcpy( zColFilename, "ANIMS\\camo.COL" ); + if ( jungle >= urban && jungle >= desert && jungle >= snow ) + strcpy( zColFilename, "ANIMS\\camo.COL" ); + else if ( urban >= jungle && urban >= desert && urban >= snow ) + strcpy( zColFilename, "ANIMS\\urban.col" ); + else if ( desert >= urban && desert >= jungle && desert >= snow ) + strcpy( zColFilename, "ANIMS\\desert.col" ); + else if ( snow >= urban && snow >= desert && snow >= jungle ) + strcpy( zColFilename, "ANIMS\\snow.col" ); + return( 1 ); } - } return( -1 ); diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 095ee18c..be47a1e3 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -2036,7 +2036,7 @@ void RenderSMPanel( BOOLEAN *pfDirty ) ApplyEquipmentBonuses(gpSMCurrentMerc); // Display cammo value! - swprintf( sString, L"%3d", max(0, min( (gpSMCurrentMerc->bCamo + gpSMCurrentMerc->wornCamo),100 )) ); + swprintf( sString, L"%3d", max(0, min( (gpSMCurrentMerc->bCamo + gpSMCurrentMerc->wornCamo+gpSMCurrentMerc->urbanCamo+gpSMCurrentMerc->wornUrbanCamo+gpSMCurrentMerc->desertCamo+gpSMCurrentMerc->wornDesertCamo+gpSMCurrentMerc->snowCamo+gpSMCurrentMerc->wornSnowCamo),100 )) ); FindFontRightCoordinates(SM_CAMMO_X, SM_CAMMO_Y ,SM_PERCENT_WIDTH ,SM_PERCENT_HEIGHT ,sString, BLOCKFONT2, &usX, &usY); mprintf( usX, usY , sString ); diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index e1aafee9..0c63eaa4 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -384,6 +384,9 @@ typedef struct INT16 camobonus; INT16 stealthbonus; + INT16 urbanCamobonus; + INT16 desertCamobonus; + INT16 snowCamobonus; UINT16 defaultattachment; } INVTYPE; diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 7aee5177..890731b1 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -2177,7 +2177,7 @@ UINT8 CalculateObjectWeight( OBJECTTYPE *pObject ) // Start with base weight usWeight = pItem->ubWeight; - if (pItem->ubPerPocket < 2) + if ( pItem->ubPerPocket < 2 && pItem->usItemClass != IC_AMMO ) { // account for any attachments for ( cnt = 0; cnt < MAX_ATTACHMENTS; cnt++ ) @@ -2191,13 +2191,27 @@ UINT8 CalculateObjectWeight( OBJECTTYPE *pObject ) // add in weight of ammo if (Item[ pObject->usItem ].usItemClass == IC_GUN && pObject->ubGunShotsLeft > 0) { - usWeight += Item[ pObject->usGunAmmoItem ].ubWeight; + usWeight += (INT16)((pObject->ubGunShotsLeft / Magazine[Item[pObject->usGunAmmoItem].ubClassIndex].ubMagSize ) * Item[ pObject->usGunAmmoItem ].ubWeight);//Madd: added weight allowance for ammo not being full } } - + else if ( pItem->usItemClass == IC_AMMO )//Madd: added weight allowance for ammo not being full + { + for ( cnt = 0; cnt < MAX_OBJECTS_PER_SLOT; cnt++ ) + { + if (pObject->ubShotsLeft[cnt] > 0 ) + { + usWeight += (INT16)(pObject->ubShotsLeft[cnt]/Magazine[pItem->usItemClass].ubMagSize) * pItem->ubWeight; + } + } + } + + // make sure it really fits into that UINT8, in case we ever add anything real heavy with attachments/ammo Assert(usWeight <= 255); + if ( usWeight > 255 ) + usWeight = 255; //Madd: limit to 255 to prevent negative weights, at least until we can change the OBJECTTYPE structure + return( (UINT8) usWeight ); } @@ -5556,29 +5570,74 @@ void WaterDamage( SOLDIERTYPE *pSoldier ) } } } + BOOLEAN camoWoreOff = FALSE; if (pSoldier->bCamo > 0 && !HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED ) ) { // reduce camouflage by 2% per tile of deep water // and 1% for medium water if ( pSoldier->bOverTerrainType == DEEP_WATER ) - { pSoldier->bCamo = __max( 0, pSoldier->bCamo - 2 ); - } else - { pSoldier->bCamo = __max( 0, pSoldier->bCamo - 1 ); - } - if ( (pSoldier->bCamo)== 0) - { - // Reload palettes.... - if ( pSoldier->bInSector ) - { - CreateSoldierPalettes( pSoldier ); - } - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_CAMMO_WASHED_OFF], pSoldier->name ); - } + if ( (pSoldier->bCamo)== 0) + camoWoreOff = TRUE; } + + if (pSoldier->urbanCamo > 0 && !HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_URBAN ) ) + { + // reduce camouflage by 2% per tile of deep water + // and 1% for medium water + if ( pSoldier->bOverTerrainType == DEEP_WATER ) + pSoldier->urbanCamo = __max( 0, pSoldier->urbanCamo - 2 ); + else + pSoldier->urbanCamo = __max( 0, pSoldier->urbanCamo - 1 ); + + if ( (pSoldier->urbanCamo)== 0) + camoWoreOff = TRUE; + } + + if (pSoldier->desertCamo > 0 && !HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_DESERT ) ) + { + // reduce camouflage by 2% per tile of deep water + // and 1% for medium water + if ( pSoldier->bOverTerrainType == DEEP_WATER ) + pSoldier->desertCamo = __max( 0, pSoldier->desertCamo - 2 ); + else + pSoldier->desertCamo = __max( 0, pSoldier->desertCamo - 1 ); + + if ( (pSoldier->desertCamo)== 0) + camoWoreOff = TRUE; + } + + if (pSoldier->snowCamo > 0 && !HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_SNOW ) ) + { + // reduce camouflage by 2% per tile of deep water + // and 1% for medium water + if ( pSoldier->bOverTerrainType == DEEP_WATER ) + pSoldier->snowCamo = __max( 0, pSoldier->snowCamo - 2 ); + else + pSoldier->snowCamo = __max( 0, pSoldier->snowCamo - 1 ); + + if ( (pSoldier->snowCamo)== 0) + camoWoreOff = TRUE; + } + + if ( camoWoreOff ) + { + // Reload palettes.... + if ( pSoldier->bInSector ) + { + CreateSoldierPalettes( pSoldier ); + } + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_CAMMO_WASHED_OFF], pSoldier->name ); + } + + + + + + if ( pSoldier->bTeam == gbPlayerNum && pSoldier->bMonsterSmell > 0 ) { if ( pSoldier->bOverTerrainType == DEEP_WATER ) @@ -5623,7 +5682,14 @@ BOOLEAN ApplyCammo( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN *pfGoodAP return( FALSE ); } - if ((pSoldier->bCamo + pSoldier->wornCamo ) >= 100) + //get total camo bonus for kit -- note that camo kits now require the camobonus tag to be set + int itemCamo = Item[pObj->usItem].camobonus + Item[pObj->usItem].urbanCamobonus + Item[pObj->usItem].desertCamobonus + Item[pObj->usItem].snowCamobonus; + + if ( itemCamo < 100 ) + usTotalKitPoints = (INT16)((itemCamo / 100) * usTotalKitPoints); + + int totalCamo = pSoldier->bCamo + pSoldier->wornCamo + pSoldier->urbanCamo+pSoldier->wornUrbanCamo+pSoldier->desertCamo+pSoldier->wornDesertCamo+pSoldier->snowCamo+pSoldier->wornSnowCamo; + if ((totalCamo) >= 100) { // nothing more to add return( FALSE ); @@ -5631,9 +5697,19 @@ BOOLEAN ApplyCammo( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN *pfGoodAP // points are used up at a rate of 50% kit = 100% cammo on guy // add 1 to round off - bPointsToUse = (100 - (pSoldier->bCamo + pSoldier->wornCamo) + 1 ) / 2; + bPointsToUse = (100 - (totalCamo) + 1 ) / 2; bPointsToUse = __min( bPointsToUse, usTotalKitPoints ); - pSoldier->bCamo = __min( 100, pSoldier->bCamo + bPointsToUse * 2); + + //figure out proportions of each to be applied, one item can theoretically have more than one camouflage type this way + int urban = (int)((Item[pObj->usItem].urbanCamobonus / itemCamo) * bPointsToUse); + int jungle = (int)((Item[pObj->usItem].camobonus / itemCamo) * bPointsToUse); + int desert = (int)((Item[pObj->usItem].desertCamobonus / itemCamo) * bPointsToUse); + int snow = (int)((Item[pObj->usItem].snowCamobonus / itemCamo) * bPointsToUse); + + pSoldier->bCamo = __min( 100, pSoldier->bCamo + jungle * 2); + pSoldier->urbanCamo = __min( 100, pSoldier->urbanCamo + urban * 2); + pSoldier->desertCamo = __min( 100, pSoldier->desertCamo + desert * 2); + pSoldier->snowCamo = __min( 100, pSoldier->snowCamo + snow * 2); UseKitPoints( pObj, bPointsToUse, pSoldier ); diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 95930150..13774e83 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -1612,7 +1612,20 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE } } - if ( ( pEndSoldier->bCamo + pEndSoldier->wornCamo ) > 0 && !bAware ) + //get the total camouflage + float jungle = (float)(pEndSoldier->bCamo + pEndSoldier->wornCamo); + float urban = (float)(pEndSoldier->urbanCamo + pEndSoldier->wornUrbanCamo); + float desert = (float)(pEndSoldier->desertCamo + pEndSoldier->wornDesertCamo); + float snow = (float)(pEndSoldier->snowCamo + pEndSoldier->wornSnowCamo); + int totalCamo = (int)(jungle + urban + desert + snow); + + //get the percentage of each type + jungle = jungle / totalCamo; + urban = urban / totalCamo; + desert = desert / totalCamo; + snow = snow / totalCamo; + + if ( ( totalCamo ) > 0 && !bAware ) { // reduce effects of camo of 5% per tile moved last turn @@ -1622,25 +1635,40 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE } else { - bEffectiveCamo = max(0,min(100,(pEndSoldier->bCamo + pEndSoldier->wornCamo))) * (100 - pEndSoldier->bTilesMoved * 5) / 100; + bEffectiveCamo = max(0,min(100,(totalCamo))) * (100 - pEndSoldier->bTilesMoved * 5) / 100; } bEffectiveCamo = __max( bEffectiveCamo, 0 ); if ( gAnimControl[ pEndSoldier->usAnimState ].ubEndHeight < ANIM_STAND ) { + iTemp = ubTileSightLimit; // reduce visibility by up to a third for camouflage! switch( pEndSoldier->bOverTerrainType ) { - case FLAT_GROUND: case LOW_GRASS: - case HIGH_GRASS: - iTemp = ubTileSightLimit; - iTemp -= iTemp * (bEffectiveCamo / 3) / 100; - ubTileSightLimit = (UINT8) iTemp; + case HIGH_GRASS: // jungle camo bonus + iTemp -= iTemp * (int)(jungle * bEffectiveCamo / 3) / 100; + break; + case FLAT_FLOOR: // flat floor = indoors + case PAVED_ROAD: // urban camo bonus + iTemp -= iTemp * (int)(urban * bEffectiveCamo / 3) / 100; + break; + case DIRT_ROAD: // desert camo bonus + case TRAIN_TRACKS: + iTemp -= iTemp * (int)(desert * bEffectiveCamo / 3) / 100; + break; + //case ??? : // snow camo bonus + // iTemp -= iTemp * (snow * bEffectiveCamo / 3) / 100; + // break; + case FLAT_GROUND: + //in this case both desert and jungle can work: + iTemp -= iTemp * (int)(jungle * bEffectiveCamo / 3) / 100; + iTemp -= iTemp * (int)(desert * bEffectiveCamo / 3) / 100; break; default: break; } + ubTileSightLimit = (UINT8) iTemp; } } else diff --git a/Tactical/Rotting Corpses.cpp b/Tactical/Rotting Corpses.cpp index 6e22597c..cd09dbb2 100644 --- a/Tactical/Rotting Corpses.cpp +++ b/Tactical/Rotting Corpses.cpp @@ -700,11 +700,26 @@ BOOLEAN CreateCorpsePalette( ROTTING_CORPSE *pCorpse ) { bBodyTypePalette = 0; } - else if ( pCorpse->def.usFlags & ROTTING_CORPSE_USE_CAMMO_PALETTE ) + else if ( pCorpse->def.usFlags & ROTTING_CORPSE_USE_CAMO_PALETTE ) { strcpy( zColFilename, "ANIMS\\camo.COL" ); bBodyTypePalette = 1; } + else if ( pCorpse->def.usFlags & ROTTING_CORPSE_USE_URBAN_CAMO_PALETTE ) + { + strcpy( zColFilename, "ANIMS\\urban.col" ); + bBodyTypePalette = 1; + } + else if ( pCorpse->def.usFlags & ROTTING_CORPSE_USE_DESERT_CAMO_PALETTE ) + { + strcpy( zColFilename, "ANIMS\\desert.col" ); + bBodyTypePalette = 1; + } + else if ( pCorpse->def.usFlags & ROTTING_CORPSE_USE_SNOW_CAMO_PALETTE ) + { + strcpy( zColFilename, "ANIMS\\snow.col" ); + bBodyTypePalette = 1; + } else if ( pCorpse->def.usFlags & ROTTING_CORPSE_USE_STEALTH_PALETTE ) { strcpy( zColFilename, "ANIMS\\stealth.col" ); @@ -795,14 +810,29 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE SET_PALETTEREP_ID ( Corpse.SkinPal, pSoldier->SkinPal ); SET_PALETTEREP_ID ( Corpse.PantsPal, pSoldier->PantsPal ); + int urban = pSoldier->urbanCamo + pSoldier->wornUrbanCamo; + int jungle = pSoldier->bCamo + pSoldier->wornCamo; + int desert = pSoldier->desertCamo + pSoldier->wornDesertCamo; + int snow = pSoldier->snowCamo + pSoldier->wornSnowCamo; + int total = urban + jungle + desert + snow; + if ( GetWornStealth(pSoldier) >= 50 ) { Corpse.usFlags |= ROTTING_CORPSE_USE_STEALTH_PALETTE; } - else if ( pSoldier->bCamo >= 50 ) + else if ( total >= 50 ) { - Corpse.usFlags |= ROTTING_CORPSE_USE_CAMMO_PALETTE; + // display camo depending on which is higher + if ( jungle >= urban && jungle >= desert && jungle >= snow ) + Corpse.usFlags |= ROTTING_CORPSE_USE_CAMO_PALETTE; + else if ( urban >= jungle && urban >= desert && urban >= snow ) + Corpse.usFlags |= ROTTING_CORPSE_USE_URBAN_CAMO_PALETTE; + else if ( desert >= urban && desert >= jungle && desert >= snow ) + Corpse.usFlags |= ROTTING_CORPSE_USE_DESERT_CAMO_PALETTE; + else if ( snow >= urban && snow >= desert && snow >= jungle ) + Corpse.usFlags |= ROTTING_CORPSE_USE_SNOW_CAMO_PALETTE; } + // Determine corpse type! ubType = (UINT8)gubAnimSurfaceCorpseID[ pSoldier->ubBodyType][ pSoldier->usAnimState ]; diff --git a/Tactical/Rotting Corpses.h b/Tactical/Rotting Corpses.h index 5a0fa375..f5c1b5e9 100644 --- a/Tactical/Rotting Corpses.h +++ b/Tactical/Rotting Corpses.h @@ -73,14 +73,17 @@ enum RottingCorpseDefines -#define ROTTING_CORPSE_FIND_SWEETSPOT_FROM_GRIDNO 0x01 //Find the closest spot to the given gridno -#define ROTTING_CORPSE_USE_NORTH_ENTRY_POINT 0x02 //Find the spot closest to the north entry grid -#define ROTTING_CORPSE_USE_SOUTH_ENTRY_POINT 0x04 //Find the spot closest to the south entry grid -#define ROTTING_CORPSE_USE_EAST_ENTRY_POINT 0x08 //Find the spot closest to the east entry grid -#define ROTTING_CORPSE_USE_WEST_ENTRY_POINT 0x10 //Find the spot closest to the west entry grid -#define ROTTING_CORPSE_USE_CAMMO_PALETTE 0x20 //We use cammo palette here.... -#define ROTTING_CORPSE_VEHICLE 0x40 //Vehicle Corpse -#define ROTTING_CORPSE_USE_STEALTH_PALETTE 0x80 //We use stealth palette here.... +#define ROTTING_CORPSE_FIND_SWEETSPOT_FROM_GRIDNO 0x001 //Find the closest spot to the given gridno +#define ROTTING_CORPSE_USE_NORTH_ENTRY_POINT 0x002 //Find the spot closest to the north entry grid +#define ROTTING_CORPSE_USE_SOUTH_ENTRY_POINT 0x004 //Find the spot closest to the south entry grid +#define ROTTING_CORPSE_USE_EAST_ENTRY_POINT 0x008 //Find the spot closest to the east entry grid +#define ROTTING_CORPSE_USE_WEST_ENTRY_POINT 0x010 //Find the spot closest to the west entry grid +#define ROTTING_CORPSE_USE_CAMO_PALETTE 0x020 //We use cammo palette here.... +#define ROTTING_CORPSE_VEHICLE 0x040 //Vehicle Corpse +#define ROTTING_CORPSE_USE_STEALTH_PALETTE 0x080 //We use stealth palette here.... +#define ROTTING_CORPSE_USE_URBAN_CAMO_PALETTE 0x100 //We use urban palette here.... +#define ROTTING_CORPSE_USE_DESERT_CAMO_PALETTE 0x200 //We use desert palette here.... +#define ROTTING_CORPSE_USE_SNOW_CAMO_PALETTE 0x400 //We use snow palette here.... typedef struct { diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index e46fb94d..90d8b4b4 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -943,8 +943,18 @@ typedef struct BOOLEAN lastFlankLeft; INT8 sniper; INT16 origDir; - INT16 wornCamo; - UINT8 bFiller[ 41 ]; + INT8 wornCamo; + + INT8 urbanCamo; // Madd: new camo types + INT8 wornUrbanCamo; + + INT8 desertCamo; + INT8 wornDesertCamo; + + INT8 snowCamo; + INT8 wornSnowCamo; + + UINT8 bFiller[ 36 ]; } SOLDIERTYPE; diff --git a/Tactical/Soldier Create.cpp b/Tactical/Soldier Create.cpp index cce3d9e8..7dfea26d 100644 --- a/Tactical/Soldier Create.cpp +++ b/Tactical/Soldier Create.cpp @@ -457,7 +457,10 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 * if ( i != NO_SLOT && Random( 5 ) < SoldierDifficultyLevel( &Soldier )) { // start camouflaged - Soldier.bCamo = 100; + Soldier.bCamo = Item[i].camobonus; + Soldier.urbanCamo = Item[i].urbanCamobonus; + Soldier.desertCamo = Item[i].desertCamobonus; + Soldier.snowCamo = Item[i].snowCamobonus; } } } @@ -722,6 +725,21 @@ BOOLEAN TacticalCopySoldierFromProfile( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STR // set camouflaged to 100 automatically pSoldier->bCamo = 100; } + if ( HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_URBAN ) ) + { + // set camouflaged to 100 automatically + pSoldier->urbanCamo = 100; + } + if ( HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_DESERT ) ) + { + // set camouflaged to 100 automatically + pSoldier->desertCamo = 100; + } + if ( HAS_SKILL_TRAIT( pSoldier, CAMOUFLAGED_SNOW ) ) + { + // set camouflaged to 100 automatically + pSoldier->snowCamo = 100; + } return( TRUE ); } diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index 35944831..2d727c23 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -81,6 +81,9 @@ INT8 gbSkillTraitBonus[NUM_SKILLTRAITS] = 30, //KNIFING 15, //ONROOF 0, //CAMOUFLAGED + 0, //CAMOUFLAGED_URBAN + 0, //CAMOUFLAGED_DESERT + 0, //CAMOUFLAGED_SNOW }; diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h index 51224089..de3a90ca 100644 --- a/Tactical/soldier profile type.h +++ b/Tactical/soldier profile type.h @@ -95,6 +95,9 @@ typedef enum KNIFING, ONROOF, CAMOUFLAGED, + CAMOUFLAGED_URBAN, + CAMOUFLAGED_DESERT, + CAMOUFLAGED_SNOW, NUM_SKILLTRAITS } SkillTrait; diff --git a/TileEngine/TileEngine.vcproj b/TileEngine/TileEngine.vcproj index 57aa7bfb..89f5d6aa 100644 --- a/TileEngine/TileEngine.vcproj +++ b/TileEngine/TileEngine.vcproj @@ -3096,6 +3096,9 @@ + + diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index 6ef265ca..68d3de02 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -197,6 +197,9 @@ itemStartElementHandle(void *userData, const char *name, const char **atts) strcmp(name, "PercentTunnelVision") == 0 || strcmp(name, "DefaultAttachment") == 0 || strcmp(name, "CamoBonus") == 0 || + strcmp(name, "UrbanCamoBonus") == 0 || + strcmp(name, "DesertCamoBonus") == 0 || + strcmp(name, "SnowCamoBonus") == 0 || strcmp(name, "StealthBonus") == 0 || strcmp(name, "fFlags") == 0 )) @@ -525,6 +528,21 @@ itemEndElementHandle(void *userData, const char *name) pData->curElement = ELEMENT; pData->curItem.camobonus = (INT16) atol(pData->szCharData); } + else if(strcmp(name, "DesertCamoBonus") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.desertCamobonus = (INT16) atol(pData->szCharData); + } + else if(strcmp(name, "UrbanCamoBonus") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.urbanCamobonus = (INT16) atol(pData->szCharData); + } + else if(strcmp(name, "SnowCamoBonus") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.snowCamobonus = (INT16) atol(pData->szCharData); + } else if(strcmp(name, "StealthBonus") == 0) { pData->curElement = ELEMENT; @@ -1401,6 +1419,9 @@ BOOLEAN WriteItemStats() FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].rock ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].camobonus ); + FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].urbanCamobonus ); + FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].desertCamobonus ); + FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].snowCamobonus ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].stealthbonus ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].flakjacket ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].leatherjacket );