+/* Log monster (described by "dsc_monster1") bumping into "monster2". */
+static void monster_bumps_monster(struct World * world, char * dsc_monster1,
+ struct Monster * monster2);
+
+/* Decrement player HPs due to attack of monster described by "dsc_monster",
+ * kill player if his HP hit zero; log the whole action.
+ */
+static void monster_hits_player(struct World * world, char * dsc_monster);
+
+/* Decrement HP of "monster" hit by player, kill it if its HP hit zero, create a
+ * corpse and increment player's score by the amount of hitpoints the monster
+ * started with; log the whole action.
+ */
+static void player_hits_monster(struct World * world, struct Monster * monster);
+
+/* Try moving the player in direction "d" towards coordinate "target"; log
+ * success or failure of the whole action.
+ */
+static void try_player_move(struct World * world,
+ enum dir d, struct yx_uint16 target);
+
+
+
+static void monster_bumps_monster(struct World * world, char * dsc_monster1,
+ struct Monster * monster2)
+{
+ char * bump_dsc = " bumps into ";
+ struct MapObjDef * mod = get_map_obj_def(world, monster2->map_obj.type);
+ char * msg = malloc(strlen(dsc_monster1) + strlen(bump_dsc)
+ + strlen(mod->desc) + 3);
+ sprintf(msg, "\n%s%s%s.", dsc_monster1, bump_dsc, mod->desc);
+ update_log(world, msg);
+ free(msg);
+}
+
+
+
+static void monster_hits_player(struct World * world, char * dsc_monster)
+{
+ char * hit_dsc = " hits you";
+ char * msg = malloc(strlen(dsc_monster) + strlen(hit_dsc) + 3);
+ sprintf(msg, "\n%s%s.", dsc_monster, hit_dsc);
+ update_log(world, msg);
+ free(msg);
+ world->player->hitpoints--;
+ if (0 == world->player->hitpoints)
+ {
+ update_log(world, "\nYou are dead.");
+ }
+}
+
+
+
+static void player_hits_monster(struct World * world, struct Monster * monster)