Example #1
0
// === EQUIP === //
void BagManager::equip(Actor* item)
{
  ItemSlotType itemSlot = item->getFeature<Pickable>()->getItemSlot();
  Wearer* playerWearer = Actor::Player->getFeature<Wearer>();

  if ( playerWearer->hasSlot( itemSlot ) )
  {
    if ( canEquip(itemSlot) ) doTheEquip(item);
  }
  else
  {
    msgBox( "You haven't got appropriate slot to equip this item.", gui::MsgType::Error);
  }

}
Example #2
0
EquipmentSlot Item::getEquipmentSlot() const {
    CHECK(canEquip());
    if (getType() == ItemType::WEAPON)
        return EquipmentSlot::WEAPON;
    if (getType() == ItemType::RANGED_WEAPON)
        return EquipmentSlot::RANGED_WEAPON;
    if (getType() == ItemType::AMULET)
        return EquipmentSlot::AMULET;
    if (armorType == ArmorType::BODY_ARMOR)
        return EquipmentSlot::BODY_ARMOR;
    if (armorType == ArmorType::HELMET)
        return EquipmentSlot::HELMET;
    if (armorType == ArmorType::BOOTS)
        return EquipmentSlot::BOOTS;
    FAIL << "other equipment slot";
    return EquipmentSlot::HELMET;
}
Example #3
0
EquipmentSlot Item::getEquipmentSlot() const {
  CHECK(canEquip());
  return *attributes->equipmentSlot;
}