From 9d485405ff1f06d8c61e6af72305812a4b1d8b07 Mon Sep 17 00:00:00 2001 From: Morrow Date: Fri, 1 Sep 2023 23:12:11 -0400 Subject: [PATCH 1/6] Almost done --- code/game/gamemodes/cm_self_destruct.dm | 18 +- code/game/machinery/doors/multi_tile.dm | 4 +- code/modules/shuttle/computer.dm | 6 +- .../shuttle/computers/escape_pod_computer.dm | 12 +- .../shuttle/shuttles/crashable/crashable.dm | 157 ++++++++++++++++++ .../{ => crashable}/escape_shuttle.dm | 136 ++------------- .../{ => shuttles/crashable}/lifeboats.dm | 33 +++- colonialmarines.dme | 5 +- maps/shuttles/escape_shuttle_e.dmm | 2 +- maps/shuttles/escape_shuttle_e_cl.dmm | 2 +- maps/shuttles/escape_shuttle_n.dmm | 3 +- maps/shuttles/escape_shuttle_s.dmm | 2 +- maps/shuttles/escape_shuttle_w.dmm | 2 +- maps/shuttles/lifeboat-port-archive.dmm | 2 +- maps/shuttles/lifeboat-port.dmm | 2 +- maps/shuttles/lifeboat-starboard-archive.dmm | 2 +- maps/shuttles/lifeboat-starboard.dmm | 2 +- 17 files changed, 230 insertions(+), 160 deletions(-) create mode 100644 code/modules/shuttle/shuttles/crashable/crashable.dm rename code/modules/shuttle/shuttles/{ => crashable}/escape_shuttle.dm (56%) rename code/modules/shuttle/{ => shuttles/crashable}/lifeboats.dm (83%) diff --git a/code/game/gamemodes/cm_self_destruct.dm b/code/game/gamemodes/cm_self_destruct.dm index 8c022fd0d916..d2f9c4eac784 100644 --- a/code/game/gamemodes/cm_self_destruct.dm +++ b/code/game/gamemodes/cm_self_destruct.dm @@ -103,7 +103,7 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi for(var/obj/structure/machinery/status_display/SD in machines) if(is_mainship_level(SD.z)) SD.set_picture("evac") - for(var/obj/docking_port/mobile/escape_shuttle/shuttle in SSshuttle.mobile) + for(var/obj/docking_port/mobile/crashable/escape_shuttle/shuttle in SSshuttle.mobile) shuttle.prepare_evac() activate_lifeboats() process_evacuation() @@ -121,7 +121,7 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi if(is_mainship_level(SD.z)) SD.set_picture("redalert") - for(var/obj/docking_port/mobile/escape_shuttle/shuttle in SSshuttle.mobile) + for(var/obj/docking_port/mobile/crashable/escape_shuttle/shuttle in SSshuttle.mobile) shuttle.cancel_evac() return TRUE @@ -132,17 +132,17 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi ai_announcement("WARNING: Evacuation order confirmed. Launching escape pods.", 'sound/AI/evacuation_confirmed.ogg') addtimer(CALLBACK(src, PROC_REF(launch_lifeboats)), 10 SECONDS) // giving some time to board lifeboats - for(var/obj/docking_port/mobile/escape_shuttle/shuttle in SSshuttle.mobile) + for(var/obj/docking_port/mobile/crashable/escape_shuttle/shuttle in SSshuttle.mobile) shuttle.evac_launch() sleep(50) sleep(300) //Sleep 30 more seconds to make sure everyone had a chance to leave. var/lifesigns = 0 // lifesigns += P.passengers - var/obj/docking_port/mobile/lifeboat/lifeboat1 = SSshuttle.getShuttle(MOBILE_SHUTTLE_LIFEBOAT_PORT) + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat1 = SSshuttle.getShuttle(MOBILE_SHUTTLE_LIFEBOAT_PORT) lifeboat1.check_for_survivors() lifesigns += lifeboat1.survivors - var/obj/docking_port/mobile/lifeboat/lifeboat2 = SSshuttle.getShuttle(MOBILE_SHUTTLE_LIFEBOAT_STARBOARD) + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat2 = SSshuttle.getShuttle(MOBILE_SHUTTLE_LIFEBOAT_STARBOARD) lifeboat2.check_for_survivors() lifesigns += lifeboat2.survivors ai_announcement("ATTENTION: Evacuation complete. Outbound lifesigns detected: [lifesigns ? lifesigns : "none"].", 'sound/AI/evacuation_complete.ogg') @@ -166,7 +166,7 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi // LIFEBOATS CORNER /datum/authority/branch/evacuation/proc/activate_lifeboats() for(var/obj/docking_port/stationary/lifeboat_dock/lifeboat_dock in GLOB.lifeboat_almayer_docks) - var/obj/docking_port/mobile/lifeboat/lifeboat = lifeboat_dock.get_docked() + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = lifeboat_dock.get_docked() if(lifeboat && lifeboat.available) lifeboat.status = LIFEBOAT_ACTIVE lifeboat_dock.open_dock() @@ -174,15 +174,15 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi /datum/authority/branch/evacuation/proc/deactivate_lifeboats() for(var/obj/docking_port/stationary/lifeboat_dock/lifeboat_dock in GLOB.lifeboat_almayer_docks) - var/obj/docking_port/mobile/lifeboat/lifeboat = lifeboat_dock.get_docked() + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = lifeboat_dock.get_docked() if(lifeboat && lifeboat.available) lifeboat.status = LIFEBOAT_INACTIVE /datum/authority/branch/evacuation/proc/launch_lifeboats() for(var/obj/docking_port/stationary/lifeboat_dock/lifeboat_dock in GLOB.lifeboat_almayer_docks) - var/obj/docking_port/mobile/lifeboat/lifeboat = lifeboat_dock.get_docked() + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = lifeboat_dock.get_docked() if(lifeboat && lifeboat.available) - lifeboat.send_to_infinite_transit() + lifeboat.evac_launch() //========================================================================================= //========================================================================================= diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index da4ad01c086b..e6dccbdedbac 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -353,8 +353,8 @@ /obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override) . = ..() - if(istype(port, /obj/docking_port/mobile/lifeboat)) - var/obj/docking_port/mobile/lifeboat/lifeboat = port + if(istype(port, /obj/docking_port/mobile/crashable/lifeboat)) + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = port lifeboat.doors += src /// External airlock that is part of the lifeboat dock diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index a7d988e460e1..dcee92cfac06 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -284,7 +284,7 @@ /obj/structure/machinery/computer/shuttle/lifeboat/attack_hand(mob/user) . = ..() - var/obj/docking_port/mobile/lifeboat/lifeboat = SSshuttle.getShuttle(shuttleId) + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = SSshuttle.getShuttle(shuttleId) if(lifeboat.status == LIFEBOAT_LOCKED) to_chat(user, SPAN_WARNING("\The [src] flickers with error messages.")) else if(lifeboat.status == LIFEBOAT_INACTIVE) @@ -292,7 +292,7 @@ else if(lifeboat.status == LIFEBOAT_ACTIVE) switch(lifeboat.mode) if(SHUTTLE_IDLE) - to_chat(user, SPAN_NOTICE("\The [src]'s screen says \"Awaiting confirmation of the evacuation order\".")) + to_chat(user, SPAN_NOTICE("\The [src]'s screen says \"Awaiting confirmation of the evacuation order\".")) // Manual evac commands here - Morrow if(SHUTTLE_IGNITING) to_chat(user, SPAN_NOTICE("\The [src]'s screen says \"Engines firing\".")) if(SHUTTLE_CALL) @@ -300,7 +300,7 @@ /obj/structure/machinery/computer/shuttle/lifeboat/attack_alien(mob/living/carbon/xenomorph/xeno) if(xeno.caste && xeno.caste.is_intelligent) - var/obj/docking_port/mobile/lifeboat/lifeboat = SSshuttle.getShuttle(shuttleId) + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = SSshuttle.getShuttle(shuttleId) if(lifeboat.status == LIFEBOAT_LOCKED) to_chat(xeno, SPAN_WARNING("We already wrested away control of this metal bird.")) return XENO_NO_DELAY_ACTION diff --git a/code/modules/shuttle/computers/escape_pod_computer.dm b/code/modules/shuttle/computers/escape_pod_computer.dm index 99a989ab2e9f..1054bf5e90d7 100644 --- a/code/modules/shuttle/computers/escape_pod_computer.dm +++ b/code/modules/shuttle/computers/escape_pod_computer.dm @@ -39,7 +39,7 @@ /obj/structure/machinery/computer/shuttle/escape_pod_panel/ui_data(mob/user) . = list() - var/obj/docking_port/mobile/escape_shuttle/shuttle = SSshuttle.getShuttle(shuttleId) + var/obj/docking_port/mobile/crashable/escape_shuttle/shuttle = SSshuttle.getShuttle(shuttleId) if(pod_state == STATE_IDLE && shuttle.evac_set) pod_state = STATE_READY @@ -63,7 +63,7 @@ if(.) return - var/obj/docking_port/mobile/escape_shuttle/shuttle = SSshuttle.getShuttle(shuttleId) + var/obj/docking_port/mobile/crashable/escape_shuttle/shuttle = SSshuttle.getShuttle(shuttleId) switch(action) if("force_launch") shuttle.evac_launch() @@ -204,7 +204,7 @@ heat_proof = 1 unslashable = TRUE unacidable = TRUE - var/obj/docking_port/mobile/escape_shuttle/linked_shuttle + var/obj/docking_port/mobile/crashable/escape_shuttle/linked_shuttle /obj/structure/machinery/door/airlock/evacuation/Initialize() . = ..() @@ -229,16 +229,16 @@ /obj/structure/machinery/door/airlock/evacuation/attack_alien(mob/living/carbon/xenomorph/xeno) if(!density || unslashable) //doors become slashable after evac is called return FALSE - + if(xeno.claw_type < CLAW_TYPE_SHARP) to_chat(xeno, SPAN_WARNING("[src] is bolted down tight.")) return XENO_NO_DELAY_ACTION - + xeno.animation_attack_on(src) playsound(src, 'sound/effects/metalhit.ogg', 25, 1) take_damage(HEALTH_DOOR / XENO_HITS_TO_DESTROY_BOLTED_DOOR) return XENO_ATTACK_ACTION - + /obj/structure/machinery/door/airlock/evacuation/attack_remote() return FALSE diff --git a/code/modules/shuttle/shuttles/crashable/crashable.dm b/code/modules/shuttle/shuttles/crashable/crashable.dm new file mode 100644 index 000000000000..c6317e4321a4 --- /dev/null +++ b/code/modules/shuttle/shuttles/crashable/crashable.dm @@ -0,0 +1,157 @@ +/obj/docking_port/mobile/crashable + name = "crashable shuttle" + + /// Whether or not this shuttle is crash landing + var/crash_land = FALSE + /// Whether fires occur aboard the shuttle when crashing + var/fires_on_crash = FALSE + +/obj/docking_port/mobile/crashable/enterTransit() + . = ..() + + if(!crash_land) + return + + for(var/area/shuttle_area in shuttle_areas) + shuttle_area.flags_alarm_state |= ALARM_WARNING_FIRE + shuttle_area.updateicon() + for(var/mob/evac_mob in shuttle_area) + if(evac_mob.client) + playsound_client(evac_mob.client, 'sound/effects/bomb_fall.ogg', vol = 50) + + for(var/turf/found_turf as anything in destination.return_turfs()) + if(istype(found_turf, /turf/closed)) + found_turf.ChangeTurf(/turf/open/floor) + + for(var/mob/current_mob as anything in get_mobs_in_z_level_range(destination.return_center_turf(), 18)) + var/relative_dir = get_dir(current_mob, destination.return_center_turf()) + var/final_dir = dir2text(relative_dir) + to_chat(current_mob, SPAN_HIGHDANGER("You hear something crashing down from above [final_dir ? "to the [final_dir]" : "nearby"]!")) + + if(fires_on_crash) + handle_fires() + + //cell_explosion(destination.return_center_turf(), length(destination.return_turfs()) * 15, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data("evac pod crash")) - Remove this - Morrow + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), destination.return_center_turf(), length(destination.return_turfs()) * 5, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data("crashing shuttle")), 1.5 SECONDS) + +/obj/docking_port/mobile/crashable/on_prearrival() + . = ..() + + if(!crash_land) + return + + movement_force = list("KNOCKDOWN" = 0, "THROW" = 5) + + for(var/area/shuttle_area in shuttle_areas) + for(var/mob/evac_mob in shuttle_area) + shake_camera(evac_mob, 20, 2) + if(evac_mob.client) + playsound_client(evac_mob.client, get_sfx("bigboom"), vol = 50) + +/obj/docking_port/mobile/crashable/proc/evac_launch() + if(!crash_check()) + return + + create_crash_point() + +/obj/docking_port/mobile/crashable/proc/crash_check() + return FALSE + +/obj/docking_port/mobile/crashable/proc/create_crash_point() + for(var/i = 1 to 10) + var/list/all_ground_levels = SSmapping.levels_by_trait(ZTRAIT_GROUND) + var/ground_z_level = all_ground_levels[1] + + var/list/area/potential_areas = SSmapping.areas_in_z["[ground_z_level]"] + + var/area/area_picked = pick(potential_areas) + + var/list/potential_turfs = list() + + for(var/turf/turf_in_area in area_picked) + potential_turfs += turf_in_area + + if(!length(potential_turfs)) + continue + + var/turf/turf_picked = pick(potential_turfs) + + var/obj/docking_port/stationary/crashable/temp_escape_pod_port = new(turf_picked) + temp_escape_pod_port.width = width + temp_escape_pod_port.height = height + temp_escape_pod_port.id = id + + if(!check_crash_point(temp_escape_pod_port)) + qdel(temp_escape_pod_port) + continue + + destination = temp_escape_pod_port + break + + if(destination) + crash_land = TRUE + +/// Checks for anything that may get in the way of a crash, returns FALSE if there is something in the way or is out of bounds +/obj/docking_port/mobile/crashable/proc/check_crash_point(obj/docking_port/stationary/crashable/checked_escape_pod_port) + for(var/turf/found_turf as anything in checked_escape_pod_port.return_turfs()) + var/area/found_area = get_area(found_turf) + if(found_area.flags_area & AREA_NOTUNNEL) + return FALSE + + if(!found_area.can_build_special) + return FALSE + + if(istype(found_turf, /turf/closed/wall)) + var/turf/closed/wall/found_closed_turf = found_turf + if(found_closed_turf.hull) + return FALSE + + if(istype(found_turf, /turf/closed/shuttle)) + return FALSE + + return TRUE + +/// Forces the shuttle to crash, admin called +/obj/docking_port/mobile/crashable/proc/force_crash() + create_crash_point() + set_mode(SHUTTLE_IGNITING) + on_ignition() + setTimer(ignitionTime) + +/// Sets up and handles fires/explosions on crashing shuttles +/obj/docking_port/mobile/crashable/proc/handle_fires() + for(var/i = 1 to (length(destination.return_turfs()) / 25)) + var/turf/position = pick(destination.return_turfs()) + new /obj/effect/warning/explosive(position, 3 SECONDS) + playsound(src, 'sound/effects/pipe_hissing.ogg', vol = 40) + addtimer(CALLBACK(src, PROC_REF(kablooie), position), 3 SECONDS) + +/// Actually blows up the fire/explosion on crashing shuttles, used for effect delay +/obj/docking_port/mobile/crashable/proc/kablooie(turf/position) + var/new_cause_data = create_cause_data("crashing shuttle fire") + var/list/exploding_types = list(/obj/item/explosive/grenade/high_explosive/bursting_pipe, /obj/item/explosive/grenade/incendiary/bursting_pipe) + for(var/path in exploding_types) + var/obj/item/explosive/grenade/exploder = new path(get_turf(src)) + exploder.cause_data = new_cause_data + exploder.prime() + +/// Handles opening the doors for the specific shuttle type upon arriving at the crash point +/obj/docking_port/mobile/crashable/proc/open_doors() + return + +/obj/docking_port/stationary/crashable + name = "Crash Escape Pod Dock" + +/obj/docking_port/stationary/crashable/on_arrival(obj/docking_port/mobile/arriving_shuttle) + . = ..() + + if(istype(arriving_shuttle, /obj/docking_port/mobile/crashable)) + var/obj/docking_port/mobile/crashable/crashing_shuttle = arriving_shuttle + crashing_shuttle.open_doors() + + for(var/area/shuttle_area in arriving_shuttle.shuttle_areas) + shuttle_area.remove_base_lighting() + + shuttle_area.flags_alarm_state &= ~ALARM_WARNING_FIRE + shuttle_area.updateicon() + diff --git a/code/modules/shuttle/shuttles/escape_shuttle.dm b/code/modules/shuttle/shuttles/crashable/escape_shuttle.dm similarity index 56% rename from code/modules/shuttle/shuttles/escape_shuttle.dm rename to code/modules/shuttle/shuttles/crashable/escape_shuttle.dm index 941785e60d9d..6029d345b6d7 100644 --- a/code/modules/shuttle/shuttles/escape_shuttle.dm +++ b/code/modules/shuttle/shuttles/crashable/escape_shuttle.dm @@ -1,4 +1,4 @@ -/obj/docking_port/mobile/escape_shuttle +/obj/docking_port/mobile/crashable/escape_shuttle name = "Escape Pod" id = ESCAPE_SHUTTLE area_type = /area/shuttle/escape_pod @@ -17,10 +17,9 @@ var/datum/door_controller/single/door_handler = new() var/launched = FALSE - var/crash_land = FALSE var/evac_set = FALSE -/obj/docking_port/mobile/escape_shuttle/Initialize(mapload) +/obj/docking_port/mobile/crashable/escape_shuttle/Initialize(mapload) . = ..(mapload) for(var/place in shuttle_areas) for(var/obj/structure/machinery/door/airlock/evacuation/air in place) @@ -30,7 +29,7 @@ air.unacidable = TRUE air.linked_shuttle = src -/obj/docking_port/mobile/escape_shuttle/proc/cancel_evac() +/obj/docking_port/mobile/crashable/escape_shuttle/proc/cancel_evac() door_handler.control_doors("force-unlock") evac_set = FALSE @@ -42,7 +41,7 @@ for(var/obj/structure/machinery/cryopod/evacuation/cryotube in interior_area) cryotube.dock_state = STATE_IDLE -/obj/docking_port/mobile/escape_shuttle/proc/prepare_evac() +/obj/docking_port/mobile/crashable/escape_shuttle/proc/prepare_evac() door_handler.control_doors("force-unlock") evac_set = TRUE for(var/area/interior_area in shuttle_areas) @@ -54,8 +53,9 @@ air.unslashable = FALSE air.unacidable = FALSE +/obj/docking_port/mobile/crashable/escape_shuttle/evac_launch() + . = ..() -/obj/docking_port/mobile/escape_shuttle/proc/evac_launch() if(mode == SHUTTLE_CRASHED) return @@ -86,10 +86,6 @@ door_handler.control_doors("force-unlock") return - destination = null - if(prob((EvacuationAuthority.evac_status >= EVACUATION_STATUS_IN_PROGRESS ? crash_land_chance : early_crash_land_chance))) - create_crash_point() - set_mode(SHUTTLE_IGNITING) on_ignition() setTimer(ignitionTime) @@ -104,128 +100,44 @@ air.indestructible = TRUE air.unacidable = TRUE - -/obj/docking_port/mobile/escape_shuttle/proc/create_crash_point() - for(var/i = 1 to 10) - var/list/all_ground_levels = SSmapping.levels_by_trait(ZTRAIT_GROUND) - var/ground_z_level = all_ground_levels[1] - - var/list/area/potential_areas = SSmapping.areas_in_z["[ground_z_level]"] - - var/area/area_picked = pick(potential_areas) - - var/list/potential_turfs = list() - - for(var/turf/turf_in_area in area_picked) - potential_turfs += turf_in_area - - if(!length(potential_turfs)) - continue - - var/turf/turf_picked = pick(potential_turfs) - - var/obj/docking_port/stationary/escape_pod/crash_land/temp_escape_pod_port = new(turf_picked) - temp_escape_pod_port.width = width - temp_escape_pod_port.height = height - temp_escape_pod_port.id = id - - if(!check_crash_point(temp_escape_pod_port)) - qdel(temp_escape_pod_port) - continue - - destination = temp_escape_pod_port - break - - if(destination) - crash_land = TRUE - -/obj/docking_port/mobile/escape_shuttle/proc/check_crash_point(obj/docking_port/stationary/escape_pod/crash_land/checked_escape_pod_port) - for(var/turf/found_turf as anything in checked_escape_pod_port.return_turfs()) - var/area/found_area = get_area(found_turf) - if(found_area.flags_area & AREA_NOTUNNEL) - return FALSE - - if(!found_area.can_build_special) - return FALSE - - if(istype(found_turf, /turf/closed/wall)) - var/turf/closed/wall/found_closed_turf = found_turf - if(found_closed_turf.hull) - return FALSE - - if(istype(found_turf, /turf/closed/shuttle)) - return FALSE - - return TRUE - -/obj/docking_port/mobile/escape_shuttle/enterTransit() +/obj/docking_port/mobile/crashable/escape_shuttle/crash_check() . = ..() - if(!crash_land) - return - - for(var/area/shuttle_area in shuttle_areas) - shuttle_area.flags_alarm_state |= ALARM_WARNING_FIRE - shuttle_area.updateicon() - for(var/mob/evac_mob in shuttle_area) - if(evac_mob.client) - playsound_client(evac_mob.client, 'sound/effects/bomb_fall.ogg', vol = 50) - - for(var/turf/found_turf as anything in destination.return_turfs()) - if(istype(found_turf, /turf/closed)) - found_turf.ChangeTurf(/turf/open/floor) - - cell_explosion(destination.return_center_turf(), 300, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data("evac pod crash")) + if(prob((EvacuationAuthority.evac_status >= EVACUATION_STATUS_IN_PROGRESS ? crash_land_chance : early_crash_land_chance))) + return TRUE -/obj/docking_port/mobile/escape_shuttle/on_prearrival() +/obj/docking_port/mobile/crashable/escape_shuttle/open_doors() . = ..() - if(!crash_land) - return - - movement_force = list("KNOCKDOWN" = 0, "THROW" = 5) - - for(var/area/shuttle_area in shuttle_areas) - for(var/mob/evac_mob in shuttle_area) - shake_camera(evac_mob, 20, 2) - if(evac_mob.client) - playsound_client(evac_mob.client, get_sfx("bigboom"), vol = 50) - door_handler.control_doors("force-unlock") -/obj/docking_port/mobile/escape_shuttle/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) +/obj/docking_port/mobile/crashable/escape_shuttle/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) . = ..() playsound(src,'sound/effects/escape_pod_launch.ogg', 50, 1) -/obj/docking_port/mobile/escape_shuttle/proc/force_crash() - create_crash_point() - set_mode(SHUTTLE_IGNITING) - on_ignition() - setTimer(ignitionTime) - -/obj/docking_port/mobile/escape_shuttle/e +/obj/docking_port/mobile/crashable/escape_shuttle/e id = ESCAPE_SHUTTLE_EAST width = 4 height = 5 -/obj/docking_port/mobile/escape_shuttle/cl +/obj/docking_port/mobile/crashable/escape_shuttle/cl id = ESCAPE_SHUTTLE_EAST_CL width = 4 height = 5 early_crash_land_chance = 25 crash_land_chance = 5 -/obj/docking_port/mobile/escape_shuttle/w +/obj/docking_port/mobile/crashable/escape_shuttle/w id = ESCAPE_SHUTTLE_WEST width = 4 height = 5 -/obj/docking_port/mobile/escape_shuttle/n +/obj/docking_port/mobile/crashable/escape_shuttle/n id = ESCAPE_SHUTTLE_NORTH width = 5 height = 4 -/obj/docking_port/mobile/escape_shuttle/s +/obj/docking_port/mobile/crashable/escape_shuttle/s id = ESCAPE_SHUTTLE_SOUTH width = 5 height = 4 @@ -263,22 +175,6 @@ width = 4 height = 5 -/obj/docking_port/stationary/escape_pod/crash_land - name = "Crash Escape Pod Dock" - -/obj/docking_port/stationary/escape_pod/crash_land/on_arrival(obj/docking_port/mobile/arriving_shuttle) - . = ..() - - if(istype(arriving_shuttle, /obj/docking_port/mobile/escape_shuttle)) - var/obj/docking_port/mobile/escape_shuttle/escape_shuttle = arriving_shuttle - escape_shuttle.door_handler.control_doors("force-unlock") - - for(var/area/shuttle_area in arriving_shuttle.shuttle_areas) - shuttle_area.remove_base_lighting() - - shuttle_area.flags_alarm_state &= ~ALARM_WARNING_FIRE - shuttle_area.updateicon() - /datum/map_template/shuttle/escape_pod_w name = "Escape Pod W" shuttle_id = ESCAPE_SHUTTLE_WEST diff --git a/code/modules/shuttle/lifeboats.dm b/code/modules/shuttle/shuttles/crashable/lifeboats.dm similarity index 83% rename from code/modules/shuttle/lifeboats.dm rename to code/modules/shuttle/shuttles/crashable/lifeboats.dm index 36696441a961..b258a6a002b5 100644 --- a/code/modules/shuttle/lifeboats.dm +++ b/code/modules/shuttle/shuttles/crashable/lifeboats.dm @@ -1,7 +1,7 @@ // === MOBILES /// Generic Lifeboat definition -/obj/docking_port/mobile/lifeboat +/obj/docking_port/mobile/crashable/lifeboat name = "lifeboat" area_type = /area/shuttle/lifeboat ignitionTime = 10 SECONDS @@ -12,7 +12,9 @@ var/list/doors = list() var/survivors = 0 -/obj/docking_port/mobile/lifeboat/proc/check_for_survivors() + fires_on_crash = TRUE + +/obj/docking_port/mobile/crashable/lifeboat/proc/check_for_survivors() for(var/mob/living/carbon/human/survived_human as anything in GLOB.alive_human_list) //check for lifeboats survivors var/area/area = get_area(survived_human) if(!survived_human) @@ -25,26 +27,39 @@ to_chat(survived_human, "

