diff options
Diffstat (limited to 'Minecraft.World/Item.cpp')
| -rw-r--r-- | Minecraft.World/Item.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/Minecraft.World/Item.cpp b/Minecraft.World/Item.cpp index 5d723ec5..85a5f1bd 100644 --- a/Minecraft.World/Item.cpp +++ b/Minecraft.World/Item.cpp @@ -275,12 +275,12 @@ void Item::staticCtor() Item::helmet_iron = (ArmorItem *) ( ( new ArmorItem(50, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_iron) ->setTextureName(L"helmetIron")->setDescriptionId(IDS_ITEM_HELMET_IRON)->setUseDescriptionId(IDS_DESC_HELMET_IRON) ); Item::helmet_diamond = (ArmorItem *) ( ( new ArmorItem(54, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_diamond) ->setTextureName(L"helmetDiamond")->setDescriptionId(IDS_ITEM_HELMET_DIAMOND)->setUseDescriptionId(IDS_DESC_HELMET_DIAMOND) ); Item::helmet_gold = (ArmorItem *) ( ( new ArmorItem(58, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_gold) ->setTextureName(L"helmetGold")->setDescriptionId(IDS_ITEM_HELMET_GOLD)->setUseDescriptionId(IDS_DESC_HELMET_GOLD) ); - + Item::chestplate_cloth = (ArmorItem *) ( ( new ArmorItem(43, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_cloth) ->setTextureName(L"chestplateCloth")->setDescriptionId(IDS_ITEM_CHESTPLATE_CLOTH)->setUseDescriptionId(IDS_DESC_CHESTPLATE_LEATHER) ); Item::chestplate_iron = (ArmorItem *) ( ( new ArmorItem(51, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_iron) ->setTextureName(L"chestplateIron")->setDescriptionId(IDS_ITEM_CHESTPLATE_IRON)->setUseDescriptionId(IDS_DESC_CHESTPLATE_IRON) ); Item::chestplate_diamond = (ArmorItem *) ( ( new ArmorItem(55, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_diamond) ->setTextureName(L"chestplateDiamond")->setDescriptionId(IDS_ITEM_CHESTPLATE_DIAMOND)->setUseDescriptionId(IDS_DESC_CHESTPLATE_DIAMOND) ); Item::chestplate_gold = (ArmorItem *) ( ( new ArmorItem(59, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_gold) ->setTextureName(L"chestplateGold")->setDescriptionId(IDS_ITEM_CHESTPLATE_GOLD)->setUseDescriptionId(IDS_DESC_CHESTPLATE_GOLD) ); - + Item::leggings_cloth = (ArmorItem *) ( ( new ArmorItem(44, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_cloth) ->setTextureName(L"leggingsCloth")->setDescriptionId(IDS_ITEM_LEGGINGS_CLOTH)->setUseDescriptionId(IDS_DESC_LEGGINGS_LEATHER) ); Item::leggings_iron = (ArmorItem *) ( ( new ArmorItem(52, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_iron) ->setTextureName(L"leggingsIron")->setDescriptionId(IDS_ITEM_LEGGINGS_IRON)->setUseDescriptionId(IDS_DESC_LEGGINGS_IRON) ); Item::leggings_diamond = (ArmorItem *) ( ( new ArmorItem(56, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_diamond) ->setTextureName(L"leggingsDiamond")->setDescriptionId(IDS_ITEM_LEGGINGS_DIAMOND)->setUseDescriptionId(IDS_DESC_LEGGINGS_DIAMOND) ); @@ -303,14 +303,14 @@ void Item::staticCtor() // 4J-PB - todo - add materials and base types to the ones below Item::bucket_empty = ( new BucketItem(69, 0) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_water)->setTextureName(L"bucket")->setDescriptionId(IDS_ITEM_BUCKET)->setUseDescriptionId(IDS_DESC_BUCKET)->setMaxStackSize(16); Item::bowl = ( new Item(25) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_wood)->setTextureName(L"bowl")->setDescriptionId(IDS_ITEM_BOWL)->setUseDescriptionId(IDS_DESC_BOWL)->setMaxStackSize(64); - + Item::bucket_water = ( new BucketItem(70, Tile::water_Id) ) ->setTextureName(L"bucketWater")->setDescriptionId(IDS_ITEM_BUCKET_WATER)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_WATER); Item::bucket_lava = ( new BucketItem(71, Tile::lava_Id) ) ->setTextureName(L"bucketLava")->setDescriptionId(IDS_ITEM_BUCKET_LAVA)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_LAVA); Item::milk = ( new MilkBucketItem(79) )->setTextureName(L"milk")->setDescriptionId(IDS_ITEM_BUCKET_MILK)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_MILK); Item::bow = (BowItem *)( new BowItem(5) ) ->setTextureName(L"bow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_bow) ->setDescriptionId(IDS_ITEM_BOW)->setUseDescriptionId(IDS_DESC_BOW); Item::arrow = ( new Item(6) ) ->setTextureName(L"arrow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_arrow) ->setDescriptionId(IDS_ITEM_ARROW)->setUseDescriptionId(IDS_DESC_ARROW); - + Item::compass = ( new CompassItem(89) ) ->setTextureName(L"compass")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_compass) ->setDescriptionId(IDS_ITEM_COMPASS)->setUseDescriptionId(IDS_DESC_COMPASS); Item::clock = ( new ClockItem(91) ) ->setTextureName(L"clock")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_clock) ->setDescriptionId(IDS_ITEM_CLOCK)->setUseDescriptionId(IDS_DESC_CLOCK); Item::map = (MapItem *) ( new MapItem(102) ) ->setTextureName(L"map")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_map) ->setDescriptionId(IDS_ITEM_MAP)->setUseDescriptionId(IDS_DESC_MAP); @@ -341,7 +341,7 @@ void Item::staticCtor() ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit,eMaterial_apple)->setTextureName(L"appleGold")->setDescriptionId(IDS_ITEM_APPLE_GOLD);//->setUseDescriptionId(IDS_DESC_GOLDENAPPLE); Item::sign = ( new SignItem(67) ) ->setBaseItemTypeAndMaterial(eBaseItemType_HangingItem, eMaterial_wood)->setTextureName(L"sign")->setDescriptionId(IDS_ITEM_SIGN)->setUseDescriptionId(IDS_DESC_SIGN); - + Item::minecart = ( new MinecartItem(72, Minecart::RIDEABLE) ) ->setTextureName(L"minecart")->setDescriptionId(IDS_ITEM_MINECART)->setUseDescriptionId(IDS_DESC_MINECART); @@ -380,7 +380,7 @@ void Item::staticCtor() Item::cookie = ( new FoodItem(101, 2, FoodConstants::FOOD_SATURATION_POOR, false) ) ->setTextureName(L"cookie")->setDescriptionId(IDS_ITEM_COOKIE)->setUseDescriptionId(IDS_DESC_COOKIE); - Item::shears = (ShearsItem *)( new ShearsItem(103) ) ->setTextureName(L"shears")->setBaseItemTypeAndMaterial(eBaseItemType_devicetool, eMaterial_shears)->setDescriptionId(IDS_ITEM_SHEARS)->setUseDescriptionId(IDS_DESC_SHEARS); + Item::shears = (ShearsItem *)( new ShearsItem(103) ) ->setTextureName(L"shears")->setBaseItemTypeAndMaterial(eBaseItemType_devicetool, eMaterial_shears)->setDescriptionId(IDS_ITEM_SHEARS)->setUseDescriptionId(IDS_DESC_SHEARS); Item::melon = (new FoodItem(104, 2, FoodConstants::FOOD_SATURATION_LOW, false)) ->setTextureName(L"melon")->setDescriptionId(IDS_ITEM_MELON_SLICE)->setUseDescriptionId(IDS_DESC_MELON_SLICE); @@ -473,7 +473,7 @@ void Item::staticCtor() void Item::staticInit() { Stats::buildItemStats(); -} +} _Tier::Tier(int level, int uses, float speed, int damage, int enchantmentValue) : @@ -605,37 +605,37 @@ Icon *Item::getIcon(int auxValue) return icon; } -Icon *Item::getIcon(shared_ptr<ItemInstance> itemInstance) +Icon *Item::getIcon(std::shared_ptr<ItemInstance> itemInstance) { return getIcon(itemInstance->getAuxValue()); } -const bool Item::useOn(shared_ptr<ItemInstance> itemInstance, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly) +const bool Item::useOn(std::shared_ptr<ItemInstance> itemInstance, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly) { return false; } -bool Item::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool Item::useOn(std::shared_ptr<ItemInstance> itemInstance, std::shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { return false; } -float Item::getDestroySpeed(shared_ptr<ItemInstance> itemInstance, Tile *tile) +float Item::getDestroySpeed(std::shared_ptr<ItemInstance> itemInstance, Tile *tile) { return 1; } -bool Item::TestUse(Level *level, shared_ptr<Player> player) +bool Item::TestUse(Level *level, std::shared_ptr<Player> player) { return false; } -shared_ptr<ItemInstance> Item::use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player) +std::shared_ptr<ItemInstance> Item::use(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player) { return itemInstance; } -shared_ptr<ItemInstance> Item::useTimeDepleted(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player) +std::shared_ptr<ItemInstance> Item::useTimeDepleted(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player) { return itemInstance; } @@ -683,20 +683,20 @@ bool Item::canBeDepleted() /** * Returns true when the item was used to deal more than default damage -* +* * @param itemInstance * @param mob * @param attacker * @return */ -bool Item::hurtEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<Mob> mob, shared_ptr<Mob> attacker) +bool Item::hurtEnemy(std::shared_ptr<ItemInstance> itemInstance, std::shared_ptr<Mob> mob, std::shared_ptr<Mob> attacker) { return false; } /** * Returns true when the item was used to mine more efficiently -* +* * @param itemInstance * @param tile * @param x @@ -705,12 +705,12 @@ bool Item::hurtEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<Mob> mob, * @param owner * @return */ -bool Item::mineBlock(shared_ptr<ItemInstance> itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr<Mob> owner) +bool Item::mineBlock(std::shared_ptr<ItemInstance> itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr<Mob> owner) { return false; } -int Item::getAttackDamage(shared_ptr<Entity> entity) +int Item::getAttackDamage(std::shared_ptr<Entity> entity) { return 1; } @@ -720,7 +720,7 @@ bool Item::canDestroySpecial(Tile *tile) return false; } -bool Item::interactEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<Mob> mob) +bool Item::interactEnemy(std::shared_ptr<ItemInstance> itemInstance, std::shared_ptr<Mob> mob) { return false; } @@ -753,7 +753,7 @@ LPCWSTR Item::getDescription() //return I18n::get(getDescriptionId()); } -LPCWSTR Item::getDescription(shared_ptr<ItemInstance> instance) +LPCWSTR Item::getDescription(std::shared_ptr<ItemInstance> instance) { return app.GetString(getDescriptionId(instance)); //return I18n::get(getDescriptionId(instance)); @@ -764,7 +764,7 @@ unsigned int Item::getDescriptionId(int iData /*= -1*/) return descriptionId; } -unsigned int Item::getDescriptionId(shared_ptr<ItemInstance> instance) +unsigned int Item::getDescriptionId(std::shared_ptr<ItemInstance> instance) { return descriptionId; } @@ -780,7 +780,7 @@ unsigned int Item::getUseDescriptionId() return useDescriptionId; } -unsigned int Item::getUseDescriptionId(shared_ptr<ItemInstance> instance) +unsigned int Item::getUseDescriptionId(std::shared_ptr<ItemInstance> instance) { return useDescriptionId; } @@ -791,7 +791,7 @@ Item *Item::setCraftingRemainingItem(Item *craftingRemainingItem) return this; } -bool Item::shouldMoveCraftingResultToInventory(shared_ptr<ItemInstance> instance) +bool Item::shouldMoveCraftingResultToInventory(std::shared_ptr<ItemInstance> instance) { // Default is good for the vast majority of items return true; @@ -817,15 +817,15 @@ wstring Item::getName() return L"";//I18n::get(getDescriptionId() + L".name"); } -int Item::getColor(shared_ptr<ItemInstance> item, int spriteLayer) +int Item::getColor(std::shared_ptr<ItemInstance> item, int spriteLayer) { return 0xffffff; } -void Item::inventoryTick(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Entity> owner, int slot, bool selected) { +void Item::inventoryTick(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Entity> owner, int slot, bool selected) { } -void Item::onCraftedBy(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player) +void Item::onCraftedBy(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player) { } @@ -834,17 +834,17 @@ bool Item::isComplex() return false; } -UseAnim Item::getUseAnimation(shared_ptr<ItemInstance> itemInstance) +UseAnim Item::getUseAnimation(std::shared_ptr<ItemInstance> itemInstance) { return UseAnim_none; } -int Item::getUseDuration(shared_ptr<ItemInstance> itemInstance) +int Item::getUseDuration(std::shared_ptr<ItemInstance> itemInstance) { return 0; } -void Item::releaseUsing(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player, int durationLeft) +void Item::releaseUsing(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player, int durationLeft) { } @@ -864,35 +864,35 @@ bool Item::hasPotionBrewingFormula() return !potionBrewingFormula.empty(); } -void Item::appendHoverText(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, vector<wstring> *lines, bool advanced, vector<wstring> &unformattedStrings) +void Item::appendHoverText(std::shared_ptr<ItemInstance> itemInstance, std::shared_ptr<Player> player, vector<wstring> *lines, bool advanced, vector<wstring> &unformattedStrings) { } -wstring Item::getHoverName(shared_ptr<ItemInstance> itemInstance) +wstring Item::getHoverName(std::shared_ptr<ItemInstance> itemInstance) { //String elementName = ("" + Language.getInstance().getElementName(getDescription(itemInstance))).trim(); //return elementName; return app.GetString(getDescriptionId(itemInstance)); } -bool Item::isFoil(shared_ptr<ItemInstance> itemInstance) +bool Item::isFoil(std::shared_ptr<ItemInstance> itemInstance) { if (itemInstance->isEnchanted()) return true; return false; } -const Rarity *Item::getRarity(shared_ptr<ItemInstance> itemInstance) +const Rarity *Item::getRarity(std::shared_ptr<ItemInstance> itemInstance) { if (itemInstance->isEnchanted()) return Rarity::rare; return Rarity::common; } -bool Item::isEnchantable(shared_ptr<ItemInstance> itemInstance) +bool Item::isEnchantable(std::shared_ptr<ItemInstance> itemInstance) { return getMaxStackSize() == 1 && canBeDepleted(); } -HitResult *Item::getPlayerPOVHitResult(Level *level, shared_ptr<Player> player, bool alsoPickLiquid) +HitResult *Item::getPlayerPOVHitResult(Level *level, std::shared_ptr<Player> player, bool alsoPickLiquid) { float a = 1; @@ -935,7 +935,7 @@ Icon *Item::getLayerIcon(int auxValue, int spriteLayer) return getIcon(auxValue); } -bool Item::isValidRepairItem(shared_ptr<ItemInstance> source, shared_ptr<ItemInstance> repairItem) +bool Item::isValidRepairItem(std::shared_ptr<ItemInstance> source, std::shared_ptr<ItemInstance> repairItem) { return false; } |
