[MIRROR] Tramstation: choo choo MORE MAP COMIN' THROUH (#4083)

* Tramstation: choo choo MORE MAP COMIN' THROUH

* Tramstation: Skyrat Edition (#4104)

* Decals Fixed

* Modularity? Whatever

* Fuck me if I need to make a second PR for this

* Blueshield + Cryo + Ian Fursuit

* Automatic changelog generation for PR #4104 [ci skip]

Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
Co-authored-by: Cheshify <73589390+Cheshify@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-12 23:19:38 +00:00
committed by GitHub
co-authored by MMMiracles Cheshify
parent 565ba9a717
commit 84f6558402
37 changed files with 409257 additions and 13 deletions
+21
View File
@@ -273,3 +273,24 @@
/obj/structure/fluff/hedge/opaque //useful for mazes and such
opacity = TRUE
/obj/structure/fluff/tram_rail
name = "tram railing"
desc = "Great for trams, not so great for skating."
icon = 'icons/obj/tram_railing.dmi'
icon_state = "rail"
layer = MID_TURF_LAYER
plane = FLOOR_PLANE
deconstructible = TRUE
/obj/structure/fluff/tram_rail/floor
icon_state = "rail_floor"
/obj/structure/fluff/tram_rail/end
icon_state = "railend"
/obj/structure/fluff/tram_rail/anchor
name = "tram railing anchor"
icon_state = "anchor"
+4
View File
@@ -100,6 +100,10 @@
flags_1 = RAD_PROTECT_CONTENTS_1 | RAD_NO_CONTAMINATE_1
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/holosign/barrier/atmos/sturdy
name = "sturdy holofirelock"
max_integrity = 150
/obj/structure/holosign/barrier/atmos/Initialize()
. = ..()
air_update_turf(TRUE, TRUE)
+162 -9
View File
@@ -74,6 +74,7 @@
var/min_x = world.maxx
var/min_y = world.maxy
set_controls(LOCKED)
for(var/p in lift_platforms)
var/obj/structure/industrial_lift/lift_platform = p
@@ -90,12 +91,12 @@
//Go along the Y axis from max to min, from up to down
for(var/y in max_y to min_y step -1)
var/obj/structure/industrial_lift/lift_platform = locate(/obj/structure/industrial_lift, locate(x, y, z))
lift_platform.travel(going)
lift_platform?.travel(going)
else
//Go along the Y axis from min to max, from down to up
for(var/y in min_y to max_y)
var/obj/structure/industrial_lift/lift_platform = locate(/obj/structure/industrial_lift, locate(x, y, z))
lift_platform.travel(going)
lift_platform?.travel(going)
else
//Go along the X axis from max to min, from right to left
for(var/x in max_x to min_x step -1)
@@ -103,12 +104,12 @@
//Go along the Y axis from max to min, from up to down
for(var/y in max_y to min_y step -1)
var/obj/structure/industrial_lift/lift_platform = locate(/obj/structure/industrial_lift, locate(x, y, z))
lift_platform.travel(going)
lift_platform?.travel(going)
else
//Go along the Y axis from min to max, from down to up
for(var/y in min_y to max_y)
var/obj/structure/industrial_lift/lift_platform = locate(/obj/structure/industrial_lift, locate(x, y, z))
lift_platform.travel(going)
lift_platform?.travel(going)
set_controls(UNLOCKED)
///Check destination turfs
@@ -163,6 +164,7 @@ GLOBAL_LIST_EMPTY(lifts)
RegisterSignal(src, COMSIG_MOVABLE_CROSSED, .proc/AddItemOnLift)
RegisterSignal(loc, COMSIG_ATOM_CREATED, .proc/AddItemOnLift)//For atoms created on platform
RegisterSignal(src, COMSIG_MOVABLE_UNCROSSED, .proc/RemoveItemFromLift)
RegisterSignal(src, COMSIG_MOVABLE_BUMP, .proc/GracefullyBreak)
if(!lift_master_datum)
lift_master_datum = new(src)
@@ -179,11 +181,33 @@ GLOBAL_LIST_EMPTY(lifts)
UnregisterSignal(AM, COMSIG_PARENT_QDELETING)
/obj/structure/industrial_lift/proc/AddItemOnLift(datum/source, atom/movable/AM)
if(istype(AM, /obj/structure/fluff/tram_rail))
return
if(AM in lift_load)
return
LAZYADD(lift_load, AM)
RegisterSignal(AM, COMSIG_PARENT_QDELETING, .proc/RemoveItemFromLift)
/**
* Signal for when the tram runs into a field of which it cannot go through.
* Stops the train's travel fully, sends a message, and destroys the train.
* Arguments:
* bumped_atom - The atom this tram bumped into
*/
/obj/structure/industrial_lift/proc/GracefullyBreak(atom/bumped_atom)
SIGNAL_HANDLER
if(istype(bumped_atom, /obj/machinery/field))
return
bumped_atom.visible_message("<span class='userdanger'>[src] crashes into the field violently!</span>")
for(var/obj/structure/industrial_lift/tram/tram_part as anything in lift_master_datum.lift_platforms)
tram_part.travel_distance = 0
tram_part.travelling = FALSE
if(prob(15) || locate(/mob/living) in tram_part.lift_load) //always go boom on people on the track
explosion(get_turf(tram_part),rand(0,1),2,3) //50% chance of gib
qdel(tram_part)
/obj/structure/industrial_lift/proc/lift_platform_expansion(datum/lift_master/lift_master_datum)
. = list()
for(var/direction in GLOB.cardinals)
@@ -199,17 +223,46 @@ GLOBAL_LIST_EMPTY(lifts)
destination = get_step_multiz(src, going)
else
destination = going
if(going == DOWN)//make sure this stays pre-item moving, or you'll crush anything on the lift under the lift.
if(going == DOWN)
for(var/mob/living/crushed in destination.contents)
to_chat(crushed, "<span class='userdanger'>You are crushed by [src]!</span>")
crushed.gib(FALSE,FALSE,FALSE)//the nicest kind of gibbing, keeping everything intact.
else if(going != UP) //can't really crush something upwards
for(var/obj/structure/anchortrouble in destination.contents)
if(!QDELETED(anchortrouble) && anchortrouble.anchored && (!istype(anchortrouble, /obj/structure/holosign)) && anchortrouble.layer >= GAS_PUMP_LAYER) //to avoid pipes, wires, etc
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
visible_message("<span class='notice'>[src] smashes through [anchortrouble]!</span>")
anchortrouble.deconstruct(FALSE)
for(var/mob/living/collided in destination.contents)
to_chat(collided, "<span class='userdanger'>[src] collides into you!</span>")
playsound(src, 'sound/effects/splat.ogg', 50, TRUE)
var/damage = rand(5,10)
collided.apply_damage(2*damage, BRUTE, BODY_ZONE_HEAD)
collided.apply_damage(2*damage, BRUTE, BODY_ZONE_CHEST)
collided.apply_damage(0.5*damage, BRUTE, BODY_ZONE_L_LEG)
collided.apply_damage(0.5*damage, BRUTE, BODY_ZONE_R_LEG)
collided.apply_damage(0.5*damage, BRUTE, BODY_ZONE_L_ARM)
collided.apply_damage(0.5*damage, BRUTE, BODY_ZONE_R_ARM)
if(QDELETED(collided)) //in case it was a mob that dels on death
continue
var/turf/T = get_turf(src)
T.add_mob_blood(collided)
collided.throw_at()
//if going EAST, will turn to the NORTHEAST or SOUTHEAST and throw the ran over guy away
var/atom/throw_target = get_edge_target_turf(collided, turn(going, pick(45, -45)))
collided.throw_at(throw_target, 200, 4)
forceMove(destination)
for(var/am in things2move)
if(isnull(am))
LAZYREMOVE(lift_load, am)//after enough use, one of these always ends up inside despite signals. when they show, we need to scrub them out.
continue
var/atom/movable/thing = am
thing.forceMove(destination)
/obj/structure/industrial_lift/proc/use(mob/user, is_ghost=FALSE)
if(is_ghost && !in_range(src, user))
/obj/structure/industrial_lift/proc/use(mob/living/user)
if(!isliving(user) || !in_range(src, user) || user.combat_mode)
return
var/list/tool_list = list()
@@ -226,8 +279,8 @@ GLOBAL_LIST_EMPTY(lifts)
add_fingerprint(user)
return
var/result = show_radial_menu(user, src, tool_list, custom_check = CALLBACK(src, .proc/check_menu, user), require_near = TRUE, tooltips = TRUE)
if(!is_ghost && !in_range(src, user))
return // nice try
if(!isliving(user) || !in_range(src, user) || user.combat_mode)
return //nice try
switch(result)
if("Up")
lift_master_datum.MoveLift(UP, user)
@@ -338,3 +391,103 @@ GLOBAL_LIST_EMPTY(lifts)
return
add_fingerprint(user)
/obj/structure/industrial_lift/tram
name = "tram"
desc = "A tram for traversing the station."
icon = 'icons/turf/floors.dmi'
icon_state = "titanium_yellow"
base_icon_state = null
smoothing_flags = NONE
smoothing_groups = null
canSmoothWith = null
//kind of a centerpiece of the station, so pretty tough to destroy
armor = list(MELEE = 80, BULLET = 80, LASER = 80, ENERGY = 80, BOMB = 100, BIO = 80, RAD = 80, FIRE = 100, ACID = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
var/travelling = FALSE
var/travel_distance = 0
///for finding the landmark initially - should be the exact same as the landmark's destination id.
var/initial_id = "middle_part"
var/obj/effect/landmark/tram/from_where
var/travel_direction
var/time_inbetween_moves = 1
/obj/structure/industrial_lift/tram/central//that's a surprise tool that can help us later
/obj/structure/industrial_lift/tram/LateInitialize()
. = ..()
find_our_location()
/obj/structure/industrial_lift/tram/proc/find_our_location()
if(!from_where)
for(var/obj/effect/landmark/tram/our_location in GLOB.landmarks_list)
if(our_location.destination_id == initial_id)
from_where = our_location
break
/obj/structure/industrial_lift/tram/central/find_our_location() //the tram knows where it is by knowing where it isn't
..()
for(var/location in lift_master_datum.lift_platforms)
var/obj/structure/industrial_lift/tram/tram_location = location
var/turf/turf = get_turf(src)
var/where_we_are = locate(/obj/effect/landmark/tram) in turf.contents
if(where_we_are)
tram_location.from_where = where_we_are //this gets set by the tram movement too but this actually makes sure we're at the dock we were moved to to prevent blender mode
/obj/structure/industrial_lift/tram/use(mob/user) //dont click the floor dingus we use computers now
return
/obj/structure/industrial_lift/tram/process(delta_time)
if(!travel_distance)
addtimer(CALLBACK(src, .proc/unlock_controls), 3 SECONDS)
return PROCESS_KILL
else
travel_distance--
lift_master_datum.MoveLiftHorizontal(travel_direction, z)
/obj/structure/industrial_lift/tram/proc/tram_travel(obj/effect/landmark/tram/from_where, obj/effect/landmark/tram/to_where)
visible_message("<span class='notice'>[src] has been called to the [to_where]!</span")
lift_master_datum.set_controls(LOCKED)
for(var/obj/structure/industrial_lift/tram/other_tram_part as anything in lift_master_datum.lift_platforms) //only thing everyone needs to know is the new location.
if(other_tram_part.travelling) //wee woo wee woo there was a double action queued. damn multi tile structs
return //we don't care to undo locked controls, though, as that will resolve itself
other_tram_part.travelling = TRUE
other_tram_part.from_where = to_where
travel_direction = get_dir(from_where, to_where)
travel_distance = get_dist(from_where, to_where)
//first movement is immediate
lift_master_datum.MoveLiftHorizontal(travel_direction, z)
travel_distance--
START_PROCESSING(SStramprocess, src)
/obj/structure/industrial_lift/tram/proc/unlock_controls()
visible_message("<span class='notice'>[src]'s controls are now unlocked.</span")
for(var/lift in lift_master_datum.lift_platforms) //only thing everyone needs to know is the new location.
var/obj/structure/industrial_lift/tram/other_tram_part = lift
other_tram_part.travelling = FALSE
other_tram_part.find_our_location()
lift_master_datum.set_controls(UNLOCKED)
/obj/effect/landmark/tram
name = "tram destination" //the tram buttons will mention this.
icon_state = "tram"
var/destination_id
///icons for the tgui console to list out for what is at this location
var/list/tgui_icons = list()
/obj/effect/landmark/tram/left_part
name = "West Wing"
destination_id = "left_part"
tgui_icons = list("Arrivals" = "plane-arrival", "Service" = "cocktail")
/obj/effect/landmark/tram/middle_part
name = "Central Wing"
destination_id = "middle_part"
tgui_icons = list("Command" = "bullhorn", "Security" = "gavel", "Medical" = "plus", "Engineering" = "wrench")
/obj/effect/landmark/tram/right_part
name = "East Wing"
destination_id = "right_part"
tgui_icons = list("Departures" = "plane-departure", "Cargo" = "box")
@@ -179,3 +179,11 @@
desc = "A warning sign which reads 'ESCAPE PODS'."
icon_state = "pods"
is_editable = TRUE
/obj/structure/sign/warning/radshelter
name = "\improper RADSTORM SHELTER sign"
sign_change_name = "Location - Radstorm Shelter"
desc = "A warning sign which reads 'RADSTORM SHELTER'."
icon_state = "radshelter"
is_editable = TRUE