X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fmap_object_actions.h;h=3041c9c2fc0c4089d40feb4fac3f71931fce2889;hb=2c2521789dc5c8bb77eb36362d4244606f878420;hp=2edc172e7a73d1cd96f99b861b957bb5785ed988;hpb=f2a7bc28be634fde4dfe4bde4c83395cab9efa91;p=plomrogue
diff --git a/src/map_object_actions.h b/src/map_object_actions.h
index 2edc172..3041c9c 100644
--- a/src/map_object_actions.h
+++ b/src/map_object_actions.h
@@ -11,24 +11,25 @@
#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.
+/* Try to move "actor" one step in direction "d" and handle the consequences:
+ * either the move succeeds, or another actor is encountered and hit (which leads
+ * to its lifepoint decreasing by one and potentially its death), or the target
+ * square is not passable and the move fails.
*/
-extern void move_monster(struct World * world, struct Monster * monster);
+extern uint8_t move_actor(struct World * world, struct MapObj * actor,
+ enum dir d);
-/* Try to move player in direction "d". On contact with monster, fight / reduce
- * monster's hitpoints, and thereby potentially trigger the monster's death.
- * Update the log on whatever the player did and turn control over to the enemy.
+/* Wrapper for using move_actor() on the MapObj representing the player; updates
+ * the game log with appropriate messages on the move attempt and its results;
+ * turns over to turn_over() when finished.
*/
-extern void move_player (struct World * world, enum dir d);
+extern void move_player(struct World * world, enum dir d);
@@ -42,7 +43,7 @@ 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 * map, struct yx_uint16 pos);