Example #1
0
        public void DoDamage(Action a)
        {
            if (isInvincible)
            {
                return;
            }

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

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

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

            Debug.Log("Damage " + damage + "Poise " + characterStats.poise);

            isInvincible = true;

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

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