Esempio n. 1
0
        public void DoDamage(Action a)
        {
            if (isInvicible)
            {
                return;
            }

            int damage = StatsCalculations.CalculateBaseDamage(a.weaponStats, characterStats);

            characterStats.poise += damage;
            health -= damage;

            if (canMove || characterStats.poise > 100)
            {
                if (a.overrideDamageAnim)
                {
                    anim.Play(a.damageAnim);
                }
                else
                {
                    int    ran = Random.Range(0, 100);
                    string tA  = (ran > 50) ? StaticStrings.damage1 : StaticStrings.damage2;
                    anim.Play(tA);
                }
            }



            isInvicible          = true;
            anim.applyRootMotion = true;
            anim.SetBool(StaticStrings.canMove, false);
        }
Esempio n. 2
0
        public void IsGettingBackstabbed(Action a)
        {
            int damage = StatsCalculations.CalculateBaseDamage(a.weaponStats, characterStats, a.backstabMultiplier);

            health        -= damage;
            dontDoAnything = true;
            anim.SetBool(StaticStrings.canMove, false);
            anim.Play(StaticStrings.backstabbed);
        }