home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplified meta_keys() interface by managing all windows stuff below World struct.
[plomrogue]
/
src
/
map_object_actions.c
diff --git
a/src/map_object_actions.c
b/src/map_object_actions.c
index 53253bca1f096cdcb9bd95642d759ddc533034fe..c0d43e76ba5501d2ee87486d8e2eb40c8d474db1 100644
(file)
--- a/
src/map_object_actions.c
+++ b/
src/map_object_actions.c
@@
-21,8
+21,9
@@
static void monster_bumps_monster(struct World * world, char * dsc_monster1,
*/
static void monster_hits_player(struct World * world, char * dsc_monster);
*/
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);
*/
static void player_hits_monster(struct World * world, struct Monster * monster);
@@
-101,6
+102,8
@@
static void player_hits_monster(struct World * world, struct Monster * monster)
m_prev->map_obj.next = monster->map_obj.next;
}
}
m_prev->map_obj.next = monster->map_obj.next;
}
}
+ uint8_t score = md->hitpoints_start;
+ world->score = world->score + score;
free(monster);
}
}
free(monster);
}
}