]> git.lizzy.rs Git - dungeon_game.git/blobdiff - plugins/monster/monster.c
Separate air_function chances for rooms and corridors
[dungeon_game.git] / plugins / monster / monster.c
index 02957da9abd6d52e2bbe5afd1c4524ff6b449c8a..d140005dbddac22831cf5263681d0cef32c2d98d 100644 (file)
@@ -10,8 +10,6 @@ struct monster_data
 
 static void monster_spawn(struct entity *self, void *data)
 {
-       (void) data;
-
        self->meta = malloc(sizeof(struct monster_data));
        ((struct monster_data *) self->meta)->timer = 0.5;
 }
@@ -62,7 +60,7 @@ static struct entity monster_entity = {
 };
 
 
-static void spawn_monster(int x, int y)
+static void spawn_monster(int x, int y, enum mg_context ctx)
 {
        spawn(monster_entity, x, y, NULL);
 }
@@ -70,7 +68,8 @@ static void spawn_monster(int x, int y)
 __attribute__((constructor)) static void init()
 {
        register_air_function((struct generator_function) {
-               .chance = 50,
+               .corridor_chance = 50,
+               .room_chance = 200,
                .callback = &spawn_monster,
        });
 }