nutrition adjustment wrapper procs.

This commit is contained in:
Ghommie
2020-05-10 21:41:50 +02:00
parent 602154abe8
commit 667c12d413
40 changed files with 94 additions and 95 deletions

View File

@@ -35,7 +35,7 @@
continue
var/datum/atom_hud/alternate_appearance/AA = v
AA.onNewMob(src)
nutrition = rand(NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_START_MAX)
set_nutrition(rand(NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_START_MAX))
. = ..()
update_config_movespeed()
update_movespeed(TRUE)
@@ -1023,6 +1023,14 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
var/datum/language_holder/H = get_language_holder()
H.open_language_menu(usr)
///Adjust the nutrition of a mob
/mob/proc/adjust_nutrition(change, max = INFINITY) //Honestly FUCK the oldcoders for putting nutrition on /mob someone else can move it up because holy hell I'd have to fix SO many typechecks
nutrition = clamp(0, nutrition + change, max)
///Force set the mob nutrition
/mob/proc/set_nutrition(var/change) //Seriously fuck you oldcoders.
nutrition = max(0, change)
/mob/setMovetype(newval)
. = ..()
update_movespeed(FALSE)