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_force.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")

  # The force command
  def cmd_force(args)
	case args
	when /(\w+) (.+)/
		who = $1
		what = $2
		ppl = []
		ppl = peopleinroom(who)
		case ppl.size
		when 0
			# More than one check current world
			ppl.clear
			objs = world.find_objects(who)
			objs.each { |o| ppl << o if o.is_a? Character and not o.unused }
			case ppl.size
			when 0
				sendto _("Player/Mobile not found.")
			when 1
				# Because this cmd is so evil we log it
				log.info "#{name} used FORCE on #{who} to #{what}"
				ppl[0].parse(what)
			else
				sendto _("There are too many.  Perhaps you should go to their room.")
			end
		when 1
			# Because this cmd is so evil we log it
			log.info "#{name} used FORCE on #{who} to #{what}"
			ppl[0].parse(what)
		else
			sendto _("Which one?")
		end
	else
		sendto _("Force whom to do what?")
	end
  end

end