コード例 #1
0
        private IRoom GenerateRoom59()
        {
            IRoom room = LibraryBalcony();
            INonPlayerCharacter npc = LibaryPatron();

            room.AddMobileObjectToRoom(npc);
            npc.Room = room;

            return(room);
        }
コード例 #2
0
ファイル: Hydra.cs プロジェクト: elavanis/Mud
        public string Process(INonPlayerCharacter npc, string command)
        {
            IHydra hydra = npc as IHydra;

            if (hydra != null)
            {
                hydra.RegrowHeads();
            }

            return(command);
        }
コード例 #3
0
ファイル: Merchant.cs プロジェクト: crybx/mud
        public IResult Offer(INonPlayerCharacter merchant, IMobileObject performer)
        {
            StringBuilder strBldr = new StringBuilder();

            foreach (IItem item in performer.Items)
            {
                strBldr.AppendLine(string.Format("{0} - {1}", item.ShortDescription, BuyPrice(merchant, performer, item)));
            }

            return(new Result(true, strBldr.ToString().Trim()));
        }
コード例 #4
0
        private IRoom GenerateRoom34()
        {
            IRoom room = LibraryBasement();

            INonPlayerCharacter apprentice = Female_Apprentice();

            room.AddMobileObjectToRoom(apprentice);
            apprentice.Room = room;

            return(room);
        }
コード例 #5
0
ファイル: Elemental.cs プロジェクト: elavanis/Mud
        public string Process(INonPlayerCharacter npc, string command)
        {
            IElemental elemental = npc as IElemental;

            if (elemental != null)
            {
                elemental.ProcessElementalTick();
            }

            return(command);
        }
コード例 #6
0
        /// <summary>
        /// Executes this command
        /// </summary>
        internal override bool ExecutionBody()
        {
            INonPlayerCharacter trainer = (INonPlayerCharacter)Subject;

            if (trainer == null || !trainer.DoITeachThings())
            {
                RenderError("There is no trainer that teaches in that direction.");
                return(false);
            }

            //Do the list
            if (Target.GetType() == typeof(string))
            {
                string listings = trainer.RenderInstructionList(Actor);

                Message listingMessage = new Message(new LexicalParagraph(listings));

                listingMessage.ExecuteMessaging(Actor, null, null, null, null);
            }

            int price = -1;

            string errorMessage = "The trainer can not train that.";

            //We have an ability
            if (Target is IQuality proficency)
            {
                int profLevel = Actor.GetQuality(proficency.Name);

                if (profLevel >= 0)
                {
                    errorMessage = trainer.Instruct((IMobile)Actor, proficency.Name, profLevel + 1, price);
                }
            }

            if (!string.IsNullOrWhiteSpace(errorMessage))
            {
                RenderError(errorMessage);
            }

            ILexicalParagraph toArea = new LexicalParagraph("$A$ trains with $S$.");

            //TODO: language outputs
            Message messagingObject = new Message(new LexicalParagraph(string.Format("You learn from $S$ for {0}blz.", price)))
            {
                ToOrigin = new List <ILexicalParagraph> {
                    toArea
                }
            };

            messagingObject.ExecuteMessaging(Actor, trainer, null, OriginLocation.CurrentZone, null);

            return(true);
        }
コード例 #7
0
ファイル: Wanderer.cs プロジェクト: elavanis/Mud
        private bool NextRoomEnterable(IRoom nextRoom, IRoom currentRoom, INonPlayerCharacter npc)
        {
            if ((nextRoom.CheckEnter(npc) == null) &&
                (NavigableRooms.Count == 0 ||
                 NavigableRooms.Where(x => x.Zone == nextRoom.Zone).Where(y => y.Id == nextRoom.Id).Count() >= 1))
            {
                return(true);
            }

            return(false);
        }
コード例 #8
0
 public string Process(INonPlayerCharacter npc, string command)
 {
     if (command == null)
     {
         CheckForTrigger(npc);
         return(null);
     }
     else
     {
         return(command);
     }
 }
