public override void DealDamage(string id, bool isBlocked) { if (!isBlocked) { actionControl.Damage(id, damage, "Sword"); } else { animator.SetTrigger("Deflected"); networkAnimator.SetTrigger("Deflected"); actionControl.Block(id, "Sword"); } }
private void OnTriggerEnter(Collider other) { if (other.transform.root.name == transform.root.name) { return; } GetComponent <Rigidbody>().velocity = Vector3.zero; GameObject tempExplosion = Instantiate(explosion, transform.position, Quaternion.identity); Destroy(this.gameObject, destroyDelay); if (other.tag != "Player") { camShake.ShakeCam(explosionShakeMag, explosionRotMag); return; } if (transform.root.name == "local player") { actionControl.Damage(other.GetComponent <NetworkIdentity>().netId.ToString(), damage, "Magic"); } }