public void Initialize() { equippedPlating = null; columnSize = 14; emptyWeapon = new EmptyWeapon(Game); emptyShield = new EmptyShield(Game); //Initial inventory items BasicLaserWeapon basicLaser = new BasicLaserWeapon(Game, ItemVariety.Regular); BasicEnergyCell regularCell = new BasicEnergyCell(Game, ItemVariety.Regular); BasicPlating regularPlating = new BasicPlating(Game, ItemVariety.Regular); shipItems.Clear(); List <PlayerWeapon> tempPrimary = new List <PlayerWeapon>(); List <PlayerWeapon> tempSecondary = new List <PlayerWeapon>(); shipItems.Add(basicLaser); shipItems.Add(regularCell); shipItems.Add(regularPlating); //Equipped from the beginning primarySlots = 2; Random random = new Random(); equippedPrimaryWeapons.Clear(); equippedPrimaryWeapons.Add(basicLaser); equippedEnergyCell = regularCell; equippedShield = emptyShield; equippedPlating = regularPlating; for (int n = equippedPrimaryWeapons.Count; n < primarySlots; n++) { equippedPrimaryWeapons.Add(emptyWeapon); } equippedSecondary = emptyWeapon; currentPrimaryWeapon = equippedPrimaryWeapons[0]; //Lists with counts for the ShipManager-state equipCounts.Add(equippedPrimaryWeapons.Count); equipCounts.Add(1); equipCounts.Add(1); equipCounts.Add(1); equipCounts.Add(1); UpdateLists(emptyItem); }
public override void Initialize() { Item item = new BasicLaserWeapon(Game, ItemVariety.High); sprite = spriteSheet.GetSubSprite(new Rectangle(724, 1130, 54, 55)); position = new Vector2(110000, 102000); name = "Lonely Asteroid"; base.Initialize(); overworldEvent = new GetItemOE(item, String.Format("Holy crap! A weapon is just floating in space!\n\nYou found {0}!", item.Name), "..But unfortunately, your inventory is full.", "..no more weapons here."); }
// Appends items to item pool public void UpdateItemPool() { Random random = new Random(); Sprite sprite = Game.stateManager.shooterState.spriteSheet; itemPool.Clear(); Item tempItem = null; int itemsToAdd = 3 + random.Next(7) + 1; for (int i = 0; i < itemsToAdd; i++) { switch (random.Next(14)) { case 0: tempItem = new BasicLaserWeapon(this.Game, ItemVariety.Regular); break; case 1: tempItem = new MultipleShotWeapon(this.Game, ItemVariety.Regular); break; case 2: tempItem = new SpreadBulletWeapon(this.Game, ItemVariety.Regular); break; case 3: tempItem = new BeamWeapon(this.Game, ItemVariety.Regular); break; case 4: tempItem = new RegularBombWeapon(this.Game, ItemVariety.Regular); break; case 5: tempItem = new HomingMissileWeapon(this.Game, ItemVariety.Regular); break; case 6: tempItem = new SideMissilesWeapon(this.Game, ItemVariety.Regular); break; case 7: tempItem = new DrillBeamWeapon(this.Game, ItemVariety.Regular); break; case 8: tempItem = new BasicShield(this.Game, ItemVariety.Regular); break; case 9: tempItem = new AdvancedShield(this.Game, ItemVariety.Regular); break; case 10: tempItem = new RegularShield(this.Game, ItemVariety.Regular); break; case 11: tempItem = new BasicEnergyCell(this.Game, ItemVariety.Regular); break; case 12: tempItem = new AdvancedEnergyCell(this.Game, ItemVariety.Regular); break; case 13: tempItem = new RegularEnergyCell(this.Game, ItemVariety.Regular); break; } itemPool.Add(tempItem); } if (itemPool.Count < 14) { int tempCount = itemPool.Count; for (int i = tempCount; i < 14; i++) { itemPool.Add(new EmptyItem(this.Game)); } } }
public static String MapCreatorEquip(int equipNbr) { equippedEnergyCell = new AdvancedEnergyCell(Game); String equipInfo = ""; switch (equipNbr) { case 1: { equippedPrimaryWeapons[0] = new BasicLaserWeapon(Game); equippedPrimaryWeapons[1] = new BasicLaserWeapon(Game); equippedSecondary = new HomingMissileWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new RegularEnergyCell(Game); equippedPlating = new BasicPlating(Game); equippedShield = new EmptyShield(Game); equipInfo += "Starters kit (mission ~1)"; break; } case 2: { equippedPrimaryWeapons[0] = new DualLaserWeapon(Game); equippedPrimaryWeapons[1] = new SpreadBulletWeapon(Game); equippedSecondary = new EmptyWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new BasicEnergyCell(Game); equippedPlating = new BasicPlating(Game); equippedShield = new BasicShield(Game); equipInfo += "Past beginner set (mission ~2)"; break; } case 3: { equippedPrimaryWeapons[0] = new MultipleShotWeapon(Game); equippedPrimaryWeapons[1] = new WaveBeamWeapon(Game); equippedSecondary = new TurretWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new RegularEnergyCell(Game); equippedPlating = new BasicPlating(Game); equippedShield = new BasicShield(Game); equipInfo += "Has reached Fortrun (mission ~3)"; break; } case 4: { equippedPrimaryWeapons[0] = new BeamWeapon(Game); equippedPrimaryWeapons[1] = new MultipleShotWeapon(Game); equippedSecondary = new FieldDamageWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new RegularEnergyCell(Game); equippedPlating = new RegularPlating(Game); equippedShield = new RegularShield(Game); equipInfo += "A bit more progress at Fortrun (mission ~4)"; break; } case 5: { equippedPrimaryWeapons[0] = new FragmentMissileWeapon(Game); equippedPrimaryWeapons[1] = new BeamWeapon(Game); equippedSecondary = new SideMissilesWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new AdvancedEnergyCell(Game); equippedPlating = new RegularPlating(Game); equippedShield = new RegularShield(Game); equipInfo += "Has now reached Rebel Station (mission ~5)"; break; } case 6: { equippedPrimaryWeapons[0] = new BallisticLaserWeapon(Game); equippedPrimaryWeapons[1] = new BursterWeapon(Game); equippedSecondary = new SideMissilesWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new AdvancedEnergyCell(Game); equippedPlating = new RegularPlating(Game); equippedShield = new RegularShield(Game); equipInfo += "Running to Peye (mission ~6+)"; break; } case 7: { equippedPrimaryWeapons[0] = new AdvancedLaserWeapon(Game); equippedPrimaryWeapons[1] = new ProximityLaserWeapon(Game); equippedSecondary = new DisruptorWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new AdvancedEnergyCell(Game); equippedPlating = new RegularPlating(Game); equippedShield = new AdvancedShield(Game); equipInfo += "Getting inaccurate here (mission >6-7)"; break; } case 8: { equippedPrimaryWeapons[0] = new AdvancedBeamWeapon(Game); equippedPrimaryWeapons[1] = new ProximityLaserWeapon(Game); equippedSecondary = new SideMissilesWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new AdvancedEnergyCell(Game); equippedPlating = new AdvancedPlating(Game); equippedShield = new AdvancedShield(Game); equipInfo += "Currently highest tier (mission ~10)"; break; } case 9: { equippedPrimaryWeapons[0] = new AdvancedBeamWeapon(Game); equippedPrimaryWeapons[1] = new BursterWeapon(Game); equippedSecondary = new BursterWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new AdvancedEnergyCell(Game); equippedPlating = new AdvancedPlating(Game); equippedShield = new AdvancedShield(Game); //equippedEnergyCell.Recharge *= 10f; //equippedPlating.Speed *= 3f; //equippedPlating.Armor *= 10f; //equippedShield.Regeneration *= 5f; equipInfo += "What's going on here??"; break; } case 0: { equippedPrimaryWeapons[0] = new LongShotWeapon(Game); equippedPrimaryWeapons[1] = new FlameShotWeapon(Game); equippedSecondary = new DisruptorWeapon(Game); currentPrimaryWeapon = equippedPrimaryWeapons[0]; equippedEnergyCell = new AdvancedEnergyCell(Game); equippedPlating = new AdvancedPlating(Game); equippedShield = new AdvancedShield(Game); equipInfo += "Jakobs testing slot"; break; } } equipInfo += "\n" + equippedPrimaryWeapons[0].Name + "\n" + equippedPrimaryWeapons[1].Name + "\n" + equippedSecondary.Name + "\n" + equippedEnergyCell.Name + "\n" + equippedShield.Name + "\n" + equippedPlating.Name; return(equipInfo); }
public Item GetItemFromSavefile(string section) { float quantity = 0; ItemVariety var; ShipPart fooItem; switch (GetPropertyAsString(section, "name", "error")) { // Weapons case "basic laser": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new BasicLaserWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "beam": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new BeamWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "drill beam": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new DrillBeamWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "flame shot": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new FlameShotWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "multiple shot": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new MultipleShotWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "spread bullet": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new SpreadBulletWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "ballistic laser": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new BallisticLaserWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "minelayer": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new MineLayerWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "advanced laser": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new AdvancedLaserWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "proximity laser": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new ProximityLaserWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "wave beam": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new WaveBeamWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "dual laser": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new DualLaserWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); // Secondary case "homingmissile": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new HomingMissileWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "bomb": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new RegularBombWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "sidemissiles": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new SideMissilesWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "fragmentmissile": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new FragmentMissileWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "puny turret": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new PunyTurretWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "turret": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new TurretWeapon(Game); fooItem.SetShipPartVariety(var); return(fooItem); // Shields case "regular shield": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new RegularShield(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "plasma shield": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new AdvancedShield(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "durable shield": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new BasicShield(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "collision shield": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new CollisionShield(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "bullet shield": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new BulletShield(Game); fooItem.SetShipPartVariety(var); return(fooItem); // Energy case "regular cell": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new RegularEnergyCell(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "durable cell": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new BasicEnergyCell(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "plasma cell": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new AdvancedEnergyCell(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "weapon boost cell": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new WeaponBoostEnergyCell(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "shield boost cell": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new ShieldBoostEnergyCell(Game); fooItem.SetShipPartVariety(var); return(fooItem); // Plating case "regular plating": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new RegularPlating(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "light plating": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new LightPlating(Game); fooItem.SetShipPartVariety(var); return(fooItem); case "heavy plating": var = (ItemVariety)Enum.Parse(typeof(ItemVariety), GetPropertyAsString(section, "variety", "none"), true); fooItem = new HeavyPlating(Game); fooItem.SetShipPartVariety(var); return(fooItem); // Resource case "copper": quantity = Game.saveFile.GetPropertyAsInt(section, "quantity", 0); return(new CopperResource(Game, quantity)); case "gold": quantity = Game.saveFile.GetPropertyAsInt(section, "quantity", 0); return(new GoldResource(Game, quantity)); case "titanium": quantity = Game.saveFile.GetPropertyAsInt(section, "quantity", 0); return(new TitaniumResource(Game, quantity)); // Other items case "fine whiskey": quantity = Game.saveFile.GetPropertyAsInt(section, "quantity", 0); return(new FineWhiskey(Game, quantity)); case "---": return(new EmptyItem(Game)); default: throw new ArgumentException("Not implemented!"); } }