Author Topic: Idea for a Different calculation of Damage of Armor penetration damage  (Read 2501 times)

Offline Eagleclaws17

  • Sergeant
  • **
  • Posts: 14
    • View Profile
An Idea I had for Armor in the Game is to change the Order Armor Damage Multipliers and Flat damage reduction, so the Damage Reduction would be applied before the Damage multipliers.
Im still fairly new to edit Rulesets of Openxcom (Im playing with the Final Mod Pack if that plays into the Topic), but I know how to change values of existing Items and add new values to them, but I dont know if it is possible to change the way the Game calculates Armor damage reduction, and if it even is how to change it

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: Idea for a Different calculation of Damage of Armor penetration damage
« Reply #1 on: September 15, 2020, 08:18:48 am »
Reduction is already applied before hitting armor amount. Do you want it to change to be applied afterward?

I find the trick to working around it is to do a simple calculation. Let's say for example we want a unit with 60% damage reduction and 40 armor. We want a 50 damage hit to deal 4 damage. You just multiply the armor by the resistance value. So the resistance number is 0.4, therefore we multiply 40 armor by 0.4 and get 16 armor. That's what you write into the ruleset. If the unit gets hit with a 50 damage attack, it is multiplied by 0.4 and we get 20 damage remaining. That 20 damage has 16 removed, and 4 damage is left.

So that's the trick: pick your armor, then multiply it by the primary resistance (or whichever resistance is the most important).

Offline Eagleclaws17

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Idea for a Different calculation of Damage of Armor penetration damage
« Reply #2 on: September 15, 2020, 02:16:17 pm »
To your question, yes, I want Damage multipliers to be applied afterwards, so that not the initial damage gets multiplied, but the Damage after armor penetration.

While your idea is worked pretty good in my test I made it does not work well when I want to have different resistances with different values (40% Plasma Resistance but also 70% Laser Resistance).

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Idea for a Different calculation of Damage of Armor penetration damage
« Reply #3 on: September 15, 2020, 02:21:31 pm »
Yes, damage is modified first by armor resistances and then by armor values.

You can set all armor resistance to 100% so that they don't have any impact and implement your own armor resistances via scripting (script hook "damageUnit") that will be applied after the armor values.

Offline Eagleclaws17

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Idea for a Different calculation of Damage of Armor penetration damage
« Reply #4 on: September 15, 2020, 02:41:30 pm »
Thanks for the Idea, but unfortunatly I dont know how to script yet since I am still a complete rookie when it comes to scripting haha, gotta look up for some guides first