aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-07-29 18:25:01 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-07-29 18:37:26 -0400
commit738c3c59a03135f2adeed3804c5a45faf441c947 (patch)
tree83a533c5a32807bea05ccd55e0a08edb3847c4ef /src/player.cpp
parent9e540db7d6492168cadcafddbf145ffdd7b21981 (diff)
added gif support
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 6674da0..3606bc7 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -227,7 +227,7 @@ void PlayerSystem::receive(const UseItemEvent& uie)
uie.attack->range.x *= -1;
game::events.emit<AttackEvent>(loc, *uie.attack, true);
} else if (uie.item->type == "Bow") {
- /*if (InventorySystem::take("Arrow", 1)) {
+ if (InventorySystem::take("Arrow", 1)) {
auto e = game::entities.create();
auto pos = getPosition();
e.assign<Position>(pos.x, pos.y + 10);
@@ -242,8 +242,10 @@ void PlayerSystem::receive(const UseItemEvent& uie)
sprite->addSpriteSegment(SpriteData(tex->sprite), 0);
auto dim = HLINES(sprite->getSpriteSize());
e.assign<Solid>(dim.x, dim.y);
- e.assign<Hit>(10, false);
- }*/
+ e.assign<Hit>(uie.attack->power, false);
+ if (uie.attack->effect.size() > 0)
+ e.component<Hit>()->effect = uie.attack->effect;
+ }
}
cool.store(false);