[SPAN_CENTERBOLD("You have successfully left the [MAIN_SHIP_NAME]. You may now ghost and observe the rest of the round.")]
") /// Port Aft Lifeboat (bottom-right, doors on its left side) -/obj/docking_port/mobile/lifeboat/port +/obj/docking_port/mobile/crashable/lifeboat/port name = "port-aft lifeboat" id = MOBILE_SHUTTLE_LIFEBOAT_PORT preferred_direction = WEST port_direction = WEST /// Starboard Aft Lifeboat (top-right, doors its right side) -/obj/docking_port/mobile/lifeboat/starboard +/obj/docking_port/mobile/crashable/lifeboat/starboard name = "starboard-aft lifeboat" id = MOBILE_SHUTTLE_LIFEBOAT_STARBOARD preferred_direction = EAST port_direction = EAST -/obj/docking_port/mobile/lifeboat/proc/send_to_infinite_transit() +/obj/docking_port/mobile/crashable/lifeboat/evac_launch() + . = ..() + available = FALSE - destination = null set_mode(SHUTTLE_IGNITING) on_ignition() setTimer(ignitionTime) +/obj/docking_port/mobile/crashable/lifeboat/crash_check() + . = ..() + + if(prob(abs(((world.time - EvacuationAuthority.evac_time) / EVACUATION_AUTOMATIC_DEPARTURE) - 1))) + return TRUE + +/obj/docking_port/mobile/crashable/lifeboat/open_doors() + . = ..() + + for(var/obj/structure/machinery/door/airlock/multi_tile/door in doors) + INVOKE_ASYNC(door, TYPE_PROC_REF(/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat, unlock_and_open)) + // === STATIONARIES /// Generic lifeboat dock @@ -54,7 +69,7 @@ height = 7 /obj/docking_port/stationary/lifeboat_dock/on_dock_ignition(departing_shuttle) - var/obj/docking_port/mobile/lifeboat/lifeboat = departing_shuttle + var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = departing_shuttle if(istype(lifeboat)) for(var/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat/door in lifeboat.doors) INVOKE_ASYNC(door, TYPE_PROC_REF(/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat, close_and_lock)) @@ -71,7 +86,7 @@ blastdoor.vacate_premises() /obj/docking_port/stationary/lifeboat_dock/proc/open_dock() - var/obj/docking_port/mobile/lifeboat/docked_shuttle = get_docked() + var/obj/docking_port/mobile/crashable/lifeboat/docked_shuttle = get_docked() if(docked_shuttle) for(var/obj/structure/machinery/door/airlock/multi_tile/door in docked_shuttle.doors) INVOKE_ASYNC(door, TYPE_PROC_REF(/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat, unlock_and_open)) @@ -81,7 +96,7 @@ addtimer(CALLBACK(blastdoor, TYPE_PROC_REF(/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat, unlock_and_open)), 10) /obj/docking_port/stationary/lifeboat_dock/proc/close_dock() - var/obj/docking_port/mobile/lifeboat/docked_shuttle = get_docked() + var/obj/docking_port/mobile/crashable/lifeboat/docked_shuttle = get_docked() if(docked_shuttle) for(var/obj/structure/machinery/door/airlock/multi_tile/door in docked_shuttle.doors) INVOKE_ASYNC(door, TYPE_PROC_REF(/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/lifeboat, close_and_lock)) diff --git a/colonialmarines.dme b/colonialmarines.dme index 03f1e780e4a1..e7e7e9acaab4 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -2181,7 +2181,6 @@ s// DM Environment file for colonialmarines.dme. #include "code\modules\shuttle\dropship.dm" #include "code\modules\shuttle\dropship_hijack.dm" #include "code\modules\shuttle\helpers.dm" -#include "code\modules\shuttle\lifeboats.dm" #include "code\modules\shuttle\on_move.dm" #include "code\modules\shuttle\ripple.dm" #include "code\modules\shuttle\shuttle.dm" @@ -2192,8 +2191,10 @@ s// DM Environment file for colonialmarines.dme. #include "code\modules\shuttle\computers\trijent_elevator_control.dm" #include "code\modules\shuttle\shuttles\dropship.dm" #include "code\modules\shuttle\shuttles\ert.dm" -#include "code\modules\shuttle\shuttles\escape_shuttle.dm" #include "code\modules\shuttle\shuttles\trijent_elevator.dm" +#include "code\modules\shuttle\shuttles\crashable\escape_shuttle.dm" +#include "code\modules\shuttle\shuttles\crashable\lifeboats.dm" +#include "code\modules\shuttle\shuttles\crashable\crashable.dm" #include "code\modules\shuttles\marine_ferry.dm" #include "code\modules\shuttles\monorail_console.dm" #include "code\modules\shuttles\shuttle.dm" diff --git a/maps/shuttles/escape_shuttle_e.dmm b/maps/shuttles/escape_shuttle_e.dmm index d8e14b742701..0ba589df217e 100644 --- a/maps/shuttles/escape_shuttle_e.dmm +++ b/maps/shuttles/escape_shuttle_e.dmm @@ -10,7 +10,7 @@ }, /area/shuttle/escape_pod) "e" = ( -/obj/docking_port/mobile/escape_shuttle/e, +/obj/docking_port/mobile/crashable/escape_shuttle/e, /turf/closed/shuttle/escapepod{ icon_state = "wall9" }, diff --git a/maps/shuttles/escape_shuttle_e_cl.dmm b/maps/shuttles/escape_shuttle_e_cl.dmm index fb35b994891d..df10125c3a3a 100644 --- a/maps/shuttles/escape_shuttle_e_cl.dmm +++ b/maps/shuttles/escape_shuttle_e_cl.dmm @@ -1,6 +1,6 @@ //MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE "a" = ( -/obj/docking_port/mobile/escape_shuttle/cl, +/obj/docking_port/mobile/crashable/escape_shuttle/cl, /turf/closed/shuttle/escapepod{ icon_state = "wall9" }, diff --git a/maps/shuttles/escape_shuttle_n.dmm b/maps/shuttles/escape_shuttle_n.dmm index ff00ef6d3117..bc3cd35f8ba2 100644 --- a/maps/shuttles/escape_shuttle_n.dmm +++ b/maps/shuttles/escape_shuttle_n.dmm @@ -2,10 +2,11 @@ "a" = ( /turf/closed/shuttle/escapepod{ icon_state = "wall6"; + }, /area/shuttle/escape_pod) "c" = ( -/obj/docking_port/mobile/escape_shuttle/n, +/obj/docking_port/mobile/crashable/escape_shuttle/n, /turf/closed/shuttle/escapepod{ icon_state = "wall9" }, diff --git a/maps/shuttles/escape_shuttle_s.dmm b/maps/shuttles/escape_shuttle_s.dmm index f3e4c74b480e..82391a5218d5 100644 --- a/maps/shuttles/escape_shuttle_s.dmm +++ b/maps/shuttles/escape_shuttle_s.dmm @@ -76,7 +76,7 @@ }, /area/shuttle/escape_pod) "U" = ( -/obj/docking_port/mobile/escape_shuttle/s, +/obj/docking_port/mobile/crashable/escape_shuttle/s, /turf/closed/shuttle/escapepod{ icon_state = "wall9" }, diff --git a/maps/shuttles/escape_shuttle_w.dmm b/maps/shuttles/escape_shuttle_w.dmm index d10d5fdfc1c8..8f81c83b500b 100644 --- a/maps/shuttles/escape_shuttle_w.dmm +++ b/maps/shuttles/escape_shuttle_w.dmm @@ -1,6 +1,6 @@ //MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE "a" = ( -/obj/docking_port/mobile/escape_shuttle/w, +/obj/docking_port/mobile/crashable/escape_shuttle/w, /turf/closed/shuttle/escapepod{ icon_state = "wall9" }, diff --git a/maps/shuttles/lifeboat-port-archive.dmm b/maps/shuttles/lifeboat-port-archive.dmm index cba75c63cc02..7279e78237b6 100644 --- a/maps/shuttles/lifeboat-port-archive.dmm +++ b/maps/shuttles/lifeboat-port-archive.dmm @@ -186,7 +186,7 @@ }, /area/shuttle/lifeboat) "xG" = ( -/obj/docking_port/mobile/lifeboat/port, +/obj/docking_port/mobile/crashable/lifeboat/port, /obj/structure/prop/invuln/dropship_parts/lifeboat{ icon_state = "0,0" }, diff --git a/maps/shuttles/lifeboat-port.dmm b/maps/shuttles/lifeboat-port.dmm index 4d58661e8e82..0117730f6971 100644 --- a/maps/shuttles/lifeboat-port.dmm +++ b/maps/shuttles/lifeboat-port.dmm @@ -191,7 +191,7 @@ }, /area/shuttle/lifeboat) "xG" = ( -/obj/docking_port/mobile/lifeboat/port, +/obj/docking_port/mobile/crashable/lifeboat/port, /obj/structure/prop/invuln/dropship_parts/lifeboat{ icon_state = "0,0" }, diff --git a/maps/shuttles/lifeboat-starboard-archive.dmm b/maps/shuttles/lifeboat-starboard-archive.dmm index b1857064804c..5094315b7b6f 100644 --- a/maps/shuttles/lifeboat-starboard-archive.dmm +++ b/maps/shuttles/lifeboat-starboard-archive.dmm @@ -160,7 +160,7 @@ /turf/template_noop, /area/shuttle/lifeboat) "vG" = ( -/obj/docking_port/mobile/lifeboat/starboard, +/obj/docking_port/mobile/crashable/lifeboat/starboard, /obj/structure/prop/invuln/dropship_parts/lifeboat{ icon_state = "0,0" }, diff --git a/maps/shuttles/lifeboat-starboard.dmm b/maps/shuttles/lifeboat-starboard.dmm index 05b128e0e2cb..57e302923131 100644 --- a/maps/shuttles/lifeboat-starboard.dmm +++ b/maps/shuttles/lifeboat-starboard.dmm @@ -169,7 +169,7 @@ }, /area/shuttle/lifeboat) "vG" = ( -/obj/docking_port/mobile/lifeboat/starboard, +/obj/docking_port/mobile/crashable/lifeboat/starboard, /obj/structure/prop/invuln/dropship_parts/lifeboat{ icon_state = "0,0" }, From d4f0fd5dd34518dd9b05aedf048fbdf8b85b2fc5 Mon Sep 17 00:00:00 2001 From: Morrow Date: Sat, 2 Sep 2023 00:24:45 -0400 Subject: [PATCH 2/6] aaaand done, plus wall cabinet alcohol removal --- .../vending/vendor_types/supplies.dm | 2 -- code/modules/shuttle/computer.dm | 23 +++++++++++++++---- .../shuttle/shuttles/crashable/crashable.dm | 22 +++++++++++------- .../shuttle/shuttles/crashable/lifeboats.dm | 2 -- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/code/game/machinery/vending/vendor_types/supplies.dm b/code/game/machinery/vending/vendor_types/supplies.dm index 2a2f35de8c19..376edf7ffc5d 100644 --- a/code/game/machinery/vending/vendor_types/supplies.dm +++ b/code/game/machinery/vending/vendor_types/supplies.dm @@ -23,8 +23,6 @@ list("FOOD AND BEVERAGE", -1, null, null), list("MRE", 25, /obj/item/storage/box/MRE, VENDOR_ITEM_REGULAR), list("Water Bottle", 25, /obj/item/reagent_container/food/drinks/cans/waterbottle, VENDOR_ITEM_REGULAR), - list("Aspen Beer", 10, /obj/item/storage/beer_pack, VENDOR_ITEM_REGULAR),//NOTE TO SELF, LOCK THIS ALCOHOL BEHIND SHIP ESCAPE - list("Wey-Yu Sake", 5, /obj/item/reagent_container/food/drinks/bottle/sake, VENDOR_ITEM_REGULAR), list("UTILITY", -1, null, null), list("M94 Marking Flare Pack", 5, /obj/item/storage/box/m94, VENDOR_ITEM_REGULAR), diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index dcee92cfac06..26869cfcf448 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -286,17 +286,30 @@ . = ..() var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = SSshuttle.getShuttle(shuttleId) if(lifeboat.status == LIFEBOAT_LOCKED) - to_chat(user, SPAN_WARNING("\The [src] flickers with error messages.")) + to_chat(user, SPAN_WARNING("[src] flickers with error messages.")) else if(lifeboat.status == LIFEBOAT_INACTIVE) - to_chat(user, SPAN_NOTICE("\The [src]'s screen says \"Awaiting evacuation order\".")) + to_chat(user, SPAN_NOTICE("[src]'s screen says \"Awaiting evacuation order\".")) else if(lifeboat.status == LIFEBOAT_ACTIVE) switch(lifeboat.mode) if(SHUTTLE_IDLE) - to_chat(user, SPAN_NOTICE("\The [src]'s screen says \"Awaiting confirmation of the evacuation order\".")) // Manual evac commands here - Morrow + if(!istype(user, /mob/living/carbon/human)) + to_chat(user, SPAN_NOTICE("[src]'s screen says \"Awaiting confirmation of the evacuation order\".")) + return + + var/mob/living/carbon/human/human_user = user + if(!(ACCESS_MARINE_SENIOR in human_user.wear_id?.access)) + to_chat(user, SPAN_NOTICE("[src]'s screen says \"Awaiting confirmation of the evacuation order\".")) + return + + if(tgui_alert(user, "Early launch the lifeboat?", "Confirm", list("Yes", "No"), 10 SECONDS) == "Yes") + to_chat(user, SPAN_NOTICE("[src]'s screen blinks and says \"Early launch accepted\".")) + lifeboat.evac_launch() + return + if(SHUTTLE_IGNITING) - to_chat(user, SPAN_NOTICE("\The [src]'s screen says \"Engines firing\".")) + to_chat(user, SPAN_NOTICE("[src]'s screen says \"Engines firing\".")) if(SHUTTLE_CALL) - to_chat(user, SPAN_NOTICE("\The [src] has flight information scrolling across the screen. The autopilot is working correctly.")) + to_chat(user, SPAN_NOTICE("[src] has flight information scrolling across the screen. The autopilot is working correctly.")) /obj/structure/machinery/computer/shuttle/lifeboat/attack_alien(mob/living/carbon/xenomorph/xeno) if(xeno.caste && xeno.caste.is_intelligent) diff --git a/code/modules/shuttle/shuttles/crashable/crashable.dm b/code/modules/shuttle/shuttles/crashable/crashable.dm index c6317e4321a4..41984f7cf3d6 100644 --- a/code/modules/shuttle/shuttles/crashable/crashable.dm +++ b/code/modules/shuttle/shuttles/crashable/crashable.dm @@ -12,7 +12,7 @@ if(!crash_land) return - for(var/area/shuttle_area in shuttle_areas) + for(var/area/shuttle_area as anything in shuttle_areas) shuttle_area.flags_alarm_state |= ALARM_WARNING_FIRE shuttle_area.updateicon() for(var/mob/evac_mob in shuttle_area) @@ -31,8 +31,7 @@ if(fires_on_crash) handle_fires() - //cell_explosion(destination.return_center_turf(), length(destination.return_turfs()) * 15, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data("evac pod crash")) - Remove this - Morrow - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), destination.return_center_turf(), length(destination.return_turfs()) * 5, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data("crashing shuttle")), 1.5 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), destination.return_center_turf(), length(destination.return_turfs()) * 2, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data("crashing shuttle")), 1.5 SECONDS) /obj/docking_port/mobile/crashable/on_prearrival() . = ..() @@ -48,15 +47,18 @@ if(evac_mob.client) playsound_client(evac_mob.client, get_sfx("bigboom"), vol = 50) +/// Called when the shuttle is launched and checks for crash and creates a crash point /obj/docking_port/mobile/crashable/proc/evac_launch() if(!crash_check()) return create_crash_point() +/// Returns whether or not the shuttle will crash after being sent /obj/docking_port/mobile/crashable/proc/crash_check() return FALSE +/// Sets up a valid crash point, fails after 10 tries /obj/docking_port/mobile/crashable/proc/create_crash_point() for(var/i = 1 to 10) var/list/all_ground_levels = SSmapping.levels_by_trait(ZTRAIT_GROUND) @@ -120,10 +122,15 @@ /// Sets up and handles fires/explosions on crashing shuttles /obj/docking_port/mobile/crashable/proc/handle_fires() - for(var/i = 1 to (length(destination.return_turfs()) / 25)) - var/turf/position = pick(destination.return_turfs()) + var/list/turf/total_turfs = list() + for(var/area/shuttle_area as anything in shuttle_areas) + for(var/turf/cycled_turf in shuttle_area) + total_turfs += cycled_turf + + for(var/i = 1 to (length(total_turfs) / 40)) + var/turf/position = pick(total_turfs) new /obj/effect/warning/explosive(position, 3 SECONDS) - playsound(src, 'sound/effects/pipe_hissing.ogg', vol = 40) + playsound(position, 'sound/effects/pipe_hissing.ogg', vol = 40) addtimer(CALLBACK(src, PROC_REF(kablooie), position), 3 SECONDS) /// Actually blows up the fire/explosion on crashing shuttles, used for effect delay @@ -131,7 +138,7 @@ var/new_cause_data = create_cause_data("crashing shuttle fire") var/list/exploding_types = list(/obj/item/explosive/grenade/high_explosive/bursting_pipe, /obj/item/explosive/grenade/incendiary/bursting_pipe) for(var/path in exploding_types) - var/obj/item/explosive/grenade/exploder = new path(get_turf(src)) + var/obj/item/explosive/grenade/exploder = new path(position) exploder.cause_data = new_cause_data exploder.prime() @@ -154,4 +161,3 @@ shuttle_area.flags_alarm_state &= ~ALARM_WARNING_FIRE shuttle_area.updateicon() - diff --git a/code/modules/shuttle/shuttles/crashable/lifeboats.dm b/code/modules/shuttle/shuttles/crashable/lifeboats.dm index b258a6a002b5..99453d2564d5 100644 --- a/code/modules/shuttle/shuttles/crashable/lifeboats.dm +++ b/code/modules/shuttle/shuttles/crashable/lifeboats.dm @@ -140,5 +140,3 @@ /datum/map_template/shuttle/lifeboat_starboard name = "Starboard door lifeboat" shuttle_id = MOBILE_SHUTTLE_LIFEBOAT_STARBOARD - - From 335636de44ec3e902541d2fd9e61198461c8aded Mon Sep 17 00:00:00 2001 From: Morrow Date: Sat, 2 Sep 2023 00:31:31 -0400 Subject: [PATCH 3/6] OK linters thanks --- colonialmarines.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colonialmarines.dme b/colonialmarines.dme index e7e7e9acaab4..721b77d56d9c 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -2192,9 +2192,9 @@ s// DM Environment file for colonialmarines.dme. #include "code\modules\shuttle\shuttles\dropship.dm" #include "code\modules\shuttle\shuttles\ert.dm" #include "code\modules\shuttle\shuttles\trijent_elevator.dm" +#include "code\modules\shuttle\shuttles\crashable\crashable.dm" #include "code\modules\shuttle\shuttles\crashable\escape_shuttle.dm" #include "code\modules\shuttle\shuttles\crashable\lifeboats.dm" -#include "code\modules\shuttle\shuttles\crashable\crashable.dm" #include "code\modules\shuttles\marine_ferry.dm" #include "code\modules\shuttles\monorail_console.dm" #include "code\modules\shuttles\shuttle.dm" From add90a91194a0d16396630682710c4a36968a393 Mon Sep 17 00:00:00 2001 From: Morrow Date: Sat, 2 Sep 2023 00:50:23 -0400 Subject: [PATCH 4/6] how's that --- maps/shuttles/escape_shuttle_n.dmm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/maps/shuttles/escape_shuttle_n.dmm b/maps/shuttles/escape_shuttle_n.dmm index bc3cd35f8ba2..71f8515daba8 100644 --- a/maps/shuttles/escape_shuttle_n.dmm +++ b/maps/shuttles/escape_shuttle_n.dmm @@ -1,8 +1,7 @@ //MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE "a" = ( /turf/closed/shuttle/escapepod{ - icon_state = "wall6"; - + icon_state = "wall6" }, /area/shuttle/escape_pod) "c" = ( From 214be15b22c7960ef406fe2994afde5317848d71 Mon Sep 17 00:00:00 2001 From: Morrow Date: Sun, 3 Sep 2023 20:39:42 -0400 Subject: [PATCH 5/6] Fixes lifeboat crash chance and should stop shuttles landing on each other? --- code/__DEFINES/mode.dm | 2 +- .../shuttle/shuttles/crashable/crashable.dm | 36 +++++++++++++------ .../shuttle/shuttles/crashable/lifeboats.dm | 5 ++- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index bb31f4d84b1e..a0271c8ec8ce 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -6,7 +6,7 @@ #define SHUTTLE_LOCK_COOLDOWN 10 MINUTES #define MONORAIL_LOCK_COOLDOWN 3 MINUTES #define SHUTTLE_LOCK_TIME_LOCK 1 MINUTES -#define EVACUATION_AUTOMATIC_DEPARTURE 10 MINUTES //All pods automatically depart in 10 minutes, unless they are full or unable to launch for some reason. +#define EVACUATION_AUTOMATIC_DEPARTURE (10 MINUTES) //All pods automatically depart in 10 minutes, unless they are full or unable to launch for some reason. #define EVACUATION_ESTIMATE_DEPARTURE ((evac_time + EVACUATION_AUTOMATIC_DEPARTURE - world.time) * 0.1) #define EVACUATION_STATUS_STANDING_BY 0 diff --git a/code/modules/shuttle/shuttles/crashable/crashable.dm b/code/modules/shuttle/shuttles/crashable/crashable.dm index 41984f7cf3d6..9cec33bee7a4 100644 --- a/code/modules/shuttle/shuttles/crashable/crashable.dm +++ b/code/modules/shuttle/shuttles/crashable/crashable.dm @@ -12,6 +12,8 @@ if(!crash_land) return + notify_ghosts(header = "Crashing shuttle!", message = "[name] has catastrophically failed and is crashing at [get_area(destination)].", source = src, action = NOTIFY_ORBIT) + for(var/area/shuttle_area as anything in shuttle_areas) shuttle_area.flags_alarm_state |= ALARM_WARNING_FIRE shuttle_area.updateicon() @@ -78,24 +80,24 @@ var/turf/turf_picked = pick(potential_turfs) - var/obj/docking_port/stationary/crashable/temp_escape_pod_port = new(turf_picked) - temp_escape_pod_port.width = width - temp_escape_pod_port.height = height - temp_escape_pod_port.id = id + var/obj/docking_port/stationary/crashable/temp_crashable_port = new(turf_picked) + temp_crashable_port.width = width + temp_crashable_port.height = height + temp_crashable_port.id = id - if(!check_crash_point(temp_escape_pod_port)) - qdel(temp_escape_pod_port) + if(!check_crash_point(temp_crashable_port)) + qdel(temp_crashable_port) continue - destination = temp_escape_pod_port + destination = temp_crashable_port break if(destination) crash_land = TRUE /// Checks for anything that may get in the way of a crash, returns FALSE if there is something in the way or is out of bounds -/obj/docking_port/mobile/crashable/proc/check_crash_point(obj/docking_port/stationary/crashable/checked_escape_pod_port) - for(var/turf/found_turf as anything in checked_escape_pod_port.return_turfs()) +/obj/docking_port/mobile/crashable/proc/check_crash_point(obj/docking_port/stationary/crashable/checked_crashable_port) + for(var/turf/found_turf as anything in checked_crashable_port.return_turfs()) var/area/found_area = get_area(found_turf) if(found_area.flags_area & AREA_NOTUNNEL) return FALSE @@ -111,6 +113,20 @@ if(istype(found_turf, /turf/closed/shuttle)) return FALSE + for(var/obj/docking_port/stationary/stationary_dock in get_turf(checked_crashable_port)) + if(stationary_dock != checked_crashable_port) + return FALSE + + for(var/obj/docking_port/mobile/cycled_mobile_port as anything in SSshuttle.mobile) + if(cycled_mobile_port == src) + continue + + if(!cycled_mobile_port.destination) + continue + + if(length(checked_crashable_port.return_turfs() & cycled_mobile_port.destination.return_turfs())) + return FALSE + return TRUE /// Forces the shuttle to crash, admin called @@ -147,7 +163,7 @@ return /obj/docking_port/stationary/crashable - name = "Crash Escape Pod Dock" + name = "Crashable Dock" /obj/docking_port/stationary/crashable/on_arrival(obj/docking_port/mobile/arriving_shuttle) . = ..() diff --git a/code/modules/shuttle/shuttles/crashable/lifeboats.dm b/code/modules/shuttle/shuttles/crashable/lifeboats.dm index 99453d2564d5..93489ee4a359 100644 --- a/code/modules/shuttle/shuttles/crashable/lifeboats.dm +++ b/code/modules/shuttle/shuttles/crashable/lifeboats.dm @@ -51,7 +51,10 @@ /obj/docking_port/mobile/crashable/lifeboat/crash_check() . = ..() - if(prob(abs(((world.time - EvacuationAuthority.evac_time) / EVACUATION_AUTOMATIC_DEPARTURE) - 1))) + if(EvacuationAuthority.evac_status >= EVACUATION_STATUS_IN_PROGRESS) + return FALSE + + if(prob(abs(((world.time - EvacuationAuthority.evac_time) / EVACUATION_AUTOMATIC_DEPARTURE) - 1) * 100)) return TRUE /obj/docking_port/mobile/crashable/lifeboat/open_doors() From e6528d2c8458310a04e66c23ec6b861f5d3a6ac2 Mon Sep 17 00:00:00 2001 From: Morrow Date: Sun, 3 Sep 2023 20:47:44 -0400 Subject: [PATCH 6/6] jump instead of orbit --- code/modules/shuttle/shuttles/crashable/crashable.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/shuttle/shuttles/crashable/crashable.dm b/code/modules/shuttle/shuttles/crashable/crashable.dm index 9cec33bee7a4..de1c5cc8e4fb 100644 --- a/code/modules/shuttle/shuttles/crashable/crashable.dm +++ b/code/modules/shuttle/shuttles/crashable/crashable.dm @@ -12,7 +12,7 @@ if(!crash_land) return - notify_ghosts(header = "Crashing shuttle!", message = "[name] has catastrophically failed and is crashing at [get_area(destination)].", source = src, action = NOTIFY_ORBIT) + notify_ghosts(header = "Crashing shuttle!", message = "[name] has catastrophically failed and is crashing at [get_area(destination)].", source = src) for(var/area/shuttle_area as anything in shuttle_areas) shuttle_area.flags_alarm_state |= ALARM_WARNING_FIRE