Ludeon Forums

Ludeon Forums

  • September 29, 2020, 01:51:48 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [ModCreationHelp] XML codes for Damage Mitigation  (Read 316 times)

HQQ

  • Muffalo
  • *
  • Posts: 7
  • Refugee
    • View Profile
[ModCreationHelp] XML codes for Damage Mitigation
« on: January 19, 2020, 06:19:09 AM »

Hello, I'm trying to create an extra powerful Tough trait that mitigates like 85% of damage instead of 50 to give to some evil monsters, but after checking the Core's Trait.xml file, and researching the coreXML dictionary, there just don't seem to be a way. Is it something that involves C#?
If so, is there a way for me to give a pawn damage mitigation? I'm thinking of the damageMultiplier codes for building, but I'm not sure if it works on RaceDef.
Logged

K

  • Colonist
  • ***
  • Posts: 154
  • Glory to the Machine God!
    • View Profile
Re: [ModCreationHelp] XML codes for Damage Mitigation
« Reply #1 on: January 19, 2020, 10:56:20 AM »

The vanilla game doesn't expose a stat for damage mitigation. The tough trait is hard coded to provide a 50% reduction. It's possible to add a stat for damage mitigation (I've done it in one of my mods) but it will require C# and the use of Harmony. Generally, the implementation I went with was adding a stat and applying that stat in a prefix to the PreApplyDamage method in the Pawn class, so that my damage mitigation worked about the same as the vanilla tough trait.

Also, posts asking for help with mod creation generally go in the help subforum.

HQQ

  • Muffalo
  • *
  • Posts: 7
  • Refugee
    • View Profile
Re: [ModCreationHelp] XML codes for Damage Mitigation
« Reply #2 on: January 19, 2020, 11:01:47 AM »

I see, thanks for the help and the directions!
I think I'll just settle with adding armors for that race instead. I'm a pawn that has Lv0 in Intellectual, with no Passion or Interest in the skill.
Logged

Vanitious

  • Muffalo
  • *
  • Posts: 7
  • Refugee
    • View Profile
Re: [ModCreationHelp] XML codes for Damage Mitigation
« Reply #3 on: February 11, 2020, 07:41:40 AM »

using these for an animal seemed to give it damage reduction in the sense apparel does for colonists. (bottom 3 not all of them)

    <statBases>
      <MoveSpeed>5.5</MoveSpeed>
      <MarketValue>6000</MarketValue>
     <SellPriceFactor>0.30</SellPriceFactor>
      <ComfyTemperatureMin>-165</ComfyTemperatureMin>
      <ComfyTemperatureMax>150</ComfyTemperatureMax>
      <ArmorRating_Sharp>1.55</ArmorRating_Sharp>
      <ArmorRating_Blunt>1.55</ArmorRating_Blunt>
      <ArmorRating_Heat>1.35</ArmorRating_Heat>
    </statBases>

cant say for certain since i never extensively tested it but sure seemed to work and i imagine adding that into a race would do the same since animals base comes from race defs.
Logged