Beispiel #1
0
 /// <summary>
 /// Applies pierce damage to limbs inside of this container. Armor chance is handled inside of ApplyTraumaDamage();
 /// </summary>
 public void TakePierceDamage(float damage)
 {
     foreach (var ContainsLimb in ContainsLimbs)
     {
         ContainsLimb.ApplyTraumaDamage(damage, BodyPart.TramuticDamageTypes.PIERCE);
     }
 }
Beispiel #2
0
 public void TakeBurnDamage(float damage)
 {
     foreach (var ContainsLimb in ContainsLimbs)
     {
         ContainsLimb.ApplyTraumaDamage(damage, BodyPart.TramuticDamageTypes.BURN);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Damages the body parts contained within the body part container. Damage will either be spread evenly across all
 /// contained body parts (spread damage like a shotgun) or dealt to one body part (pinpoint damage like a knife)
 /// Damaged body parts will assign damage to their contained body parts according to BodyPart.TakeDamage.
 /// </summary>
 /// <param name="damagedBy">The player or object that caused the damage. Null if there is none</param>
 /// <param name="damage">Damage amount</param>
 /// <param name="attackType">Type of attack that is causing the damage</param>
 /// <param name="damageType">The type of damage</param>
 /// <param name="damageSplit">Should the damage be divided amongst the contained body parts or applied to a random body part</param>
 public void TakeDamage(
     GameObject damagedBy,
     float damage,
     AttackType attackType,
     DamageType damageType,
     float armorPenetration = 0,
     bool damageSplit       = false
     )
 {
     //Logger.Log("dmg  > " + damage + "attackType > " + attackType + " damageType > " + damageType);
     //This is so you can still hit for example the Second Head of a double-headed thing, can be changed if we find a better solution for aiming at Specific body parts
     if (damageSplit || attackType == AttackType.Bomb || attackType == AttackType.Fire || attackType == AttackType.Rad)
     {
         foreach (var ContainsLimb in ContainsLimbs)
         {
             ContainsLimb.TakeDamage(
                 damagedBy,
                 damage / ContainsLimbs.Count,
                 attackType,
                 damageType,
                 damageSplit,
                 armorPenetration: armorPenetration
                 );
         }
     }
     else
     {
         var OrganToDamage = ContainsLimbs.PickRandom();
         if (OrganToDamage != null)
         {
             OrganToDamage.TakeDamage(
                 damagedBy,
                 damage,
                 attackType,
                 damageType,
                 damageSplit,
                 armorPenetration: armorPenetration
                 );
         }
     }
 }