Merge pull request #5239 from tkdrg/sanictoobs

Makes transit tubes a lot faster
This commit is contained in:
Swag McYolosteinen
2014-10-18 09:54:48 +02:00
3 changed files with 26 additions and 11 deletions
@@ -6,12 +6,11 @@
name = "station tube station"
icon = 'icons/obj/pipes/transit_tube_station.dmi'
icon_state = "closed"
exit_delay = 2
enter_delay = 3
exit_delay = 1
enter_delay = 2
tube_construction = /obj/structure/c_transit_tube/station
var/pod_moving = 0
var/automatic_launch_time = 100
var/cooldown_delay = 200
var/cooldown_delay = 50
var/launch_cooldown = 0
var/reverse_launch = 0
@@ -67,7 +66,7 @@
else if(icon_state == "open")
if(pod.contents.len && user.loc != pod)
user.visible_message("<span class='warning'>[user] starts emptying [pod]'s contents onto the floor!</span>")
if(do_after(user, 40)) //So it doesn't default to close_animation() on fail
if(do_after(user, 10)) //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)
@@ -87,7 +86,7 @@
var/mob/GM = G.affecting
for(var/obj/structure/transit_tube_pod/pod in loc)
pod.visible_message("<span class='warning'>[user] starts putting [GM] into the [pod]!</span>")
if(do_after(user, 60) && GM && G && G.affecting == GM)
if(do_after(user, 15) && GM && G && G.affecting == GM)
GM.Weaken(5)
src.Bumped(GM)
qdel(G)
@@ -10,8 +10,8 @@
anchored = 1.0
var/tube_construction = /obj/structure/c_transit_tube
var/list/tube_dirs = null
var/exit_delay = 2
var/enter_delay = 1
var/exit_delay = 1
var/enter_delay = 0
// alldirs in global.dm is the same list of directions, but since
// the specific order matters to get a usable icon_state, it is
@@ -51,7 +51,7 @@ obj/structure/transit_tube/ex_act(severity)
/obj/structure/transit_tube/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(copytext(icon_state, 1, 3) != "D-") //decorative diagonals cannot be unwrenched directly
for(var/obj/structure/transit_tube_pod/pod in loc)
for(var/obj/structure/transit_tube_pod/pod in src.loc)
user << "<span class='notice'>Remove the pod first.</span>"
return
user.visible_message("<span class='warning'>[user] starts to deattach the [src]!</span>", "<span class='notice'>You start deattaching the [name]...</span>")
@@ -64,6 +64,9 @@ obj/structure/transit_tube/ex_act(severity)
R.add_fingerprint(user)
src.destroy_diagonals()
qdel(src)
if(istype(W, /obj/item/weapon/crowbar))
for(var/obj/structure/transit_tube_pod/pod in src.loc)
pod.attackby(W, user)
//destroys disconnected decorative diagonals
/obj/structure/transit_tube/proc/destroy_diagonals()
@@ -32,8 +32,7 @@
return
if(src.contents.len)
user.visible_message("<span class='notice'>[user] empties the [src].</span>", "<span class='notice'>You empty the [src].</span>")
for(var/atom/movable/M in src.contents)
M.loc = src.loc
src.empty()
return
else
user << "<span class='notice'>You free the [src].</span>"
@@ -42,6 +41,20 @@
R.add_fingerprint(user)
qdel(src)
/obj/structure/transit_tube_pod/container_resist()
var/mob/living/user = usr
if(!moving)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user << "<span class='notice'>You start trying to escape from the pod.</span>"
if(do_after(user, 600))
user << "<span class='notice'>You manage to open the pod.</span>"
src.empty()
/obj/structure/transit_tube_pod/proc/empty()
for(var/atom/movable/M in src.contents)
M.loc = src.loc
/obj/structure/transit_tube_pod/proc/follow_tube(var/reverse_launch)
if(moving)
return