public void RPC_GotAttacked(int dmg, Vector2 dir, int t, PhotonPlayer other) { bool isBlocking = pb.currentCharacter.isBlocking; bool isInvulnerable = pb.currentCharacter.IsInvulnerable; bool isKnockBackImmune = pb.currentCharacter.IsKnockBackImmume; LastHitBy = other; dmg = (int)(dmg / pb.currentCharacter.armor); if (!isInvulnerable) { if (!isBlocking) { PlayerNetwork.Instance.photonView.RPC("PlaySound", PhotonTargets.All, pb.currentCharacter.gotHitAudio); ScoreManager.Instance.view.RPC("RPC_AddDamageTaken", PhotonTargets.MasterClient, pb.netPlayer, other, dmg, t); pb.photonViewer.RPC("RPC_DealDamage", PhotonTargets.All, dmg); if (!isKnockBackImmune) { pb.AddKnockBack(dir, 10 + this.dmg); } } else { PlayerNetwork.Instance.photonView.RPC("PlaySound", PhotonTargets.All, pb.currentCharacter.blockedAudio); ScoreManager.Instance.view.RPC("RPC_AddDamageBlocked", PhotonTargets.MasterClient, pb.netPlayer, dmg); } } }