Merge pull request #7516 from VOREStation/upstream-merge-7045

[MIRROR] Removes limits on eating, centralizes nutrition changing.
This commit is contained in:
Aronai Sieyes
2020-04-29 19:23:55 -04:00
committed by GitHub
62 changed files with 200 additions and 218 deletions

View File

@@ -205,38 +205,33 @@
if(throwing)
return
if(ismob(src))
var/mob/H = src //VOREStation Edit Start. Flight on mobs.
if(H.flying) //Some other checks are done in the wings_toggle proc
if(H.nutrition > 2)
H.nutrition -= 2 //You use up 2 nutrition per TILE and tick of flying above open spaces. If people wanna flap their wings in the hallways, shouldn't penalize them for it.
if(H.incapacitated(INCAPACITATION_ALL))
H.stop_flying()
//VOREStation Edit Start. Flight on mobs.
if(isliving(src))
var/mob/living/L = src //VOREStation Edit Start. Flight on mobs.
if(L.flying) //Some other checks are done in the wings_toggle proc
if(L.nutrition > 2)
L.adjust_nutrition(-2) //You use up 2 nutrition per TILE and tick of flying above open spaces. If people wanna flap their wings in the hallways, shouldn't penalize them for it.
if(L.incapacitated(INCAPACITATION_ALL))
L.stop_flying()
//Just here to see if the person is KO'd, stunned, etc. If so, it'll move onto can_fall.
else if (H.nutrition > 1000) //Eat too much while flying? Get fat and fall.
to_chat(H, "<span class='danger'>You're too heavy! Your wings give out and you plummit to the ground!</span>")
H.stop_flying() //womp womp.
else if(H.nutrition < 300 && H.nutrition > 289) //290 would be risky, as metabolism could mess it up. Let's do 289.
to_chat(H, "<span class='danger'>You are starting to get fatigued... You probably have a good minute left in the air, if that. Even less if you continue to fly around! You should get to the ground soon!</span>") //Ticks are, on average, 3 seconds. So this would most likely be 90 seconds, but lets just say 60.
H.nutrition -= 10
else if (L.nutrition > 1000) //Eat too much while flying? Get fat and fall.
to_chat(L, "<span class='danger'>You're too heavy! Your wings give out and you plummit to the ground!</span>")
L.stop_flying() //womp womp.
else if(L.nutrition < 300 && L.nutrition > 289) //290 would be risky, as metabolism could mess it up. Let's do 289.
to_chat(L, "<span class='danger'>You are starting to get fatigued... You probably have a good minute left in the air, if that. Even less if you continue to fly around! You should get to the ground soon!</span>") //Ticks are, on average, 3 seconds. So this would most likely be 90 seconds, but lets just say 60.
L.adjust_nutrition(-10)
return
else if(H.nutrition < 100 && H.nutrition > 89)
to_chat(H, "<span class='danger'>You're seriously fatigued! You need to get to the ground immediately and eat before you fall!</span>")
else if(L.nutrition < 100 && L.nutrition > 89)
to_chat(L, "<span class='danger'>You're seriously fatigued! You need to get to the ground immediately and eat before you fall!</span>")
return
else if(H.nutrition < 2) //Should have listened to the warnings!
to_chat(H, "<span class='danger'>You lack the strength to keep yourself up in the air...</span>")
H.stop_flying()
else if(L.nutrition < 2) //Should have listened to the warnings!
to_chat(L, "<span class='danger'>You lack the strength to keep yourself up in the air...</span>")
L.stop_flying()
else
return
else if(ishuman(H)) //Needed to prevent 2 people from grabbing eachother in the air.
var/mob/living/carbon/human/F = H
if(F.grabbed_by.len) //If you're grabbed (presumably by someone flying) let's not have you fall. This also allows people to grab onto you while you jump over a railing to prevent you from falling!
var/obj/item/weapon/grab/G = F.get_active_hand()
var/obj/item/weapon/grab/J = F.get_inactive_hand()
if(istype(G) || istype(J))
//fall
else
return
if(LAZYLEN(L.grabbed_by)) //If you're grabbed (presumably by someone flying) let's not have you fall. This also allows people to grab onto you while you jump over a railing to prevent you from falling!
return
//VOREStation Edit End
if(can_fall())
// We spawn here to let the current move operation complete before we start falling. fall() is normally called from