예제 #1
0
    private void enemyAttack(Move move, float eff, bool crit)
    {
        DamageMove dmgMove = (DamageMove)move;
        int        dmg     = dmgMove.getDamage();
        int        totalDamage;

        if (dmgMove.getPhysical())
        {
            // physical move
            float enemyAtk = this.enemy.getCurrentStats().getAtk();
            float garouDef = this.garou.getCurrentStats().getDef();
            totalDamage = (int)Math.Round(dmg * (enemyAtk / garouDef));
        }
        else
        {
            // special
            float enemySpatk = this.enemy.getCurrentStats().getSpatk();
            float garouSpdef = this.garou.getCurrentStats().getSpdef();
            totalDamage = (int)Math.Round(dmg * (enemySpatk / garouSpdef));
        }

        totalDamage = (int)Math.Round(totalDamage * eff);

        if (crit)
        {
            totalDamage = (int)Math.Round(totalDamage * 1.5f);
            //totalDamage *= 2;
        }

        if (dmgMove.getPhysical())
        {
            if (this.enemy.getStatus() == Resources.Status.Burn)
            {
                totalDamage = (int)Math.Round(totalDamage * 0.75f);
            }
            else if (this.enemy.getStatus() == Resources.Status.BadlyBurn)
            {
                totalDamage = (int)Math.Round(totalDamage * 0.5f);
            }
        }

        reduceGarouHealth(totalDamage);
    }
예제 #2
0
    private void enemyAttack(Move move, float eff, bool crit)
    {
        if (move.GetType() == typeof(DamageMove))
        {
            DamageMove dmgMove = (DamageMove)move;
            int        dmg     = dmgMove.getDamage();
            int        totalDamage;

            if (dmgMove.getPhysical())
            {
                // physical move
                float enemyAtk = this.enemy.getCurrentStats().getAtk();
                float garouDef = this.garou.getCurrentStats().getDef();
                totalDamage = (int)Math.Round(dmg * (enemyAtk / garouDef));
            }
            else
            {
                // special
                float enemySpatk = this.enemy.getCurrentStats().getSpatk();
                float garouSpdef = this.garou.getCurrentStats().getSpdef();
                totalDamage = (int)Math.Round(dmg * (enemySpatk / garouSpdef));
            }

            totalDamage = (int)Math.Round(totalDamage * eff);

            if (crit)
            {
                totalDamage = (int)Math.Round(totalDamage * 1.5f);
                //totalDamage *= 2;
            }
            reduceGarouHealth(totalDamage);
            genosDamage.GetComponent <UnityEngine.UI.Text>().text = totalDamage.ToString();
        }
        else if (move.GetType() == typeof(StatusMove))
        {
        }
        else if (move.GetType() == typeof(StatMove))
        {
        }
    }
예제 #3
0
    private void garouAttack(Move move, float eff, bool crit)
    {
        DamageMove dmgMove = (DamageMove)move;
        int        dmg     = dmgMove.getDamage();
        int        totalDamage;

        if (dmgMove.getPhysical())
        {
            // physical move
            float garouAtk = this.garou.getCurrentStats().getAtk();
            float enemyDef = this.enemy.getCurrentStats().getDef();
            totalDamage = (int)Math.Round(dmg * (garouAtk / enemyDef));
        }
        else
        {
            // special
            float garouSpatk = this.garou.getCurrentStats().getSpatk();
            float enemySpdef = this.enemy.getCurrentStats().getSpdef();
            totalDamage = (int)Math.Round(dmg * (garouSpatk / enemySpdef));
        }

        totalDamage = (int)Math.Round(totalDamage * eff);

        if (crit)
        {
            totalDamage = (int)Math.Round(totalDamage * 1.5f);
        }

        if (dmgMove.getPhysical())
        {
            if (this.garou.getStatus() == Resources.Status.Burn)
            {
                totalDamage = (int)Math.Round(totalDamage * 0.75f);
            }
            else if (this.garou.getStatus() == Resources.Status.BadlyBurn)
            {
                totalDamage = (int)Math.Round(totalDamage * 0.5f);
            }
        }

        reduceEnemyHealth(totalDamage);
        //if (move.GetType() == typeof(DamageMove))
        //{

        //}
        //else if (move.GetType() == typeof(StatusMove))
        //{

        //}
        //else if (move.GetType() == typeof(StatMove))
        //{
        //    StatMove statMove = (StatMove)move;
        //    if (statMove.getTarget())
        //    {
        //        // target is enemy
        //    }
        //    else
        //    {
        //        // target is self
        //        if (statMove.getIncrease())
        //        {
        //            // stats go up
        //            Stat garouCurrStats = this.garou.getCurrentStats();
        //            foreach (Resources.StatType s in statMove.getStats())
        //            {
        //                this.garou.changeStat(s, statMove.getFactor());
        //            }
        //            print("madeit");
        //        }
        //        else
        //        {
        //            // stats go down
        //        }
        //    }
        //}
    }