OpenXcom Forum

Modding => Work In Progress => Topic started by: NoelBuddy on September 02, 2014, 09:24:47 pm

Title: AP weapons Stun damage?
Post by: NoelBuddy on September 02, 2014, 09:24:47 pm
I've been playing around with MOD ideas and was wondering if someone could explain how the system determines stun damage from weapons that cause health damage?

I was thinking about options for stun weapons causing some actual damage( for example a stun rod that does some health damage from the electric shock, or bad reactions to stun bomb chemicals)  or weapons that cause a nerfed amount of health damage with a disproportionately high amount of stun damage(like rubber bullets they mostly just hurt but there's a good chance they'll knock someone out before they kill them).
Title: Re: AP weapons Stun damage?
Post by: Dioxine on September 02, 2014, 11:16:03 pm
All impossible. Harcoded, nothing a modder can do. Unless you want to work on the code.
Title: Re: AP weapons Stun damage?
Post by: Yankes on September 02, 2014, 11:46:50 pm
I did experimental branch that do exactly that, only drawback is that you need compile it yourself (all changes to ruleset will work only with that exe).

You can get it on:
https://github.com/Yankes/OpenXcom/tree/UnifiedDamageTypes
Title: Re: AP weapons Stun damage?
Post by: NoelBuddy on September 03, 2014, 03:30:21 am
Yankes, what part should I be focusing on to see how damage is handled?
Title: Re: AP weapons Stun damage?
Post by: Yankes on September 03, 2014, 06:57:03 pm
In my branch damage type is defined in "src/Ruleset/RuleDamageType.cpp"
and mainly used in "src/Savegame/BattleUnit.cpp" function `damage(const Position &relative, int power, const RuleDamageType *type)`.
Usage is described in my pull request: https://github.com/SupSuper/OpenXcom/pull/938
Title: Re: AP weapons Stun damage?
Post by: NoelBuddy on September 03, 2014, 08:10:46 pm
THANKS!! I must have been blind.

Quote
https:/// Conversion form power to item damage.
float ToItem;

Hmm... (https://i.imgur.com/jRKCSi9.png)