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

  # sends <message> to all characters in the room
  def cmd_say(args)
    if has_attribute? :zombie or self.is_a? Zombie and args
	# Urban Deads Zombie Lexicon :D
	args.gsub!(/[cdefijklopqstuvwxy0-9`~\\\/;:\"\'\{\}\[\]\@\#\$\%\^\&\*\(\)\-_+=|]+/i, "")
    end
    case args
    when nil, ""
      sendto _("What are you trying to say?")
    else
      sendto _("You say, \"%{args}\"." % {:args => args})
      get_object(location).characters(id).each do |p|
	msg = Msg.new _("^p1 says, \"%{args}\"." % {:args => args})
	msg.p1 = name
        if has_attribute? :invisible
		msg.p1 = _("someone") if not p.cansee? :invisible
	end
	add_event(id,p.id,:show,msg)
      end
    end
  end

end