char * dsc_hitpoints = "\nHitpoints: ";
char * dsc_score = "\nScore: ";
uint16_t maxl = strlen(dsc_turn) + strlen(dsc_hitpoints) + strlen(dsc_score)
- + 10 + 5 + 10; /* max strlens of numbers to be used */
+ + 10 + 5 + 10; /* max strlens of numbers to be used */
char * text = malloc(maxl + 1);
sprintf(text, "%s%d%s%d%s%d",
dsc_turn, world->turn,
*/
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; log the
- * whole action.
+/* 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 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.
+ * 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);