Beispiel #1
0
        private void InitializeMonsters()
        {
            _monsterIcons = new CharacterIcon[] { characterIcon1, characterIcon2,
                                                  characterIcon3, characterIcon4, characterIcon5 }.ToList();
            _monsters = new AddList <Character>();

            Character monster1 = new Murloc();
            Character monster2 = new Goblin();
            Character monster3 = new DarkElf();
            Character monster4 = new HighSeer();
            Character monster5 = new DarkenstoneDragon();

            _monsters.Add(monster1);
            _monsters.Add(monster2);
            _monsters.Add(monster3);
            _monsters.Add(monster4);
            _monsters.Add(monster5);

            for (int i = 0; i < 5; i++)
            {
                _monsterIcons[i].Character = _monsters[i];
            }

            foreach (CharacterIcon monsterIcon in _monsterIcons)
            {
                monsterIcon.OnSelection   += new EventHandler(MonsterIconSelected);
                monsterIcon.OnDeselection += new EventHandler(MonsterIconDeselected);
            }
        }
Beispiel #2
0
        private string generateRace()
        {
            string race         = "";
            int    randomNumber = NumberGen.gen(9);

            if (randomNumber == 0)
            {
                race          = "Dragonborn";
                characterRace = new Dragonborn();
            }
            else if (randomNumber == 1)
            {
                randomNumber = NumberGen.gen(2);
                if (randomNumber == 0)
                {
                    race          = "Hill Dwarf";
                    characterRace = new HillDwarf();
                }
                else if (randomNumber == 1)
                {
                    race          = "Mountain Dwarf";
                    characterRace = new MountainDwarf();
                }
            }

            if (randomNumber == 2)
            {
                randomNumber = NumberGen.gen(3);
                if (randomNumber == 0)
                {
                    race          = "High Elf";
                    characterRace = new HighElf();
                }
                else if (randomNumber == 1)
                {
                    race          = "Wood Elf";
                    characterRace = new WoodElf();
                }
                else if (randomNumber == 2)
                {
                    race          = "Dark Elf";
                    characterRace = new DarkElf();
                }
            }

            if (randomNumber == 3)
            {
                randomNumber = NumberGen.gen(3);
                if (randomNumber == 0)
                {
                    race          = "Deep Gnome";
                    characterRace = new DeepGnome();
                }
                else if (randomNumber == 1)
                {
                    race          = "Forest Gnome";
                    characterRace = new ForestGnome();
                }
                else if (randomNumber == 2)
                {
                    race          = "Rock Gnome";
                    characterRace = new RockGnome();
                }
            }

            if (randomNumber == 4)
            {
                race          = "Half-Elf";
                characterRace = new HalfElf();
            }

            if (randomNumber == 5)
            {
                randomNumber = NumberGen.gen(2);
                if (randomNumber == 0)
                {
                    race          = "Lightfoot Halfling";
                    characterRace = new LightfootHalfling();
                }
                else if (randomNumber == 1)
                {
                    race          = "Stout Halfling";
                    characterRace = new StoutHalfling();
                }
            }

            if (randomNumber == 6)
            {
                race          = "Half-Orc";
                characterRace = new HalfOrc();
            }

            if (randomNumber == 7)
            {
                race          = "Human";
                characterRace = new Human();
            }

            if (randomNumber == 8)
            {
                race          = "Tiefling";
                characterRace = new Tiefling();
            }

            return(race);
        }