mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- Fixed EDB modifier weirdness(by Moa)
- Fix: overheating modifiers on attachments weren't shown correctly git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6289 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+54
-30
@@ -11838,6 +11838,23 @@ void GunIncreaseHeat( OBJECTTYPE *pObj, SOLDIERTYPE* pSoldier )
|
||||
}
|
||||
|
||||
// Flugente: Overheating Weapons
|
||||
FLOAT GetTemperatureModifier( OBJECTTYPE *pObj )
|
||||
{
|
||||
// determine modificator according to attachments
|
||||
FLOAT modificator = Item[pObj->usItem].overheatTemperatureModificator;
|
||||
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if (iter->exists())
|
||||
{
|
||||
modificator += Item[iter->usItem].overheatTemperatureModificator;
|
||||
}
|
||||
}
|
||||
|
||||
return modificator;
|
||||
}
|
||||
|
||||
FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
|
||||
{
|
||||
FLOAT singleshottemperature = 0.0;
|
||||
@@ -11847,16 +11864,7 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
|
||||
singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature;
|
||||
|
||||
// determine modificator according to attachments
|
||||
FLOAT modificator = 1.0f;
|
||||
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if (iter->exists())
|
||||
{
|
||||
modificator += Item[iter->usItem].overheatTemperatureModificator;
|
||||
}
|
||||
}
|
||||
FLOAT modificator = 1.0f + GetTemperatureModifier(pObj);
|
||||
|
||||
// determine modificator according to ammo
|
||||
modificator += AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].temperatureModificator;
|
||||
@@ -11896,6 +11904,23 @@ FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj )
|
||||
return temperature/ jamthreshold ;
|
||||
}
|
||||
|
||||
FLOAT GetOverheatJamThresholdModifier( OBJECTTYPE *pObj )
|
||||
{
|
||||
// determine modificator according to attachments
|
||||
FLOAT modificator = Item[pObj->usItem].overheatJamThresholdModificator;
|
||||
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if (iter->exists())
|
||||
{
|
||||
modificator += Item[iter->usItem].overheatJamThresholdModificator;
|
||||
}
|
||||
}
|
||||
|
||||
return modificator;
|
||||
}
|
||||
|
||||
FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj )
|
||||
{
|
||||
FLOAT jamthreshold = OVERHEATING_MAX_TEMPERATURE / 4.0f;
|
||||
@@ -11905,16 +11930,7 @@ FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj )
|
||||
jamthreshold = Weapon[ pObj->usItem ].usOverheatingJamThreshold;
|
||||
|
||||
// determine modificator according to attachments
|
||||
FLOAT modificator = 1.0;
|
||||
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if (iter->exists())
|
||||
{
|
||||
modificator += Item[iter->usItem].overheatJamThresholdModificator;
|
||||
}
|
||||
}
|
||||
FLOAT modificator = 1.0f + GetOverheatJamThresholdModifier(pObj);
|
||||
|
||||
jamthreshold *= modificator;
|
||||
}
|
||||
@@ -11922,6 +11938,23 @@ FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj )
|
||||
return jamthreshold;
|
||||
}
|
||||
|
||||
FLOAT GetOverheatDamageThresholdModifier( OBJECTTYPE *pObj )
|
||||
{
|
||||
// determine modificator according to attachments
|
||||
FLOAT modificator = Item[pObj->usItem].overheatDamageThresholdModificator;
|
||||
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if (iter->exists())
|
||||
{
|
||||
modificator += Item[iter->usItem].overheatDamageThresholdModificator;
|
||||
}
|
||||
}
|
||||
|
||||
return modificator;
|
||||
}
|
||||
|
||||
FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj )
|
||||
{
|
||||
FLOAT damagethreshold = OVERHEATING_MAX_TEMPERATURE / 4.0f;
|
||||
@@ -11931,16 +11964,7 @@ FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj )
|
||||
damagethreshold = Weapon[ pObj->usItem ].usOverheatingDamageThreshold;
|
||||
|
||||
// determine modificator according to attachments
|
||||
FLOAT modificator = 1.0;
|
||||
|
||||
attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
|
||||
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
|
||||
{
|
||||
if (iter->exists())
|
||||
{
|
||||
modificator += Item[iter->usItem].overheatDamageThresholdModificator;
|
||||
}
|
||||
}
|
||||
FLOAT modificator = 1.0f + GetOverheatDamageThresholdModifier(pObj);
|
||||
|
||||
damagethreshold *= modificator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user