コード例 #9
0
ファイル: AbandonedDwarvenCamp.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter Goblin()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 14);

            npc.ExamineDescription  = "The goblin stares at you with fright in its eyes.";
            npc.LookDescription     = "The goblin cowers in the corner watching you very intently.";
            npc.ShortDescription    = "A frightened goblin.";
            npc.SentenceDescription = "goblin";
            npc.KeyWords.Add("goblin");

            return(npc);
        }
コード例 #10
0
        private IResult PerformRecall(IMobileObject performer)
        {
            if (performer.RecallPoint != null)
            {
                IRoom currentRoom = performer.Room;

                if (currentRoom.Attributes.Contains(Room.Room.RoomAttribute.NoRecall))
                {
                    return(new Result(false, "You try to recall but your body is held in place."));
                }

                IRoom targetRoom = null;
                try
                {
                    targetRoom = GlobalReference.GlobalValues.World.Zones[performer.RecallPoint.Zone].Rooms[performer.RecallPoint.Id];
                }
                catch
                {
                }

                if (targetRoom != null)
                {
                    IPlayerCharacter pc = performer as IPlayerCharacter;
                    if (pc != null)
                    {
                        currentRoom.RemoveMobileObjectFromRoom(pc);
                        targetRoom.AddMobileObjectToRoom(pc);
                        pc.Room = targetRoom;
                        pc.EnqueueCommand("Look");

                        return(SuccesfulRecallResult);
                    }
                    else
                    {
                        INonPlayerCharacter npc = performer as INonPlayerCharacter;
                        currentRoom.RemoveMobileObjectFromRoom(npc);
                        targetRoom.AddMobileObjectToRoom(npc);
                        npc.Room = targetRoom;
                        npc.EnqueueCommand("Look");

                        return(SuccesfulRecallResult);
                    }
                }
                else
                {
                    return(new Result(false, "Invalid recall point defined."));
                }
            }
            else
            {
                return(new Result(false, "No recall point defined."));
            }
        }
コード例 #11
0
ファイル: GrandViewCastle.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter Captain()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 55);

            npc.ShortDescription    = "The captain doesn't notice you at first as you walk in the room.  He quickly glances up at you and then returns to his job.";
            npc.LookDescription     = "The captain is busy doing paper work and has a large pile of papers on his desk labeled in.";
            npc.ExamineDescription  = "The captain is dressed in standard military garb.  Nothing indicates he is a high ranking official other than he was sitting behind the desk when you walked in.";
            npc.SentenceDescription = "captain";
            npc.KeyWords.Add("captain");

            return(npc);
        }
コード例 #12
0
        private IRoom GenerateRoom17()
        {
            IRoom room = LibraryBasement();

            INonPlayerCharacter apprentice = Female_Apprentice();

            room.AddMobileObjectToRoom(apprentice);
            apprentice.Room = room;
            apprentice.AddEquipment(WizardStaff());

            return(room);
        }
コード例 #13
0
        public string Process(INonPlayerCharacter npc, string command)
        {
            if (command == null)
            {
                if (GlobalReference.GlobalValues.Random.PercentDiceRoll(SpeakPercent))
                {
                    return(SayMessage(npc));
                }
            }

            return(command);
        }
コード例 #14
0
        private INonPlayerCharacter ButlerAutomaton()
        {
            INonPlayerCharacter npc = GenerateAutomaton();

            npc.KeyWords.Add("butler");
            npc.ShortDescription    = "A butler automaton.";
            npc.LookDescription     = "The automaton walks around tiding up the place and waits for instructions form its master.";
            npc.ExamineDescription  = "The automaton is always alert for the slightest sign that its master needs it to perform a duty.";
            npc.SentenceDescription = "butler automaton";

            return(npc);
        }
コード例 #15
0
        private INonPlayerCharacter DusterAutomaton()
        {
            INonPlayerCharacter npc = GenerateAutomaton();

            npc.KeyWords.Add("duster");
            npc.ShortDescription    = "A duster automaton.";
            npc.LookDescription     = "The automaton dust both high and low leaving no dust safe.";
            npc.ExamineDescription  = "The automaton wanders aimlessly around dusting things with a feather duster.";
            npc.SentenceDescription = "dusting automaton";

            return(npc);
        }
