shuttlepanel

This commit is contained in:
Deity Link
2017-09-17 05:33:16 +02:00
parent c49d185127
commit ddf739a0e1
11 changed files with 362 additions and 186 deletions

View File

@@ -1614,6 +1614,12 @@ Game Mode config tags:
return (team in sent_strike_teams)
/proc/area_in_map(var/area/A)
for (var/turf/T in A.area_turfs)
return TRUE
return FALSE
/proc/get_exact_dist(atom/A, atom/B) //returns the coordinate distance between the coordinates of the turfs of A and B
var/turf/T1 = A
var/turf/T2 = B

View File

@@ -1,22 +1,20 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
// Controls the emergency shuttle
// these define the time taken for the shuttle to get to SS13
// these define the time taken for the shuttle to get to the station
// and the time before it leaves again
#define SHUTTLEARRIVETIME 600 // 10 minutes = 600 seconds
#define SHUTTLELEAVETIME 180 // 3 minutes = 180 seconds
#define SHUTTLETRANSITTIME 120 // 2 minutes = 120 seconds
var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle
var/global/datum/emergency_shuttle/emergency_shuttle
datum/shuttle_controller
datum/emergency_shuttle
var/alert = 0 //0 = emergency, 1 = crew cycle
var/location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13
var/location = 0 //0 = in transit (or on standby), 1 = at the station, 2 = at centcom
var/online = 0
var/direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
var/direction = 0 //-1 = going back to centcom (recalled), 0 = on standby, 1 = going to the station, 2 = in transit to centcom (not recalled)
var/endtime // timeofday that shuttle arrives
var/timelimit //important when the shuttle gets called for more than shuttlearrivetime
@@ -33,21 +31,31 @@ datum/shuttle_controller
var/datum/shuttle/shuttle
var/list/escape_pods = list()
// call the shuttle
// if not called before, set the endtime to T+600 seconds
// otherwise if outgoing, switch to incoming
datum/shuttle_controller/proc/incall(coeff = 1)
datum/emergency_shuttle/proc/init()
var/list/pods_to_test = list ("1","2","3","5")//ADD NEW PODS HERE
for (var/i in pods_to_test)
var/area/pod_test = locate(text2path("/area/shuttle/escape_pod[i]/station"))
if (area_in_map(pod_test))
escape_pods[i] = "station"
datum/emergency_shuttle/proc/incall(coeff = 1)
if(shutdown)
return
if((!universe.OnShuttleCall(null) || deny_shuttle) && alert == 1) //crew transfer shuttle does not gets recalled by gamemode
return
if(endtime)
if(direction == -1)
setdirection(1)
setdirection(1)
else
settimeleft(SHUTTLEARRIVETIME*coeff)
online = 1
setdirection(1)
if(always_fake_recall)
fake_recall = rand(300,500)
//turning on the red lights in hallways
@@ -56,19 +64,13 @@ datum/shuttle_controller/proc/incall(coeff = 1)
if(istype(A, /area/hallway))
A.readyalert()
datum/shuttle_controller/proc/shuttlealert(var/X)
datum/emergency_shuttle/proc/shuttlealert(var/X)
if(shutdown)
return
alert = X
datum/shuttle_controller/proc/force_shutdown()
online=0
shutdown=1
datum/shuttle_controller/proc/recall()
datum/emergency_shuttle/proc/recall()
if(shutdown)
return
if(!can_recall)
@@ -94,12 +96,10 @@ datum/shuttle_controller/proc/recall()
// returns the time (in seconds) before shuttle arrival
// note if direction = -1, gives a count-up to SHUTTLEARRIVETIME
datum/shuttle_controller/proc/timeleft()
datum/emergency_shuttle/proc/timeleft()
if(online)
var/timeleft = round((endtime - world.timeofday)/10 ,1)
if(direction == 1 || direction == 2)
if(direction >= 0)
return timeleft
else
return SHUTTLEARRIVETIME-timeleft
@@ -107,24 +107,23 @@ datum/shuttle_controller/proc/timeleft()
return SHUTTLEARRIVETIME
// sets the time left to a given delay (in seconds)
datum/shuttle_controller/proc/settimeleft(var/delay)
datum/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/proc/setdirection(var/dirn)
if(direction == dirn)
datum/emergency_shuttle/proc/setdirection(var/dirn)
if(direction == dirn || !direction || !dirn)
direction = dirn
return
direction = dirn
// if changing direction, flip the timeleft by SHUTTLEARRIVETIME
// if changing direction, flip the timeleft by SHUTTLEARRIVETIME, unless changing from/to 0
var/ticksleft = endtime - world.timeofday
endtime = world.timeofday + (SHUTTLEARRIVETIME*10 - ticksleft)
return
datum/shuttle_controller/proc/process()
datum/shuttle_controller/proc/move_pod(var/start_type,var/end_type,var/direction,var/open_doors)
/*
datum/emergency_shuttle/proc/move_pod(var/start_type,var/end_type,var/direction,var/open_doors)
var/area/start_location=locate(start_type)
var/area/end_location=locate(end_type)
@@ -152,12 +151,44 @@ datum/shuttle_controller/proc/move_pod(var/start_type,var/end_type,var/direction
if(istype(M, /mob/living/carbon))
if(!M.locked_to)
M.Knockdown(5)
*/
datum/emergency_shuttle/proc/move_pod(var/pod,var/destination)
if (!pod || !destination)
return
var/area/start_location=locate(text2path("/area/shuttle/escape_pod[pod]/[escape_pods[pod]]"))
var/area/end_location=locate(text2path("/area/shuttle/escape_pod[pod]/[destination]"))
for(var/obj/structure/shuttle/engine/propulsion/P in start_location)
spawn()
P.shoot_exhaust()
datum/shuttle_controller/emergency_shuttle
start_location.move_contents_to(end_location, null, NORTH)
escape_pods[pod] = destination
for(var/obj/machinery/door/D in all_doors)
if (get_area(D) == end_location)
spawn(0)
if(destination == "transit")
D.close()
else
D.open()
for(var/mob/M in end_location)
if (M.client)
spawn()
if (M.locked_to)
shake_camera(M, 4, 1) // locked_to, not a lot of shaking
else
shake_camera(M, 10, 2) // unlocked_to, HOLY SHIT SHAKE THE ROOM
if (istype(M, /mob/living/carbon))
if (!M.locked_to)
M.Knockdown(5)
datum/emergency_shuttle/proc/force_shutdown()
online=0
shutdown=1
datum/shuttle_controller/emergency_shuttle/force_shutdown()
..()
if(direction == 2)
location = 1
@@ -172,14 +203,93 @@ datum/shuttle_controller/emergency_shuttle/force_shutdown()
//move_pod(/area/shuttle/escape/transit,/area/shuttle/escape/station,NORTH,1)
//pods
move_pod(/area/shuttle/escape_pod1/transit,/area/shuttle/escape_pod1/station, NORTH,1)
move_pod(/area/shuttle/escape_pod2/transit,/area/shuttle/escape_pod2/station, NORTH,1)
move_pod(/area/shuttle/escape_pod3/transit,/area/shuttle/escape_pod3/station, NORTH,1)
move_pod(/area/shuttle/escape_pod5/transit,/area/shuttle/escape_pod5/station, NORTH,1)
for (var/pod in escape_pods)
move_pod(pod, "station")
online = 0
datum/shuttle_controller/emergency_shuttle/process()
datum/emergency_shuttle/proc/shuttle_phase(var/phase, var/casual = 1)
switch (phase)
if ("station")
location = 1
if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
E.open_all_doors()
if(!E.move_to_dock(E.dock_station, 0, E.dir)) //Throw everything forward, on chance that there's anybody in the shuttle
message_admins("WARNING: THE EMERGENCY SHUTTLE FAILED TO FIND THE STATION! PANIC PANIC PANIC")
if (!casual)
settimeleft(SHUTTLELEAVETIME)
send2mainirc("The Emergency Shuttle has docked with the station.")
send2maindiscord("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')
/*
if(universe.name == "Hell Rising")
to_chat(world, "___________________________________________________________________")
to_chat(world, "<span class='sinister' style='font-size:3'> A vile force of darkness is making its way toward the escape shuttle.</span>")
*/
if ("transit")
location = 0 // in deep space
for(var/obj/machinery/door/unpowered/shuttle/D in shuttle.linked_area)
spawn(0)
D.close()
D.locked = 1
if (casual)
direction = 1
else
departed = 1 // It's going!
direction = 2 // heading to centcom
settimeleft(SHUTTLETRANSITTIME)
// Shuttle Radio
CallHook("EmergencyShuttleDeparture", list())
captain_announce("The Emergency Shuttle has left the station. Estimate [round(timeleft()/60,1)] minutes until the shuttle docks at Central Command.")
if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
E.close_all_doors()
for(var/obj/structure/shuttle/engine/propulsion/P in E.linked_area)
spawn()
P.shoot_exhaust(backward = 3)
if(!E.move_to_dock(E.transit_port, 0, turn(E.dir,180))) //Throw everything backwards
message_admins("WARNING: THE EMERGENCY SHUTTLE FAILED TO FIND TRANSIT! PANIC PANIC PANIC")
else
message_admins("WARNING: THERE IS NO EMERGENCY SHUTTLE! PANIC")
// "preload" the assets for when they're needed for the map vote.
if(config.map_voting && vote)
for(var/client/C in clients)
spawn
vote.interface.sendAssets(C)
if ("centcom")
if (casual)
location = 0
direction = 0
else
location = 2
if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
E.open_all_doors()
if(!E.move_to_dock(E.dock_centcom, 0, E.dir)) //Throw everything forward
message_admins("WARNING: THE EMERGENCY SHUTTLE FAILED TO FIND CENTCOMM! PANIC PANIC PANIC")
else
message_admins("WARNING: THERE IS NO EMERGENCY SHUTTLE! PANIC")
online = 0
datum/emergency_shuttle/proc/process()
if(!online || shutdown)
return
@@ -191,7 +301,7 @@ datum/shuttle_controller/emergency_shuttle/process()
switch(location)
if(0)
/* --- Shuttle is in transit to Central Command from SS13 --- */
/* --- Shuttle is in transit toward centcom --- */
if(direction == 2)
for(var/obj/structure/shuttle/engine/propulsion/P in shuttle.linked_area)
spawn()
@@ -199,40 +309,25 @@ datum/shuttle_controller/emergency_shuttle/process()
if(timeleft>0)
return 0
/* --- Shuttle has arrived at Centrcal Command --- */
/* --- Shuttle has arrived at centcom --- */
else
// turn off the star spawners
/*
for(var/obj/effect/starspawner/S in world)
S.spawning = 0
*/
location = 2
//main shuttle
if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
E.open_all_doors()
if(!E.move_to_dock(E.dock_centcom, 0, E.dir)) //Throw everything forward
message_admins("WARNING: THE EMERGENCY SHUTTLE FAILED TO FIND CENTCOMM! PANIC PANIC PANIC")
else
message_admins("WARNING: THERE IS NO EMERGENCY SHUTTLE! PANIC")
//move_pod(/area/shuttle/escape/transit,/area/shuttle/escape/centcom,NORTH,1)
shuttle_phase("centcom",0)
//pods
move_pod(/area/shuttle/escape_pod1/transit,/area/shuttle/escape_pod1/centcom, NORTH,1)
move_pod(/area/shuttle/escape_pod2/transit,/area/shuttle/escape_pod2/centcom, NORTH,1)
move_pod(/area/shuttle/escape_pod3/transit,/area/shuttle/escape_pod3/centcom, NORTH,1)
move_pod(/area/shuttle/escape_pod5/transit,/area/shuttle/escape_pod5/centcom, NORTH,1)
for (var/pod in escape_pods)
move_pod(pod, "centcom")
online = 0
return 1
/* --- Shuttle has docked centcom after being recalled --- */
if(timeleft>timelimit)
online = 0
direction = 1
direction = 0
endtime = null
return 0
@@ -244,24 +339,7 @@ datum/shuttle_controller/emergency_shuttle/process()
/* --- Shuttle has docked with the station - begin countdown to transit --- */
else if(timeleft <= 0)
location = 1
if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
E.open_all_doors()
if(!E.move_to_dock(E.dock_station, 0, E.dir)) //Throw everything forward, on chance that there's anybody in the shuttle
message_admins("WARNING: THE EMERGENCY SHUTTLE FAILED TO FIND THE STATION! PANIC PANIC PANIC")
settimeleft(SHUTTLELEAVETIME)
send2mainirc("The Emergency Shuttle has docked with the station.")
send2maindiscord("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')
if(universe.name == "Hell Rising")
to_chat(world, "___________________________________________________________________")
to_chat(world, "<span class='sinister' style='font-size:3'> A vile force of darkness is making its way toward the escape shuttle.</span>")
shuttle_phase("station",0)
return 1
if(1)
@@ -282,103 +360,15 @@ datum/shuttle_controller/emergency_shuttle/process()
/* --- Shuttle leaves the station, enters transit --- */
else
// Turn on the star effects
/* // kinda buggy atm, i'll fix this later
for(var/obj/effect/starspawner/S in world)
if(!S.spawning)
spawn() S.startspawn()
*/
departed = 1 // It's going!
location = 0 // in deep space
direction = 2 // heading to centcom
settimeleft(SHUTTLETRANSITTIME)
// Shuttle Radio
CallHook("EmergencyShuttleDeparture", list())
//main shuttle
if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
E.close_all_doors()
for(var/obj/structure/shuttle/engine/propulsion/P in E.linked_area)
spawn()
P.shoot_exhaust(backward = 3)
if(!E.move_to_dock(E.transit_port, 0, turn(E.dir,180))) //Throw everything backwards
message_admins("WARNING: THE EMERGENCY SHUTTLE FAILED TO FIND TRANSIT! PANIC PANIC PANIC")
else
message_admins("WARNING: THERE IS NO EMERGENCY SHUTTLE! PANIC")
//move_pod(/area/shuttle/escape/station,/area/shuttle/escape/transit,NORTH,0)
shuttle_phase ("transit",0)
//pods
move_pod(/area/shuttle/escape_pod1/station,/area/shuttle/escape_pod1/transit,NORTH,0)
move_pod(/area/shuttle/escape_pod2/station,/area/shuttle/escape_pod2/transit,NORTH,0)
move_pod(/area/shuttle/escape_pod3/station,/area/shuttle/escape_pod3/transit,NORTH,0)
move_pod(/area/shuttle/escape_pod5/station,/area/shuttle/escape_pod5/transit,EAST,0)
captain_announce("The Emergency Shuttle has left the station. Estimate [round(timeleft()/60,1)] minutes until the shuttle docks at Central Command.")
// "preload" the assets for when they're needed for the map vote.
if(config.map_voting && vote)
for(var/client/C in clients)
spawn
vote.interface.sendAssets(C)
for (var/pod in escape_pods)
move_pod(pod, "transit")
return 1
else
return 1
/*
Some slapped-together star effects for maximum spess immershuns. Basically consists of a
spawner, an ender, and bgstar. Spawners create bgstars, bgstars shoot off into a direction
until they reach a starender.
*/
/obj/effect/bgstar
name = "star"
var/speed
var/direction = SOUTH
layer = TURF_LAYER
/obj/effect/bgstar/New()
. = ..()
pixel_x += rand(-2, 30) * PIXEL_MULTIPLIER
pixel_y += rand(-2, 30) * PIXEL_MULTIPLIER
icon_state = "star" + pick("1", "1", "1", "2", "3", "4")
speed = rand(2, 5)
/obj/effect/bgstar/proc/startmove()
while (src)
sleep(speed)
step(src, direction)
for (var/obj/effect/starender/E in loc)
qdel(src)
/obj/effect/starender
invisibility = 101
/obj/effect/starspawner
invisibility = 101
var/spawndir = SOUTH
var/spawning = 0
West
spawndir = WEST
proc/startspawn()
spawning = 1
while(spawning)
sleep(rand(2, 30))
var/obj/effect/bgstar/S = new/obj/effect/bgstar(locate(x,y,z))
S.direction = spawndir
spawn()
S.startmove()

View File

@@ -16,7 +16,7 @@ var/datum/subsystem/emergency_shuttle/SSemergency_shuttle
/datum/subsystem/emergency_shuttle/Initialize(timeofday)
if (!emergency_shuttle)
emergency_shuttle = new
emergency_shuttle.init()
..()

View File

@@ -241,6 +241,8 @@ proc/process_adminbus_teleport_locs()
/area/shuttle/escape_pod5/transit
icon_state = "shuttle"
//SHOULD YOU ADD NEW ESCAPE PODS, REMEMBER TO UPDATE shuttle_controller.dm
/area/shuttle/supply
name = "supply shuttle"
icon_state = "shuttle3"

View File

@@ -137,7 +137,7 @@ var/global/list/all_docking_ports = list()
/obj/docking_port/destination //this guy is installed on stations and connects to shuttles
icon_state = "docking_station"
var/turf/origin_turf = null
var/list/disk_references = list() //List of shuttle destination disks that know about this docking port
var/base_turf_type = /turf/space
@@ -147,6 +147,7 @@ var/global/list/all_docking_ports = list()
/obj/docking_port/destination/New()
.=..()
origin_turf = get_turf(src)
//The following few lines exist to make shuttle corners and the syndicate base Less Shit :*
if(src.z in (1 to map.zLevels.len))
base_turf_type = get_base_turf(src.z)

View File

@@ -191,6 +191,7 @@ var/list/admin_verbs_debug = list(
/client/proc/callatomproc,
/client/proc/view_runtimes,
/client/proc/cmd_mass_modify_object_variables,
/client/proc/emergency_shuttle_panel,
)
var/list/admin_verbs_possess = list(
/proc/possess,

View File

@@ -4,18 +4,8 @@
dat += {"Current Game Mode: <B>[ticker.mode.name]</B><BR>
Round Duration: <B>[round(world.time / 36000)]:[add_zero(world.time / 600 % 60, 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B><BR>
<B>Emergency shuttle</B><BR>"}
if (!emergency_shuttle.online)
dat += "<a href='?src=\ref[src];call_shuttle=1'>Call Shuttle</a><br>"
else
var/timeleft = emergency_shuttle.timeleft()
switch(emergency_shuttle.location)
if(0)
<A HREF='?src=\ref[src];emergency_shuttle_panel=1'><B>Emergency Shuttle Panel</B></A><BR>"}
dat += {"ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>
<a href='?src=\ref[src];call_shuttle=2'>Send Back</a><br>"}
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 += "<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)
dat += "<br><table cellspacing=5><tr><td><B>Syndicates</B></td><td></td></tr>"

View File

@@ -0,0 +1,67 @@
/datum/admins/proc/emergency_shuttle_panel()
if(!emergency_shuttle)
alert("The emergency shuttle subsystem isn't ready yet!")
return
var/dat = "<html><head><title>Emergency Shuttle Fuckery Panel</title></head><body><h1>Emergency Shuttle Control</h1>"
dat += "Current Status:"
var/area/shuttle_loc = locate(/area/shuttle/escape/centcom)
var/turf/shuttle_turf = pick(shuttle_loc.area_turfs)
dat += "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[shuttle_turf.x];Y=[shuttle_turf.y];Z=[shuttle_turf.z]'>"
switch (emergency_shuttle.location)
if(0)
switch (emergency_shuttle.direction)
if (-1)
dat += "<b>In transit</b> (Recalled)"
if(0)
dat += "<b>At Central Command</b> (on standby)"
if(1)
dat += "<b>In transit</b> (To Station)"
if(2)
dat += "<b>In transit</b> (To Centcom - Round End)"
if(1)
dat += "<b>At the Station</b>"
if(2)
dat += "<b>At Central Command</b> (Round Ended)"
dat += "</a><br>"
if (!emergency_shuttle.online)
dat += "<a href='?src=\ref[src];call_shuttle=1'>Call Shuttle</a><br>"
else
var/timeleft = emergency_shuttle.timeleft()
switch(emergency_shuttle.location)
if(0)
dat += {"ETA: <a href='?src=\ref[src];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><br>
<a href='?src=\ref[src];call_shuttle=2'>Send Back</a><br>"}
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 += "<BR>"
if (emergency_shuttle.online)
dat += "Any of the three following actions will cancel the shuttle timer.<br>"
dat += "<a href='?src=\ref[src];move_emergency_shuttle=station'>move shuttle to station</a><br>"
dat += "<a href='?src=\ref[src];move_emergency_shuttle=transit'>move shuttle to transit</a><br>"
dat += "<a href='?src=\ref[src];move_emergency_shuttle=centcom'>move shuttle to centcom</a><br>"
dat += "<br>"
dat += "<a href='?src=\ref[src];move_emergency_dock=station'>move station dock here</a> - <a href='?src=\ref[src];reset_emergency_dock=station'>reset</a><br>"
dat += "<a href='?src=\ref[src];move_emergency_dock=transit'>move transit dock here</a> - <a href='?src=\ref[src];reset_emergency_dock=transit'>reset</a><br>"
dat += "<a href='?src=\ref[src];move_emergency_dock=centcom'>move centcom dock here</a> - <a href='?src=\ref[src];reset_emergency_dock=centcom'>reset</a><br>"
dat += "<h2>Escape Pods Control</h2>"
for (var/pod in emergency_shuttle.escape_pods)
var/area/pod_area = locate(text2path("/area/shuttle/escape_pod[pod]/[emergency_shuttle.escape_pods[pod]]"))
var/turf/T = pick(pod_area.area_turfs)
dat += "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>[pod_area.name]</a> : [(emergency_shuttle.escape_pods[pod] == "station") ? "<b>station</b>" : "<a href='?src=\ref[src];move_escape_pod=[pod];move_destination=station'>station</a>"] - [(emergency_shuttle.escape_pods[pod] == "transit") ? "<b>transit</b>" : "<a href='?src=\ref[src];move_escape_pod=[pod];move_destination=transit'>transit</a>"] - [(emergency_shuttle.escape_pods[pod] == "centcom") ? "<b>centcom</b>" : "<a href='?src=\ref[src];move_escape_pod=[pod];move_destination=centcom'>centcom</a>"]<br>"
if (emergency_shuttle.escape_pods.len > 1)
dat += "Move All Pods : <a href='?src=\ref[src];move_escape_pod=all;move_destination=station'>station</a> - <a href='?src=\ref[src];move_escape_pod=all;move_destination=transit'>transit</a> - <a href='?src=\ref[src];move_escape_pod=all;move_destination=centcom'>centcom</a><br>"
dat += "</body></html>"
usr << browse(dat, "window=emergencyshuttle;size=440x500")

View File

@@ -341,7 +341,7 @@
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
message_admins("<span class='notice'>[key_name_admin(usr)] sent the Emergency Shuttle back</span>", 1)
href_list["secretsadmin"] = "check_antagonist"
href_list["secretsadmin"] = "emergency_shuttle_panel"
else if(href_list["edit_shuttle_time"])
if(!check_rights(R_SERVER))
@@ -351,7 +351,110 @@
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.")
message_admins("<span class='notice'>[key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]</span>", 1)
href_list["secretsadmin"] = "check_antagonist"
href_list["secretsadmin"] = "emergency_shuttle_panel"
else if(href_list["move_emergency_shuttle"])
if(!check_rights(R_ADMIN) || !check_rights(R_DEBUG))
return
var/casual = 1
switch (href_list["move_emergency_shuttle"])
if ("station")
switch(alert("Trigger departure countdown and announcement?","Emergency Shuttle Panel","Yes","No","Cancel"))
if("Cancel")
return
if("Yes")
emergency_shuttle.online = 1
emergency_shuttle.shuttle_phase("station",0)
casual = 0
if("No")
emergency_shuttle.online = 0
emergency_shuttle.direction = 0
emergency_shuttle.endtime = null
emergency_shuttle.shuttle_phase("station",1)
if ("transit")
switch(alert("Trigger arrival countdown and announcement?","Emergency Shuttle Panel","Yes","No","Cancel"))
if("Cancel")
return
if("Yes")
emergency_shuttle.online = 1
emergency_shuttle.shuttle_phase("transit",0)
casual = 0
if("No")
emergency_shuttle.online = 0
emergency_shuttle.direction = 1
emergency_shuttle.endtime = null
emergency_shuttle.shuttle_phase("transit",1)
if ("centcom")
switch(alert("Trigger round end?","Emergency Shuttle Panel","Yes","No","Cancel"))
if("Cancel")
return
if("Yes")
emergency_shuttle.shuttle_phase("centcom",0)
casual = 0
if("No")
emergency_shuttle.shuttle_phase("centcom",1)
var/obj/docking_port/shuttle/P = emergency_shuttle.shuttle.linked_port
log_admin("[key_name(usr)] moved the emergency shuttle to [href_list["move_emergency_shuttle"]][casual?" (no round triggers)":""].</span>")
message_admins("<span class='notice'>[key_name_admin(usr)] moved the emergency shuttle to <a href='?_src_=holder;adminplayerobservecoodjump=1;X=[P.x];Y=[P.y];Z=[P.z]'>[href_list["move_emergency_shuttle"]]</a>[casual?" (no round triggers)":""].</span>", 1)
href_list["secretsadmin"] = "emergency_shuttle_panel"
else if(href_list["move_emergency_dock"])
if(!check_rights(R_ADMIN) || !check_rights(R_DEBUG))
return
var/obj/docking_port/destination/port
var/datum/shuttle/escape/E = emergency_shuttle.shuttle
switch (href_list["move_emergency_dock"])
if ("station")
port = E.dock_station
if ("transit")
port = E.transit_port
if ("centcom")
port = E.dock_centcom
if (!port) return
port.forceMove(get_turf(usr.loc))
log_admin("[key_name(usr)] moved the emergency shuttle's [href_list["move_emergency_dock"]] port.</span>")
message_admins("<span class='notice'>[key_name_admin(usr)] moved the emergency shuttle's <a href='?_src_=holder;adminplayerobservecoodjump=1;X=[port.x];Y=[port.y];Z=[port.z]'>[href_list["move_emergency_dock"]] port</a>.</span>", 1)
href_list["secretsadmin"] = "emergency_shuttle_panel"
else if(href_list["reset_emergency_dock"])
if(!check_rights(R_ADMIN) || !check_rights(R_DEBUG))
return
var/obj/docking_port/destination/port
var/datum/shuttle/escape/E = emergency_shuttle.shuttle
switch (href_list["reset_emergency_dock"])
if ("station")
port = E.dock_station
if ("transit")
port = E.transit_port
if ("centcom")
port = E.dock_centcom
if (!port) return
port.forceMove(port.origin_turf)
log_admin("[key_name(usr)] reset the emergency shuttle's [href_list["reset_emergency_dock"]] port's position.</span>")
message_admins("<span class='notice'>[key_name_admin(usr)] reset the emergency shuttle's <a href='?_src_=holder;adminplayerobservecoodjump=1;X=[port.x];Y=[port.y];Z=[port.z]'>[href_list["reset_emergency_dock"]] port's position</a>.</span>", 1)
href_list["secretsadmin"] = "emergency_shuttle_panel"
else if(href_list["move_escape_pod"])
if(!check_rights(R_ADMIN) || !check_rights(R_DEBUG))
return
if (href_list["move_escape_pod"] == "all")
for (var/pod in emergency_shuttle.escape_pods)
if (emergency_shuttle.escape_pods[pod] == href_list["move_destination"])
continue
emergency_shuttle.move_pod(pod,href_list["move_destination"])
log_admin("[key_name(usr)] moved all escape pods to [href_list["move_destination"]]")
message_admins("<span class='notice'>[key_name_admin(usr)] moved all escape pods to [href_list["move_destination"]]</span>", 1)
else
var/old_loc = emergency_shuttle.escape_pods[href_list["move_escape_pod"]]
emergency_shuttle.move_pod(href_list["move_escape_pod"],href_list["move_destination"])
var/area/pod_area = locate(text2path("/area/shuttle/escape_pod[href_list["move_escape_pod"]]/[emergency_shuttle.escape_pods[href_list["move_escape_pod"]]]"))
var/turf/T = pick(pod_area.area_turfs)
log_admin("[key_name(usr)] moved [pod_area.name] from [old_loc] to [href_list["move_destination"]]")
message_admins("<span class='notice'>[key_name_admin(usr)] moved <a href='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>[pod_area.name]</a> from [old_loc] to [href_list["move_destination"]]</span>", 1)
href_list["secretsadmin"] = "emergency_shuttle_panel"
else if(href_list["delay_round_end"])
if(!check_rights(R_SERVER))
@@ -1980,6 +2083,9 @@
if(C)
C.jumptomob(M)
else if(href_list["emergency_shuttle_panel"])
emergency_shuttle_panel()
else if(href_list["check_antagonist"])
check_antagonists()
@@ -3494,7 +3600,7 @@
if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
else if(href_list["secretsadmin"])
if(href_list["secretsadmin"])
if(!check_rights(R_ADMIN))
return
@@ -3558,6 +3664,8 @@
usr << browse(dat, "window=manifest;size=440x410")
if("check_antagonist")
check_antagonists()
if("emergency_shuttle_panel")
emergency_shuttle_panel()
if("DNA")
var/dat = "<B>Showing DNA from blood.</B><HR>"
dat += "<table cellspacing=5><tr><th>Name</th><th>DNA</th><th>Blood Type</th></tr>"

View File

@@ -1278,3 +1278,13 @@ client/proc/check_convertables()
return
error_cache.show_to(src)
/client/proc/emergency_shuttle_panel()
set name = "Emergency Shuttle Panel"
set category = "Debug"
if(holder)
holder.emergency_shuttle_panel()
log_admin("[key_name(usr)] checked the Emergency Shuttle Panel.")
feedback_add_details("admin_verb","ESP")
return

View File

@@ -999,6 +999,7 @@
#include "code\modules\admin\create_object.dm"
#include "code\modules\admin\create_poll.dm"
#include "code\modules\admin\create_turf.dm"
#include "code\modules\admin\emergency_shuttle_panel.dm"
#include "code\modules\admin\holder2.dm"
#include "code\modules\admin\IsBanned.dm"
#include "code\modules\admin\NewBan.dm"