mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-06 23:41:57 +00:00
* Replace SSingulo with SScalamity; processing cleanup
- SScalamity now handles blobs as well as singularity-types.
- Processing subtypes have been simplified to not require a stop_processing definition.
* this is probably important
* Remove cascade disabling SSgarbage
* Fixed a bug where dust() did not qdel the target mob
* Misc fixes
* Fix decals surviving break-to-plating
* Subsystem flag tweaks
* Apparently subsystems are new'd before config is.
* Fix paper icons
* Speculative fix for insane lag
* Better machinery stat
* Make organs not use SSoverlay
* Misc bugfixes & tweaks
* Nightmode fixes
* Changelog for SMC
* Port /tg/'s improved MC crash handling
* Add some more SS Recover() procs
* supply_controller -> SScargo
* More New() -> Initialize()
* pAI and robot construction overlays
* Fix cargo unit tests
* Merge the DMM Suite's atom/New() into atoms_init
* Lighting pre-baking
* Lighting initialization logging
* Fix some bad SS init orders
* Fix SSlighting logging; rename Processes to MC
* Speculative fix for insane GC lag
* Prebaked openturf/icon_smooth & fix lighting prebake
* SS init status; SSatoms LATEQDEL
* Fix bug with MC init stat panel
* Fix parallax
* Misc
* Ignore SS_NO_DISPLAY during init
* apparently this is important
* REEEEEE
* Image GC fixes; broadcaster radio-new sanity
* RCON Cleanup
* Move pAI recruiter into subsystem
* Move global solars list into sun subsystem
* Make chickens not use a global
* Demote SSdisposals to SS_BACKGROUND; garbage-debug cleanup
* Speed up space init a little
* Fix bad timer flags on floor drying
* Subsystem panic-restart verb for mins
* Explosion speedup
* Minor subsystem & MC logging tweaks
* SSopenturf improvements
* Make pipenet actually initialize (whoops)
* Minor tweaks
* Implement lighting rounding
* comments are hard okay
* Minor lattice tweaks
* Fix some timer issues & better closet init
* Timer sanity
* Request console tweaks + Storage init sanity
* Minor SSmachiner RCON improvements
* Further reduce world-start timer count
* Standardize subsystem logging
* Garbage hard delete profiling from /tg/
* Timer hang detection & recovery
* Log machines that sleep in process() and fuck up SSmachinery
* Fix an issue with external airlocks sleeping in process()
* Failsafe logging
* Minor tweaks
* Revert "Request console tweaks + Storage init sanity"
This reverts commit 98d3579e35.
* Re-implement RC changes
* Fix SQL FT saving
* Fix SSmachinery sleep in disposals
* Minor SS tweaks
* Paper fixes
* Blood drying fixes
* Merge gameticker and SSticker
* Minor global list init cleanup
* Lagcheck biogenerator & bags
* Tweak SScargo init order; RIG Initialize()
* Caching tweaks
* Remove rogue comma
* Initialize fixes
* Lighting destroy cleanup
* Fix emagging airlocks
* Initial SSicon implementation
* Tweaks & Fixes
* Fire + Air alarm queued icon updates
* Overlays + Queued icon cleanup
* Runtime & background fixes
* Kill some meaningless set statements
* Kill some image qdels
* Bump up lighting rounding val
* Fix adv. scanner destroy runtimes
* Remove unneeded icon update limiting
* Move icon smoothing into helpers
* Show a warning if DM 510 compiles without memory leak hack enabled
* Re-organize subsystems & MC defines a little
* Airlock SFX
* Log of Changes
* Make SSicon_update disable itself when not doing anything
* Fix respawn verb runtime when used early in server-init
* Add more information to MC's stat_entry()
* Replace direct refernces to gcDestroyed with QDEL* macros
* plant_controller -> SSplants
* More plant tweaks
* Add more humor to changelog
* Move parallax globals into SSparallax
* Lighting responsiveness tweaks
* Fix parallax init order & better MC init panel stat
* Make mobs GC
* More overlays + Remove intercom spawn()
* SSfast_process; make pinpointers not use spawn-recursion to process
Also made the SM Cascade beach process with SSprocessing instead of a spawn loop.
* Update changelog
* Mob GC tweaks
* Del() cleanup
* Fix insomniac ZAS connection edges
* Minor pAI cleanup
* Convert more things to SSoverlay; fix duplicated overlay in field gens
* SM Bluespace turf tweaks
* Update SSgarbage debug globals list
* Human-type qdel tweaks
* Subsystem suspension; stat_entry improvements
* SQL Statistics cleanup
* Fix runtimes with ambrosia
* More disable() -> suspend(); fix nightmode again
* Human qdel fix; minor tweaks
* Update turbolift to work with StonedMC
* Make lifts use timers instead of a subsystem
* Make SSassets start earlier
* Convert the radio controller into a subsystem
* Fix some missing CHECK_TICKs in asteroid generation
* MC stat tweaks; make shouldnt_see a typecache
* Kill some redundant debug-controller entries
* radio_controller -> SSradio
* Better SSgarbage hard-del logging from /tg/ upstream
* Logging tweaks + GELF
* Misc client caching improvements
* Slime SSoverlay
* Oven icon fixes
* Implant fixes
- Death implants will no longer spam Common on death of user.
- Death implants should handle a deleted user better.
* Holder tweaks + Welding tool Initialize()
* Fix some bad subsystem logging
* Fix suit cooling units spawning without cells
* Starlight tweaks
* Gibber infinite gib fix
* More SSoverlay stuff
* Make crates use CUT_OVERLAY_IN
* Make SSarrivals suspend instead of disable
* Make openturf use split/phased tick checks
* Speculative fix for unwet timer runtimes
* Blood overlay tweaks/fixes
* Update crusher to play nice with SMC + SSoverlay
* Openturf improvements and fixes
* Minor turbolift tweaks
* Lighting performance improvements + ChangeTurf tweaks
* this is probably important
* Fix wall weld noises on changeturf
* More ChangeTurf tweaks
* Explosion tweaks
* Pre-game lobby tweaks
* Openturf tweaks
* Prevent admins from starting the game before init finishes
* Fix Travis
* Kill an unused var
* Fix ChangeTurf runtimes on openturfs
* Fixes
* Browser datum fixes, asset caching
* Update changelog
* Changelog
* Lobby tweaks
* Ticker tweaks; kill ticker var
* Further lobby tweaks
* Cascade tweaks
* air_master -> SSair
* Reduce overhead from radio autosay
* alarm_manager -> SSalarm
* bomb_processor -> SSexplosives
* corp_regs -> SSlaw
* ZAS overlay fixes
* Small wall icon optimization
* Fix effects master
* Assembly tweaks
* Megavend fixes
* Shuttle fixes
* Camera alert performance improvements
* Fix some world.log spam from lighting overlays
* Fix some Initialize() procs
* Openspace responsiveness tweaks
* Make HE pipes animate through openturfs
* Kill a spawn
279 lines
9.9 KiB
Plaintext
279 lines
9.9 KiB
Plaintext
var/datum/controller/subsystem/emergency_shuttle/emergency_shuttle
|
|
|
|
/datum/controller/subsystem/emergency_shuttle
|
|
name = "Emergency Shuttle"
|
|
flags = SS_NO_TICK_CHECK | SS_NO_INIT
|
|
|
|
var/datum/shuttle/ferry/emergency/shuttle
|
|
var/list/escape_pods
|
|
|
|
var/launch_time //the time at which the shuttle will be launched
|
|
var/auto_recall = 0 //if set, the shuttle will be auto-recalled
|
|
var/auto_recall_time //the time at which the shuttle will be auto-recalled
|
|
var/evac = 0 //1 = emergency evacuation, 0 = crew transfer
|
|
var/wait_for_launch = 0 //if the shuttle is waiting to launch
|
|
var/autopilot = 1 //set to 0 to disable the shuttle automatically launching
|
|
|
|
var/deny_shuttle = 0 //allows admins to prevent the shuttle from being called
|
|
var/departed = 0 //if the shuttle has left the station at least once
|
|
|
|
var/datum/announcement/priority/emergency_shuttle_docked = new(0, new_sound = sound('sound/AI/shuttledock.ogg'))
|
|
var/datum/announcement/priority/emergency_shuttle_called = new(0, new_sound = sound('sound/AI/shuttlecalled.ogg'))
|
|
var/datum/announcement/priority/emergency_shuttle_recalled = new(0, new_sound = sound('sound/AI/shuttlerecalled.ogg'))
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/Recover()
|
|
// Just copy all the stuff over.
|
|
src.shuttle = emergency_shuttle.shuttle
|
|
src.escape_pods = emergency_shuttle.escape_pods
|
|
src.launch_time = emergency_shuttle.launch_time
|
|
src.auto_recall = emergency_shuttle.auto_recall
|
|
src.auto_recall_time = emergency_shuttle.auto_recall_time
|
|
src.evac = emergency_shuttle.evac
|
|
src.wait_for_launch = emergency_shuttle.wait_for_launch
|
|
src.autopilot = emergency_shuttle.autopilot
|
|
src.deny_shuttle = emergency_shuttle.deny_shuttle
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/New()
|
|
NEW_SS_GLOBAL(emergency_shuttle)
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/fire()
|
|
if (wait_for_launch)
|
|
if (evac && auto_recall && world.time >= auto_recall_time)
|
|
recall()
|
|
if (world.time >= launch_time) //time to launch the shuttle
|
|
stop_launch_countdown()
|
|
|
|
if (!shuttle.location) //leaving from the station
|
|
//launch the pods!
|
|
for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods)
|
|
if (!pod.arming_controller || pod.arming_controller.armed)
|
|
pod.launch(src)
|
|
|
|
if (autopilot)
|
|
shuttle.launch(src)
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/proc/shuttle_arrived()
|
|
if (!shuttle.location) //at station
|
|
if (autopilot)
|
|
set_launch_countdown(SHUTTLE_LEAVETIME) //get ready to return
|
|
|
|
if (evac)
|
|
emergency_shuttle_docked.Announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.")
|
|
else
|
|
priority_announcement.Announce("The scheduled Crew Transfer Shuttle to [dock_name] has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.")
|
|
|
|
//arm the escape pods
|
|
if (evac)
|
|
for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods)
|
|
if (pod.arming_controller)
|
|
pod.arming_controller.arm()
|
|
|
|
//begins the launch countdown and sets the amount of time left until launch
|
|
/datum/controller/subsystem/emergency_shuttle/proc/set_launch_countdown(var/seconds)
|
|
wait_for_launch = 1
|
|
launch_time = world.time + seconds*10
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/proc/stop_launch_countdown()
|
|
wait_for_launch = 0
|
|
|
|
//calls the shuttle for an emergency evacuation
|
|
/datum/controller/subsystem/emergency_shuttle/proc/call_evac()
|
|
if(!can_call()) return
|
|
|
|
//set the launch timer
|
|
autopilot = 1
|
|
set_launch_countdown(get_shuttle_prep_time())
|
|
auto_recall_time = rand(world.time + 300, launch_time - 300)
|
|
|
|
//reset the shuttle transit time if we need to
|
|
shuttle.move_time = SHUTTLE_TRANSIT_DURATION
|
|
|
|
evac = 1
|
|
emergency_shuttle_called.Announce("An emergency evacuation shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
|
|
for(var/area/A in world)
|
|
if(istype(A, /area/hallway))
|
|
A.readyalert()
|
|
|
|
//calls the shuttle for a routine crew transfer
|
|
/datum/controller/subsystem/emergency_shuttle/proc/call_transfer()
|
|
if(!can_call()) return
|
|
|
|
//set the launch timer
|
|
autopilot = 1
|
|
set_launch_countdown(get_shuttle_prep_time())
|
|
auto_recall_time = rand(world.time + 300, launch_time - 300)
|
|
|
|
//reset the shuttle transit time if we need to
|
|
shuttle.move_time = SHUTTLE_TRANSIT_DURATION
|
|
|
|
priority_announcement.Announce("A crew transfer to [dock_name] has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
|
|
|
|
//recalls the shuttle
|
|
/datum/controller/subsystem/emergency_shuttle/proc/recall()
|
|
if (!can_recall()) return
|
|
|
|
wait_for_launch = 0
|
|
shuttle.cancel_launch(src)
|
|
|
|
if (evac)
|
|
emergency_shuttle_recalled.Announce("The emergency shuttle has been recalled.")
|
|
|
|
for(var/area/A in world)
|
|
if(istype(A, /area/hallway))
|
|
A.readyreset()
|
|
evac = 0
|
|
else
|
|
priority_announcement.Announce("The scheduled crew transfer has been cancelled.")
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/proc/can_call()
|
|
if (!universe.OnShuttleCall(null))
|
|
return 0
|
|
if (deny_shuttle)
|
|
return 0
|
|
if (shuttle.moving_status != SHUTTLE_IDLE || !shuttle.location) //must be idle at centcom
|
|
return 0
|
|
if (wait_for_launch) //already launching
|
|
return 0
|
|
return 1
|
|
|
|
//this only returns 0 if it would absolutely make no sense to recall
|
|
//e.g. the shuttle is already at the station or wasn't called to begin with
|
|
//other reasons for the shuttle not being recallable should be handled elsewhere
|
|
/datum/controller/subsystem/emergency_shuttle/proc/can_recall()
|
|
if (shuttle.moving_status == SHUTTLE_INTRANSIT) //if the shuttle is already in transit then it's too late
|
|
return 0
|
|
if (!shuttle.location) //already at the station.
|
|
return 0
|
|
if (!wait_for_launch) //we weren't going anywhere, anyways...
|
|
return 0
|
|
return 1
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/proc/get_shuttle_prep_time()
|
|
// During mutiny rounds, the shuttle takes twice as long.
|
|
if(SSticker.mode)
|
|
return SHUTTLE_PREPTIME * SSticker.mode.shuttle_delay
|
|
return SHUTTLE_PREPTIME
|
|
|
|
|
|
/*
|
|
These procs are not really used by the controller itself, but are for other parts of the
|
|
game whose logic depends on the emergency shuttle.
|
|
*/
|
|
|
|
//returns 1 if the shuttle is docked at the station and waiting to leave
|
|
/datum/controller/subsystem/emergency_shuttle/proc/waiting_to_leave()
|
|
if (shuttle.location)
|
|
return 0 //not at station
|
|
return (wait_for_launch || shuttle.moving_status != SHUTTLE_INTRANSIT)
|
|
|
|
//so we don't have emergency_shuttle.shuttle.location everywhere
|
|
/datum/controller/subsystem/emergency_shuttle/proc/location()
|
|
if (!shuttle)
|
|
return 1 //if we dont have a shuttle datum, just act like it's at centcom
|
|
return shuttle.location
|
|
|
|
//returns the time left until the shuttle arrives at it's destination, in seconds
|
|
/datum/controller/subsystem/emergency_shuttle/proc/estimate_arrival_time()
|
|
var/eta
|
|
if (shuttle.has_arrive_time())
|
|
//we are in transition and can get an accurate ETA
|
|
eta = shuttle.arrive_time
|
|
else
|
|
//otherwise we need to estimate the arrival time using the scheduled launch time
|
|
eta = launch_time + shuttle.move_time*10 + shuttle.warmup_time*10
|
|
return (eta - world.time)/10
|
|
|
|
//returns the time left until the shuttle launches, in seconds
|
|
/datum/controller/subsystem/emergency_shuttle/proc/estimate_launch_time()
|
|
return (launch_time - world.time)/10
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/proc/has_eta()
|
|
return (wait_for_launch || shuttle.moving_status != SHUTTLE_IDLE)
|
|
|
|
//returns 1 if the shuttle has gone to the station and come back at least once,
|
|
//used for game completion checking purposes
|
|
/datum/controller/subsystem/emergency_shuttle/proc/returned()
|
|
return (departed && shuttle.moving_status == SHUTTLE_IDLE && shuttle.location) //we've gone to the station at least once, no longer in transit and are idle back at centcom
|
|
|
|
//returns 1 if the shuttle is not idle at centcom
|
|
/datum/controller/subsystem/emergency_shuttle/proc/online()
|
|
if (!shuttle.location) //not at centcom
|
|
return 1
|
|
if (wait_for_launch || shuttle.moving_status != SHUTTLE_IDLE)
|
|
return 1
|
|
return 0
|
|
|
|
//returns 1 if the shuttle is currently in transit (or just leaving) to the station
|
|
/datum/controller/subsystem/emergency_shuttle/proc/going_to_station()
|
|
return (!shuttle.direction && shuttle.moving_status != SHUTTLE_IDLE)
|
|
|
|
//returns 1 if the shuttle is currently in transit (or just leaving) to centcom
|
|
/datum/controller/subsystem/emergency_shuttle/proc/going_to_centcom()
|
|
return (shuttle.direction && shuttle.moving_status != SHUTTLE_IDLE)
|
|
|
|
|
|
/datum/controller/subsystem/emergency_shuttle/proc/get_status_panel_eta()
|
|
if (online())
|
|
if (shuttle.has_arrive_time())
|
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
|
return "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]"
|
|
|
|
if (waiting_to_leave())
|
|
if (shuttle.moving_status == SHUTTLE_WARMUP)
|
|
return "Departing..."
|
|
|
|
var/timeleft = emergency_shuttle.estimate_launch_time()
|
|
return "ETD-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]"
|
|
|
|
return ""
|
|
/*
|
|
Some slapped-together star effects for maximum spess immershuns. Basically consists of a
|
|
spawner, an ender, and bgstar. Spawners create bgstars, bgstars shoot off into a direction
|
|
until they reach a starender.
|
|
*/
|
|
|
|
/obj/effect/bgstar
|
|
name = "star"
|
|
var/speed = 10
|
|
var/direction = SOUTH
|
|
layer = 2 // TURF_LAYER
|
|
|
|
/obj/effect/bgstar/New()
|
|
..()
|
|
pixel_x += rand(-2,30)
|
|
pixel_y += rand(-2,30)
|
|
var/starnum = pick("1", "1", "1", "2", "3", "4")
|
|
|
|
icon_state = "star"+starnum
|
|
|
|
speed = rand(2, 5)
|
|
|
|
/obj/effect/bgstar/proc/startmove()
|
|
|
|
while(src)
|
|
sleep(speed)
|
|
step(src, direction)
|
|
for(var/obj/effect/starender/E in loc)
|
|
qdel(src)
|
|
return
|
|
|
|
/obj/effect/starender
|
|
invisibility = 101
|
|
|
|
/obj/effect/starspawner
|
|
invisibility = 101
|
|
var/spawndir = SOUTH
|
|
var/spawning = 0
|
|
|
|
/obj/effect/starspawner/West
|
|
spawndir = WEST
|
|
|
|
/obj/effect/starspawner/proc/startspawn()
|
|
spawning = 1
|
|
while(spawning)
|
|
sleep(rand(2, 30))
|
|
var/obj/effect/bgstar/S = new/obj/effect/bgstar(locate(x,y,z))
|
|
S.direction = spawndir
|
|
spawn()
|
|
S.startmove()
|