mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-16 17:42:32 +01:00
Ports Shuttle Sounds + Fixes Southern Cross Shuttles
Southern Cross shuttles one and two can now launch. Adds missing areas for shuttles 1 and 2. Shuttles warming up, moving, or stopping now make a nice sound, ported from /tg/. Rearranges shuttle datum/computer definitions to make it easier to read. Removes cloaking abilities for most multi-shuttles. Lowers transit time for multi-shuttles. Can be raised later if desired.
This commit is contained in:
@@ -43,38 +43,55 @@
|
||||
world << "<span class='danger'>warning: shuttle with docking tag [docking_controller_tag] could not find it's controller!</span>"
|
||||
|
||||
/datum/shuttle/proc/short_jump(var/area/origin,var/area/destination)
|
||||
if(moving_status != SHUTTLE_IDLE) return
|
||||
if(moving_status != SHUTTLE_IDLE)
|
||||
return
|
||||
|
||||
//it would be cool to play a sound here
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
spawn(warmup_time*10)
|
||||
|
||||
make_sounds(origin, HYPERSPACE_WARMUP)
|
||||
sleep(5 SECONDS) // so the sound finishes.
|
||||
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
make_sounds(origin, HYPERSPACE_END)
|
||||
return //someone cancelled the launch
|
||||
|
||||
moving_status = SHUTTLE_INTRANSIT //shouldn't matter but just to be safe
|
||||
move(origin, destination)
|
||||
moving_status = SHUTTLE_IDLE
|
||||
make_sounds(destination, HYPERSPACE_END)
|
||||
|
||||
/datum/shuttle/proc/long_jump(var/area/departing, var/area/destination, var/area/interim, var/travel_time, var/direction)
|
||||
//world << "shuttle/long_jump: departing=[departing], destination=[destination], interim=[interim], travel_time=[travel_time]"
|
||||
if(moving_status != SHUTTLE_IDLE) return
|
||||
if(moving_status != SHUTTLE_IDLE)
|
||||
return
|
||||
|
||||
//it would be cool to play a sound here
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
spawn(warmup_time*10)
|
||||
|
||||
make_sounds(departing, HYPERSPACE_WARMUP)
|
||||
sleep(5 SECONDS) // so the sound finishes.
|
||||
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
make_sounds(departing, HYPERSPACE_END)
|
||||
return //someone cancelled the launch
|
||||
|
||||
arrive_time = world.time + travel_time*10
|
||||
moving_status = SHUTTLE_INTRANSIT
|
||||
move(departing, interim, direction)
|
||||
|
||||
|
||||
var/last_progress_sound = 0
|
||||
while (world.time < arrive_time)
|
||||
// Make the shuttle make sounds every four seconds, since the sound file is five seconds.
|
||||
if(last_progress_sound + 4 SECONDS < world.time)
|
||||
make_sounds(interim, HYPERSPACE_PROGRESS)
|
||||
last_progress_sound = world.time
|
||||
sleep(5)
|
||||
|
||||
move(interim, destination, direction)
|
||||
moving_status = SHUTTLE_IDLE
|
||||
make_sounds(destination, HYPERSPACE_END)
|
||||
|
||||
/datum/shuttle/proc/dock()
|
||||
if (!docking_controller)
|
||||
@@ -104,7 +121,7 @@
|
||||
//If you want to conditionally cancel shuttle launches, that logic must go in short_jump() or long_jump()
|
||||
/datum/shuttle/proc/move(var/area/origin, var/area/destination, var/direction=null)
|
||||
|
||||
//world << "move_shuttle() called for [shuttle_tag] leaving [origin] en route to [destination]."
|
||||
//world << "move_shuttle() called for [name] leaving [origin] en route to [destination]."
|
||||
|
||||
//world << "area_coming_from: [origin]"
|
||||
//world << "destination: [destination]"
|
||||
@@ -167,3 +184,15 @@
|
||||
//returns 1 if the shuttle has a valid arrive time
|
||||
/datum/shuttle/proc/has_arrive_time()
|
||||
return (moving_status == SHUTTLE_INTRANSIT)
|
||||
|
||||
/datum/shuttle/proc/make_sounds(var/area/A, var/sound_type)
|
||||
var/sound_to_play = null
|
||||
switch(sound_type)
|
||||
if(HYPERSPACE_WARMUP)
|
||||
sound_to_play = 'sound/effects/shuttles/hyperspace_begin.ogg'
|
||||
if(HYPERSPACE_PROGRESS)
|
||||
sound_to_play = 'sound/effects/shuttles/hyperspace_progress.ogg'
|
||||
if(HYPERSPACE_END)
|
||||
sound_to_play = 'sound/effects/shuttles/hyperspace_end.ogg'
|
||||
for(var/obj/machinery/door/E in A) //dumb, I know, but playing it on the engines doesn't do it justice
|
||||
playsound(E, sound_to_play, 50, FALSE)
|
||||
@@ -19,12 +19,18 @@
|
||||
//it would be cool to play a sound here
|
||||
moving_status = SHUTTLE_WARMUP
|
||||
spawn(warmup_time*10)
|
||||
|
||||
make_sounds(origin, HYPERSPACE_WARMUP)
|
||||
sleep(5 SECONDS) // so the sound finishes.
|
||||
|
||||
if (moving_status == SHUTTLE_IDLE)
|
||||
make_sounds(origin, HYPERSPACE_END)
|
||||
return //someone cancelled the launch
|
||||
|
||||
if (at_station() && forbidden_atoms_check())
|
||||
//cancel the launch because of forbidden atoms. announce over supply channel?
|
||||
moving_status = SHUTTLE_IDLE
|
||||
make_sounds(origin, HYPERSPACE_END)
|
||||
return
|
||||
|
||||
if (!at_station()) //at centcom
|
||||
@@ -51,6 +57,7 @@
|
||||
move(away_area, destination)
|
||||
|
||||
moving_status = SHUTTLE_IDLE
|
||||
make_sounds(destination, HYPERSPACE_END)
|
||||
|
||||
if (!at_station()) //at centcom
|
||||
supply_controller.sell()
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
/datum/shuttle/multi_shuttle
|
||||
|
||||
flags = SHUTTLE_FLAGS_NONE
|
||||
var/cloaked = 1
|
||||
var/cloaked = FALSE
|
||||
var/can_cloak = FALSE
|
||||
var/at_origin = 1
|
||||
var/returned_home = 0
|
||||
var/move_time = 240
|
||||
// var/move_time = 240
|
||||
var/move_time = 60
|
||||
var/cooldown = 20
|
||||
var/last_move = 0 //the time at which we last moved
|
||||
|
||||
@@ -103,7 +105,8 @@
|
||||
else
|
||||
dat += "<font color='green'>Engines ready.</font><br>"
|
||||
|
||||
dat += "<br><b><A href='?src=\ref[src];toggle_cloak=[1]'>Toggle cloaking field</A></b><br>"
|
||||
if(MS.can_cloak)
|
||||
dat += "<br><b><A href='?src=\ref[src];toggle_cloak=[1]'>Toggle cloaking field</A></b><br>"
|
||||
dat += "<b><A href='?src=\ref[src];move_multi=[1]'>Move ship</A></b><br>"
|
||||
dat += "<b><A href='?src=\ref[src];start=[1]'>Return to base</A></b></center>"
|
||||
|
||||
@@ -195,19 +198,21 @@
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(!MS.return_warning)
|
||||
usr << "<font color='red'>Returning to your home base will end your mission. If you are sure, press the button again.</font>"
|
||||
//TODO: Actually end the mission.
|
||||
MS.return_warning = 1
|
||||
return
|
||||
// No point giving a warning if it does literally nothing.
|
||||
// if(!MS.return_warning)
|
||||
// usr << "<font color='red'>Returning to your home base will end your mission. If you are sure, press the button again.</font>"
|
||||
// //TODO: Actually end the mission.
|
||||
// MS.return_warning = 1
|
||||
// return
|
||||
|
||||
MS.long_jump(MS.last_departed,MS.origin,MS.interim,MS.move_time)
|
||||
MS.long_jump(MS.last_departed, MS.origin, MS.interim, MS.move_time)
|
||||
MS.last_departed = MS.origin
|
||||
MS.last_location = MS.start_location
|
||||
MS.at_origin = 1
|
||||
|
||||
if(href_list["toggle_cloak"])
|
||||
|
||||
if(!MS.can_cloak)
|
||||
return
|
||||
MS.cloaked = !MS.cloaked
|
||||
usr << "<font color='red'>Ship stealth systems have been [(MS.cloaked ? "activated. The station will not" : "deactivated. The station will")] be warned of our arrival.</font>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user