From 1eed982964b12e00fbb2e79b362f072592d46afb Mon Sep 17 00:00:00 2001 From: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Date: Wed, 5 Jul 2023 02:25:48 -0400 Subject: [PATCH] Changes evac pod crash chance from a define to a var (#3790) # About the pull request Changes the crash from define to a variable to allow it to be changed Adds a proc to force crash the shuttle, either if docked or in space # Explain why it's good for the game This allows the crash chance to be changed, instead of just being static # Changelog :cl: code: evacuation pod crash chance changed to a var code: proc added to force evacuation pods to crash /:cl: --- code/modules/shuttle/shuttles/escape_shuttle.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/modules/shuttle/shuttles/escape_shuttle.dm b/code/modules/shuttle/shuttles/escape_shuttle.dm index 3188721af738..6c580f9f163b 100644 --- a/code/modules/shuttle/shuttles/escape_shuttle.dm +++ b/code/modules/shuttle/shuttles/escape_shuttle.dm @@ -1,5 +1,3 @@ -#define CRASH_LAND_PROBABILITY 33 - /obj/docking_port/mobile/escape_shuttle name = "Escape Pod" id = ESCAPE_SHUTTLE @@ -10,6 +8,8 @@ rechargeTime = SHUTTLE_RECHARGE ignitionTime = 8 SECONDS ignition_sound = 'sound/effects/escape_pod_warmup.ogg' + /// The % chance of the escape pod crashing into the groundmap + var/crash_land_chance = 33 var/datum/door_controller/single/door_handler = new() var/launched = FALSE @@ -76,7 +76,7 @@ return destination = null - if(prob(CRASH_LAND_PROBABILITY)) + if(prob(crash_land_chance)) create_crash_point() set_mode(SHUTTLE_IGNITING) @@ -176,6 +176,12 @@ . = ..() 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 id = ESCAPE_SHUTTLE_EAST width = 4 @@ -270,6 +276,3 @@ /datum/map_template/shuttle/escape_pod_e_cl name = "Escape Pod E CL" shuttle_id = ESCAPE_SHUTTLE_EAST_CL - - -#undef CRASH_LAND_PROBABILITY