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 }
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; } } }