コード例 #16
0
        private string Attack(INonPlayerCharacter npc, string command)
        {
            foreach (BaseDamageSpell spell in DamageSpells)
            {
                if (spell.ManaCost <= npc.Mana)
                {
                    command = $"Cast {spell.SpellName}";
                    break;
                }
            }

            return(command);
        }
コード例 #17
0
        private INonPlayerCharacter WizardGuildMaster()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 20);

            npc.ExamineDescription  = "The Guildmaster is dressed in a tattered gray cloak that looks to at one point been white.  He has a beard that is almost as long as he is tall and is long since lost any sign of color.";
            npc.LookDescription     = "He stares into space as if contemplating things you couldn't even imagine.  Occasionally he says something as if he is talking to someone yet you can not see who.  Has he gone mad or talking to something beyond this realm?";
            npc.ShortDescription    = "The wizard Guildmaster.";
            npc.SentenceDescription = "Guildmaster";
            npc.KeyWords.Add("GuildMaster");
            npc.KeyWords.Add("Wizard");
            npc.Personalities.Add(new GuildMaster(Guilds.Wizard));
            return(npc);
        }
コード例 #18
0
ファイル: FortWoodbrook.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter BabySpider()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Other, 6);

            npc.KeyWords.Add("spider");
            npc.Personalities.Add(new Wanderer());
            npc.SentenceDescription = "spider";
            npc.ShortDescription    = "A small spider.";
            npc.LookDescription     = "A small spider crawls along its web.";
            npc.ExamineDescription  = "The spider has the trade mark red hour glass indicating its a black widow.  It might be good to leave this spider alone.";

            return(npc);
        }
コード例 #19
0
        private INonPlayerCharacter GuardAutomaton()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 20);

            npc.KeyWords.Add("automaton");
            npc.KeyWords.Add("guard");
            npc.ShortDescription    = "A guard automaton.";
            npc.LookDescription     = "The guard seems to allow prisoners to roam around the room.";
            npc.ExamineDescription  = "The guard stands at the door ready to keep any of the prisoners from escaping.";
            npc.SentenceDescription = "guard automaton";

            return(npc);
        }
コード例 #20
0
        private string Heal(INonPlayerCharacter npc, string command)
        {
            foreach (BaseCureSpell spell in CureSpell)
            {
                if (spell.ManaCost <= npc.Mana)
                {
                    command = $"Cast {spell.SpellName}";
                    break;
                }
            }

            return(command);
        }
コード例 #21
0
ファイル: CharonTemple.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter Priest()
        {
            INonPlayerCharacter nonPlayerCharacter = CreateNonplayerCharacter(MobType.Humanoid, 20);

            nonPlayerCharacter.Personalities.Add(new Guardian());
            nonPlayerCharacter.ExamineDescription  = "Clothed in a gray tunic the priest stands in meditation while emitting a humming sound.";
            nonPlayerCharacter.LookDescription     = "The priest mostly ignores you as all are welcome to the temple of Charon.";
            nonPlayerCharacter.ShortDescription    = "A mediative priest stands in his place in the circle.";
            nonPlayerCharacter.SentenceDescription = "priest";
            nonPlayerCharacter.KeyWords.Add("Priest");

            return(nonPlayerCharacter);
        }
コード例 #22
0
        private INonPlayerCharacter GladiatorGuildMaster()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 20);

            npc.ExamineDescription  = "The Guildmaster is dressed gray studded leather armor.  A blue eagle is emblazoned across his chest but has begun to fade with use.  His arms are squeezed into gauntlets but bulging biceps tell you that you should think twice before picking a fight.";
            npc.LookDescription     = "He looks at you with an annoyed look on his face before returning to his previous activities.";
            npc.ShortDescription    = "The Gladiator Guildmaster.";
            npc.SentenceDescription = "Guildmaster";
            npc.KeyWords.Add("GuildMaster");
            npc.KeyWords.Add("Gladiator");
            npc.Personalities.Add(new GuildMaster(Guilds.Gladiator));
            return(npc);
        }
コード例 #23
0
ファイル: GrandViewCastle.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter CookWoman(int id)
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 22);

            npc.ShortDescription    = "A cook.";
            npc.LookDescription     = "She is stirring a soup over a fire.";
            npc.ExamineDescription  = "The cook waves you over and ask you to try the soup.";
            npc.SentenceDescription = "cook";
            npc.KeyWords.Add("cook");

            npc.Personalities.Add(new Cook(id));

            return(npc);
        }
