diff --git a/src/character.h b/src/character.h index dd654ebc827b9..94ccb7b1cb277 100644 --- a/src/character.h +++ b/src/character.h @@ -148,6 +148,8 @@ enum edible_rating { ALLERGY_WEAK, // Cannibalism (unless psycho/cannibal) CANNIBALISM, + // This has parasites + PARASITES, // Rotten or not rotten enough (for saprophages) ROTTEN, // Can provoke vomiting if you already feel nauseous. diff --git a/src/consumption.cpp b/src/consumption.cpp index 5ea096ca72815..18c6c23c22ebb 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -757,6 +757,11 @@ ret_val Character::will_eat( const item &food, bool interactive ) add_consequence( _( "The thought of eating human flesh makes you feel sick." ), CANNIBALISM ); } + if( food.get_comestible()->parasites > 0 && !food.has_flag( flag_NO_PARASITES ) && + !( has_bionic( bio_digestion ) || has_trait( trait_PARAIMMUNE ) ) ) { + add_consequence( _( "Eating this raw meat probably isn't very healthy." ), PARASITES ); + } + const bool edible = comest->comesttype == comesttype_FOOD || food.has_flag( flag_USE_EAT_VERB ); if( edible && has_effect( effect_nausea ) ) { diff --git a/src/item.cpp b/src/item.cpp index e6f6735ebde26..6a93495fab37b 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -3895,6 +3895,7 @@ nc_color item::color_in_inventory() const case ALLERGY: case ALLERGY_WEAK: case CANNIBALISM: + case PARASITES: ret = c_red; break; case ROTTEN: diff --git a/tests/char_edible_rating_test.cpp b/tests/char_edible_rating_test.cpp index 14bead0acb59c..7ccc5b2776d1f 100644 --- a/tests/char_edible_rating_test.cpp +++ b/tests/char_edible_rating_test.cpp @@ -477,12 +477,12 @@ TEST_CASE( "who will eat rotten food", "[will_eat][edible_rating][rotten]" ) } } -TEST_CASE( "who will eat human flesh", "[will_eat][edible_rating][cannibal]" ) +TEST_CASE( "who will eat cooked human flesh", "[will_eat][edible_rating][cannibal]" ) { avatar dummy; - GIVEN( "some human flesh" ) { - item flesh( "human_flesh" ); + GIVEN( "some cooked human flesh" ) { + item flesh( "human_cooked" ); REQUIRE( flesh.has_flag( "CANNIBALISM" ) ); WHEN( "character is not a cannibal" ) {