Exemple #1
0
    public bool receiveDMG(double dmg, Vector3 direction)
    {
        ArmorAndWeapons armor     = ArmorUI.GetComponent <ArmorAndWeapons>();
        double          reduction = armor.getProtection();
        double          negDMG    = dmg / 10 * reduction;

        dmg           -= negDMG % 0.5;
        CurrentHealth -= dmg;

        canvasScript.SpawnIndicator(player.transform, direction);

        return(CurrentHealth <= 0);
    }