Jump to content

Is this possible? Changing damage to be based off % to hit and distance?


Cedwyn

Recommended Posts

I have a desire to make a change to the gameplay but I am unsure if it would even be possible.

 

I would like to mod the game such that all shots hit, but the "% to hit" modifies the damage of the weapon.

 

Ie. A weapon that does 6 damage with a 50% chance to hit would do 3 damage and not miss.

 

Or have this as a non-linear function:

 

Ie. 80-100% hit chance = 1:1 damage ratio, 0-80% hit chance = lower damage overall (exponential function).

 

 

The second change would be to distance, so certain weapons lose damage over distance:

1) Non-linear, similar to above: 0-20m = 100% base damage, 20-40 = linear reduction of damage, ie 100% @ 20m to 0% @ 40m.

2) Explosive weapons deal more damage to targets closer to the center of the explosive. Ie. upto 50% of explosive radius deals 100% damage, else linear function: 50% of radius deals 100% damage, 0% (edge of explosion) deals 25% damage.

 

 

Another area I would like to adjust is crit damage, is this possible?

 

Person in full cover but not flanked is immune to crits (ie. takes 0% of crit damage).

Person in half cover but not flanked takes 33% of crit damage.

Person in no cover but not flanked takes 66% of crit damage.

Person in cover and is flanked takes 100% of crit damage. (Default crit damage)

Person in no cover and is flanked takes 133% of crit damage.

 

 

Thanks for any input!

Link to comment
Share on other sites

This may be possible but would be very complex. A lot of the damage code is in "native" (un-moddable) code, so you might have to rewrite it from scratch, as Amineri has done for Long War. XGUnit.OnTakeDamage () is also a possibility, but I'm not certain you can access the weapon to-hit in that location, as the hit has already taken place.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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