home · contact · privacy
More consistent code styling whitespace rules.
[plomrogue] / src / map_object_actions.h
index ae764b9f1ea746d97fd1c555f9eb003f977e3cf3..8e0af47a928ba30e2097ad117c3d292132d4c116 100644 (file)
@@ -6,45 +6,40 @@
 #ifndef MAP_OBJECT_ACTIONS_H
 #define MAP_OBJECT_ACTIONS_H
 
-
-
 #include "yx_uint16.h" /* for yx_uint16 coordinates */
-struct World;
 struct Map;
 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" (where east is 'E', north 'N'
+ * etc.) 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, the move fails.
  */
-extern void move_monster(struct World * world, struct MapObj * monster);
-
+extern uint8_t move_actor(struct MapObj * actor, char 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,
- * 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.
+/* 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(char 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);
-
-
+extern void player_wait();
 
 /* 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);
+
+/* Make player drop to ground map ojbect indexed by world.inventory_select. */
+extern void player_drop();
+
+/* Make player pick up map object from ground. */
+extern void player_pick();