mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
shuttle_controller now uses a shuttle datum
This commit is contained in:
@@ -1292,6 +1292,7 @@
|
|||||||
#include "code\modules\shuttles\departmental.dm"
|
#include "code\modules\shuttles\departmental.dm"
|
||||||
#include "code\modules\shuttles\shuttle.dm"
|
#include "code\modules\shuttles\shuttle.dm"
|
||||||
#include "code\modules\shuttles\shuttle_console.dm"
|
#include "code\modules\shuttles\shuttle_console.dm"
|
||||||
|
#include "code\modules\shuttles\shuttle_emergency.dm"
|
||||||
#include "code\modules\shuttles\shuttle_specops.dm"
|
#include "code\modules\shuttles\shuttle_specops.dm"
|
||||||
#include "code\modules\shuttles\shuttle_supply.dm"
|
#include "code\modules\shuttles\shuttle_supply.dm"
|
||||||
#include "code\modules\shuttles\shuttles_multi.dm"
|
#include "code\modules\shuttles\shuttles_multi.dm"
|
||||||
|
|||||||
@@ -5,429 +5,185 @@
|
|||||||
|
|
||||||
// these define the time taken for the shuttle to get to SS13
|
// these define the time taken for the shuttle to get to SS13
|
||||||
// and the time before it leaves again
|
// and the time before it leaves again
|
||||||
#define SHUTTLEARRIVETIME 600 // 10 minutes = 600 seconds
|
#define SHUTTLE_PREPTIME 300 // 5 minutes = 300 seconds - after this time, the shuttle cannot be recalled
|
||||||
#define SHUTTLELEAVETIME 180 // 3 minutes = 180 seconds
|
#define SHUTTLE_LEAVETIME 180 // 3 minutes = 180 seconds - the duration for which the shuttle will wait at the station
|
||||||
#define SHUTTLETRANSITTIME 120 // 2 minutes = 120 seconds
|
#define SHUTTLE_TRANSIT_DURATION 300 // 5 minutes = 300 seconds - how long it takes for the shuttle to get to the station
|
||||||
|
#define SHUTTLE_TRANSIT_DURATION_RETURN 120 // 2 minutes = 120 seconds - for some reason it takes less time to come back, go figure.
|
||||||
|
|
||||||
var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle
|
var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle
|
||||||
|
|
||||||
datum/shuttle_controller/emergency_shuttle
|
/datum/shuttle_controller/emergency_shuttle
|
||||||
var/alert = 0 //0 = emergency, 1 = crew cycle
|
var/datum/shuttle/ferry/shuttle
|
||||||
|
|
||||||
|
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/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/location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13
|
/datum/shuttle_controller/emergency_shuttle/New()
|
||||||
var/online = 0
|
if ("Escape" in shuttles && istype(shuttles["Escape"], /datum/shuttle/ferry/emergency))
|
||||||
var/direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
|
shuttle = shuttles["Escape"]
|
||||||
|
|
||||||
|
//still don't have the shuttle, so create one
|
||||||
|
if (!shuttle)
|
||||||
|
shuttle = new/datum/shuttle/ferry/emergency()
|
||||||
|
shuttle.location = 1
|
||||||
|
shuttle.warmup_time = 10
|
||||||
|
shuttle.area_offsite = locate(/area/shuttle/escape/centcom)
|
||||||
|
shuttle.area_station = locate(/area/shuttle/escape/station)
|
||||||
|
shuttle.area_transition = locate(/area/shuttle/escape/transit)
|
||||||
|
shuttle.travel_time = SHUTTLE_TRANSIT_DURATION
|
||||||
|
//shuttle.docking_controller_tag = "supply_shuttle"
|
||||||
|
//shuttle.dock_target_station = "cargo_bay"
|
||||||
|
shuttles["Escape"] = shuttle
|
||||||
|
|
||||||
var/endtime // timeofday that shuttle arrives
|
/datum/shuttle_controller/emergency_shuttle/proc/process()
|
||||||
var/timelimit //important when the shuttle gets called for more than shuttlearrivetime
|
if (wait_for_launch)
|
||||||
//timeleft = 360 //600
|
if (auto_recall && can_recall() && world.time >= auto_recall_time)
|
||||||
var/fake_recall = 0 //Used in rounds to prevent "ON NOES, IT MUST [INSERT ROUND] BECAUSE SHUTTLE CAN'T BE CALLED"
|
recall()
|
||||||
|
if (world.time >= launch_time) //time to launch the shuttle
|
||||||
var/always_fake_recall = 0
|
|
||||||
var/deny_shuttle = 0 //for admins not allowing it to be called.
|
//set the travel time
|
||||||
var/departed = 0
|
if (!shuttle.location) //at station
|
||||||
// call the shuttle
|
shuttle.travel_time = SHUTTLE_TRANSIT_DURATION_RETURN
|
||||||
// if not called before, set the endtime to T+600 seconds
|
departed = 1 //technically we haven't left yet, but this should be good enough
|
||||||
// otherwise if outgoing, switch to incoming
|
//TODO launch pods
|
||||||
proc/incall(coeff = 1)
|
|
||||||
if(deny_shuttle && alert == 1) //crew transfer shuttle does not gets recalled by gamemode
|
|
||||||
return
|
|
||||||
if(endtime)
|
|
||||||
if(direction == -1)
|
|
||||||
setdirection(1)
|
|
||||||
else
|
|
||||||
settimeleft(get_shuttle_arrive_time()*coeff)
|
|
||||||
online = 1
|
|
||||||
if(always_fake_recall)
|
|
||||||
fake_recall = rand(300,500) //turning on the red lights in hallways
|
|
||||||
if(alert == 0)
|
|
||||||
for(var/area/A in world)
|
|
||||||
if(istype(A, /area/hallway))
|
|
||||||
A.readyalert()
|
|
||||||
|
|
||||||
proc/get_shuttle_arrive_time()
|
|
||||||
// During mutiny rounds, the shuttle takes twice as long.
|
|
||||||
if(ticker && istype(ticker.mode,/datum/game_mode/mutiny))
|
|
||||||
return SHUTTLEARRIVETIME * 2
|
|
||||||
|
|
||||||
return SHUTTLEARRIVETIME
|
|
||||||
|
|
||||||
datum/shuttle_controller/emergency_shuttle/proc/shuttlealert(var/X)
|
|
||||||
alert = X
|
|
||||||
|
|
||||||
datum/shuttle_controller/emergency_shuttle/proc/recall()
|
|
||||||
if(direction == 1)
|
|
||||||
var/timeleft = timeleft()
|
|
||||||
if(alert == 0)
|
|
||||||
if(timeleft >= get_shuttle_arrive_time())
|
|
||||||
return
|
|
||||||
captain_announce("The emergency shuttle has been recalled.")
|
|
||||||
world << sound('sound/AI/shuttlerecalled.ogg')
|
|
||||||
setdirection(-1)
|
|
||||||
online = 1
|
|
||||||
for(var/area/A in world)
|
|
||||||
if(istype(A, /area/hallway))
|
|
||||||
A.readyreset()
|
|
||||||
return
|
|
||||||
else //makes it possible to send shuttle back.
|
|
||||||
captain_announce("The shuttle has been recalled.")
|
|
||||||
setdirection(-1)
|
|
||||||
online = 1
|
|
||||||
alert = 0 // set alert back to 0 after an admin recall
|
|
||||||
return
|
|
||||||
|
|
||||||
// returns the time (in seconds) before shuttle arrival
|
|
||||||
// note if direction = -1, gives a count-up to SHUTTLEARRIVETIME
|
|
||||||
datum/shuttle_controller/emergency_shuttle/proc/timeleft()
|
|
||||||
if(online)
|
|
||||||
var/timeleft = round((endtime - world.timeofday)/10 ,1)
|
|
||||||
if(direction == 1 || direction == 2)
|
|
||||||
return timeleft
|
|
||||||
else
|
|
||||||
return get_shuttle_arrive_time()-timeleft
|
|
||||||
else
|
|
||||||
return get_shuttle_arrive_time()
|
|
||||||
|
|
||||||
// sets the time left to a given delay (in seconds)
|
|
||||||
datum/shuttle_controller/emergency_shuttle/proc/settimeleft(var/delay)
|
|
||||||
endtime = world.timeofday + delay * 10
|
|
||||||
timelimit = delay
|
|
||||||
|
|
||||||
// sets the shuttle direction
|
|
||||||
// 1 = towards SS13, -1 = back to centcom
|
|
||||||
datum/shuttle_controller/emergency_shuttle/proc/setdirection(var/dirn)
|
|
||||||
if(direction == dirn)
|
|
||||||
return
|
|
||||||
direction = dirn
|
|
||||||
// if changing direction, flip the timeleft by SHUTTLEARRIVETIME
|
|
||||||
var/ticksleft = endtime - world.timeofday
|
|
||||||
endtime = world.timeofday + (get_shuttle_arrive_time()*10 - ticksleft)
|
|
||||||
return
|
|
||||||
|
|
||||||
datum/shuttle_controller/emergency_shuttle/proc/process()
|
|
||||||
|
|
||||||
datum/shuttle_controller/emergency_shuttle/process()
|
|
||||||
if(!online)
|
|
||||||
return
|
|
||||||
var/timeleft = timeleft()
|
|
||||||
if(timeleft > 1e5) // midnight rollover protection
|
|
||||||
timeleft = 0
|
|
||||||
switch(location)
|
|
||||||
if(0)
|
|
||||||
|
|
||||||
/* --- Shuttle is in transit to Central Command from SS13 --- */
|
|
||||||
if(direction == 2)
|
|
||||||
if(timeleft>0)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/* --- Shuttle has arrived at Centrcal Command --- */
|
|
||||||
else
|
|
||||||
// turn off the star spawners
|
|
||||||
/*
|
|
||||||
for(var/obj/effect/starspawner/S in world)
|
|
||||||
S.spawning = 0
|
|
||||||
*/
|
|
||||||
|
|
||||||
location = 2
|
|
||||||
|
|
||||||
//main shuttle
|
|
||||||
var/area/start_location = locate(/area/shuttle/escape/transit)
|
|
||||||
var/area/end_location = locate(/area/shuttle/escape/centcom)
|
|
||||||
|
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
|
||||||
|
|
||||||
for(var/obj/machinery/door/unpowered/shuttle/D in end_location)
|
|
||||||
spawn(0)
|
|
||||||
D.locked = 0
|
|
||||||
D.open()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
|
||||||
if(M.client)
|
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
//pods
|
|
||||||
start_location = locate(/area/shuttle/escape_pod1/transit)
|
|
||||||
end_location = locate(/area/shuttle/escape_pod1/centcom)
|
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
|
||||||
|
|
||||||
for(var/obj/machinery/door/D in machines)
|
|
||||||
if( get_area(D) == end_location )
|
|
||||||
spawn(0)
|
|
||||||
D.open()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
|
||||||
if(M.client)
|
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
start_location = locate(/area/shuttle/escape_pod2/transit)
|
|
||||||
end_location = locate(/area/shuttle/escape_pod2/centcom)
|
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
|
||||||
|
|
||||||
for(var/obj/machinery/door/D in machines)
|
|
||||||
if( get_area(D) == end_location )
|
|
||||||
spawn(0)
|
|
||||||
D.open()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
|
||||||
if(M.client)
|
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
start_location = locate(/area/shuttle/escape_pod3/transit)
|
|
||||||
end_location = locate(/area/shuttle/escape_pod3/centcom)
|
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
|
||||||
|
|
||||||
for(var/obj/machinery/door/D in machines)
|
|
||||||
if( get_area(D) == end_location )
|
|
||||||
spawn(0)
|
|
||||||
D.open()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
|
||||||
if(M.client)
|
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
start_location = locate(/area/shuttle/escape_pod5/transit)
|
|
||||||
end_location = locate(/area/shuttle/escape_pod5/centcom)
|
|
||||||
start_location.move_contents_to(end_location, null, EAST)
|
|
||||||
|
|
||||||
for(var/obj/machinery/door/D in machines)
|
|
||||||
if( get_area(D) == end_location )
|
|
||||||
spawn(0)
|
|
||||||
D.open()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
|
||||||
if(M.client)
|
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
online = 0
|
|
||||||
|
|
||||||
return 1
|
|
||||||
|
|
||||||
/* --- Shuttle has docked centcom after being recalled --- */
|
|
||||||
if(timeleft>timelimit)
|
|
||||||
online = 0
|
|
||||||
direction = 1
|
|
||||||
endtime = null
|
|
||||||
|
|
||||||
return 0
|
|
||||||
|
|
||||||
else if((fake_recall != 0) && (timeleft <= fake_recall))
|
|
||||||
recall()
|
|
||||||
fake_recall = 0
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/* --- Shuttle has docked with the station - begin countdown to transit --- */
|
|
||||||
else if(timeleft <= 0)
|
|
||||||
location = 1
|
|
||||||
var/area/start_location = locate(/area/shuttle/escape/centcom)
|
|
||||||
var/area/end_location = locate(/area/shuttle/escape/station)
|
|
||||||
|
|
||||||
var/list/dstturfs = list()
|
|
||||||
var/throwy = world.maxy
|
|
||||||
|
|
||||||
for(var/turf/T in end_location)
|
|
||||||
dstturfs += T
|
|
||||||
if(T.y < throwy)
|
|
||||||
throwy = T.y
|
|
||||||
|
|
||||||
// hey you, get out of the way!
|
|
||||||
for(var/turf/T in dstturfs)
|
|
||||||
// find the turf to move things to
|
|
||||||
var/turf/D = locate(T.x, throwy - 1, 1)
|
|
||||||
//var/turf/E = get_step(D, SOUTH)
|
|
||||||
for(var/atom/movable/AM as mob|obj in T)
|
|
||||||
AM.Move(D)
|
|
||||||
// NOTE: Commenting this out to avoid recreating mass driver glitch
|
|
||||||
/*
|
|
||||||
spawn(0)
|
|
||||||
AM.throw_at(E, 1, 1)
|
|
||||||
return
|
|
||||||
*/
|
|
||||||
|
|
||||||
if(istype(T, /turf/simulated))
|
|
||||||
del(T)
|
|
||||||
|
|
||||||
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
|
|
||||||
bug.gib()
|
|
||||||
|
|
||||||
for(var/mob/living/simple_animal/pest in end_location) // And for the other kind of bug...
|
|
||||||
pest.gib()
|
|
||||||
|
|
||||||
start_location.move_contents_to(end_location)
|
|
||||||
settimeleft(SHUTTLELEAVETIME)
|
|
||||||
//send2irc("Server", "The Emergency Shuttle has docked with the station.")
|
|
||||||
captain_announce("The Emergency Shuttle has docked with the station. You have [round(timeleft()/60,1)] minutes to board the Emergency Shuttle.")
|
|
||||||
world << sound('sound/AI/shuttledock.ogg')
|
|
||||||
|
|
||||||
return 1
|
|
||||||
|
|
||||||
if(1)
|
|
||||||
|
|
||||||
// Just before it leaves, close the damn doors!
|
|
||||||
if(timeleft == 2 || timeleft == 1)
|
|
||||||
var/area/start_location = locate(/area/shuttle/escape/station)
|
|
||||||
for(var/obj/machinery/door/unpowered/shuttle/D in start_location)
|
|
||||||
spawn(0)
|
|
||||||
D.close()
|
|
||||||
D.locked = 1
|
|
||||||
|
|
||||||
if(timeleft>0)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/* --- Shuttle leaves the station, enters transit --- */
|
|
||||||
else
|
else
|
||||||
|
shuttle.travel_time = SHUTTLE_TRANSIT_DURATION
|
||||||
|
|
||||||
|
shuttle.launch(src)
|
||||||
|
|
||||||
// Turn on the star effects
|
//called when the shuttle has arrived.
|
||||||
|
/datum/shuttle_controller/emergency_shuttle/proc/shuttle_arrived()
|
||||||
|
if (!shuttle.location) //at station
|
||||||
|
launch_time = world.time + SHUTTLE_LEAVETIME
|
||||||
|
wait_for_launch = 1 //get ready to return
|
||||||
|
|
||||||
/* // kinda buggy atm, i'll fix this later
|
//returns the time left until the shuttle arrives at it's destination, in ticks
|
||||||
for(var/obj/effect/starspawner/S in world)
|
/datum/shuttle_controller/emergency_shuttle/proc/estimate_arrival_time()
|
||||||
if(!S.spawning)
|
var/eta = launch_time + shuttle.travel_time
|
||||||
spawn() S.startspawn()
|
return (eta - world.time)
|
||||||
*/
|
|
||||||
|
|
||||||
departed = 1 // It's going!
|
//returns the time left until the shuttle launches, in ticks
|
||||||
location = 0 // in deep space
|
/datum/shuttle_controller/emergency_shuttle/proc/estimate_launch_time()
|
||||||
direction = 2 // heading to centcom
|
return (launch_time - world.time)
|
||||||
|
|
||||||
//main shuttle
|
/datum/shuttle_controller/emergency_shuttle/proc/has_eta()
|
||||||
var/area/start_location = locate(/area/shuttle/escape/station)
|
return (wait_for_launch || shuttle.moving_status != SHUTTLE_IDLE)
|
||||||
var/area/end_location = locate(/area/shuttle/escape/transit)
|
|
||||||
|
|
||||||
settimeleft(SHUTTLETRANSITTIME)
|
//returns 1 if the shuttle has gone to the station and come back at least once,
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
//used for game completion checking purposes
|
||||||
|
/datum/shuttle_controller/emergency_shuttle/proc/returned()
|
||||||
|
return 0 //TODO
|
||||||
|
|
||||||
// Close shuttle doors, lock
|
//returns 1 if the shuttle is not idle at centcom
|
||||||
for(var/obj/machinery/door/unpowered/shuttle/D in end_location)
|
/datum/shuttle_controller/emergency_shuttle/proc/online()
|
||||||
spawn(0)
|
if (!shuttle.location) //not at centcom
|
||||||
D.close()
|
return 1
|
||||||
D.locked = 1
|
if (wait_for_launch || shuttle.moving_status != SHUTTLE_IDLE)
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
// Some aesthetic turbulance shaking
|
//returns 1 if the shuttle is currently in transit (or just leaving) to the station
|
||||||
for(var/mob/M in end_location)
|
/datum/shuttle_controller/emergency_shuttle/proc/going_to_station()
|
||||||
if(M.client)
|
return (!shuttle.direction && shuttle.moving_status != SHUTTLE_IDLE)
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
//pods
|
//returns 1 if the shuttle is currently in transit (or just leaving) to centcom
|
||||||
start_location = locate(/area/shuttle/escape_pod1/station)
|
/datum/shuttle_controller/emergency_shuttle/proc/going_to_centcom()
|
||||||
end_location = locate(/area/shuttle/escape_pod1/transit)
|
return (shuttle.direction && shuttle.moving_status != SHUTTLE_IDLE)
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
|
||||||
for(var/obj/machinery/door/D in end_location)
|
|
||||||
spawn(0)
|
|
||||||
D.close()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
//returns 1 if the shuttle is docked at the station and waiting to leave
|
||||||
if(M.client)
|
/datum/shuttle_controller/emergency_shuttle/proc/waiting_to_leave()
|
||||||
spawn(0)
|
if (shuttle.location)
|
||||||
if(M.buckled)
|
return 0 //not at station
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
if (!wait_for_launch)
|
||||||
else
|
return 0 //not going anywhere
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
if (shuttle.moving_status != SHUTTLE_IDLE)
|
||||||
if(istype(M, /mob/living/carbon))
|
return 0 //shuttle is doing stuff
|
||||||
if(!M.buckled)
|
return 1
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
start_location = locate(/area/shuttle/escape_pod2/station)
|
//so we don't have emergency_shuttle.shuttle.location everywhere
|
||||||
end_location = locate(/area/shuttle/escape_pod2/transit)
|
/datum/shuttle_controller/emergency_shuttle/proc/location()
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
if (!shuttle)
|
||||||
for(var/obj/machinery/door/D in end_location)
|
return 1 //if we dont have a shuttle datum, just act like it's at centcom
|
||||||
spawn(0)
|
return shuttle.location
|
||||||
D.close()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
//calls the shuttle for an emergency evacuation
|
||||||
if(M.client)
|
/datum/shuttle_controller/emergency_shuttle/proc/call_evac()
|
||||||
spawn(0)
|
if(!can_call()) return
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
//set the launch timer
|
||||||
else
|
launch_time = world.time + get_shuttle_prep_time()
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
auto_recall_time = world.time + rand(300,500)
|
||||||
if(istype(M, /mob/living/carbon))
|
wait_for_launch = 1
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
evac = 1
|
||||||
|
captain_announce("An emergency evacuation shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
|
||||||
|
world << sound('sound/AI/shuttlecalled.ogg')
|
||||||
|
for(var/area/A in world)
|
||||||
|
if(istype(A, /area/hallway))
|
||||||
|
A.readyalert()
|
||||||
|
|
||||||
start_location = locate(/area/shuttle/escape_pod3/station)
|
//calls the shuttle for a routine crew transfer
|
||||||
end_location = locate(/area/shuttle/escape_pod3/transit)
|
/datum/shuttle_controller/emergency_shuttle/proc/call_transfer()
|
||||||
start_location.move_contents_to(end_location, null, NORTH)
|
if(!can_call()) return
|
||||||
for(var/obj/machinery/door/D in end_location)
|
|
||||||
spawn(0)
|
|
||||||
D.close()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
//set the launch timer
|
||||||
if(M.client)
|
launch_time = world.time + get_shuttle_prep_time()
|
||||||
spawn(0)
|
auto_recall_time = world.time + rand(100,SHUTTLE_PREPTIME-30)
|
||||||
if(M.buckled)
|
wait_for_launch = 1
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in [round(estimate_arrival_time()/60)] minutes.")
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
start_location = locate(/area/shuttle/escape_pod5/station)
|
//recalls the shuttle
|
||||||
end_location = locate(/area/shuttle/escape_pod5/transit)
|
/datum/shuttle_controller/emergency_shuttle/proc/recall()
|
||||||
start_location.move_contents_to(end_location, null, EAST)
|
if (!can_recall()) return
|
||||||
for(var/obj/machinery/door/D in end_location)
|
|
||||||
spawn(0)
|
|
||||||
D.close()
|
|
||||||
|
|
||||||
for(var/mob/M in end_location)
|
wait_for_launch = 0
|
||||||
if(M.client)
|
shuttle.cancel_launch(src)
|
||||||
spawn(0)
|
|
||||||
if(M.buckled)
|
|
||||||
shake_camera(M, 4, 1) // buckled, not a lot of shaking
|
|
||||||
else
|
|
||||||
shake_camera(M, 10, 2) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
|
||||||
if(istype(M, /mob/living/carbon))
|
|
||||||
if(!M.buckled)
|
|
||||||
M.Weaken(5)
|
|
||||||
|
|
||||||
captain_announce("The Emergency Shuttle has left the station. Estimate [round(timeleft()/60,1)] minutes until the shuttle docks at Central Command.")
|
if (evac)
|
||||||
|
captain_announce("The emergency shuttle has been recalled.")
|
||||||
|
world << sound('sound/AI/shuttlerecalled.ogg')
|
||||||
|
|
||||||
|
for(var/area/A in world)
|
||||||
|
if(istype(A, /area/hallway))
|
||||||
|
A.readyreset()
|
||||||
|
evac = 0
|
||||||
|
else
|
||||||
|
captain_announce("The scheduled crew transfer has been cancelled.")
|
||||||
|
|
||||||
return 1
|
/datum/shuttle_controller/emergency_shuttle/proc/can_call()
|
||||||
|
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
|
||||||
|
|
||||||
else
|
//this only returns 0 if it would absolutely make no sense to recall
|
||||||
return 1
|
//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/shuttle_controller/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/shuttle_controller/emergency_shuttle/proc/get_shuttle_prep_time()
|
||||||
|
// During mutiny rounds, the shuttle takes twice as long.
|
||||||
|
if(ticker && istype(ticker.mode,/datum/game_mode/mutiny))
|
||||||
|
return SHUTTLE_PREPTIME * 3 //15 minutes
|
||||||
|
|
||||||
|
return SHUTTLE_PREPTIME
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Some slapped-together star effects for maximum spess immershuns. Basically consists of a
|
Some slapped-together star effects for maximum spess immershuns. Basically consists of a
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ Implants;
|
|||||||
|
|
||||||
|
|
||||||
/datum/game_mode/proc/check_finished() //to be called by ticker
|
/datum/game_mode/proc/check_finished() //to be called by ticker
|
||||||
if(emergency_shuttle.location==2 || station_was_nuked)
|
if(emergency_shuttle.returned() || station_was_nuked)
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -315,10 +315,10 @@ var/global/datum/controller/gameticker/ticker
|
|||||||
var/game_finished = 0
|
var/game_finished = 0
|
||||||
var/mode_finished = 0
|
var/mode_finished = 0
|
||||||
if (config.continous_rounds)
|
if (config.continous_rounds)
|
||||||
game_finished = (emergency_shuttle.location == 2 || mode.station_was_nuked)
|
game_finished = (emergency_shuttle.returned() || mode.station_was_nuked)
|
||||||
mode_finished = (!post_game && mode.check_finished())
|
mode_finished = (!post_game && mode.check_finished())
|
||||||
else
|
else
|
||||||
game_finished = (mode.check_finished() || (emergency_shuttle.location == 2 && emergency_shuttle.alert == 1))
|
game_finished = (mode.check_finished() || (emergency_shuttle.returned() && emergency_shuttle.evac == 1))
|
||||||
mode_finished = game_finished
|
mode_finished = game_finished
|
||||||
|
|
||||||
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))
|
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
AI_mind.current.icon_state = "ai-malf2"
|
AI_mind.current.icon_state = "ai-malf2"
|
||||||
*/
|
*/
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
emergency_shuttle.always_fake_recall = 1
|
emergency_shuttle.auto_recall = 1
|
||||||
spawn (rand(waittime_l, waittime_h))
|
spawn (rand(waittime_l, waittime_h))
|
||||||
send_intercept()
|
send_intercept()
|
||||||
..()
|
..()
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
if (is_malf_ai_dead())
|
if (is_malf_ai_dead())
|
||||||
if(config.continous_rounds)
|
if(config.continous_rounds)
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
emergency_shuttle.always_fake_recall = 0
|
emergency_shuttle.auto_recall = 0
|
||||||
malf_mode_declared = 0
|
malf_mode_declared = 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
|
|
||||||
/datum/game_mode/malfunction/declare_completion()
|
/datum/game_mode/malfunction/declare_completion()
|
||||||
var/malf_dead = is_malf_ai_dead()
|
var/malf_dead = is_malf_ai_dead()
|
||||||
var/crew_evacuated = (emergency_shuttle.location==2)
|
var/crew_evacuated = (emergency_shuttle.returned())
|
||||||
|
|
||||||
if ( station_captured && station_was_nuked)
|
if ( station_captured && station_was_nuked)
|
||||||
feedback_set_details("round_end_result","win - AI win - nuke")
|
feedback_set_details("round_end_result","win - AI win - nuke")
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ datum
|
|||||||
explanation_text = "Frame [target.current.real_name], the [target.assigned_role] for a crime and make sure they are arrested and brought back to the Centcom station alive. We'll handle the rest from there."
|
explanation_text = "Frame [target.current.real_name], the [target.assigned_role] for a crime and make sure they are arrested and brought back to the Centcom station alive. We'll handle the rest from there."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
if(target.current.stat == 2)
|
if(target.current.stat == 2)
|
||||||
return 0
|
return 0
|
||||||
@@ -313,7 +313,7 @@ datum
|
|||||||
explanation_text = "[target.current.real_name], the [target.assigned_role] is a [pick("relative of a","friend of a","") + pick("high ranking","important","well-liked")] Syndicate [pick("Leader","Officer","Agent","sympathiser")]. Make sure they get off the station safely, while minimizing intervention."
|
explanation_text = "[target.current.real_name], the [target.assigned_role] is a [pick("relative of a","friend of a","") + pick("high ranking","important","well-liked")] Syndicate [pick("Leader","Officer","Agent","sympathiser")]. Make sure they get off the station safely, while minimizing intervention."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(target.current.stat == 2)
|
if(target.current.stat == 2)
|
||||||
@@ -477,7 +477,7 @@ datum
|
|||||||
explanation_text = "Hijack the emergency shuttle by escaping alone."
|
explanation_text = "Hijack the emergency shuttle by escaping alone."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(!owner.current || owner.current.stat == 2)
|
if(!owner.current || owner.current.stat == 2)
|
||||||
@@ -512,7 +512,7 @@ datum
|
|||||||
explanation_text = "Escape on the shuttle alive, without being arrested."
|
explanation_text = "Escape on the shuttle alive, without being arrested."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(!owner.current || owner.current.stat ==2)
|
if(!owner.current || owner.current.stat ==2)
|
||||||
@@ -1224,7 +1224,7 @@ datum
|
|||||||
check_completion()
|
check_completion()
|
||||||
if(!istype(owner.current, /mob/living/silicon))
|
if(!istype(owner.current, /mob/living/silicon))
|
||||||
return 0
|
return 0
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
if(!owner.current)
|
if(!owner.current)
|
||||||
return 0
|
return 0
|
||||||
@@ -1447,7 +1447,7 @@ datum/objective/silence
|
|||||||
explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
|
explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/area/shuttle = locate(/area/shuttle/escape/centcom)
|
var/area/shuttle = locate(/area/shuttle/escape/centcom)
|
||||||
|
|||||||
@@ -277,7 +277,7 @@
|
|||||||
if(!is_type_in_list(disk_area, centcom_areas))
|
if(!is_type_in_list(disk_area, centcom_areas))
|
||||||
disk_rescued = 0
|
disk_rescued = 0
|
||||||
break
|
break
|
||||||
var/crew_evacuated = (emergency_shuttle.location==2)
|
var/crew_evacuated = (emergency_shuttle.returned())
|
||||||
//var/operatives_are_dead = is_operatives_are_dead()
|
//var/operatives_are_dead = is_operatives_are_dead()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ datum/objective/hijack
|
|||||||
check_completion()
|
check_completion()
|
||||||
if(!owner.current || owner.current.stat)
|
if(!owner.current || owner.current.stat)
|
||||||
return 0
|
return 0
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
if(issilicon(owner.current))
|
if(issilicon(owner.current))
|
||||||
return 0
|
return 0
|
||||||
@@ -307,7 +307,7 @@ datum/objective/block
|
|||||||
check_completion()
|
check_completion()
|
||||||
if(!istype(owner.current, /mob/living/silicon))
|
if(!istype(owner.current, /mob/living/silicon))
|
||||||
return 0
|
return 0
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
if(!owner.current)
|
if(!owner.current)
|
||||||
return 0
|
return 0
|
||||||
@@ -325,7 +325,7 @@ datum/objective/silence
|
|||||||
explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
|
explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
for(var/mob/living/player in player_list)
|
for(var/mob/living/player in player_list)
|
||||||
@@ -350,7 +350,7 @@ datum/objective/escape
|
|||||||
return 0
|
return 0
|
||||||
if(isbrain(owner.current))
|
if(isbrain(owner.current))
|
||||||
return 0
|
return 0
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
if(!owner.current || owner.current.stat ==2)
|
if(!owner.current || owner.current.stat ==2)
|
||||||
return 0
|
return 0
|
||||||
@@ -709,7 +709,7 @@ datum/objective/absorb
|
|||||||
explanation_text = "Our knowledge must live on. Make sure at least 5 acolytes escape on the shuttle to spread their work on an another station."
|
explanation_text = "Our knowledge must live on. Make sure at least 5 acolytes escape on the shuttle to spread their work on an another station."
|
||||||
|
|
||||||
check_completion()
|
check_completion()
|
||||||
if(emergency_shuttle.location<2)
|
if(!emergency_shuttle.returned())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/cultists_escaped = 0
|
var/cultists_escaped = 0
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
greet_revolutionary(rev_mind)
|
greet_revolutionary(rev_mind)
|
||||||
modePlayer += head_revolutionaries
|
modePlayer += head_revolutionaries
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
emergency_shuttle.always_fake_recall = 1
|
emergency_shuttle.auto_recall = 1
|
||||||
spawn (rand(waittime_l, waittime_h))
|
spawn (rand(waittime_l, waittime_h))
|
||||||
send_intercept()
|
send_intercept()
|
||||||
..()
|
..()
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
if(config.continous_rounds)
|
if(config.continous_rounds)
|
||||||
if(finished != 0)
|
if(finished != 0)
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
emergency_shuttle.always_fake_recall = 0
|
emergency_shuttle.auto_recall = 0
|
||||||
return ..()
|
return ..()
|
||||||
if(finished != 0)
|
if(finished != 0)
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -18,4 +18,4 @@
|
|||||||
/datum/game_mode/sandbox/post_setup()
|
/datum/game_mode/sandbox/post_setup()
|
||||||
..()
|
..()
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
emergency_shuttle.always_fake_recall = 1
|
emergency_shuttle.auto_recall = 1
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
if("callshuttle2")
|
if("callshuttle2")
|
||||||
if(src.authenticated)
|
if(src.authenticated)
|
||||||
call_shuttle_proc(usr)
|
call_shuttle_proc(usr)
|
||||||
if(emergency_shuttle.online)
|
if(emergency_shuttle.online())
|
||||||
post_status("shuttle")
|
post_status("shuttle")
|
||||||
src.state = STATE_DEFAULT
|
src.state = STATE_DEFAULT
|
||||||
if("cancelshuttle")
|
if("cancelshuttle")
|
||||||
@@ -284,8 +284,8 @@
|
|||||||
|
|
||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
var/dat = "<head><title>Communications Console</title></head><body>"
|
var/dat = "<head><title>Communications Console</title></head><body>"
|
||||||
if (emergency_shuttle.online && emergency_shuttle.location==0)
|
if (emergency_shuttle.has_eta())
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]<BR>"
|
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]<BR>"
|
||||||
|
|
||||||
if (istype(user, /mob/living/silicon))
|
if (istype(user, /mob/living/silicon))
|
||||||
@@ -309,8 +309,8 @@
|
|||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=RestoreBackup'>Restore Backup Routing Data</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=RestoreBackup'>Restore Backup Routing Data</A> \]"
|
||||||
|
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=changeseclevel'>Change alert level</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=changeseclevel'>Change alert level</A> \]"
|
||||||
if(emergency_shuttle.location==0)
|
if(!emergency_shuttle.location())
|
||||||
if (emergency_shuttle.online)
|
if (emergency_shuttle.online())
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=cancelshuttle'>Cancel Shuttle Call</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=cancelshuttle'>Cancel Shuttle Call</A> \]"
|
||||||
else
|
else
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=callshuttle'>Call Emergency Shuttle</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=callshuttle'>Call Emergency Shuttle</A> \]"
|
||||||
@@ -377,7 +377,7 @@
|
|||||||
var/dat = ""
|
var/dat = ""
|
||||||
switch(src.aistate)
|
switch(src.aistate)
|
||||||
if(STATE_DEFAULT)
|
if(STATE_DEFAULT)
|
||||||
if(emergency_shuttle.location==0 && !emergency_shuttle.online)
|
if(!emergency_shuttle.location() && !emergency_shuttle.online())
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-callshuttle'>Call Emergency Shuttle</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-callshuttle'>Call Emergency Shuttle</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-messagelist'>Message List</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-messagelist'>Message List</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-status'>Set Status Display</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-status'>Set Status Display</A> \]"
|
||||||
@@ -424,22 +424,26 @@
|
|||||||
PS.allowedtocall = !(PS.allowedtocall)
|
PS.allowedtocall = !(PS.allowedtocall)
|
||||||
|
|
||||||
/proc/call_shuttle_proc(var/mob/user)
|
/proc/call_shuttle_proc(var/mob/user)
|
||||||
if ((!( ticker ) || emergency_shuttle.location))
|
if ((!( ticker ) || !emergency_shuttle.location()))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(sent_strike_team == 1)
|
if(sent_strike_team == 1)
|
||||||
user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated."
|
user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE
|
if(emergency_shuttle.deny_shuttle)
|
||||||
user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minutes before trying again."
|
user << "The emergency shuttle may not be sent at this time. Please try again later."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(emergency_shuttle.direction == -1)
|
if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE
|
||||||
|
user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/60)] minutes before trying again."
|
||||||
|
return
|
||||||
|
|
||||||
|
if(emergency_shuttle.going_to_centcom())
|
||||||
user << "The emergency shuttle may not be called while returning to CentCom."
|
user << "The emergency shuttle may not be called while returning to CentCom."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(emergency_shuttle.online)
|
if(emergency_shuttle.online())
|
||||||
user << "The emergency shuttle is already on its way."
|
user << "The emergency shuttle is already on its way."
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -447,23 +451,22 @@
|
|||||||
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||||
return
|
return
|
||||||
|
|
||||||
emergency_shuttle.incall()
|
emergency_shuttle.call_evac()
|
||||||
log_game("[key_name(user)] has called the shuttle.")
|
log_game("[key_name(user)] has called the shuttle.")
|
||||||
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
|
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
|
||||||
world << sound('sound/AI/shuttlecalled.ogg')
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
/proc/init_shift_change(var/mob/user, var/force = 0)
|
/proc/init_shift_change(var/mob/user, var/force = 0)
|
||||||
if ((!( ticker ) || emergency_shuttle.location))
|
if ((!( ticker ) || !emergency_shuttle.location()))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(emergency_shuttle.direction == -1)
|
if(emergency_shuttle.going_to_centcom())
|
||||||
user << "The shuttle may not be called while returning to CentCom."
|
user << "The shuttle may not be called while returning to CentCom."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(emergency_shuttle.online)
|
if(emergency_shuttle.online())
|
||||||
user << "The shuttle is already on its way."
|
user << "The shuttle is already on its way."
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -478,32 +481,30 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
if(world.time < 54000) // 30 minute grace period to let the game get going
|
if(world.time < 54000) // 30 minute grace period to let the game get going
|
||||||
user << "The shuttle is refueling. Please wait another [round((54000-world.time)/600)] minutes before trying again."//may need to change "/600"
|
user << "The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "sandbox")
|
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "sandbox")
|
||||||
//New version pretends to call the shuttle but cause the shuttle to return after a random duration.
|
//New version pretends to call the shuttle but cause the shuttle to return after a random duration.
|
||||||
emergency_shuttle.fake_recall = rand(300,500)
|
emergency_shuttle.auto_recall = 1
|
||||||
|
|
||||||
if(ticker.mode.name == "blob" || ticker.mode.name == "epidemic")
|
if(ticker.mode.name == "blob" || ticker.mode.name == "epidemic")
|
||||||
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||||
return
|
return
|
||||||
|
|
||||||
emergency_shuttle.shuttlealert(1)
|
emergency_shuttle.call_transfer()
|
||||||
emergency_shuttle.incall()
|
|
||||||
log_game("[key_name(user)] has called the shuttle.")
|
log_game("[key_name(user)] has called the shuttle.")
|
||||||
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
|
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
|
||||||
captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
/proc/cancel_call_proc(var/mob/user)
|
/proc/cancel_call_proc(var/mob/user)
|
||||||
if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0 || emergency_shuttle.timeleft() < 300))
|
if (!( ticker ) || !emergency_shuttle.can_recall())
|
||||||
return
|
return
|
||||||
if((ticker.mode.name == "blob")||(ticker.mode.name == "meteor"))
|
if((ticker.mode.name == "blob")||(ticker.mode.name == "meteor"))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(emergency_shuttle.direction != -1 && emergency_shuttle.online) //check that shuttle isn't already heading to centcomm
|
if(!emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to centcomm
|
||||||
emergency_shuttle.recall()
|
emergency_shuttle.recall()
|
||||||
log_game("[key_name(user)] has recalled the shuttle.")
|
log_game("[key_name(user)] has recalled the shuttle.")
|
||||||
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
|
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
|
||||||
@@ -549,11 +550,9 @@
|
|||||||
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
|
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
emergency_shuttle.incall(2)
|
emergency_shuttle.call_evac()
|
||||||
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
||||||
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
|
||||||
world << sound('sound/AI/shuttlecalled.ogg')
|
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -574,10 +573,8 @@
|
|||||||
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
|
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
emergency_shuttle.incall(2)
|
emergency_shuttle.call_evac()
|
||||||
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
||||||
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
|
||||||
world << sound('sound/AI/shuttlecalled.ogg')
|
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob)
|
attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob)
|
||||||
if(stat & (BROKEN|NOPOWER)) return
|
if(stat & (BROKEN|NOPOWER)) return
|
||||||
if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
|
if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location() || !( user ))) return
|
||||||
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||||
if (istype(W, /obj/item/device/pda))
|
if (istype(W, /obj/item/device/pda))
|
||||||
var/obj/item/device/pda/pda = W
|
var/obj/item/device/pda/pda = W
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
|
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
|
||||||
if(emergency_shuttle.location != 1 && user.get_active_hand() != W)
|
if(emergency_shuttle.location() && user.get_active_hand() != W)
|
||||||
return 0
|
return 0
|
||||||
switch(choice)
|
switch(choice)
|
||||||
if("Authorize")
|
if("Authorize")
|
||||||
@@ -41,8 +41,7 @@
|
|||||||
message_admins("[key_name_admin(user)] has launched the shuttle")
|
message_admins("[key_name_admin(user)] has launched the shuttle")
|
||||||
log_game("[user.ckey] has launched the shuttle early")
|
log_game("[user.ckey] has launched the shuttle early")
|
||||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||||
emergency_shuttle.online = 1
|
emergency_shuttle.launch_time = min(world.time + 100, emergency_shuttle.launch_time)
|
||||||
emergency_shuttle.settimeleft(10)
|
|
||||||
//src.authorized = null
|
//src.authorized = null
|
||||||
del(src.authorized)
|
del(src.authorized)
|
||||||
src.authorized = list( )
|
src.authorized = list( )
|
||||||
@@ -59,11 +58,11 @@
|
|||||||
else if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
else if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||||
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
|
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
|
||||||
|
|
||||||
if(!emagged && emergency_shuttle.location == 1 && user.get_active_hand() == W)
|
if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W)
|
||||||
switch(choice)
|
switch(choice)
|
||||||
if("Launch")
|
if("Launch")
|
||||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||||
emergency_shuttle.settimeleft( 10 )
|
emergency_shuttle.launch_time = min(world.time + 100, emergency_shuttle.launch_time)
|
||||||
emagged = 1
|
emagged = 1
|
||||||
if("Cancel")
|
if("Cancel")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -74,13 +74,15 @@
|
|||||||
if(0) //blank
|
if(0) //blank
|
||||||
remove_display()
|
remove_display()
|
||||||
if(1) //emergency shuttle timer
|
if(1) //emergency shuttle timer
|
||||||
if(emergency_shuttle.online)
|
if(emergency_shuttle.waiting_to_leave())
|
||||||
var/line1
|
var/line1 = "-ETD-"
|
||||||
var/line2 = get_shuttle_timer()
|
var/line2 = get_shuttle_timer_departure()
|
||||||
if(emergency_shuttle.location == 1)
|
if(length(line2) > CHARS_PER_LINE)
|
||||||
line1 = "-ETD-"
|
line2 = "Error!"
|
||||||
else
|
update_display(line1, line2)
|
||||||
line1 = "-ETA-"
|
else if(emergency_shuttle.has_eta())
|
||||||
|
var/line1 = "-ETA-"
|
||||||
|
var/line2 = get_shuttle_timer_arrival()
|
||||||
if(length(line2) > CHARS_PER_LINE)
|
if(length(line2) > CHARS_PER_LINE)
|
||||||
line2 = "Error!"
|
line2 = "Error!"
|
||||||
update_display(line1, line2)
|
update_display(line1, line2)
|
||||||
@@ -111,7 +113,7 @@
|
|||||||
if(4) // supply shuttle timer
|
if(4) // supply shuttle timer
|
||||||
var/line1 = "SUPPLY"
|
var/line1 = "SUPPLY"
|
||||||
var/line2 = ""
|
var/line2 = ""
|
||||||
|
|
||||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||||
if (!shuttle)
|
if (!shuttle)
|
||||||
line2 = "Error"
|
line2 = "Error"
|
||||||
@@ -164,8 +166,14 @@
|
|||||||
if(maptext != new_text)
|
if(maptext != new_text)
|
||||||
maptext = new_text
|
maptext = new_text
|
||||||
|
|
||||||
proc/get_shuttle_timer()
|
proc/get_shuttle_timer_arrival()
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
|
if(timeleft)
|
||||||
|
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
|
||||||
|
return ""
|
||||||
|
|
||||||
|
proc/get_shuttle_timer_departure()
|
||||||
|
var/timeleft = emergency_shuttle.estimate_launch_time()
|
||||||
if(timeleft)
|
if(timeleft)
|
||||||
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
|
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
|
||||||
return ""
|
return ""
|
||||||
@@ -174,7 +182,7 @@
|
|||||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||||
if (!shuttle)
|
if (!shuttle)
|
||||||
return "Error"
|
return "Error"
|
||||||
|
|
||||||
if(shuttle.has_eta())
|
if(shuttle.has_eta())
|
||||||
var/timeleft = round((shuttle.arrive_time - world.time) / 10,1)
|
var/timeleft = round((shuttle.arrive_time - world.time) / 10,1)
|
||||||
if(timeleft < 0)
|
if(timeleft < 0)
|
||||||
|
|||||||
@@ -397,15 +397,15 @@
|
|||||||
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
|
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
|
||||||
dat += "Round Duration: <B>[round(world.time / 36000)]:[add_zero(world.time / 600 % 60, 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B><BR>"
|
dat += "Round Duration: <B>[round(world.time / 36000)]:[add_zero(world.time / 600 % 60, 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B><BR>"
|
||||||
dat += "<B>Emergency shuttle</B><BR>"
|
dat += "<B>Emergency shuttle</B><BR>"
|
||||||
if (!emergency_shuttle.online)
|
if (!emergency_shuttle.online())
|
||||||
dat += "<a href='?src=\ref[src];call_shuttle=1'>Call Shuttle</a><br>"
|
dat += "<a href='?src=\ref[src];call_shuttle=1'>Call Shuttle</a><br>"
|
||||||
else
|
else
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_launch_time()
|
||||||
switch(emergency_shuttle.location)
|
switch(emergency_shuttle.location())
|
||||||
if(0)
|
if(1)
|
||||||
dat += "ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
dat += "ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||||
dat += "<a href='?src=\ref[src];call_shuttle=2'>Send Back</a><br>"
|
dat += "<a href='?src=\ref[src];call_shuttle=2'>Send Back</a><br>"
|
||||||
if(1)
|
if(0)
|
||||||
dat += "ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
dat += "ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||||
dat += "<a href='?src=\ref[src];delay_round_end=1'>[ticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
|
dat += "<a href='?src=\ref[src];delay_round_end=1'>[ticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
|
||||||
if(ticker.mode.syndicates.len)
|
if(ticker.mode.syndicates.len)
|
||||||
|
|||||||
@@ -214,36 +214,37 @@
|
|||||||
|
|
||||||
switch(href_list["call_shuttle"])
|
switch(href_list["call_shuttle"])
|
||||||
if("1")
|
if("1")
|
||||||
if ((!( ticker ) || emergency_shuttle.location))
|
if ((!( ticker ) || !emergency_shuttle.location()))
|
||||||
return
|
return
|
||||||
emergency_shuttle.incall()
|
if (emergency_shuttle.can_call())
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
emergency_shuttle.call_evac()
|
||||||
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
||||||
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
||||||
|
|
||||||
if("2")
|
if("2")
|
||||||
if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0))
|
if (!( ticker ) || !emergency_shuttle.location())
|
||||||
return
|
return
|
||||||
switch(emergency_shuttle.direction)
|
if (emergency_shuttle.can_call())
|
||||||
if(-1)
|
emergency_shuttle.call_evac()
|
||||||
emergency_shuttle.incall()
|
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
||||||
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
|
||||||
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
else if (emergency_shuttle.can_recall())
|
||||||
if(1)
|
emergency_shuttle.recall()
|
||||||
emergency_shuttle.recall()
|
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
|
||||||
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
|
message_admins("\blue [key_name_admin(usr)] sent the Emergency Shuttle back", 1)
|
||||||
message_admins("\blue [key_name_admin(usr)] sent the Emergency Shuttle back", 1)
|
|
||||||
|
|
||||||
href_list["secretsadmin"] = "check_antagonist"
|
href_list["secretsadmin"] = "check_antagonist"
|
||||||
|
|
||||||
else if(href_list["edit_shuttle_time"])
|
else if(href_list["edit_shuttle_time"])
|
||||||
if(!check_rights(R_SERVER)) return
|
if(!check_rights(R_SERVER)) return
|
||||||
|
|
||||||
emergency_shuttle.settimeleft( input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", emergency_shuttle.timeleft() ) as num )
|
var/new_time_left = input("Enter new shuttle launch duration (seconds):","Edit Shuttle Timeleft", emergency_shuttle.estimate_launch_time() ) as num
|
||||||
log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]")
|
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
emergency_shuttle.launch_time = world.time + new_time_left*10
|
||||||
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]", 1)
|
|
||||||
|
log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [new_time_left]")
|
||||||
|
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [new_time_left*10]", 1)
|
||||||
href_list["secretsadmin"] = "check_antagonist"
|
href_list["secretsadmin"] = "check_antagonist"
|
||||||
|
|
||||||
else if(href_list["delay_round_end"])
|
else if(href_list["delay_round_end"])
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
var/age = alert(src, "Age check", "Show accounts yonger then _____ days","7", "30" , "All")
|
var/age = alert(src, "Age check", "Show accounts yonger then _____ days","7", "30" , "All")
|
||||||
|
|
||||||
if(age == "All")
|
if(age == "All")
|
||||||
age = 9999999
|
age = 9999999
|
||||||
else
|
else
|
||||||
age = text2num(age)
|
age = text2num(age)
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
continue
|
continue
|
||||||
if(C.player_age < age)
|
if(C.player_age < age)
|
||||||
msg += "[key_name(C, 1, 1, highlight_special_characters)]: account is [C.player_age] days old<br>"
|
msg += "[key_name(C, 1, 1, highlight_special_characters)]: account is [C.player_age] days old<br>"
|
||||||
|
|
||||||
if(missing_ages)
|
if(missing_ages)
|
||||||
src << "Some accounts did not have proper ages set in their clients. This function requires database to be present"
|
src << "Some accounts did not have proper ages set in their clients. This function requires database to be present"
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ Ccomp's first proc.
|
|||||||
|
|
||||||
/client/proc/get_ghosts(var/notify = 0,var/what = 2)
|
/client/proc/get_ghosts(var/notify = 0,var/what = 2)
|
||||||
// what = 1, return ghosts ass list.
|
// what = 1, return ghosts ass list.
|
||||||
// what = 2, return mob list
|
// what = 2, return mob list
|
||||||
|
|
||||||
var/list/mobs = list()
|
var/list/mobs = list()
|
||||||
var/list/ghosts = list()
|
var/list/ghosts = list()
|
||||||
@@ -300,22 +300,22 @@ Ccomp's first proc.
|
|||||||
src << "Hrm, appears you didn't select a ghost" // Sanity check, if no ghosts in the list we don't want to edit a null variable and cause a runtime error.
|
src << "Hrm, appears you didn't select a ghost" // Sanity check, if no ghosts in the list we don't want to edit a null variable and cause a runtime error.
|
||||||
return
|
return
|
||||||
|
|
||||||
var/mob/dead/observer/G = ghosts[target]
|
var/mob/dead/observer/G = ghosts[target]
|
||||||
if(G.has_enabled_antagHUD && config.antag_hud_restricted)
|
if(G.has_enabled_antagHUD && config.antag_hud_restricted)
|
||||||
var/response = alert(src, "Are you sure you wish to allow this individual to play?","Ghost has used AntagHUD","Yes","No")
|
var/response = alert(src, "Are you sure you wish to allow this individual to play?","Ghost has used AntagHUD","Yes","No")
|
||||||
if(response == "No") return
|
if(response == "No") return
|
||||||
G.timeofdeath=-19999 /* time of death is checked in /mob/verb/abandon_mob() which is the Respawn verb.
|
G.timeofdeath=-19999 /* time of death is checked in /mob/verb/abandon_mob() which is the Respawn verb.
|
||||||
timeofdeath is used for bodies on autopsy but since we're messing with a ghost I'm pretty sure
|
timeofdeath is used for bodies on autopsy but since we're messing with a ghost I'm pretty sure
|
||||||
there won't be an autopsy.
|
there won't be an autopsy.
|
||||||
*/
|
*/
|
||||||
G.has_enabled_antagHUD = 2
|
G.has_enabled_antagHUD = 2
|
||||||
G.can_reenter_corpse = 1
|
G.can_reenter_corpse = 1
|
||||||
|
|
||||||
G:show_message(text("\blue <B>You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead.</B>"), 1)
|
G:show_message(text("\blue <B>You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead.</B>"), 1)
|
||||||
log_admin("[key_name(usr)] allowed [key_name(G)] to bypass the 30 minute respawn limit")
|
log_admin("[key_name(usr)] allowed [key_name(G)] to bypass the 30 minute respawn limit")
|
||||||
message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the 30 minute respawn limit", 1)
|
message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the 30 minute respawn limit", 1)
|
||||||
|
|
||||||
|
|
||||||
/client/proc/toggle_antagHUD_use()
|
/client/proc/toggle_antagHUD_use()
|
||||||
set category = "Server"
|
set category = "Server"
|
||||||
set name = "Toggle antagHUD usage"
|
set name = "Toggle antagHUD usage"
|
||||||
@@ -331,7 +331,7 @@ Ccomp's first proc.
|
|||||||
if(g.antagHUD)
|
if(g.antagHUD)
|
||||||
g.antagHUD = 0 // Disable it on those that have it enabled
|
g.antagHUD = 0 // Disable it on those that have it enabled
|
||||||
g.has_enabled_antagHUD = 2 // We'll allow them to respawn
|
g.has_enabled_antagHUD = 2 // We'll allow them to respawn
|
||||||
g << "\red <B>The Administrator has disabled AntagHUD </B>"
|
g << "\red <B>The Administrator has disabled AntagHUD </B>"
|
||||||
config.antag_hud_allowed = 0
|
config.antag_hud_allowed = 0
|
||||||
src << "\red <B>AntagHUD usage has been disabled</B>"
|
src << "\red <B>AntagHUD usage has been disabled</B>"
|
||||||
action = "disabled"
|
action = "disabled"
|
||||||
@@ -343,8 +343,8 @@ Ccomp's first proc.
|
|||||||
config.antag_hud_allowed = 1
|
config.antag_hud_allowed = 1
|
||||||
action = "enabled"
|
action = "enabled"
|
||||||
src << "\blue <B>AntagHUD usage has been enabled</B>"
|
src << "\blue <B>AntagHUD usage has been enabled</B>"
|
||||||
|
|
||||||
|
|
||||||
log_admin("[key_name(usr)] has [action] antagHUD usage for observers")
|
log_admin("[key_name(usr)] has [action] antagHUD usage for observers")
|
||||||
message_admins("Admin [key_name_admin(usr)] has [action] antagHUD usage for observers", 1)
|
message_admins("Admin [key_name_admin(usr)] has [action] antagHUD usage for observers", 1)
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ Ccomp's first proc.
|
|||||||
for(var/mob/dead/observer/g in get_ghosts())
|
for(var/mob/dead/observer/g in get_ghosts())
|
||||||
g << "\blue <B>The administrator has lifted restrictions on joining the round if you use AntagHUD</B>"
|
g << "\blue <B>The administrator has lifted restrictions on joining the round if you use AntagHUD</B>"
|
||||||
action = "lifted restrictions"
|
action = "lifted restrictions"
|
||||||
config.antag_hud_restricted = 0
|
config.antag_hud_restricted = 0
|
||||||
src << "\blue <B>AntagHUD restrictions have been lifted</B>"
|
src << "\blue <B>AntagHUD restrictions have been lifted</B>"
|
||||||
else
|
else
|
||||||
for(var/mob/dead/observer/g in get_ghosts())
|
for(var/mob/dead/observer/g in get_ghosts())
|
||||||
@@ -375,7 +375,7 @@ Ccomp's first proc.
|
|||||||
|
|
||||||
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
|
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
|
||||||
message_admins("Admin [key_name_admin(usr)] has [action] on joining the round if they use AntagHUD", 1)
|
message_admins("Admin [key_name_admin(usr)] has [action] on joining the round if they use AntagHUD", 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -883,7 +883,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
|||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Call Shuttle"
|
set name = "Call Shuttle"
|
||||||
|
|
||||||
if ((!( ticker ) || emergency_shuttle.location))
|
if ((!( ticker ) || emergency_shuttle.location()))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!check_rights(R_ADMIN)) return
|
if(!check_rights(R_ADMIN)) return
|
||||||
@@ -891,16 +891,21 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
|||||||
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
|
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
|
||||||
if(confirm != "Yes") return
|
if(confirm != "Yes") return
|
||||||
|
|
||||||
|
var/choice
|
||||||
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "confliction")
|
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "confliction")
|
||||||
var/choice = input("The shuttle will just return if you call it. Call anyway?") in list("Confirm", "Cancel")
|
choice = input("The shuttle will just return if you call it. Call anyway?") in list("Confirm", "Cancel")
|
||||||
if(choice == "Confirm")
|
if(choice == "Confirm")
|
||||||
emergency_shuttle.fake_recall = rand(300,500)
|
emergency_shuttle.auto_recall = 1 //enable auto-recall
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
|
|
||||||
emergency_shuttle.incall()
|
choice = input("Is this an emergency evacuation or a crew transfer?") in list("Emergency", "Crew Transfer")
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
if (choice == "Emergency")
|
||||||
world << sound('sound/AI/shuttlecalled.ogg')
|
emergency_shuttle.call_evac()
|
||||||
|
else
|
||||||
|
emergency_shuttle.call_transfer()
|
||||||
|
|
||||||
|
|
||||||
feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
log_admin("[key_name(usr)] admin-called the emergency shuttle.")
|
log_admin("[key_name(usr)] admin-called the emergency shuttle.")
|
||||||
message_admins("\blue [key_name_admin(usr)] admin-called the emergency shuttle.", 1)
|
message_admins("\blue [key_name_admin(usr)] admin-called the emergency shuttle.", 1)
|
||||||
@@ -914,7 +919,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
|||||||
|
|
||||||
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return
|
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return
|
||||||
|
|
||||||
if(!ticker || emergency_shuttle.location || emergency_shuttle.direction == 0)
|
if(!ticker || !emergency_shuttle.can_recall())
|
||||||
return
|
return
|
||||||
|
|
||||||
emergency_shuttle.recall()
|
emergency_shuttle.recall()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ var/global/sent_strike_team = 0
|
|||||||
|
|
||||||
sent_strike_team = 1
|
sent_strike_team = 1
|
||||||
|
|
||||||
if (emergency_shuttle.direction == 1 && emergency_shuttle.online == 1)
|
if (emergency_shuttle.can_recall())
|
||||||
emergency_shuttle.recall()
|
emergency_shuttle.recall()
|
||||||
|
|
||||||
var/commando_number = commandos_possible //for selecting a leader
|
var/commando_number = commandos_possible //for selecting a leader
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ var/global/sent_syndicate_strike_team = 0
|
|||||||
|
|
||||||
sent_syndicate_strike_team = 1
|
sent_syndicate_strike_team = 1
|
||||||
|
|
||||||
if (emergency_shuttle.direction == 1 && emergency_shuttle.online == 1)
|
//if (emergency_shuttle.can_recall())
|
||||||
emergency_shuttle.recall()
|
// emergency_shuttle.recall() //why, exactly? Admins can do this themselves.
|
||||||
|
|
||||||
var/syndicate_commando_number = syndicate_commandos_possible //for selecting a leader
|
var/syndicate_commando_number = syndicate_commandos_possible //for selecting a leader
|
||||||
var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned.
|
var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned.
|
||||||
|
|||||||
@@ -216,8 +216,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
|||||||
if(ticker.mode:malf_mode_declared)
|
if(ticker.mode:malf_mode_declared)
|
||||||
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
if (timeleft)
|
if (timeleft)
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
|
|
||||||
|
|||||||
@@ -159,8 +159,8 @@
|
|||||||
stat(null, "Plasma Stored: [getPlasma()]/[max_plasma]")
|
stat(null, "Plasma Stored: [getPlasma()]/[max_plasma]")
|
||||||
|
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
if (timeleft)
|
if (timeleft)
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,8 @@
|
|||||||
if(ticker.mode:malf_mode_declared)
|
if(ticker.mode:malf_mode_declared)
|
||||||
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
if (timeleft)
|
if (timeleft)
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ var/list/ai_list = list()
|
|||||||
call_shuttle_proc(src)
|
call_shuttle_proc(src)
|
||||||
|
|
||||||
// hack to display shuttle timer
|
// hack to display shuttle timer
|
||||||
if(emergency_shuttle.online)
|
if(emergency_shuttle.online())
|
||||||
var/obj/machinery/computer/communications/C = locate() in machines
|
var/obj/machinery/computer/communications/C = locate() in machines
|
||||||
if(C)
|
if(C)
|
||||||
C.post_status("shuttle")
|
C.post_status("shuttle")
|
||||||
|
|||||||
@@ -39,11 +39,9 @@
|
|||||||
callshuttle = 0
|
callshuttle = 0
|
||||||
|
|
||||||
if(callshuttle == 3) //if all three conditions are met
|
if(callshuttle == 3) //if all three conditions are met
|
||||||
emergency_shuttle.incall(2)
|
emergency_shuttle.call_evac()
|
||||||
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
|
||||||
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
|
||||||
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
|
|
||||||
world << sound('sound/AI/shuttlecalled.ogg')
|
|
||||||
|
|
||||||
if(explosive)
|
if(explosive)
|
||||||
spawn(10)
|
spawn(10)
|
||||||
|
|||||||
@@ -97,10 +97,11 @@
|
|||||||
|
|
||||||
// this function displays the shuttles ETA in the status panel if the shuttle has been called
|
// this function displays the shuttles ETA in the status panel if the shuttle has been called
|
||||||
/mob/living/silicon/proc/show_emergency_shuttle_eta()
|
/mob/living/silicon/proc/show_emergency_shuttle_eta()
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle)
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
if (timeleft)
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
if (timeleft)
|
||||||
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
|
|
||||||
|
|
||||||
// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms
|
// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms
|
||||||
|
|||||||
@@ -146,8 +146,8 @@
|
|||||||
statpanel("Status")
|
statpanel("Status")
|
||||||
|
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle)
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
if (timeleft)
|
if (timeleft)
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
|
|
||||||
|
|||||||
@@ -329,12 +329,13 @@
|
|||||||
dat += "Round Duration: [round(hours)]h [round(mins)]m<br>"
|
dat += "Round Duration: [round(hours)]h [round(mins)]m<br>"
|
||||||
|
|
||||||
if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles.
|
if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles.
|
||||||
if(emergency_shuttle.direction == 2) //Shuttle is going to centcomm, not recalled
|
if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled
|
||||||
dat += "<font color='red'><b>The station has been evacuated.</b></font><br>"
|
dat += "<font color='red'><b>The station has been evacuated.</b></font><br>"
|
||||||
if(emergency_shuttle.direction == 1 && emergency_shuttle.timeleft() < 300 && emergency_shuttle.alert == 0) // Emergency shuttle is past the point of no recall
|
if(emergency_shuttle.online())
|
||||||
dat += "<font color='red'>The station is currently undergoing evacuation procedures.</font><br>"
|
if (emergency_shuttle.evac) // Emergency shuttle is past the point of no recall
|
||||||
if(emergency_shuttle.direction == 1 && emergency_shuttle.alert == 1) // Crew transfer initiated
|
dat += "<font color='red'>The station is currently undergoing evacuation procedures.</font><br>"
|
||||||
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
|
else // Crew transfer initiated
|
||||||
|
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
|
||||||
|
|
||||||
dat += "Choose from the following open positions:<br>"
|
dat += "Choose from the following open positions:<br>"
|
||||||
for(var/datum/job/job in job_master.occupations)
|
for(var/datum/job/job in job_master.occupations)
|
||||||
|
|||||||
@@ -475,8 +475,9 @@ var/global/list/uneatable = list(
|
|||||||
/obj/machinery/singularity/narsie/large/New()
|
/obj/machinery/singularity/narsie/large/New()
|
||||||
..()
|
..()
|
||||||
world << "<font size='28' color='red'><b>NAR-SIE HAS RISEN</b></font>"
|
world << "<font size='28' color='red'><b>NAR-SIE HAS RISEN</b></font>"
|
||||||
if(emergency_shuttle)
|
if(emergency_shuttle && emergency_shuttle.can_call())
|
||||||
emergency_shuttle.incall(0.5) // Cannot recall
|
emergency_shuttle.call_evac()
|
||||||
|
emergency_shuttle.launch_time = 0 // Cannot recall
|
||||||
|
|
||||||
/obj/machinery/singularity/narsie/process()
|
/obj/machinery/singularity/narsie/process()
|
||||||
eat()
|
eat()
|
||||||
|
|||||||
@@ -6,11 +6,15 @@
|
|||||||
|
|
||||||
/datum/shuttle/ferry
|
/datum/shuttle/ferry
|
||||||
var/location = 0 //0 = at area_station, 1 = at area_offsite
|
var/location = 0 //0 = at area_station, 1 = at area_offsite
|
||||||
|
var/direction = 0 //0 = going to station, 1 = going to offsite.
|
||||||
var/process_state = IDLE_STATE
|
var/process_state = IDLE_STATE
|
||||||
|
|
||||||
//this mutex ensures that only one console is processing the shuttle's controls at a time
|
//this mutex ensures that only one console is processing the shuttle's controls at a time
|
||||||
var/obj/machinery/computer/shuttle_control/in_use = null
|
var/obj/machinery/computer/shuttle_control/in_use = null //this doesn't have to be a console...
|
||||||
|
|
||||||
|
var/area_transition
|
||||||
|
var/travel_time = 0
|
||||||
|
|
||||||
var/area_station
|
var/area_station
|
||||||
var/area_offsite
|
var/area_offsite
|
||||||
//TODO: change location to a string and use a mapping for area and dock targets.
|
//TODO: change location to a string and use a mapping for area and dock targets.
|
||||||
@@ -25,7 +29,8 @@
|
|||||||
destination = get_location_area(!location)
|
destination = get_location_area(!location)
|
||||||
if(!origin)
|
if(!origin)
|
||||||
origin = get_location_area(location)
|
origin = get_location_area(location)
|
||||||
|
|
||||||
|
direction = !location
|
||||||
..(origin, destination)
|
..(origin, destination)
|
||||||
|
|
||||||
/datum/shuttle/ferry/long_jump(var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
/datum/shuttle/ferry/long_jump(var/area/departing,var/area/destination,var/area/interim,var/travel_time)
|
||||||
@@ -36,7 +41,8 @@
|
|||||||
destination = get_location_area(!location)
|
destination = get_location_area(!location)
|
||||||
if(!departing)
|
if(!departing)
|
||||||
departing = get_location_area(location)
|
departing = get_location_area(location)
|
||||||
|
|
||||||
|
direction = !location
|
||||||
..(departing, destination, interim, travel_time)
|
..(departing, destination, interim, travel_time)
|
||||||
|
|
||||||
/datum/shuttle/ferry/move(var/area/origin,var/area/destination)
|
/datum/shuttle/ferry/move(var/area/origin,var/area/destination)
|
||||||
@@ -44,16 +50,20 @@
|
|||||||
destination = get_location_area(!location)
|
destination = get_location_area(!location)
|
||||||
if(!origin)
|
if(!origin)
|
||||||
origin = get_location_area(location)
|
origin = get_location_area(location)
|
||||||
|
|
||||||
if (docking_controller && !docking_controller.undocked())
|
if (docking_controller && !docking_controller.undocked())
|
||||||
docking_controller.force_undock()
|
docking_controller.force_undock()
|
||||||
..(origin, destination)
|
..(origin, destination)
|
||||||
location = !location
|
|
||||||
|
|
||||||
|
if (destination == area_station) location = 0
|
||||||
|
if (destination == area_offsite) location = 1
|
||||||
|
//if this is a long_jump retain the location we were last at until we get to the new one
|
||||||
|
|
||||||
/datum/shuttle/ferry/proc/get_location_area(location_id = null)
|
/datum/shuttle/ferry/proc/get_location_area(location_id = null)
|
||||||
if (isnull(location_id))
|
if (isnull(location_id))
|
||||||
location_id = location
|
location_id = location
|
||||||
|
|
||||||
if (!location_id)
|
if (!location_id)
|
||||||
return area_station
|
return area_station
|
||||||
return area_offsite
|
return area_offsite
|
||||||
@@ -62,12 +72,12 @@
|
|||||||
switch(process_state)
|
switch(process_state)
|
||||||
if (WAIT_LAUNCH)
|
if (WAIT_LAUNCH)
|
||||||
if (skip_docking_checks() || docking_controller.can_launch())
|
if (skip_docking_checks() || docking_controller.can_launch())
|
||||||
|
|
||||||
//once you have a transition area, making ferry shuttles have a transition would merely requre replacing this with
|
if (travel_time && area_transition)
|
||||||
//if (transition_area) long_jump(...)
|
long_jump(null, null, area_transition, travel_time)
|
||||||
//else short_jump ()
|
else
|
||||||
short_jump()
|
short_jump()
|
||||||
|
|
||||||
process_state = WAIT_ARRIVE
|
process_state = WAIT_ARRIVE
|
||||||
if (WAIT_ARRIVE)
|
if (WAIT_ARRIVE)
|
||||||
if (moving_status == SHUTTLE_IDLE)
|
if (moving_status == SHUTTLE_IDLE)
|
||||||
@@ -77,6 +87,7 @@
|
|||||||
if (skip_docking_checks() || docking_controller.docked())
|
if (skip_docking_checks() || docking_controller.docked())
|
||||||
process_state = IDLE_STATE
|
process_state = IDLE_STATE
|
||||||
in_use = null //release lock
|
in_use = null //release lock
|
||||||
|
arrived()
|
||||||
|
|
||||||
/datum/shuttle/ferry/current_dock_target()
|
/datum/shuttle/ferry/current_dock_target()
|
||||||
var/dock_target
|
var/dock_target
|
||||||
@@ -89,42 +100,42 @@
|
|||||||
|
|
||||||
/datum/shuttle/ferry/proc/launch(var/obj/machinery/computer/shuttle_control/user)
|
/datum/shuttle/ferry/proc/launch(var/obj/machinery/computer/shuttle_control/user)
|
||||||
if (!can_launch()) return
|
if (!can_launch()) return
|
||||||
|
|
||||||
in_use = user //obtain an exclusive lock on the shuttle
|
in_use = user //obtain an exclusive lock on the shuttle
|
||||||
|
|
||||||
process_state = WAIT_LAUNCH
|
process_state = WAIT_LAUNCH
|
||||||
undock()
|
undock()
|
||||||
|
|
||||||
/datum/shuttle/ferry/proc/force_launch(var/obj/machinery/computer/shuttle_control/user)
|
/datum/shuttle/ferry/proc/force_launch(var/obj/machinery/computer/shuttle_control/user)
|
||||||
if (!can_force()) return
|
if (!can_force()) return
|
||||||
|
|
||||||
in_use = user //obtain an exclusive lock on the shuttle
|
in_use = user //obtain an exclusive lock on the shuttle
|
||||||
|
|
||||||
short_jump()
|
short_jump()
|
||||||
|
|
||||||
process_state = WAIT_ARRIVE
|
process_state = WAIT_ARRIVE
|
||||||
|
|
||||||
/datum/shuttle/ferry/proc/cancel_launch(var/obj/machinery/computer/shuttle_control/user)
|
/datum/shuttle/ferry/proc/cancel_launch(var/obj/machinery/computer/shuttle_control/user)
|
||||||
if (!can_cancel()) return
|
if (!can_cancel()) return
|
||||||
|
|
||||||
moving_status = SHUTTLE_IDLE
|
moving_status = SHUTTLE_IDLE
|
||||||
process_state = WAIT_FINISH
|
process_state = WAIT_FINISH
|
||||||
|
|
||||||
if (docking_controller && !docking_controller.undocked())
|
if (docking_controller && !docking_controller.undocked())
|
||||||
docking_controller.force_undock()
|
docking_controller.force_undock()
|
||||||
|
|
||||||
spawn(10)
|
spawn(10)
|
||||||
dock()
|
dock()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
/datum/shuttle/ferry/proc/can_launch()
|
/datum/shuttle/ferry/proc/can_launch()
|
||||||
if (moving_status != SHUTTLE_IDLE)
|
if (moving_status != SHUTTLE_IDLE)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if (in_use)
|
if (in_use)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/datum/shuttle/ferry/proc/can_force()
|
/datum/shuttle/ferry/proc/can_force()
|
||||||
@@ -137,6 +148,10 @@
|
|||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
//This gets called when the shuttle finishes arriving at it's destination
|
||||||
|
//This can be used by subtypes to do things when the shuttle arrives.
|
||||||
|
/datum/shuttle/ferry/proc/arrived()
|
||||||
|
return //do nothing for now
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control
|
/obj/machinery/computer/shuttle_control
|
||||||
@@ -145,7 +160,7 @@
|
|||||||
icon_state = "shuttle"
|
icon_state = "shuttle"
|
||||||
req_access = list(access_engine)
|
req_access = list(access_engine)
|
||||||
circuit = null
|
circuit = null
|
||||||
|
|
||||||
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
||||||
var/hacked = 0 // Has been emagged, no access restrictions.
|
var/hacked = 0 // Has been emagged, no access restrictions.
|
||||||
var/launch_override = 0
|
var/launch_override = 0
|
||||||
@@ -156,11 +171,11 @@
|
|||||||
/obj/machinery/computer/shuttle_control/process()
|
/obj/machinery/computer/shuttle_control/process()
|
||||||
if (!shuttles || !(shuttle_tag in shuttles))
|
if (!shuttles || !(shuttle_tag in shuttles))
|
||||||
return
|
return
|
||||||
|
|
||||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||||
if (!istype(shuttle))
|
if (!istype(shuttle))
|
||||||
return
|
return
|
||||||
|
|
||||||
if (shuttle.in_use == src)
|
if (shuttle.in_use == src)
|
||||||
shuttle.process_shuttle()
|
shuttle.process_shuttle()
|
||||||
|
|
||||||
@@ -168,7 +183,7 @@
|
|||||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||||
if (!istype(shuttle))
|
if (!istype(shuttle))
|
||||||
return
|
return
|
||||||
|
|
||||||
if (shuttle.in_use == src)
|
if (shuttle.in_use == src)
|
||||||
shuttle.in_use = null //shuttle may not dock properly if this gets deleted while in transit, but its not a big deal
|
shuttle.in_use = null //shuttle may not dock properly if this gets deleted while in transit, but its not a big deal
|
||||||
|
|
||||||
@@ -206,7 +221,7 @@
|
|||||||
shuttle_status = "Proceeding to destination."
|
shuttle_status = "Proceeding to destination."
|
||||||
if(WAIT_FINISH)
|
if(WAIT_FINISH)
|
||||||
shuttle_status = "Arriving at destination now."
|
shuttle_status = "Arriving at destination now."
|
||||||
|
|
||||||
data = list(
|
data = list(
|
||||||
"shuttle_status" = shuttle_status,
|
"shuttle_status" = shuttle_status,
|
||||||
"shuttle_state" = shuttle_state,
|
"shuttle_state" = shuttle_state,
|
||||||
@@ -237,7 +252,7 @@
|
|||||||
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
var/datum/shuttle/ferry/shuttle = shuttles[shuttle_tag]
|
||||||
if (!istype(shuttle))
|
if (!istype(shuttle))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(href_list["move"])
|
if(href_list["move"])
|
||||||
shuttle.launch(src)
|
shuttle.launch(src)
|
||||||
if(href_list["force"])
|
if(href_list["force"])
|
||||||
|
|||||||
69
code/modules/shuttles/shuttle_emergency.dm
Normal file
69
code/modules/shuttles/shuttle_emergency.dm
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/datum/shuttle/ferry/emergency
|
||||||
|
//pass
|
||||||
|
|
||||||
|
/datum/shuttle/ferry/emergency/arrived()
|
||||||
|
emergency_shuttle.shuttle_arrived()
|
||||||
|
|
||||||
|
/*
|
||||||
|
/datum/shuttle/ferry/emergency/move()
|
||||||
|
if (!location) //leaving the station
|
||||||
|
emergency_shuttle.departed = 1
|
||||||
|
..()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/datum/shuttle/ferry/escape_pod
|
||||||
|
//pass
|
||||||
|
|
||||||
|
/datum/shuttle/ferry/escape_pod/can_launch()
|
||||||
|
if(location)
|
||||||
|
return 0 //it's a one-way trip.
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/datum/shuttle/ferry/escape_pod/can_force()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
/datum/shuttle/ferry/escape_pod/can_cancel()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
//TODO replace this with proper door controllers
|
||||||
|
/datum/shuttle/ferry/escape_pod/move(var/area/origin,var/area/destination)
|
||||||
|
for(var/obj/machinery/door/D in origin)
|
||||||
|
spawn(0)
|
||||||
|
D.close()
|
||||||
|
|
||||||
|
..(origin, destination) //might need to adjust shuttle/move so that it can take into account the direction argument to area/move_contents_to, I dunno.
|
||||||
|
|
||||||
|
for(var/obj/machinery/door/D in destination)
|
||||||
|
spawn(0)
|
||||||
|
D.open()
|
||||||
|
|
||||||
|
//Escape pod garbage, copied from the controller
|
||||||
|
/*
|
||||||
|
//pods
|
||||||
|
start_location = locate(/area/shuttle/escape_pod1/station)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod1/transit)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod1/centcom)
|
||||||
|
start_location.move_contents_to(end_location, null, NORTH)
|
||||||
|
|
||||||
|
start_location = locate(/area/shuttle/escape_pod2/station)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod2/transit)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod2/centcom)
|
||||||
|
start_location.move_contents_to(end_location, null, NORTH)
|
||||||
|
|
||||||
|
start_location = locate(/area/shuttle/escape_pod3/station)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod3/transit)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod3/centcom)
|
||||||
|
start_location.move_contents_to(end_location, null, NORTH)
|
||||||
|
|
||||||
|
//There is no pod 4, apparently.
|
||||||
|
|
||||||
|
start_location = locate(/area/shuttle/escape_pod5/station)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod5/transit)
|
||||||
|
end_location = locate(/area/shuttle/escape_pod5/centcom)
|
||||||
|
start_location.move_contents_to(end_location, null, EAST)
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
@@ -43,10 +43,11 @@
|
|||||||
..()
|
..()
|
||||||
statpanel("Status")
|
statpanel("Status")
|
||||||
if (src.client.statpanel == "Status")
|
if (src.client.statpanel == "Status")
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle)
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
if (timeleft)
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
if (timeleft)
|
||||||
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
/*
|
/*
|
||||||
if(ticker.mode.name == "AI malfunction")
|
if(ticker.mode.name == "AI malfunction")
|
||||||
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
..()
|
..()
|
||||||
statpanel("Status")
|
statpanel("Status")
|
||||||
if (src.client.statpanel == "Status")
|
if (src.client.statpanel == "Status")
|
||||||
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
if(emergency_shuttle)
|
||||||
var/timeleft = emergency_shuttle.timeleft()
|
if(emergency_shuttle.has_eta() && !emergency_shuttle.returned())
|
||||||
if (timeleft)
|
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||||
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
if (timeleft)
|
||||||
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||||
/*
|
/*
|
||||||
if(ticker.mode.name == "AI malfunction")
|
if(ticker.mode.name == "AI malfunction")
|
||||||
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
|
||||||
|
|||||||
Reference in New Issue
Block a user