]> git.lizzy.rs Git - dungeon_game.git/blobdiff - plugins/cherry/cherry.c
Add loot boxes
[dungeon_game.git] / plugins / cherry / cherry.c
index 1b0ac8a5c664c063c013dae6c8d84f74a7ba9f1f..96f0a2aeafe012758b9ac679fb0acb2ffdbc34f2 100644 (file)
@@ -3,6 +3,7 @@
 #include "../game/game.h"
 #include "../score/score.h"
 #include "../inventory/inventory.h"
+#include "../loot/loot.h"
 
 static bool use_cherry(struct itemstack *stack)
 {
@@ -66,5 +67,12 @@ __attribute__((constructor)) static void init()
                .room_chance = 100,
                .callback = &spawn_cherry,
        });
+
+       register_loot((struct loot) {
+               .item = &cherry_item,
+               .chance = 2,
+               .min = 3,
+               .max = 10,
+       });
 }