private string AddAbilities(string rank, string itemType) { string ability = ""; RDSTable Abilities = new RDSTable(); //used to swap between minor/medium/major and armor/weapon ability tables string buffer = ""; switch (rank) { case "Minor": switch(itemType) { case "Armor Ability": Abilities = MinorArmorAbilities; break; case "Melee Weapon": case "Uncommon Melee Weapon": Abilities = MinorMeleeWeaponsAbilities; break; case "Ranged Weapon": Abilities = MinorRangedWeaponsAbilities; break; default: return ""; //something went wrong if it gets here } break; case "Medium": switch(itemType) { case "Armor Ability": Abilities = MediumArmorAbilitiesTable; break; case "Shield Ability": Abilities = MediumShieldAbilities; break; case "Melee Weapon": case "Uncommon Melee Weapon": Abilities = MediumMeleeWeaponsAbilitiesTable; break; case "Ranged Weapon": Abilities = MediumRangedWeaponsAbilitiesTable; break; default: return ""; //something went wrong if it gets here } break; case "Major": switch(itemType) { case "Armor Ability": Abilities = MajorArmorAbilitiesTable; break; case "Melee Weapon": case "Uncommon Melee Weapon": Abilities = MajorMeleeWeaponsAbilitiesTable; break; case "Ranged Weapon": Abilities = MajorRangedWeaponsAbilitiesTable; break; default: return ""; //something went wrong if it gets here } break; default: break; } int rollsLeft = 1; ability = "\r\n+-->Abilities: \r\n"; while (rollsLeft > 0) //EXIT IFF: totalBonus == 10; rollsleft < 1; { if (Abilities.rdsContents.Count() < 1) { textBox2.Text += "ERROR: no abilities to apply for" + itemType; break; } buffer = Abilities.rdsResult.Single().ToString(); if (buffer == "ROLL AGAIN TWICE") { //textBox2.Text += "ROLL AGAIN!"; rollsLeft += 2; } else { //textBox2.Text += "ABILITY ADDED!" + " " + buffer + "\r\n"; ability += " ->" + buffer + "\r\n"; } rollsLeft--; } return ability; }
private void SetMulitipliers(RDSTable table, double p) { double newMult = p; table.rdsEnabled = true; if (p == 0.5) { table.rdsCount = 1; } else { switch ((int)p) { case 0: table.rdsCount = 0; table.rdsEnabled = false; newMult = 0; break; case 1: newMult = 1; table.rdsCount = (int)p; break; case 2: newMult = 1; table.rdsCount = (int)p; break; case 3: table.ProbabilityMult(1.0); table.rdsCount = (int)p; break; default: table.rdsCount = 1; break; } } table.ProbabilityMult(newMult); }