Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавляет емаг эвакуационных челноков (подов) #12676

Merged
merged 10 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 44 additions & 101 deletions code/controllers/subsystem/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,43 +138,12 @@ SUBSYSTEM_DEF(shuttle)
dock_act(end_location, "shuttle_escape")
dock_act(/area/centcom/evac, "shuttle_escape")

//pods
start_location = locate(/area/shuttle/escape_pod1/transit)
end_location = locate(/area/shuttle/escape_pod1/centcom)
if(prob(5)) // 5% that they survive
start_location.move_contents_to(end_location, null, NORTH)
dock_act(end_location, "pod1")
dock_act(/area/centcom/evac, "pod1")

shake_mobs_in_area(end_location, EAST)

start_location = locate(/area/shuttle/escape_pod2/transit)
end_location = locate(/area/shuttle/escape_pod2/centcom)
if(prob(5)) // 5% that they survive
start_location.move_contents_to(end_location, null, NORTH)
dock_act(end_location, "pod2")
dock_act(/area/centcom/evac, "pod2")

shake_mobs_in_area(end_location, EAST)

start_location = locate(/area/shuttle/escape_pod3/transit)
end_location = locate(/area/shuttle/escape_pod3/centcom)
if(prob(5)) // 5% that they survive
start_location.move_contents_to(end_location, null, NORTH)
dock_act(end_location, "pod3")
dock_act(/area/centcom/evac, "pod3")

shake_mobs_in_area(end_location, EAST)

start_location = locate(/area/shuttle/escape_pod4/transit)
end_location = locate(/area/shuttle/escape_pod4/centcom)
if(prob(5)) // 5% that they survive
start_location.move_contents_to(end_location, null, NORTH)
dock_act(end_location, "pod4")
dock_act(/area/centcom/evac, "pod4")

shake_mobs_in_area(end_location, WEST)

//pods
pod_docking(/area/shuttle/escape_pod1/transit, /area/shuttle/escape_pod1/centcom, "pod1")
pod_docking(/area/shuttle/escape_pod2/transit, /area/shuttle/escape_pod2/centcom, "pod2")
pod_docking(/area/shuttle/escape_pod3/transit, /area/shuttle/escape_pod3/centcom, "pod3")
pod_docking(/area/shuttle/escape_pod4/transit, /area/shuttle/escape_pod4/centcom, "pod4")
LudwigVonChesterfield marked this conversation as resolved.
Show resolved Hide resolved
online = 0

return TRUE
Expand Down Expand Up @@ -276,77 +245,19 @@ SUBSYSTEM_DEF(shuttle)
shake_mobs_in_area(end_location, SOUTH)

//pods
if(alert == 0) // Crew Transfer not for pods

var/ep_shot_sound_type = 'sound/effects/escape_shuttle/ep_lucky_shot.ogg' // successful undocking, clean flight, yay!
if(prob(33))
ep_shot_sound_type = 'sound/effects/escape_shuttle/ep_unlucky_shot.ogg' // the escape pod almost crashed into something, damn it!
start_location = locate(/area/shuttle/escape_pod1/station)
end_location = locate(/area/shuttle/escape_pod1/transit)
end_location.parallax_movedir = EAST
start_location.move_contents_to(end_location, null, NORTH)
undock_act(start_location, "pod1")
try_launch_pod(/area/shuttle/escape_pod1/station, /area/shuttle/escape_pod1/transit, EAST, WEST, "pod1")
try_launch_pod(/area/shuttle/escape_pod2/station, /area/shuttle/escape_pod2/transit, EAST, WEST, "pod2")
try_launch_pod(/area/shuttle/escape_pod3/station, /area/shuttle/escape_pod3/transit, EAST, WEST, "pod3")
try_launch_pod(/area/shuttle/escape_pod4/station, /area/shuttle/escape_pod4/transit, WEST, EAST, "pod4")
LudwigVonChesterfield marked this conversation as resolved.
Show resolved Hide resolved
try_launch_pod(/area/shuttle/escape_pod5/station, /area/shuttle/escape_pod5/transit, NORTH, SOUTH, "pod5")
try_launch_pod(/area/shuttle/escape_pod6/station, /area/shuttle/escape_pod6/transit, NORTH, SOUTH, "pod6")
if(alert == 0)
undock_act(/area/station/maintenance/chapel || /area/station/maintenance/bridge, "pod1")

for(var/mob/M in end_location)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(end_location, WEST)

start_location = locate(/area/shuttle/escape_pod2/station)
end_location = locate(/area/shuttle/escape_pod2/transit)
end_location.parallax_movedir = EAST
start_location.move_contents_to(end_location, null, NORTH)
undock_act(start_location, "pod2")
undock_act(/area/station/maintenance/medbay || /area/station/maintenance/bridge || /area/station/civilian/gym, "pod2")

for(var/mob/M in end_location)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(end_location, WEST)

