Example #1
0
        void UnitInListDeath(CombatUnit corpse, EventArgs e)
        {
            for (int i = 0; i < redTeam.Count; i++)
            {
                if (redTeam[i] == corpse)
                {
                    redTeam.Remove(corpse);
                }
            }

            //DEBUG:Console.WriteLine("current red team num = " + redTeam.Count);

            if (redTeam.Count == 0)
            {
                //Console.WriteLine("Blue team win at "+bNum );
                bWin = true;
                //DEBUG:Console.ReadKey();
            }

            for (int i = 0; i < blueTeam.Count; i++)
            {
                if (blueTeam[i] == corpse)
                {
                    blueTeam.Remove(corpse);
                }
            }

            //DEBUG:Console.WriteLine("current blue team num = " + blueTeam.Count);

            if (blueTeam.Count == 0)
            {
                aWin = true;
                //Console.WriteLine("Red team win!");
            }
        }
Example #2
0
        void UnitInListDeath(CombatUnit corpse, EventArgs e)
        {
            for (int i = 0; i < redTeam.Count; i++)
            {
                if (redTeam[i] == corpse)
                {
                    redTeam.Remove(corpse);
                }
            }

            if (redTeam.Count == 0)
            {
                Console.WriteLine("Blue team win at " + bNum);
                bWin = true;
                Console.ReadKey();
            }

            for (int i = 0; i < blueTeam.Count; i++)
            {
                if (blueTeam[i] == corpse)
                {
                    blueTeam.Remove(corpse);
                }
            }



            if (blueTeam.Count == 0)
            {
                Console.WriteLine("Red team win!");
                Console.ReadKey();
            }
        }
Example #3
0
        CombatUnit target;      //Tracking Projectile


        public Projectile(double damage, CombatUnit _target)
        {
            initDamage = damage;
            target     = _target;
            //TODO: Use a method to trigger collide
            Collide();
        }
Example #4
0
        public void SearchTarget(List <CombatUnit> enemies)
        {
            double tarHealth = 999999999;

            if (enemies == null)
            {
                Console.WriteLine("GameEnd");
            }

            foreach (CombatUnit enemy in enemies)
            {
                if (enemy.currentHealth < tarHealth)
                {
                    target    = enemy;
                    tarHealth = enemy.currentHealth;
                }
            }
        }