X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fmap_object_actions.c;h=c0d43e76ba5501d2ee87486d8e2eb40c8d474db1;hb=caf7e50574dc4fb3756a386257863e5b8b42ad98;hp=53253bca1f096cdcb9bd95642d759ddc533034fe;hpb=e9282787cecf5439513dbfaedeac235cdc841e91;p=plomrogue diff --git a/src/map_object_actions.c b/src/map_object_actions.c index 53253bc..c0d43e7 100644 --- 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); -/* 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); @@ -101,6 +102,8 @@ static void player_hits_monster(struct World * world, struct Monster * monster) m_prev->map_obj.next = monster->map_obj.next; } } + uint8_t score = md->hitpoints_start; + world->score = world->score + score; free(monster); } }