Stops runtimes

This commit is contained in:
killer653
2017-11-01 17:46:35 -04:00
parent cd423e7d07
commit 529b55798e

View File

@@ -49,21 +49,22 @@
else
to_chat(src, "<span class='warning'>You gave up on pulling yourself up.</span>")
return 0
var/mob/H = src //VOREStation Edit Start. Are they human (H above.), have a wing style, and do they have the trait?
if(H.flying == 1)
if(H.incapacitated(INCAPACITATION_ALL))
to_chat(src, "<span class='notice'>You can't fly in your current state.</span>")
H.stop_flying() //Should already be done, but just in case.
return 0
var/fly_time = max(7 SECONDS + (H.movement_delay() * 10), 1) //So it's not too useful for combat.
to_chat(src, "<span class='notice'>You begin to fly upwards...</span>")
destination.audible_message("<span class='notice'>You hear the flapping of wings.</span>")
H.audible_message("<span class='notice'>[H] begins to flap \his wings, preparing to move upwards!.</span>")
if(do_after(H, fly_time) && H.flying)
to_chat(src, "<span class='notice'>You fly upwards.</span>")
else
to_chat(src, "<span class='warning'>You stopped flying upwards.</span>")
return 0 //VOREStation Edit End.
else if(ismob(src)) //VOREStation Edit Start. Are they a mob, and are they currently flying??
var/mob/H = src
if(H.flying == 1)
if(H.incapacitated(INCAPACITATION_ALL))
to_chat(src, "<span class='notice'>You can't fly in your current state.</span>")
H.stop_flying() //Should already be done, but just in case.
return 0
var/fly_time = max(7 SECONDS + (H.movement_delay() * 10), 1) //So it's not too useful for combat. Could make this variable somehow, but that's down the road.
to_chat(src, "<span class='notice'>You begin to fly upwards...</span>")
destination.audible_message("<span class='notice'>You hear the flapping of wings.</span>")
H.audible_message("<span class='notice'>[H] begins to flap \his wings, preparing to move upwards!.</span>")
if(do_after(H, fly_time) && H.flying)
to_chat(src, "<span class='notice'>You fly upwards.</span>")
else
to_chat(src, "<span class='warning'>You stopped flying upwards.</span>")
return 0 //VOREStation Edit End.
else
to_chat(src, "<span class='warning'>Gravity stops you from moving upward.</span>")
return 0
@@ -158,30 +159,31 @@
if(throwing)
return
var/mob/H = src //VOREStation Edit Start. Flight on mobs.
if(H.flying == 1) //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()
//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
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>")
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
return
if(H.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!
return //VOREStation Edit End.
if(ismob(src))
var/mob/H = src //VOREStation Edit Start. Flight on mobs.
if(H.flying == 1) //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()
//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
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>")
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
return
if(H.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!
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