Jump to content

R&D Damage Mods


Amineri

Recommended Posts

Aaaah, nevermind I won't even bother adding Gunslinger back into the game then, pistols are abit too strange and buggy as standard to make small changes.

 

I'd probably go with a single +2 Damage for Rocket Launcher/Blaster Launcher Item probably with Elerium research.

 

Elerium Rockets - We put some green stuff in your rockets for that extra OOMPH!

Link to comment
Share on other sites

Here's the next release of my prototype damage mod.

 

It includes the rework of the critical damage calculations, damage randomization, perk damage boosts, etc. I slightly reduced the damage variation from my earlier post -- I'll give some examples. Second Wave option Damage Roulette still has an effect, increase the amount of damage randomization (without altering the average damage).

 

Note the possible damage displayed in the UI isn't correct. This appears to be buried pretty deep in the native code so I don't think I'll be able to update it. It underestimates the maximum damage that can be done by high-damage weapons. The only alternative I see is to suppress the damage display entirely by changing the localization strings.

 

Here's the complete 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 0x559)
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 59 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 0B 0B 07 0F 02 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 6A 00 24 02 0A 6F 00 24 03 0A 74 00 24 04 0A 79 00 24 05 0A B5 00 24 06 07 B2 00 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 2C 4A 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A BA 00 24 08 0A BF 00 24 09 0A C4 00 24 0A 0A C9 00 24 0B 0A 05 01 24 0C 07 02 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 2C 4B 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A 0A 01 24 0D 0A 0F 01 24 0E 0A 14 01 24 0F 0A 19 01 24 10 0A 1E 01 24 11 0A 5A 01 24 12 07 57 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 2C 54 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A 5F 01 24 07 0A 09 02 24 13 07 9B 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 2C 54 16 A1 00 71 7C 00 00 2C 03 16 06 06 02 07 D2 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 2C 4B 16 A1 00 71 7C 00 00 2C 02 16 06 06 02 07 06 02 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 2C 4A 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A FF FF 06 0F 02 05 1C 7C 00 00 00 1B 1E 35 00 00 00 00 00 00 16 0A 28 02 24 16 0A 76 02 24 18 07 73 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 7C 02 0A FF FF 06 7C 02 05 1C 7C 00 00 00 1B 1E 35 00 00 00 00 00 00 16 0A 95 02 24 11 0A 9A 02 24 19 0A B4 02 24 42 A1 00 71 7C 00 00 1B 3A 33 00 00 00 00 00 00 16 16 0A FF FF 06 BA 02 07 EF 02 82 9A 1B 1E 35 00 00 00 00 00 00 16 2C 3D 16 18 0B 00 2D 01 25 BC 00 00 16 A1 00 71 7C 00 00 1B 2F 34 00 00 00 00 00 00 16 16 07 65 03 82 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 20 16 18 0B 00 2D 01 25 BC 00 00 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 DF 03 82 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 18 0B 00 2D 01 25 BC 00 00 16 07 DF 03 19 01 E6 7B 00 00 0A 00 2F 34 00 00 00 1B BD 5E 00 00 00 00 00 00 16 9F 00 71 7C 00 00 1E 1F 85 AB 3F 16 07 22 04 9A 1B 1E 35 00 00 00 00 00 00 16 2C 0C 16 A2 00 71 7C 00 00 91 92 19 01 E8 BB 00 00 0A 00 37 B9 00 00 00 1B 0B 32 00 00 00 00 00 00 16 2C 01 16 2C 02 16 16 07 65 04 9A 1B 1E 35 00 00 00 00 00 00 16 2C 3E 16 A2 00 71 7C 00 00 91 92 19 01 E8 BB 00 00 0A 00 37 B9 00 00 00 1B 0B 32 00 00 00 00 00 00 16 2C 03 16 2C 04 16 16 07 F6 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 F6 04 9A 19 01 E6 7B 00 00 09 00 B6 30 00 00 00 01 B6 30 00 00 2C 00 16 07 F6 04 81 19 01 E8 BB 00 00 0C 00 4F B9 00 00 00 1B 9A 36 00 00 00 00 00 00 2C 01 16 16 A1 00 71 7C 00 00 2C 01 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 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 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  

 

 

 

