From db94963933d6a15f5b6db7d74c11b0660ff59572 Mon Sep 17 00:00:00 2001 From: JJRcop Date: Mon, 9 Dec 2013 21:02:50 -0500 Subject: [PATCH 1/4] Adds functionality to empty a transit pod or put mobs in one Clicking on a transit station with a grab or harm intent will cause you to attempt to empty the contents of the pod onto the floor, takes 4 seconds Clicking on a transit station with a grab item in the aggressive state or above will cause you to attempt to stuff the grabbed mob into the pod, takes 6 seconds EDIT1: Caused stuffing people in pods to stun them for 5 seconds to assist transport of captured persons --- code/game/objects/structures/transit_tubes.dm | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 5e85802b1fa..f20a7cb73ca 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -121,9 +121,30 @@ obj/structure/ex_act(severity) open_animation() else if(icon_state == "open") - close_animation() + if(pod.contents.len && user.loc != pod && intent_numeric(user.a_intent) > 1) + user.visible_message("[user] starts emptying [pod]'s contents onto the floor!") + if(do_after(user, 40)) //So it doesn't default to close_animation() on fail + if(pod.loc == loc) + for(var/atom/movable/AM in pod) + AM.loc = get_turf(user) + if(ismob(AM)) + var/mob/M = AM + M.Weaken(5) + else + close_animation() +/obj/structure/transit_tube/station/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/weapon/grab) && icon_state == "open") + var/obj/item/weapon/grab/G = W + if(ismob(G.affecting) && G.state >= GRAB_AGGRESSIVE) + var/mob/GM = G.affecting + for(var/obj/structure/transit_tube_pod/pod in loc) + pod.visible_message("[user] starts putting [GM] into the [pod]!") + if(do_after(user, 60)) + GM.Weaken(5) + src.Bumped(GM) + del(G) /obj/structure/transit_tube/station/proc/open_animation() if(icon_state == "closed") @@ -146,7 +167,7 @@ obj/structure/ex_act(severity) /obj/structure/transit_tube/station/proc/launch_pod() for(var/obj/structure/transit_tube_pod/pod in loc) if(!pod.moving && pod.dir in directions()) - spawn(5) + spawn(35) //To prevent saxing in the pod, should probably change these to sleep if it doesn't break the tubes pod_moving = 1 close_animation() sleep(CLOSE_DURATION + 2) @@ -422,7 +443,6 @@ obj/structure/ex_act(severity) return - // Parse the icon_state into a list of directions. // This means that mappers can use Dream Maker's built in // "Generate Instances from Icon-states" option to get all From c80efcc0f0bba09ce6f38512459f49dee7439ea8 Mon Sep 17 00:00:00 2001 From: JJRcop Date: Wed, 11 Dec 2013 10:50:03 -0500 Subject: [PATCH 2/4] Adds breaks to some loops in case there is more than one pod. Shouldn't happen, but Murphy's law. --- code/game/objects/structures/transit_tubes.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index f20a7cb73ca..22f20194900 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -130,8 +130,10 @@ obj/structure/ex_act(severity) if(ismob(AM)) var/mob/M = AM M.Weaken(5) + else close_animation() + break /obj/structure/transit_tube/station/attackby(obj/item/W, mob/user) @@ -145,6 +147,7 @@ obj/structure/ex_act(severity) GM.Weaken(5) src.Bumped(GM) del(G) + break /obj/structure/transit_tube/station/proc/open_animation() if(icon_state == "closed") From d2eee6572e045cfe39e8cfc42dfb5493d7ab5b53 Mon Sep 17 00:00:00 2001 From: JJRcop Date: Fri, 13 Dec 2013 21:18:09 -0500 Subject: [PATCH 3/4] Adds and removes some checks in transit tubes Adds some safety checks when stuffing people in transit tubes Removes intent check when yanking people out of tubes because it complicates things --- code/game/objects/structures/transit_tubes.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 22f20194900..206b03e8e53 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -121,7 +121,7 @@ obj/structure/ex_act(severity) open_animation() else if(icon_state == "open") - if(pod.contents.len && user.loc != pod && intent_numeric(user.a_intent) > 1) + if(pod.contents.len && user.loc != pod) user.visible_message("[user] starts emptying [pod]'s contents onto the floor!") if(do_after(user, 40)) //So it doesn't default to close_animation() on fail if(pod.loc == loc) @@ -143,7 +143,7 @@ obj/structure/ex_act(severity) var/mob/GM = G.affecting for(var/obj/structure/transit_tube_pod/pod in loc) pod.visible_message("[user] starts putting [GM] into the [pod]!") - if(do_after(user, 60)) + if(do_after(user, 60) && GM && G && G.affecting == GM) GM.Weaken(5) src.Bumped(GM) del(G) From a3a1aa952d5ff3bf85eecac5cf4608474174c8b4 Mon Sep 17 00:00:00 2001 From: JJRcop Date: Sat, 14 Dec 2013 18:23:15 -0500 Subject: [PATCH 4/4] New way to prevent saxxing in transit tubes to run from the law --- code/game/objects/structures/transit_tubes.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 206b03e8e53..41bde491118 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -30,6 +30,8 @@ enter_delay = 3 var/pod_moving = 0 var/automatic_launch_time = 100 + var/cooldown_delay = 30 + var/launch_cooldown = 0 var/const/OPEN_DURATION = 6 var/const/CLOSE_DURATION = 6 @@ -170,11 +172,11 @@ obj/structure/ex_act(severity) /obj/structure/transit_tube/station/proc/launch_pod() for(var/obj/structure/transit_tube_pod/pod in loc) if(!pod.moving && pod.dir in directions()) - spawn(35) //To prevent saxing in the pod, should probably change these to sleep if it doesn't break the tubes + spawn(5) pod_moving = 1 close_animation() sleep(CLOSE_DURATION + 2) - if(icon_state == "closed" && pod) + if(icon_state == "closed" && pod && launch_cooldown < world.time) pod.follow_tube() pod_moving = 0 @@ -203,6 +205,7 @@ obj/structure/ex_act(severity) /obj/structure/transit_tube/station/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir) pod_moving = 1 spawn(5) + launch_cooldown = world.time + min(cooldown_delay, automatic_launch_time) open_animation() sleep(OPEN_DURATION + 2) pod_moving = 0