get.rb
rbmud-0.2/commands/get.rb · 577 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_get(user, args = "")
user.location.contents.each{|obj|
if obj.kind_of?(Item)
user.contents << obj
user.location.contents.delete(obj)
user.puts("&WYou pick up #{obj.name}.&*")
user.location.puts("&W#{user.name} picks up #{obj.name}.&*", user)
return
else
user.puts("&WYou can't pick up #{obj.name}!&*")
end if obj.name.include?(args)
}
end