Skip to content

Commit

Permalink
Changes evac pod crash chance from a define to a var (#3790)
Browse files Browse the repository at this point in the history
# 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:
  • Loading branch information
BeagleGaming1 committed Jul 5, 2023
1 parent ff9a60f commit 1eed982
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions code/modules/shuttle/shuttles/escape_shuttle.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#define CRASH_LAND_PROBABILITY 33

/obj/docking_port/mobile/escape_shuttle
name = "Escape Pod"
id = ESCAPE_SHUTTLE
Expand All @@ -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
Expand Down Expand Up @@ -76,7 +76,7 @@
return

destination = null
if(prob(CRASH_LAND_PROBABILITY))
if(prob(crash_land_chance))
create_crash_point()

set_mode(SHUTTLE_IGNITING)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 1eed982

Please sign in to comment.