inventory.rb
rbmud-0.2/commands/inventory.rb · 476 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_inventory(user, args = "")
user.puts("&WYou are carrying:&*")
if user.contents.length > 0
user.contents.each{|obj|
if obj.kind_of?(Item)
user.puts("&l#{obj.name}&*")
end
}
else
user.puts("&WNothing.&*")
return
end if user.contents != nil
end