[MIRROR] Tramstation Tram "Upgrades" (#6456)

* Tramstation Tram "Upgrades" (#59277)

The tram now smashes through walls instead of phasing through them. Spawns sparks and shakes the screen for nearby observers as the tram kool-aids its way through obstructions.
The tram now equal-opportunity smashes through most machinery and structures. If a structure is normally not anchored by default (girders, lockers, closets, ect), it will unanchor them and throw them while doing some damage. Machinery now actually gets destroyed when hit by the tram, which also fixes the issue with the recycler breaking the tram.
Tram platforms themselves have been made inherently indestructible to prevent them from ever breaking in any unexpected gameplay method.
The permabrig mouse has been moved to the general activity room instead of the room with the exposed APC wiring.

* Tramstation Tram "Upgrades"

Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
This commit is contained in:
SkyratBot
2021-06-22 23:37:08 +02:00
committed by GitHub
parent 0663425134
commit 9eaae7deea
2 changed files with 456 additions and 431 deletions
@@ -228,16 +228,44 @@ GLOBAL_LIST_EMPTY(lifts)
destination = get_step_multiz(src, going)
else
destination = going
if(istype(destination, /turf/closed/wall))
var/turf/closed/wall/C = destination
do_sparks(2, FALSE, C)
C.dismantle_wall(devastated = TRUE)
for(var/mob/M in urange(8, src))
shake_camera(M, 2, 3)
playsound(C, 'sound/effects/meteorimpact.ogg', 100, TRUE)
if(going == DOWN)
for(var/mob/living/crushed in destination.contents)
to_chat(crushed, span_userdanger("You are crushed by [src]!"))
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
var/atom/throw_target = get_edge_target_turf(src, turn(going, pick(45, -45))) //finds a spot to throw the victim at for daring to be hit by a tram
for(var/obj/structure/victimstructure in destination.contents)
if(QDELETED(victimstructure))
continue
if(!istype(victimstructure, /obj/structure/holosign) && victimstructure.layer >= LOW_OBJ_LAYER)
if(victimstructure.anchored && initial(victimstructure.anchored) == TRUE)
visible_message("<span class='danger'>[src] smashes through [victimstructure]!</span>")
victimstructure.deconstruct(FALSE)
else
visible_message("<span class='danger'>[src] violently rams [victimstructure] out of the way!</span>")
victimstructure.anchored = FALSE
victimstructure.take_damage(rand(20,25))
victimstructure.throw_at(throw_target, 200, 4)
for(var/obj/machinery/victimmachine in destination.contents)
if(QDELETED(victimmachine))
continue
if(istype(victimmachine, /obj/machinery/field)) //graceful break handles this scenario
continue
if(victimmachine.layer >= LOW_OBJ_LAYER) //avoids stuff that is probably flush with the ground
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
visible_message(span_notice("[src] smashes through [anchortrouble]!"))
anchortrouble.deconstruct(FALSE)
visible_message("<span class='danger'>[src] smashes through [victimmachine]!</span>")
qdel(victimmachine)
for(var/mob/living/collided in destination.contents)
to_chat(collided, span_userdanger("[src] collides into you!"))
playsound(src, 'sound/effects/splat.ogg', 50, TRUE)
@@ -256,7 +284,6 @@ GLOBAL_LIST_EMPTY(lifts)
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/atom/movable/thing as anything in things2move)
@@ -403,8 +430,7 @@ GLOBAL_LIST_EMPTY(lifts)
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
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
///set by the tram control console in late initialize
var/travelling = FALSE
var/travel_distance = 0