Example #1
0
 public PetrolBombMissile(Tower ownerTower, Minion targetMinion) : base(ownerTower, targetMinion)
 {
     movementSpeed = 5.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
     targetPosition = targetMinion.getWorldPosition();
     targetBoard    = targetMinion.position.board;
 }
 public PetrolBombMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 5.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
     targetPosition = targetMinion.getWorldPosition();
     targetBoard = targetMinion.position.board;
 }
Example #3
0
 public NailTrapMissile(Tower ownerTower, Minion targetMinion, float slowAmount, float dmgPerSecond)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 50.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
     targetPosition    = targetMinion.getWorldPosition();
     targetBoard       = targetMinion.position.board;
     this.slowAmount   = slowAmount;
     this.dmgPerSecond = dmgPerSecond;
 }
Example #4
0
 public NailTrapMissile(Tower ownerTower, Minion targetMinion,float slowAmount,float dmgPerSecond)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 50.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
     targetPosition = targetMinion.getWorldPosition();
     targetBoard = targetMinion.position.board;
     this.slowAmount = slowAmount;
     this.dmgPerSecond = dmgPerSecond;
 }
            public Player(string name)
            {
                Name = name;
                if (CurrentPlayer == null)
                {
                    CurrentPlayer = this;
                }

                Board = new Boards.Board(this);

                Nukes = Options.OPTIONS["Nukes"];
            }
        static void AddCursorTo(List <StringBuilder> sbs, Boards.Board board)
        {
            var y_0 = 2 * board.SelectedTile.Coords.Y;
            var x_0 = 5 * board.SelectedTile.Coords.X;

            for (int y = y_0; y < y_0 + BOX_HEIGHT; y++)
            {
                int x = x_0;
                sbs[y][x++] = VERT_THICK;
                if (y == y_0 || y == y_0 + BOX_HEIGHT - 1)
                {
                    for (; x < x_0 + BOX_WIDTH - 1; x++)
                    {
                        sbs[y][x] = HOR_THICK[Convert.ToInt32(y != y_0)];
                    }
                }
                sbs[y][x_0 + BOX_WIDTH - 1] = VERT_THICK;
            }
        }
        public static string Render(this Boards.Board board, bool enemy)
        {
            var sbFinal = new StringBuilder(14400);
            List <StringBuilder> sbs = new List <StringBuilder>();

            for (var y = 0; y < Options.OPTIONS["Board height"]; y++)
            {
                List <StringBuilder> sb = new List <StringBuilder>();
                for (int i = 0; i < BOX_HEIGHT; i++)
                {
                    sb.Add(new StringBuilder());
                }

                for (var x = 0; x < Options.OPTIONS["Board width"]; x++)
                {
                    int BOX_Y = (y == 0 ? 0 : 1);
                    int BOX_X = Convert.ToInt32(x != 0);

                    sb[0].Append(BOX[BOX_Y][BOX_X]);
                    sb[0].Append(new String(HOR, BOX_WIDTH - 2));
                    for (int i = 1; i < BOX_HEIGHT - 1; i++)
                    {
                        sb[i].Append(VERT);
                    }

                    for (int i = 1; i < BOX_HEIGHT - 1; i++)
                    {
                        if (i == (int)Math.Ceiling((float)(BOX_HEIGHT - 2) / 2))
                        {
                            sb[i].Append(GetTileValue(board.Map[y][x], enemy)); // tile value
                        }
                        else
                        {
                            sb[i].Append(new String(' ', BOX_WIDTH - 2));
                        }
                    }

                    if (y + 1 == Options.OPTIONS["Board height"])
                    {
                        sb.Last().Append(BOX[2][BOX_X]);
                        sb.Last().Append(new String(HOR, BOX_WIDTH - 2));
                        if (x + 1 == Options.OPTIONS["Board width"])
                        {
                            sb.Last().Append(BOX[2][2]);
                        }
                    }
                    if (x + 1 == Options.OPTIONS["Board width"])
                    {
                        sb[0].Append(BOX[BOX_Y][2]);
                        for (int i = 1; i < BOX_HEIGHT - 1; i++)
                        {
                            sb[i].Append(VERT);
                        }
                    }
                }
                sbs.Add(sb[0]);
                for (int i = 1; i < BOX_HEIGHT - 1; i++)
                {
                    sbs.Add(sb[i]);
                }
                if (y + 1 == Options.OPTIONS["Board height"])
                {
                    sbs.Add(sb.Last());
                }
            }

            if (!State.TurnEnded)
            {
                AddCursorTo(sbs, board);
            }

            sbFinal.AppendJoin('\n', sbs);
            while (sbFinal[sbFinal.Length - 1] == '\n')
            {
                sbFinal.Remove(sbFinal.Length - 1, 1);
            }
            return(sbFinal.ToString());
        }