Esempio n. 1
0
        public void DrawUnitRange(Surface GameSurface, MapCoord Coord, PlayerUnit Unit)
        {
            Circle MaxRange = new Circle(Coord.ToPointMiddle(), (short)Unit.Range);
            GameSurface.Draw(MaxRange, Color.Aqua, true);

            if (Unit.MinusRange != 0)
            {
                Circle MinusRange = new Circle(Coord.ToPointMiddle(), (short)Unit.MinusRange);
                GameSurface.Draw(MinusRange, Color.Red, true);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Add a PlayerUnit to the specified position and class
        /// </summary>
        /// <param name="Coord">Position of Unit</param>
        /// <param name="UnitClass">Class of Unit</param>
        public void AddPlayerUnit(MapCoord Coord, UnitClasses UnitClass)
        {
            if (map.Tiles[Coord.Row][Coord.Column].Type == TileType.Normal && !PlayerUnits.ContainsCoord(Coord))
            {
                if (Gold >= PlayerUnit.LevelCost(1) && UnitClass == UnitClasses.Thieft && PlayerUnits.CountClass(UnitClasses.Thieft) < 4)
                {
                    Gold -= PlayerUnit.LevelCost(1);
                    PlayerUnits.Add(Coord, new Thieft());
                    PlayerUnits[Coord].Position = Coord.ToPointMiddle();
                    Score += 100;
                }
                else if (Gold >= PlayerUnit.LevelCost(1) && UnitClass != UnitClasses.Thieft)
                {
                    Gold -= PlayerUnit.LevelCost(1);
                    Score += 100;

                    if (UnitClass == UnitClasses.Archer)
                    {
                        PlayerUnits.Add(Coord, new Archer());
                        PlayerUnits[Coord].Position = Coord.ToPointMiddle();
                    }
                    else if (UnitClass == UnitClasses.Mage)
                    {
                        PlayerUnits.Add(Coord, new Mage());
                        PlayerUnits[Coord].Position = Coord.ToPointMiddle();
                    }
                    else if (UnitClass == UnitClasses.Soldier)
                    {
                        PlayerUnits.Add(Coord, new Soldier());
                        PlayerUnits[Coord].Position = Coord.ToPointMiddle();
                    }
                    else if (UnitClass == UnitClasses.Paladin)
                    {
                        PlayerUnits.Add(Coord, new Paladin());
                        PlayerUnits[Coord].Position = Coord.ToPointMiddle();
                    }
                }
            }
        }