예제 #1
0
    public int GiveDmg(GhostMoveBase move)
    {
        var mod = Random.Range(0.75f, 1.1f);
        var dmg = 0f;

        if (move.GetMoveType() == moveType.Physical)
        {
            dmg = (((((2 * Level / 5) + 2) * move.getBaseDmg() * Atk / PlayerStat.def) / 50) + 2) * mod;
        }
        else
        {
            dmg = (((((2 * Level / 5) + 2) * move.getBaseDmg() * SAtk / PlayerStat.sdef) / 50) + 2) * mod;
        }
        PlayerStat.health -= Mathf.RoundToInt(dmg);

        return(Mathf.RoundToInt(dmg));
    }
예제 #2
0
    //-----------------------GhostMove----------------------------
    public int TakeDmg(GhostMoveBase move)
    {
        var mod = Random.Range(0.75f, 1.1f);
        var dmg = 0f;

        if (move.GetMoveType() == moveType.Physical)
        {
            dmg = (((((2 * PlayerStat.lvl / 5) + 2) * move.getBaseDmg() * PlayerStat.atk / Def) / 50) + 2) * mod;
        }
        else
        {
            dmg = (((((2 * PlayerStat.lvl / 5) + 2) * move.getBaseDmg() * PlayerStat.satk / SDef) / 50) + 2) * mod;
        }

        HP -= Mathf.RoundToInt(dmg);

        if (HP <= 0)
        {
            HP = 0;
        }

        return(Mathf.RoundToInt(dmg));
    }