Folks, What do you think about my below analysis how damage could be processed. This is even for vanilla game.
Every type of armor has resistances. Every type of damage has also few parameters.
Formula:
Damage = Weapon Power * armor resistance * random factor
DamageToArmor= Damage * damage to armor factor
armor value = armor value - DamageToArmor
Damage = Damage - armor value
DamageAsStun = Damage * damage as stun factor
DamageAsHP = Damage - DamageAsStun
Health = Health - DamageAsHP * damage as hp factor
StunDamage = StunDamage + DamageAsStun
Lets say we shoot with a pistol 26 AP to a floater (hp 40 and armor 10). Resistance is 80%.
Effective power is then:
20 = 26 * 80%
Then we calculate damage to armor in this area:
4 = 20 * 20%
Which means that armor is now 6 instead of 10. Now calculate damage to unit it self:
14 = 20 - 6
Calculate stun damage from rest of damage:
1 = 14 * 10%
Rest damage goes to HP:
15 = 20 - 4 - 1
Summary:
Alien lost 4 units of armor, 15 HP and 1 stun point. And have 15/12 chance to have a 1-3 wounds.
This would be damage type matrix for vanilla:
ARMOR STUN HP ENERGY WOUND_CHANCE
0 none
1 ap 20% 10% 70% 0% 12
2 fire 20% 20% 60% 0% 10 (fire makes smoke)
3 he 0% 30% 70% 0% 8 (explosives gives more internal wounds)
4 laser 10% 0% 90% 0% 50 (laser surgeon laser does makes wounds or pain)
5 plasma 10% 20% 70% 0% 10 (plasma should be universal for aliens)
6 melee 30% 30% 40% 0% 8 (close combat is brutal)
7 stun 0% 100% 0% 0% 50
8 acid 40% 20% 40% 0% 8 (acid was designed for wounds)
9 smoke 0% 80% 0% 20% 50
Possible new types of damages:
ARMOR STUN HP ENERGY WOUND_CHANCE
10 psi 0% 80% 20% 0% 50 (PSI damage from UFO apocalypse)
11 emp 0% 0% 100% 0% 50 (works only on mechanic units)
12 bio 0% 0% 100% 0% 50 (works only on organic unit)
13 soft 0% 20% 80% 0% 10 (special type for shotguns)
14 slow 0% 20% 0% 80% 50 (usefull to stop units)
15 ent 100% 0% 0% 0% 50 (entropia from ufo apocalypse)
ENERGY loss is optional for any custom damage type.
PS: sorry if such topic was already discussed before. I am going to use this feature in my build anyway.