示例#1
0
        public static void do_open(CharacterInstance ch, string argument)
        {
            var firstArg = argument.FirstWord();

            if (CheckFunctions.CheckIfEmptyString(ch, firstArg, "Open what?"))
            {
                return;
            }

            var exit = ch.FindExit(firstArg, true);

            if (exit != null)
            {
                OpenDoor(ch, exit, firstArg);
                return;
            }

            var obj = ch.GetObjectOnMeOrInRoom(firstArg);

            if (obj != null)
            {
                OpenObject(ch, obj, firstArg);
                return;
            }

            ch.Printf("You see no %s here.", firstArg);
        }
示例#2
0
        public static void do_bashdoor(CharacterInstance ch, string argument)
        {
            var skill = RepositoryManager.Instance.GetEntity <SkillData>("bashdoor");

            if (CheckFunctions.CheckIfTrue(ch, !ch.IsNpc() && ch.Level < skill.SkillLevels.ToList()[(int)ch.CurrentClass],
                                           "You're not enough of a warrior to bash doors!"))
            {
                return;
            }

            var firstArg = argument.FirstWord();

            if (CheckFunctions.CheckIfEmptyString(ch, firstArg, "Bash what?"))
            {
                return;
            }
            if (CheckFunctions.CheckIfNotNullObject(ch, ch.CurrentFighting, "You can't break off your fight."))
            {
                return;
            }

            var exit = ch.FindExit(firstArg);

            if (exit == null)
            {
                Bash(ch, skill, "wall");
            }
            else
            {
                BashSomething(ch, exit, skill, firstArg);
            }
        }
示例#3
0
        public static void do_unbolt(CharacterInstance ch, string argument)
        {
            var firstArg = argument.FirstWord();

            if (CheckFunctions.CheckIfEmptyString(ch, firstArg, "Unbolt what?"))
            {
                return;
            }

            var exit = ch.FindExit(firstArg, true);

            if (exit == null)
            {
                ch.Printf("You see no %s here.", firstArg);
                return;
            }

            if (exit.Flags.IsSet(ExitFlags.Secret) && !exit.Keywords.IsAnyEqual(firstArg))
            {
                ch.Printf("You see no %s here.", firstArg);
                return;
            }

            if (CheckFunctions.CheckIfNotSet(ch, exit.Flags, ExitFlags.IsDoor, "You can't do that."))
            {
                return;
            }
            if (CheckFunctions.CheckIfNotSet(ch, exit.Flags, ExitFlags.Closed, "It's not closed."))
            {
                return;
            }
            if (CheckFunctions.CheckIfNotSet(ch, exit.Flags, ExitFlags.IsBolt, "You don't see a bolt."))
            {
                return;
            }
            if (CheckFunctions.CheckIfNotSet(ch, exit.Flags, ExitFlags.Bolted, "It's already unbolted."))
            {
                return;
            }

            if (!exit.Flags.IsSet(ExitFlags.Secret))
            {
                ch.SendTo("*Clunk*");
                comm.act(ATTypes.AT_ACTION, "$n unbolts the $d.", ch, null, exit.Keywords, ToTypes.Room);
                exit.RemoveFlagFromSelfAndReverseExit(ExitFlags.Bolted);
            }
        }
示例#4
0
        public static void do_enter(CharacterInstance ch, string argument)
        {
            if (string.IsNullOrEmpty(argument))
            {
                EnterExit(ch);
                return;
            }

            var exit = ch.FindExit(argument, true);

            if (exit != null && exit.Flags.IsSet(ExitFlags.xEnter))
            {
                Move.move_char(ch, exit, 0);
                return;
            }

            ch.SendTo("You cannot enter that.");
        }
示例#5
0
        public static void do_leave(CharacterInstance ch, string argument)
        {
            if (string.IsNullOrEmpty(argument))
            {
                LeaveRoom(ch);
                return;
            }

            var exit = ch.FindExit(argument, true);

            if (exit != null && exit.Flags.IsSet(ExitFlags.xLeave))
            {
                Move.move_char(ch, exit, 0);
                return;
            }

            ch.SendTo("You cannot leave that way.");
        }
示例#6
0
        public static void do_climb(CharacterInstance ch, string argument)
        {
            if (string.IsNullOrEmpty(argument))
            {
                foreach (var ext in ch.CurrentRoom.Exits.Where(ext => ext.Flags.IsSet(ExitFlags.xClimb)))
                {
                    Move.move_char(ch, ext, 0);
                    return;
                }

                ch.SendTo("You cannot climb here.");
                return;
            }

            var exit = ch.FindExit(argument, true);

            if (exit != null && exit.Flags.IsSet(ExitFlags.xClimb))
            {
                Move.move_char(ch, exit, 0);
                return;
            }

            ch.SendTo("You cannot climb there.");
        }