From e5a64253217db49081b8e64a517d1685bb54b86f Mon Sep 17 00:00:00 2001 From: Haha26315 Date: Wed, 7 Sep 2022 18:16:45 -0400 Subject: [PATCH] Overboard; Railings Update Allows players to circumvent railings by use of wings, jump boots, or being thrown by other players or by disposals systems, etc. Throwing, be it items or players, has the same chance of failure as throwing something into a disposals bin of 25%. --- hyperstation/code/game/objects/railings.dm | 32 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/hyperstation/code/game/objects/railings.dm b/hyperstation/code/game/objects/railings.dm index 8140ad908..154829b5c 100644 --- a/hyperstation/code/game/objects/railings.dm +++ b/hyperstation/code/game/objects/railings.dm @@ -47,16 +47,42 @@ /obj/structure/railing/CanPass(atom/movable/mover, turf/target) if(istype(mover) && (mover.pass_flags & PASSGLASS) || is_type_in_typecache(mover, freepass)) return 1 + + if(get_dir(loc, target) != dir) + return 1 + + if(mover.throwing && !mover.floating) + if(prob(75)) + visible_message("[mover] sails over the [src].") + return 1 //Flies right over the railing + + else + visible_message("[mover] bounces off of the [src]'s rods!") + return 0 //Bounces off railing's bulk + + if(ismob(mover)) + var/mob/M = mover + if(M.is_flying()) + visible_message("[mover] soars over the [src].") + return 1 + + if(mover.floating) + visible_message("[mover] floats over the [src].") + return 1 + if(get_dir(loc, target) == dir) return 0 - return 1 /obj/structure/railing/CheckExit(atom/movable/O, turf/target) - if(istype(O) && (O.pass_flags & PASSGLASS) || is_type_in_typecache(O, freepass)) + + if(istype(O) && ((O.pass_flags & PASSGLASS) || is_type_in_typecache(O, freepass)) || CanPass(O, target) == 1) return 1 + + if(get_dir(O.loc, target) != dir) + return 1 + if(get_dir(O.loc, target) == dir) return 0 - return 1 /obj/structure/railing/Initialize() . = ..()