Included:

  • Damage now randomizes approximately +/- 25% of base damage (+/- 50% for Damage Roulette)
  • Criticals average +50% damage, with +/- 25% randomization (+100% critical damage with +/- 50% for Damage Roulette)
  • Effectively : regular hit = 75% to 125%, critical hit = 125% to 175%
  • Damage Roulette : regular hit = 50% to 150%, critical hit = 150% to 250%
  • Critical hits can never be lower than the maximum non-crit hit (can be equal)
  • Explosives currently do not have randomized damage (I plan to add randomization per unit hit later)

New items / perks

  • Still have support for new damage booster items
  • item 74 = +1 damage to ballistic weapons
  • item 75 = +1 damage to laser weapons
  • item 84 = +1 damage to plasma weapons
  • Also add bonus damage to Rocket Launcher / Blaster Launcher
  • Added support for perk that adds +1 damage if unit did not move -- only applies to primary weapon / pistol

 

Reworked application of bonus damage for existing perks -- bonus is now to base damage before critical bonus / randomization :

  • Mayhem still applies to FireRocket, ShredderRocket and Suppression damage
  • Headshot damage bonus applied (if critical hit)
  • Bring Em On now adds +1 damage per enemy unit seen by unit to max of +4 (if critical hit)
  • Killer Instinct adds +34% damage (total +100% crit damage regular, +167% damage with Damage Roulette) (if critical hit)
  • Flush subtracts -50% of weapon base damage (rounded up -- e.g. Assault Rifle is -2 damage)
  • Disabling shot subtracts -25% of weapon base damage (rounded up)

 

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

 

Example damage variation : non-Damage Roulette

 

Base 3 damage (e.g. Assault Rifle, Plasma Pistol)

regular hit : 25% chance of 2 damage, 50% chance of 3 damage, 25% chance of 4 damage

critical hit : 50% chance of 4 damage, 50% chance of 5 damage

 

base 4 damage (e.g. LMG, Shotgun)

regular hit : 30% chance of 3 damage, 40% chance of 4 damage, 30% chance of 5 damage

critical hit : 30% chance of 5 damage, 40% chance of 6 damage, 30% chance of 7 damage

 

base 5 damage (e.g. LPR, Laser Rifle)

regular hit : 33.3% chance of 4 damage, 33.3% chance of 5 damage, 33.3% chance of 6 damage

critical hit : 16.7% chance of 6 damage, 33.3% chance of 7 damage, 33.3% chance of 8 damage, 16.7% chance of 9 damage

 

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

 

The damage formulae I implemented are:

 

regular:

rand_damage = ((3*base_damage) + 1 + Rand(2*base_damage + 2)) / 4
rand_crit_damage = ((5*base_damage) + 1 + Rand(2*base_damage + 2)) / 4
additionally, rand_crit_damage = Max(rand_crit_damage, (5*base_damage + 1)/4)
For second wave option damage roulette, use:
rand_damage = ((2*base_damage) + 1 + Rand(4*base_damage + 2)) / 4
rand_crit_damage = ((6*base_damage) + 1 + Rand(4*base_damage + 2)) / 4
additionally, rand_crit_damage = Max(rand_crit_damage, (6*base_damage + 1) / 4
Link to comment
Share on other sites

 

 

  • Mayhem still applies to FireRocket, ShredderRocket and Suppression damage
  • Headshot damage bonus applied (if critical hit)
  • Bring Em On now adds +1 damage per enemy unit seen by unit to max of +4 (if critical hit)
  • Killer Instinct adds +34% damage (total +100% crit damage regular, +167% damage with Damage Roulette) (if critical hit)
  • Flush subtracts -50% of weapon base damage (rounded up -- e.g. Assault Rifle is -2 damage)
  • Disabling shot subtracts -25% of weapon base damage (rounded up)

 

Would you mind listing the difference from default on these? Bring 'Em On default is up to +5, I believe, and would require a localization change.

Link to comment
Share on other sites

if(m_kUnit.m_kCharacter.HasUpgrade(32) && m_bCritical)
    {
        I += Max(4, m_kUnit.m_arrVisibleEnemies.Length);
    }

I think this is the intended Bring 'Em On line, yes? However, perk 32 is Aggression. I believe this should be 39.

 

EDIT: And shouldn't that be a Min instead of a Max if you want to cap it at 4 bonus Critical Hit damage?

 

And -- sorry, I'm unclear from above -- Is Gunslinger working? How about the Foundry Project Improved Pistol III (+1 damage to pistols) ?

Edited by johnnylump
Link to comment
Share on other sites

On displaying incorrect maximum damage. Probably the easiest fix would be to change the localization files to say "Does up to X damage or more" which is a little confusing but more accurate.

 

Could change X from ipossibledamage to base damage somehow and change localization to say "Does an average of X damage" if I can figure out the localization variable for base damage.

Link to comment
Share on other sites

Shredder Rocket may be an issue. I hit a target for 7 damage with a SR, and even with the randomizers in there, it should only be two to six. It's possible it is instead doing default rocket damage.

 

Edit: Or is this a feature, not a bug? :)

