{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/38268650","id":38268650,"diff_hunk":"@@ -10050,74 +10041,47 @@ void player::consume_effects(item *eaten, const it_comest *comest, bool rotten)\n         // No good can come of this.\n         return;\n     }\n-    if ( !(has_trait(\"GIZZARD\")) && (rotten) && !(has_trait(\"SAPROPHAGE\")) ) {\n-        hunger -= rng(0, nutrition_for(comest));\n-        thirst -= comest->quench;\n+    float factor = 1.0;\n+    float hunger_factor = 1.0;\n+    bool unhealthy_allowed = true;\n+\n+    if (has_trait(\"GIZZARD\")) {\n+        factor *= .6;\n+    }\n+    if (has_trait(\"CARNIVORE\")) {\n+        // At least partially edible\n+        if(eaten->made_of(\"flesh\") || eaten->made_of(\"hflesh\") || eaten->made_of(\"iflesh\") ||\n+              eaten->made_of(\"milk\") || eaten->made_of(\"egg\")) {\n+            // Other things are in it, we only get partial benefits\n+            if ((eaten->made_of(\"veggy\") || eaten->made_of(\"fruit\") || eaten->made_of(\"wheat\"))) {\n+                factor *= .5;\n+            } else {\n+                // Carnivores don't get unhealthy off pure meat diets\n+                unhealthy_allowed = false;\n+            }\n+        }\n+    }\n+    // Saprophages get full nutrition from rotting food\n+    if (rotten && !has_trait(\"SAPROPHAGE\")) {\n+        // everyone else only gets a portion of the nutrition\n+        hunger_factor *= rng_float(0, 1);\n+        // and takes a health penalty if they aren't adapted\n         if (!has_trait(\"SAPROVORE\") && !has_bionic(\"bio_digestion\")) {\n             mod_healthy_mod(-30);\n         }\n-    } else if (has_trait(\"GIZZARD\")) {\n-        // Carrion-eating Birds might have Saprovore; Saprophage is unlikely,\n-        // but best to code defensively.\n-        // Thanks for the warning, i2amroy.\n-        if ((rotten) && !(has_trait(\"SAPROPHAGE\")) ) {\n-            int nut = (rng(0, nutrition_for(comest)) * 0.66 );\n-            int que = (comest->quench) * 0.66;\n-            hunger -= nut;\n-            thirst -= que;\n-            stomach_food += nut;\n-            stomach_water += que;\n-            if (!has_trait(\"SAPROVORE\") && !has_bionic(\"bio_digestion\")) {\n-                mod_healthy_mod(-30);\n-            }\n-        } else {\n-        // Shorter GI tract, so less nutrients captured.\n-            int giz_nutr = (nutrition_for(comest)) * 0.66;\n-            int giz_quench = (comest->quench) * 0.66;\n-            int giz_healthy = (comest->healthy) * 0.66;\n-            hunger -= (giz_nutr);\n-            thirst -= (giz_quench);\n-            mod_healthy_mod(giz_healthy);\n-            stomach_food += (giz_nutr);\n-            stomach_water += (giz_quench);\n-        }\n-    } else if (has_trait(\"CARNIVORE\") && (eaten->made_of(\"veggy\") || eaten->made_of(\"fruit\") || eaten->made_of(\"wheat\")) &&\n-      (eaten->made_of(\"flesh\") || eaten->made_of(\"hflesh\") || eaten->made_of(\"iflesh\") || eaten->made_of(\"milk\") ||\n-      eaten->made_of(\"egg\")) ) {\n-          // Carnivore is stripping the good stuff out of that plant crap it's mixed up with.\n-          // They WILL eat the Meat Pizza.\n-          int carn_nutr = (nutrition_for(comest)) * 0.5;\n-          int carn_quench = (comest->quench) * 0.5;\n-          int carn_healthy = (comest->healthy) * 0.5;\n-          hunger -= (carn_nutr);\n-          thirst -= (carn_quench);\n-          mod_healthy_mod(carn_healthy);\n-          stomach_food += (carn_nutr);\n-          stomach_water += (carn_quench);\n-          add_msg_if_player(m_good, _(\"You eat the good parts and leave that indigestible plant stuff behind.\"));\n-    } else if (has_trait(\"CARNIVORE\") && ((eaten->made_of(\"flesh\") || eaten->made_of(\"hflesh\") ||\n-      eaten->made_of(\"iflesh\") || eaten->made_of(\"egg\"))) ) {\n-          // Carnivores, being specialized to consume meat, get more nutrients from a wholly-meat or egg meal.\n-          if (comest->healthy < 1) {\n-              int carn_healthy = (comest->healthy) + 1;\n-              mod_healthy_mod(carn_healthy);","path":"src/player.cpp","position":529,"original_position":529,"commit_id":"a0d7cff3b36518a7e55a9474ee04f90239442f4b","original_commit_id":"a0d7cff3b36518a7e55a9474ee04f90239442f4b","user":{"login":"i2amroy","id":4275617,"avatar_url":"https://avatars.githubusercontent.com/u/4275617?v=3","gravatar_id":"","url":"https://api.github.com/users/i2amroy","html_url":"https://github.com/i2amroy","followers_url":"https://api.github.com/users/i2amroy/followers","following_url":"https://api.github.com/users/i2amroy/following{/other_user}","gists_url":"https://api.github.com/users/i2amroy/gists{/gist_id}","starred_url":"https://api.github.com/users/i2amroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i2amroy/subscriptions","organizations_url":"https://api.github.com/users/i2amroy/orgs","repos_url":"https://api.github.com/users/i2amroy/repos","events_url":"https://api.github.com/users/i2amroy/events{/privacy}","received_events_url":"https://api.github.com/users/i2amroy/received_events","type":"User","site_admin":false},"body":"As best as I can tell the new code is what this was intended to be, but it was hardcoded at +1 (which is opposite the health value of raw meat, -1) instead of being set up to be a catch all without magic numbers.","created_at":"2015-08-30T05:18:36Z","updated_at":"2015-08-30T05:18:36Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13417#discussion_r38268650","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/38268650"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13417#discussion_r38268650"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417","id":43359100,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13417","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13417.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13417.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13417","number":13417,"state":"open","locked":false,"title":"Begin moving need values upwards to Character [Ready]","user":{"login":"i2amroy","id":4275617,"avatar_url":"https://avatars.githubusercontent.com/u/4275617?v=3","gravatar_id":"","url":"https://api.github.com/users/i2amroy","html_url":"https://github.com/i2amroy","followers_url":"https://api.github.com/users/i2amroy/followers","following_url":"https://api.github.com/users/i2amroy/following{/other_user}","gists_url":"https://api.github.com/users/i2amroy/gists{/gist_id}","starred_url":"https://api.github.com/users/i2amroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i2amroy/subscriptions","organizations_url":"https://api.github.com/users/i2amroy/orgs","repos_url":"https://api.github.com/users/i2amroy/repos","events_url":"https://api.github.com/users/i2amroy/events{/privacy}","received_events_url":"https://api.github.com/users/i2amroy/received_events","type":"User","site_admin":false},"body":"Moves stomach_food, stomach_water, and hunger upwards to the Character class from the player class. Also cleaned up a particularly bad example of brittle code duplication in the consume_effects() function and a small handful of unrelated errors/warnings that were in the road.","created_at":"2015-08-26T02:47:49Z","updated_at":"2015-08-30T05:18:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bde6061c34524d366f6e6f7f2d21f79cb5850f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417/comments","review_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13417/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/a0d7cff3b36518a7e55a9474ee04f90239442f4b","head":{"label":"i2amroy:Needs","ref":"Needs","sha":"a0d7cff3b36518a7e55a9474ee04f90239442f4b","user":{"login":"i2amroy","id":4275617,"avatar_url":"https://avatars.githubusercontent.com/u/4275617?v=3","gravatar_id":"","url":"https://api.github.com/users/i2amroy","html_url":"https://github.com/i2amroy","followers_url":"https://api.github.com/users/i2amroy/followers","following_url":"https://api.github.com/users/i2amroy/following{/other_user}","gists_url":"https://api.github.com/users/i2amroy/gists{/gist_id}","starred_url":"https://api.github.com/users/i2amroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i2amroy/subscriptions","organizations_url":"https://api.github.com/users/i2amroy/orgs","repos_url":"https://api.github.com/users/i2amroy/repos","events_url":"https://api.github.com/users/i2amroy/events{/privacy}","received_events_url":"https://api.github.com/users/i2amroy/received_events","type":"User","site_admin":false},"repo":{"id":9722704,"name":"Cataclysm-DDA","full_name":"i2amroy/Cataclysm-DDA","owner":{"login":"i2amroy","id":4275617,"avatar_url":"https://avatars.githubusercontent.com/u/4275617?v=3","gravatar_id":"","url":"https://api.github.com/users/i2amroy","html_url":"https://github.com/i2amroy","followers_url":"https://api.github.com/users/i2amroy/followers","following_url":"https://api.github.com/users/i2amroy/following{/other_user}","gists_url":"https://api.github.com/users/i2amroy/gists{/gist_id}","starred_url":"https://api.github.com/users/i2amroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i2amroy/subscriptions","organizations_url":"https://api.github.com/users/i2amroy/orgs","repos_url":"https://api.github.com/users/i2amroy/repos","events_url":"https://api.github.com/users/i2amroy/events{/privacy}","received_events_url":"https://api.github.com/users/i2amroy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/i2amroy/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA","forks_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/i2amroy/Cataclysm-DDA/releases{/id}","created_at":"2013-04-27T23:43:26Z","updated_at":"2015-04-28T04:32:01Z","pushed_at":"2015-08-27T23:40:53Z","git_url":"git://github.com/i2amroy/Cataclysm-DDA.git","ssh_url":"git@github.com:i2amroy/Cataclysm-DDA.git","clone_url":"https://github.com/i2amroy/Cataclysm-DDA.git","svn_url":"https://github.com/i2amroy/Cataclysm-DDA","homepage":"http://www.cataclysm.glyphgryph.com/","size":505574,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CleverRaven:master","ref":"master","sha":"5171fff1f557646ba59f84b37e55857670fe9f4d","user":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"repo":{"id":5973855,"name":"Cataclysm-DDA","full_name":"CleverRaven/Cataclysm-DDA","owner":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":false,"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","forks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/releases{/id}","created_at":"2012-09-26T22:57:43Z","updated_at":"2015-08-30T00:56:17Z","pushed_at":"2015-08-30T05:12:38Z","git_url":"git://github.com/CleverRaven/Cataclysm-DDA.git","ssh_url":"git@github.com:CleverRaven/Cataclysm-DDA.git","clone_url":"https://github.com/CleverRaven/Cataclysm-DDA.git","svn_url":"https://github.com/CleverRaven/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":802094,"stargazers_count":724,"watchers_count":724,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":763,"mirror_url":null,"open_issues_count":1060,"forks":763,"open_issues":1060,"watchers":724,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/13417"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13417"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13417/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417/comments"},"review_comment":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/13417/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/a0d7cff3b36518a7e55a9474ee04f90239442f4b"}}}}