use of eidolons.entity.item.DC_JewelryObj in project Eidolons by IDemiurge.
the class UnitShop method equip.
private static void equip(Unit unit, DC_HeroItemObj item, ITEM_SLOT slot) {
if (slot != null) {
if (!unit.equip(item, slot)) {
LogMaster.log(1, unit.getName() + " failed to equip " + item.getName());
}
} else {
if (item instanceof DC_JewelryObj) {
unit.addJewelryItem((DC_JewelryObj) item);
} else {
if (item instanceof DC_QuickItemObj) {
unit.getQuickItems().add((DC_QuickItemObj) item);
} else {
DC_HeroItemObj itemObj = ItemFactory.createItemObj(item.getType(), unit.getOriginalOwner(), unit.getGame(), unit.getRef(), true);
unit.getQuickItems().add((DC_QuickItemObj) itemObj);
}
}
}
}
use of eidolons.entity.item.DC_JewelryObj in project Eidolons by IDemiurge.
the class DC_HeroManager method addJewelryItem.
@Override
protected int addJewelryItem(Unit hero, Entity type) {
DC_HeroItemObj item = null;
if (type instanceof DC_JewelryObj) {
item = (DC_HeroItemObj) type;
} else {
item = (DC_HeroItemObj) ObjUtilities.findObjByType(type, hero.getInventory());
}
int result = super.addJewelryItem(hero, type);
if (result == 0) {
return 0;
}
hero.addJewelryItem((DC_JewelryObj) item);
hero.removeFromInventory(item);
update(hero);
return result;
}
Aggregations