znmud-0.0.1/benchmark/
znmud-0.0.1/cmd/
znmud-0.0.1/cmd/emotes/
znmud-0.0.1/cmd/objects/
znmud-0.0.1/cmd/tiny/
znmud-0.0.1/doc/
znmud-0.0.1/farts/
znmud-0.0.1/lib/
znmud-0.0.1/lib/combat/
znmud-0.0.1/lib/core/bodytypes/
znmud-0.0.1/lib/engine/
znmud-0.0.1/lib/farts/
znmud-0.0.1/logs/
#
# file::    cmd_lock.rb

# This source code copyright (C) 2009 Craig Smith
# All rights reserved.
#
# Released under the terms of the TeensyMUD Public License
# See LICENSE file for additional information.
#

module Cmd

  bindtextdomain("cmd")

  # Opens doors..
  def cmd_lock(args)
	case args
	when nil,""
		sendto _("Lock what?")
	else
		loc = get_object(location)
		possible_doors = []
		loc.exits.each do |exid|
			ex = get_object(exid)
			if not ex.door_state == Exit::NO_DOOR
				possible_doors << ex if ex.door_name=~/#{args}/i
			end
		end
		case possible_doors.size
		when 0
			sendto _("You do not see that.")
		when 1
			add_event(id, possible_doors[0].id, :lockdoor)
		else
			sendto _("There are too many to pick from.")
		end
	end
  end

end