# # file:: cmd_bury.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 bury command def cmd_bury(args) can_bury = false with_what = _("%{pos} bare hands" % {:pos => pos_pronoun}) 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_bury = true end end can_bury = true if world.can_build? id if not can_bury sendto _("You have nothing to dig with.") return end objs = find_inv(args) if objs.size > 0 sendto _("You begin to dig with %{with_what}" % {:with_what => with_what}) sendroom _("%{name} begins digging with %{with_what}." % {:name => name, :with_what => with_what}) objs.each do |o| add_event(id,o.id,:bury) end else sendto _("Bury what?") end end end