Edited by johnnylump
Link to comment
Share on other sites

Trying to address each post here :) --

 

1) To be honest I'm not completely sure what each of the listed perks does (not in detail, as the code that implements each is written in native code). It's like the ammo mod all over again, trying to blindly replicate functionality without access to the original code.

 

The underlying change is that the damage modifiers for perks, etc are now applied before the critical damage and damage randomization. Before the order was (1) CalcOverallDamage (2) CalcOverallDamageModFromPerk. Now the order is (1) TShotInfo_ToString (helper that calculates delta damage) (2) CalcOverallDamage. This means that perks may effectively work differently than before, because the bonus damage is now multiplied by the 1.5 critical damage multiplier.

 

Here's how I've implemented the existing perks:

  • If the soldier has the perk ePerk_Mayhem, and is using one of abilities eAbility_RocketLauncher, eAbility_ShredderRocket, or eAbility_ShotSuppress, then the native function GetMayhemPerkBonusDamage() is called and the amount it returns is added to the base damage. I don't know what this function does, nor if it was called before, but am hoping it is correct.

 

  • If the soldier is using the ability eAbility_PrecisionShot and the shot is a critical, then the native function GetPrecisionShotPerkDamageDamageAdd() is called and the amount it returns is added to the based damage. Same situation as with Mayhem

 

  • You are right -- I was looking at the eAbilityEffect_BringEmOn, which is 32. Once it is fixed, if the soldier has the perk ePerk_BringEmOn, and the shot is a critical, then m_kUnit.m_arrVisibleEnemies.Length is retrieved and added on to the base damage. Note that a base 5 damage weapon with 5 enemies visible would become base damage 10. Since this is a critical, the average damage result would be 15. This is why I thought it appropriate to cap the max number of enemies at a lower number. I oon't know precisely how this was being implemented before. I am assuming is was similar, but was added after critical damage was applied. Any suggestions as to how to re-work this are appreciated.

 

  • Killer Instinct is currently glitched. Here's what it will do : If the soldier has perk ePerk_KillerInstinct and the shot is a critical and the function RunAndGunActive() returns true, then 34% of the weapon's base damage will be added as bonus damage, fractions rounded up. For a shotgun this changes base damage from 4 to 6, for a scatter laser it changes from 6 to 8, for an alloy cannon it changes from 9 to 12. The new base damage then gets the +50% critical damage amount added on afterwards. This makes a shotgun do 9 damage average, scatter laser 12 damage average, and alloy cannon a rather insane 18 damage average. It felt like enough.

 

  • If the ability is eAbility_ShotFlush, then a penalty of -50% (rounded up) of the weapons base damage (without any other modifiers) is applied. For 3 or 4 damage weapons this is -2. For 5 or 6 damage weapons it is -3. Other perks / items that increase damage can offset this. The -50% does not apply to any bonus damage from other sources -- only to the weapons base damage.

 

  • If the ability is eAbility_DisablingShot, a similar case as with Flush is taken, except that the penalty is -25% (rounded up). Damage 1 to 4 weapons get -1, Damage 5 to 8 get -2. I'm not sure what the damage reduction in vanilla is, but the ability has a -10% to hit, so the -25% seemed roughly right.

 

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

 

