using System; public class Program { public static void Main() { Random rnd = new Random(); int runs = 0; int plasmEarned = 0; int plasmPerRun = 30; int plasmNeededVoruna = 0; int plasmNeededAll = 0; int somaticEarned = 0; int somaticNeeded = 20; int[] lootBools = new int[11]; //Array of loot obtained. /* 0 = Perigale BP 1 = Sarofang BP 2 = Sarofang Blade 3 = Sarofang Handle 4 = Perigale Barrel 5 = Perigale Receiver 6 = Perigale Stock 7 = Voruna BP 8 = Voruna Chassis 9 = Voruna Neuroptics 10 = Voruna Systems */ int vorunaBlueprintsGot = 0; int[] runCounts = new int[4];//Array of runs taken. 0=VorunaBPs, 1=Voruna+Resources, 2=everything but somatics, and 3=everything with somatics int reward; for (int i = 0; i < 70; i++) { runs = 0; plasmEarned = 0; plasmNeededVoruna = 475; plasmNeededAll = 1025; somaticEarned = 0; for (int j = 0; j < 11; j++) { lootBools[j] = 0; } vorunaBlueprintsGot = 0; for (int j = 0; j < 4; j++) { runCounts[j] = 0; } do { runs++; plasmEarned = plasmEarned + plasmPerRun; for (int k = 0; k < 4; k++) { double roll = rnd.NextDouble(); reward = Rot(k, roll); //Console.Write("{0}-",reward); if (reward == 99)//Error check { return; } if (reward == 1)//Rolled a Somatic Fibers drop { somaticEarned++; } else if (reward > 1)//Rolled some other important drop { if (lootBools[reward-2] == 0)//If this is the first time we got this drop (otherwise we don't care) { lootBools[reward-2] = 1;//Mark the drop obtained if (reward == 2 || reward == 3)//Remove the Plasm cost to buy this drop from total plasm needed - we no longer need to buy it. Applies to else ifs too { plasmNeededAll = plasmNeededAll - 100; } else if (reward > 3 && reward < 9) { plasmNeededAll = plasmNeededAll - 50; } else if (reward == 9) { plasmNeededAll = plasmNeededAll - 125; plasmNeededVoruna = plasmNeededVoruna - 125; if (lootBools[7] + lootBools[8] + lootBools[9] + lootBools[10] == 4)//If full set of VorunaBPs, VorunaBPs have been got! { vorunaBlueprintsGot = 1; } } else if (reward > 9 && reward < 13) { plasmNeededAll = plasmNeededAll - 75; plasmNeededVoruna = plasmNeededVoruna - 75; if (lootBools[7] + lootBools[8] + lootBools[9] + lootBools[10] == 4)//If full set of VorunaBPs, VorunaBPs have been got! { vorunaBlueprintsGot = 1; } } } } } if (vorunaBlueprintsGot == 1 && runCounts[0] == 0 || plasmEarned > plasmNeededVoruna && runCounts[0] == 0)//If we have a full set of Voruna BPs, or can buy them, record runs taken ONLY IF not already recorded { runCounts[0] = runs; Console.Write("{0}",lootBools[7] + lootBools[8] + lootBools[9] + lootBools[10]); } if (runCounts[0] != 0 && somaticEarned >= somaticNeeded && runCounts[1] == 0) { runCounts[1] = runs; } if (plasmEarned >= plasmNeededAll && runCounts[2] == 0) { runCounts[2] = runs; } if (runCounts[2] != 0 && somaticEarned >= somaticNeeded && runCounts[3] == 0) { runCounts[3] = runs; } } while (runCounts[0] == 0 || runCounts[1] == 0 || runCounts[2] == 0 || runCounts[3] == 0); Console.WriteLine("#{0};{1};{2};{3}",runCounts[0],runCounts[1],runCounts[2],runCounts[3]); } } public static int Rot(int rotation, double roll) { if (rotation < 2) { if (roll < 0.3872) //Somatic Fiber Drop { return 1; } else if (roll < 0.5) //Perigale BP drop { return 2; } else if (roll < 0.6128) //Sarofang BP drop { return 3; } else //Endo drop, not important { return 0; } } else if (rotation == 2) { if (roll < .1016) //Sarofang Blade { return 4; } else if (roll < .2032) //Sarofang Handle { return 5; } else if (roll < .3048) //Perigale Barrel { return 6; } else if (roll < .4064) //Perigale Receiver { return 7; } else if (roll < .5080) //Perigale Stock { return 8; } else //Arcane or Relic - not important { return 0; } } else if (rotation == 3) { if (roll < .1224) //Voruna BP { return 9; } else if (roll < .204) //Voruna Chassis { return 10; } else if (roll < .2856) //Voruna Neuroptics { return 11; } else if (roll < .3672) //Voruna Systems { return 12; } else //Relic or Arcane - not important { return 0; } } else { Console.WriteLine("ERROR - ROTATION NOT KNOWN"); return 99; } } }