public void DealDamage(Health target, Transform user, Vector2 knockbackMultiplierXY, IDInfo IDs, bool knockAway)
 {
     if (target.health != 0) {
         if (!target.invulnerable)
             target.health -= Mathf.Clamp (GetDmg () * target.dmgTaken, Mathf.NegativeInfinity, target.health);
         IDs.Steal ();
         target.GetComponent<Rigidbody> ().velocity = ((target.transform.position - user.position).normalized * knockbackMultiplierXY.x + target.transform.up * knockbackMultiplierXY.y) * knockback;
         if (target.GetComponent<Enemy> ())
             target.GetComponent<Enemy> ().disableWalk = true;
         if (target == Player.Health) {
             EnemyAttack.shakeCam ();
             Punch.PlayHitSound ();
         } else {
             ChangeEnemyCol (Player.Punch.hitCol, target.GetComponent<Enemy> ().rends);
             Punch.PlayHitSound ();
         }
     }
 }
Example #2
0
 public static extern int readCard(ref IDInfo info, int timeOut);
 void Awake()
 {
     S = this;
 }