aboutsummaryrefslogtreecommitdiff
path: root/plugins/sword/sword.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sword/sword.c')
-rw-r--r--plugins/sword/sword.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/sword/sword.c b/plugins/sword/sword.c
index f399150..653692f 100644
--- a/plugins/sword/sword.c
+++ b/plugins/sword/sword.c
@@ -3,6 +3,7 @@
#include "../game/game.h"
#include "../movement/movement.h"
#include "../inventory/inventory.h"
+#include "../recharge/recharge.h"
static bool use_broken_sword(struct itemstack *stack)
{
@@ -22,6 +23,9 @@ static struct item broken_sword = {
static bool use_sword(struct itemstack *stack)
{
+ if (! is_charged())
+ return false;
+
int x, y;
x = player.x;
y = player.y;
@@ -35,6 +39,8 @@ static bool use_sword(struct itemstack *stack)
if (rand() % 100 == 0)
stack->item = &broken_sword;
+
+ recharge(1.0, "⚔ ");
}
return false;