public void rerollCharateristics()
        {
            DieRoller die = new DieRoller();

            CharacteristicsFromRolls.WeaponSkills   = die.rollD10(2);
            CharacteristicsFromRolls.BalisticSkills = die.rollD10(2);
            CharacteristicsFromRolls.Strength       = die.rollD10(2);
            CharacteristicsFromRolls.Toughness      = die.rollD10(2);
            CharacteristicsFromRolls.Agility        = die.rollD10(2);
            CharacteristicsFromRolls.Intelligence   = die.rollD10(2);
            CharacteristicsFromRolls.WillPower      = die.rollD10(2);
            CharacteristicsFromRolls.Fellowship     = die.rollD10(2);
            updateCharateristics();
        }
Esempio n. 2
0
        public void RollNewWoundsValue()
        {
            string    connectionStr = System.Configuration.ConfigurationManager.ConnectionStrings["WHFR_ed2_NPC_Creator.Properties.Settings.DBConnection"].ConnectionString;
            DieRoller die           = new DieRoller();
            int       rollforWouds  = die.rollD10();

            using (SqlConnection connection = new SqlConnection(connectionStr))
                using (SqlDataAdapter dataAdapter = new SqlDataAdapter("SELECT * FROM WoundsRoll Where id = " + rollforWouds.ToString(), connection)) {
                    connection.Open();
                    System.Data.DataTable table = new System.Data.DataTable();
                    dataAdapter.Fill(table);
                    Characteristics.Wounds = (int)table.Rows[0][Id + 1];
                    //System.Diagnostics.Debug.WriteLine(String.Format("Roll Value {0:d} Wouds val {1:d}", rollforWouds, Characteristics.Wounds));
                }
        }
        public string randomizeName()
        {
            string name;
            string connectionStr = ConfigurationManager.ConnectionStrings["WHFR_ed2_NPC_Creator.Properties.Settings.DBConnection"].ConnectionString;

            using (SqlConnection connection = new SqlConnection(connectionStr))
                using (SqlDataAdapter dataAdapter = new SqlDataAdapter("SELECT * FROM Names", connection)) {
                    connection.Open();
                    System.Data.DataTable table = new System.Data.DataTable();
                    dataAdapter.Fill(table);

                    DieRoller dieRoller = new DieRoller();

                    int rollValue = dieRoller.rollDie(1, table.Select().Length - 1);
                    name = table.Rows[rollValue][Race.Id + 1].ToString();
                    Name = name;
                }
            return(name);
        }