Beispiel #1
0
        public async Task <Room> GetStartingRoom()
        {
            await CreateWorld(_context); // obviously this should not be necessary here.

            var mappedRooms = LoadArea(0);

            var secondRoom = mappedRooms.Single(r => r.Name == "The second room");

            secondRoom.Objects.Add(new RoomObject(0, TargetingKeywords.From("glowing", "rock"), "a glowing rock", "A glowing rock draws your attention.", @"
A giant glowing rock is standing in the middle of the room. Swirly
patterns of light fade in and out in complicated patterns.".TrimStart(), secondRoom));

            var casterCreator = new Player(0, "Castramus", secondRoom);

            secondRoom.Inscriptions.Add(new Inscription(0, TargetingKeywords.From("inscription"), "an inscription",
                                                        "A magical inscription has been carved into the wall", $"The inscription reads\n\n\u001b[31;1mDEBUG\u001b[0m",
                                                        new RunePhrase(new DEBUG(casterCreator, secondRoom))));

            return(mappedRooms.Single(r => r.Name == "The starting room"));
        }
Beispiel #2
0
        public void ZuBehWithInvalidReferenceInscription()
        {
            var room   = new Room(0, "room", "room");
            var player = new Player(0, "player", room);

            var inscription = new Inscription(0, TargetingKeywords.From("ins"), "ins", "ins", "ins", new RunePhrase(new ZU(player, room)));

            player.Point(inscription);

            var spellstring = "ZU BEH";
            var parsed      = new SpellParser().Parse(player, spellstring);

            if (parsed.IsError)
            {
                Assert.Fail(parsed.Error);
            }
            else
            {
                Assert.IsNotNull(parsed.Result.root.Eval().Success);
            }
        }