This commit is contained in:
izac112
2020-09-13 15:05:53 +02:00
969 changed files with 169510 additions and 210533 deletions
+60 -50
View File
@@ -37,6 +37,11 @@
forceMove(destination)
return 1
var/obj/structure/ladder/ladder = locate() in start.contents
if((direction == UP ? ladder?.target_up : ladder?.target_down) && (ladder?.allowed_directions & direction))
if(src.may_climb_ladders(ladder))
return ladder.climbLadder(src, (direction == UP ? ladder.target_up : ladder.target_down))
if(!start.CanZPass(src, direction))
to_chat(src, "<span class='warning'>\The [start] is in the way.</span>")
return 0
@@ -46,54 +51,59 @@
return 0
var/area/area = get_area(src)
if(direction == UP && area.has_gravity() && !can_overcome_gravity())
var/obj/structure/lattice/lattice = locate() in destination.contents
var/obj/structure/catwalk/catwalk = locate() in destination.contents
if(lattice)
var/pull_up_time = max(5 SECONDS + (src.movement_delay() * 10), 1)
to_chat(src, "<span class='notice'>You grab \the [lattice] and start pulling yourself upward...</span>")
destination.audible_message("<span class='notice'>You hear something climbing up \the [lattice].</span>")
if(do_after(src, pull_up_time))
to_chat(src, "<span class='notice'>You pull yourself up.</span>")
else
to_chat(src, "<span class='warning'>You gave up on pulling yourself up.</span>")
return 0
else if(catwalk?.hatch_open)
var/pull_up_time = max(5 SECONDS + (src.movement_delay() * 10), 1)
to_chat(src, "<span class='notice'>You grab the edge of \the [catwalk] and start pulling yourself upward...</span>")
var/old_dest = destination
destination = get_step(destination, dir) // mob's dir
if(!destination?.Enter(src, old_dest))
to_chat(src, "<span class='notice'>There's something in the way up above in that direction, try another.</span>")
return 0
destination.audible_message("<span class='notice'>You hear something climbing up \the [catwalk].</span>")
if(do_after(src, pull_up_time))
to_chat(src, "<span class='notice'>You pull yourself up.</span>")
else
to_chat(src, "<span class='warning'>You gave up on pulling yourself up.</span>")
return 0
else if(ismob(src)) //VOREStation Edit Start. Are they a mob, and are they currently flying??
var/mob/H = src
if(H.flying)
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>")
if(area.has_gravity() && !can_overcome_gravity())
if(direction == UP)
var/obj/structure/lattice/lattice = locate() in destination.contents
var/obj/structure/catwalk/catwalk = locate() in destination.contents
if(lattice)
var/pull_up_time = max(5 SECONDS + (src.movement_delay() * 10), 1)
to_chat(src, "<span class='notice'>You grab \the [lattice] and start pulling yourself upward...</span>")
destination.audible_message("<span class='notice'>You hear something climbing up \the [lattice].</span>")
if(do_after(src, pull_up_time))
to_chat(src, "<span class='notice'>You pull yourself up.</span>")
else
to_chat(src, "<span class='warning'>You stopped flying upwards.</span>")
to_chat(src, "<span class='warning'>You gave up on pulling yourself up.</span>")
return 0
else if(catwalk?.hatch_open)
var/pull_up_time = max(5 SECONDS + (src.movement_delay() * 10), 1)
to_chat(src, "<span class='notice'>You grab the edge of \the [catwalk] and start pulling yourself upward...</span>")
var/old_dest = destination
destination = get_step(destination, dir) // mob's dir
if(!destination?.Enter(src, old_dest))
to_chat(src, "<span class='notice'>There's something in the way up above in that direction, try another.</span>")
return 0
destination.audible_message("<span class='notice'>You hear something climbing up \the [catwalk].</span>")
if(do_after(src, pull_up_time))
to_chat(src, "<span class='notice'>You pull yourself up.</span>")
else
to_chat(src, "<span class='warning'>You gave up on pulling yourself up.</span>")
return 0
else if(ismob(src)) //VOREStation Edit Start. Are they a mob, and are they currently flying??
var/mob/H = src
if(H.flying)
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
else
to_chat(src, "<span class='warning'>Gravity stops you from moving upward.</span>")
return 0 //VOREStation Edit End.
else
to_chat(src, "<span class='warning'>Gravity stops you from moving upward.</span>")
return 0 //VOREStation Edit End.
else
to_chat(src, "<span class='warning'>Gravity stops you from moving upward.</span>")
return 0
return 0
for(var/atom/A in destination)
if(!A.CanPass(src, start, 1.5, 0))
@@ -224,22 +234,22 @@
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.nutrition > 0.5)
L.adjust_nutrition(-0.5) //You use up -0.5 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 (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.
else if(L.nutrition < 300 && L.nutrition > 299.4) //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)
L.adjust_nutrition(-0.5)
return
else if(L.nutrition < 100 && L.nutrition > 89)
else if(L.nutrition < 100 && L.nutrition > 99.4)
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(L.nutrition < 2) //Should have listened to the warnings!
else if(L.nutrition < 10) //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
+16 -17
View File
@@ -52,16 +52,7 @@
to_chat(M, "<span class='notice'>You fail to reach \the [src].</span>")
return
var/direction = target_ladder == target_up ? "up" : "down"
M.visible_message("<span class='notice'>\The [M] begins climbing [direction] \the [src]!</span>",
"You begin climbing [direction] \the [src]!",
"You hear the grunting and clanging of a metal ladder being used.")
target_ladder.audible_message("<span class='notice'>You hear something coming [direction] \the [src]</span>")
if(do_after(M, climb_time, src))
climbLadder(M, target_ladder)
climbLadder(M, target_ladder)
/obj/structure/ladder/attack_ghost(var/mob/M)
var/target_ladder = getTargetLadder(M)
@@ -105,13 +96,21 @@
/mob/observer/ghost/may_climb_ladders(var/ladder)
return TRUE
/obj/structure/ladder/proc/climbLadder(var/mob/M, var/target_ladder)
var/turf/T = get_turf(target_ladder)
for(var/atom/A in T)
if(!A.CanPass(M, M.loc, 1.5, 0))
to_chat(M, "<span class='notice'>\The [A] is blocking \the [src].</span>")
return FALSE
return M.forceMove(T) //VOREStation Edit - Fixes adminspawned ladders
/obj/structure/ladder/proc/climbLadder(var/mob/M, var/obj/target_ladder)
var/direction = (target_ladder == target_up ? "up" : "down")
M.visible_message("<span class='notice'>\The [M] begins climbing [direction] \the [src]!</span>",
"You begin climbing [direction] \the [src]!",
"You hear the grunting and clanging of a metal ladder being used.")
target_ladder.audible_message("<span class='notice'>You hear something coming [direction] \the [src]</span>")
if(do_after(M, climb_time, src))
var/turf/T = get_turf(target_ladder)
for(var/atom/A in T)
if(!A.CanPass(M, M.loc, 1.5, 0))
to_chat(M, "<span class='notice'>\The [A] is blocking \the [src].</span>")
return FALSE
return M.forceMove(T) //VOREStation Edit - Fixes adminspawned ladders
/obj/structure/ladder/CanPass(obj/mover, turf/source, height, airflow)
return airflow || !density
+2 -2
View File
@@ -114,10 +114,10 @@
shadow.set_dir(new_dir)
// Transfer messages about what we are doing to upstairs
/mob/visible_message(var/message, var/self_message, var/blind_message)
/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null)
. = ..()
if(shadow)
shadow.visible_message(message, self_message, blind_message)
shadow.visible_message(message, self_message, blind_message, exclude_mobs)
/mob/zshadow/set_typing_indicator(var/state)
if(!typing_indicator)