lib/goby/entity/entity.rb
def equip_item(item)

      index = has_item(item)
      if index
        actual_item = inventory[index].first

        # Checks for Equippable without importing the file.
        if (defined? actual_item.equip)
          actual_item.equip(self)

          # Equipping the item will always remove it from the entity's inventory.
          remove_item(actual_item)
        else
          print "#{actual_item.name} cannot be equipped!\n\n"
        end
      else
        print NO_SUCH_ITEM_ERROR
      end
    end
# Equips the specified item to the entity's outfit.
#
# @param [Item, String] item the item (or its name) to equip.
Equips the specified item to the entity's outfit.
Equips the specified item to the entity ' s outfit .
def equip_item(item)
      index = has_item(item)
      if index
        actual_item = inventory[index].first
        if (defined? actual_item.equip)
          actual_item.equip(self)
          remove_item(actual_item)
        else
          print "#{actual_item.name} cannot be equipped!\n\n"
        end
      else
        print NO_SUCH_ITEM_ERROR
      end
    end
def equip_item ( item ) index = has_item ( item ) if index actual_item = inventory [ index ] . first if ( defined? actual_item . equip ) actual_item . equip ( self ) remove_item ( actual_item ) else print "#{actual_item.name} cannot be equipped!\n\n" end else print NO_SUCH_ITEM_ERROR end end
Equips the specified item to the entity's outfit.
Equips the specified item to the entity ' s outfit .
# Checks for Equippable without importing the file. # Equipping the item will always remove it from the entity's inventory.
item
item the item (or its name) to equip.
item the item ( or its name ) to equip .