From 901fbf0249099a76df9872886ba8f868e2808f25 Mon Sep 17 00:00:00 2001 From: Lohikar Date: Wed, 16 Aug 2017 14:18:14 -0500 Subject: [PATCH] Fix devour nutrient calculations (#3300) changes: Devour no longer gives unathi ridiculous amounts of protein. Xenomorph devour actually works now I swear --- code/modules/mob/living/carbon/human/human.dm | 2 -- code/modules/mob/living/carbon/human/species/species.dm | 2 ++ .../mob/living/carbon/human/species/xenomorphs/alien_species.dm | 1 + code/modules/mob/living/devour.dm | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f31f5ac0b1e..0b75ce64771 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -11,8 +11,6 @@ mob_size = 9//Based on average weight of a human /mob/living/carbon/human/Initialize(mapload, var/new_species = null) - eat_types |= TYPE_ORGANIC//Any mobs that are given the devour verb, can eat nonhumanoid organics. Only applies to unathi for now - if(!dna) dna = new /datum/dna(null) // Species name is handled by set_species() diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 308ce367572..852c614ee31 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -145,6 +145,7 @@ var/gluttonous // Can eat some mobs. Boolean. var/mouth_size // How big the mob's mouth is. Limits how large a mob this species can swallow. Only relevant if gluttonous is TRUE. + var/allowed_eat_types = TYPE_ORGANIC var/max_nutrition_factor = 1 //Multiplier on maximum nutrition var/nutrition_loss_factor = 1 //Multiplier on passive nutrition losses @@ -329,6 +330,7 @@ H.pass_flags = pass_flags H.mob_size = mob_size H.mouth_size = mouth_size || 2 + H.eat_types = allowed_eat_types if(!kpg) if(islesserform(H)) H.dna.SetSEState(MONKEYBLOCK,1) diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm index eae12a82068..dfbc29f73c4 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm @@ -13,6 +13,7 @@ siemens_coefficient = 0 gluttonous = TRUE mouth_size = 15 // Should be larger than any human-type. + allowed_eat_types = TYPE_ORGANIC | TYPE_SYNTHETIC | TYPE_HUMANOID mob_size = 14 fall_mod = 0 diff --git a/code/modules/mob/living/devour.dm b/code/modules/mob/living/devour.dm index b8dffeb0bba..06ba843a34a 100644 --- a/code/modules/mob/living/devour.dm +++ b/code/modules/mob/living/devour.dm @@ -181,7 +181,7 @@ M.adjustBruteLoss(round(dmg_factor * 0.33, 0.1) || 0.1) M.adjustFireLoss(round(dmg_factor * 0.66, 0.1) || 0.1) - ingested.add_reagent(M.composition_reagent, M.composition_reagent_quantity * 1/dmg_factor) + ingested.add_reagent(M.composition_reagent, M.composition_reagent_quantity * dmg_factor) if (M.stat == DEAD && !stomach_contents[M]) // If the mob has died, poke the consuming mob about it. src << "Your stomach feels a little more relaxed as \the [M] finally stops fighting."