Merge nutrition refactor for vorestation

This commit is contained in:
Aronai Sieyes
2020-04-29 18:34:22 -04:00
parent f1cabd6742
commit 893130bdff
32 changed files with 98 additions and 469 deletions
@@ -38,11 +38,12 @@
/obj/item/weapon/implant/reagent_generator/process()
var/before_gen
if(imp_in && generated_reagents)
if(isliving(imp_in) && generated_reagents)
before_gen = reagents.total_volume
var/mob/living/L = imp_in
if(reagents.total_volume < reagents.maximum_volume)
if(imp_in.nutrition >= gen_cost)
do_generation()
if(L.nutrition >= gen_cost)
do_generation(L)
else
return
else
@@ -55,8 +56,8 @@
else if(reagents.total_volume == reagents.maximum_volume && before_gen < reagents.maximum_volume)
to_chat(imp_in, "<span class='warning'>[pick(full_message)]</span>")
/obj/item/weapon/implant/reagent_generator/proc/do_generation()
imp_in.nutrition -= gen_cost
/obj/item/weapon/implant/reagent_generator/proc/do_generation(var/mob/living/L)
L.adjust_nutrition(-gen_cost)
for(var/reagent in generated_reagents)
reagents.add_reagent(reagent, generated_reagents[reagent])
@@ -269,7 +269,7 @@
/obj/item/weapon/cell/standin/give(var/amount)
. = ..(amount * NUTRITION_COEFF) //Shrink amount to store
hume.nutrition += . //Add the amount we really stored
hume.adjust_nutrition(.) //Add the amount we really stored
. /= NUTRITION_COEFF //Inflate amount to take from the giver
#undef NUTRITION_COEFF
+1 -1
View File
@@ -57,7 +57,7 @@
flick("[icon_state]_[weight]", src)
if(do_after(user, 20 + (weight * 10)))
playsound(src.loc, 'sound/effects/weightdrop.ogg', 25, 1)
user.nutrition -= weight * 10
user.adjust_nutrition(weight * -10)
to_chat(user, "<span class='notice'>You lift the weights [qualifiers[weight]].</span>")
being_used = 0
else