diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index a0a3045dedb..553aaf8ab6d 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -410,6 +410,8 @@ #define HUNGER_FACTOR 0.05 //factor at which mob nutrition decreases #define ETHEREAL_CHARGE_FACTOR 0.8 //factor at which ethereal's charge decreases per second +/// How much nutrition eating clothes as moth gives and drains +#define CLOTHING_NUTRITION_GAIN 15 #define REAGENTS_METABOLISM 0.2 //How many units of reagent are consumed per second, by default. #define REAGENTS_EFFECT_MULTIPLIER (REAGENTS_METABOLISM / 0.4) // By defining the effect multiplier this way, it'll exactly adjust all effects according to how they originally were with the 0.4 metabolism diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index dadc27cf2f7..423c4d2b2fc 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -82,7 +82,7 @@ // sigh, ok, so it's not ACTUALLY infinite nutrition. this is so you can eat clothes more than...once. // bite_consumption limits how much you actually get, and the take_damage in after eat makes sure you can't abuse this. // ...maybe this was a mistake after all. - food_reagents = list(/datum/reagent/consumable/nutriment = INFINITY) + food_reagents = list(/datum/reagent/consumable/nutriment/cloth_fibers = INFINITY) tastes = list("dust" = 1, "lint" = 1) foodtypes = CLOTH diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 390ffab8426..a1d61f082c4 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -118,7 +118,7 @@ burn_heal = 1 /datum/reagent/consumable/nutriment/vitamin/on_mob_life(mob/living/carbon/M, delta_time, times_fired) - if(M.satiety < 600) + if(M.satiety < MAX_SATIETY) M.satiety += 30 * REM * delta_time . = ..() @@ -136,6 +136,26 @@ taste_description = "rich earthy pungent" chemical_flags = REAGENT_CAN_BE_SYNTHESIZED +/datum/reagent/consumable/nutriment/cloth_fibers + name = "Cloth Fibers" + description = "It's not actually a form of nutriment but it does keep Mothpeople going for a short while..." + nutriment_factor = 30 * REAGENTS_METABOLISM + chemical_flags = REAGENT_CAN_BE_SYNTHESIZED + brute_heal = 0 + burn_heal = 0 + ///Amount of satiety that will be drained when the cloth_fibers is fully metabolized + var/delayed_satiety_drain = 2 * CLOTHING_NUTRITION_GAIN + +/datum/reagent/consumable/nutriment/cloth_fibers/on_mob_life(mob/living/carbon/M, delta_time, times_fired) + if(M.satiety < MAX_SATIETY) + M.adjust_nutrition(CLOTHING_NUTRITION_GAIN) + delayed_satiety_drain += CLOTHING_NUTRITION_GAIN + return ..() + +/datum/reagent/consumable/nutriment/cloth_fibers/on_mob_delete(mob/living/carbon/M) + M.adjust_nutrition(-delayed_satiety_drain) + return ..() + /datum/reagent/consumable/cooking_oil name = "Cooking Oil" description = "A variety of cooking oil derived from fat or plants. Used in food preparation and frying."