put.rb
rbmud-0.2/commands/put.rb · 571 B
From the archive RbMUD-0.2.tar.bz2
Download the archive « Back to the archive contents
#!/usr/bin/env ruby
# $Revision: 1.4 $
# $Date: 2003/12/06 18:12:08 $
# $Author: mikeman2 $
# test.rb
# the contents of this file will probably change every time i want to try
# something new.
def Commands.do_put(user, args = "")
user.contents.each{|obj|
if obj.kind_of?(Item)
user.location.contents << obj
user.contents.delete(obj)
user.puts("&WYou put down #{obj.name}.&*")
user.location.puts("&W#{user.name} puts down #{obj.name}.&*", user)
return
else
user.puts("&WYou can't put down #{obj.name}!&*")
end if obj.name.include?(args)
}
end