mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fixed overlapping camo values for armor and LBE vests
New item property modifier for armor: CAMO_LBE_OVER_ARMOR_MODIFIER sets the amount of camouflage from armor vests that is used when we wear LBE over them. Default is 0.2. That's basically the arms sticking out of the LBE. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6553 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2733,6 +2733,7 @@ void LoadItemSettings()
|
||||
gItemSettings.fHandlingModifierLauncher = iniReader.ReadFloat ("Weapon Settings","HANDLING_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
|
||||
// -------------- ARMOR MODIFIERS ----------------
|
||||
gItemSettings.fCamoLBEoverArmorModifier = iniReader.ReadFloat ("Armor Settings","CAMO_LBE_OVER_ARMOR_MODIFIER", 0.2f, 0.0f, 1.0f);
|
||||
|
||||
// ------------ EXPLOSIVE MODIFIERS --------------
|
||||
gItemSettings.fDamageHealthModifierExplosive = iniReader.ReadFloat ("Explosives Settings","DAMAGE_HEALTH_EXPLOSIVE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
|
||||
@@ -1956,6 +1956,7 @@ typedef struct
|
||||
FLOAT fHandlingModifierLauncher;
|
||||
|
||||
// -------------- ARMOR MODIFIERS ----------------
|
||||
FLOAT fCamoLBEoverArmorModifier;
|
||||
|
||||
// ------------ EXPLOSIVE MODIFIERS --------------
|
||||
// Grenade Damage Modifiers
|
||||
|
||||
+30
-5
@@ -12362,6 +12362,12 @@ INT16 GetWornCamo( SOLDIERTYPE * pSoldier )
|
||||
if ( pSoldier->inv[bLoop].exists() == true )
|
||||
{
|
||||
ttl += GetCamoBonus(&pSoldier->inv[bLoop]);
|
||||
if ( UsingNewInventorySystem() )
|
||||
if ( bLoop == VESTPOS && pSoldier->inv[VESTPOCKPOS].exists() )
|
||||
{
|
||||
// silversurver: Using LBE vest. Only apply partial bonus from armor vest.
|
||||
ttl -= ( ( 1.0 - gItemSettings.fCamoLBEoverArmorModifier ) * Item[ pSoldier->inv[bLoop].usItem ].camobonus );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12372,11 +12378,6 @@ INT16 GetWornCamo( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
if ( pSoldier->inv[bLoop].exists() == true )
|
||||
ttl += GetCamoBonus(&pSoldier->inv[bLoop]);
|
||||
//CHRISL: to prevent camo overlap, don't count armor vest camo if we're weaing an LBE vest that grants a bonus
|
||||
if(bLoop == VESTPOCKPOS && pSoldier->inv[VESTPOS].exists() == true && Item[pSoldier->inv[bLoop].usItem].camobonus > 0)
|
||||
{
|
||||
ttl -= Item[pSoldier->inv[VESTPOS].usItem].camobonus;
|
||||
}
|
||||
}
|
||||
|
||||
//tais: guns can be camouflaged, this will make gun camo have effect when in main/second hand or on gunsling, did a check for guns and nothing else, hope that's enough.
|
||||
@@ -12398,7 +12399,15 @@ INT16 GetWornUrbanCamo( SOLDIERTYPE * pSoldier )
|
||||
for (bLoop = HELMETPOS; bLoop <= LEGPOS; bLoop++)
|
||||
{
|
||||
if ( pSoldier->inv[bLoop].exists() == true )
|
||||
{
|
||||
ttl += GetUrbanCamoBonus(&pSoldier->inv[bLoop]);
|
||||
if ( UsingNewInventorySystem() )
|
||||
if ( bLoop == VESTPOS && pSoldier->inv[VESTPOCKPOS].exists() )
|
||||
{
|
||||
// silversurver: Using LBE vest. Only apply partial bonus from armor vest.
|
||||
ttl -= ( ( 1.0 - gItemSettings.fCamoLBEoverArmorModifier ) * Item[ pSoldier->inv[bLoop].usItem ].urbanCamobonus );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CHRISL: Add additional loop for LBE items while using new inventory system
|
||||
@@ -12429,7 +12438,15 @@ INT16 GetWornDesertCamo( SOLDIERTYPE * pSoldier )
|
||||
for (bLoop = HELMETPOS; bLoop <= LEGPOS; bLoop++)
|
||||
{
|
||||
if ( pSoldier->inv[bLoop].exists() == true )
|
||||
{
|
||||
ttl += GetDesertCamoBonus(&pSoldier->inv[bLoop]);
|
||||
if ( UsingNewInventorySystem() )
|
||||
if ( bLoop == VESTPOS && pSoldier->inv[VESTPOCKPOS].exists() )
|
||||
{
|
||||
// silversurver: Using LBE vest. Only apply partial bonus from armor vest.
|
||||
ttl -= ( ( 1.0 - gItemSettings.fCamoLBEoverArmorModifier ) * Item[ pSoldier->inv[bLoop].usItem ].desertCamobonus );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CHRISL: Add additional loop for LBE items while using new inventory system
|
||||
@@ -12459,7 +12476,15 @@ INT16 GetWornSnowCamo( SOLDIERTYPE * pSoldier )
|
||||
for (bLoop = HELMETPOS; bLoop <= LEGPOS; bLoop++)
|
||||
{
|
||||
if ( pSoldier->inv[bLoop].exists() == true )
|
||||
{
|
||||
ttl += GetSnowCamoBonus(&pSoldier->inv[bLoop]);
|
||||
if ( UsingNewInventorySystem() )
|
||||
if ( bLoop == VESTPOS && pSoldier->inv[VESTPOCKPOS].exists() )
|
||||
{
|
||||
// silversurver: Using LBE vest. Only apply partial bonus from armor vest.
|
||||
ttl -= ( ( 1.0 - gItemSettings.fCamoLBEoverArmorModifier ) * Item[ pSoldier->inv[bLoop].usItem ].snowCamobonus );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CHRISL: Add additional loop for LBE items while using new inventory system
|
||||
|
||||
Reference in New Issue
Block a user