Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 111.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using System.Threading;
  12. using System.Web.Script.Serialization;
  13. namespace spiderbotmk5
  14. {
  15. public partial class Gunstoreform : Form
  16. {
  17. public Gunstoreform()
  18. {
  19. InitializeComponent();
  20. }
  21.  
  22. private void Form1_Load(object sender, EventArgs e)
  23. {
  24.  
  25. }
  26.  
  27. private void button2_Click(object sender, EventArgs e)
  28. {
  29. //string programdirectory = "C:/Users/Alex/Dropbox/Gunbot/Gunstore files/Json files/"; // Json location at home
  30. // string programdirectory = "C:/Users/mazycka/Dropbox/Gunbot/Gunstore files/Json files/"; //Json Location at work
  31. string programdirectory = Directory.GetCurrentDirectory() + "/"; // Directory for installs
  32. string gunfile = "Firearms.json"; // File with all of the firearms
  33. string rocketfile = "Rockets.json"; // File with all of the rocket launchers
  34. string caliberfile = "Calibers.json"; // A listing of every caliber in Ops and Tactics
  35. string ammotypefile = "Ammotypes.json"; // All of the Standard Modern Ammotypes
  36. string manufacturerfile = "Ammomakers.txt"; // The ammomakers in a text file. No need for a Json for these.
  37.  
  38. Dictionary<string, List<Firearm>> MasterGunInventory = new Dictionary<string, List<Firearm>>();
  39. Dictionary<string, List<Rocket>> MasterRocketInventory = new Dictionary<string, List<Rocket>>();
  40. Dictionary<string, List<Caliber>> MasterCaliberListings = new Dictionary<string, List<Caliber>>();
  41. Dictionary<string, List<AmmunitionType>> MasterAmmoType = new Dictionary<string, List<AmmunitionType>>();
  42. Dictionary<string, List<Firearm>> CurrentGunInventory = new Dictionary<string, List<Firearm>>();
  43. List<string> MasterAmmoMakers = File.ReadAllLines(programdirectory + manufacturerfile).ToList();
  44. Store GAfiringline = new Store();
  45.  
  46. // First thigns first, Scan all of the Jsons to dictionary files, and the ammomaker's file
  47.  
  48. using (StreamReader r = new StreamReader(programdirectory + gunfile))
  49. {
  50. string json = r.ReadToEnd();
  51. MasterGunInventory = new JavaScriptSerializer().Deserialize<Dictionary<string, List<Firearm>>>(json);
  52. }
  53. using (StreamReader q = new StreamReader(programdirectory + rocketfile))
  54. {
  55. string json = q.ReadToEnd();
  56. MasterRocketInventory = new JavaScriptSerializer().Deserialize<Dictionary<string, List<Rocket>>>(json);
  57. }
  58. using (StreamReader s = new StreamReader(programdirectory + caliberfile))
  59. {
  60. string json = s.ReadToEnd();
  61. MasterCaliberListings = new JavaScriptSerializer().Deserialize<Dictionary<string, List<Caliber>>>(json);
  62. }
  63. using (StreamReader t = new StreamReader(programdirectory + ammotypefile))
  64. {
  65. string json = t.ReadToEnd();
  66. MasterAmmoType = new JavaScriptSerializer().Deserialize<Dictionary<string, List<AmmunitionType>>>(json);
  67. }
  68.  
  69. StringBuilder InventoryofGuns = new StringBuilder();
  70.  
  71. Category Rimfire = new Category();
  72. Rimfire.CategoryName = "Rimfire";
  73. Category LightRimless = new Category();
  74. LightRimless.CategoryName = "Light Rimless";
  75. Category IntermediateRimless = new Category();
  76. IntermediateRimless.CategoryName = "Intermediate Rimless";
  77. Category HeavyRimless = new Category();
  78. HeavyRimless.CategoryName = "Heavy Rimless";
  79. Category LightRimmed = new Category();
  80. LightRimmed.CategoryName = "Light Rimmed";
  81. Category HeavyRimmed = new Category();
  82. HeavyRimmed.CategoryName = "Heavy Rimmed";
  83. Category LightRifle = new Category();
  84. LightRifle.CategoryName = "Light Rifle";
  85. Category IntermediateRifle = new Category();
  86. IntermediateRifle.CategoryName = "Intermediate Rifle";
  87. Category HeavyRifle = new Category();
  88. HeavyRifle.CategoryName = "Heavy Rifle";
  89. Category SuperheavyRifle = new Category();
  90. SuperheavyRifle.CategoryName = "Superheavy Rifle";
  91. Category LightShotshell = new Category();
  92. LightShotshell.CategoryName = "Light Shotshell";
  93. Category IntermediateShotshell = new Category();
  94. IntermediateShotshell.CategoryName = "Intermediate Shotshell";
  95. Category HeavyShotshell = new Category();
  96. HeavyShotshell.CategoryName = "Heavy Shotshell";
  97. //Cased
  98. //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,
  99. AmmunitionType FMJ = MasterAmmoType["Cased"][0];
  100. AmmunitionType Surplus = MasterAmmoType["Cased"][1];
  101. AmmunitionType JHP = MasterAmmoType["Cased"][2];
  102. AmmunitionType SJHP = MasterAmmoType["Cased"][3];
  103. AmmunitionType SJSP = MasterAmmoType["Cased"][4];
  104. AmmunitionType AP = MasterAmmoType["Cased"][5];
  105. AmmunitionType IncCased = MasterAmmoType["Cased"][6];
  106. AmmunitionType FranCased = MasterAmmoType["Cased"][7];
  107. AmmunitionType NLCased = MasterAmmoType["Cased"][8];
  108. AmmunitionType Match = MasterAmmoType["Cased"][9];
  109. AmmunitionType TraceCased = MasterAmmoType["Cased"][10];
  110. AmmunitionType Blank = MasterAmmoType["Cased"][11];
  111. AmmunitionType Wad = MasterAmmoType["Cased"][12];
  112. AmmunitionType SWad = MasterAmmoType["Cased"][13];
  113. AmmunitionType ExpCased = MasterAmmoType["Cased"][14];
  114. AmmunitionType Solid = MasterAmmoType["Cased"][15];
  115. AmmunitionType Rat = MasterAmmoType["Cased"][16];
  116.  
  117.  
  118.  
  119. // Adds the calibers to categories, and the ammo types to the categories
  120.  
  121. //Shell
  122. //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
  123.  
  124. AmmunitionType Double00Buck = MasterAmmoType["Shelled"][0];
  125. AmmunitionType Num4Buck = MasterAmmoType["Shelled"][1];
  126. AmmunitionType Num9Bird = MasterAmmoType["Shelled"][2];
  127. AmmunitionType Num6Bird = MasterAmmoType["Shelled"][3];
  128. AmmunitionType Num3Bird = MasterAmmoType["Shelled"][4];
  129. AmmunitionType Slug = MasterAmmoType["Shelled"][5];
  130. AmmunitionType WaxSlug = MasterAmmoType["Shelled"][6];
  131. AmmunitionType SaboSlug = MasterAmmoType["Shelled"][7];
  132. AmmunitionType Mag00Buck = MasterAmmoType["Shelled"][8];
  133. AmmunitionType Mag4Buck = MasterAmmoType["Shelled"][9];
  134. AmmunitionType Mag9Bird = MasterAmmoType["Shelled"][10];
  135. AmmunitionType Mag6Bird = MasterAmmoType["Shelled"][11];
  136. AmmunitionType Mag3Bird = MasterAmmoType["Shelled"][12];
  137. AmmunitionType MagSlug = MasterAmmoType["Shelled"][13];
  138. AmmunitionType MiniBuck = MasterAmmoType["Shelled"][14];
  139. AmmunitionType MiniSlug = MasterAmmoType["Shelled"][15];
  140. AmmunitionType NL00Buck = MasterAmmoType["Shelled"][16];
  141. AmmunitionType NLSlug = MasterAmmoType["Shelled"][17];
  142. AmmunitionType NLSalt = MasterAmmoType["Shelled"][18];
  143. AmmunitionType Stun = MasterAmmoType["Shelled"][19];
  144. AmmunitionType Fran6Bird = MasterAmmoType["Shelled"][20];
  145. AmmunitionType Fran3Bird = MasterAmmoType["Shelled"][21];
  146. AmmunitionType FranBuck = MasterAmmoType["Shelled"][22];
  147. AmmunitionType Breach = MasterAmmoType["Shelled"][23];
  148. AmmunitionType BlankShell = MasterAmmoType["Shelled"][24];
  149. AmmunitionType Fletch = MasterAmmoType["Shelled"][25];
  150. AmmunitionType TracerShell = MasterAmmoType["Shelled"][26];
  151. AmmunitionType Marker = MasterAmmoType["Shelled"][27];
  152. AmmunitionType ExpShell = MasterAmmoType["Shelled"][28];
  153. AmmunitionType OC = MasterAmmoType["Shelled"][29];
  154. AmmunitionType Flame = MasterAmmoType["Shelled"][30];
  155. AmmunitionType Flare = MasterAmmoType["Shelled"][31];
  156. AmmunitionType Taser = MasterAmmoType["Shelled"][32];
  157. AmmunitionType Strung = MasterAmmoType["Shelled"][33];
  158. //All of the rimfire ammo boxes
  159. AmmoBox rimfmj = new AmmoBox(FMJ.Name, FMJ, 1, 500, "None");
  160. AmmoBox rimjhp = new AmmoBox(JHP.Name, JHP, 1, 400, "None");
  161. AmmoBox rimexp = new AmmoBox(ExpCased.Name, ExpCased, 1, 20, "None");
  162. AmmoBox rimmatch = new AmmoBox(Match.Name, Match, 1, 50, "None");
  163. AmmoBox rimtrace = new AmmoBox(TraceCased.Name, TraceCased, 1, 500, "None");
  164. AmmoBox rimfran = new AmmoBox(FranCased.Name, FranCased, 1, 50, "None");
  165. AmmoBox rimblank = new AmmoBox(Blank.Name, Blank, 1, 200, "None");
  166. //adds them to the rifmfire ammo boxes
  167. Rimfire.AmmoBox.Add(rimfmj);
  168. Rimfire.AmmoBox.Add(rimjhp);
  169. Rimfire.AmmoBox.Add(rimexp);
  170. Rimfire.AmmoBox.Add(rimmatch);
  171. Rimfire.AmmoBox.Add(rimtrace);
  172. Rimfire.AmmoBox.Add(rimfran);
  173. Rimfire.AmmoBox.Add(rimblank);
  174.  
  175. //Most of the boxes actually share values, so I'll reuse when I can
  176. 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
  177. AmmoBox SmallSurplusBox = new AmmoBox(Surplus.Name, Surplus, 1, 200, "None"); //Light Rimless and Heavy Rimless have the same surplus values
  178. AmmoBox SmallJHPBox = new AmmoBox(JHP.Name, JHP, 1, 50, "None"); // Light and intermediate Rimless have the same JHP values
  179. AmmoBox TinyFranbox = new AmmoBox("FMJ", FMJ, 1, 500, "None"); // Intermediate and heavy rimless use the same frangible values
  180. AmmoBox lrlfran = new AmmoBox(FranCased.Name, FranCased, 1, 10, "None");
  181. AmmoBox tinymathcbox = new AmmoBox(Match.Name, Match, 1, 25, "None"); // Light Rimless, intermediate rimless and heavy rimless match all use the same size
  182. AmmoBox Lrlblank = new AmmoBox(Blank.Name, Blank, 1, 500, "None");
  183. //Adds them to the Light rimless possible boxes
  184. LightRimless.AmmoBox.Add(FMJbox);
  185. LightRimless.AmmoBox.Add(SmallSurplusBox);
  186. LightRimless.AmmoBox.Add(SmallJHPBox);
  187. LightRimless.AmmoBox.Add(lrlfran);
  188. LightRimless.AmmoBox.Add(tinymathcbox);
  189. LightRimless.AmmoBox.Add(Lrlblank);
  190.  
  191.  
  192. AmmoBox intrimfmj = new AmmoBox(FMJ.Name, FMJ, 1, 100, "None");
  193. AmmoBox intrmdsur = new AmmoBox(Surplus.Name, Surplus, 1, 400, "None");
  194.  
  195. 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
  196.  
  197. 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
  198. AmmoBox tinyblank = new AmmoBox(Blank.Name, Blank, 1, 200, "None"); //int and heavy rimless
  199. AmmoBox tinyapbox = new AmmoBox(AP.Name, AP, 1, 5, "M&P"); //Int and heavy rimless, light and heavy rimmed
  200. AmmoBox tinynlcase = new AmmoBox(NLCased.Name, NLCased, 1, 20, "None"); //Int and heavy rimless
  201. IntermediateRimless.AmmoBox.Add(intrimfmj);
  202. IntermediateRimless.AmmoBox.Add(intrmdsur);
  203. IntermediateRimless.AmmoBox.Add(SmallJHPBox);
  204. IntermediateRimless.AmmoBox.Add(Ratshotbox);
  205. IntermediateRimless.AmmoBox.Add(TinyFranbox);
  206. IntermediateRimless.AmmoBox.Add(tinyapbox);
  207. IntermediateRimless.AmmoBox.Add(tinynlcase);
  208. IntermediateRimless.AmmoBox.Add(tinymathcbox);
  209. IntermediateRimless.AmmoBox.Add(tinytracer);
  210. IntermediateRimless.AmmoBox.Add(tinyblank);
  211.  
  212. AmmoBox hvyrmljhp = new AmmoBox(JHP.Name, JHP, 1, 25, "None");
  213. AmmoBox hvyrmlfran = new AmmoBox(FranCased.Name, FranCased, 1, 25, "None");
  214. AmmoBox smallswad = new AmmoBox(SWad.Name, SWad, 1, 50, "None"); // heavyrimless, Light and heavy rimmed as well
  215. AmmoBox hvyrmlsolid = new AmmoBox(Solid.Name, Solid, 1, 5, "None");
  216. HeavyRimless.AmmoBox.Add(FMJbox);
  217. HeavyRimless.AmmoBox.Add(SmallSurplusBox);
  218. HeavyRimless.AmmoBox.Add(hvyrmljhp);
  219. HeavyRimless.AmmoBox.Add(Ratshotbox);
  220. HeavyRimless.AmmoBox.Add(hvyrmlfran);
  221. HeavyRimless.AmmoBox.Add(tinyapbox);
  222. HeavyRimless.AmmoBox.Add(tinynlcase);
  223. HeavyRimless.AmmoBox.Add(tinymathcbox);
  224. HeavyRimless.AmmoBox.Add(tinytracer);
  225. HeavyRimless.AmmoBox.Add(tinyblank);
  226. HeavyRimless.AmmoBox.Add(smallswad);
  227. HeavyRimless.AmmoBox.Add(hvyrmlsolid);
  228.  
  229. AmmoBox medsurplus = new AmmoBox(Surplus.Name, Surplus, 1, 100, "None"); // Light and heavy rimmed
  230. AmmoBox lrmjhp = new AmmoBox(JHP.Name, JHP, 1, 30, "None");
  231. AmmoBox lrmfran = new AmmoBox(FranCased.Name, FranCased, 1, 30, "None");
  232. AmmoBox Blankbox = new AmmoBox(Blank.Name, Blank, 1, 100, "None");
  233. AmmoBox lrsjhp = new AmmoBox(SJHP.Name, SJHP, 1, 30, "None");
  234. AmmoBox lrshsp = new AmmoBox(SJSP.Name, SJSP, 1, 30, "None");
  235. AmmoBox smallwads = new AmmoBox(Wad.Name, Wad, 1, 50, "None"); // light and heavy rimmed
  236. LightRimmed.AmmoBox.Add(FMJbox);
  237. LightRimmed.AmmoBox.Add(medsurplus);
  238. LightRimmed.AmmoBox.Add(lrmjhp);
  239. LightRimmed.AmmoBox.Add(Ratshotbox);
  240. LightRimmed.AmmoBox.Add(lrmfran);
  241. LightRimmed.AmmoBox.Add(tinyapbox);
  242. LightRimmed.AmmoBox.Add(tinytracer);
  243. LightRimmed.AmmoBox.Add(Blankbox);
  244. LightRimmed.AmmoBox.Add(lrsjhp);
  245. LightRimmed.AmmoBox.Add(lrshsp);
  246.  
  247. LightRimmed.AmmoBox.Add(smallwads);
  248. LightRimmed.AmmoBox.Add(smallswad);
  249.  
  250. AmmoBox hvyrmjhp = new AmmoBox(JHP.Name, JHP, 1, 20, "None");
  251. AmmoBox hvyrmfran = new AmmoBox(FranCased.Name, FranCased, 1, 20, "None");
  252. AmmoBox hvyrmsjhp = new AmmoBox(SJHP.Name, SJHP, 1, 20, "None");
  253. AmmoBox hvyrmsjsp = new AmmoBox(SJSP.Name, SJSP, 1, 20, "None");
  254. AmmoBox hvysolid = new AmmoBox(Solid.Name, Solid, 1, 5, "None");
  255. HeavyRimmed.AmmoBox.Add(FMJbox);
  256. HeavyRimmed.AmmoBox.Add(medsurplus);
  257. HeavyRimmed.AmmoBox.Add(hvyrmjhp);
  258. HeavyRimmed.AmmoBox.Add(Ratshotbox);
  259. HeavyRimmed.AmmoBox.Add(hvyrmfran);
  260. HeavyRimmed.AmmoBox.Add(tinyapbox);
  261. HeavyRimmed.AmmoBox.Add(tinytracer);
  262. HeavyRimmed.AmmoBox.Add(Blankbox);
  263. HeavyRimmed.AmmoBox.Add(hvyrmsjhp);
  264. HeavyRimmed.AmmoBox.Add(hvyrmsjsp);
  265. HeavyRimmed.AmmoBox.Add(smallwads);
  266. HeavyRimmed.AmmoBox.Add(smallswad);
  267. HeavyRimmed.AmmoBox.Add(hvysolid);
  268.  
  269. AmmoBox smallriflefmj = new AmmoBox(FMJ.Name, FMJ, 1, 40, "None"); //Light and intermediate rifle
  270. AmmoBox smallriflesurplus = new AmmoBox(Surplus.Name, Surplus, 1, 160, "None"); //Light and intermediate rifle
  271. AmmoBox smallriflejhp = new AmmoBox(JHP.Name, JHP, 1, 20, "None"); // Light and intermediate rifle
  272. AmmoBox smallrifletrace = new AmmoBox(TraceCased.Name, TraceCased, 1, 20, "None"); // Ligh and intermediate
  273. AmmoBox smallAP = new AmmoBox(AP.Name, AP, 1, 10, "M&P");
  274. AmmoBox smallmatch = new AmmoBox(Match.Name, Match, 1, 20, "None");
  275. LightRifle.AmmoBox.Add(smallriflefmj);
  276. LightRifle.AmmoBox.Add(smallriflesurplus);
  277. LightRifle.AmmoBox.Add(smallriflejhp);
  278. LightRifle.AmmoBox.Add(smallrifletrace);
  279. LightRifle.AmmoBox.Add(Blankbox);
  280. LightRifle.AmmoBox.Add(smallAP);
  281. LightRifle.AmmoBox.Add(smallmatch);
  282.  
  283. AmmoBox medsolid = new AmmoBox(Solid.Name, Solid, 1, 10, "None");
  284. AmmoBox lightinc = new AmmoBox(IncCased.Name, IncCased, 1, 5, "M&P");
  285.  
  286. IntermediateRifle.AmmoBox.Add(smallriflefmj);
  287. IntermediateRifle.AmmoBox.Add(smallriflesurplus);
  288. IntermediateRifle.AmmoBox.Add(smallriflejhp);
  289. IntermediateRifle.AmmoBox.Add(smallrifletrace);
  290. IntermediateRifle.AmmoBox.Add(medsolid);
  291. IntermediateRifle.AmmoBox.Add(hvyrmfran);
  292. IntermediateRifle.AmmoBox.Add(lightinc);
  293. IntermediateRifle.AmmoBox.Add(smallAP);
  294. IntermediateRifle.AmmoBox.Add(smallmatch);
  295. IntermediateRifle.AmmoBox.Add(smallrifletrace);
  296. IntermediateRifle.AmmoBox.Add(Blankbox);
  297. IntermediateRifle.AmmoBox.Add(hvyrmsjsp);
  298.  
  299. AmmoBox medriflefmj = new AmmoBox(FMJ.Name, FMJ, 1, 20, "None");
  300. AmmoBox hvyrflmatch = new AmmoBox(Match.Name, Match, 1, 10, "None");
  301. AmmoBox hvyrflinc = new AmmoBox(IncCased.Name, IncCased, 1, 10, "M&P");
  302. AmmoBox hvyrfltrace = new AmmoBox(TraceCased.Name, TraceCased, 1, 30, "None");
  303. AmmoBox hvyrifleexp = new AmmoBox(ExpCased.Name, ExpCased, 1, 5, "M&P");
  304. HeavyRifle.AmmoBox.Add(medriflefmj);
  305. HeavyRifle.AmmoBox.Add(medsurplus);
  306. HeavyRifle.AmmoBox.Add(lrmjhp);
  307. HeavyRifle.AmmoBox.Add(hvyrmfran);
  308. HeavyRifle.AmmoBox.Add(hvyrflmatch);
  309. HeavyRifle.AmmoBox.Add(hvyrflinc);
  310. HeavyRifle.AmmoBox.Add(smallAP);
  311. HeavyRifle.AmmoBox.Add(hvyrfltrace);
  312. HeavyRifle.AmmoBox.Add(Blankbox);
  313. HeavyRifle.AmmoBox.Add(hvyrmsjhp);
  314. HeavyRifle.AmmoBox.Add(hvyrmsjsp);
  315. HeavyRifle.AmmoBox.Add(hvysolid);
  316.  
  317. AmmoBox shfmj = new AmmoBox(FMJ.Name, FMJ, 1, 10, "None");
  318. AmmoBox shsurp = new AmmoBox(Surplus.Name, Surplus, 1, 40, "None");
  319. AmmoBox shjhp = new AmmoBox(JHP.Name, JHP, 1, 10, "None");
  320. AmmoBox shfran = new AmmoBox(FranCased.Name, FranCased, 1, 10, "None");
  321. AmmoBox shmatch = new AmmoBox(Match.Name, Match, 1, 5, "None");
  322. AmmoBox shinc = new AmmoBox(IncCased.Name, IncCased, 1, 5, "M&P");
  323. AmmoBox shap = new AmmoBox(AP.Name, AP, 1, 5, "M&P");
  324. AmmoBox shblank = new AmmoBox(Blank.Name, Blank, 1, 20, "None");
  325. AmmoBox shexp = new AmmoBox(ExpCased.Name, ExpCased, 1, 1, "M&P");
  326. AmmoBox shsolid = new AmmoBox(Solid.Name, Solid, 1, 5, "None");
  327.  
  328.  
  329. SuperheavyRifle.AmmoBox.Add(shfmj);
  330. SuperheavyRifle.AmmoBox.Add(shsurp);
  331. SuperheavyRifle.AmmoBox.Add(shjhp);
  332. SuperheavyRifle.AmmoBox.Add(shfran);
  333. SuperheavyRifle.AmmoBox.Add(shmatch);
  334. SuperheavyRifle.AmmoBox.Add(shinc);
  335. SuperheavyRifle.AmmoBox.Add(shap);
  336. SuperheavyRifle.AmmoBox.Add(shblank);
  337. SuperheavyRifle.AmmoBox.Add(shexp);
  338. SuperheavyRifle.AmmoBox.Add(shsolid);
  339.  
  340. AmmoBox lightshot00 = new AmmoBox(Double00Buck.Name, Double00Buck, 1, 25, "None");
  341. AmmoBox lightshotno4buck = new AmmoBox(Num4Buck.Name, Num4Buck, 1, 25, "None");
  342. AmmoBox lightshotno6bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 40, "None");
  343. AmmoBox lightshotno3bird = new AmmoBox(Num3Bird.Name, Num3Bird, 1, 20, "None");
  344. AmmoBox lightshotrocks = new AmmoBox(NLSalt.Name, NLSalt, 1, 50, "None");
  345. AmmoBox lightshotslug = new AmmoBox(Slug.Name, Slug, 1, 10, "None");
  346. AmmoBox lightshotfran00 = new AmmoBox(FranBuck.Name, FranBuck, 1, 10, "None");
  347. AmmoBox lightshotfran3bird = new AmmoBox(Fran3Bird.Name, Fran3Bird, 1, 20, "None");
  348. AmmoBox lightshotsaboslug = new AmmoBox(SaboSlug.Name, SaboSlug, 1, 25, "None");
  349. AmmoBox lightshotwax = new AmmoBox(WaxSlug.Name, WaxSlug, 1, 20, "None");
  350. AmmoBox lightshotblank = new AmmoBox(BlankShell.Name, BlankShell, 1, 20, "None");
  351. AmmoBox lightshotmarker = new AmmoBox(Marker.Name, Marker, 1, 25, "None");
  352.  
  353. LightShotshell.AmmoBox.Add(lightshot00);
  354. LightShotshell.AmmoBox.Add(lightshotno4buck);
  355. LightShotshell.AmmoBox.Add(lightshotno6bird);
  356. LightShotshell.AmmoBox.Add(lightshotno3bird);
  357. LightShotshell.AmmoBox.Add(lightshotrocks);
  358. LightShotshell.AmmoBox.Add(lightshotslug);
  359. LightShotshell.AmmoBox.Add(lightshotfran00);
  360. LightShotshell.AmmoBox.Add(lightshotfran3bird);
  361. LightShotshell.AmmoBox.Add(lightshotfran3bird);
  362. LightShotshell.AmmoBox.Add(lightshotsaboslug);
  363. LightShotshell.AmmoBox.Add(lightshotwax);
  364. LightShotshell.AmmoBox.Add(lightshotblank);
  365. LightShotshell.AmmoBox.Add(lightshotmarker);
  366.  
  367.  
  368.  
  369. AmmoBox intershotno4buck = new AmmoBox(Num4Buck.Name, Num4Buck, 1, 30, "None");
  370. AmmoBox intershotno9bird = new AmmoBox(Num9Bird.Name, Num9Bird, 1, 100, "None");
  371. AmmoBox intershotno6bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 100, "None");
  372. AmmoBox intershotno3bird = new AmmoBox(Num3Bird.Name, Num3Bird, 1, 100, "None");
  373. AmmoBox intershotnlbean = new AmmoBox(NLSlug.Name, NLSlug, 1, 5, "None");
  374. AmmoBox intershotnlball = new AmmoBox(NL00Buck.Name, NL00Buck, 1, 20, "None");
  375. AmmoBox intershotnlrock = new AmmoBox(NLSalt.Name, NLSalt, 1, 200, "None");
  376. AmmoBox intershotslug = new AmmoBox(Slug.Name, Slug, 1, 20, "None");
  377. AmmoBox intershotoc = new AmmoBox(OC.Name, OC, 1, 10, "R");
  378. AmmoBox intershotsaboslug = new AmmoBox(SaboSlug.Name, SaboSlug, 1, 10, "None");
  379. AmmoBox intershottrace = new AmmoBox(TracerShell.Name, TracerShell, 1, 10, "None");
  380. AmmoBox intershottaser = new AmmoBox(Taser.Name, Taser, 1, 5, "R");
  381. AmmoBox intershotfran00 = new AmmoBox(FranBuck.Name, FranBuck, 1, 5, "None");
  382. AmmoBox intershotfran6 = new AmmoBox(Fran6Bird.Name, Fran6Bird, 1, 10, "None");
  383. AmmoBox intershotfran3 = new AmmoBox(Fran3Bird.Name, Fran3Bird, 1, 10, "None");
  384. AmmoBox intershotbreach = new AmmoBox(Breach.Name, Breach, 1, 5, "None");
  385. AmmoBox intershotexp = new AmmoBox(ExpShell.Name, ExpShell, 4, 1, "M&P");
  386. AmmoBox intershotflame = new AmmoBox(Flame.Name, Flame, 2, 3, "None");
  387. AmmoBox intershotflare = new AmmoBox(Flare.Name, Flare, 1, 3, "None");
  388. AmmoBox intershotstun = new AmmoBox(Stun.Name, Stun, 1, 2, "R");
  389. AmmoBox intershotstrung = new AmmoBox(Strung.Name, Strung, 1, 4, "None");
  390. AmmoBox intershotmag00 = new AmmoBox(Mag00Buck.Name, Mag00Buck, 1, 10, "None");
  391. AmmoBox intershotmagno4 = new AmmoBox(Mag4Buck.Name, Mag4Buck, 1, 10, "None");
  392. AmmoBox intershotmag9bird = new AmmoBox(Mag9Bird.Name, Mag9Bird, 1, 50, "None");
  393. AmmoBox intershotmag6bird = new AmmoBox(Mag6Bird.Name, Mag6Bird, 1, 25, "None");
  394. AmmoBox intershotmag3bird = new AmmoBox(Mag3Bird.Name, Mag3Bird, 1, 15, "None");
  395. AmmoBox intershotmagslug = new AmmoBox(MagSlug.Name, MagSlug, 1, 5, "None");
  396. AmmoBox intershotmini00 = new AmmoBox(MiniBuck.Name, MiniBuck, 1, 25, "None");
  397. AmmoBox intershotminislug = new AmmoBox(MiniSlug.Name, MiniSlug, 1, 25, "None");
  398. AmmoBox intershotwax = new AmmoBox(WaxSlug.Name, WaxSlug, 1, 25, "None");
  399. AmmoBox intershotmarker = new AmmoBox(Marker.Name, Marker, 1, 25, "None");
  400.  
  401.  
  402. IntermediateShotshell.AmmoBox.Add(lightshot00);
  403. IntermediateShotshell.AmmoBox.Add(intershotno4buck);
  404. IntermediateShotshell.AmmoBox.Add(intershotno9bird);
  405. IntermediateShotshell.AmmoBox.Add(intershotno6bird);
  406. IntermediateShotshell.AmmoBox.Add(intershotno3bird);
  407. IntermediateShotshell.AmmoBox.Add(intershotnlbean);
  408. IntermediateShotshell.AmmoBox.Add(intershotnlball);
  409. IntermediateShotshell.AmmoBox.Add(intershotnlrock);
  410. IntermediateShotshell.AmmoBox.Add(intershotslug);
  411. IntermediateShotshell.AmmoBox.Add(intershotoc);
  412. IntermediateShotshell.AmmoBox.Add(intershotsaboslug);
  413. IntermediateShotshell.AmmoBox.Add(lightshotblank);
  414. IntermediateShotshell.AmmoBox.Add(intershottrace);
  415. IntermediateShotshell.AmmoBox.Add(intershottaser);
  416. IntermediateShotshell.AmmoBox.Add(intershotfran00);
  417. IntermediateShotshell.AmmoBox.Add(intershotfran6);
  418. IntermediateShotshell.AmmoBox.Add(intershotfran3);
  419. IntermediateShotshell.AmmoBox.Add(intershotbreach);
  420. IntermediateShotshell.AmmoBox.Add(intershotexp);
  421. IntermediateShotshell.AmmoBox.Add(intershotflame);
  422. IntermediateShotshell.AmmoBox.Add(intershotflare);
  423. IntermediateShotshell.AmmoBox.Add(intershotstun);
  424. IntermediateShotshell.AmmoBox.Add(intershotstrung);
  425. IntermediateShotshell.AmmoBox.Add(intershotmag00);
  426. IntermediateShotshell.AmmoBox.Add(intershotmagno4);
  427. IntermediateShotshell.AmmoBox.Add(intershotmag9bird);
  428. IntermediateShotshell.AmmoBox.Add(intershotmag6bird);
  429. IntermediateShotshell.AmmoBox.Add(intershotmag3bird);
  430. IntermediateShotshell.AmmoBox.Add(intershotmagslug);
  431. IntermediateShotshell.AmmoBox.Add(intershotmini00);
  432. IntermediateShotshell.AmmoBox.Add(intershotminislug);
  433. IntermediateShotshell.AmmoBox.Add(intershotwax);
  434. IntermediateShotshell.AmmoBox.Add(intershotmarker);
  435.  
  436. AmmoBox heavyshot6bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 50, "None");
  437. AmmoBox heavyshot3bird = new AmmoBox(Num6Bird.Name, Num6Bird, 1, 25, "None");
  438. HeavyShotshell.AmmoBox.Add(lightshot00);
  439. HeavyShotshell.AmmoBox.Add(intershotno4buck);
  440. HeavyShotshell.AmmoBox.Add(intershotno9bird);
  441. HeavyShotshell.AmmoBox.Add(heavyshot6bird);
  442. HeavyShotshell.AmmoBox.Add(heavyshot3bird);
  443. HeavyShotshell.AmmoBox.Add(intershotslug);
  444. HeavyShotshell.AmmoBox.Add(intershotmag00);
  445. HeavyShotshell.AmmoBox.Add(intershotmagno4);
  446. HeavyShotshell.AmmoBox.Add(intershotmag9bird);
  447. HeavyShotshell.AmmoBox.Add(intershotmag6bird);
  448. HeavyShotshell.AmmoBox.Add(intershotmag3bird);
  449. HeavyShotshell.AmmoBox.Add(intershotmagslug);
  450.  
  451. foreach (List<Caliber> cals in MasterCaliberListings.Values)
  452. {
  453. foreach (Caliber entry in cals.ToList())
  454. {
  455. if (entry.AmmunitionGroup == "Rimfire")
  456. {
  457. Rimfire.IncludedCalibers.Add(entry);
  458.  
  459. }
  460. else if (entry.AmmunitionGroup == "Light Rimless")
  461. {
  462. LightRimless.IncludedCalibers.Add(entry);
  463. }
  464. else if (entry.AmmunitionGroup == "Light Rimless")
  465. {
  466. LightRimless.IncludedCalibers.Add(entry);
  467. }
  468. else if (entry.AmmunitionGroup == "Intermediate Rimless")
  469. {
  470. IntermediateRimless.IncludedCalibers.Add(entry);
  471. }
  472. else if (entry.AmmunitionGroup == "Heavy Rimless")
  473. {
  474. HeavyRifle.IncludedCalibers.Add(entry);
  475. }
  476. else if (entry.AmmunitionGroup == "Light Rimmed")
  477. {
  478. LightRimmed.IncludedCalibers.Add(entry);
  479. }
  480. else if (entry.AmmunitionGroup == "Heavy Rimmed")
  481. {
  482. HeavyRimmed.IncludedCalibers.Add(entry);
  483. }
  484. else if (entry.AmmunitionGroup == "Light Rifle")
  485. {
  486. LightRifle.IncludedCalibers.Add(entry);
  487. }
  488. else if (entry.AmmunitionGroup == "Heavy Rifle")
  489. {
  490. HeavyRifle.IncludedCalibers.Add(entry);
  491. }
  492. else if (entry.AmmunitionGroup == "Superheavy Rifle")
  493. {
  494. SuperheavyRifle.IncludedCalibers.Add(entry);
  495. }
  496. else if (entry.AmmunitionGroup == "Light Shotshell")
  497. {
  498. LightShotshell.IncludedCalibers.Add(entry);
  499. }
  500. else if (entry.AmmunitionGroup == "Intermediate Shotshell")
  501. {
  502. IntermediateShotshell.IncludedCalibers.Add(entry);
  503. }
  504. else if (entry.AmmunitionGroup == "Heavy Shotshell")
  505. {
  506. HeavyShotshell.IncludedCalibers.Add(entry);
  507. }
  508. }
  509.  
  510. }
  511.  
  512.  
  513.  
  514. Random roller = new Random();
  515. Random roller2 = new Random();
  516. Random roller3 = new Random();
  517. Random roller4 = new Random();
  518. Random roller5 = new Random();
  519. Random roller6 = new Random();
  520. Random roller7 = new Random();
  521. Random roller8 = new Random();
  522. Random roller9 = new Random();
  523. Random roller10 = new Random();
  524.  
  525. Random handgunroller = new Random();
  526. Random PDWroller = new Random();
  527. Random rifleroller = new Random();
  528. Random shotgunroller = new Random();
  529. Random mgroller = new Random();
  530. Random rocketroller = new Random();
  531. Random glroller = new Random();
  532.  
  533. // This basically checks the restrictor slider to see what guns are actually allowed
  534. switch (RestrictionTrackbar.Value)
  535. {
  536. case 1: // No license. This doesn't work so I had to remove it. So it does nothing.
  537. {
  538. foreach (List<Firearm> list in MasterGunInventory.Values)
  539. {
  540. foreach (Firearm entry in list.ToList())
  541. {
  542. if (list.Count != 0)
  543. {
  544. if (entry.License == "L" || entry.License == "R" || entry.License == "M&P" || entry.License == "I")
  545. {
  546. list.Remove(entry);
  547. }
  548. }
  549. }
  550.  
  551. }
  552.  
  553.  
  554.  
  555.  
  556. }
  557. break;
  558. case 2: // Licensed only
  559. {
  560. foreach (List<Firearm> list in MasterGunInventory.Values)
  561. {
  562. foreach (Firearm entry in list.ToList())
  563. {
  564. if (entry.License == "R" || entry.License == "M&P" || entry.License == "I")
  565. {
  566.  
  567. list.Remove(entry);
  568. }
  569.  
  570. }
  571.  
  572. }
  573.  
  574. }
  575. break;
  576. case 3: // Licensed and restricted only
  577. {
  578.  
  579.  
  580. foreach (List<Firearm> list in MasterGunInventory.Values)
  581. {
  582. foreach (Firearm entry in list.ToList())
  583. {
  584. if (entry.License == "M&P" || entry.License == "I")
  585. {
  586. list.Remove(entry);
  587.  
  588. }
  589. }
  590.  
  591. }
  592. }
  593. break;
  594. case 4: // Licensed restricted and MP only
  595. {
  596. foreach (List<Firearm> list in MasterGunInventory.Values)
  597. {
  598. foreach (Firearm entry in list.ToList())
  599. {
  600. if (entry.License == "I")
  601. {
  602.  
  603. list.Remove(entry);
  604. }
  605.  
  606. }
  607.  
  608. }
  609.  
  610. }
  611. break;
  612. case 5: // All guns available! I need this here becasue it breaks if I don't, for some reason
  613. {
  614.  
  615.  
  616.  
  617. }
  618. break;
  619. default:
  620. {
  621.  
  622. }
  623. break;
  624.  
  625. }
  626.  
  627.  
  628.  
  629.  
  630. int handgunfinish = new int();
  631. int pdwfinish = new int();
  632. int riflefinish = new int();
  633. int shotgunfinish = new int();
  634. int mgfinish = new int();
  635. int rocketfinish = new int();
  636. int glfinish = new int();
  637.  
  638. switch (WealthTrackbar.Value)
  639. {
  640. case 1: // Cheap guns!
  641. {
  642. List<string> handgunarray = new List<string>();
  643. List<string> shotgunarray = new List<string>();
  644. List<string> riflearray = new List<string>();
  645. List<string> pdwarray = new List<string>();
  646. //Cheap guns don't need a bellcurve roll because they're all cheapguns
  647. handgunarray.Add("cheapmodholdout");
  648. handgunarray.Add("cheapmodbackup");
  649. handgunarray.Add("cheapmodfull");
  650. handgunarray.Add("cheapmodtarget");
  651.  
  652. shotgunarray.Add("cheapmodcombat");
  653. shotgunarray.Add("cheapmodsport");
  654.  
  655. riflearray.Add("cheapmodassault");
  656. riflearray.Add("cheapmodcarb");
  657. riflearray.Add("cheapmoddmr");
  658. riflearray.Add("cheapmodsniper");
  659.  
  660. pdwarray.Add("cheapmodmp");
  661. pdwarray.Add("cheapmodsmg");
  662.  
  663. int handcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(HandgunTrackbar.Value) * .5), HandgunTrackbar.Value);
  664. int PDWcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(PDWTrackbar.Value) * .5), PDWTrackbar.Value);
  665. int riflecounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RifleTrackbar.Value) * .5), RifleTrackbar.Value);
  666. int shotguncounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(ShotgunTrackbar.Value) * .5), ShotgunTrackbar.Value);
  667. int whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
  668. int whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
  669. int whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
  670. int whichrifle = rifleroller.Next(0, riflearray.Count - 1);
  671. if (handcounter > 0)
  672. {
  673. handgunfinish = handcounter;
  674. }
  675. if (PDWcounter > 0)
  676. {
  677. pdwfinish = PDWcounter;
  678. }
  679. if (shotguncounter > 0)
  680. {
  681. shotgunfinish = shotguncounter;
  682. }
  683. if (riflecounter > 0)
  684. {
  685. riflefinish = riflecounter;
  686. }
  687. int handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
  688. int shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
  689. int pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
  690. int rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
  691.  
  692. int handguninventoryroller = new int();
  693. int shotguninventoryroller = new int();
  694. int pdwinventoryroller = new int();
  695. int rifleinventoryroller = new int();
  696.  
  697. if (handguninventory > 0)
  698. {
  699. handguninventoryroller = roller2.Next(0, handguninventory);
  700. }
  701. if (shotguninventory > 0)
  702. {
  703. shotguninventoryroller = roller2.Next(0, shotguninventory);
  704. }
  705. if (pdwinventory > 0)
  706. {
  707. pdwinventoryroller = roller2.Next(0, pdwinventory);
  708. }
  709. if (rifleinventory > 0)
  710. {
  711. rifleinventoryroller = roller2.Next(0, rifleinventory);
  712. }
  713.  
  714.  
  715.  
  716. string handgunstring = handgunarray.ElementAt(whichsizehandgun);
  717. string shotgunstring = shotgunarray.ElementAt(whichshotgun);
  718. string pdwstring = pdwarray.ElementAt(whichpdw);
  719. string riflestring = riflearray.ElementAt(whichrifle);
  720.  
  721. while (handcounter > 0)
  722. {
  723. if (MasterGunInventory[handgunstring].Count != 0 && MasterGunInventory.ContainsKey(handgunstring))
  724. {
  725. if (handgunfinish == handcounter)
  726. {
  727. Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
  728. GAfiringline.ShelvedFirearms.Add("__________________________Handguns__________________________" + Environment.NewLine + reassembler.ToString());
  729. handcounter--;
  730. }
  731. else
  732. {
  733.  
  734. Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
  735. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  736. handcounter--;
  737. }
  738. }
  739. else
  740. {
  741. handcounter = 0;
  742. }
  743. whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
  744. handgunstring = handgunarray.ElementAt(whichsizehandgun);
  745. handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
  746. handguninventoryroller = roller2.Next(0, handguninventory);
  747.  
  748. }
  749. while (shotguncounter > 0)
  750. {
  751. if (MasterGunInventory[shotgunstring].Count != 0 && MasterGunInventory.ContainsKey(shotgunstring))
  752. {
  753. if (shotgunfinish == shotguncounter)
  754. {
  755. Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
  756. GAfiringline.ShelvedFirearms.Add("__________________________Shotguns__________________________" + Environment.NewLine + reassembler.ToString());
  757. shotguncounter--;
  758. }
  759. else
  760. {
  761.  
  762. Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
  763. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  764. shotguncounter--;
  765. }
  766. }
  767. else
  768. {
  769. shotguncounter = 0;
  770. }
  771. whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
  772. shotgunstring = shotgunarray.ElementAt(whichshotgun);
  773. shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
  774. shotguninventoryroller = roller2.Next(0, shotguninventory);
  775. }
  776. while (riflecounter > 0)
  777. {
  778. if (MasterGunInventory[riflestring].Count != 0 && MasterGunInventory.ContainsKey(riflestring))
  779. {
  780. if (riflefinish == riflecounter)
  781. {
  782. Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
  783. GAfiringline.ShelvedFirearms.Add("__________________________Rifles__________________________" + Environment.NewLine + reassembler.ToString());
  784. riflecounter--;
  785. }
  786. else
  787. {
  788.  
  789. Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
  790. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  791. riflecounter--;
  792. }
  793. }
  794. else
  795. {
  796. riflecounter = 0;
  797. }
  798. whichrifle = rifleroller.Next(0, riflearray.Count - 1);
  799. riflestring = riflearray.ElementAt(whichrifle);
  800. rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
  801. rifleinventoryroller = roller2.Next(0, rifleinventory);
  802. }
  803.  
  804.  
  805.  
  806. while (PDWcounter > 0)
  807. {
  808. if (MasterGunInventory[pdwstring].Count != 0 && MasterGunInventory.ContainsKey(pdwstring))
  809. {
  810. if (pdwfinish == PDWcounter)
  811. {
  812. Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
  813. GAfiringline.ShelvedFirearms.Add("__________________________PDWs__________________________" + Environment.NewLine + reassembler.ToString());
  814. PDWcounter--;
  815. }
  816. else
  817. {
  818.  
  819. Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
  820. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  821. PDWcounter--;
  822. }
  823. }
  824. else
  825. {
  826. PDWcounter = 0;
  827. }
  828. whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
  829. pdwstring = pdwarray.ElementAt(whichpdw);
  830. pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
  831. pdwinventoryroller = roller2.Next(0, pdwinventory);
  832. }
  833.  
  834.  
  835. }
  836.  
  837.  
  838. break;
  839. case 2: // Inermediate guns! Not too costly, not too cheap.
  840. {
  841. int bellcurve = roller3.Next(1, 101);
  842. List<string> handgunarray = new List<string>();
  843. List<string> shotgunarray = new List<string>();
  844. List<string> riflearray = new List<string>();
  845. List<string> pdwarray = new List<string>();
  846.  
  847.  
  848.  
  849. if (Enumerable.Range(1, 5).Contains(bellcurve))
  850. {
  851. handgunarray.Add("cheapmodholdout");
  852. handgunarray.Add("cheapmodbackup");
  853. handgunarray.Add("cheapmodfull");
  854. handgunarray.Add("cheapmodtarget");
  855. }
  856. else
  857. {
  858. handgunarray.Add("midmodholdout");
  859. handgunarray.Add("midmodbackup");
  860. handgunarray.Add("midmodfull");
  861. handgunarray.Add("midmodtarget");
  862. }
  863. if (Enumerable.Range(1, 15).Contains(bellcurve))
  864. {
  865.  
  866. riflearray.Add("cheapmodassault");
  867. riflearray.Add("cheapmodcarb");
  868. riflearray.Add("cheapmoddmr");
  869. riflearray.Add("cheapmodsniper");
  870.  
  871. pdwarray.Add("cheapmodmp");
  872. pdwarray.Add("cheapmodsmg");
  873.  
  874. shotgunarray.Add("cheapmodcombat");
  875. shotgunarray.Add("cheapmodsport");
  876.  
  877. }
  878. else
  879. {
  880.  
  881.  
  882. shotgunarray.Add("midmodsport");
  883. shotgunarray.Add("cheapmodcombat");
  884.  
  885. riflearray.Add("midmodassault");
  886. riflearray.Add("midmodcarb");
  887. riflearray.Add("cheapmoddmr");
  888. riflearray.Add("cheapmodsniper");
  889.  
  890. pdwarray.Add("cheapmodmp");
  891. pdwarray.Add("cheapmodsmg");
  892.  
  893. }
  894.  
  895.  
  896.  
  897.  
  898. if (earlymodcheck.Checked == true)
  899. {
  900. handgunarray.Add("ww2full");
  901. handgunarray.Add("ww2back");
  902. handgunarray.Add("ww2hold");
  903.  
  904. riflearray.Add("ww2battle");
  905. riflearray.Add("ww2sniper");
  906. if (RestrictionTrackbar.Value >= 3)
  907. {
  908. pdwarray.Add("ww2smg");
  909. pdwarray.Add("ww2mp");
  910. }
  911.  
  912.  
  913. }
  914. if (lateinducheck.Checked == true)
  915. {
  916. handgunarray.Add("ww1full");
  917. handgunarray.Add("ww1back");
  918. handgunarray.Add("ww1hold");
  919. if (RestrictionTrackbar.Value >= 3)
  920. {
  921. pdwarray.Add("ww1smg");
  922. pdwarray.Add("ww1mp");
  923. }
  924. shotgunarray.Add("ww1combat");
  925.  
  926. riflearray.Add("ww1battle");
  927.  
  928. }
  929. if (induscheck.Checked == true)
  930. {
  931. handgunarray.Add("wildback");
  932. handgunarray.Add("wildfull");
  933.  
  934. shotgunarray.Add("wildcombat");
  935.  
  936. riflearray.Add("wildrifle");
  937. }
  938.  
  939.  
  940. int handcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(HandgunTrackbar.Value) * .5), HandgunTrackbar.Value);
  941. int PDWcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(PDWTrackbar.Value) * .5), PDWTrackbar.Value);
  942. int riflecounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RifleTrackbar.Value) * .5), RifleTrackbar.Value);
  943. int shotguncounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(ShotgunTrackbar.Value) * .5), ShotgunTrackbar.Value);
  944. int whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
  945. int whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
  946. int whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
  947. int whichrifle = rifleroller.Next(0, riflearray.Count - 1);
  948. if (handcounter > 0)
  949. {
  950. handgunfinish = handcounter;
  951. }
  952. if (PDWcounter > 0)
  953. {
  954. pdwfinish = PDWcounter;
  955. }
  956. if (shotguncounter > 0)
  957. {
  958. shotgunfinish = shotguncounter;
  959. }
  960. if (riflecounter > 0)
  961. {
  962. riflefinish = riflecounter;
  963. }
  964. int handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
  965.  
  966. int shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
  967.  
  968. int pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
  969.  
  970. int rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
  971.  
  972.  
  973. int handguninventoryroller = new int();
  974. int shotguninventoryroller = new int();
  975. int pdwinventoryroller = new int();
  976. int rifleinventoryroller = new int();
  977.  
  978. if (handguninventory > 0)
  979. {
  980. handguninventoryroller = roller2.Next(0, handguninventory);
  981. }
  982. if (shotguninventory > 0)
  983. {
  984. shotguninventoryroller = roller2.Next(0, shotguninventory);
  985. }
  986. if (pdwinventory > 0)
  987. {
  988. pdwinventoryroller = roller2.Next(0, pdwinventory);
  989. }
  990. if (rifleinventory > 0)
  991. {
  992. rifleinventoryroller = roller2.Next(0, rifleinventory);
  993. }
  994.  
  995.  
  996. string handgunstring = handgunarray.ElementAt(whichsizehandgun);
  997. string shotgunstring = shotgunarray.ElementAt(whichshotgun);
  998. string pdwstring = pdwarray.ElementAt(whichpdw);
  999. string riflestring = riflearray.ElementAt(whichrifle);
  1000.  
  1001. while (handcounter > 0)
  1002. {
  1003. if (Enumerable.Range(1, 5).Contains(bellcurve))
  1004. {
  1005. handgunarray.Add("cheapmodholdout");
  1006. handgunarray.Add("cheapmodbackup");
  1007. handgunarray.Add("cheapmodfull");
  1008. handgunarray.Add("cheapmodtarget");
  1009. }
  1010. else
  1011. {
  1012. handgunarray.Add("midmodholdout");
  1013. handgunarray.Add("midmodbackup");
  1014. handgunarray.Add("midmodfull");
  1015. handgunarray.Add("midmodtarget");
  1016. }
  1017. if (MasterGunInventory[handgunstring].Count != 0 && MasterGunInventory.ContainsKey(handgunstring))
  1018. {
  1019. if (handgunfinish == handcounter)
  1020. {
  1021. Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
  1022. GAfiringline.ShelvedFirearms.Add("__________________________Handguns__________________________" + Environment.NewLine + reassembler.ToString());
  1023. handcounter--;
  1024. }
  1025. else
  1026. {
  1027.  
  1028. Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
  1029. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1030. handcounter--;
  1031. }
  1032. }
  1033. else
  1034. {
  1035. handcounter = 0;
  1036. }
  1037. whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
  1038. handgunstring = handgunarray.ElementAt(whichsizehandgun);
  1039. handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
  1040. handguninventoryroller = roller2.Next(0, handguninventory);
  1041. bellcurve = roller3.Next(1, 101);
  1042.  
  1043. }
  1044. while (shotguncounter > 0)
  1045. {
  1046. if (Enumerable.Range(1, 15).Contains(bellcurve))
  1047. {
  1048. shotgunarray.Add("cheapmodcombat");
  1049. shotgunarray.Add("cheapmodsport");
  1050. }
  1051. else
  1052. {
  1053. shotgunarray.Add("midmodsport");
  1054. shotgunarray.Add("cheapmodcombat");
  1055. }
  1056. if (MasterGunInventory[shotgunstring].Count != 0 && MasterGunInventory.ContainsKey(shotgunstring))
  1057. {
  1058. if (shotgunfinish == shotguncounter)
  1059. {
  1060. Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
  1061. GAfiringline.ShelvedFirearms.Add("__________________________Shotguns__________________________" + Environment.NewLine + reassembler.ToString());
  1062. shotguncounter--;
  1063. }
  1064. else
  1065. {
  1066.  
  1067. Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
  1068. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1069. shotguncounter--;
  1070. }
  1071. }
  1072. else
  1073. {
  1074. shotguncounter = 0;
  1075. }
  1076. whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
  1077. shotgunstring = shotgunarray.ElementAt(whichshotgun);
  1078. shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
  1079. shotguninventoryroller = roller2.Next(0, shotguninventory);
  1080. bellcurve = roller3.Next(1, 101);
  1081. }
  1082. while (riflecounter > 0)
  1083. {
  1084. if (Enumerable.Range(1, 15).Contains(bellcurve))
  1085. {
  1086.  
  1087. riflearray.Add("cheapmodassault");
  1088. riflearray.Add("cheapmodcarb");
  1089. riflearray.Add("cheapmoddmr");
  1090. riflearray.Add("cheapmodsniper");
  1091.  
  1092. }
  1093. else
  1094. {
  1095.  
  1096. riflearray.Add("midmodassault");
  1097. riflearray.Add("midmodcarb");
  1098. riflearray.Add("cheapmoddmr");
  1099. riflearray.Add("cheapmodsniper");
  1100. }
  1101. if (MasterGunInventory[riflestring].Count != 0 && MasterGunInventory.ContainsKey(riflestring))
  1102. {
  1103. if (riflefinish == riflecounter)
  1104. {
  1105. Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
  1106. GAfiringline.ShelvedFirearms.Add("__________________________Rifles__________________________" + Environment.NewLine + reassembler.ToString());
  1107. riflecounter--;
  1108. }
  1109. else
  1110. {
  1111.  
  1112. Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
  1113. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1114. riflecounter--;
  1115. }
  1116. }
  1117. else
  1118. {
  1119. riflecounter = 0;
  1120. }
  1121. whichrifle = rifleroller.Next(0, riflearray.Count - 1);
  1122. riflestring = riflearray.ElementAt(whichrifle);
  1123. rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
  1124. rifleinventoryroller = roller2.Next(0, rifleinventory);
  1125. bellcurve = roller3.Next(1, 101);
  1126. }
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132. while (PDWcounter > 0)
  1133. {
  1134. if (MasterGunInventory[pdwstring].Count != 0 && MasterGunInventory.ContainsKey(pdwstring))
  1135. {
  1136. if (pdwfinish == PDWcounter)
  1137. {
  1138. Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
  1139. GAfiringline.ShelvedFirearms.Add("__________________________PDWs__________________________" + Environment.NewLine + reassembler.ToString());
  1140. PDWcounter--;
  1141. }
  1142. else
  1143. {
  1144.  
  1145. Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
  1146. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1147. PDWcounter--;
  1148. }
  1149. }
  1150. else
  1151. {
  1152. PDWcounter = 0;
  1153. }
  1154. whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
  1155. pdwstring = pdwarray.ElementAt(whichpdw);
  1156. pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
  1157. pdwinventoryroller = roller2.Next(0, pdwinventory);
  1158. bellcurve = roller3.Next(1, 101);
  1159. }
  1160.  
  1161.  
  1162.  
  1163.  
  1164. }
  1165.  
  1166.  
  1167. break;
  1168. case 3:
  1169. {
  1170. int bellcurve = roller3.Next(1, 101);
  1171. List<string> handgunarray = new List<string>();
  1172. List<string> shotgunarray = new List<string>();
  1173. List<string> riflearray = new List<string>();
  1174. List<string> pdwarray = new List<string>();
  1175. List<string> mgarray = new List<string>();
  1176. List<string> glarray = new List<string>();
  1177. List<string> rocketarray = new List<string>();
  1178.  
  1179. mgarray.Add("modlmg");
  1180. glarray.Add("modsag");
  1181. rocketarray.Add("modrocket");
  1182. if (RestrictionTrackbar.Value >= 4)
  1183. {
  1184.  
  1185. mgarray.Add("modgpmg");
  1186.  
  1187.  
  1188. }
  1189. if (Enumerable.Range(1, 3).Contains(bellcurve))
  1190. {
  1191. handgunarray.Add("cheapmodholdout");
  1192. handgunarray.Add("cheapmodbackup");
  1193. handgunarray.Add("cheapmodfull");
  1194. handgunarray.Add("cheapmodtarget");
  1195. }
  1196. else if (Enumerable.Range(4, 24).Contains(bellcurve))
  1197. {
  1198. handgunarray.Add("midmodholdout");
  1199. handgunarray.Add("midmodbackup");
  1200. handgunarray.Add("midmodfull");
  1201. handgunarray.Add("midmodtarget");
  1202. }
  1203. else
  1204. {
  1205. handgunarray.Add("expenmodholdout");
  1206. handgunarray.Add("expenmodbackup");
  1207. handgunarray.Add("expenmodfull");
  1208. handgunarray.Add("expenmodtarget");
  1209. }
  1210. if (Enumerable.Range(1, 10).Contains(bellcurve))
  1211. {
  1212.  
  1213. riflearray.Add("cheapmodassault");
  1214. riflearray.Add("cheapmodcarb");
  1215. riflearray.Add("cheapmoddmr");
  1216. riflearray.Add("cheapmodsniper");
  1217.  
  1218. pdwarray.Add("cheapmodmp");
  1219. pdwarray.Add("cheapmodsmg");
  1220.  
  1221. shotgunarray.Add("cheapmodcombat");
  1222. shotgunarray.Add("cheapmodsport");
  1223.  
  1224. }
  1225. else if (Enumerable.Range(11, 30).Contains(bellcurve))
  1226. {
  1227. shotgunarray.Add("midmodsport");
  1228. shotgunarray.Add("expenmodsport");
  1229. shotgunarray.Add("expenmodcombat");
  1230. riflearray.Add("midmodassault");
  1231. riflearray.Add("midmodcarb");
  1232.  
  1233. pdwarray.Add("expenmodmp");
  1234. pdwarray.Add("expenmodsmg");
  1235.  
  1236. }
  1237. else
  1238. {
  1239. riflearray.Add("expenmodassault");
  1240. riflearray.Add("expenmodcarb");
  1241. riflearray.Add("expenmoddmr");
  1242. riflearray.Add("expenmodsniper");
  1243. if (RestrictionTrackbar.Value >= 3)
  1244. {
  1245. riflearray.Add("modanti");
  1246. }
  1247. pdwarray.Add("expenmodmp");
  1248. pdwarray.Add("expenmodsmg");
  1249.  
  1250. shotgunarray.Add("expenmodsport");
  1251. shotgunarray.Add("expenmodcombat");
  1252. }
  1253. if (earlymodcheck.Checked == true)
  1254. {
  1255. handgunarray.Add("ww2full");
  1256. handgunarray.Add("ww2back");
  1257. handgunarray.Add("ww2hold");
  1258.  
  1259. riflearray.Add("ww2battle");
  1260. riflearray.Add("ww2sniper");
  1261. if (RestrictionTrackbar.Value >= 3)
  1262. {
  1263. pdwarray.Add("ww2smg");
  1264. pdwarray.Add("ww2mp");
  1265. mgarray.Add("ww2lmg");
  1266. mgarray.Add("ww2gpmg");
  1267. pdwarray.Add("koreasmg");
  1268. riflearray.Add("ww2anti");
  1269. }
  1270. else if (RestrictionTrackbar.Value >= 4)
  1271. {
  1272.  
  1273. glarray.Add("korearocket");
  1274. glarray.Add("ww2rocket");
  1275. }
  1276.  
  1277. }
  1278. if (lateinducheck.Checked == true)
  1279. {
  1280. handgunarray.Add("ww1full");
  1281. handgunarray.Add("ww1back");
  1282. handgunarray.Add("ww1hold");
  1283. if (RestrictionTrackbar.Value >= 3)
  1284. {
  1285. pdwarray.Add("ww1smg");
  1286. pdwarray.Add("ww1mp");
  1287. mgarray.Add("ww1lmg");
  1288.  
  1289. }
  1290. shotgunarray.Add("ww1combat");
  1291.  
  1292. riflearray.Add("ww1battle");
  1293.  
  1294. }
  1295. if (induscheck.Checked == true)
  1296. {
  1297. handgunarray.Add("wildback");
  1298. handgunarray.Add("wildfull");
  1299.  
  1300. shotgunarray.Add("wildcombat");
  1301.  
  1302. riflearray.Add("wildrifle");
  1303. }
  1304.  
  1305.  
  1306. int handcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(HandgunTrackbar.Value) * .5), HandgunTrackbar.Value);
  1307. int PDWcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(PDWTrackbar.Value) * .5), PDWTrackbar.Value);
  1308. int riflecounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RifleTrackbar.Value) * .5), RifleTrackbar.Value);
  1309. int shotguncounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(ShotgunTrackbar.Value) * .5), ShotgunTrackbar.Value);
  1310. int mgcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(MGTrackbar.Value) * .5), MGTrackbar.Value);
  1311. int rlaunchcounter = roller2.Next(Convert.ToInt32(Convert.ToDouble(RocketLauncherTrackbar.Value) * .5), RocketLauncherTrackbar.Value);
  1312. int glaunchercounter = roller10.Next(Convert.ToInt32(Convert.ToDouble(GrenadeLauncherTrackbar.Value) * .5), GrenadeLauncherTrackbar.Value);
  1313.  
  1314. int whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
  1315. int whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
  1316. int whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
  1317. int whichrifle = rifleroller.Next(0, riflearray.Count - 1);
  1318. int whichmg = mgroller.Next(0, mgarray.Count - 1);
  1319. int whichgl = glroller.Next(0, glarray.Count - 1);
  1320. int whichrocket = rocketroller.Next(0, rocketarray.Count - 1);
  1321.  
  1322. if (handcounter > 0)
  1323. {
  1324. handgunfinish = handcounter;
  1325. }
  1326. else if (PDWcounter > 0)
  1327. {
  1328. pdwfinish = PDWcounter;
  1329. }
  1330. else if (shotguncounter > 0)
  1331. {
  1332. shotgunfinish = shotguncounter;
  1333. }
  1334. else if (riflecounter > 0)
  1335. {
  1336. riflefinish = riflecounter;
  1337. }
  1338. else if (mgcounter > 0)
  1339. {
  1340. mgfinish = mgcounter;
  1341. }
  1342. if (RestrictionTrackbar.Value >= 4)
  1343. {
  1344. if (rlaunchcounter > 0)
  1345. {
  1346.  
  1347. rocketfinish = rlaunchcounter;
  1348. }
  1349. }
  1350. else if (glaunchercounter > 0)
  1351. {
  1352. glfinish = glaunchercounter;
  1353. }
  1354. else { }
  1355.  
  1356. int handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
  1357.  
  1358. int shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
  1359.  
  1360. int pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
  1361.  
  1362. int rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
  1363.  
  1364. int mginventory = MasterGunInventory[mgarray.ElementAt(whichmg)].Count - 1;
  1365.  
  1366. int glinventory = MasterGunInventory[glarray.ElementAt(whichgl)].Count - 1;
  1367.  
  1368. int rocketinventory = new int();
  1369. if (RestrictionTrackbar.Value >= 4)
  1370. {
  1371.  
  1372. rocketinventory = MasterRocketInventory[rocketarray.ElementAt(whichrocket)].Count - 1;
  1373.  
  1374. }
  1375. int handguninventoryroller = new int();
  1376. int shotguninventoryroller = new int();
  1377. int pdwinventoryroller = new int();
  1378. int rifleinventoryroller = new int();
  1379. int mginventoryroller = new int();
  1380. int glinventoryroller = new int();
  1381. int rocketinventoryroller = new int();
  1382.  
  1383.  
  1384. if (handguninventory > 0)
  1385. {
  1386. handguninventoryroller = roller2.Next(0, handguninventory);
  1387. }
  1388. if (shotguninventory > 0)
  1389. {
  1390. shotguninventoryroller = roller2.Next(0, shotguninventory);
  1391. }
  1392. if (pdwinventory > 0)
  1393. {
  1394. pdwinventoryroller = roller2.Next(0, pdwinventory);
  1395. }
  1396. if (rifleinventory > 0)
  1397. {
  1398. rifleinventoryroller = roller2.Next(0, rifleinventory);
  1399. }
  1400. if (mginventory > 0)
  1401. {
  1402. mginventoryroller = roller2.Next(0, mginventory);
  1403. }
  1404. if (glinventory > 0)
  1405. {
  1406. glinventoryroller = roller2.Next(0, glinventory);
  1407. }
  1408.  
  1409. if (RestrictionTrackbar.Value >= 4)
  1410. {
  1411.  
  1412. if (rocketinventory > 0)
  1413. {
  1414. rocketinventory = roller3.Next(0, rocketinventory);
  1415. }
  1416. }
  1417. string handgunstring = handgunarray.ElementAt(whichsizehandgun);
  1418. string shotgunstring = shotgunarray.ElementAt(whichshotgun);
  1419. string pdwstring = pdwarray.ElementAt(whichpdw);
  1420. string riflestring = riflearray.ElementAt(whichrifle);
  1421. string mgstring = mgarray.ElementAt(whichmg);
  1422. string glstring = glarray.ElementAt(whichgl);
  1423. string rocketstring = rocketarray.ElementAt(whichrocket);
  1424. while (handcounter > 0)
  1425. {
  1426. if (Enumerable.Range(1, 3).Contains(bellcurve))
  1427. {
  1428. handgunarray.Add("cheapmodholdout");
  1429. handgunarray.Add("cheapmodbackup");
  1430. handgunarray.Add("cheapmodfull");
  1431. handgunarray.Add("cheapmodtarget");
  1432. }
  1433. else if (Enumerable.Range(4, 24).Contains(bellcurve))
  1434. {
  1435. handgunarray.Add("midmodholdout");
  1436. handgunarray.Add("midmodbackup");
  1437. handgunarray.Add("midmodfull");
  1438. handgunarray.Add("midmodtarget");
  1439. }
  1440. else
  1441. {
  1442. handgunarray.Add("expenmodholdout");
  1443. handgunarray.Add("expenmodbackup");
  1444. handgunarray.Add("expenmodfull");
  1445. handgunarray.Add("expenmodtarget");
  1446. }
  1447.  
  1448. if (MasterGunInventory[handgunstring].Count != 0 && MasterGunInventory.ContainsKey(handgunstring))
  1449. {
  1450. if (handgunfinish == handcounter)
  1451. {
  1452. Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
  1453. GAfiringline.ShelvedFirearms.Add("__________________________Handguns__________________________" + Environment.NewLine + reassembler.ToString());
  1454. handcounter--;
  1455. }
  1456. else
  1457. {
  1458.  
  1459. Firearm reassembler = MasterGunInventory[handgunstring][handguninventoryroller];
  1460. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1461. handcounter--;
  1462. }
  1463. }
  1464. else
  1465. {
  1466. handcounter = 0;
  1467. }
  1468. whichsizehandgun = handgunroller.Next(0, handgunarray.Count - 1);
  1469. handgunstring = handgunarray.ElementAt(whichsizehandgun);
  1470. handguninventory = MasterGunInventory[handgunarray.ElementAt(whichsizehandgun)].Count - 1;
  1471. handguninventoryroller = roller2.Next(0, handguninventory);
  1472. bellcurve = roller3.Next(1, 101);
  1473.  
  1474. }
  1475. while (shotguncounter > 0)
  1476. {
  1477. if (Enumerable.Range(1, 10).Contains(bellcurve))
  1478. {
  1479. shotgunarray.Add("cheapmodcombat");
  1480. shotgunarray.Add("cheapmodsport");
  1481. }
  1482. else
  1483. {
  1484. shotgunarray.Add("midmodsport");
  1485. shotgunarray.Add("expenmodsport");
  1486. shotgunarray.Add("expenmodcombat");
  1487. }
  1488. if (MasterGunInventory[shotgunstring].Count != 0 && MasterGunInventory.ContainsKey(shotgunstring))
  1489. {
  1490. if (shotgunfinish == shotguncounter)
  1491. {
  1492. Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
  1493. GAfiringline.ShelvedFirearms.Add("__________________________Shotguns__________________________" + Environment.NewLine + reassembler.ToString());
  1494. shotguncounter--;
  1495. }
  1496. else
  1497. {
  1498.  
  1499. Firearm reassembler = MasterGunInventory[shotgunstring][shotguninventoryroller];
  1500. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1501. shotguncounter--;
  1502. }
  1503. }
  1504. else
  1505. {
  1506. shotguncounter = 0;
  1507. }
  1508. whichshotgun = shotgunroller.Next(0, shotgunarray.Count - 1);
  1509. shotgunstring = shotgunarray.ElementAt(whichshotgun);
  1510. shotguninventory = MasterGunInventory[shotgunarray.ElementAt(whichshotgun)].Count - 1;
  1511. shotguninventoryroller = roller2.Next(0, shotguninventory);
  1512. bellcurve = roller3.Next(1, 101);
  1513. }
  1514. while (riflecounter > 0)
  1515. {
  1516. if (Enumerable.Range(1, 10).Contains(bellcurve))
  1517. {
  1518.  
  1519. riflearray.Add("cheapmodassault");
  1520. riflearray.Add("cheapmodcarb");
  1521. riflearray.Add("cheapmoddmr");
  1522. riflearray.Add("cheapmodsniper");
  1523. }
  1524. else if (Enumerable.Range(11, 30).Contains(bellcurve))
  1525. {
  1526. riflearray.Add("midmodassault");
  1527. riflearray.Add("midmodcarb");
  1528. }
  1529. else
  1530. {
  1531. riflearray.Add("expenmodassault");
  1532. riflearray.Add("expenmodcarb");
  1533. riflearray.Add("expenmoddmr");
  1534. riflearray.Add("expenmodsniper");
  1535. if (RestrictionTrackbar.Value >= 3)
  1536. {
  1537. riflearray.Add("modanti");
  1538. }
  1539. }
  1540.  
  1541.  
  1542. if (MasterGunInventory[riflestring].Count != 0 && MasterGunInventory.ContainsKey(riflestring))
  1543. {
  1544. if (riflefinish == riflecounter)
  1545. {
  1546. Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
  1547. GAfiringline.ShelvedFirearms.Add("__________________________Rifles__________________________" + Environment.NewLine + reassembler.ToString());
  1548. riflecounter--;
  1549. }
  1550. else
  1551. {
  1552.  
  1553. Firearm reassembler = MasterGunInventory[riflestring][rifleinventoryroller];
  1554. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1555. riflecounter--;
  1556. }
  1557. }
  1558. else
  1559. {
  1560. riflecounter = 0;
  1561. }
  1562. whichrifle = rifleroller.Next(0, riflearray.Count - 1);
  1563. riflestring = riflearray.ElementAt(whichrifle);
  1564. rifleinventory = MasterGunInventory[riflearray.ElementAt(whichrifle)].Count - 1;
  1565. rifleinventoryroller = roller2.Next(0, rifleinventory);
  1566. bellcurve = roller3.Next(1, 101);
  1567. }
  1568.  
  1569. while (PDWcounter > 0)
  1570. {
  1571. if (Enumerable.Range(1, 10).Contains(bellcurve))
  1572. {
  1573. pdwarray.Add("cheapmodmp");
  1574. pdwarray.Add("cheapmodsmg");
  1575. }
  1576. else
  1577. {
  1578.  
  1579. pdwarray.Add("expenmodmp");
  1580. pdwarray.Add("expenmodsmg");
  1581. }
  1582. if (MasterGunInventory[pdwstring].Count != 0 && MasterGunInventory.ContainsKey(pdwstring))
  1583. {
  1584. if (pdwfinish == PDWcounter)
  1585. {
  1586. Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
  1587. GAfiringline.ShelvedFirearms.Add("__________________________PDWs__________________________" + Environment.NewLine + reassembler.ToString());
  1588. PDWcounter--;
  1589. }
  1590. else
  1591. {
  1592.  
  1593. Firearm reassembler = MasterGunInventory[pdwstring][pdwinventoryroller];
  1594. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1595. PDWcounter--;
  1596. }
  1597. }
  1598. else
  1599. {
  1600. PDWcounter = 0;
  1601. }
  1602. whichpdw = PDWroller.Next(0, pdwarray.Count - 1);
  1603. pdwstring = pdwarray.ElementAt(whichpdw);
  1604. pdwinventory = MasterGunInventory[pdwarray.ElementAt(whichpdw)].Count - 1;
  1605. pdwinventoryroller = roller2.Next(0, pdwinventory);
  1606. bellcurve = roller3.Next(1, 101);
  1607. }
  1608. while (mgcounter > 0)
  1609. {
  1610. if (MasterGunInventory[mgstring].Count != 0 && MasterGunInventory.ContainsKey(mgstring))
  1611. {
  1612. if (mgfinish == mgcounter)
  1613. {
  1614. Firearm reassembler = MasterGunInventory[mgstring][mginventoryroller];
  1615. GAfiringline.ShelvedFirearms.Add("__________________________Machine Guns__________________________" + Environment.NewLine + reassembler.ToString());
  1616. mgcounter--;
  1617. }
  1618. else
  1619. {
  1620.  
  1621. Firearm reassembler = MasterGunInventory[mgstring][mginventoryroller];
  1622. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1623. mgcounter--;
  1624. }
  1625. }
  1626. else
  1627. {
  1628. mgcounter = 0;
  1629. }
  1630. whichmg = mgroller.Next(0, mgarray.Count - 1);
  1631. mgstring = mgarray.ElementAt(whichmg);
  1632. mginventory = MasterGunInventory[mgarray.ElementAt(whichmg)].Count - 1;
  1633. mginventoryroller = roller2.Next(0, mginventory);
  1634. bellcurve = roller3.Next(1, 101);
  1635. }
  1636. while (glaunchercounter > 0)
  1637. {
  1638. if (MasterGunInventory[mgstring].Count != 0 && MasterGunInventory.ContainsKey(mgstring))
  1639. {
  1640. if (glfinish == glaunchercounter)
  1641. {
  1642. Firearm reassembler = MasterGunInventory[glstring][glinventoryroller];
  1643. GAfiringline.ShelvedFirearms.Add("__________________________Grenade Launchers__________________________" + Environment.NewLine + reassembler.ToString());
  1644. glaunchercounter--;
  1645. }
  1646. else
  1647. {
  1648.  
  1649. Firearm reassembler = MasterGunInventory[glstring][glinventoryroller];
  1650. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1651. glaunchercounter--;
  1652. }
  1653. }
  1654. else
  1655. {
  1656. glaunchercounter = 0;
  1657. }
  1658. whichgl = glroller.Next(0, glarray.Count - 1);
  1659. glstring = glarray.ElementAt(whichgl);
  1660. glinventory = MasterGunInventory[glarray.ElementAt(whichgl)].Count - 1;
  1661. glinventoryroller = roller2.Next(0, glinventory);
  1662. bellcurve = roller3.Next(1, 101);
  1663. }
  1664. if (RestrictionTrackbar.Value >= 4)
  1665. {
  1666. while (rlaunchcounter > 0)
  1667. {
  1668. if (MasterRocketInventory.Keys != null)
  1669. {
  1670. if (MasterRocketInventory[rocketstring].Count != 0 && MasterRocketInventory.ContainsKey(rocketstring))
  1671. {
  1672. if (rocketfinish == rlaunchcounter)
  1673. {
  1674. Rocket reassembler = MasterRocketInventory[rocketstring][rocketinventoryroller];
  1675. GAfiringline.ShelvedFirearms.Add("__________________________Grenade Launchers__________________________" + Environment.NewLine + reassembler.ToString());
  1676. rlaunchcounter--;
  1677. }
  1678. else
  1679. {
  1680.  
  1681. Rocket reassembler = MasterRocketInventory[rocketstring][rocketinventoryroller];
  1682. GAfiringline.ShelvedFirearms.Add(reassembler.ToString());
  1683. rlaunchcounter--;
  1684. }
  1685. }
  1686. else
  1687. {
  1688. rlaunchcounter = 0;
  1689. }
  1690. whichrocket = rocketroller.Next(0, rocketarray.Count - 1);
  1691. rocketstring = rocketarray.ElementAt(whichrocket);
  1692. rocketinventory = MasterRocketInventory[rocketarray.ElementAt(whichrocket)].Count - 1;
  1693. rocketinventoryroller = roller2.Next(0, rocketinventory);
  1694. bellcurve = roller3.Next(1, 101);
  1695. }
  1696. }
  1697. }
  1698. }
  1699.  
  1700.  
  1701.  
  1702.  
  1703. break;
  1704. default:
  1705. {
  1706.  
  1707. }
  1708. break;
  1709.  
  1710. }
  1711.  
  1712. //This is a tester to print ammo
  1713. StringBuilder ammotester = new StringBuilder();
  1714. StringBuilder shelftester = new StringBuilder();
  1715.  
  1716. int rimstatic = Rimfire.AmmoBox.Count;
  1717. int lightrimstatic = LightRimless.AmmoBox.Count;
  1718. int interrimstatic = IntermediateRimless.AmmoBox.Count;
  1719. int heavyrimstatic = HeavyRimless.AmmoBox.Count;
  1720. int lightrimedstatic = LightRimmed.AmmoBox.Count;
  1721. int heavyrimedstatic = HeavyRimmed.AmmoBox.Count;
  1722. int lightriflestatic = LightRifle.AmmoBox.Count;
  1723. int interriflestatic = IntermediateRifle.AmmoBox.Count;
  1724. int heavyriflestatic = HeavyRifle.AmmoBox.Count;
  1725. int superheavyriflestatic = SuperheavyRifle.AmmoBox.Count;
  1726. int lightshotshellstatic = LightShotshell.AmmoBox.Count;
  1727. int intershotshellstatic = IntermediateShotshell.AmmoBox.Count;
  1728. int heavyshotshellstatic = HeavyShotshell.AmmoBox.Count;
  1729.  
  1730. int ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1731.  
  1732. foreach (AmmoBox bang in Rimfire.AmmoBox.ToList())
  1733. {
  1734.  
  1735. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1736. }
  1737.  
  1738. Random Boxobullets = new Random();
  1739. int rimfirecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1740. int lightrimlesscountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1741. int interrimlesscountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1742. int heavyrimlesscountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1743. int lightrimmedcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1744. int heavyrimmedcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1745. int lightriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1746. int interriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1747. int heavyriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1748. int superheavyriflecountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1749. int lightshotshellcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1750. int intershotshellcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1751. int heavyshotshellcountdown = Boxobullets.Next(Convert.ToInt32(Convert.ToDouble(AmmoTrackbar.Value) * .5), AmmoTrackbar.Value);
  1752.  
  1753.  
  1754. int numberofrims = rimstatic - 1;
  1755. int numberoflightrimless = lightrimstatic - 1;
  1756. int numberofinterrimless = interrimstatic - 1;
  1757. int numberofheavyrimless = heavyrimstatic - 1;
  1758. int numberoflightrimmed = lightrimedstatic - 1;
  1759. int numberofheavyrimmed = heavyrimstatic - 1;
  1760. int numberlightrifle = lightriflestatic - 1;
  1761. int numberinterrifle = interriflestatic - 1;
  1762. int numberheavyrifle = heavyriflestatic - 1;
  1763. int numbersuperheavyrifle = superheavyriflestatic - 1;
  1764. int numberlightshot = lightshotshellstatic - 1;
  1765. int numberintershot = intershotshellstatic - 1;
  1766. int numberheavyshot = heavyshotshellstatic - 1;
  1767.  
  1768.  
  1769.  
  1770.  
  1771. int whichrimfire = Boxobullets.Next(0, numberofrims);
  1772. int whichLRL = Boxobullets.Next(0, numberoflightrimless);
  1773. int whichIRL = Boxobullets.Next(0, numberofinterrimless);
  1774. int whichHRL = Boxobullets.Next(0, numberofheavyrimless);
  1775. int whichLRM = Boxobullets.Next(0, numberoflightrimmed);
  1776. int whichHRM = Boxobullets.Next(0, numberofheavyrimmed);
  1777. int whichLR = Boxobullets.Next(0, numberlightrifle);
  1778. int whichIR = Boxobullets.Next(0, numberinterrifle);
  1779. int whichHR = Boxobullets.Next(0, numberheavyrifle);
  1780. int whichSHR = Boxobullets.Next(0, numbersuperheavyrifle);
  1781.  
  1782. int whichLS = Boxobullets.Next(0, numberlightshot);
  1783. int whichIS = Boxobullets.Next(0, numberintershot);
  1784. int whichHS = Boxobullets.Next(0, numberheavyshot);
  1785.  
  1786.  
  1787. int boxcount = Boxobullets.Next(1, 11);
  1788.  
  1789. while (rimfirecountdown != 0)
  1790. {
  1791.  
  1792. AmmoShelf holder = new AmmoShelf();
  1793. AmmoShelf tester = new AmmoShelf();
  1794.  
  1795. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1796.  
  1797. while (boxcount != 0)
  1798. {
  1799. if (holder.AmountOfBoxes == 0)
  1800. {
  1801.  
  1802. holder.AmmoBox = Rimfire.AmmoBox[whichrimfire];
  1803. holder.AmmoCat = Rimfire;
  1804. holder.AmountOfBoxes++;
  1805. boxcount--;
  1806. }
  1807. else
  1808. {
  1809. holder.AmountOfBoxes++;
  1810. boxcount--;
  1811. }
  1812. }
  1813.  
  1814.  
  1815.  
  1816. GAfiringline.ShelvedAmmo.Add(holder);
  1817. rimfirecountdown--;
  1818. whichrimfire = Boxobullets.Next(0, numberofrims);
  1819. boxcount = Boxobullets.Next(1, 11);
  1820.  
  1821.  
  1822. }
  1823. while (lightrimlesscountdown != 0)
  1824. {
  1825.  
  1826. AmmoShelf holder = new AmmoShelf();
  1827. AmmoShelf tester = new AmmoShelf();
  1828.  
  1829. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1830.  
  1831. while (boxcount != 0)
  1832. {
  1833. if (holder.AmountOfBoxes == 0)
  1834. {
  1835.  
  1836. holder.AmmoBox = LightRimless.AmmoBox[whichLRL];
  1837. holder.AmmoCat = LightRimless;
  1838. holder.AmountOfBoxes++;
  1839. boxcount--;
  1840. }
  1841. else
  1842. {
  1843. holder.AmountOfBoxes++;
  1844. boxcount--;
  1845. }
  1846. }
  1847.  
  1848.  
  1849.  
  1850. GAfiringline.ShelvedAmmo.Add(holder);
  1851. lightrimlesscountdown--;
  1852. whichLRL = Boxobullets.Next(0, numberoflightrimless);
  1853. boxcount = Boxobullets.Next(1, 11);
  1854.  
  1855.  
  1856. }
  1857. while (interrimlesscountdown != 0)
  1858. {
  1859.  
  1860. AmmoShelf holder = new AmmoShelf();
  1861. AmmoShelf tester = new AmmoShelf();
  1862.  
  1863. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1864.  
  1865. while (boxcount != 0)
  1866. {
  1867. if (holder.AmountOfBoxes == 0)
  1868. {
  1869.  
  1870. holder.AmmoBox = IntermediateRimless.AmmoBox[whichIRL];
  1871. holder.AmmoCat = IntermediateRimless;
  1872. holder.AmountOfBoxes++;
  1873. boxcount--;
  1874. }
  1875. else
  1876. {
  1877. holder.AmountOfBoxes++;
  1878. boxcount--;
  1879. }
  1880. }
  1881.  
  1882.  
  1883.  
  1884. GAfiringline.ShelvedAmmo.Add(holder);
  1885. interrimlesscountdown--;
  1886. whichIRL = Boxobullets.Next(0, numberofinterrimless);
  1887. boxcount = Boxobullets.Next(1, 11);
  1888.  
  1889.  
  1890. }
  1891. while (heavyrimlesscountdown != 0)
  1892. {
  1893.  
  1894. AmmoShelf holder = new AmmoShelf();
  1895. AmmoShelf tester = new AmmoShelf();
  1896.  
  1897. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1898.  
  1899. while (boxcount != 0)
  1900. {
  1901. if (holder.AmountOfBoxes == 0)
  1902. {
  1903.  
  1904. holder.AmmoBox = HeavyRimless.AmmoBox[whichHRL];
  1905. holder.AmmoCat = HeavyRimless;
  1906. holder.AmountOfBoxes++;
  1907. boxcount--;
  1908. }
  1909. else
  1910. {
  1911. holder.AmountOfBoxes++;
  1912. boxcount--;
  1913. }
  1914. }
  1915.  
  1916.  
  1917.  
  1918. GAfiringline.ShelvedAmmo.Add(holder);
  1919. heavyrimlesscountdown--;
  1920. whichHRL = Boxobullets.Next(0, numberofheavyrimless);
  1921. boxcount = Boxobullets.Next(1, 11);
  1922.  
  1923.  
  1924. }
  1925. while (lightrimmedcountdown != 0)
  1926. {
  1927.  
  1928. AmmoShelf holder = new AmmoShelf();
  1929. AmmoShelf tester = new AmmoShelf();
  1930.  
  1931. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1932.  
  1933. while (boxcount != 0)
  1934. {
  1935. if (holder.AmountOfBoxes == 0)
  1936. {
  1937.  
  1938. holder.AmmoBox = LightRimmed.AmmoBox[whichLRM];
  1939. holder.AmmoCat = LightRimmed;
  1940. holder.AmountOfBoxes++;
  1941. boxcount--;
  1942. }
  1943. else
  1944. {
  1945. holder.AmountOfBoxes++;
  1946. boxcount--;
  1947. }
  1948. }
  1949.  
  1950.  
  1951.  
  1952. GAfiringline.ShelvedAmmo.Add(holder);
  1953. lightrimmedcountdown--;
  1954. whichLRM = Boxobullets.Next(0, numberoflightrimmed);
  1955. boxcount = Boxobullets.Next(1, 11);
  1956.  
  1957.  
  1958. }
  1959. while (heavyrimmedcountdown != 0)
  1960. {
  1961.  
  1962. AmmoShelf holder = new AmmoShelf();
  1963. AmmoShelf tester = new AmmoShelf();
  1964.  
  1965. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  1966.  
  1967. while (boxcount != 0)
  1968. {
  1969. if (holder.AmountOfBoxes == 0)
  1970. {
  1971.  
  1972. holder.AmmoBox = HeavyRimmed.AmmoBox[whichHRM];
  1973. holder.AmmoCat = HeavyRimmed;
  1974. holder.AmountOfBoxes++;
  1975. boxcount--;
  1976. }
  1977. else
  1978. {
  1979. holder.AmountOfBoxes++;
  1980. boxcount--;
  1981. }
  1982. }
  1983.  
  1984.  
  1985.  
  1986. GAfiringline.ShelvedAmmo.Add(holder);
  1987. heavyrimmedcountdown--;
  1988. whichHRM = Boxobullets.Next(0, numberofheavyrimmed);
  1989. boxcount = Boxobullets.Next(1, 11);
  1990.  
  1991.  
  1992. }
  1993. while (lightriflecountdown != 0)
  1994. {
  1995.  
  1996. AmmoShelf holder = new AmmoShelf();
  1997. AmmoShelf tester = new AmmoShelf();
  1998.  
  1999. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2000.  
  2001. while (boxcount != 0)
  2002. {
  2003. if (holder.AmountOfBoxes == 0)
  2004. {
  2005.  
  2006. holder.AmmoBox = LightRifle.AmmoBox[whichLR];
  2007. holder.AmmoCat = LightRifle;
  2008. holder.AmountOfBoxes++;
  2009. boxcount--;
  2010. }
  2011. else
  2012. {
  2013. holder.AmountOfBoxes++;
  2014. boxcount--;
  2015. }
  2016. }
  2017.  
  2018.  
  2019.  
  2020. GAfiringline.ShelvedAmmo.Add(holder);
  2021. lightriflecountdown--;
  2022. whichLR = Boxobullets.Next(0, numberlightrifle);
  2023. boxcount = Boxobullets.Next(1, 11);
  2024.  
  2025.  
  2026. }
  2027. while (interriflecountdown != 0)
  2028. {
  2029.  
  2030. AmmoShelf holder = new AmmoShelf();
  2031. AmmoShelf tester = new AmmoShelf();
  2032.  
  2033.  
  2034.  
  2035. while (boxcount != 0)
  2036. {
  2037. if (holder.AmountOfBoxes == 0)
  2038. {
  2039.  
  2040. holder.AmmoBox = IntermediateRifle.AmmoBox[whichIR];
  2041. holder.AmmoCat = IntermediateRifle;
  2042. holder.AmountOfBoxes++;
  2043. boxcount--;
  2044. }
  2045. else
  2046. {
  2047. holder.AmountOfBoxes++;
  2048. boxcount--;
  2049. }
  2050. }
  2051.  
  2052.  
  2053.  
  2054. GAfiringline.ShelvedAmmo.Add(holder);
  2055. interriflecountdown--;
  2056. whichIR = Boxobullets.Next(0, numberinterrifle);
  2057. boxcount = Boxobullets.Next(1, 11);
  2058.  
  2059.  
  2060. }
  2061. while (heavyriflecountdown != 0)
  2062. {
  2063.  
  2064. AmmoShelf holder = new AmmoShelf();
  2065. AmmoShelf tester = new AmmoShelf();
  2066.  
  2067. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2068.  
  2069. while (boxcount != 0)
  2070. {
  2071. if (holder.AmountOfBoxes == 0)
  2072. {
  2073.  
  2074. holder.AmmoBox = HeavyRifle.AmmoBox[whichHR];
  2075. holder.AmmoCat = HeavyRifle;
  2076. holder.AmountOfBoxes++;
  2077. boxcount--;
  2078. }
  2079. else
  2080. {
  2081. holder.AmountOfBoxes++;
  2082. boxcount--;
  2083. }
  2084. }
  2085.  
  2086.  
  2087.  
  2088. GAfiringline.ShelvedAmmo.Add(holder);
  2089. heavyriflecountdown--;
  2090. whichHR = Boxobullets.Next(0, numberheavyrifle);
  2091. boxcount = Boxobullets.Next(1, 11);
  2092.  
  2093.  
  2094. }
  2095. while (superheavyriflecountdown != 0)
  2096. {
  2097.  
  2098. AmmoShelf holder = new AmmoShelf();
  2099. AmmoShelf tester = new AmmoShelf();
  2100.  
  2101. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2102.  
  2103. while (boxcount != 0)
  2104. {
  2105. if (holder.AmountOfBoxes == 0)
  2106. {
  2107.  
  2108. holder.AmmoBox = SuperheavyRifle.AmmoBox[whichSHR];
  2109. holder.AmmoCat = SuperheavyRifle;
  2110. holder.AmountOfBoxes++;
  2111. boxcount--;
  2112. }
  2113. else
  2114. {
  2115. holder.AmountOfBoxes++;
  2116. boxcount--;
  2117. }
  2118. }
  2119.  
  2120.  
  2121.  
  2122. GAfiringline.ShelvedAmmo.Add(holder);
  2123. superheavyriflecountdown--;
  2124. whichSHR = Boxobullets.Next(0, numbersuperheavyrifle);
  2125. boxcount = Boxobullets.Next(1, 11);
  2126.  
  2127.  
  2128. }
  2129. while (lightshotshellcountdown != 0)
  2130. {
  2131.  
  2132. AmmoShelf holder = new AmmoShelf();
  2133. AmmoShelf tester = new AmmoShelf();
  2134.  
  2135. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2136.  
  2137. while (boxcount != 0)
  2138. {
  2139. if (holder.AmountOfBoxes == 0)
  2140. {
  2141.  
  2142. holder.AmmoBox = LightShotshell.AmmoBox[whichLS];
  2143. holder.AmmoCat = LightShotshell;
  2144. holder.AmountOfBoxes++;
  2145. boxcount--;
  2146. }
  2147. else
  2148. {
  2149. holder.AmountOfBoxes++;
  2150. boxcount--;
  2151. }
  2152. }
  2153.  
  2154.  
  2155.  
  2156. GAfiringline.ShelvedAmmo.Add(holder);
  2157. lightshotshellcountdown--;
  2158. whichLS = Boxobullets.Next(0, numberlightshot);
  2159. boxcount = Boxobullets.Next(1, 11);
  2160.  
  2161.  
  2162. }
  2163. while (intershotshellcountdown != 0)
  2164. {
  2165.  
  2166. AmmoShelf holder = new AmmoShelf();
  2167. AmmoShelf tester = new AmmoShelf();
  2168.  
  2169. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2170.  
  2171. while (boxcount != 0)
  2172. {
  2173. if (holder.AmountOfBoxes == 0)
  2174. {
  2175.  
  2176. holder.AmmoBox = IntermediateShotshell.AmmoBox[whichIS];
  2177. holder.AmmoCat = IntermediateShotshell;
  2178. holder.AmountOfBoxes++;
  2179. boxcount--;
  2180. }
  2181. else
  2182. {
  2183. holder.AmountOfBoxes++;
  2184. boxcount--;
  2185. }
  2186. }
  2187.  
  2188.  
  2189.  
  2190. GAfiringline.ShelvedAmmo.Add(holder);
  2191. intershotshellcountdown--;
  2192. whichIS = Boxobullets.Next(0, numberintershot);
  2193. boxcount = Boxobullets.Next(1, 11);
  2194.  
  2195.  
  2196. }
  2197. while (heavyshotshellcountdown != 0)
  2198. {
  2199.  
  2200. AmmoShelf holder = new AmmoShelf();
  2201. AmmoShelf tester = new AmmoShelf();
  2202.  
  2203. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2204.  
  2205. while (boxcount != 0)
  2206. {
  2207. if (holder.AmountOfBoxes == 0)
  2208. {
  2209.  
  2210. holder.AmmoBox = HeavyShotshell.AmmoBox[whichHS];
  2211. holder.AmmoCat = HeavyShotshell;
  2212. holder.AmountOfBoxes++;
  2213. boxcount--;
  2214. }
  2215. else
  2216. {
  2217. holder.AmountOfBoxes++;
  2218. boxcount--;
  2219. }
  2220. }
  2221.  
  2222.  
  2223.  
  2224. GAfiringline.ShelvedAmmo.Add(holder);
  2225. heavyshotshellcountdown--;
  2226. whichHS = Boxobullets.Next(0, numberheavyshot);
  2227. boxcount = Boxobullets.Next(1, 11);
  2228.  
  2229.  
  2230. }
  2231. if (GAfiringline.ShelvedAmmo.ToList().Count != 0)
  2232. {
  2233. shelftester.Append("__________________________Ammunition__________________________" + Environment.NewLine);
  2234.  
  2235. }
  2236.  
  2237. foreach (AmmoShelf ha in GAfiringline.ShelvedAmmo.ToList())
  2238. { // Make something that changes rounds to round if it's that one box of ammo that only has one round in it.
  2239. if (ha.AmountOfBoxes == 1)
  2240. {
  2241.  
  2242. 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);
  2243. }
  2244. else if (ha.AmountOfBoxes > 2)
  2245. {
  2246. 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);
  2247.  
  2248. }
  2249. ammomaker = roller5.Next(0, MasterAmmoMakers.Count - 1);
  2250. }
  2251.  
  2252.  
  2253. //End ammotester
  2254.  
  2255.  
  2256.  
  2257.  
  2258. int staticcount = GAfiringline.ShelvedFirearms.Count - 1;
  2259. int guncount = 0;
  2260.  
  2261. if (staticcount != 0)
  2262. {
  2263. while (guncount <= staticcount)
  2264. {
  2265.  
  2266. InventoryofGuns.Append(GAfiringline.ShelvedFirearms[guncount] + Environment.NewLine);
  2267. guncount++;
  2268.  
  2269. }
  2270. }
  2271. gunstoreoutput.Text = "";
  2272. // Outputs the guntext to the big box
  2273. gunstoreoutput.Text = InventoryofGuns.ToString() + shelftester.ToString() + ammotester.ToString();
  2274. // gunstoreoutput.Text = ammotester.ToString();
  2275. //gunstoreoutput.Text = shelftester.ToString();
  2276. }
  2277. private void label2_Click(object sender, EventArgs e)
  2278. {
  2279.  
  2280. }
  2281.  
  2282. private void label3_Click(object sender, EventArgs e)
  2283. {
  2284.  
  2285. }
  2286.  
  2287. private void label5_Click(object sender, EventArgs e)
  2288. {
  2289.  
  2290. }
  2291.  
  2292. private void label10_Click(object sender, EventArgs e)
  2293. {
  2294.  
  2295. }
  2296.  
  2297. private void label28_Click(object sender, EventArgs e)
  2298. {
  2299.  
  2300. }
  2301.  
  2302. private void label27_Click(object sender, EventArgs e)
  2303. {
  2304.  
  2305. }
  2306.  
  2307. private void trackBar7_Scroll(object sender, EventArgs e)
  2308. {
  2309.  
  2310. }
  2311.  
  2312. private void label26_Click(object sender, EventArgs e)
  2313. {
  2314.  
  2315. }
  2316.  
  2317. private void label25_Click(object sender, EventArgs e)
  2318. {
  2319.  
  2320. }
  2321.  
  2322. private void trackBar3_Scroll(object sender, EventArgs e)
  2323. {
  2324.  
  2325. }
  2326.  
  2327. private void saveToolStripMenuItem_Click(object sender, EventArgs e)
  2328. {
  2329. SaveFileDialog SaveStoreDialog = new SaveFileDialog();
  2330. SaveStoreDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
  2331. SaveStoreDialog.FileName = "NewStore.txt";
  2332. SaveStoreDialog.RestoreDirectory = true;
  2333.  
  2334. if (SaveStoreDialog.ShowDialog() == DialogResult.OK)
  2335. {
  2336. using (StreamWriter newstream = new StreamWriter(SaveStoreDialog.FileName))
  2337. {
  2338.  
  2339. newstream.Write(gunstoreoutput.Text);
  2340. newstream.Close();
  2341. }
  2342. }
  2343. }
  2344.  
  2345. private void exitToolStripMenuItem_Click(object sender, EventArgs e)
  2346. {
  2347. if (MessageBox.Show("Are you sure you want to quit, Sempai?", "Exit", MessageBoxButtons.OKCancel) == DialogResult.OK)
  2348. {
  2349.  
  2350. Application.Exit();
  2351.  
  2352. }
  2353. }
  2354.  
  2355. private void label30_Click(object sender, EventArgs e)
  2356. {
  2357.  
  2358. }
  2359.  
  2360. private void label29_Click(object sender, EventArgs e)
  2361. {
  2362.  
  2363. }
  2364.  
  2365. private void trackBar1_Scroll(object sender, EventArgs e)
  2366. {
  2367.  
  2368. }
  2369.  
  2370. private void label7_Click(object sender, EventArgs e)
  2371. {
  2372.  
  2373. }
  2374.  
  2375. private void label33_Click(object sender, EventArgs e)
  2376. {
  2377.  
  2378. }
  2379.  
  2380. private void label32_Click(object sender, EventArgs e)
  2381. {
  2382.  
  2383. }
  2384.  
  2385. private void label31_Click(object sender, EventArgs e)
  2386. {
  2387.  
  2388. }
  2389.  
  2390. private void trackBar1_Scroll_1(object sender, EventArgs e)
  2391. {
  2392.  
  2393. }
  2394. }
  2395. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement