示例#1
0
        public void DoDamage(Action a)
        {
            if (isInvincible)
            {
                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);
                }
            }

            isInvincible         = true;
            anim.applyRootMotion = true;
            anim.SetBool(StaticStrings.canMove, false);
        }
示例#2
0
        public void BeingBackstabbed(Action a)
        {
            int damage = StatsCalculations.CalculateBaseDamage(a.weaponStats, characterStats, a.backstabMultiplier);

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