mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 21:49:11 +01:00
Merge branch 'shuttlecontroller' of https://github.com/Zuhayr/Baystation12 into dev
This commit is contained in:
@@ -637,10 +637,7 @@ var/global/floorIsLava = 0
|
||||
<A href='?src=\ref[src];secretsfun=fakeguns'>Make all items look like guns</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=schoolgirl'>Japanese Animes Mode</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=eagles'>Egalitarian Station Mode</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=moveadminshuttle'>Move Administration Shuttle</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=moveferry'>Move Ferry</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=movealienship'>Move Alien Dinghy</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=moveminingshuttle'>Move Mining Shuttle</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=moveshuttle'>Move a shuttle</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=blackout'>Break all lights</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=whiteout'>Fix all lights</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=friendai'>Best Friend AI</A><BR>
|
||||
@@ -1127,67 +1124,4 @@ proc/get_options_bar(whom, detail = 2, name = 0, link = 1)
|
||||
//
|
||||
//ALL DONE
|
||||
//*********************************************************************************************************
|
||||
//TO-DO:
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
/**********************Administration Shuttle**************************/
|
||||
|
||||
var/admin_shuttle_location = 0 // 0 = centcom 13, 1 = station
|
||||
|
||||
proc/move_admin_shuttle()
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (admin_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/administration/station)
|
||||
toArea = locate(/area/shuttle/administration/centcom)
|
||||
else
|
||||
fromArea = locate(/area/shuttle/administration/centcom)
|
||||
toArea = locate(/area/shuttle/administration/station)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (admin_shuttle_location)
|
||||
admin_shuttle_location = 0
|
||||
else
|
||||
admin_shuttle_location = 1
|
||||
return
|
||||
|
||||
/**********************Centcom Ferry**************************/
|
||||
|
||||
var/ferry_location = 0 // 0 = centcom , 1 = station
|
||||
|
||||
proc/move_ferry()
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (ferry_location == 1)
|
||||
fromArea = locate(/area/shuttle/transport1/station)
|
||||
toArea = locate(/area/shuttle/transport1/centcom)
|
||||
else
|
||||
fromArea = locate(/area/shuttle/transport1/centcom)
|
||||
toArea = locate(/area/shuttle/transport1/station)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (ferry_location)
|
||||
ferry_location = 0
|
||||
else
|
||||
ferry_location = 1
|
||||
return
|
||||
|
||||
/**********************Alien ship**************************/
|
||||
|
||||
var/alien_ship_location = 1 // 0 = base , 1 = mine
|
||||
|
||||
proc/move_alien_ship()
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (alien_ship_location == 1)
|
||||
fromArea = locate(/area/shuttle/alien/mine)
|
||||
toArea = locate(/area/shuttle/alien/base)
|
||||
else
|
||||
fromArea = locate(/area/shuttle/alien/base)
|
||||
toArea = locate(/area/shuttle/alien/mine)
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (alien_ship_location)
|
||||
alien_ship_location = 0
|
||||
else
|
||||
alien_ship_location = 1
|
||||
return
|
||||
//
|
||||
+13
-24
@@ -1920,32 +1920,21 @@
|
||||
ticker.mode.finalize_traitor(A.mind)
|
||||
message_admins("\blue [key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]", 1)
|
||||
log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]")
|
||||
if("moveminingshuttle")
|
||||
if(mining_shuttle_moving)
|
||||
return
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShM")
|
||||
move_mining_shuttle()
|
||||
message_admins("\blue [key_name_admin(usr)] moved mining shuttle", 1)
|
||||
log_admin("[key_name(usr)] moved the mining shuttle")
|
||||
if("moveadminshuttle")
|
||||
|
||||
if("moveshuttle")
|
||||
|
||||
if(!shuttles) return // Something is very wrong, the shuttle controller has not been created.
|
||||
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShA")
|
||||
move_admin_shuttle()
|
||||
message_admins("\blue [key_name_admin(usr)] moved the centcom administration shuttle", 1)
|
||||
log_admin("[key_name(usr)] moved the centcom administration shuttle")
|
||||
if("moveferry")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShF")
|
||||
move_ferry()
|
||||
message_admins("\blue [key_name_admin(usr)] moved the centcom ferry", 1)
|
||||
log_admin("[key_name(usr)] moved the centcom ferry")
|
||||
if("movealienship")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ShX")
|
||||
move_alien_ship()
|
||||
message_admins("\blue [key_name_admin(usr)] moved the alien dinghy", 1)
|
||||
log_admin("[key_name(usr)] moved the alien dinghy")
|
||||
|
||||
var/shuttle_tag = input("Which shuttle do you want to call?") as null|anything in shuttles.locations
|
||||
|
||||
if(shuttle_tag && !shuttles.moving[shuttle_tag])
|
||||
shuttles.move_shuttle(shuttle_tag)
|
||||
message_admins("\blue [key_name_admin(usr)] moved the [shuttle_tag] shuttle", 1)
|
||||
log_admin("[key_name(usr)] moved the [shuttle_tag] shuttle")
|
||||
|
||||
if("togglebombcap")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","BC")
|
||||
|
||||
@@ -38,132 +38,6 @@
|
||||
new /obj/item/clothing/glasses/meson(src)
|
||||
|
||||
|
||||
/**********************Shuttle Computer**************************/
|
||||
|
||||
var/mining_shuttle_tickstomove = 10
|
||||
var/mining_shuttle_moving = 0
|
||||
var/mining_shuttle_location = 0 // 0 = station 13, 1 = mining station
|
||||
|
||||
proc/move_mining_shuttle()
|
||||
if(mining_shuttle_moving) return
|
||||
mining_shuttle_moving = 1
|
||||
spawn(mining_shuttle_tickstomove*10)
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (mining_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/mining/outpost)
|
||||
toArea = locate(/area/shuttle/mining/station)
|
||||
|
||||
else
|
||||
fromArea = locate(/area/shuttle/mining/station)
|
||||
toArea = locate(/area/shuttle/mining/outpost)
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in toArea)
|
||||
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 toArea) // If someone somehow is still in the shuttle's docking area...
|
||||
bug.gib()
|
||||
|
||||
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
|
||||
pest.gib()
|
||||
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (mining_shuttle_location)
|
||||
mining_shuttle_location = 0
|
||||
else
|
||||
mining_shuttle_location = 1
|
||||
|
||||
for(var/mob/M in toArea)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
if(M.buckled)
|
||||
shake_camera(M, 3, 1) // buckled, not a lot of shaking
|
||||
else
|
||||
shake_camera(M, 10, 1) // unbuckled, HOLY SHIT SHAKE THE ROOM
|
||||
if(istype(M, /mob/living/carbon))
|
||||
if(!M.buckled)
|
||||
M.Weaken(3)
|
||||
|
||||
mining_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mining_shuttle
|
||||
name = "mining shuttle console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_mining)
|
||||
circuit = "/obj/item/weapon/circuitboard/mining_shuttle"
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
|
||||
dat = "<center>Mining Shuttle Control<hr>"
|
||||
|
||||
if(mining_shuttle_moving)
|
||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
||||
else
|
||||
dat += "Location: [mining_shuttle_location ? "Outpost" : "Station"] <br>"
|
||||
|
||||
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
|
||||
|
||||
|
||||
user << browse("[dat]", "window=miningshuttle;size=200x150")
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["move"])
|
||||
//if(ticker.mode.name == "blob")
|
||||
// if(ticker.mode:declared)
|
||||
// usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
// return
|
||||
|
||||
if (!mining_shuttle_moving)
|
||||
usr << "\blue Shuttle recieved message and will be sent shortly."
|
||||
move_mining_shuttle()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You fried the consoles ID checking system. It's now available to everyone!"
|
||||
else
|
||||
..()
|
||||
|
||||
/******************************Lantern*******************************/
|
||||
|
||||
/obj/item/device/flashlight/lantern
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
|
||||
/**********************Shuttle Computer**************************/
|
||||
|
||||
//copy paste from the mining shuttle
|
||||
|
||||
var/research_shuttle_tickstomove = 10
|
||||
var/research_shuttle_moving = 0
|
||||
var/research_shuttle_location = 0 // 0 = station 13, 1 = research station
|
||||
|
||||
proc/move_research_shuttle()
|
||||
if(research_shuttle_moving) return
|
||||
research_shuttle_moving = 1
|
||||
spawn(research_shuttle_tickstomove*10)
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (research_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/research/outpost)
|
||||
toArea = locate(/area/shuttle/research/station)
|
||||
else
|
||||
fromArea = locate(/area/shuttle/research/station)
|
||||
toArea = locate(/area/shuttle/research/outpost)
|
||||
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in toArea)
|
||||
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 toArea) // If someone somehow is still in the shuttle's docking area...
|
||||
bug.gib()
|
||||
|
||||
for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
|
||||
pest.gib()
|
||||
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (research_shuttle_location)
|
||||
research_shuttle_location = 0
|
||||
else
|
||||
research_shuttle_location = 1
|
||||
research_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/research_shuttle
|
||||
name = "Research Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_research)
|
||||
circuit = "/obj/item/weapon/circuitboard/research_shuttle"
|
||||
var/hacked = 0
|
||||
var/location = 0 //0 = station, 1 = research base
|
||||
|
||||
/obj/machinery/computer/research_shuttle/attack_hand(user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
var/dat = "<center>Research shuttle: <b><A href='?src=\ref[src];move=1'>Send</A></b></center><br>"
|
||||
|
||||
user << browse("[dat]", "window=researchshuttle;size=200x100")
|
||||
|
||||
/obj/machinery/computer/research_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["move"])
|
||||
//if(ticker.mode.name == "blob")
|
||||
// if(ticker.mode:declared)
|
||||
// usr << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
// return
|
||||
|
||||
if (!research_shuttle_moving)
|
||||
usr << "\blue Shuttle recieved message and will be sent shortly."
|
||||
move_research_shuttle()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
|
||||
/obj/machinery/computer/research_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
var/obj/item/weapon/card/emag/E = W
|
||||
if(E.uses)
|
||||
E.uses--
|
||||
else
|
||||
return
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You fried the consoles ID checking system. It's now available to everyone!"
|
||||
|
||||
else
|
||||
..()
|
||||
@@ -0,0 +1,9 @@
|
||||
/obj/machinery/computer/shuttle_control/multi/vox
|
||||
name = "skipjack control console"
|
||||
req_access = list(access_syndicate)
|
||||
shuttle_tag = "Vox Skipjack"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/syndicate
|
||||
name = "Syndicate control console"
|
||||
req_access = list(access_syndicate)
|
||||
shuttle_tag = "Syndicate"
|
||||
@@ -0,0 +1,17 @@
|
||||
/obj/machinery/computer/shuttle_control/mining
|
||||
name = "mining shuttle console"
|
||||
shuttle_tag = "Mining"
|
||||
req_access = list(access_mining)
|
||||
circuit = "/obj/item/weapon/circuitboard/mining_shuttle"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/engineering
|
||||
name = "engineering shuttle console"
|
||||
shuttle_tag = "Engineering"
|
||||
req_access = list(access_engine)
|
||||
circuit = "/obj/item/weapon/circuitboard/engineering_shuttle"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/research
|
||||
name = "research shuttle console"
|
||||
shuttle_tag = "Research"
|
||||
req_access = list(access_research)
|
||||
circuit = "/obj/item/weapon/circuitboard/research_shuttle"
|
||||
@@ -1,108 +0,0 @@
|
||||
var/engineering_shuttle_tickstomove = 10
|
||||
var/engineering_shuttle_moving = 0
|
||||
var/engineering_shuttle_location = 1 //Starts at the construction site.
|
||||
|
||||
proc/move_engineering_shuttle()
|
||||
if(engineering_shuttle_moving) return
|
||||
engineering_shuttle_moving = 1
|
||||
spawn(engineering_shuttle_tickstomove*10)
|
||||
var/area/fromArea
|
||||
var/area/toArea
|
||||
if (engineering_shuttle_location == 1)
|
||||
fromArea = locate(/area/shuttle/constructionsite/site)
|
||||
toArea = locate(/area/shuttle/constructionsite/station)
|
||||
|
||||
else
|
||||
fromArea = locate(/area/shuttle/constructionsite/station)
|
||||
toArea = locate(/area/shuttle/constructionsite/site)
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in toArea)
|
||||
dstturfs += T
|
||||
if(T.y < throwy)
|
||||
throwy = T.y
|
||||
|
||||
for(var/turf/T in dstturfs)
|
||||
var/turf/D = locate(T.x, throwy - 1, 1)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.Move(D)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
for(var/mob/living/carbon/bug in toArea)
|
||||
bug.gib()
|
||||
|
||||
for(var/mob/living/simple_animal/pest in toArea)
|
||||
pest.gib()
|
||||
|
||||
fromArea.move_contents_to(toArea)
|
||||
if (engineering_shuttle_location)
|
||||
engineering_shuttle_location = 0
|
||||
else
|
||||
engineering_shuttle_location = 1
|
||||
|
||||
for(var/mob/M in toArea)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
if(M.buckled)
|
||||
shake_camera(M, 3, 1)
|
||||
else
|
||||
shake_camera(M, 10, 1)
|
||||
if(istype(M, /mob/living/carbon))
|
||||
if(!M.buckled)
|
||||
M.Weaken(3)
|
||||
|
||||
engineering_shuttle_moving = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/engineering_shuttle
|
||||
name = "engineering shuttle console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_engine)
|
||||
circuit = "/obj/item/weapon/circuitboard/engineering_shuttle"
|
||||
var/hacked = 0
|
||||
var/location = 0
|
||||
|
||||
/obj/machinery/computer/engineering_shuttle/attack_hand(user as mob)
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
|
||||
dat = "<center>Engineering Shuttle Control<hr>"
|
||||
|
||||
if(engineering_shuttle_moving)
|
||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
||||
else
|
||||
dat += "Location: [engineering_shuttle_location ? "Outpost" : "Station"] <br>"
|
||||
|
||||
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
|
||||
|
||||
|
||||
user << browse("[dat]", "window=engineeringshuttle;size=200x150")
|
||||
|
||||
/obj/machinery/computer/engineering_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["move"])
|
||||
if (!engineering_shuttle_moving)
|
||||
usr << "\blue Shuttle recieved message and will be sent shortly."
|
||||
move_engineering_shuttle()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/engineering_shuttle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You fried the consoles ID checking system. It's now available to everyone!"
|
||||
else
|
||||
..()
|
||||
@@ -0,0 +1,256 @@
|
||||
//These lists are populated in /datum/shuttle_controller/New()
|
||||
//Shuttle controller is instantiated in master_controller.dm.
|
||||
|
||||
var/global/datum/shuttle_controller/shuttles
|
||||
|
||||
/datum/shuttle_controller //This isn't really a controller...
|
||||
var/list/locations = list()
|
||||
var/list/delays = list()
|
||||
var/list/moving = list()
|
||||
var/list/areas_offsite = list()
|
||||
var/list/areas_station = list()
|
||||
|
||||
//Shuttles with multiple destinations don't quite behave in the same way as ferries.
|
||||
var/list/multi_shuttles = list()
|
||||
|
||||
/datum/shuttle_controller/New()
|
||||
|
||||
..()
|
||||
|
||||
//Supply and escape shuttles.
|
||||
locations["Supply"] = 1
|
||||
delays["Supply"] = 0
|
||||
moving["Supply"] = 0
|
||||
areas_offsite["Supply"] = locate(/area/supply/dock)
|
||||
areas_station["Supply"] = locate(/area/supply/station)
|
||||
|
||||
// Admin shuttles.
|
||||
locations["Centcom"] = 1
|
||||
delays["Centcom"] = 0
|
||||
moving["Centcom"] = 0
|
||||
areas_offsite["Centcom"] = locate(/area/shuttle/transport1/centcom)
|
||||
areas_station["Centcom"] = locate(/area/shuttle/transport1/station)
|
||||
|
||||
locations["Administration"] = 1
|
||||
delays["Administration"] = 0
|
||||
moving["Administration"] = 0
|
||||
areas_offsite["Administration"] = locate(/area/shuttle/administration/centcom)
|
||||
areas_station["Administration"] = locate(/area/shuttle/administration/station)
|
||||
|
||||
locations["Alien"] = 0
|
||||
delays["Alien"] = 0
|
||||
moving["Alien"] = 0
|
||||
areas_offsite["Alien"] = locate(/area/shuttle/alien/base)
|
||||
areas_station["Alien"] = locate(/area/shuttle/alien/mine)
|
||||
|
||||
// Public shuttles.
|
||||
locations["Engineering"] = 1
|
||||
delays["Engineering"] = 10
|
||||
moving["Engineering"] = 0
|
||||
areas_offsite["Engineering"] = locate(/area/shuttle/constructionsite/site)
|
||||
areas_station["Engineering"] = locate(/area/shuttle/constructionsite/station)
|
||||
|
||||
locations["Mining"] = 0
|
||||
delays["Mining"] = 10
|
||||
moving["Mining"] = 0
|
||||
areas_offsite["Mining"] = locate(/area/shuttle/mining/outpost)
|
||||
areas_station["Mining"] = locate(/area/shuttle/mining/station)
|
||||
|
||||
locations["Research"] = 0
|
||||
delays["Research"] = 10
|
||||
moving["Research"] = 0
|
||||
areas_offsite["Research"] = locate(/area/shuttle/research/outpost)
|
||||
areas_station["Research"] = locate(/area/shuttle/research/station)
|
||||
|
||||
//Vox Shuttle.
|
||||
var/datum/multi_shuttle/VS = new
|
||||
VS.origin = /area/shuttle/vox/station
|
||||
|
||||
VS.destinations = list(
|
||||
"Fore Starboard Solars" = /area/vox_station/northeast_solars,
|
||||
"Fore Port Solars" = /area/vox_station/northwest_solars,
|
||||
"Aft Starboard Solars" = /area/vox_station/southeast_solars,
|
||||
"Aft Port Solars" = /area/vox_station/southwest_solars,
|
||||
"Mining asteroid" = /area/vox_station/mining
|
||||
)
|
||||
|
||||
VS.announcer = "NSV Icarus"
|
||||
VS.arrival_message = "Attention, Exodus, we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
|
||||
VS.departure_message = "Your guests are pulling away, Exodus - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
|
||||
VS.interim = /area/vox_station/transit
|
||||
|
||||
multi_shuttles["Vox Skipjack"] = VS
|
||||
locations["Vox Skipjack"] = 1
|
||||
delays["Vox Skipjack"] = 10
|
||||
moving["Vox Skipjack"] = 0
|
||||
|
||||
//Nuke Ops shuttle.
|
||||
var/datum/multi_shuttle/MS = new
|
||||
MS.origin = /area/syndicate_station/start
|
||||
|
||||
MS.destinations = list(
|
||||
"Northwest of the station" = /area/syndicate_station/northwest,
|
||||
"North of the station" = /area/syndicate_station/north,
|
||||
"Northeast of the station" = /area/syndicate_station/northeast,
|
||||
"Southwest of the station" = /area/syndicate_station/southwest,
|
||||
"South of the station" = /area/syndicate_station/south,
|
||||
"Southeast of the station" = /area/syndicate_station/southeast,
|
||||
"Telecomms Satellite" = /area/syndicate_station/commssat,
|
||||
"Mining Asteroid" = /area/syndicate_station/mining
|
||||
)
|
||||
|
||||
MS.announcer = "NSV Icarus"
|
||||
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
||||
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
|
||||
MS.interim = /area/syndicate_station/transit
|
||||
|
||||
multi_shuttles["Syndicate"] = MS
|
||||
locations["Syndicate"] = 1
|
||||
delays["Syndicate"] = 10
|
||||
moving["Syndicate"] = 0
|
||||
|
||||
/datum/shuttle_controller/proc/move_shuttle(var/shuttle_tag,var/area/origin,var/area/destination)
|
||||
|
||||
//world << "move_shuttle() called for [shuttle_tag] leaving [origin] en route to [destination]."
|
||||
if(!shuttle_tag || isnull(locations[shuttle_tag]))
|
||||
return
|
||||
|
||||
if(moving[shuttle_tag] == 1) return
|
||||
moving[shuttle_tag] = 1
|
||||
|
||||
spawn(delays[shuttle_tag]*10)
|
||||
|
||||
var/area/area_going_to
|
||||
if(destination)
|
||||
//world << "Using supplied destination [destination]."
|
||||
area_going_to = destination
|
||||
else
|
||||
//world << "Using controller value [(locations[shuttle_tag] == 1 ? areas_station[shuttle_tag] : areas_offsite[shuttle_tag])]."
|
||||
area_going_to = (locations[shuttle_tag] == 1 ? areas_station[shuttle_tag] : areas_offsite[shuttle_tag])
|
||||
|
||||
var/area/area_coming_from
|
||||
if(origin)
|
||||
//world << "Using supplied origin [origin]."
|
||||
area_coming_from = origin
|
||||
else
|
||||
//world << "Using controller value [(locations[shuttle_tag] == 1 ? areas_offsite[shuttle_tag] : areas_station[shuttle_tag])]."
|
||||
area_coming_from = (locations[shuttle_tag] == 1 ? areas_offsite[shuttle_tag] : areas_station[shuttle_tag])
|
||||
|
||||
//world << "area_coming_from: [area_coming_from]"
|
||||
//world << "area_going_to: [area_going_to]"
|
||||
|
||||
if(area_coming_from == area_going_to)
|
||||
//world << "cancelling move, shuttle will overlap."
|
||||
moving[shuttle_tag] = 0
|
||||
return
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in area_going_to)
|
||||
dstturfs += T
|
||||
if(T.y < throwy)
|
||||
throwy = T.y
|
||||
|
||||
for(var/turf/T in dstturfs)
|
||||
var/turf/D = locate(T.x, throwy - 1, 1)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.Move(D)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
for(var/mob/living/carbon/bug in area_going_to)
|
||||
bug.gib()
|
||||
|
||||
for(var/mob/living/simple_animal/pest in area_going_to)
|
||||
pest.gib()
|
||||
|
||||
area_coming_from.move_contents_to(area_going_to)
|
||||
|
||||
locations[shuttle_tag] = !locations[shuttle_tag]
|
||||
|
||||
for(var/mob/M in area_going_to)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
if(M.buckled)
|
||||
M << "\red Sudden acceleration presses you into your chair!"
|
||||
shake_camera(M, 3, 1)
|
||||
else
|
||||
M << "\red The floor lurches beneath you!"
|
||||
shake_camera(M, 10, 1)
|
||||
if(istype(M, /mob/living/carbon))
|
||||
if(!M.buckled)
|
||||
M.Weaken(3)
|
||||
|
||||
moving[shuttle_tag] = 0
|
||||
return
|
||||
|
||||
//This is for shuttles with a timer before arrival such as the vox skipjack and the escape shuttle.
|
||||
/datum/shuttle_controller/proc/move_shuttle_long(var/shuttle_tag,var/area/departing,var/area/destination,var/area/interim,var/delay)
|
||||
|
||||
move_shuttle(shuttle_tag,locate(departing),locate(interim))
|
||||
|
||||
spawn(1)
|
||||
moving[shuttle_tag] = 1 //So they can't jump out by messing with the console.
|
||||
|
||||
sleep(delay)
|
||||
|
||||
moving[shuttle_tag] = 0
|
||||
move_shuttle(shuttle_tag,locate(interim),locate(destination))
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle_control
|
||||
name = "shuttle console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_engine)
|
||||
circuit = "/obj/item/weapon/circuitboard/engineering_shuttle"
|
||||
|
||||
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
||||
var/hacked = 0 // Has been emagged, no access restrictions.
|
||||
|
||||
/obj/machinery/computer/shuttle_control/attack_hand(user as mob)
|
||||
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
var/dat
|
||||
|
||||
dat = "<center>[shuttle_tag] Shuttle Control<hr>"
|
||||
|
||||
if(shuttles.moving[shuttle_tag])
|
||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
||||
else
|
||||
dat += "Location: [shuttles.locations[shuttle_tag] ? "Offsite" : "Station"] <br>"
|
||||
|
||||
dat += "<b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>"
|
||||
|
||||
|
||||
user << browse("[dat]", "window=[shuttle_tag]shuttlecontrol;size=200x150")
|
||||
|
||||
/obj/machinery/computer/shuttle_control/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
if(href_list["move"])
|
||||
if (!shuttles.moving[shuttle_tag])
|
||||
usr << "\blue [shuttle_tag] Shuttle recieved message and will be sent shortly."
|
||||
shuttles.move_shuttle(shuttle_tag)
|
||||
else
|
||||
usr << "\blue [shuttle_tag] Shuttle is already moving."
|
||||
|
||||
|
||||
/obj/machinery/computer/shuttle_control/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
hacked = 1
|
||||
usr << "You short out the console's ID checking system. It's now available to everyone!"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/shuttle_control/bullet_act(var/obj/item/projectile/Proj)
|
||||
visible_message("[Proj] ricochets off [src]!")
|
||||
@@ -0,0 +1,138 @@
|
||||
//This is a holder for things like the Vox and Nuke shuttle.
|
||||
/datum/multi_shuttle
|
||||
|
||||
var/cloaked = 1
|
||||
var/at_origin = 1
|
||||
var/move_time = 240
|
||||
var/cooldown = 200
|
||||
var/last_move = 0
|
||||
|
||||
var/announcer
|
||||
var/arrival_message
|
||||
var/departure_message
|
||||
|
||||
var/area/interim
|
||||
var/area/last_departed
|
||||
var/list/destinations
|
||||
var/area/origin
|
||||
var/return_warning = 0
|
||||
|
||||
/datum/multi_shuttle/New()
|
||||
..()
|
||||
if(origin) last_departed = origin
|
||||
|
||||
/datum/multi_shuttle/proc/announce_departure()
|
||||
|
||||
if(cloaked || isnull(departure_message))
|
||||
return
|
||||
|
||||
command_alert(departure_message,(announcer ? announcer : "Central Command"))
|
||||
|
||||
/datum/multi_shuttle/proc/announce_arrival()
|
||||
|
||||
if(cloaked || isnull(arrival_message))
|
||||
return
|
||||
|
||||
command_alert(arrival_message,(announcer ? announcer : "Central Command"))
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi
|
||||
icon_state = "syndishuttle"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/attack_hand(user as mob)
|
||||
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
|
||||
var/datum/multi_shuttle/MS = shuttles.multi_shuttles[shuttle_tag]
|
||||
if(!istype(MS)) return
|
||||
|
||||
var/dat
|
||||
dat = "<center>[shuttle_tag] Ship Control<hr>"
|
||||
|
||||
|
||||
if(shuttles.moving[shuttle_tag])
|
||||
dat += "Location: <font color='red'>Moving</font> <br>"
|
||||
else
|
||||
var/area/areacheck = get_area(src)
|
||||
dat += "Location: [areacheck.name]<br>"
|
||||
|
||||
if((MS.last_move + MS.cooldown) > world.time)
|
||||
dat += "<font color='red'>Engines charging.</font><br>"
|
||||
else
|
||||
dat += "<font color='green'>Engines ready.</font><br>"
|
||||
|
||||
dat += "<br><b><A href='?src=\ref[src];toggle_cloak=[1]'>Toggle cloaking field</A></b><br>"
|
||||
dat += "<b><A href='?src=\ref[src];move_multi=[1]'>Move ship</A></b><br>"
|
||||
dat += "<b><A href='?src=\ref[src];start=[1]'>Return to base</A></b></center>"
|
||||
|
||||
user << browse("[dat]", "window=[shuttle_tag]shuttlecontrol;size=300x600")
|
||||
|
||||
/obj/machinery/computer/shuttle_control/multi/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
var/datum/multi_shuttle/MS = shuttles.multi_shuttles[shuttle_tag]
|
||||
if(!istype(MS)) return
|
||||
|
||||
if (shuttles.moving[shuttle_tag])
|
||||
usr << "\blue [shuttle_tag] vessel is moving."
|
||||
return
|
||||
|
||||
if((MS.last_move + MS.cooldown) > world.time)
|
||||
usr << "\red The ship is inoperable while the engines are charging."
|
||||
return
|
||||
|
||||
if(href_list["start"])
|
||||
|
||||
if(MS.at_origin)
|
||||
usr << "\red You are already at your home base."
|
||||
return
|
||||
|
||||
if(!MS.return_warning)
|
||||
usr << "\red Returning to your home base will end your mission. If you are sure, press the button again."
|
||||
//TODO: Actually end the mission.
|
||||
MS.return_warning = 1
|
||||
return
|
||||
|
||||
shuttles.move_shuttle_long(shuttle_tag,MS.last_departed,MS.origin,MS.interim,MS.move_time)
|
||||
MS.last_departed = MS.origin
|
||||
MS.at_origin = 1
|
||||
|
||||
if(href_list["toggle_cloak"])
|
||||
|
||||
if(!shuttles.multi_shuttles) return
|
||||
|
||||
MS.cloaked = !MS.cloaked
|
||||
usr << "\red Ship stealth systems have been [(MS.cloaked ? "activated. The station will not" : "deactivated. The station will")] be warned of our arrival."
|
||||
|
||||
if(href_list["move_multi"])
|
||||
|
||||
if(!shuttles.multi_shuttles) return
|
||||
|
||||
var/choice = input("Select a destination.") as null|anything in MS.destinations
|
||||
if(!choice) return
|
||||
|
||||
usr << "\blue [shuttle_tag] main computer recieved message."
|
||||
|
||||
if(MS.at_origin)
|
||||
MS.announce_arrival()
|
||||
MS.last_departed = MS.origin
|
||||
MS.at_origin = 0
|
||||
|
||||
shuttles.move_shuttle_long(shuttle_tag,MS.last_departed,MS.destinations[choice],MS.interim,MS.move_time)
|
||||
MS.last_departed = MS.destinations[choice]
|
||||
return
|
||||
|
||||
else if(choice == MS.origin)
|
||||
|
||||
MS.announce_departure()
|
||||
|
||||
shuttles.move_shuttle(shuttle_tag,locate(MS.last_departed),locate(MS.destinations[choice]))
|
||||
MS.last_departed = MS.destinations[choice]
|
||||
|
||||
updateUsrDialog()
|
||||
Reference in New Issue
Block a user