start_location = locate(/area/shuttle/escape_pod3/station)
end_location = locate(/area/shuttle/escape_pod3/transit)
end_location.parallax_movedir = EAST
start_location.move_contents_to(end_location, null, NORTH)
undock_act(start_location, "pod3")
undock_act(/area/station/maintenance/dormitory || /area/station/maintenance/brig || /area/station/security/prison, "pod3")

for(var/mob/M in end_location)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(end_location, WEST)

start_location = locate(/area/shuttle/escape_pod4/station)
end_location = locate(/area/shuttle/escape_pod4/transit)
end_location.parallax_movedir = WEST
start_location.move_contents_to(end_location, null, EAST)
undock_act(start_location, "pod4")
undock_act(/area/station/maintenance/engineering || /area/station/maintenance/brig, "pod4")

for(var/mob/M in end_location)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(end_location, EAST)

start_location = locate(/area/shuttle/escape_pod5/station)
end_location = locate(/area/shuttle/escape_pod5/transit)
end_location.parallax_movedir = NORTH
start_location.move_contents_to(end_location, null, SOUTH)
undock_act(start_location, "pod5")
undock_act(/area/station/hallway/secondary/entry, "pod5")

for(var/mob/M in end_location)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(end_location, SOUTH)

start_location = locate(/area/shuttle/escape_pod6/station)
end_location = locate(/area/shuttle/escape_pod6/transit)
end_location.parallax_movedir = NORTH
start_location.move_contents_to(end_location, null, SOUTH)
undock_act(start_location, "pod6")
undock_act(/area/station/hallway/secondary/entry, "pod6")

for(var/mob/M in end_location)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(end_location, SOUTH)

announce_emer_left.play()
else
announce_crew_left.play()
Expand Down Expand Up @@ -665,6 +576,38 @@ SUBSYSTEM_DEF(shuttle)
endtime = REALTIMEOFDAY + (get_shuttle_arrive_time()*10 - ticksleft)
return

/datum/controller/subsystem/shuttle/proc/check_emag(area/escape_pod)
var/obj/item/device/radio/intercom/pod/int = locate(/obj/item/device/radio/intercom/pod) in escape_pod
if(isnull(int))
return
return int.emagged

/datum/controller/subsystem/shuttle/proc/try_launch_pod(area/escape_pod_start, area/escape_pod_end, move_content_dir, shake_dir, loc_name)
if(!locate(escape_pod_start) in all_areas)
return
volas marked this conversation as resolved.
Show resolved Hide resolved
var/area/start = locate(escape_pod_start)
var/area/transit = locate(escape_pod_end)
if(alert == 0 || check_emag(start))
var/ep_shot_sound_type = 'sound/effects/escape_shuttle/ep_lucky_shot.ogg'
if(prob(33))
ep_shot_sound_type = 'sound/effects/escape_shuttle/ep_unlucky_shot.ogg'
transit.parallax_movedir = move_content_dir
start.move_contents_to(transit, null, move_content_dir)
for(var/mob/M in transit)
M.playsound_local(null, ep_shot_sound_type, VOL_EFFECTS_MASTER, null, FALSE)
shake_mobs_in_area(transit, shake_dir)
undock_act(start, loc_name)
Chip11-n marked this conversation as resolved.
Show resolved Hide resolved

/datum/controller/subsystem/shuttle/proc/pod_docking(area/start, area/end, loc_name)
var/area/transit = locate(start)
var/area/centcom = locate(end)
if(prob(5) || check_emag(transit)) // 5% that they survive
transit.move_contents_to(centcom, null, NORTH)
dock_act(centcom, loc_name)
dock_act(/area/centcom/evac, loc_name)
shake_mobs_in_area(centcom, EAST)


/datum/controller/subsystem/shuttle/proc/set_eta_timeofday(flytime = SSshuttle.movetime)
eta_timeofday = (REALTIMEOFDAY + flytime) % MIDNIGHT_ROLLOVER

Expand Down
4 changes: 4 additions & 0 deletions code/game/gamemodes/objectives/escape.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@
return OBJECTIVE_WIN
if(istype(check_area, /area/shuttle/escape_pod4/centcom))
return OBJECTIVE_WIN
if(istype(check_area, /area/shuttle/escape_pod5/centcom))
return OBJECTIVE_WIN
if(istype(check_area, /area/shuttle/escape_pod6/centcom))
return OBJECTIVE_WIN
else
return OBJECTIVE_LOSS
8 changes: 8 additions & 0 deletions code/modules/locations/shuttles/Intercom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
cases = list("интерком станции", "интеркома станции", "интеркому станции", "интерком станции", "интеркомом станции", "интеркоме станции")
icon = 'icons/locations/shuttles/intercom.dmi'
icon_state = "intercom"
var/emagged = FALSE

/obj/item/device/radio/intercom/pod/emag_act(mob/user)
if(emagged)
return FALSE
to_chat(user, "<span class='notice'>On the small screen you see a message:</span><span class='warning'> Launch is possible without an activated evacuation system; a better route has been selected. Have a nice flight, Agent Doe!</span>")
playsound(src, 'sound/effects/sparks4.ogg', VOL_EFFECTS_MASTER)
emagged = TRUE
Loading