//rolls die and returns three different values encapulated in an object public static D100Result RollD100(Cryptorandom rn) { //RNG.NumberBetween(1, 10); int[] die = new int[2]; die[0] = rn.Next(1, 10); //10 die[1] = rn.Next(1, 10); //10 = 100 string strDie = ""; int intDie = 0; var strTens = ""; var strOnes = ""; //converts the die into readable ints if (die[1] == 10 && die[0] == 1) { intDie = 1; } if (die[1] == 10 && die[0] == 10) { intDie = 100; } if (die[1] == 10 && die[0] != 10) { die[1] = 0; } strTens = die[1].ToString(); strOnes = die[0].ToString(); strDie = strTens + strOnes; intDie = Convert.ToInt32(strDie); D100Result result = new D100Result(die, intDie, strDie); return(result); }
public D100Result ConductMovementCheck(string skill) { D100Result result = null; //the skill will always be in here, but just in case... var skillInList = MovementSkills.Where(x => x.Name == skill).FirstOrDefault(); if (skillInList != null) { result = skillInList.ConductCheck(); } return(result); }