Beispiel #1
0
        public void DoDamage(Action a)
        {
            if (isInviciable)
            {
                return;
            }

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

            characterStats.poise += damage;
            health -= damage;
            if (canMove || characterStats.poise > 50)
            {
                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);
                }
            }
//            Debug.Log(damage + " , " + characterStats.poise);

            isInviciable         = true;
            anim.applyRootMotion = true;
            anim.SetBool(StaticStrings.canMove, false);
        }
Beispiel #2
0
        public void IsGettingBackstabed(Action a)
        {
            int damage = StatsCalculations.CalculateBaseDamage(a.weapenStats, characterStats, a.backstabMultiplier);

            health        -= damage;
            dontDoAnything = true;
            anim.SetBool(StaticStrings.canMove, false);
            anim.Play(StaticStrings.getting_backstabbed);
        }
Beispiel #3
0
        public void IsGettingParried(Action a)
        {
            int damage = StatsCalculations.CalculateBaseDamage(a.weapenStats, characterStats, a.parryMultiplier);

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