Example #1
0
    public int GetExperience()
    {
        if (defender.faction == Faction.WORLD)
        {
            return(0);
        }

        //Exp for support skills
        if (type != Type.DAMAGE)
        {
            return((attacker.faction == Faction.PLAYER) ? BattleCalc.GetExperienceSupport(staffAtk, attacker.stats) : 0);
        }

        //Exp for fights
        TacticsMove player = (attacker.faction == Faction.PLAYER) ? attacker : defender;
        TacticsMove enemy  = (attacker.faction == Faction.PLAYER) ? defender : attacker;

        if (!player.IsAlive())
        {
            return(0);
        }

        bool killed = (!enemy.IsAlive());
        bool isBoss = (enemy is NPCMove && ((NPCMove)enemy).aggroType == AggroType.BOSS);

        return(BattleCalc.GetExperienceDamage(player.stats, enemy.stats, killed, isBoss));
    }
    public int GetExperience()
    {
        TacticsMove player = (attacker.faction == Faction.PLAYER) ? attacker : defender;
        TacticsMove enemy  = (attacker.faction == Faction.PLAYER) ? defender : attacker;

        if (!player.IsAlive())
        {
            return(0);
        }

        //Exp for support skills
        if (!isDamage)
        {
            return((player.GetSupport().supportType == SupportType.HEAL) ? 10 : 0);
        }

        //Exp for fights
        bool killed        = (!enemy.IsAlive());
        int  attackerLevel = attacker.stats.level;
        int  defenderLevel = defender.stats.level;

        int ld = attackerLevel - defenderLevel;

        if (ld < 0)
        {
            ld = Mathf.Min(0, ld + 2);
        }

        int gainedExp = (int)((30 + ld) / 3.0f);

        if (killed)
        {
            gainedExp += 20 + (ld * 3);
        }

        return(gainedExp);
    }