コード例 #24
0
        private INonPlayerCharacter ArenaSpecator()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 3);

            npc.Personalities.Add(new Wanderer());

            npc.ExamineDescription  = "The spectator looks onward towards the arena floor hoping to catch a glimpse of their favorite gladiator in action.";
            npc.LookDescription     = "Unable to decided if they should sit or stand this fan is contently jumping up and down and changing seats trying to get a better view of the action blow.";
            npc.ShortDescription    = "A spectator sits nervously while watching the games below.";
            npc.SentenceDescription = "A spectator";
            npc.KeyWords.Add("spectator");

            return(npc);
        }
コード例 #25
0
        private IRoom GenerateRoom9()
        {
            IRoom room = IndoorRoomLight();

            room.ExamineDescription = "The black tailored suit and the purple ball gown are most exquisite.  Both are tucked in just the right places to show of the wearers figure and show an eye for detail by the tailor.";
            room.LookDescription    = "Fine tailored suits and formal gowns are displayed in the front window.  The armor is in the back half of the store.";
            room.ShortDescription   = "The better than nothing armor shop";

            INonPlayerCharacter npc = Tailor();

            room.AddMobileObjectToRoom(npc);

            return(room);
        }
コード例 #26
0
        private IRoom GenerateRoom8()
        {
            IRoom room = IndoorRoomLight();

            room.ExamineDescription = "The smell of fresh leather drifts through the shop.  The various shades of browns give the shop a warm look and in the evening the light of the setting sun can be seen entering through the front of the store.  It reflects off the leather samples in the store and creates a nice warm inviting atmosphere, so much so that the shop keeper says that over 20% of her business come at sunset.";
            room.LookDescription    = "Different type of leather armor line one wall while raw materials line the other.";
            room.ShortDescription   = "Hyde's Hides";

            INonPlayerCharacter npc = LeatherWorker();

            room.AddMobileObjectToRoom(npc);

            return(room);
        }
コード例 #27
0
        private IRoom GenerateRoom7()
        {
            IRoom room = IndoorRoomLight();

            room.ExamineDescription = "Anything that you can could need for self protection exists in this shop.  It only a matter of finding something you like.";
            room.LookDescription    = "Swords, shields and armor adorn the walls of the little shop.  While mannequins display items on the floor.";
            room.ShortDescription   = "The Basic Dagger";

            INonPlayerCharacter npc = BlackSmith();

            room.AddMobileObjectToRoom(npc);

            return(room);
        }
コード例 #28
0
ファイル: GrandViewCastle.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter Servant()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 22);

            npc.ShortDescription    = "The kings servant.";
            npc.LookDescription     = "Dressed in plain clothing this servant attends to the needs of their king.";
            npc.ExamineDescription  = "They wear an dark aqua shirt and a brown sleeveless tunic.";
            npc.SentenceDescription = "kings servant";
            npc.KeyWords.Add("servant");

            npc.Personalities.Add(new Servant());

            return(npc);
        }
コード例 #29
0
ファイル: GrandViewCastle.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter Queen()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 28);

            npc.ShortDescription    = "The queen.";
            npc.LookDescription     = "Dressed in a navy blue dress and goes about her day.";
            npc.ExamineDescription  = "The queen is still young and beautiful.";
            npc.SentenceDescription = "queen";
            npc.KeyWords.Add("queen");

            npc.Personalities.Add(new Queen());

            return(npc);
        }
コード例 #30
0
ファイル: GrandViewCastle.cs プロジェクト: elavanis/Mud
        private INonPlayerCharacter King()
        {
            INonPlayerCharacter npc = CreateNonplayerCharacter(MobType.Humanoid, 28);

            npc.ShortDescription    = "The king.";
            npc.LookDescription     = "Dressed in a dark red cloak and goes about his day.";
            npc.ExamineDescription  = "The king is still young but is getting some gray in his beard.";
            npc.SentenceDescription = "king";
            npc.KeyWords.Add("king");

            npc.Personalities.Add(new King());

            return(npc);
        }