public DamageInfo(DamageDef def, float amount, float armorPenetration = 0f, float angle = -1f, Thing instigator = null, BodyPartRecord hitPart = null, ThingDef weapon = null, DamageInfo.SourceCategory category = DamageInfo.SourceCategory.ThingOrUnknown, Thing intendedTarget = null)
 {
     this.defInt              = def;
     this.amountInt           = amount;
     this.armorPenetrationInt = armorPenetration;
     if (angle < 0f)
     {
         this.angleInt = (float)Rand.RangeInclusive(0, 359);
     }
     else
     {
         this.angleInt = angle;
     }
     this.instigatorInt             = instigator;
     this.categoryInt               = category;
     this.hitPartInt                = hitPart;
     this.heightInt                 = BodyPartHeight.Undefined;
     this.depthInt                  = BodyPartDepth.Undefined;
     this.weaponInt                 = weapon;
     this.weaponBodyPartGroupInt    = null;
     this.weaponHediffInt           = null;
     this.instantPermanentInjuryInt = false;
     this.allowDamagePropagationInt = true;
     this.intendedTargetInt         = intendedTarget;
 }
Esempio n. 2
0
 public DamageInfo(DamageInfo cloneSource)
 {
     this.defInt                    = cloneSource.defInt;
     this.amountInt                 = cloneSource.amountInt;
     this.angleInt                  = cloneSource.angleInt;
     this.instigatorInt             = cloneSource.instigatorInt;
     this.categoryInt               = cloneSource.categoryInt;
     this.hitPartInt                = cloneSource.hitPartInt;
     this.heightInt                 = cloneSource.heightInt;
     this.depthInt                  = cloneSource.depthInt;
     this.weaponInt                 = cloneSource.weaponInt;
     this.weaponBodyPartGroupInt    = cloneSource.weaponBodyPartGroupInt;
     this.weaponHediffInt           = cloneSource.weaponHediffInt;
     this.instantOldInjuryInt       = cloneSource.instantOldInjuryInt;
     this.allowDamagePropagationInt = cloneSource.allowDamagePropagationInt;
 }