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_dig.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 dig command
  def cmd_dig(args)
  	can_dig = false
	with_what = _("bare hands")
	if get_object(location).has_attribute? :inside
		sendto _("You can not dig inside.")
		return
	end
	@body.wielding?.each do |oid|
		if get_object(oid).has_attribute? :shovel
			with_what = get_object(oid).shortname
			can_dig = true
		end
	end
	can_dig = true if world.can_build? id
	if can_dig
		sendto _("You begin digging with your %{obj}." % {:obj => with_what})
		sendroom _("%{name} begins degging with %{pos} %{obj}." % {:name => name, :obj => with_what, :pos => pos_pronoun})
		add_event(id,location,:dig)
	else
		sendto _("You have nothing to dig with.")
	end
  end

end