Esempio n. 1
0
        public Tower(Game g, Player p, Player opponent, Vector2 pos)
        {
            mGame = g;
            Player = p;
            mOpponent = opponent;

            Width = Settings.BOARD_CELL_WIDTH;
            Height = Settings.BOARD_CELL_HEIGHT;
            Position = pos;
            Cost = Costs.BASIC;

            FireRate = 1800; // Settings.DEFAULT_FIRE_RATE * 3;
            Range = Settings.DEFAULT_RANGE * 2;
            Damage = 30;
            SellValue = 7;

            EffectedFireRate = FireRate;
            EffectedDamage = Damage;
            EffectedRange = Range;

            mUpdatedRange = Range;
            mUpdatedRate = FireRate;
            mUpdatedDamage = Damage;

            FireRatePosition = mFireRate;

            StaticTarget = null;
            Enabled = true;
        }
Esempio n. 2
0
        public Wave(GameCode gc, Game game, Player player, Player opponent)
        {
            ID = Guid.NewGuid().ToString();
            mCtx = gc;
            mGame = game;
            mPlayer = player;
            mOpponent = opponent;

            mWaveTimeWindow = Settings.WAVE_WINDOW;
            mWaveTimeElapsed = 0;
            mTimeToNextSpawn = 0;

            Points = 24;

            Started = false;
            SpawnQueue = new Queue<Creep>();
            SpawnTimers = new Dictionary<Creep, long>();
            CreepTypes = new List<String>();

            if (mPlayer == mGame.Black)
            {
                StartingPosition = mGame.Board.WhiteSpawn.Position;
            }
            else
            {
                StartingPosition = mGame.Board.BlackSpawn.Position;
            }
        }
        public AOESlowTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = 75;
            Range = Settings.DEFAULT_RANGE * 2;
            Damage = 0;
            SellValue = 210;

            Type = Tower.SLOW;
        }
        public SniperTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = 1500;
            Range = Settings.DEFAULT_RANGE * 12;
            Damage = Settings.DEFAULT_DAMAGE * 25;
            SellValue = 210;

            Type = Tower.SNIPER;
        }
Esempio n. 5
0
        public SeedTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = Settings.DEFAULT_FIRE_RATE * 30; // every 9 seconds
            Range = Settings.DEFAULT_RANGE * 3;
            Damage = Settings.DEFAULT_DAMAGE * 10;
            SellValue = (int)(Costs.SEED * Costs.RESELL_VALUE);

            Type = Tower.SEED;
        }
        public PulseTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = Settings.DEFAULT_FIRE_RATE * 3;
            Range = Settings.DEFAULT_RANGE * 1.25f;
            Damage = Settings.DEFAULT_DAMAGE * 15;
            SellValue = 210;

            Type = Tower.PULSE;
        }
        public PulseProjectile(Game game, Vector2 position, Player target, int damage, float range)
            : base(game, position, null, damage)
        {
            mOpponent = target;
            mRadius = 0.0f;
            mRange = range;
            Velocity = 5 * Settings.BOARD_CELL_WIDTH;

            Type = "Pulse";
            Ready = false;
        }
        public QuickCreep(Player player, Player opponent, Vector2 pos, Path p)
            : base(player, opponent, pos, p)
        {
            Type = "Quick";

            Speed = DEFAULT_SPEED;
            Damage = DEFAULT_DAMAGE;
            Life = DEFAULT_LIFE;
            StartingLife = Life;
            Points = DEFAULT_POINTS;
        }
        public SwarmCreep(Player player, Player opponent, Vector2 pos, Path p)
            : base(player, opponent, pos, p)
        {
            Type = "Swarm";

            Speed = DEFAULT_SPEED;
            Damage = DEFAULT_DAMAGE;
            Life = (int)DEFAULT_LIFE;
            StartingLife = Life;
            Points = DEFAULT_POINTS;

            Worth = (int)(Worth * 0.25f);
        }
Esempio n. 10
0
        public MagicCreep(Player player, Player opponent, Vector2 pos, Path p)
            : base(player, opponent, pos, p)
        {
            Type = "Magic";

            Speed = 50;
            Damage = DEFAULT_DAMAGE;
            Life = DEFAULT_LIFE;
            StartingLife = Life;

            Points = DEFAULT_POINTS;
            Worth *= DEFAULT_POINTS;
        }
Esempio n. 11
0
        public SpellTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = 750;
            Range = 100;// Settings.DEFAULT_RANGE * 3;
            Damage = 70;
            SellValue = 75;

            EffectedFireRate = FireRate;
            EffectedDamage = Damage;
            EffectedRange = Range;

            Type = Tower.SPELL;
        }
        public RapidFireTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = 200;
            Range = 100;// Settings.DEFAULT_RANGE * 3;
            Damage = 20;
            SellValue = 75;

            EffectedFireRate = FireRate;
            EffectedDamage = Damage;
            EffectedRange = Range;

            Type = Tower.RAPID_FIRE;
        }
        public DamageBoostTower(Game g, Player p, Player opponent, Vector2 pos)
            : base(g, p, opponent, pos)
        {
            FireRate = 0;
            Range = 0;
            Damage = 0;
            SellValue = 210;

            EffectedFireRate = FireRate;
            EffectedDamage = Damage;
            EffectedRange = Range;

            Type = Tower.DAMAGE_BOOST;
        }
