示例#1
0
 private string GenerateSuffix(Random rand)
 {
     return rand.Pick<string>(new List<string>() { "Ages", "Bane", "Catastrophe", "Chaos", "Darkness", "Death", "Demons", "Despair", "Destruction", "Devils", "Disease", "Doom", "Eternal Night", "Eternity", "Hatred", "Horror", "Illusion", "Insanity", "Lost Souls", "Madness", "Magic", "Might", "Misery", "Mortality", "Nightmares", "No Escape", "Power", "Ruin", "Screams", "Secrets", "Shadows", "Sorrow", "Spite", "Suffering", "Valor", "War", "Winter", "Woe", "Worms", "Worry" });
 }
示例#2
0
 private string GenerateLocation(Random rand)
 {
     return rand.Pick<string>(new List<string>() { "Catacomb", "Cave", "Caverns", "Chamber", "Chambers", "Crypt", "Den", "Dungeon", "Grotto", "Hill", "Hills", "Hole", "Labyrinth", "Lair", "Mausoleum", "Maze", "Mortuary", "Mount", "Mountain", "Mountains", "Pit", "Quarter", "Realm", "Tomb", "Tunnel", "Tunnels", "Vault", "Vaults", "Ways" });
 }
示例#3
0
 private string GeneratePrefix(Random rand)
 {
     return rand.Pick<string>(new List<string>() { "Amazing", "Amethyst", "Black", "Boiling", "Brilliant", "Broad", "Brutal", "Chaotic", "Crazy", "Cursed", "Dagger", "Dangerous", "Deadly", "Decayed", "Deep", "Dire", "Dying", "Emerald", "Eternal", "Evil", "False", "Forgotten", "Ghostly", "Giant", "Great", "Green", "Grizzly", "Haunted", "Hellish", "Hidden", "Icy", "Infernal", "Jade", "Lawful", "Mighty", "Misty", "Mysterious", "Rancid", "Red", "Rough", "Royal", "Scary", "Secluded", "Sword", "Tiny", "True", "Twisted", "Uncanny", "Unholy", "Unnamed", "Valiant", "Viscious", "Wailing", "Whispering" });
 }
示例#4
0
        private void frmGame_Load(object sender, EventArgs e)
        {
            Rand = new Random();

            // create the player.
            Player = new Player();

            // first, generate a name.
            // name generator's...names from: http://www.goodsandgoodies.com/wq/bashwe-dungeonnames.pdf
            switch (Rand.Pick<NameStructure>(new List<NameStructure>() { NameStructure.Prefix, NameStructure.Prefix2x, NameStructure.Suffix,
            NameStructure.PrefixAndSuffix, NameStructure.Prefix2xAndSuffix }))
            {
                case NameStructure.Prefix:
                    this.Name = "The {0} {1}".FormatBy(GeneratePrefix(Rand), GenerateLocation(Rand));
                    break;

                case NameStructure.Prefix2x:
                    this.Name = "The {0}-{1} {2}".FormatBy(GeneratePrefix(Rand), GeneratePrefix(Rand), GenerateLocation(Rand));
                    break;

                case NameStructure.Suffix:
                    this.Name = "The {0} of {1}".FormatBy(GenerateLocation(Rand), GenerateSuffix(Rand));
                    break;

                case NameStructure.PrefixAndSuffix:
                    this.Name = "The {0} {1} of {2}".FormatBy(GeneratePrefix(Rand), GenerateLocation(Rand), GenerateSuffix(Rand));
                    break;

                case NameStructure.Prefix2xAndSuffix:
                    this.Name = "The {0}-{1} {2} of {3}".FormatBy(GeneratePrefix(Rand), GeneratePrefix(Rand), GenerateLocation(Rand), GenerateSuffix(Rand));
                    break;
            }

            // pick whether the dungeon is ascending or descending.
            Direction = Rand.Pick<FloorDirection>(new List<FloorDirection>() { FloorDirection.Ascending, FloorDirection.Descending });
            SetFloor();
            SetPoints();

            // set the grid up.
            MapCells = new Cell[15, 10];
            for (int x = 0; x < 15; x++)
            {
                for (int y = 0; y < 10; y++)
                {
                    Label lbl = new Label();
                    lbl.Text = " ";
                    lbl.AutoSize = false;
                    lbl.Size = new System.Drawing.Size(46, 46);
                    lbl.Location = new Point(46 * x, 46 * y);
                    lbl.TextAlign = ContentAlignment.MiddleCenter;
                    lbl.Font = new System.Drawing.Font("Segoe UI", 16);
                    pnlGame.Controls.Add(lbl);
                    MapCells[x, y] = new Cell(lbl);
                }
            }

            // play a random song.
            PlayRandomSong();

            // generate a new map and display.
            GenerateNewMap();
            Update();
        }