コード例 #1
0
ファイル: TRPG.cs プロジェクト: StevenGann/TRPG
        /// <summary>
        /// Most of the basic game configuration is done here.
        /// </summary>
        public TRPG_core()
        {
            player = new Player();
            gui = new GUI(100, 30, true);//Configure the size of the GUI, and enable/disable dynamic size
            messages = new List<Message>();
            parser = new Parser();
            dungeon = new Dungeon();

            LoadItems();

            player.Contents.Add(WeaponsMaster[1]);

            Random RNG = new Random();
            player.Buffs.Scramble(RNG.Next(), 5);
            dungeon.GenerateRandom(RNG.Next(), ItemsMaster, WeaponsMaster, MonstersMaster);

            //Define the help text that shows when the player says "help".
            helpText = "COMMON COMMANDS\n";
            helpText += "This is a small list of some common and useful commands ";
            helpText += "for navigating the game. There are many other commands, ";
            helpText += "but these few are necessary for manipulating the interface.\n\n";
            helpText += "\"open inventory\"             - Makes the inventory tray much larger.\n";
            helpText += "\"close inventory\"            - Collapses the inventory tray back to 1 line.\n";
            helpText += "\"scroll down\", \"sd\"        - Scrolls very large texts down.\n";
            helpText += "\"scroll up\",   \"su\"        - Scrolls very large texts up.\n";
            helpText += "\"go north\"                   - Moves the player to the adjacent room North.\n";
            helpText += "\"go south\"                   - Moves the player to the adjacent room South.\n";
            helpText += "\"go east\"                    - Moves the player to the adjacent room East.\n";
            helpText += "\"go west\"                    - Take a wild guess.\n";
            helpText += "\"examine\"                    - Examine items, monsters, self, or \"all\".\n";
            helpText += "\"attack MONSTER with WEAPON\" - name a monster and a weapon to use.\n";
            //helpText += "\"\"         - \n";
            helpText += "\"help\"            - shows and hides this help.\n";

            gui.MainText = dungeon.CurrentRoom.Description;
        }
コード例 #2
0
ファイル: Item.cs プロジェクト: StevenGann/TRPG
 public new Player Copy()
 {
     Player result = new Player();
     result.Name = Name;
     result.Lore = Lore;
     result.Weight = Weight;
     result.Value = Value;
     result.Adjectives = Adjectives;
     result.Buffs = Buffs;
     result.Damage = Damage;
     result.Defense = Defense;
     result.Accuracy = Accuracy;
     result.Health = Health;
     result.Uses = Uses;
     result.Experience = Experience;
     result.Contents = Contents;
     return result;
 }