2012-09-23 18:09:57 -04:00
|
|
|
|
2012-07-15 16:36:34 -04:00
|
|
|
#pragma once
|
2012-09-23 18:09:57 -04:00
|
|
|
|
|
|
|
#include "ItemHandler.h"
|
|
|
|
#include "../World.h"
|
|
|
|
#include "../Player.h"
|
2012-07-15 16:36:34 -04:00
|
|
|
|
|
|
|
class cItemPickaxeHandler : public cItemHandler
|
|
|
|
{
|
|
|
|
public:
|
2012-10-18 15:41:29 -04:00
|
|
|
cItemPickaxeHandler(int a_ItemType)
|
|
|
|
: cItemHandler(a_ItemType)
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char PickaxeLevel()
|
|
|
|
{
|
2012-10-18 15:41:29 -04:00
|
|
|
switch(m_ItemType)
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
case E_ITEM_WOODEN_PICKAXE:
|
|
|
|
case E_ITEM_GOLD_PICKAXE:
|
|
|
|
return 1;
|
|
|
|
case E_ITEM_STONE_PICKAXE:
|
|
|
|
return 2;
|
|
|
|
case E_ITEM_IRON_PICKAXE:
|
|
|
|
return 3;
|
|
|
|
case E_ITEM_DIAMOND_PICKAXE:
|
|
|
|
return 4;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-03 04:52:11 -04:00
|
|
|
virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
2012-10-03 04:52:11 -04:00
|
|
|
switch(a_BlockType)
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
case E_BLOCK_OBSIDIAN:
|
|
|
|
return PickaxeLevel() >= 4;
|
|
|
|
case E_BLOCK_DIAMOND_BLOCK:
|
|
|
|
case E_BLOCK_DIAMOND_ORE:
|
|
|
|
case E_BLOCK_GOLD_BLOCK:
|
|
|
|
case E_BLOCK_GOLD_ORE:
|
|
|
|
case E_BLOCK_REDSTONE_ORE:
|
|
|
|
case E_BLOCK_REDSTONE_ORE_GLOWING:
|
2012-08-06 06:36:20 -04:00
|
|
|
case E_BLOCK_EMERALD_ORE:
|
2012-07-15 16:36:34 -04:00
|
|
|
return PickaxeLevel() >= 3;
|
|
|
|
case E_BLOCK_IRON_BLOCK:
|
|
|
|
case E_BLOCK_IRON_ORE:
|
|
|
|
case E_BLOCK_LAPIS_ORE:
|
|
|
|
case E_BLOCK_LAPIS_BLOCK:
|
|
|
|
return PickaxeLevel() >= 2;
|
|
|
|
case E_BLOCK_COAL_ORE:
|
|
|
|
case E_BLOCK_STONE:
|
|
|
|
case E_BLOCK_COBBLESTONE:
|
|
|
|
case E_BLOCK_END_STONE:
|
|
|
|
case E_BLOCK_MOSSY_COBBLESTONE:
|
2012-08-06 06:36:20 -04:00
|
|
|
case E_BLOCK_SANDSTONE_STAIRS:
|
2012-07-15 16:36:34 -04:00
|
|
|
case E_BLOCK_SANDSTONE:
|
|
|
|
case E_BLOCK_STONE_BRICKS:
|
|
|
|
case E_BLOCK_NETHER_BRICK:
|
|
|
|
case E_BLOCK_NETHERRACK:
|
|
|
|
case E_BLOCK_STONE_SLAB:
|
|
|
|
case E_BLOCK_DOUBLE_STONE_SLAB:
|
|
|
|
case E_BLOCK_STONE_PRESSURE_PLATE:
|
|
|
|
case E_BLOCK_BRICK:
|
|
|
|
case E_BLOCK_COBBLESTONE_STAIRS:
|
|
|
|
case E_BLOCK_STONE_BRICK_STAIRS:
|
|
|
|
case E_BLOCK_NETHER_BRICK_STAIRS:
|
|
|
|
return PickaxeLevel() >= 1;
|
|
|
|
}
|
2012-07-16 09:30:33 -04:00
|
|
|
return false;
|
2012-07-15 16:36:34 -04:00
|
|
|
}
|
|
|
|
};
|