Пример #1
0
    public int GiveHeal(GhostMoveBase move)
    {
        var heal = (move.getBaseDmg() * MaxHp) / 100;

        HP += (int)heal;

        if (HP >= MaxHp)
        {
            HP = MaxHp;
        }

        return((int)heal);
    }
Пример #2
0
    public void MinusCost(GhostMoveBase moveBase)
    {
        costType type = moveBase.getCostType();
        var      cost = moveBase.getCost();

        if (type == costType.Hp)
        {
            cost = Mathf.Round((moveBase.getCost() + 1 * PlayerStat.maxHealth / 100));
            PlayerStat.health -= (int)cost;
        }
        else
        {
            cost             = Mathf.Round((moveBase.getCost() + 1 * PlayerStat.maxMana / 50));
            PlayerStat.mana -= (int)cost;
        }
    }
Пример #3
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));
    }
Пример #4
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));
    }
Пример #5
0
 public GhostMove(GhostMoveBase pBase)
 {
     Base = pBase;
 }