I realized that none of the code in the CalcOverallDamageModFromPerks would affect the possible damage display, which means that there is something additional going on with regard to the Gunslinger perks and the Pistol III foundy damage.

 

Unfortunately a lot of the relevant code is native code, so we're kind of groping blindly in the dark here.

 

Looking at where the damage number comes from, the CalcOverallDamage function is pulling damage from : m_arrWeapons[iWeapon].iDamage. This is the raw direct info read from the DGC.ini file. There is no possible tweaking / customization per unit possible here. This means that anything that mods damage has to be added or it won't be applied. This means gunslinger, Foundry pistol damage, shredder rockets, etc.

 

 

Because of all of the unknowns this modlet is going to require a lot of debugging and many people testing it. Hopefully it will be worth it...

 

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

 

The damage is pulled somewhere from the ability data. I tried to find where this is set for the Medikit (it's adjusted for Foundry / Savior), but was unable to find it. The medikit heal amount and weapon possible damage I think are getting set in the same way.

 

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

 

The Shredder Rocket thing is very interesting. I didn't change anything regarding that ability. The CalcOverallDamage function pulls the damage number from m_arrWeapons[iWeapon].iDamage, which I hadn't really thought too deeply about until now. However (as I said above) this is the raw weapon damage as read from the DGC.ini.

 

The weapon ID being passed is using m_kWeapon.GameplayType(). There is another function that returns item IDs for XGItems, which would be m_kWeapon.ItemType(). Changing this might make the alien weapons use the damage value defined in the alien weapon section instead of the generic version. Would have to test it out.

 

So, this means the following have to be adjusted:

  • Gunslinger perk damage
  • Shredder Rocket reduced damage (reduced by 33% I think?)
  • Foundry pistol III damage bonus
  • Sniper bonus critical damage based on weapon tech level
  • ..... anything else I forgot

I'm going to have to tighten up the code a bit in the new helper function to get all of this in. There's a good amount of space so I was a bit sloppy with the item damage booster code. Should have some new stuff posted up.... eventually ^_^

Link to comment
Share on other sites

Oh, I wanted to mention that the damage randomization in the re-written CalcOverallDamage function still uses the SyncRand function, so any random results should be reproducible when loaded from a save-game file.

Link to comment
Share on other sites

With the help of johnnylump I've found another unanticipated side-effect of this damage modlet.

 

It appears that Medikit healing has been somewhat randomized, although it is not following the randomization I implemented. A basic Medikit appears to heal for 3 or 4 HP now (but never 5). My new First Aid Kit item (which removes half the healed amount) now heals for 1 or 2 damage.

 

I really have no idea how this was introduced or why the randomization appears to be only within 3 or 4. With base medikit "damage" of 4, I'd expect to see 3 and 5 "damage" results as well, but it doesn't happen. Also, the iDamage field for the Medikit item is iDamage = 0, so the amount must be getting set in some other way ? The medikit heal amount varies with perks and foundry projects, so it had to be getting adjusted somewhere.

 

Quite mysterious.

 

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

 

Regarding Shredder Rockets -- a 6 base damage item should range from 4 to 8 damage. However, there's only a 1/14 chance of getting 4 damage, and 1/14 chance of getting 8 damage. 5, 6, and 7 damage each have a 4/14 chance of being selected.

 

It definitely appears that the shredder rocket damage has to be adjusted down by 1/3 prior to randomization. Alternatively could make the Rocket Launcher base damage be 4, and then make the Fire Rocket ability grant +50% damage. Blaster Launcher base damage would have to be adjusted to 6 (so would be 9 with +50% for Fire Rocket ability). I'll probably go with the +50% thing as the numbers are easier to compute with less hex.

Edited by Amineri
Link to comment
Share on other sites

  • Recently Browsing   0 members

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