Ludeon Forums

Ludeon Forums

  • August 17, 2022, 03:06:05 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Solved] Damage skin layer only?  (Read 332 times)


  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile
[Solved] Damage skin layer only?
« on: June 12, 2022, 03:14:40 PM »

Hi, I'm trying to make a flamethrower that deals burn damage to the outmost layer of a pawn.

The code I have for dealing damage looks like this:

BodyPartRecord part = null;
targetPawn.RaceProps.body.GetPartsWithDef(BodyPartDefOf.Body).TryRandomElement(out part);
DamageInfo dmgInfo = new DamageInfo(DamageDefOf.Burn, 1, 1, -1, this.launcher, part);

The problem is that it will also damage internal organs such as heart or brain.

Is there some way to specify to damage only the outmost layer (i.e. torso, limbs, head)?
« Last Edit: June 12, 2022, 03:32:35 PM by simonster99 »