X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=src%2Fmap_object_actions.h;h=ae764b9f1ea746d97fd1c555f9eb003f977e3cf3;hb=fb8ddca6abc66eb7e52a007850689309b4cda938;hp=2202b27e60642cc70485332f8c84ccc607c09e2d;hpb=a037841b38d73f59839731eb3ffaf4edc43d9cf0;p=plomrogue
diff --git a/src/map_object_actions.h b/src/map_object_actions.h
index 2202b27..ae764b9 100644
--- a/src/map_object_actions.h
+++ b/src/map_object_actions.h
@@ -1,15 +1,51 @@
+/* map_object_actions.h
+ *
+ * Routines for the actions available to map objects.
+ */
+
#ifndef MAP_OBJECT_ACTIONS_H
#define MAP_OBJECT_ACTIONS_H
-#include "yx_uint16.h"
+
+#include "yx_uint16.h" /* for yx_uint16 coordinates */
struct World;
struct Map;
-struct Monster;
+struct MapObj;
+
+
+
+/* Try to move "monster" in random direction. On contact with other monster,
+ * only bump. On contact with player, fight / reduce player's hitpoints,
+ * and thereby potentially trigger the player's death. Update the log for any
+ * contact action.
+ */
+extern void move_monster(struct World * world, struct MapObj * monster);
+
+
+
+/* Try to move player in direction "d". On contact with monster, fight / reduce
+ * monster's hitpoints, and thereby potentially trigger the monster's death,
+ * create a corpse and increment the player's score by the amount of hitpoints
+ * the monster started with. Update the log on whatever the player did and turn
+ * control over to the enemy.
+ */
+extern void move_player (struct World * world, enum dir d);
+
+
+
+/* Make player wait one turn, i.e. only update_log with a "you wait" message
+ * and turn control over to the enemy.
+ */
+extern void player_wait(struct World * world);
+
+
+
+/* Check if coordinate pos on (or beyond) map is accessible to map object
+ * movement.
+ */
+extern char is_passable (struct Map * map, struct yx_uint16 pos);
+
-extern char is_passable (struct Map *, struct yx_uint16);
-extern void move_monster (struct World *, struct Monster *);
-extern void move_player (struct World *, enum dir);
-extern void player_wait(struct World *);
#endif