aliens

Author Topic: AP weapons Stun damage?  (Read 4278 times)

Offline NoelBuddy

  • Colonel
  • ****
  • Posts: 142
    • View Profile
AP weapons Stun damage?
« 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).
« Last Edit: September 02, 2014, 09:29:57 pm by NoelBuddy »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: AP weapons Stun damage?
« Reply #1 on: September 02, 2014, 11:16:03 pm »
All impossible. Harcoded, nothing a modder can do. Unless you want to work on the code.
« Last Edit: September 02, 2014, 11:20:30 pm by Dioxine »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: AP weapons Stun damage?
« Reply #2 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

Offline NoelBuddy

  • Colonel
  • ****
  • Posts: 142
    • View Profile
Re: AP weapons Stun damage?
« Reply #3 on: September 03, 2014, 03:30:21 am »
Yankes, what part should I be focusing on to see how damage is handled?
« Last Edit: September 03, 2014, 03:36:43 am by NoelBuddy »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: AP weapons Stun damage?
« Reply #4 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

Offline NoelBuddy

  • Colonel
  • ****
  • Posts: 142
    • View Profile
Re: AP weapons Stun damage?
« Reply #5 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...