Example #1
0
 /// <summary>
 /// Creates a backstab action. Backstab does more damage when the target isn't facing the attacker.
 /// </summary>
 /// <param name="factor">
 /// The damage multiplication factor. 2 = double damage
 /// </param>
 /// <returns></returns>
 public static Action <MeleeAttack> Backstab(double factor)
 {
     return(attack => {
         var dmg = attack.AttackDamage;
         if (!PositionUtil.Facing(attack.GetTarget().gameObject.transform, attack.gameObject.transform))
         {
             dmg = (int)(dmg * factor);
         }
         attack.GetTarget().Damage(dmg);
     });
 }