Esempio n. 14
0
        public ArmorCreep(Player player, Player opponent, Vector2 pos, Path p)
            : base(player, opponent, pos, p)
        {
            Type = "Armor";

            Speed = DEFAULT_SPEED;
            Damage = DEFAULT_DAMAGE;
            Life = DEFAULT_LIFE;
            StartingLife = Life;

            Points = DEFAULT_POINTS;
            Worth *= DEFAULT_POINTS;

            Armor = DEFAULT_ARMOR;
        }
Esempio n. 15
0
        public Board(Player black, Player white)
        {
            for (int i = 0; i < Height; i++)
            {
                for (int j = 0; j < Width; j++)
                {
                    Cells.Add(new Cell(getIndex(j, i), new Point(j, i), new Point(j * CellWidth + XOffset, i * CellHeight + YOffset)));
                }
            }

            // certain cells are not passable by default since they aren't in the playable area
            setupLists();
            setupCells(black, white);
            setupPathFinding();
        }
Esempio n. 16
0
        public ChigenCreep(Player player, Player opponent, Vector2 pos, Path p)
            : base(player, opponent, pos, p)
        {
            Type = "Chigen";

            Speed = 30;
            Damage = DEFAULT_DAMAGE;
            Life = DEFAULT_LIFE;
            StartingLife = Life;

            Points = DEFAULT_POINTS;
            Worth *= DEFAULT_POINTS;
            Armor = DEFAULT_ARMOR;

            mChiTimer = 3000;
            mChiPosition = 0;

            ChiAdded = 1;
        }
Esempio n. 17
0
        public RegenCreep(Player player, Player opponent, Vector2 pos, Path p)
            : base(player, opponent, pos, p)
        {
            Type = "Regen";

            Speed = DEFAULT_SPEED;
            Damage = DEFAULT_DAMAGE;
            Life = (int)DEFAULT_LIFE;
            StartingLife = Life;

            Points = DEFAULT_POINTS;
            Worth *= DEFAULT_POINTS;

            mRegenTimer = 1000;
            mRegenPosition = 0;

            mLifeRegen = (int)(Life * 0.1f);
            mInitialLife = Life;
            Range = Settings.BOARD_CELL_WIDTH * 4;
        }
Esempio n. 18
0
        public Creep(Player player, Player opponent, Vector2 pos, Path p)
        {
            Player = player;
            mOpponent = opponent;
            CurrentPath = new Path(p);
            Worth = 5;
            Armor = 0;
            Points = 1;

            Height = Settings.BOARD_CELL_HEIGHT;
            Width = Settings.BOARD_CELL_WIDTH;

            Position = pos;

            Alive = true;
            Life = Settings.CREEP_LIFE;
            StartingLife = Life;

            Type = "Basic";
            Active = false;
            mActivationTime = 0;
        }
Esempio n. 19
0
        public Creep getNextCreep(Player p)
        {
            Path path;
            Vector2 v;
            if (p == mGame.Black)
            {
                path = mGame.Board.WhitePath;
                v = mGame.Board.WhiteSpawn.Position;
            }
            else
            {
                path = mGame.Board.BlackPath;
                v = mGame.Board.BlackSpawn.Position;
            }

            int rand = mPlayer.Game.RandomGen.Next(2, 8);

            switch (rand)
            {
                case 2:
                    return new RegenCreep(mPlayer, mOpponent, v, path);
                case 3:
                    return new ChigenCreep(mPlayer, mOpponent, v, path);
                case 4:
                    return new QuickCreep(mPlayer, mOpponent, v, path);
                case 5:
                    return new MagicCreep(mPlayer, mOpponent, v, path);
                case 6:
                    return new ArmorCreep(mPlayer, mOpponent, v, path);
                case 7:
                    return new SwarmCreep(mPlayer, mOpponent, v, path);
                default:
                    return new SwarmCreep(mPlayer, mOpponent, v, path);
            }
        }
Esempio n. 20
0
        private void setupCells(Player black, Player white)
        {
            if (Cells == null)
                return;

            foreach (Cell c in Cells)
            {
                if (blackCellsIndex.Contains(c.Index))
                {
                    c.Passable = true;
                    c.Buildable = true;
                    c.Player = black;

                    BlackCells.Add(c);
                }

                else if (whiteCellsIndex.Contains(c.Index))
                {
                    c.Passable = true;
                    c.Buildable = true;
                    c.Player = white;

                    WhiteCells.Add(c);
                }

                if (c.Index == Settings.DEFAULT_WHITE_SPAWN)
                {
                    c.Passable = true;
                    c.Player = white;
                    WhiteSpawn = c;
                    WhiteCells.Add(c);
                }
                else if (c.Index == Settings.DEFAULT_BLACK_SPAWN)
                {
                    c.Passable = true;
                    c.Player = black;

                    BlackSpawn = c;
                    BlackCells.Add(c);
                }

                if (blackBases.Contains(c.Index))
                {
                    c.Passable = true;
                    c.Player = black;

                    BlackBase.Add(c);
                    BlackCells.Add(c);
                }
                else if (whiteBases.Contains(c.Index))
                {
                    c.Passable = true;
                    c.Player = white;

                    WhiteBase.Add(c);
                    WhiteCells.Add(c);
                }
            }
        }