aboutsummaryrefslogtreecommitdiff
path: root/plugins/sword
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sword')
-rw-r--r--plugins/sword/Makefile2
-rw-r--r--plugins/sword/sword.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/plugins/sword/Makefile b/plugins/sword/Makefile
index 034ba74..2173fa1 100644
--- a/plugins/sword/Makefile
+++ b/plugins/sword/Makefile
@@ -1,4 +1,4 @@
-plugins/sword/sword.so: plugins/sword/sword.c plugins/game/game.h plugins/movement/movement.h plugins/inventory/inventory.h plugins/recharge/recharge.h
+plugins/sword/sword.so: plugins/sword/sword.c plugins/game/game.h plugins/movement/movement.h plugins/inventory/inventory.h plugins/recharge/recharge.h plugins/loot/loot.h
cc -g -shared -fpic -o plugins/sword/sword.so plugins/sword/sword.c
PLUGINS := ${PLUGINS} plugins/sword/sword.so
diff --git a/plugins/sword/sword.c b/plugins/sword/sword.c
index bac963f..31bb87a 100644
--- a/plugins/sword/sword.c
+++ b/plugins/sword/sword.c
@@ -4,6 +4,7 @@
#include "../movement/movement.h"
#include "../inventory/inventory.h"
#include "../recharge/recharge.h"
+#include "../loot/loot.h"
static bool use_broken_sword(struct itemstack *stack)
{
@@ -73,4 +74,11 @@ __attribute__((constructor)) static void init()
.run_if_dead = false,
.callback = &handle_e,
});
+
+ register_loot((struct loot) {
+ .chance = 7,
+ .item = &sword,
+ .min = 1,
+ .max = 1,
+ });
}