Files
Bubberstation/code/game/objects/structures/transit_tubes/transit_tube_construction.dm
T
YesterdaysPromiseandGitHub fb10121022 Icons folder cleaning wave two (#76788)
## About The Pull Request

Further continous organizing and cleaning the Icons folder. There are
still some minior nitpicks left to do, but I reached my daily sanity
expenses limit again, and the faster these get in the less issues for
both me and others later. Also cleans some mess I caused by my blindness
last PR.

## Why It's Good For The Game

Saner spriters = better sprites
2023-07-14 18:36:41 +00:00

168 lines
5.6 KiB
Plaintext

// transit tube construction
// normal transit tubes
/obj/structure/c_transit_tube
name = "unattached transit tube"
icon = 'icons/obj/pipes_n_cables/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/flipped = FALSE
var/build_type = /obj/structure/transit_tube
var/flipped_build_type
/obj/structure/c_transit_tube/Initialize(mapload)
. = ..()
AddComponent(/datum/component/simple_rotation, AfterRotation = CALLBACK(src, PROC_REF(AfterRotation)))
/obj/structure/c_transit_tube/proc/can_wrench_in_loc(mob/user)
var/turf/source_turf = get_turf(loc)
var/existing_tubes = 0
for(var/obj/structure/transit_tube/tube in source_turf)
existing_tubes +=1
if(existing_tubes >= 2)
to_chat(user, "[span_warning("You cannot wrench any more transit tubes!")] ")
return FALSE
return TRUE
/obj/structure/c_transit_tube/proc/AfterRotation(mob/user, degrees)
if(flipped_build_type && degrees == ROTATION_FLIP)
setDir(turn(dir, degrees)) //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_state][flipped]"
/obj/structure/c_transit_tube/wrench_act(mob/living/user, obj/item/I)
..()
if(!can_wrench_in_loc(user))
return
to_chat(user, span_notice("You start attaching the [name]..."))
add_fingerprint(user)
if(I.use_tool(src, user, 2 SECONDS, volume=50, extra_checks=CALLBACK(src, PROC_REF(can_wrench_in_loc), user)))
to_chat(user, span_notice("You attach the [name]."))
var/obj/structure/transit_tube/R = new build_type(loc, dir)
transfer_fingerprints_to(R)
qdel(src)
return TRUE
/obj/structure/c_transit_tube/AltClick(mob/user)
return ..() // This hotkey is BLACKLISTED since it's used by /datum/component/simple_rotation
// 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_state = "closed_station"
/obj/structure/c_transit_tube/station/flipped
icon_state = "closed_station1"
flipped = TRUE
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_state = "closed_terminus"
/obj/structure/c_transit_tube/station/reverse/flipped
icon_state = "closed_terminus1"
flipped = TRUE
build_type = /obj/structure/transit_tube/station/reverse/flipped
flipped_build_type = /obj/structure/transit_tube/station/reverse
//all the dispenser stations
/obj/structure/c_transit_tube/station/dispenser
icon_state = "open_dispenser0"
name = "unattached dispenser station"
build_type = /obj/structure/transit_tube/station/dispenser
flipped_build_type = /obj/structure/transit_tube/station/dispenser/flipped
base_icon_state = "open_dispenser"
/obj/structure/c_transit_tube/station/dispenser/flipped
icon_state = "open_dispenser1"
flipped = TRUE
build_type = /obj/structure/transit_tube/station/dispenser/flipped
flipped_build_type = /obj/structure/transit_tube/station/dispenser
//and the ones that reverse
/obj/structure/c_transit_tube/station/dispenser/reverse
name = "unattached terminus dispenser station"
icon_state = "open_terminusdispenser0"
build_type = /obj/structure/transit_tube/station/dispenser/reverse
flipped_build_type = /obj/structure/transit_tube/station/dispenser/reverse/flipped
base_icon_state = "open_terminusdispenser"
/obj/structure/c_transit_tube/station/dispenser/reverse/flipped
icon_state = "open_terminusdispenser1"
flipped = TRUE
build_type = /obj/structure/transit_tube/station/dispenser/reverse/flipped
flipped_build_type = /obj/structure/transit_tube/station/dispenser/reverse
//onto some special tube types
/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_state = "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 = TRUE
/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_state = "junction"
/obj/structure/c_transit_tube/junction/flipped
icon_state = "junction1"
flipped = TRUE
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/pipes_n_cables/transit_tube.dmi'
icon_state = "pod"
desc = "Could probably be <b>dragged</b> into an open Transit Tube."
anchored = FALSE
density = FALSE