Fixes #2803
Fixes #2553
Fixes #2597 (Couldn't find a cleaner way to make this work, unfortunately. Not all procs-as-verbs can be used as procs.)
Fixes #2498
Fixes #2912
This commit is contained in:
skull132
2017-07-04 00:52:42 +03:00
committed by GitHub
parent 85d0e3c1c5
commit 405366d15f
10 changed files with 155 additions and 75 deletions
+16 -1
View File
@@ -43,7 +43,9 @@
/obj/structure/ladder/attackby(obj/item/C as obj, mob/user as mob)
attack_hand(user)
return
/obj/structure/ladder/attack_robot(mob/user)
attack_hand(user)
/obj/structure/ladder/attack_hand(var/mob/M)
if(!M.may_climb_ladders(src))
@@ -102,6 +104,19 @@
return FALSE
return TRUE
/mob/living/silicon/may_climb_ladders(ladder)
to_chat(src, "<span class='warning'>You're too heavy to climb [ladder]!</span>")
return FALSE
/mob/living/silicon/robot/drone/may_climb_ladders(ladder)
if(!Adjacent(ladder))
to_chat(src, "<span class='warning'>You need to be next to \the [ladder] to start climbing.</span>")
return FALSE
if(incapacitated())
to_chat(src, "<span class='warning'>You are physically unable to climb \the [ladder].</span>")
return FALSE
return TRUE
/mob/observer/ghost/may_climb_ladders(var/ladder)
return TRUE
+59 -6
View File
@@ -54,10 +54,32 @@
if (mover.Check_Shoegrip(FALSE) && mover.can_fall(below, src))
to_chat(mover, span("notice",
"You are stopped from falling off the edge by \the [mover.shoes] you're wearing!"))
return 0
return FALSE
return ..()
// Add a falling atom by default. Even if it's not an atom that can actually fall.
// SSfalling will check this on its own and remove if necessary. This is saner, as it
// centralizes control to SSfalling.
/turf/simulated/open/Entered(atom/movable/mover)
..()
ADD_FALLING_ATOM(mover)
update_icon()
// Override to deny a climber exit if they're set to adhere to CLIMBER_NO_EXIT
/turf/simulated/open/Exit(atom/movable/mover, atom/newloc)
var/flags = remove_climber(mover)
if (flags & CLIMBER_NO_EXIT)
ADD_FALLING_ATOM(mover)
return FALSE
return ..()
// Remove from climbers just in case.
/turf/simulated/open/Exited(atom/movable/mover, atom/newloc)
LAZYREMOVE(climbers, mover)
/turf/simulated/open/Destroy()
SSopenturf.openspace_turfs -= src
SSopenturf.queued_turfs -= src
@@ -95,6 +117,42 @@
return FALSE
/**
* Used to add a climber to the climbers list. Climbers do not fall down this specific tile.
*
* @param climber The atom to be added as a climber.
* @param flags Bitflags to control the status of the climber. Should always be non-0!
*
* @return TRUE if a climber was successfully added. FALSE if the climber is already
* present or an error occured.
*/
/turf/simulated/open/proc/add_climber(atom/climber, flags = CLIMBER_DEFAULT)
if (!flags)
PROCLOG_WEIRD("Attempted to add climber [climber] without flags.")
return FALSE
if (LAZYACCESS(climbers, climber))
return FALSE
LAZYINITLIST(climbers)
climbers[climber] = flags
return TRUE
/**
* Used to remove a climber from the climbers list. Returns the flags the climber
* was assigned.
*
* @param climber The atom to be removed from climbers.
*
* @return The flags assigned to the climber if it was present in the list. 0 otherwise.
*/
/turf/simulated/open/proc/remove_climber(atom/climber)
. = 0
if (LAZYACCESS(climbers, climber))
. = climbers[climber]
LAZYREMOVE(climbers, climber)
/turf/simulated/open/airless
oxygen = 0
nitrogen = 0
@@ -127,11 +185,6 @@
/turf/simulated/open/update_dirt()
return 0
/turf/simulated/open/Entered(atom/movable/mover)
..()
ADD_FALLING_ATOM(mover)
update_icon()
// override to make sure nothing is hidden
/turf/simulated/open/levelupdate()
for(var/obj/O in src)