mirror of
https://github.com/KabKebab/GS13.git
synced 2026-08-26 22:46:15 +01:00
Uploading all files.
This commit is contained in:
@@ -0,0 +1,210 @@
|
||||
|
||||
// A place where tube pods stop, and people can get in or out.
|
||||
// Mappers: use "Generate Instances from Directions" for this
|
||||
// one.
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station
|
||||
name = "station tube station"
|
||||
icon_state = "closed_station0"
|
||||
desc = "The lynchpin of the transit system."
|
||||
exit_delay = 1
|
||||
enter_delay = 2
|
||||
tube_construction = /obj/structure/c_transit_tube/station
|
||||
var/open_status = STATION_TUBE_CLOSED
|
||||
var/pod_moving = 0
|
||||
var/cooldown_delay = 50
|
||||
var/launch_cooldown = 0
|
||||
var/reverse_launch = 0
|
||||
var/base_icon = "station0"
|
||||
var/boarding_dir //from which direction you can board the tube
|
||||
|
||||
var/const/OPEN_DURATION = 6
|
||||
var/const/CLOSE_DURATION = 6
|
||||
|
||||
/obj/structure/transit_tube/station/New()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/structure/transit_tube/station/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube/station/should_stop_pod(pod, from_dir)
|
||||
return 1
|
||||
|
||||
/obj/structure/transit_tube/station/Bumped(atom/movable/AM)
|
||||
if(!pod_moving && open_status == STATION_TUBE_OPEN && ismob(AM) && AM.dir == boarding_dir)
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving)
|
||||
AM.forceMove(pod)
|
||||
pod.update_icon()
|
||||
return
|
||||
|
||||
|
||||
//pod insertion
|
||||
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/user)
|
||||
if(!user.canmove || user.stat || user.restrained())
|
||||
return
|
||||
if (!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
|
||||
return
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
return //no fun allowed
|
||||
var/obj/structure/transit_tube_pod/TP = new(loc)
|
||||
R.transfer_fingerprints_to(TP)
|
||||
TP.add_fingerprint(user)
|
||||
TP.setDir(turn(src.dir, -90))
|
||||
user.visible_message("[user] inserts [R].", "<span class='notice'>You insert [R].</span>")
|
||||
qdel(R)
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(!pod_moving)
|
||||
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
|
||||
if(open_status == STATION_TUBE_OPEN)
|
||||
var/mob/living/GM = user.pulling
|
||||
if(user.grab_state >= GRAB_AGGRESSIVE)
|
||||
if(GM.buckled || GM.has_buckled_mobs())
|
||||
to_chat(user, "<span class='warning'>[GM] is attached to something!</span>")
|
||||
return
|
||||
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, 15, target = src))
|
||||
if(open_status == STATION_TUBE_OPEN && GM && user.grab_state >= GRAB_AGGRESSIVE && user.pulling == GM && !GM.buckled && !GM.has_buckled_mobs())
|
||||
GM.Knockdown(100)
|
||||
src.Bumped(GM)
|
||||
break
|
||||
else
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving && (pod.dir in tube_dirs))
|
||||
if(open_status == STATION_TUBE_CLOSED)
|
||||
open_animation()
|
||||
|
||||
else if(open_status == STATION_TUBE_OPEN)
|
||||
if(pod.contents.len && user.loc != pod)
|
||||
user.visible_message("[user] starts emptying [pod]'s contents onto the floor.", "<span class='notice'>You start emptying [pod]'s contents onto the floor...</span>")
|
||||
if(do_after(user, 10, target = src)) //So it doesn't default to close_animation() on fail
|
||||
if(pod && pod.loc == loc)
|
||||
for(var/atom/movable/AM in pod)
|
||||
AM.forceMove(get_turf(user))
|
||||
|
||||
else
|
||||
close_animation()
|
||||
break
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
for(var/obj/structure/transit_tube_pod/P in loc)
|
||||
P.deconstruct(FALSE, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube/station/proc/open_animation()
|
||||
if(open_status == STATION_TUBE_CLOSED)
|
||||
icon_state = "opening_[base_icon]"
|
||||
open_status = STATION_TUBE_OPENING
|
||||
spawn(OPEN_DURATION)
|
||||
if(open_status == STATION_TUBE_OPENING)
|
||||
icon_state = "open_[base_icon]"
|
||||
open_status = STATION_TUBE_OPEN
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/close_animation()
|
||||
if(open_status == STATION_TUBE_OPEN)
|
||||
icon_state = "closing_[base_icon]"
|
||||
open_status = STATION_TUBE_CLOSING
|
||||
spawn(CLOSE_DURATION)
|
||||
if(open_status == STATION_TUBE_CLOSING)
|
||||
icon_state = "closed_[base_icon]"
|
||||
open_status = STATION_TUBE_CLOSED
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/proc/launch_pod()
|
||||
if(launch_cooldown >= world.time)
|
||||
return
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
if(!pod.moving)
|
||||
pod_moving = 1
|
||||
close_animation()
|
||||
sleep(CLOSE_DURATION + 2)
|
||||
if(open_status == STATION_TUBE_CLOSED && pod && pod.loc == loc)
|
||||
pod.follow_tube()
|
||||
pod_moving = 0
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/structure/transit_tube/station/process()
|
||||
if(!pod_moving)
|
||||
launch_pod()
|
||||
|
||||
/obj/structure/transit_tube/station/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir)
|
||||
pod_moving = 1
|
||||
spawn(5)
|
||||
if(reverse_launch)
|
||||
pod.setDir(tube_dirs[1]) //turning the pod around for next launch.
|
||||
launch_cooldown = world.time + cooldown_delay
|
||||
open_animation()
|
||||
sleep(OPEN_DURATION + 2)
|
||||
pod_moving = 0
|
||||
if(!QDELETED(pod))
|
||||
var/datum/gas_mixture/floor_mixture = loc.return_air()
|
||||
ARCHIVE_TEMPERATURE(floor_mixture)
|
||||
ARCHIVE_TEMPERATURE(pod.air_contents)
|
||||
pod.air_contents.share(floor_mixture, 1) //mix the pod's gas mixture with the tile it's on
|
||||
air_update_turf()
|
||||
|
||||
/obj/structure/transit_tube/station/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(EAST, WEST)
|
||||
if(SOUTH)
|
||||
tube_dirs = list(EAST, WEST)
|
||||
if(EAST)
|
||||
tube_dirs = list(NORTH, SOUTH)
|
||||
if(WEST)
|
||||
tube_dirs = list(NORTH, SOUTH)
|
||||
boarding_dir = turn(dir, 180)
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/flipped
|
||||
icon_state = "closed_station1"
|
||||
base_icon = "station1"
|
||||
tube_construction = /obj/structure/c_transit_tube/station/flipped
|
||||
|
||||
/obj/structure/transit_tube/station/flipped/init_tube_dirs()
|
||||
..()
|
||||
boarding_dir = dir
|
||||
|
||||
|
||||
// Stations which will send the tube in the opposite direction after their stop.
|
||||
/obj/structure/transit_tube/station/reverse
|
||||
tube_construction = /obj/structure/c_transit_tube/station/reverse
|
||||
reverse_launch = 1
|
||||
icon_state = "closed_terminus0"
|
||||
base_icon = "terminus0"
|
||||
|
||||
/obj/structure/transit_tube/station/reverse/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(EAST)
|
||||
if(SOUTH)
|
||||
tube_dirs = list(WEST)
|
||||
if(EAST)
|
||||
tube_dirs = list(SOUTH)
|
||||
if(WEST)
|
||||
tube_dirs = list(NORTH)
|
||||
boarding_dir = turn(dir, 180)
|
||||
|
||||
/obj/structure/transit_tube/station/reverse/flipped
|
||||
icon_state = "closed_terminus1"
|
||||
base_icon = "terminus1"
|
||||
tube_construction = /obj/structure/c_transit_tube/station/reverse/flipped
|
||||
|
||||
/obj/structure/transit_tube/station/reverse/flipped/init_tube_dirs()
|
||||
..()
|
||||
boarding_dir = dir
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
|
||||
/obj/structure/transit_tube
|
||||
name = "transit tube"
|
||||
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
|
||||
icon_state = "straight"
|
||||
desc = "A transit tube for moving things around."
|
||||
density = TRUE
|
||||
layer = LOW_ITEM_LAYER
|
||||
anchored = TRUE
|
||||
climbable = 1
|
||||
var/tube_construction = /obj/structure/c_transit_tube
|
||||
var/list/tube_dirs //list of directions this tube section can connect to.
|
||||
var/exit_delay = 1
|
||||
var/enter_delay = 0
|
||||
var/const/time_to_unwrench = 2 SECONDS
|
||||
|
||||
/obj/structure/transit_tube/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
return !density
|
||||
|
||||
/obj/structure/transit_tube/New(loc, newdirection)
|
||||
..(loc)
|
||||
if(newdirection)
|
||||
setDir(newdirection)
|
||||
init_tube_dirs()
|
||||
generate_tube_overlays()
|
||||
|
||||
/obj/structure/transit_tube/Destroy()
|
||||
for(var/obj/structure/transit_tube_pod/P in loc)
|
||||
P.deconstruct(FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
|
||||
/obj/structure/transit_tube/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(tube_construction)
|
||||
for(var/obj/structure/transit_tube_pod/pod in src.loc)
|
||||
to_chat(user, "<span class='warning'>Remove the pod first!</span>")
|
||||
return
|
||||
user.visible_message("[user] starts to detach \the [src].", "<span class='notice'>You start to detach the [name]...</span>")
|
||||
if(W.use_tool(src, user, time_to_unwrench, volume=50))
|
||||
to_chat(user, "<span class='notice'>You detach the [name].</span>")
|
||||
var/obj/structure/c_transit_tube/R = new tube_construction(loc)
|
||||
R.setDir(dir)
|
||||
transfer_fingerprints_to(R)
|
||||
R.add_fingerprint(user)
|
||||
qdel(src)
|
||||
else if(istype(W, /obj/item/crowbar))
|
||||
for(var/obj/structure/transit_tube_pod/pod in src.loc)
|
||||
pod.attackby(W, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
// Called to check if a pod should stop upon entering this tube.
|
||||
/obj/structure/transit_tube/proc/should_stop_pod(pod, from_dir)
|
||||
return 0
|
||||
|
||||
// Called when a pod stops in this tube section.
|
||||
/obj/structure/transit_tube/proc/pod_stopped(pod, from_dir)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/has_entrance(from_dir)
|
||||
from_dir = turn(from_dir, 180)
|
||||
|
||||
for(var/direction in tube_dirs)
|
||||
if(direction == from_dir)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/has_exit(in_dir)
|
||||
for(var/direction in tube_dirs)
|
||||
if(direction == in_dir)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
// Searches for an exit direction within 45 degrees of the
|
||||
// specified dir. Returns that direction, or 0 if none match.
|
||||
/obj/structure/transit_tube/proc/get_exit(in_dir)
|
||||
var/near_dir = 0
|
||||
var/in_dir_cw = turn(in_dir, -45)
|
||||
var/in_dir_ccw = turn(in_dir, 45)
|
||||
|
||||
for(var/direction in tube_dirs)
|
||||
if(direction == in_dir)
|
||||
return direction
|
||||
|
||||
else if(direction == in_dir_cw)
|
||||
near_dir = direction
|
||||
|
||||
else if(direction == in_dir_ccw)
|
||||
near_dir = direction
|
||||
|
||||
return near_dir
|
||||
|
||||
|
||||
// Return how many BYOND ticks to wait before entering/exiting
|
||||
// the tube section. Default action is to return the value of
|
||||
// a var, which wouldn't need a proc, but it makes it possible
|
||||
// for later tube types to interact in more interesting ways
|
||||
// such as being very fast in one direction, but slow in others
|
||||
/obj/structure/transit_tube/proc/exit_delay(pod, to_dir)
|
||||
return exit_delay
|
||||
|
||||
/obj/structure/transit_tube/proc/enter_delay(pod, to_dir)
|
||||
return enter_delay
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(NORTH, SOUTH)
|
||||
if(SOUTH)
|
||||
tube_dirs = list(NORTH, SOUTH)
|
||||
if(EAST)
|
||||
tube_dirs = list(EAST, WEST)
|
||||
if(WEST)
|
||||
tube_dirs = list(EAST, WEST)
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/generate_tube_overlays()
|
||||
for(var/direction in tube_dirs)
|
||||
if(direction in GLOB.diagonals)
|
||||
if(direction & NORTH)
|
||||
create_tube_overlay(direction ^ 3, NORTH)
|
||||
|
||||
if(direction & EAST)
|
||||
create_tube_overlay(direction ^ 12, EAST)
|
||||
|
||||
else
|
||||
create_tube_overlay(direction ^ 12, WEST)
|
||||
else
|
||||
create_tube_overlay(direction)
|
||||
|
||||
|
||||
/obj/structure/transit_tube/proc/create_tube_overlay(direction, shift_dir)
|
||||
var/image/tube_overlay = new(dir = direction)
|
||||
if(shift_dir)
|
||||
tube_overlay.icon_state = "decorative_diag"
|
||||
switch(shift_dir)
|
||||
if(NORTH)
|
||||
tube_overlay.pixel_y = 32
|
||||
if(SOUTH)
|
||||
tube_overlay.pixel_y = -32
|
||||
if(EAST)
|
||||
tube_overlay.pixel_x = 32
|
||||
if(WEST)
|
||||
tube_overlay.pixel_x = -32
|
||||
else
|
||||
tube_overlay.icon_state = "decorative"
|
||||
add_overlay(tube_overlay)
|
||||
|
||||
|
||||
|
||||
|
||||
//Some of these are mostly for mapping use
|
||||
/obj/structure/transit_tube/horizontal
|
||||
dir = WEST
|
||||
|
||||
|
||||
/obj/structure/transit_tube/diagonal
|
||||
icon_state = "diagonal"
|
||||
tube_construction = /obj/structure/c_transit_tube/diagonal
|
||||
|
||||
/obj/structure/transit_tube/diagonal/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(NORTHEAST, SOUTHWEST)
|
||||
if(SOUTH)
|
||||
tube_dirs = list(NORTHEAST, SOUTHWEST)
|
||||
if(EAST)
|
||||
tube_dirs = list(NORTHWEST, SOUTHEAST)
|
||||
if(WEST)
|
||||
tube_dirs = list(NORTHWEST, SOUTHEAST)
|
||||
|
||||
//mostly for mapping use
|
||||
/obj/structure/transit_tube/diagonal/topleft
|
||||
dir = WEST
|
||||
|
||||
/obj/structure/transit_tube/diagonal/crossing
|
||||
density = FALSE
|
||||
icon_state = "diagonal_crossing"
|
||||
tube_construction = /obj/structure/c_transit_tube/diagonal/crossing
|
||||
|
||||
//mostly for mapping use
|
||||
/obj/structure/transit_tube/diagonal/crossing/topleft
|
||||
dir = WEST
|
||||
|
||||
|
||||
/obj/structure/transit_tube/curved
|
||||
icon_state = "curved0"
|
||||
tube_construction = /obj/structure/c_transit_tube/curved
|
||||
|
||||
/obj/structure/transit_tube/curved/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(NORTH, SOUTHWEST)
|
||||
if(SOUTH)
|
||||
tube_dirs = list(SOUTH, NORTHEAST)
|
||||
if(EAST)
|
||||
tube_dirs = list(EAST, NORTHWEST)
|
||||
if(WEST)
|
||||
tube_dirs = list(SOUTHEAST, WEST)
|
||||
|
||||
/obj/structure/transit_tube/curved/flipped
|
||||
icon_state = "curved1"
|
||||
tube_construction = /obj/structure/c_transit_tube/curved/flipped
|
||||
|
||||
/obj/structure/transit_tube/curved/flipped/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(NORTH, SOUTHEAST)
|
||||
if(SOUTH)
|
||||
tube_dirs = list(SOUTH, NORTHWEST)
|
||||
if(EAST)
|
||||
tube_dirs = list(EAST, SOUTHWEST)
|
||||
if(WEST)
|
||||
tube_dirs = list(NORTHEAST, WEST)
|
||||
|
||||
|
||||
/obj/structure/transit_tube/junction
|
||||
icon_state = "junction0"
|
||||
tube_construction = /obj/structure/c_transit_tube/junction
|
||||
|
||||
/obj/structure/transit_tube/junction/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(NORTH, SOUTHEAST, SOUTHWEST)//ending with the prefered direction
|
||||
if(SOUTH)
|
||||
tube_dirs = list(SOUTH, NORTHWEST, NORTHEAST)
|
||||
if(EAST)
|
||||
tube_dirs = list(EAST, SOUTHWEST, NORTHWEST)
|
||||
if(WEST)
|
||||
tube_dirs = list(WEST, NORTHEAST, SOUTHEAST)
|
||||
|
||||
/obj/structure/transit_tube/junction/flipped
|
||||
icon_state = "junction1"
|
||||
tube_construction = /obj/structure/c_transit_tube/junction/flipped
|
||||
|
||||
/obj/structure/transit_tube/junction/flipped/init_tube_dirs()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
tube_dirs = list(NORTH, SOUTHWEST, SOUTHEAST)//ending with the prefered direction
|
||||
if(SOUTH)
|
||||
tube_dirs = list(SOUTH, NORTHEAST, NORTHWEST)
|
||||
if(EAST)
|
||||
tube_dirs = list(EAST, NORTHWEST, SOUTHWEST)
|
||||
if(WEST)
|
||||
tube_dirs = list(WEST, SOUTHEAST, NORTHEAST)
|
||||
|
||||
|
||||
/obj/structure/transit_tube/crossing
|
||||
icon_state = "crossing"
|
||||
tube_construction = /obj/structure/c_transit_tube/crossing
|
||||
density = FALSE
|
||||
|
||||
//mostly for mapping use
|
||||
/obj/structure/transit_tube/crossing/horizontal
|
||||
dir = WEST
|
||||
@@ -0,0 +1,122 @@
|
||||
// transit tube construction
|
||||
|
||||
// normal transit tubes
|
||||
/obj/structure/c_transit_tube
|
||||
name = "unattached transit tube"
|
||||
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
|
||||
icon_state = "straight"
|
||||
desc = "An unattached segment of transit tube."
|
||||
density = FALSE
|
||||
layer = LOW_ITEM_LAYER //same as the built tube
|
||||
anchored = FALSE
|
||||
var/const/time_to_unwrench = 2 SECONDS
|
||||
var/flipped = 0
|
||||
var/build_type = /obj/structure/transit_tube
|
||||
var/flipped_build_type
|
||||
var/base_icon
|
||||
|
||||
|
||||
/obj/structure/c_transit_tube/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_FLIP | ROTATION_VERBS,null,null,CALLBACK(src,.proc/after_rot))
|
||||
|
||||
/obj/structure/c_transit_tube/proc/after_rot(mob/user,rotation_type)
|
||||
if(flipped_build_type && rotation_type == ROTATION_FLIP)
|
||||
setDir(turn(dir,-180)) //Turn back we don't actually flip
|
||||
flipped = !flipped
|
||||
var/cur_flip = initial(flipped) ? !flipped : flipped
|
||||
if(cur_flip)
|
||||
build_type = flipped_build_type
|
||||
else
|
||||
build_type = initial(build_type)
|
||||
icon_state = "[base_icon][flipped]"
|
||||
|
||||
/obj/structure/c_transit_tube/wrench_act(mob/living/user, obj/item/I)
|
||||
to_chat(user, "<span class='notice'>You start attaching the [name]...</span>")
|
||||
add_fingerprint(user)
|
||||
if(I.use_tool(src, user, time_to_unwrench, volume=50))
|
||||
to_chat(user, "<span class='notice'>You attach the [name].</span>")
|
||||
var/obj/structure/transit_tube/R = new build_type(loc, dir)
|
||||
transfer_fingerprints_to(R)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
// transit tube station
|
||||
/obj/structure/c_transit_tube/station
|
||||
name = "unattached through station"
|
||||
icon_state = "closed_station0"
|
||||
build_type = /obj/structure/transit_tube/station
|
||||
flipped_build_type = /obj/structure/transit_tube/station/flipped
|
||||
base_icon = "closed_station"
|
||||
|
||||
/obj/structure/c_transit_tube/station/flipped
|
||||
icon_state = "closed_station1"
|
||||
flipped = 1
|
||||
build_type = /obj/structure/transit_tube/station/flipped
|
||||
flipped_build_type = /obj/structure/transit_tube/station
|
||||
|
||||
|
||||
// reverser station, used for the terminus
|
||||
/obj/structure/c_transit_tube/station/reverse
|
||||
name = "unattached terminus station"
|
||||
icon_state = "closed_terminus0"
|
||||
build_type = /obj/structure/transit_tube/station/reverse
|
||||
flipped_build_type = /obj/structure/transit_tube/station/reverse/flipped
|
||||
base_icon = "closed_terminus"
|
||||
|
||||
/obj/structure/c_transit_tube/station/reverse/flipped
|
||||
icon_state = "closed_terminus1"
|
||||
flipped = 1
|
||||
build_type = /obj/structure/transit_tube/station/reverse/flipped
|
||||
flipped_build_type = /obj/structure/transit_tube/station/reverse
|
||||
|
||||
|
||||
/obj/structure/c_transit_tube/crossing
|
||||
icon_state = "crossing"
|
||||
build_type = /obj/structure/transit_tube/crossing
|
||||
|
||||
|
||||
/obj/structure/c_transit_tube/diagonal
|
||||
icon_state = "diagonal"
|
||||
build_type = /obj/structure/transit_tube/diagonal
|
||||
|
||||
/obj/structure/c_transit_tube/diagonal/crossing
|
||||
icon_state = "diagonal_crossing"
|
||||
build_type = /obj/structure/transit_tube/diagonal/crossing
|
||||
|
||||
|
||||
/obj/structure/c_transit_tube/curved
|
||||
icon_state = "curved0"
|
||||
build_type = /obj/structure/transit_tube/curved
|
||||
flipped_build_type = /obj/structure/transit_tube/curved/flipped
|
||||
base_icon = "curved"
|
||||
|
||||
/obj/structure/c_transit_tube/curved/flipped
|
||||
icon_state = "curved1"
|
||||
build_type = /obj/structure/transit_tube/curved/flipped
|
||||
flipped_build_type = /obj/structure/transit_tube/curved
|
||||
flipped = 1
|
||||
|
||||
|
||||
/obj/structure/c_transit_tube/junction
|
||||
icon_state = "junction0"
|
||||
build_type = /obj/structure/transit_tube/junction
|
||||
flipped_build_type = /obj/structure/transit_tube/junction/flipped
|
||||
base_icon = "junction"
|
||||
|
||||
|
||||
/obj/structure/c_transit_tube/junction/flipped
|
||||
icon_state = "junction1"
|
||||
flipped = 1
|
||||
build_type = /obj/structure/transit_tube/junction/flipped
|
||||
flipped_build_type = /obj/structure/transit_tube/junction
|
||||
|
||||
|
||||
//transit tube pod
|
||||
//see station.dm for the logic
|
||||
/obj/structure/c_transit_tube_pod
|
||||
name = "unattached transit tube pod"
|
||||
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
|
||||
icon_state = "pod"
|
||||
anchored = FALSE
|
||||
density = FALSE
|
||||
@@ -0,0 +1,185 @@
|
||||
/obj/structure/transit_tube_pod
|
||||
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
|
||||
icon_state = "pod"
|
||||
animate_movement = FORWARD_STEPS
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
layer = BELOW_OBJ_LAYER
|
||||
var/moving = 0
|
||||
var/datum/gas_mixture/air_contents = new()
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/Initialize()
|
||||
. = ..()
|
||||
air_contents.gases[/datum/gas/oxygen] = MOLES_O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrogen] = MOLES_N2STANDARD
|
||||
air_contents.temperature = T20C
|
||||
|
||||
|
||||
/obj/structure/transit_tube_pod/Destroy()
|
||||
empty_pod()
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube_pod/update_icon()
|
||||
if(contents.len)
|
||||
icon_state = "pod_occupied"
|
||||
else
|
||||
icon_state = "pod"
|
||||
|
||||
/obj/structure/transit_tube_pod/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(!moving)
|
||||
I.play_tool_sound(src)
|
||||
if(contents.len)
|
||||
user.visible_message("[user] empties \the [src].", "<span class='notice'>You empty \the [src].</span>")
|
||||
empty_pod()
|
||||
else
|
||||
deconstruct(TRUE, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube_pod/deconstruct(disassembled = TRUE, mob/user)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
var/atom/location = get_turf(src)
|
||||
if(user)
|
||||
location = user.loc
|
||||
add_fingerprint(user)
|
||||
user.visible_message("[user] removes [src].", "<span class='notice'>You remove [src].</span>")
|
||||
var/obj/structure/c_transit_tube_pod/R = new/obj/structure/c_transit_tube_pod(location)
|
||||
transfer_fingerprints_to(R)
|
||||
R.setDir(dir)
|
||||
empty_pod(location)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/transit_tube_pod/ex_act(severity, target)
|
||||
..()
|
||||
if(!QDELETED(src))
|
||||
empty_pod()
|
||||
|
||||
/obj/structure/transit_tube_pod/contents_explosion(severity, target)
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.ex_act(severity, target)
|
||||
|
||||
/obj/structure/transit_tube_pod/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
|
||||
/obj/structure/transit_tube_pod/container_resist(mob/living/user)
|
||||
if(!user.incapacitated())
|
||||
empty_pod()
|
||||
return
|
||||
if(!moving)
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
to_chat(user, "<span class='notice'>You start trying to escape from the pod...</span>")
|
||||
if(do_after(user, 600, target = src))
|
||||
to_chat(user, "<span class='notice'>You manage to open the pod.</span>")
|
||||
empty_pod()
|
||||
|
||||
/obj/structure/transit_tube_pod/proc/empty_pod(atom/location)
|
||||
if(!location)
|
||||
location = get_turf(src)
|
||||
for(var/atom/movable/M in contents)
|
||||
M.forceMove(location)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/transit_tube_pod/Process_Spacemove()
|
||||
if(moving) //No drifting while moving in the tubes
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/transit_tube_pod/proc/follow_tube()
|
||||
set waitfor = 0
|
||||
if(moving)
|
||||
return
|
||||
|
||||
moving = 1
|
||||
|
||||
var/obj/structure/transit_tube/current_tube = null
|
||||
var/next_dir
|
||||
var/next_loc
|
||||
var/last_delay = 0
|
||||
var/exit_delay
|
||||
|
||||
for(var/obj/structure/transit_tube/tube in loc)
|
||||
if(tube.has_exit(dir))
|
||||
current_tube = tube
|
||||
break
|
||||
|
||||
while(current_tube)
|
||||
next_dir = current_tube.get_exit(dir)
|
||||
|
||||
if(!next_dir)
|
||||
break
|
||||
|
||||
exit_delay = current_tube.exit_delay(src, dir)
|
||||
last_delay += exit_delay
|
||||
|
||||
sleep(exit_delay)
|
||||
|
||||
next_loc = get_step(loc, next_dir)
|
||||
|
||||
current_tube = null
|
||||
for(var/obj/structure/transit_tube/tube in next_loc)
|
||||
if(tube.has_entrance(next_dir))
|
||||
current_tube = tube
|
||||
break
|
||||
|
||||
if(current_tube == null)
|
||||
setDir(next_dir)
|
||||
Move(get_step(loc, dir), dir) // Allow collisions when leaving the tubes.
|
||||
break
|
||||
|
||||
last_delay = current_tube.enter_delay(src, next_dir)
|
||||
sleep(last_delay)
|
||||
setDir(next_dir)
|
||||
forceMove(next_loc) // When moving from one tube to another, skip collision and such.
|
||||
density = current_tube.density
|
||||
|
||||
if(current_tube && current_tube.should_stop_pod(src, next_dir))
|
||||
current_tube.pod_stopped(src, dir)
|
||||
break
|
||||
|
||||
density = TRUE
|
||||
moving = 0
|
||||
|
||||
var/obj/structure/transit_tube/TT = locate(/obj/structure/transit_tube) in loc
|
||||
if(!TT || (!(dir in TT.tube_dirs) && !(turn(dir,180) in TT.tube_dirs))) //landed on a turf without transit tube or not in our direction
|
||||
deconstruct(FALSE) //we automatically deconstruct the pod
|
||||
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver)
|
||||
return air_contents.merge(giver)
|
||||
|
||||
/obj/structure/transit_tube_pod/remove_air(amount)
|
||||
return air_contents.remove(amount)
|
||||
|
||||
/obj/structure/transit_tube_pod/relaymove(mob/mob, direction)
|
||||
if(istype(mob) && mob.client)
|
||||
if(!moving)
|
||||
for(var/obj/structure/transit_tube/station/station in loc)
|
||||
if(!station.pod_moving)
|
||||
if(direction == turn(station.boarding_dir,180))
|
||||
if(station.open_status == STATION_TUBE_OPEN)
|
||||
mob.forceMove(loc)
|
||||
update_icon()
|
||||
else
|
||||
station.open_animation()
|
||||
|
||||
else if(direction in station.tube_dirs)
|
||||
setDir(direction)
|
||||
station.launch_pod()
|
||||
return
|
||||
|
||||
for(var/obj/structure/transit_tube/TT in loc)
|
||||
if(dir in TT.tube_dirs)
|
||||
if(TT.has_exit(direction))
|
||||
setDir(direction)
|
||||
return
|
||||
|
||||
/obj/structure/transit_tube_pod/return_temperature()
|
||||
return air_contents.temperature
|
||||
Reference in New Issue
Block a user