Jump to content

R&D Damage Mods


Amineri

Recommended Posts

Here's some new target code that shows all of the damage mods that will be applied prior to critical and damage randomization:

 

 

 

    I = m_kUnit.m_aCurrentStats[12];        
    // End:0x20F
    if(m_kWeapon != none)
    {
        switch(m_kWeapon.GameplayType())
        {
            case eItem_Pistol: // 2
            case eItem_AssaultRifle:  // 3
            case eItem_Shotgun: // 4
            case eItem_LMG: // 5
            case eItem_SniperRifle: // 6
                if(m_kUnit.IsInFront(none, float(74))) // helper function to check inventory for item 74
                {
                    I += 1;
                }
                break;
            case eItem_LaserPistol: // 8
            case eItem_LaserAssaultRifle: // 9
            case eItem_LaserAssaultGun: // 10
            case eItem_HeavyLaser: // 11
            case eItem_LaserSniperRifle: // 12
                if(m_kUnit.IsInFront(none, float(75))) // helper function to check inventory for item 75
                {
                    I += 1;
                }
                break;
            case eItem_PlasmaPistol: // 13
            case eItem_PlasmaLightRifle: // 14 
            case eItem_PlasmaAssaultRifle: // 15
            case eItem_AlloyCannon: // 16 
            case eItem_HeavyPlasma: // 17 
            case eItem_PlasmaSniperRifle: // 18 
                if(m_kUnit.IsInFront(none, float(84))) // helper function to check inventory for item 84
                {
                    I += 1;
                }
                break;
            case eItem_RocketLauncher: // 7
            case eItem_BlasterLauncher: // 19
                if(m_kUnit.IsInFront(none, float(84))) // helper function to check inventory for item 84
                {
                    I += 3;
                }
                else
                {
                    if(m_kUnit.IsInFront(none, float(75))) // helper function to check inventory for item 75
                    {
                        I += 2;
                    }
                    else
                    {
                        if(m_kUnit.IsInFront(none, float(74))) // helper function to check inventory for item 74
                        {
                            I += 1;
                        }
                    }
                }
                break;
            default:
                break;
            }
    }
	if(m_kWeapon.HasProperty(eWP_Pistol))
	{
		if(m_kUnit.m_kCharacter.HasUpgrade(ePerk_Gunslinger) // 95
		{
			I += 2;
		}
		if(m_kUnit.GetPlayer().HasFoundryHistory(eFoundry_PistolIII)   // 15
		{
			I += 1;
		}
	}
	switch(GetType())
	{	
		case eAbility_FragGrenade:   // 22
		case eAbility_AlienGrenade:  // 24
			if(m_kUnit.m_kCharacter.HasUpgrade(45) // check for new engineer's sapper perk
			{
				I += 1;
			}
			break;
		case eAbility_FireRocket :
			I += (m_kWeapon.GetDamageStat() + 1) / 2; // add +50% damage to regular rocket
		case eAbility_ShredderRocket :
		case eAbility_Suppression :
			if(m_kUnit.m_kCharacter.HasUpgrade(ePerk_Mayhem))
			{
				I += GetMayhemPerkBonusDamage(); // add Mayhem bonus damage
			}
			break;
		case eAbility_PrecisionShot: // HeadShot
			if(m_bCritical)
			{
				I += GetPrecisionShotPerkDamageDamageAdd(); // Add Headshot bonus damage
			}
			break;
		case eAbility_ShotFlush: // Flush
			I -= (m_kWeapon.GetDamageStat() + 1) / 2; // remove 50% of weapon base damage
			break;
		case eAbility_DisablingShot: //Disabling Shot
			I -= (m_kWeapon.GetDamageStat() + 3) / 4; // remove 25% of weapon base damage
			break;
		case default:
			break;
	}
	if(m_bCritical)
	{
		if(m_kUnit.m_kCharacter.HasUpgrade(ePerk_BringEmOn)) //Bring Em On
		{
			I += Max(4, m_kUnit.m_arrVisibleEnemies.Length); // +1 base damage per enemy seen
		}

		if(m_kUnit.m_kCharacter.HasUpgrade(ePerk_KillerInstinct))  // KillerInstinct
		{
			if(m_kUnit.RunAndGunPerkActive())
			{
				I += (m_kWeapon.GetDamageStat() + 2) / 3; // +33% (fractions rounded up) to base damage
			}
		}
	}
	if(GetPrimaryTarget() != none && GetPrimaryTarget().IsInCover() && !GetPrimaryTarget().IsFlankedBy(m_kUnit) && GetPrimaryTarget().m_kCharacter.HasUpgrade(ePerk_WillToSurvive)) //WillToSurvive
	{
		I -= 2;
	}
    if(m_kUnit.m_kCharacter.HasUpgrade(50)) // new bonus damage perk
    {
        if(!m_kWeapon.HasProperty(eWP_Pistol)) // 2
        {
            if(!m_kWeapon.HasProperty(eWP_Secondary)) // 1
            {
                I += 1;
            }
        }
    }
    return string(I); 

 

 

 

Changes:

  • Gunslinger bonus damage added -- default +2
  • Foundry Pistol III bonus damage added -- default +1
  • Fixed Killer Instinct
  • Added check for Mayhem perk before applying Mayhem damage
  • Fire Rocket ability adds +50% of base weapon damage (Shredder Rocket does not)
  • New perk 50 adds +1 damage to main-hand weapon only (not to eWP_Secondary and not to eWP_Pistol items) -- no movement requirement dropped
  • Added pseudocode for WillToSurvive damage reduction -- note this differs from other damage reduction in that it is applied BEFORE critical multiplier

The Rocket Launcher and Blaster Launcher have eWP_Secondary, so the damage perk will not apply. It only applies to Rifles, Shotguns, LMGs, and Sniper Rifles.

 

Note that adding the +1 damage booster item, the Pistol III foundry +1 upgrade and the Gunslinger +2 damage to a Plasma pistol results in a 7 base damage plasma pistol -- equal to an unmodified Plasma Assault Rifle :o

 

In comparison

  • the Plasma Assault Rifle maxes out at 9 base damage (7 + 1 (perk) + 1 (item))
  • the Alloy Cannon, Heavy Plasma and Plasma Sniper max out at 11 base damage (9 + 1 + 1)
  • The Rocket Launcher maxes out at 9 damage (6 + 3 (item)) ((perk does not apply to rockets)), (12 with Mayhem)
  • The Blaster Launcher maxes out at 12 damage (9 + 3(item)) (some large number with Mayhem)

--------------------------------

 

I really don't know if WillToSurvive has to be applied here or not. It depends on whether it was previously implemented in the CalcOverallDamageModFromPerks, which I have no way to check in the code. Any feedback on this would be much appreciated.

Link to comment
Share on other sites

Finished up the hex code that implements the above with a couple of minor changes :

  • Plasma damage booster item applies +1 to Blaster Launcher
  • Ballistic damage booster item applies +1 to Rocket Launcher
  • Perk 50 applies +1 to all large item weapons -- rifles, shotguns, LMGs, sniper rifles, SHIV weapons and Rocket/Blaster Launchers
  • WillToSurvive is implemented (JL verified that it needed to be added)

Full set of hex changes:

 

 

All Hex changes for damage rework modlet

In XGAbility_Targeted.CalcDamage,
Remove CalcOverallDamageModFromPerks to remove glitchy native code that messes up critical damage calculations

change:
m_iActualDamage = CalcOverallDamageModFromPerk(float(m_iActualDamage))
0F 01 16 BC 00 00 1B D0 0E 00 00 00 00 00 00 38 3F 01 16 BC 00 00 16

to:
m_iActualDamage m_iActualDamage
0B 01 16 BC 00 00 01 16 BC 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 


--------------------------------------------------------------------

Change part of XGAbility_Targeted.CalcDamage to call helper function to send damage delta into CalcOverallDamage


original hex:
07 AC 02 9A 1B 1E 35 00 00 00 00 00 00 16 2C 48 16 0F 01 16 BC 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 02 00 F0 2C 00 00 00 2C 05 06 85 03 07 85 03 9B 1B 1E 35 00 00 00 00 00 00 16 2C 43 16 0F 01 16 BC 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 60 00 EF 76 00 00 00 1B CF 0E 00 00 00 00 00 00 38 3A 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 1A 2C 0C 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 2D 01 25 BC 00 00 2D 01 24 BC 00 00 16 


new hex: 
07 4E 02 9A 1B 1E 35 00 00 00 00 00 00 16 2C 48 16 0F 01 16 BC 00 00 2C 05 06 85 03 07 85 03 9B 1B 1E 35 00 00 00 00 00 00 16 2C 43 16 0F 01 16 BC 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 54 00 EF 76 00 00 00 1B CF 0E 00 00 00 00 00 00 38 3A 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 38 4A 1C 75 7C 00 00 00 BF 29 00 00 16 2D 01 25 BC 00 00 2D 01 24 BC 00 00 16 0B 0B 0B 0B 0B 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 


--------------------------------------------------------------------


Rewrite XGAbility_Targeted.TShotInfo_ToString as a helper function to compute delta damage based on perks, etc.

XGAbility_Targeted.TShotInfo_ToString

original hex:
header:
89 7C 00 00 50 55 00 00 00 00 00 00 70 7C 00 00 00 00 00 00 00 00 00 00 74 7C 00 00 00 00 00 00 18 01 00 00 1E 27 00 00 15 06 00 00 3D 04 00 00 

body:
0F 00 72 7C 00 00 70 70 1F 54 53 68 6F 74 49 6E 66 6F 3A 20 54 69 74 6C 65 3D 00 35 D7 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 42 6F 6E 75 73 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 F6 00 96 00 71 7C 00 00 36 35 D6 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D6 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 74 00 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 42 6F 6E 75 73 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 AD 01 96 00 71 7C 00 00 36 35 D5 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D5 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 29 01 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 50 65 6E 61 6C 74 79 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 65 02 96 00 71 7C 00 00 36 35 D4 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D4 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 E3 01 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 50 65 6E 61 6C 74 79 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 1E 03 96 00 71 7C 00 00 36 35 D3 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D3 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 9A 02 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 42 6F 6E 75 73 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 D5 03 96 00 71 7C 00 00 36 35 D2 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D2 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 53 03 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 42 6F 6E 75 73 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 8D 04 96 00 71 7C 00 00 36 35 D1 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D1 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 09 04 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 50 65 6E 61 6C 74 79 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 46 05 96 00 71 7C 00 00 36 35 D0 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D0 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 C4 04 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 50 65 6E 61 6C 74 79 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 00 06 96 00 71 7C 00 00 36 35 CF 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 CF 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 7C 05 04 00 72 7C 00 00 04 3A 73 7C 00 00 53 

new hex: (virtual 0x589)
header:
89 7C 00 00 50 55 00 00 00 00 00 00 70 7C 00 00 00 00 00 00 00 00 00 00 74 7C 00 00 00 00 00 00 18 01 00 00 1E 27 00 00 89 05 00 00 3D 04 00 00 

body: 
0F 00 71 7C 00 00 1A 2C 0C 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 07 B6 04 77 01 E8 BB 00 00 2A 16 05 E8 9B 00 00 00 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 0A 68 00 24 02 0A 6D 00 24 03 0A 72 00 24 04 0A 77 00 24 05 0A 7C 00 24 06 0A 90 00 24 07 0F 00 B9 7C 00 00 2C 4A 06 F0 00 0A 95 00 24 08 0A 9A 00 24 09 0A 9F 00 24 0A 0A A4 00 24 0B 0A B8 00 24 0C 0F 00 B9 7C 00 00 2C 4B 06 F0 00 0A BD 00 24 0D 0A C2 00 24 0E 0A C7 00 24 0F 0A CC 00 24 10 0A D1 00 24 11 0A D6 00 24 12 0A EA 00 24 13 0F 00 B9 7C 00 00 2C 54 06 F0 00 0A FF FF 06 F0 00 07 2B 01 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 00 B9 7C 00 00 16 A1 00 71 7C 00 00 2C 01 16 0F 00 BB 7C 00 00 19 01 E8 BB 00 00 0A 00 37 B9 00 00 00 1B 0B 32 00 00 00 00 00 00 16 07 05 02 19 01 E8 BB 00 00 0C 00 4F B9 00 00 00 1B 9A 36 00 00 00 00 00 00 2C 02 16 07 BE 01 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5F 16 A1 00 71 7C 00 00 2C 02 16 07 05 02 19 19 01 E6 7B 00 00 0A 00 EB B2 00 00 00 1B 0A 34 00 00 00 00 00 00 16 0C 00 9E 94 00 00 00 1B 7A 36 00 00 00 00 00 00 24 0F 16 A1 00 71 7C 00 00 2C 01 16 05 1C 7C 00 00 00 1B 1E 35 00 00 00 00 00 00 16 0A 1E 02 24 16 0A 6C 02 24 18 07 69 02 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 2D 16 A1 00 71 7C 00 00 2C 01 16 06 60 03 0A 8D 02 24 19 A1 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 01 16 2C 02 16 16 0A 92 02 24 11 0A E8 02 24 42 07 E5 02 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5E 16 A1 00 71 7C 00 00 1B 3A 33 00 00 00 00 00 00 16 16 06 60 03 0A 12 03 24 3D 07 0F 03 2D 01 25 BC 00 00 A1 00 71 7C 00 00 1B 2F 34 00 00 00 00 00 00 16 16 06 60 03 0A 36 03 24 0C A2 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 01 16 2C 02 16 16 06 60 03 0A 5A 03 24 3E A2 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 03 16 2C 04 16 16 06 60 03 0A FF FF 06 60 03 07 4B 04 2D 01 25 BC 00 00 07 D4 03 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 27 16 A1 00 71 7C 00 00 FA 2C 04 36 19 01 E6 7B 00 00 09 00 9C 30 00 00 00 01 9C 30 00 00 16 16 07 4B 04 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 29 16 07 4B 04 19 01 E6 7B 00 00 0A 00 2F 34 00 00 00 1B BD 5E 00 00 00 00 00 00 16 A1 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 02 16 2C 03 16 16 07 B6 04 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 32 16 07 B6 04 9A 19 01 E8 BB 00 00 09 00 76 A6 00 00 00 01 76 A6 00 00 2C 04 16 A1 00 71 7C 00 00 2C 01 16 07 5E 05 77 1B 38 34 00 00 00 00 00 00 16 2A 16 07 5E 05 19 1B 38 34 00 00 00 00 00 00 16 0A 00 A4 31 00 00 00 1C A5 31 00 00 16 07 5E 05 81 19 1B 38 34 00 00 00 00 00 00 16 13 00 C6 32 00 00 00 1B 5C 3D 00 00 00 00 00 00 01 E6 7B 00 00 16 16 07 5E 05 19 19 1B 38 34 00 00 00 00 00 00 16 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 11 16 A2 00 71 7C 00 00 2C 02 16 04 38 53 00 71 7C 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 3A 73 7C 00 00 53 


--------------------------------------------------------------------------

Rewrite XGTacticalGameCore.CalcOverallDamage to adjust damage randomization, critical damage and second wave option Damage Roulette

XGTacticalGameCore.CalcOverallDamage

original hex:
header:
09 77 00 00 50 55 00 00 00 00 00 00 EC 76 00 00 00 00 00 00 00 00 00 00 F3 76 00 00 00 00 00 00 AC 02 00 00 04 50 00 00 55 02 00 00 A1 01 00 00 

body:
49 02 00 28 15 49 02 00 28 15 0F 00 EE 76 00 00 92 35 A4 0D 00 00 AA 0D 00 00 00 00 10 00 F3 76 00 00 01 94 0F 00 00 00 F2 76 00 00 16 07 7D 00 2D 00 F0 76 00 00 0F 00 EE 76 00 00 38 44 AB 38 3F 00 EE 76 00 00 1E C3 F5 A8 3E 16 04 FA 26 00 EE 76 00 00 16 07 9F 00 1B 8C 71 00 00 00 00 00 00 00 F3 76 00 00 2C 09 16 04 00 EE 76 00 00 07 3D 01 1B F5 3D 00 00 00 00 00 00 24 00 16 0F 00 ED 76 00 00 92 26 12 20 BC 4D 00 00 3E 00 6B 4D 00 00 00 1C 6E 4D 00 00 38 44 AB 38 3F 00 EE 76 00 00 1E 00 00 C0 3F 16 A8 A8 38 57 01 04 FA FF FF 38 57 61 1C 16 16 38 57 1C B5 FC FF FF 16 16 16 16 07 33 01 2D 00 F1 76 00 00 04 92 00 EE 76 00 00 00 ED 76 00 00 16 06 3D 01 04 00 ED 76 00 00 07 CD 01 2D 00 F1 76 00 00 A1 00 EE 76 00 00 26 16 0F 00 EE 76 00 00 38 44 AB 38 3F 00 EE 76 00 00 1E 00 00 C0 3F 16 A1 00 EE 76 00 00 93 12 20 BC 4D 00 00 2C 00 6B 4D 00 00 00 1C 6E 4D 00 00 2C 03 A8 A8 38 57 01 04 FA FF FF 38 57 61 1C 16 16 38 57 1C B5 FC FF FF 16 16 16 26 16 16 04 00 EE 76 00 00 0F 00 EE 76 00 00 93 92 00 EE 76 00 00 12 20 BC 4D 00 00 2C 00 6B 4D 00 00 00 1C 6E 4D 00 00 2C 03 A8 A8 38 57 01 04 FA FF FF 38 57 61 1C 16 16 38 57 1C B5 FC FF FF 16 16 16 16 26 16 07 40 02 96 00 EE 76 00 00 26 16 0F 00 EE 76 00 00 26 04 00 EE 76 00 00 04 3A EF 76 00 00 53 


original hex: (virtual 0x251)
header:
09 77 00 00 50 55 00 00 00 00 00 00 EC 76 00 00 00 00 00 00 00 00 00 00 F3 76 00 00 00 00 00 00 AC 02 00 00 04 50 00 00 51 02 00 00 A1 01 00 00 

body:
49 02 00 28 15 49 02 00 28 15 0F 00 EE 76 00 00 92 35 A4 0D 00 00 AA 0D 00 00 00 00 10 00 F3 76 00 00 01 94 0F 00 00 00 F2 76 00 00 16 07 86 00 2D 00 F0 76 00 00 0F 00 EE 76 00 00 38 44 AB 38 3F 00 EE 76 00 00 1E 7B 14 AE 3E 16 0F 00 EE 76 00 00 FA 26 00 EE 76 00 00 16 07 A8 00 1B 8C 71 00 00 00 00 00 00 00 F3 76 00 00 2C 09 16 04 00 EE 76 00 00 07 C6 00 1B F5 3D 00 00 00 00 00 00 24 00 16 0F 00 BD 77 00 00 2C 04 06 D2 00 0F 00 BD 77 00 00 2C 02 0F 00 ED 76 00 00 12 20 BC 4D 00 00 3E 00 6B 4D 00 00 00 1C 6E 4D 00 00 92 90 00 BD 77 00 00 00 EE 76 00 00 16 2C 02 16 A8 A8 38 57 01 04 FA FF FF 38 57 61 1C 16 16 38 57 1C B5 FC FF FF 16 16 16 07 6D 01 1B F5 3D 00 00 00 00 00 00 24 00 16 07 5E 01 2D 00 F1 76 00 00 0F 00 BE 77 00 00 2C 06 06 6A 01 0F 00 BE 77 00 00 2C 02 06 95 01 07 89 01 2D 00 F1 76 00 00 0F 00 BE 77 00 00 2C 05 06 95 01 0F 00 BE 77 00 00 2C 03 0F 00 BD 77 00 00 91 92 90 00 BE 77 00 00 00 EE 76 00 00 16 2C 01 16 2C 04 16 0F 00 EE 76 00 00 91 92 92 90 00 BE 77 00 00 00 EE 76 00 00 16 2C 01 16 00 ED 76 00 00 16 2C 04 16 07 17 02 2D 00 F1 76 00 00 0F 00 EE 76 00 00 FA 00 BD 77 00 00 00 EE 76 00 00 16 07 31 02 96 00 EE 76 00 00 26 16 0F 00 EE 76 00 00 26 04 00 EE 76 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 3A EF 76 00 00 53  

 

 

 

Here is the full set of features:

 

 

Damage Mod feature list:
Damage variance increases with base damage:
  • 1 damage - no variation
  • 2-5 damage - up to +/- 1
  • 6-9 damage - up to +/- 2
  • 10-13 damage - up to +/- 3
  • etc
Critical hits always average +50% damage, and use same variance as base damage. (effective damage range is 75% to 175% of base damage)
Damage Roulette is supported. Damage variance is doubled. Critical damage is doubled to +100%. (effective damage range is 50% to 250% of base damage)
Perks that adjust damage now affect base damage (before critical bonus and variance applied)
Perks, etc re-implemented:
  • Will To Survive : -2 base damage if in cover and not flanked
  • Killer Instinct : +33% base damage if Run and Gun active and critical hit
  • Bring Em On : +1 base damage per enemy seen (Max +4) if critical hit
  • Disabling Shot : -25% base weapon damage
  • Flush : -50% base weapon damage
  • Headshot : Unchanged from vanilla but now adjusts base damage, making it deadlier
  • Mayhem : Unchanged from vanilla
  • Fire Rocket ability : adds +50% base damage
  • Gunslinger : adds +2 to base damage for pistols
  • Foundry III upgrade : adds +1 to base damage for pistols
New items/perks:
  • Grenade bonus damage : adds +1 damage to Frag Grenade and Alien Grenade abilities
  • Large weapon bonus damage : adds +1 damage to any large weapon (Rifles, Shotguns, LMGs, Sniper Rifles, SHIV Weapons and Rocket Launchers)
  • Ballistic Damage boost item : adds +1 damage to Ballistic Weapons and Rocket Launcher
  • Laser Damage boost item : adds +1 damage to Laser Weapons
  • Plasma Damage boost item : adds +1 damage to Plasma Weapons and Blaster Launcher

 

 

Link to comment
Share on other sites

Gah... keep forgetting to fix that! xD

 

You are correct: the code should be:

            if(m_kUnit.m_kCharacter.HasUpgrade(39))
            {
                I += Min(4, m_kUnit.m_arrVisibleEnemies.Length);
            }

Here is the updated hex code for the function that is in:

 

 

XGAbility_Targeted.TShotInfo_ToString

original hex:
header:
89 7C 00 00 50 55 00 00 00 00 00 00 70 7C 00 00 00 00 00 00 00 00 00 00 74 7C 00 00 00 00 00 00 18 01 00 00 1E 27 00 00 15 06 00 00 3D 04 00 00 

body:
0F 00 72 7C 00 00 70 70 1F 54 53 68 6F 74 49 6E 66 6F 3A 20 54 69 74 6C 65 3D 00 35 D7 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 42 6F 6E 75 73 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 F6 00 96 00 71 7C 00 00 36 35 D6 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D6 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 74 00 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 42 6F 6E 75 73 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 AD 01 96 00 71 7C 00 00 36 35 D5 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D5 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 29 01 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 50 65 6E 61 6C 74 79 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 65 02 96 00 71 7C 00 00 36 35 D4 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D4 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 E3 01 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 50 65 6E 61 6C 74 79 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 1E 03 96 00 71 7C 00 00 36 35 D3 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D3 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 9A 02 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 42 6F 6E 75 73 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 D5 03 96 00 71 7C 00 00 36 35 D2 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D2 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 53 03 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 42 6F 6E 75 73 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 8D 04 96 00 71 7C 00 00 36 35 D1 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D1 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 09 04 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 50 65 6E 61 6C 74 79 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 46 05 96 00 71 7C 00 00 36 35 D0 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D0 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 C4 04 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 50 65 6E 61 6C 74 79 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 00 06 96 00 71 7C 00 00 36 35 CF 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 CF 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 7C 05 04 00 72 7C 00 00 04 3A 73 7C 00 00 53 

new hex: (virtual 0x589)
header:
89 7C 00 00 50 55 00 00 00 00 00 00 70 7C 00 00 00 00 00 00 00 00 00 00 74 7C 00 00 00 00 00 00 18 01 00 00 1E 27 00 00 89 05 00 00 3D 04 00 00 

body: 
0F 00 71 7C 00 00 1A 2C 0C 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 07 B6 04 77 01 E8 BB 00 00 2A 16 05 E8 9B 00 00 00 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 0A 68 00 24 02 0A 6D 00 24 03 0A 72 00 24 04 0A 77 00 24 05 0A 7C 00 24 06 0A 90 00 24 07 0F 00 B9 7C 00 00 2C 4A 06 F0 00 0A 95 00 24 08 0A 9A 00 24 09 0A 9F 00 24 0A 0A A4 00 24 0B 0A B8 00 24 0C 0F 00 B9 7C 00 00 2C 4B 06 F0 00 0A BD 00 24 0D 0A C2 00 24 0E 0A C7 00 24 0F 0A CC 00 24 10 0A D1 00 24 11 0A D6 00 24 12 0A EA 00 24 13 0F 00 B9 7C 00 00 2C 54 06 F0 00 0A FF FF 06 F0 00 07 2B 01 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 00 B9 7C 00 00 16 A1 00 71 7C 00 00 2C 01 16 0F 00 BB 7C 00 00 19 01 E8 BB 00 00 0A 00 37 B9 00 00 00 1B 0B 32 00 00 00 00 00 00 16 07 05 02 19 01 E8 BB 00 00 0C 00 4F B9 00 00 00 1B 9A 36 00 00 00 00 00 00 2C 02 16 07 BE 01 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5F 16 A1 00 71 7C 00 00 2C 02 16 07 05 02 19 19 01 E6 7B 00 00 0A 00 EB B2 00 00 00 1B 0A 34 00 00 00 00 00 00 16 0C 00 9E 94 00 00 00 1B 7A 36 00 00 00 00 00 00 24 0F 16 A1 00 71 7C 00 00 2C 01 16 05 1C 7C 00 00 00 1B 1E 35 00 00 00 00 00 00 16 0A 1E 02 24 16 0A 6C 02 24 18 07 69 02 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 2D 16 A1 00 71 7C 00 00 2C 01 16 06 60 03 0A 8D 02 24 19 A1 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 01 16 2C 02 16 16 0A 92 02 24 11 0A E8 02 24 42 07 E5 02 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5E 16 A1 00 71 7C 00 00 1B 3A 33 00 00 00 00 00 00 16 16 06 60 03 0A 12 03 24 3D 07 0F 03 2D 01 25 BC 00 00 A1 00 71 7C 00 00 1B 2F 34 00 00 00 00 00 00 16 16 06 60 03 0A 36 03 24 0C A2 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 01 16 2C 02 16 16 06 60 03 0A 5A 03 24 3E A2 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 03 16 2C 04 16 16 06 60 03 0A FF FF 06 60 03 07 4B 04 2D 01 25 BC 00 00 07 D4 03 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 27 16 A1 00 71 7C 00 00 F9 2C 04 36 19 01 E6 7B 00 00 09 00 9C 30 00 00 00 01 9C 30 00 00 16 16 07 4B 04 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 29 16 07 4B 04 19 01 E6 7B 00 00 0A 00 2F 34 00 00 00 1B BD 5E 00 00 00 00 00 00 16 A1 00 71 7C 00 00 91 92 00 BB 7C 00 00 2C 02 16 2C 03 16 16 07 B6 04 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 32 16 07 B6 04 9A 19 01 E8 BB 00 00 09 00 76 A6 00 00 00 01 76 A6 00 00 2C 04 16 A1 00 71 7C 00 00 2C 01 16 07 5E 05 77 1B 38 34 00 00 00 00 00 00 16 2A 16 07 5E 05 19 1B 38 34 00 00 00 00 00 00 16 0A 00 A4 31 00 00 00 1C A5 31 00 00 16 07 5E 05 81 19 1B 38 34 00 00 00 00 00 00 16 13 00 C6 32 00 00 00 1B 5C 3D 00 00 00 00 00 00 01 E6 7B 00 00 16 16 07 5E 05 19 19 1B 38 34 00 00 00 00 00 00 16 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 11 16 A2 00 71 7C 00 00 2C 02 16 04 38 53 00 71 7C 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 3A 73 7C 00 00 53  

 

 

 

Also note that the help text says that it is the number of enemies that the squad can see, whereas this function gives bonus damage based on the number of enemies that the unit can see.

Edited by Amineri
Link to comment
Share on other sites

I'm going from memory, but I think disabling shot has a more severe damage penalty than that ... given it's supposed to help with captures. (Just got a "2" possible damage for a laser sniper rifle using disabled shot; believe it's normal possible damage is 7)

 

For what it's worth, I'm going to set it to -67% base damage.

Link to comment
Share on other sites

  • 1 month later...

Hello,Amineri. Tried your Damage Mod, all seems fine, but standard rocket deals 10 damage! Didn't had the opportunity to test shredder rocket, can't say anything about it.

 

It turns out that vanilla was subtracting 33% damage from the base damage defined on the rocket launcher weapon (as defined in the DGC.ini) in the function that I replaced.

 

Rather than subtract 33% (which is a little awkward code-wise), I made the regular rocket deal +50% (much simpler code to squeeze in).

 

What you need to do is adjust the base damage in the DGC.ini on the Rocket Launcher and Blaster Launcher to 4 and 6 respectively. This sets the Shredder Rocket damage. The regular Rockets get +50%, so +2 and +3 to make 6 and 9.

 

If you keep the vanilla Rocket Launcher DGC setting of 6, then you'd get +50% to a base of 9 damage. With the randomization it could easily be 10 :).

Link to comment
Share on other sites

  • 1 month later...

So I'm almost sure I already know the answer here but it's not really feasible code wise to have different critical damage modifiers for different weapons is it?

 

Actually it would be feasible if some way to shoehorn the extra data into the Weapons= entries could be found.

 

That's how I was able to define ammo on a per-weapon basis, by taking over the iSuppression field. The trick is that having used that for ammo there is less space for something else.

 

The critical damage amount is computed in CalcOverallDamage. With the new damage mod it no longer uses a float multiplier, since everything has been shifted to integer-based calculations. Damage Roulette SW option in particular increases the critical damage amount to +100% instead of +50%, so something like that is definitely possible.

 

The code fragment that does this is:

if(IsOptionEnabled(0))
{
if(bCritical)
{
iAbility = 6;
}
else
{
iAbility = 2;
}
}
else
{
if(bCritical)
{
iAbility = 5;
}
else
{
iAbility = 3;
}
}
 

Everything works with multiples of 4 currently (each possible integer damage result has 4 integer results that can generate it). So for non-DR, a non-crit starts with a multipler of 3 (75% of base damage) and then adds the random part (which is always positive). For non-DR, the crit starts with a multiplier of 5 (125% of base damage) and then adds the random part.

 

In contrast, with DR, the non-crit starts at 2 (50%) while the crit starts at 6 (150%).

 

The damage variation amount is set earlier based on DR setting to be either 2 (50% of base damage) or 4 (100% of base damage).

 

Another option would be to use some unused weapon property to flag "high crit damage" weapons from low ones, so instead of having a somewhat smooth progression of crit damage (which there would be no way in the UI to display) to have just two such tiers.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...