Exemple #1
0
    public void RPC_GetDamage(int amount)
    {
        if (isVulnerable && !isWerewolfState && !playerItems.CanDamageArmor(amount))
        {
            currentHp -= amount;
            //photonView.RPC("RPC_PlaySound", RpcTarget.All, "VillegerDeath");
            RPC_PlaySound("VillegerDeath");
        }
        else if (isVulnerable && isWerewolfState)
        {
            currentHp -= amount;
            //photonView.RPC("RPC_PlaySound", RpcTarget.All, "WolfDead");
            RPC_PlaySound("WolfDead");
        }

        if (this.currentHp <= 0 && this.photonView.IsMine)
        {
            this.camera.EnableSpectateMode();
        }

        GameManager.getInstance.CheckWinCondition();
    }