-
Notifications
You must be signed in to change notification settings - Fork 78
Pickaxe, Hatchet, & Shovel #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hellosammu
wants to merge
3
commits into
ReMinecraftPE:master
Choose a base branch
from
hellosammu:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+361
−70
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include "HatchetItem.hpp" | ||
| #include "world/tile/Tile.hpp" | ||
|
|
||
| HatchetItem::HatchetItem(int id, Tier& tier) : ToolItem(id, 1, tier) | ||
| { | ||
| static const Tile* hatchetTiles[] = | ||
| { | ||
| Tile::wood, | ||
| Tile::bookshelf, | ||
| Tile::treeTrunk, | ||
| // Tile::chest | ||
| }; | ||
|
|
||
| static const int HATCHET_TILE_COUNT = sizeof(hatchetTiles) / sizeof(Tile*); | ||
| initializeTiles(hatchetTiles, HATCHET_TILE_COUNT); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #pragma once | ||
|
|
||
| #include "ToolItem.hpp" | ||
|
|
||
| class HatchetItem : public ToolItem | ||
| { | ||
| public: | ||
| HatchetItem(int id, Tier& tier); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,17 +45,18 @@ class Item | |
|
|
||
| struct Tier | ||
| { | ||
| int field_0; | ||
| int m_Durability; | ||
| float m_HitStrength; | ||
| int field_C; | ||
|
|
||
| Tier(int a, int b, float c, int d) : | ||
| field_0(a), | ||
| m_Durability(b), | ||
| m_HitStrength(c), | ||
| field_C(d) | ||
| {} | ||
| int m_level; | ||
| int m_uses; | ||
| float m_speed; | ||
| int m_damage; | ||
|
|
||
| Tier(int level, int uses, float speed, int damage) : | ||
| m_level(level), | ||
| m_uses(uses), | ||
| m_speed(speed), | ||
| m_damage(damage) | ||
| { | ||
| } | ||
|
|
||
| // Item tiers | ||
| static Tier WOOD, STONE, IRON, EMERALD, GOLD; | ||
|
|
@@ -72,16 +73,16 @@ class Item | |
| virtual int getIcon(const ItemStack*) const; | ||
| virtual bool useOn(ItemStack*, Level*, const TilePos& pos, Facing::Name face) const; | ||
| virtual bool useOn(ItemStack*, Player*, Level*, const TilePos& pos, Facing::Name face) const; | ||
| virtual float getDestroySpeed(ItemStack*, Tile*) const; | ||
| virtual float getDestroySpeed(ItemStack*, const Tile*) const; | ||
| virtual ItemStack* use(ItemStack*, Level*, Player*) const; | ||
| virtual int getMaxStackSize() const; | ||
| virtual TileData getLevelDataForAuxValue(int x) const; | ||
| virtual bool isStackedByData() const; | ||
| virtual int getMaxDamage() const; | ||
| virtual void hurtEnemy(ItemStack*, Mob*) const; | ||
| virtual void mineBlock(ItemStack*, const TilePos& pos, Facing::Name face) const; | ||
| virtual void mineBlock(ItemStack*, const TilePos& pos, Facing::Name face, Player* player) const; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should take a Mob*, not a Player* |
||
| virtual int getAttackDamage(Entity*) const; | ||
| virtual bool canDestroySpecial(Tile*) const; | ||
| virtual bool canDestroySpecial(const Tile*) const; | ||
| virtual void interactEnemy(ItemStack*, Mob*) const; | ||
| virtual Item* handEquipped(); | ||
| virtual bool isHandEquipped() const; | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.