Beispiel #1
0
		/// <summary>
		/// initializes all Character Races
		/// </summary>
        public static void initRaces()
        {
            Race dwarf = new Race("Dwarf");
            Race elf = new Race("Elf");
            Race halfling = new Race("Halfling");
            Race human = new Race("Human");
            Race dragonborn = new Race("Dragonborn");
            Race gnome = new Race("Gnome");
            Race halfElf = new Race("Half-Elf");
            Race halfOrc = new Race("Half-Orc");
            Race tiefling = new Race("Tiefling");
        }
Beispiel #2
0
        private void raceBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Get the currently selected item.
            string curItem = raceBox.SelectedItem.ToString();

            //Call to create a new Race object, same name as currently selected item.
            Race selectRace = new Race(curItem);

            // Changes labels, grids, and buttons to be visible
            asmLabel.Visible = true;
            asmDisplayLabel.Visible = true;
            sizeLabel.Visible = true;
            sizeDisplayLabel.Visible = true;
            speedLabel.Visible = true;
            speedDisplayLabel.Visible = true;
            traitsLabel.Visible = true;
            traitsGrid.Visible = true;
            languagesLabel.Visible = true;
            languagesGrid.Visible = true;
            raceButton.Visible = true;

            // Changes race background image based on selected Race
            switch (curItem)
            {
                case "Dwarf":
                    raceTab.BackgroundImage = Properties.Resources.dwarf;
                    break;
                case "Elf":
                    raceTab.BackgroundImage = Properties.Resources.elf;
                    break;
                case "Halfling":
                    raceTab.BackgroundImage = Properties.Resources.halfling;
                    break;
                case "Human":
                    raceTab.BackgroundImage = Properties.Resources.human;
                    break;
                case "Dragonborn":
                    raceTab.BackgroundImage = Properties.Resources.dragonborn;
                    break;
                case "Gnome":
                    raceTab.BackgroundImage = Properties.Resources.gnome;
                    break;
                case "Half-Elf":
                    raceTab.BackgroundImage = Properties.Resources.halfelf;
                    break;
                case "Half-Orc":
                    raceTab.BackgroundImage = Properties.Resources.halforc;
                    break;
                case "Tiefling":
                    raceTab.BackgroundImage = Properties.Resources.tiefling;
                    break;
                default:
                    break;
            }

            //Set Ability Score Modifier text display for each race.
            asmDisplayLabel.Text = "STR: " + selectRace.getStats()[0] + "   DEX: " + selectRace.getStats()[1] + "\nCON: " + selectRace.getStats()[2] +
            "   INT: " + selectRace.getStats()[3] + "\nWIS: " + selectRace.getStats()[4] + "    CHA: " + selectRace.getStats()[5];

            //Set Size text display for each race.
            sizeDisplayLabel.Text = selectRace.getSize();

            //Set Speed text display for each race.
            speedDisplayLabel.Text = selectRace.getSpeed().ToString();

            //Clear the Trait DataGrid of all columns and rows.
            traitsGrid.Columns.Clear();
            traitsGrid.Rows.Clear();

            //Add Trait information to the Traits DataGrid based on the amount of racial traits each race has.
            traitsGrid.ColumnCount = 2;
            traitsGrid.Columns[0].Name = "Trait";
            traitsGrid.Columns[1].Name = "Description";

            ArrayList trait = new ArrayList();
            trait = selectRace.getTraits();
            ArrayList tDesc = new ArrayList();
            tDesc = selectRace.getTDesc();
            ArrayList lang = new ArrayList();
            lang = selectRace.getLanguages();


            for (int i = 0; i < trait.Count; i++)
            {
                traitsGrid.Rows.Add(trait[i], tDesc[i]);

            }

            //Clear the Language DataGrid of all columns and rows.
            languagesGrid.Columns.Clear();
            languagesGrid.Rows.Clear();

            languagesGrid.ColumnCount = 1;
            languagesGrid.Columns[0].Name = "Languages";
            //Add Language information to the Language DataGrid.
            for (int j = 0; j < lang.Count; j++)
            {
                languagesGrid.Rows.Add(lang[j]);
            }
        }
Beispiel #3
0
		/// <summary>
        /// Sets the Race for the character </summary>
		/// <param name="s"> String representation of the Race </param>
        public void setRace(string s)
        {
            race = new Race(s);
        }