Files
Bubberstation/code/game/objects/structures/transit_tubes/transit_tube_construction.dm
Bloop cf14dcfc1a Converts 3 components into elements (#94589)
## About The Pull Request

`adjust_fishing_difficulty` is a good one to make into a bespoke element
since a number of the same clothing item are created in the wardrobe
system.

climb_walkable is also good due to how prevalent it is, and it is a bit
of a two for one since it also removes the need for the
`/component/connect_loc_behalf`

Also stops adding the on_climbable trait to literally everything in the
turf, it now only applies it to atoms with density. So no more pipes and
stuff getting trait lists created for no reason.

<details><summary> Tested + things still work as before </summary>

<img width="422" height="122" alt="image"
src="https://github.com/user-attachments/assets/b23696f5-cd16-4150-aeb3-14ea6bd256fc"
/>

</details>

## Why It's Good For The Game

Lessens overhead, fixes a bug as well.

## Changelog

🆑
fix: fixes a pushed crate not removing on_climbable trait properly off
the mob standing atop it
/🆑
2025-12-30 01:05:50 +01:00

166 lines
5.4 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)
. = ..()
AddElement(/datum/element/simple_rotation)
/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/post_rotation(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 [src]..."))
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 [src]."))
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_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