Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Threading;
- using System.Web.Script.Serialization;
- namespace spiderbotmk5
- {
- public partial class Gunstoreform : Form
- {
- public Gunstoreform()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- //string programdirectory = "C:/Users/Alex/Dropbox/Gunbot/Gunstore files/Json files/"; // Json location at home
- // string programdirectory = "C:/Users/mazycka/Dropbox/Gunbot/Gunstore files/Json files/"; //Json Location at work
- string programdirectory = Directory.GetCurrentDirectory() + "/"; // Directory for installs
- string gunfile = "Firearms.json"; // File with all of the firearms
- string rocketfile = "Rockets.json"; // File with all of the rocket launchers
- string caliberfile = "Calibers.json"; // A listing of every caliber in Ops and Tactics
- string ammotypefile = "Ammotypes.json"; // All of the Standard Modern Ammotypes
- string manufacturerfile = "Ammomakers.txt"; // The ammomakers in a text file. No need for a Json for these.
- Dictionary<string, List<Firearm>> MasterGunInventory = new Dictionary<string, List<Firearm>>();
- Dictionary<string, List<Rocket>> MasterRocketInventory = new Dictionary<string, List<Rocket>>();
- Dictionary<string, List<Caliber>> MasterCaliberListings = new Dictionary<string, List<Caliber>>();
- Dictionary<string, List<AmmunitionType>> MasterAmmoType = new Dictionary<string, List<AmmunitionType>>();
- Dictionary<string, List<Firearm>> CurrentGunInventory = new Dictionary<string, List<Firearm>>();
- List<string> MasterAmmoMakers = File.ReadAllLines(programdirectory + manufacturerfile).ToList();
- Store GAfiringline = new Store();
- // First thigns first, Scan all of the Jsons to dictionary files, and the ammomaker's file
- using (StreamReader r = new StreamReader(programdirectory + gunfile))
- {
- string json = r.ReadToEnd();
- MasterGunInventory = new JavaScriptSerializer().Deserialize<Dictionary<string, List<Firearm>>>(json);
- }
- using (StreamReader q = new StreamReader(programdirectory + rocketfile))
- {
- string json = q.ReadToEnd();
- MasterRocketInventory = new JavaScriptSerializer().Deserialize<Dictionary<string, List<Rocket>>>(json);
- }
- using (StreamReader s = new StreamReader(programdirectory + caliberfile))
- {
- string json = s.ReadToEnd();
- MasterCaliberListings = new JavaScriptSerializer().Deserialize<Dictionary<string, List<Caliber>>>(json);
- }
- using (StreamReader t = new StreamReader(programdirectory + ammotypefile))
- {
- string json = t.ReadToEnd();
- MasterAmmoType = new JavaScriptSerializer().Deserialize<Dictionary<string, List<AmmunitionType>>>(json);
- }
- StringBuilder InventoryofGuns = new StringBuilder();
- Category Rimfire = new Category();
- Rimfire.CategoryName = "Rimfire";
- Category LightRimless = new Category();
- LightRimless.CategoryName = "Light Rimless";
- Category IntermediateRimless = new Category();
- IntermediateRimless.CategoryName = "Intermediate Rimless";
- Category HeavyRimless = new Category();
- HeavyRimless.CategoryName = "Heavy Rimless";
- Category LightRimmed = new Category();
- LightRimmed.CategoryName = "Light Rimmed";
- Category HeavyRimmed = new Category();
- HeavyRimmed.CategoryName = "Heavy Rimmed";
- Category LightRifle = new Category();
- LightRifle.CategoryName = "Light Rifle";
- Category IntermediateRifle = new Category();
- IntermediateRifle.CategoryName = "Intermediate Rifle";
- Category HeavyRifle = new Category();
- HeavyRifle.CategoryName = "Heavy Rifle";
- Category SuperheavyRifle = new Category();
- SuperheavyRifle.CategoryName = "Superheavy Rifle";
- Category LightShotshell = new Category();
- LightShotshell.CategoryName = "Light Shotshell";
- Category IntermediateShotshell = new Category();
- IntermediateShotshell.CategoryName = "Intermediate Shotshell";
- Category HeavyShotshell = new Category();
- HeavyShotshell.CategoryName = "Heavy Shotshell";
- //Cased
- //0=FMJ, 1=Surplus, 2 JHP, 3 SJHP, 4 SJSP, 5 AP, 6 Incendary, 7 Frang, 8 Non-lethal, 9 Matchgrade, 10 Tracer,11 blank, 12 wadcutter,13 semiwadcutter, 14 Exploding, 15 Solid, 16 Ratshot,
- AmmunitionType FMJ = MasterAmmoType["Cased"][0];
- AmmunitionType Surplus = MasterAmmoType["Cased"][1];
- AmmunitionType JHP = MasterAmmoType["Cased"][2];
- AmmunitionType SJHP = MasterAmmoType["Cased"][3];
- AmmunitionType SJSP = MasterAmmoType["Cased"][4];
- AmmunitionType AP = MasterAmmoType["Cased"][5];
- AmmunitionType IncCased = MasterAmmoType["Cased"][6];
- AmmunitionType FranCased = MasterAmmoType["Cased"][7];
- AmmunitionType NLCased = MasterAmmoType["Cased"][8];
- AmmunitionType Match = MasterAmmoType["Cased"][9];
- AmmunitionType TraceCased = MasterAmmoType["Cased"][10];
- AmmunitionType Blank = MasterAmmoType["Cased"][11];
- AmmunitionType Wad = MasterAmmoType["Cased"][12];
- AmmunitionType SWad = MasterAmmoType["Cased"][13];
- AmmunitionType ExpCased = MasterAmmoType["Cased"][14];
- AmmunitionType Solid = MasterAmmoType["Cased"][15];
- AmmunitionType Rat = MasterAmmoType["Cased"][16];
- // Adds the calibers to categories, and the ammo types to the categories
- //Shell
- //0 00 Buck, 1 #4 Buck, 2 #9 Bird, 3 #6 Bird, 4 #3 Bird, 5 Slug, 6 Wax Slug, 7 Sabo Slug, 8 Mag 00 Buck, 9 Mag #4 Buck, 10 Mag #9 Bird, 11 Mag #6 Bird, 12 Mag #3 Bird, 13 Mag Slug, 14 Mini 00 buck, 15 Mini slug, 16 non-lethal rubber ball, 17 non lethal beanbag, 18 Non lethal rock salt, 19 STun, 20 Frangible #6 Bird, 21 Frangible #3 Bird, 22 frangible 00 buck, 23 Breaching, 24 Blank , 25 Flechette, 26 Tracer, 27 marker, 28 Explosive, 29 OC, 30 Flamethrower, 31 Taser, 32 STrung buck
- AmmunitionType Double00Buck = MasterAmmoType["Shelled"][0];
- AmmunitionType Num4Buck = MasterAmmoType["Shelled"][1];
- AmmunitionType Num9Bird = MasterAmmoType["Shelled"][2];
- AmmunitionType Num6Bird = MasterAmmoType["Shelled"][3];
- AmmunitionType Num3Bird = MasterAmmoType["Shelled"][4];
- AmmunitionType Slug = MasterAmmoType["Shelled"][5];
- AmmunitionType WaxSlug = MasterAmmoType["Shelled"][6];
- AmmunitionType SaboSlug = MasterAmmoType["Shelled"][7];
- AmmunitionType Mag00Buck = MasterAmmoType["Shelled"][8];
- AmmunitionType Mag4Buck = MasterAmmoType["Shelled"][9];
- AmmunitionType Mag9Bird = MasterAmmoType["Shelled"][10];
- AmmunitionType Mag6Bird = MasterAmmoType["Shelled"][11];
- AmmunitionType Mag3Bird = MasterAmmoType["Shelled"][12];
- AmmunitionType MagSlug = MasterAmmoType["Shelled"][13];
- AmmunitionType MiniBuck = MasterAmmoType["Shelled"][14];
- AmmunitionType MiniSlug = MasterAmmoType["Shelled"][15];
- AmmunitionType NL00Buck = MasterAmmoType["Shelled"][16];
- AmmunitionType NLSlug = MasterAmmoType["Shelled"][17];
- AmmunitionType NLSalt = MasterAmmoType["Shelled"][18];
- AmmunitionType Stun = MasterAmmoType["Shelled"][19];
- AmmunitionType Fran6Bird = MasterAmmoType["Shelled"][20];
- AmmunitionType Fran3Bird = MasterAmmoType["Shelled"][21];
- AmmunitionType FranBuck = MasterAmmoType["Shelled"][22];
- AmmunitionType Breach = MasterAmmoType["Shelled"][23];
- AmmunitionType BlankShell = MasterAmmoType["Shelled"][24];
- AmmunitionType Fletch = MasterAmmoType["Shelled"][25];
- AmmunitionType TracerShell = MasterAmmoType["Shelled"][26];
- AmmunitionType Marker = MasterAmmoType["Shelled"][27];
- AmmunitionType ExpShell = MasterAmmoType["Shelled"][28];
- AmmunitionType OC = MasterAmmoType["Shelled"][29];
- AmmunitionType Flame = MasterAmmoType["Shelled"][30];
- AmmunitionType Flare = MasterAmmoType["Shelled"][31];
- AmmunitionType Taser = MasterAmmoType["Shelled"][32];
- AmmunitionType Strung = MasterAmmoType["Shelled"][33];
- //All of the rimfire ammo boxes
- AmmoBox rimfmj = new AmmoBox(FMJ.Name, FMJ, 1, 500, "None");
- AmmoBox rimjhp = new AmmoBox(JHP.Name, JHP, 1, 400, "None");
- AmmoBox rimexp = new AmmoBox(ExpCased.Name, ExpCased, 1, 20, "None");
- AmmoBox rimmatch = new AmmoBox(Match.Name, Match, 1, 50, "None");
- AmmoBox rimtrace = new AmmoBox(TraceCased.Name, TraceCased, 1, 500, "None");
- AmmoBox rimfran = new AmmoBox(FranCased.Name, FranCased, 1, 50, "None");
- AmmoBox rimblank = new AmmoBox(Blank.Name, Blank, 1, 200, "None");
- //adds them to the rifmfire ammo boxes
- Rimfire.AmmoBox.Add(rimfmj);
- Rimfire.AmmoBox.Add(rimjhp);
- Rimfire.AmmoBox.Add(rimexp);
- Rimfire.AmmoBox.Add(rimmatch);
- Rimfire.AmmoBox.Add(rimtrace);
- Rimfire.AmmoBox.Add(rimfran);
- Rimfire.AmmoBox.Add(rimblank);
- //Most of the boxes actually share values, so I'll reuse when I can
- AmmoBox FMJbox = new AmmoBox(FMJ.Name, FMJ, 1, 50, "None"); // Light Rimless, heavy Rimless, Light rimmed, and heavy rimmed all have identical values, so just use one
- AmmoBox SmallSurplusBox = new AmmoBox(Surplus.Name, Surplus, 1, 200, "None"); //Light Rimless and Heavy Rimless have the same surplus values
- AmmoBox SmallJHPBox = new AmmoBox(JHP.Name, JHP, 1, 50, "None"); // Light and intermediate Rimless have the same JHP values
- AmmoBox TinyFranbox = new AmmoBox("FMJ", FMJ, 1, 500, "None"); // Intermediate and heavy rimless use the same frangible values
- AmmoBox lrlfran = new AmmoBox(FranCased.Name, FranCased, 1, 10, "None");
- AmmoBox tinymathcbox = new AmmoBox(Match.Name, Match, 1, 25, "None"); // Light Rimless, intermediate rimless and heavy rimless match all use the same size
- AmmoBox Lrlblank = new AmmoBox(Blank.Name, Blank, 1, 500, "None");
- //Adds them to the Light rimless possible boxes
- LightRimless.AmmoBox.Add(FMJbox);
- LightRimless.AmmoBox.Add(SmallSurplusBox);
- LightRimless.AmmoBox.Add(SmallJHPBox);
- LightRimless.AmmoBox.Add(lrlfran);
- LightRimless.AmmoBox.Add(tinymathcbox);
- LightRimless.AmmoBox.Add(Lrlblank);
- AmmoBox intrimfmj = new AmmoBox(FMJ.Name, FMJ, 1, 100, "None");
- AmmoBox intrmdsur = new AmmoBox(Surplus.Name, Surplus, 1, 400, "None");
- AmmoBox Ratshotbox = new AmmoBox(Rat.Name, Rat, 1, 10, "None"); // Intermediate and heavy Rimless, and light and heavy rimmed all have the same values for ratshot
- AmmoBox tinytracer = new AmmoBox(TraceCased.Name, FMJ, 1, 10, "None"); // Intermediate, and ehavy rimless, and light rimmed and heavy rimmed all use the same tracer box
- AmmoBox tinyblank = new AmmoBox(Blank.Name, Blank, 1, 200, "None"); //int and heavy rimless
- AmmoBox tinyapbox = new AmmoBox(AP.Name, AP, 1, 5, "M&P"); //Int and heavy rimless, light and heavy rimmed
- AmmoBox tinynlcase = new AmmoBox(NLCased.Name, NLCased, 1, 20, "None"); //Int and heavy rimless
- IntermediateRimless.AmmoBox.Add(intrimfmj);
- IntermediateRimless.AmmoBox.Add(intrmdsur);
- IntermediateRimless.AmmoBox.Add(SmallJHPBox);
- IntermediateRimless.AmmoBox.Add(Ratshotbox);
- IntermediateRimless.AmmoBox.Add(TinyFranbox);
- IntermediateRimless.AmmoBox.Add(tinyapbox);
- IntermediateRimless.AmmoBox.Add(tinynlcase);
- IntermediateRimless.AmmoBox.Add(tinymathcbox);
- IntermediateRimless.AmmoBox.Add(tinytracer);
- IntermediateRimless.AmmoBox.Add(tinyblank);
- AmmoBox hvyrmljhp = new AmmoBox(JHP.Name, JHP, 1, 25, "None");
- AmmoBox hvyrmlfran = new AmmoBox(FranCased.Name, FranCased, 1, 25, "None");
- AmmoBox smallswad = new AmmoBox(SWad.Name, SWad, 1, 50, "None"); // heavyrimless, Light and heavy rimmed as well
- AmmoBox hvyrmlsolid = new AmmoBox(Solid.Name, Solid, 1, 5, "None");
- HeavyRimless.AmmoBox.Add(FMJbox);
- HeavyRimless.AmmoBox.Add(SmallSurplusBox);
- HeavyRimless.AmmoBox.Add(hvyrmljhp);
- HeavyRimless.AmmoBox.Add(Ratshotbox);
- HeavyRimless.AmmoBox.Add(hvyrmlfran);
- HeavyRimless.AmmoBox.Add(tinyapbox);
- HeavyRimless.AmmoBox.Add(tinynlcase);
- HeavyRimless.AmmoBox.Add(tinymathcbox);
- HeavyRimless.AmmoBox.Add(tinytracer);
- HeavyRimless.AmmoBox.Add(tinyblank);
- HeavyRimless.AmmoBox.Add(smallswad);
- HeavyRimless.AmmoBox.Add(hvyrmlsolid);
- AmmoBox medsurplus = new AmmoBox(Surplus.Name, Surplus, 1, 100, "None"); // Light and heavy rimmed
- AmmoBox lrmjhp = new AmmoBox(JHP.Name, JHP, 1, 30, "None");
- AmmoBox lrmfran = new AmmoBox(FranCased.Name, FranCased, 1, 30, "None");
- AmmoBox Blankbox = new AmmoBox(Blank.Name, Blank, 1, 100, "None");
- AmmoBox lrsjhp = new AmmoBox(SJHP.Name, SJHP, 1, 30, "None");
- AmmoBox lrshsp = new AmmoBox(SJSP.Name, SJSP, 1, 30, "None");
- AmmoBox smallwads = new AmmoBox(Wad.Name, Wad, 1, 50, "None"); // light and heavy rimmed
- LightRimmed.AmmoBox.Add(FMJbox);
- LightRimmed.AmmoBox.Add(medsurplus);
- LightRimmed.AmmoBox.Add(lrmjhp);
- LightRimmed.AmmoBox.Add(Ratshotbox);
- LightRimmed.AmmoBox.Add(lrmfran);
- LightRimmed.AmmoBox.Add(tinyapbox);
- LightRimmed.AmmoBox.Add(tinytracer);
- LightRimmed.AmmoBox.Add(Blankbox);
- LightRimmed.AmmoBox.Add(lrsjhp);
- LightRimmed.AmmoBox.Add(lrshsp);
- LightRimmed.AmmoBox.Add(smallwads);
- LightRimmed.AmmoBox.Add(smallswad);
- AmmoBox hvyrmjhp = new AmmoBox(JHP.Name, JHP, 1, 20, "None");
- AmmoBox hvyrmfran = new AmmoBox(FranCased.Name, FranCased, 1, 20, "None");
- AmmoBox hvyrmsjhp = new AmmoBox(SJHP.Name, SJHP, 1, 20, "None");
- AmmoBox hvyrmsjsp = new AmmoBox(SJSP.Name, SJSP, 1, 20, "None");
- AmmoBox hvysolid = new AmmoBox(Solid.Name, Solid, 1, 5, "None");
- HeavyRimmed.AmmoBox.Add(FMJbox);
- HeavyRimmed.AmmoBox.Add(medsurplus);
- HeavyRimmed.AmmoBox.Add(hvyrmjhp);
- HeavyRimmed.AmmoBox.Add(Ratshotbox);
- HeavyRimmed.AmmoBox.Add(hvyrmfran);
- HeavyRimmed.AmmoBox.Add(tinyapbox);
- HeavyRimmed.AmmoBox.Add(tinytracer);
- HeavyRimmed.AmmoBox.Add(Blankbox);
- HeavyRimmed.AmmoBox.Add(hvyrmsjhp);
- HeavyRimmed.AmmoBox.Add(hvyrmsjsp);
- HeavyRimmed.AmmoBox.Add(smallwads);
- HeavyRimmed.AmmoBox.Add(smallswad);
- HeavyRimmed.AmmoBox.Add(hvysolid);
- AmmoBox smallriflefmj = new AmmoBox(FMJ.Name, FMJ, 1, 40, "None"); //Light and intermediate rifle
- AmmoBox smallriflesurplus = new AmmoBox(Surplus.Name, Surplus, 1, 160, "None"); //Light and intermediate rifle
- AmmoBox smallriflejhp = new AmmoBox(JHP.Name, JHP, 1, 20, "None"); // Light and intermediate rifle
- AmmoBox smallrifletrace = new AmmoBox(TraceCased.Name, TraceCased, 1, 20, "None"); // Ligh and intermediate
- AmmoBox smallAP = new AmmoBox(AP.Name, AP, 1, 10, "M&P");
- AmmoBox smallmatch = new AmmoBox(Match.Name, Match, 1, 20, "None");
- LightRifle.AmmoBox.Add(smallriflefmj);
- LightRifle.AmmoBox.Add(smallriflesurplus);
- LightRifle.AmmoBox.Add(smallriflejhp);
- LightRifle.AmmoBox.Add(smallrifletrace);
- LightRifle.AmmoBox.Add(Blankbox);
- LightRifle.AmmoBox.Add(smallAP);
- LightRifle.AmmoBox.Add(smallmatch);
- AmmoBox medsolid = new AmmoBox(Solid.Name, Solid, 1, 10, "None");
- AmmoBox lightinc = new AmmoBox(IncCased.Name, IncCased, 1, 5, "M&P");
- IntermediateRifle.AmmoBox.Add(smallriflefmj);
- IntermediateRifle.AmmoBox.Add(smallriflesurplus);
- IntermediateRifle.AmmoBox.Add(smallriflejhp);
- IntermediateRifle.AmmoBox.Add(smallrifletrace);
- IntermediateRifle.AmmoBox.Add(medsolid);
- IntermediateRifle.AmmoBox.Add(hvyrmfran);
- IntermediateRifle.AmmoBox.Add(lightinc);
- IntermediateRifle.AmmoBox.Add(smallAP);
- IntermediateRifle.AmmoBox.Add(smallmatch);
- IntermediateRifle.AmmoBox.Add(smallrifletrace);
- IntermediateRifle.AmmoBox.Add(Blankbox);
- IntermediateRifle.AmmoBox.Add(hvyrmsjsp);
- AmmoBox medriflefmj = new AmmoBox(FMJ.Name, FMJ, 1, 20, "None");
- AmmoBox hvyrflmatch = new AmmoBox(Match.Name, Match, 1, 10, "None");
- AmmoBox hvyrflinc = new AmmoBox(IncCased.Name, IncCased, 1, 10, "M&P");
- AmmoBox hvyrfltrace = new AmmoBox(TraceCased.Name, TraceCased, 1, 30, "None");
- AmmoBox hvyrifleexp = new AmmoBox(ExpCased.Name, ExpCased, 1, 5, "M&P");
- HeavyRifle.AmmoBox.Add(medriflefmj);
- HeavyRifle.AmmoBox.Add(medsurplus);
- HeavyRifle.AmmoBox.Add(lrmjhp);
- HeavyRifle.AmmoBox.Add(hvyrmfran);
- HeavyRifle.AmmoBox.Add(hvyrflmatch);
- HeavyRifle.AmmoBox.Add(hvyrflinc);
- HeavyRifle.AmmoBox.Add(smallAP);
- HeavyRifle.AmmoBox.Add(hvyrfltrace);
- HeavyRifle.AmmoBox.Add(Blankbox);
- HeavyRifle.AmmoBox.Add(hvyrmsjhp);
- HeavyRifle.AmmoBox.Add(hvyrmsjsp);
- HeavyRifle.AmmoBox.Add(hvysolid);
- AmmoBox shfmj = new AmmoBox(FMJ.Name, FMJ, 1, 10, "None");
- AmmoBox shsurp = new AmmoBox(Surplus.Name, Surplus, 1, 40, "None");
- AmmoBox shjhp = new AmmoBox(JHP.Name, JHP, 1, 10, "None");
- AmmoBox shfran = new AmmoBox(FranCased.Name, FranCased, 1, 10, "None");
- AmmoBox shmatch = new AmmoBox(Match.Name, Match, 1, 5, "None");
- AmmoBox shinc = new AmmoBox(IncCased.Name, IncCased, 1, 5, "M&P");
- AmmoBox shap = new AmmoBox(AP.Name, AP, 1, 5, "M&P");
- AmmoBox shblank = new AmmoBox(Blank.Name, Blank, 1, 20, "None");
- AmmoBox shexp = new AmmoBox(ExpCased.Name, ExpCased, 1, 1, "M&P");
- AmmoBox shsolid = new AmmoBox(Solid.Name, Solid, 1, 5, "None");
- SuperheavyRifle.AmmoBox.Add(shfmj);
- SuperheavyRifle.AmmoBox.Add(shsurp);
- SuperheavyRifle.AmmoBox.Add(shjhp);
- SuperheavyRifle.AmmoBox.Add(shfran);
- SuperheavyRifle.AmmoBox.Add(shmatch);
- SuperheavyRifle.AmmoBox.Add(shinc);
- SuperheavyRifle.AmmoBox.Add(shap);
- SuperheavyRifle.AmmoBox.Add(shblank);
- SuperheavyRifle.AmmoBox.Add(shexp);
- SuperheavyRifle.AmmoBox.Add(shsolid);
- AmmoBox lightshot00 = new AmmoBox(Double00Buck.Name, Double00Buck, 1, 25, "None");
- AmmoBox lightshotno4buck = new AmmoBox(Num4Buck.Name, Num4Buck, 1, 25, "None");
- AmmoBox lightshotno6bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 40, "None");
- AmmoBox lightshotno3bird = new AmmoBox(Num3Bird.Name, Num3Bird, 1, 20, "None");
- AmmoBox lightshotrocks = new AmmoBox(NLSalt.Name, NLSalt, 1, 50, "None");
- AmmoBox lightshotslug = new AmmoBox(Slug.Name, Slug, 1, 10, "None");
- AmmoBox lightshotfran00 = new AmmoBox(FranBuck.Name, FranBuck, 1, 10, "None");
- AmmoBox lightshotfran3bird = new AmmoBox(Fran3Bird.Name, Fran3Bird, 1, 20, "None");
- AmmoBox lightshotsaboslug = new AmmoBox(SaboSlug.Name, SaboSlug, 1, 25, "None");
- AmmoBox lightshotwax = new AmmoBox(WaxSlug.Name, WaxSlug, 1, 20, "None");
- AmmoBox lightshotblank = new AmmoBox(BlankShell.Name, BlankShell, 1, 20, "None");
- AmmoBox lightshotmarker = new AmmoBox(Marker.Name, Marker, 1, 25, "None");
- LightShotshell.AmmoBox.Add(lightshot00);
- LightShotshell.AmmoBox.Add(lightshotno4buck);
- LightShotshell.AmmoBox.Add(lightshotno6bird);
- LightShotshell.AmmoBox.Add(lightshotno3bird);
- LightShotshell.AmmoBox.Add(lightshotrocks);
- LightShotshell.AmmoBox.Add(lightshotslug);
- LightShotshell.AmmoBox.Add(lightshotfran00);
- LightShotshell.AmmoBox.Add(lightshotfran3bird);
- LightShotshell.AmmoBox.Add(lightshotfran3bird);
- LightShotshell.AmmoBox.Add(lightshotsaboslug);
- LightShotshell.AmmoBox.Add(lightshotwax);
- LightShotshell.AmmoBox.Add(lightshotblank);
- LightShotshell.AmmoBox.Add(lightshotmarker);
- AmmoBox intershotno4buck = new AmmoBox(Num4Buck.Name, Num4Buck, 1, 30, "None");
- AmmoBox intershotno9bird = new AmmoBox(Num9Bird.Name, Num9Bird, 1, 100, "None");
- AmmoBox intershotno6bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 100, "None");
- AmmoBox intershotno3bird = new AmmoBox(Num3Bird.Name, Num3Bird, 1, 100, "None");
- AmmoBox intershotnlbean = new AmmoBox(NLSlug.Name, NLSlug, 1, 5, "None");
- AmmoBox intershotnlball = new AmmoBox(NL00Buck.Name, NL00Buck, 1, 20, "None");
- AmmoBox intershotnlrock = new AmmoBox(NLSalt.Name, NLSalt, 1, 200, "None");
- AmmoBox intershotslug = new AmmoBox(Slug.Name, Slug, 1, 20, "None");
- AmmoBox intershotoc = new AmmoBox(OC.Name, OC, 1, 10, "R");
- AmmoBox intershotsaboslug = new AmmoBox(SaboSlug.Name, SaboSlug, 1, 10, "None");
- AmmoBox intershottrace = new AmmoBox(TracerShell.Name, TracerShell, 1, 10, "None");
- AmmoBox intershottaser = new AmmoBox(Taser.Name, Taser, 1, 5, "R");
- AmmoBox intershotfran00 = new AmmoBox(FranBuck.Name, FranBuck, 1, 5, "None");
- AmmoBox intershotfran6 = new AmmoBox(Fran6Bird.Name, Fran6Bird, 1, 10, "None");
- AmmoBox intershotfran3 = new AmmoBox(Fran3Bird.Name, Fran3Bird, 1, 10, "None");
- AmmoBox intershotbreach = new AmmoBox(Breach.Name, Breach, 1, 5, "None");
- AmmoBox intershotexp = new AmmoBox(ExpShell.Name, ExpShell, 4, 1, "M&P");
- AmmoBox intershotflame = new AmmoBox(Flame.Name, Flame, 2, 3, "None");
- AmmoBox intershotflare = new AmmoBox(Flare.Name, Flare, 1, 3, "None");
- AmmoBox intershotstun = new AmmoBox(Stun.Name, Stun, 1, 2, "R");
- AmmoBox intershotstrung = new AmmoBox(Strung.Name, Strung, 1, 4, "None");
- AmmoBox intershotmag00 = new AmmoBox(Mag00Buck.Name, Mag00Buck, 1, 10, "None");
- AmmoBox intershotmagno4 = new AmmoBox(Mag4Buck.Name, Mag4Buck, 1, 10, "None");
- AmmoBox intershotmag9bird = new AmmoBox(Mag9Bird.Name, Mag9Bird, 1, 50, "None");
- AmmoBox intershotmag6bird = new AmmoBox(Mag6Bird.Name, Mag6Bird, 1, 25, "None");
- AmmoBox intershotmag3bird = new AmmoBox(Mag3Bird.Name, Mag3Bird, 1, 15, "None");
- AmmoBox intershotmagslug = new AmmoBox(MagSlug.Name, MagSlug, 1, 5, "None");
- AmmoBox intershotmini00 = new AmmoBox(MiniBuck.Name, MiniBuck, 1, 25, "None");
- AmmoBox intershotminislug = new AmmoBox(MiniSlug.Name, MiniSlug, 1, 25, "None");
- AmmoBox intershotwax = new AmmoBox(WaxSlug.Name, WaxSlug, 1, 25, "None");
- AmmoBox intershotmarker = new AmmoBox(Marker.Name, Marker, 1, 25, "None");
- IntermediateShotshell.AmmoBox.Add(lightshot00);
- IntermediateShotshell.AmmoBox.Add(intershotno4buck);
- IntermediateShotshell.AmmoBox.Add(intershotno9bird);
- IntermediateShotshell.AmmoBox.Add(intershotno6bird);
- IntermediateShotshell.AmmoBox.Add(intershotno3bird);
- IntermediateShotshell.AmmoBox.Add(intershotnlbean);
- IntermediateShotshell.AmmoBox.Add(intershotnlball);
- IntermediateShotshell.AmmoBox.Add(intershotnlrock);
- IntermediateShotshell.AmmoBox.Add(intershotslug);
- IntermediateShotshell.AmmoBox.Add(intershotoc);
- IntermediateShotshell.AmmoBox.Add(intershotsaboslug);
- IntermediateShotshell.AmmoBox.Add(lightshotblank);
- IntermediateShotshell.AmmoBox.Add(intershottrace);
- IntermediateShotshell.AmmoBox.Add(intershottaser);
- IntermediateShotshell.AmmoBox.Add(intershotfran00);
- IntermediateShotshell.AmmoBox.Add(intershotfran6);
- IntermediateShotshell.AmmoBox.Add(intershotfran3);
- IntermediateShotshell.AmmoBox.Add(intershotbreach);
- IntermediateShotshell.AmmoBox.Add(intershotexp);
- IntermediateShotshell.AmmoBox.Add(intershotflame);
- IntermediateShotshell.AmmoBox.Add(intershotflare);
- IntermediateShotshell.AmmoBox.Add(intershotstun);
- IntermediateShotshell.AmmoBox.Add(intershotstrung);
- IntermediateShotshell.AmmoBox.Add(intershotmag00);
- IntermediateShotshell.AmmoBox.Add(intershotmagno4);
- IntermediateShotshell.AmmoBox.Add(intershotmag9bird);
- IntermediateShotshell.AmmoBox.Add(intershotmag6bird);
- IntermediateShotshell.AmmoBox.Add(intershotmag3bird);
- IntermediateShotshell.AmmoBox.Add(intershotmagslug);
- IntermediateShotshell.AmmoBox.Add(intershotmini00);
- IntermediateShotshell.AmmoBox.Add(intershotminislug);
- IntermediateShotshell.AmmoBox.Add(intershotwax);
- IntermediateShotshell.AmmoBox.Add(intershotmarker);
- AmmoBox heavyshot6bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 50, "None");
- AmmoBox heavyshot3bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 25, "None");
- HeavyShotshell.AmmoBox.Add(lightshot00);
- HeavyShotshell.AmmoBox.Add(intershotno4buck);
- HeavyShotshell.AmmoBox.Add(intershotno9bird);
- HeavyShotshell.AmmoBox.Add(heavyshot6bird);
- HeavyShotshell.AmmoBox.Add(heavyshot3bird);
- HeavyShotshell.AmmoBox.Add(intershotslug);
- HeavyShotshell.AmmoBox.Add(intershotmag00);
- HeavyShotshell.AmmoBox.Add(intershotmagno4);
- HeavyShotshell.AmmoBox.Add(intershotmag9bird);
- HeavyShotshell.AmmoBox.Add(intershotmag6bird);
- HeavyShotshell.AmmoBox.Add(intershotmag3bird);
- HeavyShotshell.AmmoBox.Add(intershotmagslug);
- foreach (List<Caliber> cals in MasterCaliberListings.Values)
- {
- foreach (Caliber entry in cals.ToList())
- {
- if (entry.AmmunitionGroup == "Rimfire")
- {
- Rimfire.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Light Rimless")
- {
- LightRimless.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Light Rimless")
- {
- LightRimless.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Intermediate Rimless")
- {
- IntermediateRimless.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Heavy Rimless")
- {
- HeavyRifle.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Light Rimmed")
- {
- LightRimmed.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Heavy Rimmed")
- {
- HeavyRimmed.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Light Rifle")
- {
- LightRifle.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Heavy Rifle")
- {
- HeavyRifle.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Superheavy Rifle")
- {
- SuperheavyRifle.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Light Shotshell")
- {
- LightShotshell.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Intermediate Shotshell")
- {
- IntermediateShotshell.IncludedCalibers.Add(entry);
- }
- else if (entry.AmmunitionGroup == "Heavy Shotshell")
- {
- HeavyShotshell.IncludedCalibers.Add(entry);
- }
- }
- }
- Random roller = new Random();
- Random roller2 = new Random();
- Random roller3 = new Random();
- Random roller4 = new Random();
- Random roller5 = new Random();
- Random roller6 = new Random();
- Random roller7 = new Random();
- Random roller8 = new Random();
- Random roller9 = new Random();
- Random roller10 = new Random();
- Random handgunroller = new Random();
- Random PDWroller = new Random();
- Random rifleroller = new Random();
- Random shotgunroller = new Random();
- Random mgroller = new Random();
- Random rocketroller = new Random();
- Random glroller = new Random();
- // This basically checks the restrictor slider to see what guns are actually allowed
- switch (RestrictionTrackbar.Value)
- {
- case 1: // No license. This doesn't work so I had to remove it. So it does nothing.
- {
- foreach (List<Firearm> list in MasterGunInventory.Values)
- {
- foreach (Firearm entry in list.ToList())
- {
- if (list.Count != 0)
- {
- if (entry.License == "L" || entry.License == "R" || entry.License == "M&P" || entry.License == "I")
- {
- list.Remove(entry);
- }
- }
- }
- }
- }
- break;
- case 2: // Licensed only
- {
- foreach (List<Firearm> list in MasterGunInventory.Values)
- {
- foreach (Firearm entry in list.ToList())
- {
- if (entry.License == "R" || entry.License == "M&P" || entry.License == "I")
- {
- list.Remove(entry);
- }
- }
- }
- }
- break;
- case 3: // Licensed and restricted only
- {
- foreach (List<Firearm> list in MasterGunInventory.Values)
- {
- foreach (Firearm entry in list.ToList())
- {
- if (entry.License == "M&P" || entry.License == "I")
- {
- list.Remove(entry);
- }
- }
- }
- }
- break;
- case 4: // Licensed restricted and MP only
- {
- foreach (List<Firearm> list in MasterGunInventory.Values)
- {
- foreach (Firearm entry in list.ToList())
- {
- if (entry.License == "I")
- {
- list.Remove(entry);
- }
- }
- }
- }
- break;
- case 5: // All guns available! I need this here becasue it breaks if I don't, for some reason
- {
- }
- break;
- default:
- {
- }
- break;
- }
- int handgunfinish = new int();
- int pdwfinish = new int();
- int riflefinish = new int();
- int shotgunfinish = new int();
- int mgfinish = new int();
- int rocketfinish = new int();
- int glfinish = new int();
- switch (WealthTrackbar.Value)
- {
- case 1: // Cheap guns!
- {
- List<string> handgunarray = new List<string>();
- List<string> shotgunarray = new List<string>();
- List<string> riflearray = new List<string>();
- List<string> pdwarray = new List<string>();
- //Cheap guns don't need a bellcurve roll because they're all cheapguns
- handgunarray.Add("cheapmodholdout");
- handgunarray.Add("cheapmodbackup");
- handgunarray.Add("cheapmodfull");
- handgunarray.Add("cheapmodtarget");
- shotgunarray.Add("cheapmodcombat");
- shotgunarray.Add("cheapmodsport");
- riflearray.Add("cheapmodassault");
- riflearray.Add("cheapmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- pdwarray.Add("cheapmodmp");
- pdwarray.Add("cheapmodsmg");
- int handcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(HandgunTrackbar.Value) * .5), HandgunTrackbar.Value);
- int PDWcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(PDWTrackbar.Value) * .5), PDWTrackbar.Value);
- int riflecounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RifleTrackbar.Value) * .5), RifleTrackbar.Value);
- int shotguncounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(ShotgunTrackbar.Value) * .5), ShotgunTrackbar.Value);
- int whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
- int whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
- int whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
- int whichrifle = rifleroller.Next(0, riflearray.Count - 1);
- if (handcounter > 0)
- {
- handgunfinish = handcounter;
- }
- if (PDWcounter > 0)
- {
- pdwfinish = PDWcounter;
- }
- if (shotguncounter > 0)
- {
- shotgunfinish = shotguncounter;
- }
- if (riflecounter > 0)
- {
- riflefinish = riflecounter;
- }
- int handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
- int shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
- int pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
- int rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
- int handguninventoryroller = new int();
- int shotguninventoryroller = new int();
- int pdwinventoryroller = new int();
- int rifleinventoryroller = new int();
- if (handguninventory > 0)
- {
- handguninventoryroller = roller2.Next(0, handguninventory);
- }
- if (shotguninventory > 0)
- {
- shotguninventoryroller = roller2.Next(0, shotguninventory);
- }
- if (pdwinventory > 0)
- {
- pdwinventoryroller = roller2.Next(0, pdwinventory);
- }
- if (rifleinventory > 0)
- {
- rifleinventoryroller = roller2.Next(0, rifleinventory);
- }
- string handgunstring = handgunarray.ElementAt(whichsizehandgun);
- string shotgunstring = shotgunarray.ElementAt(whichshotgun);
- string pdwstring = pdwarray.ElementAt(whichpdw);
- string riflestring = riflearray.ElementAt(whichrifle);
- while (handcounter > 0)
- {
- if (MasterGunInventory[handgunstring].Count != 0 && MasterGunInventory.ContainsKey(handgunstring))
- {
- if (handgunfinish == handcounter)
- {
- Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Handguns__________________________" + Environment.NewLine + reassembler.ToString());
- handcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- handcounter--;
- }
- }
- else
- {
- handcounter = 0;
- }
- whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
- handgunstring = handgunarray.ElementAt(whichsizehandgun);
- handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
- handguninventoryroller = roller2.Next(0, handguninventory);
- }
- while (shotguncounter > 0)
- {
- if (MasterGunInventory[shotgunstring].Count != 0 && MasterGunInventory.ContainsKey(shotgunstring))
- {
- if (shotgunfinish == shotguncounter)
- {
- Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Shotguns__________________________" + Environment.NewLine + reassembler.ToString());
- shotguncounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- shotguncounter--;
- }
- }
- else
- {
- shotguncounter = 0;
- }
- whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
- shotgunstring = shotgunarray.ElementAt(whichshotgun);
- shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
- shotguninventoryroller = roller2.Next(0, shotguninventory);
- }
- while (riflecounter > 0)
- {
- if (MasterGunInventory[riflestring].Count != 0 && MasterGunInventory.ContainsKey(riflestring))
- {
- if (riflefinish == riflecounter)
- {
- Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Rifles__________________________" + Environment.NewLine + reassembler.ToString());
- riflecounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- riflecounter--;
- }
- }
- else
- {
- riflecounter = 0;
- }
- whichrifle = rifleroller.Next(0, riflearray.Count - 1);
- riflestring = riflearray.ElementAt(whichrifle);
- rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
- rifleinventoryroller = roller2.Next(0, rifleinventory);
- }
- while (PDWcounter > 0)
- {
- if (MasterGunInventory[pdwstring].Count != 0 && MasterGunInventory.ContainsKey(pdwstring))
- {
- if (pdwfinish == PDWcounter)
- {
- Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________PDWs__________________________" + Environment.NewLine + reassembler.ToString());
- PDWcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- PDWcounter--;
- }
- }
- else
- {
- PDWcounter = 0;
- }
- whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
- pdwstring = pdwarray.ElementAt(whichpdw);
- pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
- pdwinventoryroller = roller2.Next(0, pdwinventory);
- }
- }
- break;
- case 2: // Inermediate guns! Not too costly, not too cheap.
- {
- int bellcurve = roller3.Next(1, 101);
- List<string> handgunarray = new List<string>();
- List<string> shotgunarray = new List<string>();
- List<string> riflearray = new List<string>();
- List<string> pdwarray = new List<string>();
- if (Enumerable.Range(1, 5).Contains(bellcurve))
- {
- handgunarray.Add("cheapmodholdout");
- handgunarray.Add("cheapmodbackup");
- handgunarray.Add("cheapmodfull");
- handgunarray.Add("cheapmodtarget");
- }
- else
- {
- handgunarray.Add("midmodholdout");
- handgunarray.Add("midmodbackup");
- handgunarray.Add("midmodfull");
- handgunarray.Add("midmodtarget");
- }
- if (Enumerable.Range(1, 15).Contains(bellcurve))
- {
- riflearray.Add("cheapmodassault");
- riflearray.Add("cheapmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- pdwarray.Add("cheapmodmp");
- pdwarray.Add("cheapmodsmg");
- shotgunarray.Add("cheapmodcombat");
- shotgunarray.Add("cheapmodsport");
- }
- else
- {
- shotgunarray.Add("midmodsport");
- shotgunarray.Add("cheapmodcombat");
- riflearray.Add("midmodassault");
- riflearray.Add("midmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- pdwarray.Add("cheapmodmp");
- pdwarray.Add("cheapmodsmg");
- }
- if (earlymodcheck.Checked == true)
- {
- handgunarray.Add("ww2full");
- handgunarray.Add("ww2back");
- handgunarray.Add("ww2hold");
- riflearray.Add("ww2battle");
- riflearray.Add("ww2sniper");
- if (RestrictionTrackbar.Value >= 3)
- {
- pdwarray.Add("ww2smg");
- pdwarray.Add("ww2mp");
- }
- }
- if (lateinducheck.Checked == true)
- {
- handgunarray.Add("ww1full");
- handgunarray.Add("ww1back");
- handgunarray.Add("ww1hold");
- if (RestrictionTrackbar.Value >= 3)
- {
- pdwarray.Add("ww1smg");
- pdwarray.Add("ww1mp");
- }
- shotgunarray.Add("ww1combat");
- riflearray.Add("ww1battle");
- }
- if (induscheck.Checked == true)
- {
- handgunarray.Add("wildback");
- handgunarray.Add("wildfull");
- shotgunarray.Add("wildcombat");
- riflearray.Add("wildrifle");
- }
- int handcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(HandgunTrackbar.Value) * .5), HandgunTrackbar.Value);
- int PDWcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(PDWTrackbar.Value) * .5), PDWTrackbar.Value);
- int riflecounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RifleTrackbar.Value) * .5), RifleTrackbar.Value);
- int shotguncounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(ShotgunTrackbar.Value) * .5), ShotgunTrackbar.Value);
- int whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
- int whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
- int whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
- int whichrifle = rifleroller.Next(0, riflearray.Count - 1);
- if (handcounter > 0)
- {
- handgunfinish = handcounter;
- }
- if (PDWcounter > 0)
- {
- pdwfinish = PDWcounter;
- }
- if (shotguncounter > 0)
- {
- shotgunfinish = shotguncounter;
- }
- if (riflecounter > 0)
- {
- riflefinish = riflecounter;
- }
- int handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
- int shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
- int pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
- int rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
- int handguninventoryroller = new int();
- int shotguninventoryroller = new int();
- int pdwinventoryroller = new int();
- int rifleinventoryroller = new int();
- if (handguninventory > 0)
- {
- handguninventoryroller = roller2.Next(0, handguninventory);
- }
- if (shotguninventory > 0)
- {
- shotguninventoryroller = roller2.Next(0, shotguninventory);
- }
- if (pdwinventory > 0)
- {
- pdwinventoryroller = roller2.Next(0, pdwinventory);
- }
- if (rifleinventory > 0)
- {
- rifleinventoryroller = roller2.Next(0, rifleinventory);
- }
- string handgunstring = handgunarray.ElementAt(whichsizehandgun);
- string shotgunstring = shotgunarray.ElementAt(whichshotgun);
- string pdwstring = pdwarray.ElementAt(whichpdw);
- string riflestring = riflearray.ElementAt(whichrifle);
- while (handcounter > 0)
- {
- if (Enumerable.Range(1, 5).Contains(bellcurve))
- {
- handgunarray.Add("cheapmodholdout");
- handgunarray.Add("cheapmodbackup");
- handgunarray.Add("cheapmodfull");
- handgunarray.Add("cheapmodtarget");
- }
- else
- {
- handgunarray.Add("midmodholdout");
- handgunarray.Add("midmodbackup");
- handgunarray.Add("midmodfull");
- handgunarray.Add("midmodtarget");
- }
- if (MasterGunInventory[handgunstring].Count != 0 && MasterGunInventory.ContainsKey(handgunstring))
- {
- if (handgunfinish == handcounter)
- {
- Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Handguns__________________________" + Environment.NewLine + reassembler.ToString());
- handcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- handcounter--;
- }
- }
- else
- {
- handcounter = 0;
- }
- whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
- handgunstring = handgunarray.ElementAt(whichsizehandgun);
- handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
- handguninventoryroller = roller2.Next(0, handguninventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (shotguncounter > 0)
- {
- if (Enumerable.Range(1, 15).Contains(bellcurve))
- {
- shotgunarray.Add("cheapmodcombat");
- shotgunarray.Add("cheapmodsport");
- }
- else
- {
- shotgunarray.Add("midmodsport");
- shotgunarray.Add("cheapmodcombat");
- }
- if (MasterGunInventory[shotgunstring].Count != 0 && MasterGunInventory.ContainsKey(shotgunstring))
- {
- if (shotgunfinish == shotguncounter)
- {
- Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Shotguns__________________________" + Environment.NewLine + reassembler.ToString());
- shotguncounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- shotguncounter--;
- }
- }
- else
- {
- shotguncounter = 0;
- }
- whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
- shotgunstring = shotgunarray.ElementAt(whichshotgun);
- shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
- shotguninventoryroller = roller2.Next(0, shotguninventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (riflecounter > 0)
- {
- if (Enumerable.Range(1, 15).Contains(bellcurve))
- {
- riflearray.Add("cheapmodassault");
- riflearray.Add("cheapmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- }
- else
- {
- riflearray.Add("midmodassault");
- riflearray.Add("midmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- }
- if (MasterGunInventory[riflestring].Count != 0 && MasterGunInventory.ContainsKey(riflestring))
- {
- if (riflefinish == riflecounter)
- {
- Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Rifles__________________________" + Environment.NewLine + reassembler.ToString());
- riflecounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- riflecounter--;
- }
- }
- else
- {
- riflecounter = 0;
- }
- whichrifle = rifleroller.Next(0, riflearray.Count - 1);
- riflestring = riflearray.ElementAt(whichrifle);
- rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
- rifleinventoryroller = roller2.Next(0, rifleinventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (PDWcounter > 0)
- {
- if (MasterGunInventory[pdwstring].Count != 0 && MasterGunInventory.ContainsKey(pdwstring))
- {
- if (pdwfinish == PDWcounter)
- {
- Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________PDWs__________________________" + Environment.NewLine + reassembler.ToString());
- PDWcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- PDWcounter--;
- }
- }
- else
- {
- PDWcounter = 0;
- }
- whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
- pdwstring = pdwarray.ElementAt(whichpdw);
- pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
- pdwinventoryroller = roller2.Next(0, pdwinventory);
- bellcurve = roller3.Next(1, 101);
- }
- }
- break;
- case 3:
- {
- int bellcurve = roller3.Next(1, 101);
- List<string> handgunarray = new List<string>();
- List<string> shotgunarray = new List<string>();
- List<string> riflearray = new List<string>();
- List<string> pdwarray = new List<string>();
- List<string> mgarray = new List<string>();
- List<string> glarray = new List<string>();
- List<string> rocketarray = new List<string>();
- mgarray.Add("modlmg");
- glarray.Add("modsag");
- rocketarray.Add("modrocket");
- if (RestrictionTrackbar.Value >= 4)
- {
- mgarray.Add("modgpmg");
- }
- if (Enumerable.Range(1, 3).Contains(bellcurve))
- {
- handgunarray.Add("cheapmodholdout");
- handgunarray.Add("cheapmodbackup");
- handgunarray.Add("cheapmodfull");
- handgunarray.Add("cheapmodtarget");
- }
- else if (Enumerable.Range(4, 24).Contains(bellcurve))
- {
- handgunarray.Add("midmodholdout");
- handgunarray.Add("midmodbackup");
- handgunarray.Add("midmodfull");
- handgunarray.Add("midmodtarget");
- }
- else
- {
- handgunarray.Add("expenmodholdout");
- handgunarray.Add("expenmodbackup");
- handgunarray.Add("expenmodfull");
- handgunarray.Add("expenmodtarget");
- }
- if (Enumerable.Range(1, 10).Contains(bellcurve))
- {
- riflearray.Add("cheapmodassault");
- riflearray.Add("cheapmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- pdwarray.Add("cheapmodmp");
- pdwarray.Add("cheapmodsmg");
- shotgunarray.Add("cheapmodcombat");
- shotgunarray.Add("cheapmodsport");
- }
- else if (Enumerable.Range(11, 30).Contains(bellcurve))
- {
- shotgunarray.Add("midmodsport");
- shotgunarray.Add("expenmodsport");
- shotgunarray.Add("expenmodcombat");
- riflearray.Add("midmodassault");
- riflearray.Add("midmodcarb");
- pdwarray.Add("expenmodmp");
- pdwarray.Add("expenmodsmg");
- }
- else
- {
- riflearray.Add("expenmodassault");
- riflearray.Add("expenmodcarb");
- riflearray.Add("expenmoddmr");
- riflearray.Add("expenmodsniper");
- if (RestrictionTrackbar.Value >= 3)
- {
- riflearray.Add("modanti");
- }
- pdwarray.Add("expenmodmp");
- pdwarray.Add("expenmodsmg");
- shotgunarray.Add("expenmodsport");
- shotgunarray.Add("expenmodcombat");
- }
- if (earlymodcheck.Checked == true)
- {
- handgunarray.Add("ww2full");
- handgunarray.Add("ww2back");
- handgunarray.Add("ww2hold");
- riflearray.Add("ww2battle");
- riflearray.Add("ww2sniper");
- if (RestrictionTrackbar.Value >= 3)
- {
- pdwarray.Add("ww2smg");
- pdwarray.Add("ww2mp");
- mgarray.Add("ww2lmg");
- mgarray.Add("ww2gpmg");
- pdwarray.Add("koreasmg");
- riflearray.Add("ww2anti");
- }
- else if (RestrictionTrackbar.Value >= 4)
- {
- glarray.Add("korearocket");
- glarray.Add("ww2rocket");
- }
- }
- if (lateinducheck.Checked == true)
- {
- handgunarray.Add("ww1full");
- handgunarray.Add("ww1back");
- handgunarray.Add("ww1hold");
- if (RestrictionTrackbar.Value >= 3)
- {
- pdwarray.Add("ww1smg");
- pdwarray.Add("ww1mp");
- mgarray.Add("ww1lmg");
- }
- shotgunarray.Add("ww1combat");
- riflearray.Add("ww1battle");
- }
- if (induscheck.Checked == true)
- {
- handgunarray.Add("wildback");
- handgunarray.Add("wildfull");
- shotgunarray.Add("wildcombat");
- riflearray.Add("wildrifle");
- }
- int handcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(HandgunTrackbar.Value) * .5), HandgunTrackbar.Value);
- int PDWcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(PDWTrackbar.Value) * .5), PDWTrackbar.Value);
- int riflecounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RifleTrackbar.Value) * .5), RifleTrackbar.Value);
- int shotguncounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(ShotgunTrackbar.Value) * .5), ShotgunTrackbar.Value);
- int mgcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(MGTrackbar.Value) * .5), MGTrackbar.Value);
- int rlaunchcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RocketLauncherTrackbar.Value) * .5), RocketLauncherTrackbar.Value);
- int glaunchercounter = roller10.Next(Convert.ToInt32(Convert.ToDouble(GrenadeLauncherTrackbar.Value) * .5), GrenadeLauncherTrackbar.Value);
- int whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
- int whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
- int whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
- int whichrifle = rifleroller.Next(0, riflearray.Count - 1);
- int whichmg = mgroller.Next(0, mgarray.Count - 1);
- int whichgl = glroller.Next(0, glarray.Count - 1);
- int whichrocket = rocketroller.Next(0, rocketarray.Count - 1);
- if (handcounter > 0)
- {
- handgunfinish = handcounter;
- }
- else if (PDWcounter > 0)
- {
- pdwfinish = PDWcounter;
- }
- else if (shotguncounter > 0)
- {
- shotgunfinish = shotguncounter;
- }
- else if (riflecounter > 0)
- {
- riflefinish = riflecounter;
- }
- else if (mgcounter > 0)
- {
- mgfinish = mgcounter;
- }
- if (RestrictionTrackbar.Value >= 4)
- {
- if (rlaunchcounter > 0)
- {
- rocketfinish = rlaunchcounter;
- }
- }
- else if (glaunchercounter > 0)
- {
- glfinish = glaunchercounter;
- }
- else { }
- int handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
- int shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
- int pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
- int rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
- int mginventory = MasterGunInventory[mgarray.ElementAt(whichmg)].Count - 1;
- int glinventory = MasterGunInventory[glarray.ElementAt(whichgl)].Count - 1;
- int rocketinventory = new int();
- if (RestrictionTrackbar.Value >= 4)
- {
- rocketinventory = MasterRocketInventory[rocketarray.ElementAt(whichrocket)].Count - 1;
- }
- int handguninventoryroller = new int();
- int shotguninventoryroller = new int();
- int pdwinventoryroller = new int();
- int rifleinventoryroller = new int();
- int mginventoryroller = new int();
- int glinventoryroller = new int();
- int rocketinventoryroller = new int();
- if (handguninventory > 0)
- {
- handguninventoryroller = roller2.Next(0, handguninventory);
- }
- if (shotguninventory > 0)
- {
- shotguninventoryroller = roller2.Next(0, shotguninventory);
- }
- if (pdwinventory > 0)
- {
- pdwinventoryroller = roller2.Next(0, pdwinventory);
- }
- if (rifleinventory > 0)
- {
- rifleinventoryroller = roller2.Next(0, rifleinventory);
- }
- if (mginventory > 0)
- {
- mginventoryroller = roller2.Next(0, mginventory);
- }
- if (glinventory > 0)
- {
- glinventoryroller = roller2.Next(0, glinventory);
- }
- if (RestrictionTrackbar.Value >= 4)
- {
- if (rocketinventory > 0)
- {
- rocketinventory = roller3.Next(0, rocketinventory);
- }
- }
- string handgunstring = handgunarray.ElementAt(whichsizehandgun);
- string shotgunstring = shotgunarray.ElementAt(whichshotgun);
- string pdwstring = pdwarray.ElementAt(whichpdw);
- string riflestring = riflearray.ElementAt(whichrifle);
- string mgstring = mgarray.ElementAt(whichmg);
- string glstring = glarray.ElementAt(whichgl);
- string rocketstring = rocketarray.ElementAt(whichrocket);
- while (handcounter > 0)
- {
- if (Enumerable.Range(1, 3).Contains(bellcurve))
- {
- handgunarray.Add("cheapmodholdout");
- handgunarray.Add("cheapmodbackup");
- handgunarray.Add("cheapmodfull");
- handgunarray.Add("cheapmodtarget");
- }
- else if (Enumerable.Range(4, 24).Contains(bellcurve))
- {
- handgunarray.Add("midmodholdout");
- handgunarray.Add("midmodbackup");
- handgunarray.Add("midmodfull");
- handgunarray.Add("midmodtarget");
- }
- else
- {
- handgunarray.Add("expenmodholdout");
- handgunarray.Add("expenmodbackup");
- handgunarray.Add("expenmodfull");
- handgunarray.Add("expenmodtarget");
- }
- if (MasterGunInventory[handgunstring].Count != 0 && MasterGunInventory.ContainsKey(handgunstring))
- {
- if (handgunfinish == handcounter)
- {
- Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Handguns__________________________" + Environment.NewLine + reassembler.ToString());
- handcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- handcounter--;
- }
- }
- else
- {
- handcounter = 0;
- }
- whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
- handgunstring = handgunarray.ElementAt(whichsizehandgun);
- handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
- handguninventoryroller = roller2.Next(0, handguninventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (shotguncounter > 0)
- {
- if (Enumerable.Range(1, 10).Contains(bellcurve))
- {
- shotgunarray.Add("cheapmodcombat");
- shotgunarray.Add("cheapmodsport");
- }
- else
- {
- shotgunarray.Add("midmodsport");
- shotgunarray.Add("expenmodsport");
- shotgunarray.Add("expenmodcombat");
- }
- if (MasterGunInventory[shotgunstring].Count != 0 && MasterGunInventory.ContainsKey(shotgunstring))
- {
- if (shotgunfinish == shotguncounter)
- {
- Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Shotguns__________________________" + Environment.NewLine + reassembler.ToString());
- shotguncounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- shotguncounter--;
- }
- }
- else
- {
- shotguncounter = 0;
- }
- whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
- shotgunstring = shotgunarray.ElementAt(whichshotgun);
- shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
- shotguninventoryroller = roller2.Next(0, shotguninventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (riflecounter > 0)
- {
- if (Enumerable.Range(1, 10).Contains(bellcurve))
- {
- riflearray.Add("cheapmodassault");
- riflearray.Add("cheapmodcarb");
- riflearray.Add("cheapmoddmr");
- riflearray.Add("cheapmodsniper");
- }
- else if (Enumerable.Range(11, 30).Contains(bellcurve))
- {
- riflearray.Add("midmodassault");
- riflearray.Add("midmodcarb");
- }
- else
- {
- riflearray.Add("expenmodassault");
- riflearray.Add("expenmodcarb");
- riflearray.Add("expenmoddmr");
- riflearray.Add("expenmodsniper");
- if (RestrictionTrackbar.Value >= 3)
- {
- riflearray.Add("modanti");
- }
- }
- if (MasterGunInventory[riflestring].Count != 0 && MasterGunInventory.ContainsKey(riflestring))
- {
- if (riflefinish == riflecounter)
- {
- Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Rifles__________________________" + Environment.NewLine + reassembler.ToString());
- riflecounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- riflecounter--;
- }
- }
- else
- {
- riflecounter = 0;
- }
- whichrifle = rifleroller.Next(0, riflearray.Count - 1);
- riflestring = riflearray.ElementAt(whichrifle);
- rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
- rifleinventoryroller = roller2.Next(0, rifleinventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (PDWcounter > 0)
- {
- if (Enumerable.Range(1, 10).Contains(bellcurve))
- {
- pdwarray.Add("cheapmodmp");
- pdwarray.Add("cheapmodsmg");
- }
- else
- {
- pdwarray.Add("expenmodmp");
- pdwarray.Add("expenmodsmg");
- }
- if (MasterGunInventory[pdwstring].Count != 0 && MasterGunInventory.ContainsKey(pdwstring))
- {
- if (pdwfinish == PDWcounter)
- {
- Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________PDWs__________________________" + Environment.NewLine + reassembler.ToString());
- PDWcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- PDWcounter--;
- }
- }
- else
- {
- PDWcounter = 0;
- }
- whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
- pdwstring = pdwarray.ElementAt(whichpdw);
- pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
- pdwinventoryroller = roller2.Next(0, pdwinventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (mgcounter > 0)
- {
- if (MasterGunInventory[mgstring].Count != 0 && MasterGunInventory.ContainsKey(mgstring))
- {
- if (mgfinish == mgcounter)
- {
- Firearm reassembler = MasterGunInventory[mgstring][mginventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Machine Guns__________________________" + Environment.NewLine + reassembler.ToString());
- mgcounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[mgstring][mginventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- mgcounter--;
- }
- }
- else
- {
- mgcounter = 0;
- }
- whichmg = mgroller.Next(0, mgarray.Count - 1);
- mgstring = mgarray.ElementAt(whichmg);
- mginventory = MasterGunInventory[mgarray.ElementAt(whichmg)].Count - 1;
- mginventoryroller = roller2.Next(0, mginventory);
- bellcurve = roller3.Next(1, 101);
- }
- while (glaunchercounter > 0)
- {
- if (MasterGunInventory[mgstring].Count != 0 && MasterGunInventory.ContainsKey(mgstring))
- {
- if (glfinish == glaunchercounter)
- {
- Firearm reassembler = MasterGunInventory[glstring][glinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Grenade Launchers__________________________" + Environment.NewLine + reassembler.ToString());
- glaunchercounter--;
- }
- else
- {
- Firearm reassembler = MasterGunInventory[glstring][glinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- glaunchercounter--;
- }
- }
- else
- {
- glaunchercounter = 0;
- }
- whichgl = glroller.Next(0, glarray.Count - 1);
- glstring = glarray.ElementAt(whichgl);
- glinventory = MasterGunInventory[glarray.ElementAt(whichgl)].Count - 1;
- glinventoryroller = roller2.Next(0, glinventory);
- bellcurve = roller3.Next(1, 101);
- }
- if (RestrictionTrackbar.Value >= 4)
- {
- while (rlaunchcounter > 0)
- {
- if (MasterRocketInventory.Keys != null)
- {
- if (MasterRocketInventory[rocketstring].Count != 0 && MasterRocketInventory.ContainsKey(rocketstring))
- {
- if (rocketfinish == rlaunchcounter)
- {
- Rocket reassembler = MasterRocketInventory[rocketstring][rocketinventoryroller];
- GAfiringline.ShelvedFirearms.Add("__________________________Grenade Launchers__________________________" + Environment.NewLine + reassembler.ToString());
- rlaunchcounter--;
- }
- else
- {
- Rocket reassembler = MasterRocketInventory[rocketstring][rocketinventoryroller];
- GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
- rlaunchcounter--;
- }
- }
- else
- {
- rlaunchcounter = 0;
- }
- whichrocket = rocketroller.Next(0, rocketarray.Count - 1);
- rocketstring = rocketarray.ElementAt(whichrocket);
- rocketinventory = MasterRocketInventory[rocketarray.ElementAt(whichrocket)].Count - 1;
- rocketinventoryroller = roller2.Next(0, rocketinventory);
- bellcurve = roller3.Next(1, 101);
- }
- }
- }
- }
- break;
- default:
- {
- }
- break;
- }
- //This is a tester to print ammo
- StringBuilder ammotester = new StringBuilder();
- StringBuilder shelftester = new StringBuilder();
- int rimstatic = Rimfire.AmmoBox.Count;
- int lightrimstatic = LightRimless.AmmoBox.Count;
- int interrimstatic = IntermediateRimless.AmmoBox.Count;
- int heavyrimstatic = HeavyRimless.AmmoBox.Count;
- int lightrimedstatic = LightRimmed.AmmoBox.Count;
- int heavyrimedstatic = HeavyRimmed.AmmoBox.Count;
- int lightriflestatic = LightRifle.AmmoBox.Count;
- int interriflestatic = IntermediateRifle.AmmoBox.Count;
- int heavyriflestatic = HeavyRifle.AmmoBox.Count;
- int superheavyriflestatic = SuperheavyRifle.AmmoBox.Count;
- int lightshotshellstatic = LightShotshell.AmmoBox.Count;
- int intershotshellstatic = IntermediateShotshell.AmmoBox.Count;
- int heavyshotshellstatic = HeavyShotshell.AmmoBox.Count;
- int ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- foreach (AmmoBox bang in Rimfire.AmmoBox.ToList())
- {
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- }
- Random Boxobullets = new Random();
- int rimfirecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int lightrimlesscountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int interrimlesscountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int heavyrimlesscountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int lightrimmedcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int heavyrimmedcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int lightriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int interriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int heavyriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int superheavyriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int lightshotshellcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int intershotshellcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int heavyshotshellcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
- int numberofrims = rimstatic - 1;
- int numberoflightrimless = lightrimstatic - 1;
- int numberofinterrimless = interrimstatic - 1;
- int numberofheavyrimless = heavyrimstatic - 1;
- int numberoflightrimmed = lightrimedstatic - 1;
- int numberofheavyrimmed = heavyrimstatic - 1;
- int numberlightrifle = lightriflestatic - 1;
- int numberinterrifle = interriflestatic - 1;
- int numberheavyrifle = heavyriflestatic - 1;
- int numbersuperheavyrifle = superheavyriflestatic - 1;
- int numberlightshot = lightshotshellstatic - 1;
- int numberintershot = intershotshellstatic - 1;
- int numberheavyshot = heavyshotshellstatic - 1;
- int whichrimfire = Boxobullets.Next(0, numberofrims);
- int whichLRL = Boxobullets.Next(0, numberoflightrimless);
- int whichIRL = Boxobullets.Next(0, numberofinterrimless);
- int whichHRL = Boxobullets.Next(0, numberofheavyrimless);
- int whichLRM = Boxobullets.Next(0, numberoflightrimmed);
- int whichHRM = Boxobullets.Next(0, numberofheavyrimmed);
- int whichLR = Boxobullets.Next(0, numberlightrifle);
- int whichIR = Boxobullets.Next(0, numberinterrifle);
- int whichHR = Boxobullets.Next(0, numberheavyrifle);
- int whichSHR = Boxobullets.Next(0, numbersuperheavyrifle);
- int whichLS = Boxobullets.Next(0, numberlightshot);
- int whichIS = Boxobullets.Next(0, numberintershot);
- int whichHS = Boxobullets.Next(0, numberheavyshot);
- int boxcount = Boxobullets.Next(1, 11);
- while (rimfirecountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = Rimfire.AmmoBox[whichrimfire];
- holder.AmmoCat = Rimfire;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- rimfirecountdown--;
- whichrimfire = Boxobullets.Next(0, numberofrims);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (lightrimlesscountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = LightRimless.AmmoBox[whichLRL];
- holder.AmmoCat = LightRimless;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- lightrimlesscountdown--;
- whichLRL = Boxobullets.Next(0, numberoflightrimless);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (interrimlesscountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = IntermediateRimless.AmmoBox[whichIRL];
- holder.AmmoCat = IntermediateRimless;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- interrimlesscountdown--;
- whichIRL = Boxobullets.Next(0, numberofinterrimless);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (heavyrimlesscountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = HeavyRimless.AmmoBox[whichHRL];
- holder.AmmoCat = HeavyRimless;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- heavyrimlesscountdown--;
- whichHRL = Boxobullets.Next(0, numberofheavyrimless);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (lightrimmedcountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = LightRimmed.AmmoBox[whichLRM];
- holder.AmmoCat = LightRimmed;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- lightrimmedcountdown--;
- whichLRM = Boxobullets.Next(0, numberoflightrimmed);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (heavyrimmedcountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = HeavyRimmed.AmmoBox[whichHRM];
- holder.AmmoCat = HeavyRimmed;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- heavyrimmedcountdown--;
- whichHRM = Boxobullets.Next(0, numberofheavyrimmed);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (lightriflecountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = LightRifle.AmmoBox[whichLR];
- holder.AmmoCat = LightRifle;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- lightriflecountdown--;
- whichLR = Boxobullets.Next(0, numberlightrifle);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (interriflecountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = IntermediateRifle.AmmoBox[whichIR];
- holder.AmmoCat = IntermediateRifle;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- interriflecountdown--;
- whichIR = Boxobullets.Next(0, numberinterrifle);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (heavyriflecountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = HeavyRifle.AmmoBox[whichHR];
- holder.AmmoCat = HeavyRifle;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- heavyriflecountdown--;
- whichHR = Boxobullets.Next(0, numberheavyrifle);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (superheavyriflecountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = SuperheavyRifle.AmmoBox[whichSHR];
- holder.AmmoCat = SuperheavyRifle;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- superheavyriflecountdown--;
- whichSHR = Boxobullets.Next(0, numbersuperheavyrifle);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (lightshotshellcountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = LightShotshell.AmmoBox[whichLS];
- holder.AmmoCat = LightShotshell;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- lightshotshellcountdown--;
- whichLS = Boxobullets.Next(0, numberlightshot);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (intershotshellcountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = IntermediateShotshell.AmmoBox[whichIS];
- holder.AmmoCat = IntermediateShotshell;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- intershotshellcountdown--;
- whichIS = Boxobullets.Next(0, numberintershot);
- boxcount = Boxobullets.Next(1, 11);
- }
- while (heavyshotshellcountdown != 0)
- {
- AmmoShelf holder = new AmmoShelf();
- AmmoShelf tester = new AmmoShelf();
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- while (boxcount != 0)
- {
- if (holder.AmountOfBoxes == 0)
- {
- holder.AmmoBox = HeavyShotshell.AmmoBox[whichHS];
- holder.AmmoCat = HeavyShotshell;
- holder.AmountOfBoxes++;
- boxcount--;
- }
- else
- {
- holder.AmountOfBoxes++;
- boxcount--;
- }
- }
- GAfiringline.ShelvedAmmo.Add(holder);
- heavyshotshellcountdown--;
- whichHS = Boxobullets.Next(0, numberheavyshot);
- boxcount = Boxobullets.Next(1, 11);
- }
- if (GAfiringline.ShelvedAmmo.ToList().Count != 0)
- {
- shelftester.Append("__________________________Ammunition__________________________" + Environment.NewLine);
- }
- foreach (AmmoShelf ha in GAfiringline.ShelvedAmmo.ToList())
- { // Make something that changes rounds to round if it's that one box of ammo that only has one round in it.
- if (ha.AmountOfBoxes == 1)
- {
- shelftester.Append(ha.AmountOfBoxes.ToString() + " box of " + MasterAmmoMakers[ammomaker] + " brand " + ha.AmmoCat.CategoryName + " " + ha.AmmoBox.Ammotype.Name + " ammunition. A box has " + ha.AmmoBox.BoxAmount + " rounds in it. A box cost " + ha.AmmoBox.Cost + " WP." + Environment.NewLine);
- }
- else if (ha.AmountOfBoxes > 2)
- {
- shelftester.Append(ha.AmountOfBoxes.ToString() + " boxes of " + MasterAmmoMakers[ammomaker] + " brand " + ha.AmmoCat.CategoryName + " " + ha.AmmoBox.Ammotype.Name + " ammunition. A box has " + ha.AmmoBox.BoxAmount + " rounds in it. A box cost " + ha.AmmoBox.Cost + " WP." + Environment.NewLine);
- }
- ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
- }
- //End ammotester
- int staticcount = GAfiringline.ShelvedFirearms.Count - 1;
- int guncount = 0;
- if (staticcount != 0)
- {
- while (guncount <= staticcount)
- {
- InventoryofGuns.Append(GAfiringline.ShelvedFirearms[guncount] + Environment.NewLine);
- guncount++;
- }
- }
- gunstoreoutput.Text = "";
- // Outputs the guntext to the big box
- gunstoreoutput.Text = InventoryofGuns.ToString() + shelftester.ToString() + ammotester.ToString();
- // gunstoreoutput.Text = ammotester.ToString();
- //gunstoreoutput.Text = shelftester.ToString();
- }
- private void label2_Click(object sender, EventArgs e)
- {
- }
- private void label3_Click(object sender, EventArgs e)
- {
- }
- private void label5_Click(object sender, EventArgs e)
- {
- }
- private void label10_Click(object sender, EventArgs e)
- {
- }
- private void label28_Click(object sender, EventArgs e)
- {
- }
- private void label27_Click(object sender, EventArgs e)
- {
- }
- private void trackBar7_Scroll(object sender, EventArgs e)
- {
- }
- private void label26_Click(object sender, EventArgs e)
- {
- }
- private void label25_Click(object sender, EventArgs e)
- {
- }
- private void trackBar3_Scroll(object sender, EventArgs e)
- {
- }
- private void saveToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SaveFileDialog SaveStoreDialog = new SaveFileDialog();
- SaveStoreDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
- SaveStoreDialog.FileName = "NewStore.txt";
- SaveStoreDialog.RestoreDirectory = true;
- if (SaveStoreDialog.ShowDialog() == DialogResult.OK)
- {
- using (StreamWriter newstream = new StreamWriter(SaveStoreDialog.FileName))
- {
- newstream.Write(gunstoreoutput.Text);
- newstream.Close();
- }
- }
- }
- private void exitToolStripMenuItem_Click(object sender, EventArgs e)
- {
- if (MessageBox.Show("Are you sure you want to quit, Sempai?", "Exit", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- Application.Exit();
- }
- }
- private void label30_Click(object sender, EventArgs e)
- {
- }
- private void label29_Click(object sender, EventArgs e)
- {
- }
- private void trackBar1_Scroll(object sender, EventArgs e)
- {
- }
- private void label7_Click(object sender, EventArgs e)
- {
- }
- private void label33_Click(object sender, EventArgs e)
- {
- }
- private void label32_Click(object sender, EventArgs e)
- {
- }
- private void label31_Click(object sender, EventArgs e)
- {
- }
- private void trackBar1_Scroll_1(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement