Пример #1
0
 private void FillRoomControls(Rooms.Room room)
 {
     roomIdValue.Text          = room.Id.ToString();
     roomTitleValue.Text       = room.Title;
     roomDescriptionValue.Text = room.Description;
     room.GetRoomExits();
     FillExits(room.RoomExits);
     FillModifiers(Rooms.Room.GetModifiers(room.Id));
 }
Пример #2
0
        private string Look(Rooms.Room room)
        {
            StringBuilder sb = new StringBuilder();

            //let's build the description the player will see
            room.GetRoomExits();
            List <Rooms.Exits> exitList = room.RoomExits;

            sb.AppendLine(("- " + room.Title + " -\t\t\t").ToUpper());
            //TODO: add a "Descriptive" flag, that we will use to determine if we need to display the room description.
            sb.AppendLine(room.Description);
            sb.Append(HintCheck(room.Id));

            foreach (Rooms.Exits exit in exitList)
            {
                sb.AppendLine(GetExitDescription(exit, room));
            }

            return(sb.ToString());
        }
Пример #3
0
        public void Execute(Character.NPC actor, ITrigger trigger = null)
        {
            if (!actor.IsDead() && !actor.InCombat)
            {
                Rooms.Room room = Rooms.Room.GetRoom(actor.Location);
                room.GetRoomExits();
                List <Rooms.Exits> availableExits = room.RoomExits;
                if (DateTime.Now.ToUniversalTime() > actor.NextAiAction)  //so it's time for this AI state to execute
                {
                    Commands.CommandParser.ExecuteCommand(actor, availableExits[Extensions.RandomNumber.GetRandomNumber().NextNumber(0, availableExits.Count)].Direction);
                    actor.NextAiAction = DateTime.Now.AddSeconds(Extensions.RandomNumber.GetRandomNumber().NextNumber(60, 121)).ToUniversalTime(); //set when we want this action to execute next
                    if (!FSM.ContinueWithThisState())
                    {
                        actor.Fsm.ChangeState(Speak.GetState(), actor);
                    }
                }
            }

            if (actor.InCombat)
            {
                actor.Fsm.ChangeState(Combat.GetState(), actor);
            }
        }