예제 #1
0
파일: Enemy.cs 프로젝트: davidc4747/Robo
        protected virtual void setDrop()
        {
            //Select an Item to drop

            double randNum = rand.NextDouble();

            if (randNum > 0.75f)
            {
                Drop = new HealthPack(Position);
            }
            else if (randNum > 0.65f)
            {
                Drop = new Salvage(Position);
            }
            else if (randNum > 0.40f)
            {
                Drop = new Ammo(Position);
            }
            else if (randNum > 0.30f)
            {
                Drop = new GunItem(Position, this);
            }

            //---Drops---
            //Salvage
            //Health Kit
            //Ammo
            //Bomb
            //~~Money
        }
예제 #2
0
        public void add(Item item)
        {
            if (item.GetType() == typeof(Salvage))
            {
                Salvage salv = (Salvage)item;
                switch (salv.TechType)
                {
                case TechType.HUMAN:
                    HumSalvage += salv.Quantity;
                    break;

                case TechType.ALIEN:
                    AliSalvage += salv.Quantity;
                    break;

                case TechType.ROBOT:
                    RoboSalvage += salv.Quantity;
                    break;
                }
            }
        }