mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- New behaviour for gas grenades:
Gas grenades now don't cause direct damage on hit anymore. They will cause damage on start of turn or if you move inside a gas cloud. Of course gas mask still helps (except for creature gas and fire). Every tile moved inside a gas cloud deals a percentage of the normal damage (default 10%). This is set in Item_Settings.ini (DAMAGE_HEALTH_MOVE_EXPLOSIVE_MODIFIER, DAMAGE_BREATH_MOVE_EXPLOSIVE_MODIFIER). Tiles can now have multiple gas effects on them. Unfortunately this is not visualized (yet). Smoke doesn't make a character immune to other gas types anymore. The 25% chance of taking damage while moving through a gas cloud has been removed. Damage is now applied 100% of the time. - New modifiers for explosive damage in Item_Settings.ini (DAMAGE_HEALTH_EXPLOSIVE_MODIFIER, DAMAGE_BREATH_EXPLOSIVE_MODIFIER). These could fully replace EXPLOSIVES_DAMAGE_MODIFIER in Ja2_Options.ini but I left that general modifier untouched for now. - Some compiler warning fixes. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6517 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+23
-11
@@ -5479,23 +5479,28 @@ std::vector<UINT16> GetItemSlots(OBJECTTYPE* pObj, UINT8 subObject, BOOLEAN fAtt
|
||||
UINT64 uiClass = (UINT64)pow((double)2, (int)sClass);
|
||||
UINT32 slotSize = tempItemSlots.size();
|
||||
if(fItemSlots & uiClass){ //don't bother with this slot if it's not a valid class
|
||||
for(UINT32 sCount = 1; sCount < MAXITEMS+1; sCount++){
|
||||
for(UINT32 sCount = 1; sCount < MAXITEMS+1; sCount++)
|
||||
{
|
||||
if(AttachmentSlots[sCount].uiSlotIndex == 0)
|
||||
break;
|
||||
if(AttachmentSlots[sCount].nasAttachmentClass & uiClass && AttachmentSlots[sCount].nasLayoutClass & fItemLayout){ //found a slot
|
||||
if(AttachmentSlots[sCount].nasAttachmentClass & uiClass && AttachmentSlots[sCount].nasLayoutClass & fItemLayout) //found a slot
|
||||
{
|
||||
if(magSize > 0 && AttachmentSlots[sCount].fMultiShot)
|
||||
magSize--;
|
||||
else if(AttachmentSlots[sCount].fMultiShot)
|
||||
continue;
|
||||
|
||||
if(Item[pObj->usItem].usItemClass == IC_LBEGEAR && AttachmentSlots[sCount].ubPocketMapping > 0){
|
||||
if(LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketsAvailable & (UINT16)pow((double)2, AttachmentSlots[sCount].ubPocketMapping - 1)){
|
||||
tempItemSlots.push_back(AttachmentSlots[sCount].uiSlotIndex);
|
||||
}
|
||||
}else{
|
||||
if(Item[pObj->usItem].usItemClass == IC_LBEGEAR && AttachmentSlots[sCount].ubPocketMapping > 0)
|
||||
{
|
||||
if(LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketsAvailable & (UINT16)pow((double)2, AttachmentSlots[sCount].ubPocketMapping - 1))
|
||||
{
|
||||
tempItemSlots.push_back(AttachmentSlots[sCount].uiSlotIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tempItemSlots.push_back(AttachmentSlots[sCount].uiSlotIndex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(slotSize == tempItemSlots.size()){ //we didn't find a layout specific slot so try to find a default layout slot
|
||||
@@ -13840,14 +13845,21 @@ INT8 FindBackpackOnSoldier( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: This applies the INI modifier to explosives
|
||||
UINT8 GetModifiedExplosiveDamage( UINT16 sDamage )
|
||||
UINT8 GetModifiedExplosiveDamage( UINT16 sDamage, UINT8 ubType )
|
||||
{
|
||||
if (sDamage == 0)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
sDamage = (INT16)(( sDamage * gGameExternalOptions.iExplosivesDamageModifier ) / 100);
|
||||
// apply ini modifiers by type
|
||||
if ( ubType == 0 ) // type 0 is health damage
|
||||
sDamage = (FLOAT)(( sDamage * gGameExternalOptions.iExplosivesDamageModifier * gItemSettings.fDamageHealthModifierExplosive ) / 100);
|
||||
else if ( ubType == 1 ) // type 1 is breath damage
|
||||
sDamage = (FLOAT)(( sDamage * gGameExternalOptions.iExplosivesDamageModifier * gItemSettings.fDamageBreathModifierExplosive ) / 100);
|
||||
else
|
||||
return(0); // undefined type
|
||||
|
||||
sDamage = __max(1, sDamage);
|
||||
sDamage = __min(255, sDamage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user