Removes Old Deprecated Stuff (#15241)

This commit is contained in:
SleepyGemmy
2023-01-02 14:27:29 +01:00
committed by GitHub
parent 8cd958c560
commit 5179dad83e
164 changed files with 546 additions and 8217 deletions
-55
View File
@@ -1,55 +0,0 @@
/*
* Acid
*/
/obj/effect/acid
name = "acid"
desc = "Burbling corrosive stuff. Probably a bad idea to roll around in it."
icon_state = "acid"
icon = 'icons/mob/npc/alien.dmi'
density = 0
opacity = 0
anchored = 1
var/atom/target
var/ticks = 0
var/target_strength = 0
/obj/effect/acid/New(loc, supplied_target)
..(loc)
target = supplied_target
if(isturf(target)) // Turf take twice as long to take down.
target_strength = 8
else
target_strength = 4
tick()
/obj/effect/acid/proc/tick()
if(!target)
qdel(src)
ticks++
if(ticks >= target_strength)
target.visible_message("<span class='alium'>\The [target] collapses under its own weight into a puddle of goop and undigested debris!</span>")
if(istype(target, /turf/simulated/wall)) // I hate turf code.
var/turf/simulated/wall/W = target
W.dismantle_wall(1)
else if(istype(target, /turf/simulated/floor))
var/turf/simulated/floor/F = target
F.ChangeTurf(F.baseturf)
else
qdel(target)
qdel(src)
return
switch(target_strength - ticks)
if(6)
visible_message("<span class='alium'>\The [src.target] is holding up against the acid!</span>")
if(4)
visible_message("<span class='alium'>\The [src.target]\s structure is being melted by the acid!</span>")
if(2)
visible_message("<span class='alium'>\The [src.target] is struggling to withstand the acid!</span>")
if(0 to 1)
visible_message("<span class='alium'>\The [src.target] begins to crumble under the acid!</span>")
addtimer(CALLBACK(src, .proc/tick), rand(150, 200))
@@ -35,165 +35,6 @@
return
/obj/item/radio/integrated/proc/generate_menu()
/obj/item/radio/integrated/beepsky
var/list/botlist = null // list of bots
var/mob/living/bot/secbot/active // the active bot; if null, show bot list
var/list/botstatus // the status signal sent by the bot
var/control_freq = BOT_FREQ
// create a new QM cartridge, and register to receive bot control & beacon message
/obj/item/radio/integrated/beepsky/Initialize()
. = ..()
SSradio.add_object(src, control_freq, filter = RADIO_SECBOT)
// receive radio signals
// can detect bot status signals
// create/populate list as they are recvd
/obj/item/radio/integrated/beepsky/receive_signal(datum/signal/signal)
if (signal.data["type"] == "secbot")
if(!botlist)
botlist = new()
if(!(signal.source in botlist))
botlist += signal.source
if(active == signal.source)
var/list/b = signal.data
botstatus = b.Copy()
/obj/item/radio/integrated/beepsky/Topic(href, href_list)
..()
var/obj/item/modular_computer/PDA = src.hostpda
switch(href_list["op"])
if("control")
active = locate(href_list["bot"])
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
if("scanbots") // find all bots
botlist = null
post_signal(control_freq, "command", "bot_status", s_filter = RADIO_SECBOT)
if("botlist")
active = null
if("stop", "go")
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = RADIO_SECBOT)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
if("summon")
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , s_filter = RADIO_SECBOT)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
/obj/item/radio/integrated/beepsky/Destroy()
SSradio.remove_object(src, control_freq)
return ..()
/obj/item/radio/integrated/mule
var/list/botlist = null // list of bots
var/obj/machinery/bot/mulebot/active // the active bot; if null, show bot list
var/list/botstatus // the status signal sent by the bot
var/list/beacons
var/beacon_freq = 1400
var/control_freq = BOT_FREQ
// create a new QM cartridge, and register to receive bot control & beacon message
/obj/item/radio/integrated/mule/Initialize()
..()
SSradio.add_object(src, control_freq, filter = RADIO_MULEBOT)
SSradio.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
return INITIALIZE_HINT_LATELOAD
/obj/item/radio/integrated/mule/LateInitialize()
post_signal(beacon_freq, "findbeacon", "delivery", s_filter = RADIO_NAVBEACONS)
/obj/item/radio/integrated/mule/Destroy()
SSradio.remove_object(src, control_freq)
SSradio.remove_object(src, beacon_freq)
return ..()
// receive radio signals
// can detect bot status signals
// and beacon locations
// create/populate lists as they are recvd
/obj/item/radio/integrated/mule/receive_signal(datum/signal/signal)
if(signal.data["type"] == "mulebot")
if(!botlist)
botlist = new()
if(!(signal.source in botlist))
botlist += signal.source
if(active == signal.source)
var/list/b = signal.data
botstatus = b.Copy()
else if(signal.data["beacon"])
if(!beacons)
beacons = new()
beacons[signal.data["beacon"] ] = signal.source
// if(istype(P)) P.updateSelfDialog()
/obj/item/radio/integrated/mule/Topic(href, href_list)
..()
var/cmd = "command"
if(active) cmd = "command [active.suffix]"
switch(href_list["op"])
if("control")
active = locate(href_list["bot"])
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("scanbots") // find all bots
botlist = null
post_signal(control_freq, "command", "bot_status", s_filter = RADIO_MULEBOT)
if("botlist")
active = null
if("unload")
post_signal(control_freq, cmd, "unload", s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("setdest")
if(beacons)
var/dest = input("Select Bot Destination", "Mulebot [active.suffix] Interlink", active.destination) as null|anything in beacons
if(dest)
post_signal(control_freq, cmd, "target", "destination", dest, s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("retoff")
post_signal(control_freq, cmd, "autoret", "value", 0, s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("reton")
post_signal(control_freq, cmd, "autoret", "value", 1, s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("pickoff")
post_signal(control_freq, cmd, "autopick", "value", 0, s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("pickon")
post_signal(control_freq, cmd, "autopick", "value", 1, s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
if("stop", "go", "home")
post_signal(control_freq, cmd, href_list["op"], s_filter = RADIO_MULEBOT)
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
/*
* Radio Cartridge, essentially a signaler.
*/
@@ -19,7 +19,7 @@
return
if(!in_range(user, A))
return
else if(is_type_in_list(A, list(/obj/machinery/atmospherics/pipe/tank, /obj/machinery/atmospherics/pipe/vent, /obj/machinery/atmospherics/pipe/simple/heat_exchanging, /obj/machinery/atmospherics/pipe/simple/insulated)))
else if(is_type_in_list(A, list(/obj/machinery/atmospherics/pipe/tank, /obj/machinery/atmospherics/pipe/simple/heat_exchanging)))
return
else if(istype(A,/obj/machinery/atmospherics/pipe))
var/obj/machinery/atmospherics/pipe/P = A
@@ -39,20 +39,4 @@ var/global/list/teleportbeacons = list()
/obj/item/device/radio/beacon/bacon //Probably a better way of doing this, I'm lazy.
proc/digest_delay()
QDEL_IN(src, 600)
// SINGULO BEACON SPAWNER
/obj/item/device/radio/beacon/syndicate
name = "suspicious beacon"
desc = "A label on it reads: <i>Activate to have a singularity beacon teleported to your location</i>."
origin_tech = list(TECH_BLUESPACE = 1, TECH_ILLEGAL = 7)
/obj/item/device/radio/beacon/syndicate/attack_self(mob/user as mob)
if(user)
to_chat(user, "<span class='notice'>Locked In</span>")
new /obj/machinery/power/singularity_beacon/syndicate( user.loc )
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
qdel(src)
return
QDEL_IN(src, 600)
@@ -50,36 +50,6 @@
icon_has_variants = FALSE
hide_type = "scales"
/obj/item/stack/material/animalhide/xeno
name = "alien hide"
desc = "The skin of a terrible creature."
singular_name = "alien hide piece"
icon_state = "sheet-xeno"
default_type = "alien hide"
icon_has_variants = FALSE
hide_type = "carapace"
//don't see anywhere else to put these, maybe together they could be used to make the xenos suit?
/obj/item/stack/material/xenochitin
name = "alien chitin"
desc = "A piece of the hide of a terrible creature."
singular_name = "alien hide piece"
icon = 'icons/mob/npc/alien.dmi'
icon_state = "chitin"
default_type = "alien hide"
/obj/item/xenos_claw
name = "alien claw"
desc = "The claw of a terrible creature."
icon = 'icons/mob/npc/alien.dmi'
icon_state = "claw"
/obj/item/weed_extract
name = "weed extract"
desc = "A piece of slimy, purplish weed."
icon = 'icons/mob/npc/alien.dmi'
icon_state = "weed_extract"
/obj/item/stack/material/animalhide/barehide
name = "bare hide"
desc = "A hide without fur or scales. Can be tanned into leather."
@@ -59,10 +59,6 @@
build_path = /obj/machinery/computer/arcade/orion_trail
origin_tech = list(TECH_DATA = 1)
/obj/item/circuitboard/turbine_control
name = T_BOARD("turbine control console")
build_path = /obj/machinery/computer/turbine_computer
/obj/item/circuitboard/solar_control
name = T_BOARD("solar control console")
build_path = /obj/machinery/power/solar_control
+2 -15
View File
@@ -110,7 +110,7 @@
<br>
<h2>OPERATING PRINCIPLES</h2>
<br>
<li>The supermatter crystal serves as the fundamental power source of the engine. Upon being charged, it begins to emit large amounts of heat and radiation, as well and oxygen and phoron gas. As oxygen accelerates the reaction, and phoron carries the risk of fire, these must be filtered out. NOTE: Supermatter radiation will not charge radiation collectors.</li>
<li>The supermatter crystal serves as the fundamental power source of the engine. Upon being charged, it begins to emit large amounts of heat and radiation, as well and oxygen and phoron gas. As oxygen accelerates the reaction, and phoron carries the risk of fire, these must be filtered out.</li>
<br>
<li>Air in the reactor chamber housing the supermatter is circulated through the reactor loop, which passes through the filters and thermoelectric generators. The thermoelectric generators transfer heat from the reactor loop to the colder radiator loop, thereby generating power. Additional power is generated from internal turbines in the circulators.</li>
<br>
@@ -1012,7 +1012,6 @@
<ol>
<li><a href="#Foreword">Author's Foreword</a></li>
<li><a href="#Basic">Basic Piping</a></li>
<li><a href="#Insulated">Insulated Pipes</a></li>
<li><a href="#Devices">Atmospherics Devices</a></li>
<li><a href="#HES">Heat Exchange Systems</a></li>
<li><a href="#Final">Final Checks</a></li>
@@ -1045,19 +1044,7 @@
</ul>
An important note here is that pipes are now done in three distinct lines - general, supply, and scrubber. You can move gases between these with a universal adapter. Use the correct position for the correct location.
Connecting scrubbers to a supply position pipe makes you an idiot who gives everyone a difficult job. Insulated and HE pipes don't go through these positions.
<h1><a name="Insulated"><B>Insulated Pipes</B></a></h1>
<li><I>Bent pipes:</I> Pipes with a 90 degree bend at the half-meter mark. My goodness.</li>
<li><I>Pipe manifolds:</I> Pipes that are essentially a "T" shape, allowing you to connect three things at one point.</li>
<li><I>4-way manifold:</I> A four-way junction.</li>
<li><I>Pipe cap:</I> Caps off the end of a pipe. Open ends don't actually vent air, because of the way the pipes are assembled, so, uh. Use them to decorate your house or something.</li>
<li><I>Manual Valve:</I> A valve that will block off airflow when turned. Can't be used by the AI or cyborgs, because they don't have hands.</li>
<li><I>Manual T-Valve:</I> Like a manual valve, but at the center of a manifold instead of a straight pipe.</li><BR><BR>
<h1><a name="Insulated"><B>Insulated Pipes</B></a></h1><BR>
<I>Special Public Service Announcement.</I><BR>
Our regular pipes are already insulated. These are completely worthless. Punch anyone who uses them.<BR><BR>
Connecting scrubbers to a supply position pipe makes you an idiot who gives everyone a difficult job. HE pipes don't go through these positions.
<h1><a name="Devices"><B>Devices: </B></a></h1>
<I>They actually do something.</I><BR>
@@ -1,80 +1,3 @@
/obj/item/storage/box/syndicate/
New()
..()
switch (pickweight(list("bloodyspai" = 1, "stealth" = 1, "screwed" = 1, "guns" = 1, "murder" = 1, "freedom" = 1, "hacker" = 1, "lordsingulo" = 1, "smoothoperator" = 1)))
if("bloodyspai")
new /obj/item/clothing/under/chameleon(src)
new /obj/item/clothing/mask/gas/voice(src)
new /obj/item/card/id/syndicate(src)
new /obj/item/clothing/shoes/syndigaloshes(src)
return
if("stealth")
new /obj/item/gun/energy/crossbow(src)
new /obj/item/pen/reagent/healing(src)
new /obj/item/pen/reagent/pacifier(src)
new /obj/item/pen/reagent/hyperzine(src)
new /obj/item/pen/reagent/poison(src)
new /obj/item/device/chameleon(src)
return
if("screwed")
new /obj/effect/spawner/newbomb/timer/syndicate(src)
new /obj/effect/spawner/newbomb/timer/syndicate(src)
new /obj/item/device/powersink(src)
new /obj/item/clothing/suit/space/syndicate(src)
new /obj/item/clothing/head/helmet/space/syndicate(src)
new /obj/item/clothing/mask/gas/syndicate(src)
new /obj/item/tank/emergency_oxygen/double(src)
return
if("guns")
new /obj/item/gun/projectile/revolver(src)
new /obj/item/ammo_magazine/a357(src)
new /obj/item/card/emag(src)
new /obj/item/plastique(src)
new /obj/item/plastique(src)
return
if("murder")
new /obj/item/melee/energy/sword(src)
new /obj/item/clothing/glasses/thermal/syndi(src)
new /obj/item/card/emag(src)
new /obj/item/clothing/shoes/syndigaloshes(src)
return
if("freedom")
var/obj/item/implanter/O = new /obj/item/implanter(src)
O.imp = new /obj/item/implant/freedom(O)
var/obj/item/implanter/U = new /obj/item/implanter(src)
U.imp = new /obj/item/implant/uplink(U)
return
if("hacker")
new /obj/item/device/encryptionkey/syndicate(src)
new /obj/item/aiModule/syndicate(src)
new /obj/item/card/emag(src)
new /obj/item/device/encryptionkey/binary(src)
return
if("lordsingulo")
new /obj/item/device/radio/beacon/syndicate(src)
new /obj/item/clothing/suit/space/syndicate(src)
new /obj/item/clothing/head/helmet/space/syndicate(src)
new /obj/item/clothing/mask/gas/syndicate(src)
new /obj/item/tank/emergency_oxygen/double(src)
new /obj/item/card/emag(src)
return
if("smoothoperator")
new /obj/item/storage/box/syndie_kit/g9mm(src)
new /obj/item/storage/bag/trash(src)
new /obj/item/soap/syndie(src)
new /obj/item/bodybag(src)
new /obj/item/clothing/under/suit_jacket(src)
new /obj/item/clothing/shoes/laceup(src)
return
/obj/item/storage/box/syndie_kit
name = "box"
desc = "A sleek, sturdy box"
+1 -1
View File
@@ -546,7 +546,7 @@
. = ..()
allowed_mobs = list(
/mob/living/simple_animal/hostile/retaliate/goat, /mob/living/simple_animal/cow, /mob/living/simple_animal/corgi/fox,
/mob/living/simple_animal/hostile/carp, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/alien, /mob/living/simple_animal/hostile/giant_spider,
/mob/living/simple_animal/hostile/carp, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/giant_spider,
/mob/living/simple_animal/hostile/commanded/dog, /mob/living/simple_animal/hostile/retaliate/cavern_dweller, /mob/living/carbon/human,
/mob/living/simple_animal/pig)
+4 -77
View File
@@ -1,8 +1,8 @@
/obj/structure/banner
name = "corporate banner"
desc = "A blue flag emblazoned with a golden logo of NanoTrasen hanging from a wooden stand."
anchored = 1
density = 1
anchored = TRUE
density = TRUE
layer = 9
var/icon_up = "banner_up"
icon = 'icons/obj/banner.dmi'
@@ -38,87 +38,14 @@
/obj/structure/banner/unmovable/attackby(obj/item/W, mob/user)
return
//////////////////////////////Cola's cool religious banners/////////////////////////////////////////////////////////
/obj/structure/banner/sunbro
name = "sun banner"
desc = "A banner depicting a blazing sun. You feel the urge to praise it."
icon_state = "sunbro_down"
icon_up = "sunbro_up" //Thank you for all the help Abby
/obj/structure/banner/anime
name = "kawaii banner"
desc = "Just... why what's wrong with you?"
icon_state = "dankmaymays_down"
icon_up = "dankmaymays_up"
/obj/structure/banner/christian
name = "crucifix banner"
desc = "A banner depicting a crucifix the symbol of christianity."
icon_state = "crucifix_down"
icon_up = "crucifix_up"
/obj/structure/banner/jewish
name = "star of david banner"
desc = "A banner depicting the star of david the symbol of Judaism."
icon_state = "starofdavid_down"
icon_up = "starofdavid_up"
/obj/structure/banner/muslim
name = "moon and star banner"
desc = "A banner depicting the moon and star the symbol of Islam."
icon_state = "moonandstar_down"
icon_up = "moonandstar_up"
/obj/structure/banner/buddhist
name = "dharmachakra banner"
desc = "A banner depicting the Dharmachakra a symbol of Buddhism."
icon_state = "dharmachakra_down"
icon_up = "dharmachakra_up"
/obj/structure/banner/hindu
name = "aum banner"
desc = "A banner depicting the aum a symbol of Hinduism."
icon_state = "aum_down"
icon_up = "aum_up"
/obj/structure/banner/sikh
name = "khanda banner"
desc = "A banner depicting the khanda the symbol of sikhism."
icon_state = "khanda_down"
icon_up = "khanda_up"
/obj/structure/banner/tengri
name = "tengri crescent banner"
desc = "A banner depicting the tengri crescent the symbol of the tengri faith."
icon_state = "tengricrescent_down"
icon_up = "tengricrescent_up"
/obj/structure/banner/orthodox
name = "orthodox cross banner"
desc = "A banner depicting the orthodox cross the symbol of orthodox christianity."
icon_state = "orthodoxcross_down"
icon_up = "orthodoxcross_up"
/obj/structure/banner/knightshospitaller
name = "knights hospitaller banner"
desc = "Deus vult. Non nobis domine!"
icon_state = "hospitallercross_down"
icon_up = "hospitallercross_up"
//////////////////////////////MarauderW's banners/////////////////////////////////////////////////////////
/obj/structure/banner/newgibson
name = "new gibson banner"
name = "\improper New Gibson banner"
desc = "A banner depicting the flag of New Gibson."
icon_state = "newgibson_down"
icon_up = "newgibson_up"
/obj/structure/banner/scc
name = "Stellar Corporate Conglomerate banner"
name = "\improper Stellar Corporate Conglomerate banner"
desc = "A deep blue banner adorned with the logo of the Stellar Corporate Conglomerate."
desc_extended = "The Stellar Corporate Conglomerate, also known as Chainlink, is a joint alliance between the NanoTrasen Corporation, Hephaestus Industries, Idris Incorporated, Zeng-Hu Pharmaceuticals and Zavodskoi Interstellar to exercise an undisputed economic dominance over the Orion Spur."
icon_state = "scc_banner_down"
@@ -1,611 +0,0 @@
// Basic transit tubes. Straight pieces, curved sections,
// and basic splits/joins (no routing logic).
// Mappers: you can use "Generate Instances from Icon-states"
// to get the different pieces.
/obj/structure/transit_tube
icon = 'icons/obj/pipes/transit_tube.dmi'
icon_state = "E-W"
density = 1
layer = 3.1
anchored = 1.0
var/list/tube_dirs = null
var/exit_delay = 2
var/enter_delay = 1
// alldirs in global.dm is the same list of directions, but since
// the specific order matters to get a usable icon_state, it is
// copied here so that, in the unlikely case that alldirs is changed,
// this continues to work.
var/global/list/tube_dir_list = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
// 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
icon = 'icons/obj/pipes/transit_tube_station.dmi'
icon_state = "closed"
exit_delay = 2
enter_delay = 3
var/pod_moving = 0
var/automatic_launch_time = 100
var/const/OPEN_DURATION = 6
var/const/CLOSE_DURATION = 6
/obj/structure/transit_tube_pod
icon = 'icons/obj/pipes/transit_tube_pod.dmi'
icon_state = "pod"
animate_movement = FORWARD_STEPS
anchored = 1.0
density = 1
var/moving = 0
var/datum/gas_mixture/air_contents = new()
/obj/structure/transit_tube_pod/Destroy()
for(var/atom/movable/AM in contents)
AM.forceMove(loc)
return ..()
// When destroyed by explosions, properly handle contents.
obj/structure/ex_act(severity)
switch(severity)
if(1.0)
for(var/atom/movable/AM in contents)
AM.forceMove(loc)
AM.ex_act(severity++)
qdel(src)
return
if(2.0)
if(prob(50))
for(var/atom/movable/AM in contents)
AM.forceMove(loc)
AM.ex_act(severity++)
qdel(src)
return
if(3.0)
return
/obj/structure/transit_tube_pod/New(loc)
..(loc)
air_contents.adjust_multi(GAS_OXYGEN, MOLES_O2STANDARD * 2, GAS_NITROGEN, MOLES_N2STANDARD)
air_contents.temperature = T20C
// Give auto tubes time to align before trying to start moving
spawn(5)
follow_tube()
/obj/structure/transit_tube/New(loc)
..(loc)
if(tube_dirs == null)
init_dirs()
/obj/structure/transit_tube/CollidedWith(mob/AM as mob|obj)
var/obj/structure/transit_tube/T = locate() in AM.loc
if(T)
to_chat(AM, "<span class='warning'>The tube's support pylons block your way.</span>")
return ..()
else
AM.forceMove(src.loc)
to_chat(AM, "<span class='info'>You slip under the tube.</span>")
/obj/structure/transit_tube/station/New(loc)
..(loc)
/obj/structure/transit_tube/station/CollidedWith(mob/AM as mob|obj)
if(!pod_moving && icon_state == "open" && istype(AM, /mob))
for(var/obj/structure/transit_tube_pod/pod in loc)
if(pod.contents.len)
to_chat(AM, "<span class='notice'>The pod is already occupied.</span>")
return
else if(!pod.moving && (pod.dir in directions()))
AM.forceMove(pod)
return
/obj/structure/transit_tube/station/attack_hand(mob/user as mob)
if(!pod_moving)
for(var/obj/structure/transit_tube_pod/pod in loc)
if(!pod.moving && (pod.dir in directions()))
if(icon_state == "closed")
open_animation()
else if(icon_state == "open")
close_animation()
/obj/structure/transit_tube/station/proc/open_animation()
if(icon_state == "closed")
icon_state = "opening"
spawn(OPEN_DURATION)
if(icon_state == "opening")
icon_state = "open"
/obj/structure/transit_tube/station/proc/close_animation()
if(icon_state == "open")
icon_state = "closing"
spawn(CLOSE_DURATION)
if(icon_state == "closing")
icon_state = "closed"
/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)
pod_moving = 1
close_animation()
sleep(CLOSE_DURATION + 2)
//reverse directions for automated cycling
var/turf/next_loc = get_step(loc, pod.dir)
var/obj/structure/transit_tube/nexttube
for(var/obj/structure/transit_tube/tube in next_loc)
if(tube.has_entrance(pod.dir))
nexttube = tube
break
if(!nexttube)
pod.set_dir(turn(pod.dir, 180))
if(icon_state == "closed" && pod)
pod.follow_tube()
pod_moving = 0
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
/obj/structure/transit_tube/station/should_stop_pod(pod, from_dir)
return 1
// Called when a pod stops in this tube section.
/obj/structure/transit_tube/proc/pod_stopped(pod, from_dir)
return
/obj/structure/transit_tube/station/pod_stopped(obj/structure/transit_tube_pod/pod, from_dir)
pod_moving = 1
spawn(5)
open_animation()
sleep(OPEN_DURATION + 2)
pod_moving = 0
pod.mix_air()
if(automatic_launch_time)
var/const/wait_step = 5
var/i = 0
while(i < automatic_launch_time)
sleep(wait_step)
i += wait_step
if(pod_moving || icon_state != "open")
return
launch_pod()
// Returns a /list of directions this tube section can connect to.
// Tubes that have some sort of logic or changing direction might
// override it with additional logic.
/obj/structure/transit_tube/proc/directions()
return tube_dirs
/obj/structure/transit_tube/proc/has_entrance(from_dir)
from_dir = turn(from_dir, 180)
for(var/direction in directions())
if(direction == from_dir)
return 1
return 0
/obj/structure/transit_tube/proc/has_exit(in_dir)
for(var/direction in directions())
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 directions())
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_pod/proc/follow_tube()
if(moving)
return
moving = 1
spawn()
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)
set_dir(next_dir)
Move(get_step(loc, dir)) // Allow collisions when leaving the tubes.
break
last_delay = current_tube.enter_delay(src, next_dir)
sleep(last_delay)
set_dir(next_dir)
loc = 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 = 1
// If the pod is no longer in a tube, move in a line until stopped or slowed to a halt.
// /turf/inertial_drift appears to only work on mobs, and re-implementing some of the
// logic allows a gradual slowdown and eventual stop when passing over non-space turfs.
if(!current_tube && last_delay <= 10)
do
sleep(last_delay)
if(!istype(loc, /turf/space))
last_delay++
if(last_delay > 10)
break
while(isturf(loc) && Move(get_step(loc, dir)))
moving = 0
/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)
// Called when a pod arrives at, and before a pod departs from a station,
// giving it a chance to mix its internal air supply with the turf it is
// currently on.
/obj/structure/transit_tube_pod/proc/mix_air()
if(!loc) return
var/datum/gas_mixture/environment = loc.return_air()
//note that share_ratio assumes both gas mixes have the same volume,
//so if the volume is changed this may need to be changed as well.
air_contents.share_ratio(environment, 1)
// When the player moves, check if the pos is currently stopped at a station.
// if it is, check the direction. If the direction matches the direction of
// the station, try to exit. If the direction matches one of the station's
// tube directions, launch the pod in that direction.
/obj/structure/transit_tube_pod/relaymove(mob/mob, direction)
if(istype(mob, /mob) && mob.client)
// If the pod is not in a tube at all, you can get out at any time.
if(!(locate(/obj/structure/transit_tube) in loc))
mob.forceMove(loc)
mob.client.Move(get_step(loc, direction), direction)
//if(moving && istype(loc, /turf/space))
// Todo: If you get out of a moving pod in space, you should move as well.
// Same direction as pod? Direcion you moved? Halfway between?
if(!moving)
for(var/obj/structure/transit_tube/station/station in loc)
if(dir in station.directions())
if(!station.pod_moving)
if(direction == station.dir)
if(station.icon_state == "open")
mob.forceMove(loc)
mob.client.Move(get_step(loc, direction), direction)
else
station.open_animation()
else if(direction in station.directions())
set_dir(direction)
station.launch_pod()
return
for(var/obj/structure/transit_tube/tube in loc)
if(dir in tube.directions())
if(tube.has_exit(direction))
set_dir(direction)
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
// variations. Additionally, as a separate proc, sub-types
// can handle it more intelligently.
/obj/structure/transit_tube/proc/init_dirs()
if(icon_state == "auto")
// Additional delay, for map loading.
spawn(1)
init_dirs_automatic()
else
tube_dirs = parse_dirs(icon_state)
if(copytext(icon_state, 1, 3) == "D-" || findtextEx(icon_state, "Pass"))
density = 0
// Tube station directions are simply 90 to either side of
// the exit.
/obj/structure/transit_tube/station/init_dirs()
tube_dirs = list(turn(dir, 90), turn(dir, -90))
// Initialize dirs by searching for tubes that do/might connect
// on nearby turfs. Create corner pieces if nessecary.
// Pick two directions, preferring tubes that already connect
// to loc, or other auto tubes if there aren't enough connections.
/obj/structure/transit_tube/proc/init_dirs_automatic()
var/list/connected = list()
var/list/connected_auto = list()
for(var/direction in tube_dir_list)
var/location = get_step(loc, direction)
for(var/obj/structure/transit_tube/tube in location)
if(tube.directions() == null && tube.icon_state == "auto")
connected_auto += direction
break
else if(turn(direction, 180) in tube.directions())
connected += direction
break
connected += connected_auto
tube_dirs = select_automatic_dirs(connected)
if(length(tube_dirs) == 2 && tube_dir_list.Find(tube_dirs[1]) > tube_dir_list.Find(tube_dirs[2]))
tube_dirs.Swap(1, 2)
generate_automatic_corners(tube_dirs)
select_automatic_icon_state(tube_dirs)
// Given a list of directions, look a pair that forms a 180 or
// 135 degree angle, and return a list containing the pair.
// If none exist, return list(connected[1], turn(connected[1], 180)
/obj/structure/transit_tube/proc/select_automatic_dirs(connected)
if(length(connected) < 1)
return list()
for(var/i = 1, i <= length(connected), i++)
for(var/j = i + 1, j <= length(connected), j++)
var/d1 = connected[i]
var/d2 = connected[j]
if(d1 == turn(d2, 135) || d1 == turn(d2, 180) || d1 == turn(d2, 225))
return list(d1, d2)
return list(connected[1], turn(connected[1], 180))
/obj/structure/transit_tube/proc/select_automatic_icon_state(directions)
if(length(directions) == 2)
icon_state = "[dir2text_short(directions[1])]-[dir2text_short(directions[2])]"
// Look for diagonal directions, generate the decorative corners in each.
/obj/structure/transit_tube/proc/generate_automatic_corners(directions)
for(var/direction in directions)
if(direction == 5 || direction == 6 || direction == 9 || direction == 10)
if(direction & NORTH)
create_automatic_decorative_corner(get_step(loc, NORTH), direction ^ 3)
else
create_automatic_decorative_corner(get_step(loc, SOUTH), direction ^ 3)
if(direction & EAST)
create_automatic_decorative_corner(get_step(loc, EAST), direction ^ 12)
else
create_automatic_decorative_corner(get_step(loc, WEST), direction ^ 12)
// Generate a corner, if one doesn't exist for the direction on the turf.
/obj/structure/transit_tube/proc/create_automatic_decorative_corner(location, direction)
var/state = "D-[dir2text_short(direction)]"
for(var/obj/structure/transit_tube/tube in location)
if(tube.icon_state == state)
return
var/obj/structure/transit_tube/tube = new(location)
tube.icon_state = state
tube.init_dirs()
// Uses a list() to cache return values. Since they should
// never be edited directly, all tubes with a certain
// icon_state can just reference the same list. In theory,
// reduces memory usage, and improves CPU cache usage.
// In reality, I don't know if that is quite how BYOND works,
// but it is probably safer to assume the existence of, and
// rely on, a sufficiently smart compiler/optimizer.
/obj/structure/transit_tube/proc/parse_dirs(text)
var/global/list/direction_table = list()
if(text in direction_table)
return direction_table[text]
var/list/split_text = text2list(text, "-")
// If the first token is D, the icon_state represents
// a purely decorative tube, and doesn't actually
// connect to anything.
if(split_text[1] == "D")
direction_table[text] = list()
return null
var/list/directions = list()
for(var/text_part in split_text)
var/direction = text2dir_extended(text_part)
if(direction > 0)
directions += direction
direction_table[text] = directions
return directions
// A copy of text2dir, extended to accept one and two letter
// directions, and to clearly return 0 otherwise.
/obj/structure/transit_tube/proc/text2dir_extended(direction)
switch(uppertext(direction))
if("NORTH", "N")
return 1
if("SOUTH", "S")
return 2
if("EAST", "E")
return 4
if("WEST", "W")
return 8
if("NORTHEAST", "NE")
return 5
if("NORTHWEST", "NW")
return 9
if("SOUTHEAST", "SE")
return 6
if("SOUTHWEST", "SW")
return 10
else
return 0
// A copy of dir2text, which returns the short one or two letter
// directions used in tube icon states.
/obj/structure/transit_tube/proc/dir2text_short(direction)
switch(direction)
if(1)
return "N"
if(2)
return "S"
if(4)
return "E"
if(8)
return "W"
if(5)
return "NE"
if(6)
return "SE"
if(9)
return "NW"
if(10)
return "SW"
else
return