Example #1
0
 public bool CheckRange(TacticsMove player, bool isAttack)
 {
     if (isAttack)
     {
         WeaponSkill weapon = player.GetWeapon();
         if (weapon == null)
         {
             return(false);
         }
         for (int i = 0; i < enemyList.values.Count; i++)
         {
             int distance = MapCreator.DistanceTo(player, enemyList.values[i]);
             if (weapon.InRange(distance))
             {
                 return(true);
             }
         }
     }
     else
     {
         SupportSkill support = player.GetSupport();
         if (support == null)
         {
             return(false);
         }
         for (int i = 0; i < playerList.values.Count; i++)
         {
             if (!playerList.values[i].IsInjured())
             {
                 continue;
             }
             int distance = MapCreator.DistanceTo(player, playerList.values[i]);
             if (support.InRange(distance))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
    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);
    }
 public int GetHeals()
 {
     return(attacker.GetSupport().power + (int)(attacker.stats.atk * attacker.GetSupport().statsMultiplier));
 }
Example #4
0
    public void FindNeighbours(Queue <MapTile> progress, int currentDistance, TacticsMove tactics, int moveSpeed, bool showAttack, bool isDanger)
    {
        MapTile tile = mapCreator.GetTile(posx - 1, posy);

        if (CheckTile(tile, currentDistance, moveSpeed, tactics.faction, tactics.stats.charClass.classType, tactics.GetWeapon(), tactics.GetSupport(), showAttack, isDanger))
        {
            progress.Enqueue(tile);
        }
        tile = mapCreator.GetTile(posx + 1, posy);
        if (CheckTile(tile, currentDistance, moveSpeed, tactics.faction, tactics.stats.charClass.classType, tactics.GetWeapon(), tactics.GetSupport(), showAttack, isDanger))
        {
            progress.Enqueue(tile);
        }
        tile = mapCreator.GetTile(posx, posy - 1);
        if (CheckTile(tile, currentDistance, moveSpeed, tactics.faction, tactics.stats.charClass.classType, tactics.GetWeapon(), tactics.GetSupport(), showAttack, isDanger))
        {
            progress.Enqueue(tile);
        }
        tile = mapCreator.GetTile(posx, posy + 1);
        if (CheckTile(tile, currentDistance, moveSpeed, tactics.faction, tactics.stats.charClass.classType, tactics.GetWeapon(), tactics.GetSupport(), showAttack, isDanger))
        {
            progress.Enqueue(tile);
        }
    }