mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 14:44:05 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into space_allocation
This commit is contained in:
@@ -1,363 +0,0 @@
|
||||
/obj/machinery/computer3/cloning
|
||||
default_prog = /datum/file/program/cloning
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/storage/removable,/obj/item/part/computer/networking/prox)
|
||||
|
||||
/datum/file/program/cloning
|
||||
name = "cloning console"
|
||||
desc = "Connects to cloning machinery through the local network."
|
||||
active_state = "dna_old"
|
||||
|
||||
req_access = list(access_heads) //Only used for record deletion right now.
|
||||
|
||||
var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
|
||||
var/obj/machinery/clonepod/pod1 = null //Linked cloning pod.
|
||||
|
||||
var/temp = "Inactive"
|
||||
var/scantemp_ckey
|
||||
var/scantemp = "Ready to Scan"
|
||||
var/menu = 1 //Which menu screen to display
|
||||
var/list/records = list()
|
||||
var/datum/data/record/active_record = null
|
||||
var/loading = 0 // Nice loading text
|
||||
var/has_disk = 0
|
||||
|
||||
proc/updatemodules()
|
||||
if(!computer.net) return
|
||||
|
||||
if(scanner && pod1)
|
||||
if(!computer.net.verify_machine(scanner))
|
||||
scanner = null
|
||||
if(!computer.net.verify_machine(pod1))
|
||||
pod1 = null
|
||||
|
||||
if(!scanner || !pod1)
|
||||
var/list/nearby = computer.net.get_machines()
|
||||
scanner = locate(/obj/machinery/dna_scannernew) in nearby
|
||||
pod1 = locate(/obj/machinery/clonepod) in nearby
|
||||
|
||||
if(pod1)
|
||||
pod1.connected = src // Some variable the pod needs
|
||||
|
||||
proc/ScanningMenu()
|
||||
if(isnull(scanner))
|
||||
return "<font class='bad'>ERROR: No Scanner detected!</font><br>"
|
||||
|
||||
var/dat = "<h3>Scanner Functions</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
|
||||
if(!scanner.occupant)
|
||||
dat += "Scanner Unoccupied"
|
||||
else if(loading)
|
||||
dat += "[scanner.occupant] => Scanning..."
|
||||
else
|
||||
if(scanner.occupant.ckey != scantemp_ckey)
|
||||
scantemp = "Ready to Scan"
|
||||
scantemp_ckey = scanner.occupant.ckey
|
||||
dat += "[scanner.occupant] => [scantemp]"
|
||||
|
||||
dat += "</div>"
|
||||
|
||||
if(scanner.occupant)
|
||||
dat += topic_link(src,"scan","Start Scan") + "<br>"
|
||||
if(scanner.locked)
|
||||
dat += topic_link(src,"lock","Unlock Scanner")
|
||||
else
|
||||
dat += topic_link(src,"lock","Lock Scanner")
|
||||
else
|
||||
dat += fake_link("Start Scan")
|
||||
|
||||
// Footer
|
||||
dat += "<h3>Database Functions</h3>"
|
||||
if(records.len > 0)
|
||||
dat += topic_link(src,"menu=2","View Records ([records.len])") + "<br>"
|
||||
else
|
||||
dat += fake_link("View Records (0)")
|
||||
|
||||
if(has_disk)
|
||||
dat += topic_link(src,"eject_disk","Eject Disk") + "<br>"
|
||||
return dat
|
||||
|
||||
proc/RecordsList()
|
||||
var/dat = "<h3>Current records</h3>"
|
||||
to_chat(dat += topic_link(src,"menu=1",", Back") + "<br><br>")
|
||||
for(var/datum/data/record/R in records)
|
||||
dat += "<h4>[R.fields["name"]]</h4>Scan ID [R.fields["id"]] " + topic_link(src,"view_rec=\ref[R]","View Record")
|
||||
return dat
|
||||
|
||||
proc/ShowRecord()
|
||||
var/dat = "<h3>Selected Record</h3>"
|
||||
to_chat(dat += topic_link(src,"menu=2",", Back") + "<br><br>")
|
||||
|
||||
if(!active_record)
|
||||
dat += "<font class='bad'>Record not found.</font>"
|
||||
else
|
||||
dat += "<h4>[active_record.fields["name"]]</h4>"
|
||||
dat += "Scan ID [active_record.fields["id"]] [topic_link(src,"clone","Clone")]<br>"
|
||||
|
||||
var/obj/item/weapon/implant/health/H = locate(active_record.fields["imp"])
|
||||
|
||||
if((H) && (istype(H)))
|
||||
dat += "<b>Health Implant Data:</b><br />[H.sensehealth()]<br><br />"
|
||||
else
|
||||
dat += "<font class='bad'>Unable to locate Health Implant.</font><br /><br />"
|
||||
|
||||
dat += "<b>Unique Identifier:</b><br /><span class='highlight'>[active_record.fields["UI"]]</span><br>"
|
||||
dat += "<b>Structural Enzymes:</b><br /><span class='highlight'>[active_record.fields["SE"]]</span><br>"
|
||||
|
||||
if(has_disk)
|
||||
dat += "<div class='block'>"
|
||||
dat += "<h4>Inserted Disk</h4>"
|
||||
dat += "<b>Contents:</b> "
|
||||
if(computer.floppy.inserted.files.len == 0)
|
||||
dat += "<i>Empty</i>"
|
||||
else
|
||||
for(var/datum/file/data/genome/G in computer.floppy.inserted.files)
|
||||
dat += topic_link(src,"loadfile=\ref[G]","[G.name]") + "<br>"
|
||||
|
||||
dat += "<br /><br /><b>Save to Disk:<b><br />"
|
||||
dat += topic_link(src,"save_disk=ue","Unique Identifier + Unique Enzymes") + "<br />"
|
||||
dat += topic_link(src,"save_disk=ui","Unique Identifier") + "<br />"
|
||||
dat += topic_link(src,"save_disk=se","Structural Enzymes") + "<br />"
|
||||
dat += "</div>"
|
||||
|
||||
dat += "<font size=1>[topic_link(src,"del_rec","Delete Record")]</font>"
|
||||
return dat
|
||||
proc/ConfirmDelete()
|
||||
var/dat = "[temp]<br>"
|
||||
dat += "<h3>Confirm Record Deletion</h3>"
|
||||
|
||||
dat += "<b>[topic_link(src,"del_rec","Scan card to confirm")]</b><br>"
|
||||
dat += "<b>[topic_link(src,"menu=3","Cancel")]</b>"
|
||||
return dat
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
updatemodules()
|
||||
|
||||
var/dat = ""
|
||||
dat += topic_link(src,"refresh","Refresh")
|
||||
dat += "<h3>Cloning Pod Status</h3>"
|
||||
dat += "<div class='statusDisplay'>[temp] </div>"
|
||||
|
||||
has_disk = (computer.floppy && computer.floppy.inserted)
|
||||
if(!active_record && menu > 2)
|
||||
menu = 2
|
||||
|
||||
switch(menu)
|
||||
if(1)
|
||||
dat += ScanningMenu()
|
||||
|
||||
if(2)
|
||||
dat += RecordsList()
|
||||
|
||||
if(3)
|
||||
dat += ShowRecord()
|
||||
|
||||
if(4)
|
||||
dat = ConfirmDelete() // not (+=), this is how it used to be, just putting it in a function
|
||||
|
||||
if(!popup)
|
||||
popup = new(usr, "\ref[computer]", "Cloning System Control")
|
||||
popup.set_title_image(usr.browse_rsc_icon(overlay.icon, overlay.icon_state))
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(loading || !interactable())
|
||||
return
|
||||
|
||||
if(href_list["menu"])
|
||||
menu = text2num(href_list["menu"])
|
||||
else if(("scan" in href_list) && !isnull(scanner))
|
||||
scantemp = ""
|
||||
|
||||
loading = 1
|
||||
computer.updateUsrDialog()
|
||||
|
||||
spawn(20)
|
||||
scan_mob(scanner.occupant)
|
||||
|
||||
loading = 0
|
||||
computer.updateUsrDialog()
|
||||
|
||||
|
||||
//No locking an open scanner.
|
||||
else if(("lock" in href_list) && !isnull(scanner))
|
||||
if((!scanner.locked) && (scanner.occupant))
|
||||
scanner.locked = 1
|
||||
else
|
||||
scanner.locked = 0
|
||||
|
||||
else if("view_rec" in href_list)
|
||||
active_record = locate(href_list["view_rec"])
|
||||
if(istype(active_record,/datum/data/record))
|
||||
if( !active_record.fields["ckey"] || active_record.fields["ckey"] == "" )
|
||||
del(active_record)
|
||||
temp = "<font class='bad'>Record Corrupt</font>"
|
||||
else
|
||||
menu = 3
|
||||
else
|
||||
active_record = null
|
||||
temp = "Record missing."
|
||||
|
||||
else if("del_rec" in href_list)
|
||||
if((!active_record) || (menu < 3))
|
||||
return
|
||||
if(menu == 3) //If we are viewing a record, confirm deletion
|
||||
temp = "Delete record?"
|
||||
menu = 4
|
||||
|
||||
else if(menu == 4)
|
||||
var/obj/item/weapon/card/id/C = usr.get_active_hand()
|
||||
if(istype(C)||istype(C, /obj/item/device/pda))
|
||||
if(check_access(C))
|
||||
temp = "[active_record.fields["name"]] => Record deleted."
|
||||
records.Remove(active_record)
|
||||
del(active_record)
|
||||
menu = 2
|
||||
else
|
||||
temp = "<font class='bad'>Access Denied.</font>"
|
||||
|
||||
else if("eject_disk" in href_list)
|
||||
if(computer.floppy)
|
||||
computer.floppy.eject_disk()
|
||||
|
||||
else if("loadfile" in href_list)
|
||||
|
||||
var/datum/file/data/genome/G = locate(href_list["loadfile"]) in computer.floppy.files
|
||||
if(!istype(G))
|
||||
temp = "<font class='bad'>Load error.</font>"
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
switch(G.type)
|
||||
if(/datum/file/data/genome/UI)
|
||||
active_record.fields["UI"] = G.content
|
||||
if(/datum/file/data/genome/UE)
|
||||
active_record.fields["name"] = G.real_name
|
||||
if(/datum/file/data/genome/SE)
|
||||
active_record.fields["SE"] = G.content
|
||||
if(/datum/file/data/genome/cloning)
|
||||
active_record = G:record
|
||||
else if("savefile" in href_list)
|
||||
if(!active_record || !computer || !computer.floppy)
|
||||
temp = "<font class='bad'>Save error.</font>"
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
var/rval = 0
|
||||
switch(href_list["save_disk"])
|
||||
if("ui")
|
||||
var/datum/file/data/genome/UI/ui = new
|
||||
ui.content = active_record.fields["UI"]
|
||||
ui.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(ui)
|
||||
if("ue")
|
||||
var/datum/file/data/genome/UI/UE/ui = new
|
||||
ui.content = active_record.fields["UI"]
|
||||
ui.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(ui)
|
||||
if("se")
|
||||
var/datum/file/data/genome/SE/se = new
|
||||
se.content = active_record.fields["SE"]
|
||||
se.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(se)
|
||||
if("clone")
|
||||
var/datum/file/data/genome/cloning/c = new
|
||||
c.record = active_record
|
||||
c.real_name = active_record.fields["name"]
|
||||
rval = computer.floppy.addfile(c)
|
||||
if(!rval)
|
||||
temp = "<font class='bad'>Disk write error.</font>"
|
||||
|
||||
else if("refresh" in href_list)
|
||||
computer.updateUsrDialog()
|
||||
|
||||
else if("clone" in href_list)
|
||||
//Look for that player! They better be dead!
|
||||
if(active_record)
|
||||
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
|
||||
if(!pod1)
|
||||
temp = "<font class='bad'>No Clonepod detected.</font>"
|
||||
else if(pod1.occupant)
|
||||
temp = "<font class='bad'>Clonepod is currently occupied.</font>"
|
||||
else if(pod1.mess)
|
||||
temp = "<font class='bad'>Clonepod malfunction.</font>"
|
||||
else if(!config.revival_cloning)
|
||||
temp = "<font class='bad'>Unable to initiate cloning cycle.</font>"
|
||||
else if(pod1.growclone(active_record.fields["ckey"], active_record.fields["name"], active_record.fields["UI"], active_record.fields["SE"], active_record.fields["mind"], active_record.fields["mrace"]))
|
||||
temp = "[active_record.fields["name"]] => <font class='good'>Cloning cycle in progress...</font>"
|
||||
records.Remove(active_record)
|
||||
del(active_record)
|
||||
menu = 1
|
||||
else
|
||||
temp = "[active_record.fields["name"]] => <font class='bad'>Initialisation failure.</font>"
|
||||
|
||||
else
|
||||
temp = "<font class='bad'>Data corruption.</font>"
|
||||
|
||||
computer.add_fingerprint(usr)
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
|
||||
proc/scan_mob(mob/living/carbon/human/subject as mob)
|
||||
if((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna))
|
||||
scantemp = "<font class='bad'>Unable to locate valid genetic data.</font>"
|
||||
return
|
||||
if(!getbrain(subject))
|
||||
scantemp = "<font class='bad'>No signs of intelligence detected.</font>"
|
||||
return
|
||||
if(subject.suiciding == 1)
|
||||
scantemp = "<font class='bad'>Subject's brain is not responding to scanning stimuli.</font>"
|
||||
return
|
||||
if((!subject.ckey) || (!subject.client))
|
||||
scantemp = "<font class='bad'>Mental interface failure.</font>"
|
||||
return
|
||||
if(NOCLONE in subject.mutations)
|
||||
scantemp = "<font class='bad'>Mental interface failure.</font>"
|
||||
return
|
||||
if(!isnull(find_record(subject.ckey)))
|
||||
scantemp = "<font class='average'>Subject already in database.</font>"
|
||||
return
|
||||
|
||||
subject.dna.check_integrity()
|
||||
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
if(subject.dna)
|
||||
R.fields["mrace"] = subject.dna.mutantrace
|
||||
R.fields["UI"] = subject.dna.uni_identity
|
||||
R.fields["SE"] = subject.dna.struc_enzymes
|
||||
else
|
||||
R.fields["mrace"] = null
|
||||
R.fields["UI"] = null
|
||||
R.fields["SE"] = null
|
||||
R.fields["ckey"] = subject.ckey
|
||||
R.fields["name"] = subject.real_name
|
||||
R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
|
||||
|
||||
|
||||
|
||||
//Add an implant if needed
|
||||
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)
|
||||
if(isnull(imp))
|
||||
imp = new /obj/item/weapon/implant/health(subject)
|
||||
imp.implanted = subject
|
||||
R.fields["imp"] = "\ref[imp]"
|
||||
//Update it if needed
|
||||
else
|
||||
R.fields["imp"] = "\ref[imp]"
|
||||
|
||||
if(!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
|
||||
R.fields["mind"] = "\ref[subject.mind]"
|
||||
|
||||
records += R
|
||||
scantemp = "Subject successfully scanned."
|
||||
|
||||
//Find a specific record by key.
|
||||
proc/find_record(var/find_key)
|
||||
for(var/datum/data/record/R in records)
|
||||
if(R.fields["ckey"] == find_key)
|
||||
return R
|
||||
return null
|
||||
@@ -1,242 +0,0 @@
|
||||
//Config stuff
|
||||
#define PRISON_MOVETIME 150 //Time to station is milliseconds.
|
||||
#define PRISON_STATION_AREATYPE "/area/shuttle/prison/station" //Type of the prison shuttle area for station
|
||||
#define PRISON_DOCK_AREATYPE "/area/shuttle/prison/prison" //Type of the prison shuttle area for dock
|
||||
|
||||
var/prison_shuttle_moving_to_station = 0
|
||||
var/prison_shuttle_moving_to_prison = 0
|
||||
var/prison_shuttle_at_station = 0
|
||||
var/prison_shuttle_can_send = 1
|
||||
var/prison_shuttle_time = 0
|
||||
var/prison_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer3/prison_shuttle
|
||||
name = "Prison Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_security)
|
||||
circuit = "/obj/item/part/board/circuit/prison_shuttle"
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
var/prison_break = 0
|
||||
|
||||
|
||||
attackby(I as obj, user as mob, params)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attackby(I as obj, user as mob, params)
|
||||
if(istype(I, /obj/item/tool/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20, target = src))
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/part/board/circuit/prison_shuttle/M = new /obj/item/part/board/circuit/prison_shuttle( A )
|
||||
for(var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.anchored = 1
|
||||
|
||||
if(src.stat & BROKEN)
|
||||
to_chat(user, "\blue The broken glass falls out.")
|
||||
new /obj/item/trash/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
to_chat(user, "\blue You disconnect the monitor.")
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
|
||||
del(src)
|
||||
else if(istype(I,/obj/item/card/emag) && (!hacked))
|
||||
hacked = 1
|
||||
to_chat(user, "\blue You disable the lock.")
|
||||
else
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(!src.allowed(user) && (!hacked))
|
||||
to_chat(user, "\red Access Denied.")
|
||||
return
|
||||
if(prison_break)
|
||||
to_chat(user, "\red Unable to locate shuttle.")
|
||||
return
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
post_signal("prison")
|
||||
var/dat
|
||||
if(src.temp)
|
||||
dat = src.temp
|
||||
else
|
||||
dat += {"<b>Location:</b> [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "\n*Shuttle already called*<BR>\n<BR>":prison_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Send to Dock</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Send to Station</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
//user << browse(dat, "window=computer;size=575x450")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", name, 575, 450)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["sendtodock"])
|
||||
if(!prison_can_move())
|
||||
to_chat(usr, "\red The prison shuttle is unable to leave.")
|
||||
return
|
||||
if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
post_signal("prison")
|
||||
to_chat(usr, "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.")
|
||||
src.temp += "Shuttle sent.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
src.updateUsrDialog()
|
||||
prison_shuttle_moving_to_prison = 1
|
||||
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
|
||||
spawn(0)
|
||||
prison_process()
|
||||
|
||||
else if(href_list["sendtostation"])
|
||||
if(!prison_can_move())
|
||||
to_chat(usr, "\red The prison shuttle is unable to leave.")
|
||||
return
|
||||
if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
post_signal("prison")
|
||||
to_chat(usr, "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.")
|
||||
src.temp += "Shuttle sent.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
src.updateUsrDialog()
|
||||
prison_shuttle_moving_to_station = 1
|
||||
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
|
||||
spawn(0)
|
||||
prison_process()
|
||||
|
||||
else if(href_list["mainmenu"])
|
||||
src.temp = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
proc/prison_can_move()
|
||||
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0
|
||||
else return 1
|
||||
|
||||
/*
|
||||
proc/prison_break()
|
||||
switch(prison_break)
|
||||
if(0)
|
||||
if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return
|
||||
|
||||
prison_shuttle_moving_to_prison = 1
|
||||
prison_shuttle_at_station = prison_shuttle_at_station
|
||||
|
||||
if(!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station)
|
||||
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
|
||||
spawn(0)
|
||||
prison_process()
|
||||
prison_break = 1
|
||||
if(1)
|
||||
prison_break = 0
|
||||
*/
|
||||
|
||||
proc/post_signal(var/command)
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1311)
|
||||
if(!frequency) return
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
frequency.post_signal(src, status_signal)
|
||||
return
|
||||
|
||||
|
||||
proc/prison_process()
|
||||
while(prison_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = prison_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
prison_shuttle_time = world.timeofday + 10 // midnight rollover
|
||||
|
||||
prison_shuttle_timeleft = (ticksleft / 10)
|
||||
sleep(5)
|
||||
prison_shuttle_moving_to_station = 0
|
||||
prison_shuttle_moving_to_prison = 0
|
||||
|
||||
switch(prison_shuttle_at_station)
|
||||
|
||||
if(0)
|
||||
prison_shuttle_at_station = 1
|
||||
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
|
||||
if(!prison_can_move())
|
||||
to_chat(usr, "\red The prison shuttle is unable to leave.")
|
||||
return
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/prison/prison)
|
||||
var/area/end_location = locate(/area/shuttle/prison/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)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
start_location.move_contents_to(end_location)
|
||||
|
||||
if(1)
|
||||
prison_shuttle_at_station = 0
|
||||
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
|
||||
|
||||
if(!prison_can_move())
|
||||
to_chat(usr, "\red The prison shuttle is unable to leave.")
|
||||
return
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/prison/station)
|
||||
var/area/end_location = locate(/area/shuttle/prison/prison)
|
||||
|
||||
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)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
start_location.move_contents_to(end_location)
|
||||
return
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
This may not migrate to C3. It's basically a machine in the guise of a computer;
|
||||
there is nothing interactive about it.
|
||||
*/
|
||||
|
||||
/obj/machinery/computer3/shuttle
|
||||
name = "Shuttle"
|
||||
desc = "For shuttle control."
|
||||
icon_state = "shuttle"
|
||||
var/auth_need = 3.0
|
||||
var/list/authorized = list( )
|
||||
|
||||
|
||||
attackby(var/obj/item/card/W as obj, var/mob/user as mob, params)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
|
||||
if(istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda))
|
||||
if(istype(W, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = W
|
||||
W = pda.id
|
||||
if(!W:access) //no access
|
||||
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
|
||||
return
|
||||
|
||||
var/list/cardaccess = W:access
|
||||
if(!istype(cardaccess, /list) || !cardaccess.len) //no access
|
||||
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
|
||||
return
|
||||
|
||||
if(!(access_heads in W:access)) //doesn't have this access
|
||||
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
|
||||
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")
|
||||
if(emergency_shuttle.location != 1 && user.get_active_hand() != W)
|
||||
return 0
|
||||
switch(choice)
|
||||
if("Authorize")
|
||||
src.authorized -= W:registered_name
|
||||
src.authorized += W:registered_name
|
||||
if(src.auth_need - src.authorized.len > 0)
|
||||
message_admins("[key_name_admin(user)] has authorized early shuttle launch")
|
||||
log_game("[user.ckey] has authorized early shuttle launch")
|
||||
to_chat(world, text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len))
|
||||
else
|
||||
message_admins("[key_name_admin(user)] has launched the shuttle")
|
||||
log_game("[user.ckey] has launched the shuttle early")
|
||||
to_chat(world, "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>")
|
||||
emergency_shuttle.online = 1
|
||||
emergency_shuttle.settimeleft(10)
|
||||
//src.authorized = null
|
||||
del(src.authorized)
|
||||
src.authorized = list( )
|
||||
|
||||
if("Repeal")
|
||||
src.authorized -= W:registered_name
|
||||
to_chat(world, text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len))
|
||||
|
||||
if("Abort")
|
||||
to_chat(world, "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>")
|
||||
src.authorized.len = 0
|
||||
src.authorized = list( )
|
||||
return
|
||||
|
||||
emag_act(user as mob)
|
||||
if(!emagged)
|
||||
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
|
||||
|
||||
if(!emagged && emergency_shuttle.location == 1)
|
||||
switch(choice)
|
||||
if("Launch")
|
||||
to_chat(world, "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>")
|
||||
emergency_shuttle.settimeleft( 10 )
|
||||
emagged = 1
|
||||
if("Cancel")
|
||||
return
|
||||
@@ -1,246 +0,0 @@
|
||||
//Config stuff
|
||||
#define SPECOPS_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
|
||||
#define SPECOPS_STATION_AREATYPE "/area/shuttle/specops/station" //Type of the spec ops shuttle area for station
|
||||
#define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock
|
||||
|
||||
var/specops_shuttle_moving_to_station = 0
|
||||
var/specops_shuttle_moving_to_centcom = 0
|
||||
var/specops_shuttle_at_station = 0
|
||||
var/specops_shuttle_can_send = 1
|
||||
var/specops_shuttle_time = 0
|
||||
var/specops_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle
|
||||
name = "Spec. Ops. Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_cent_specops)
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
|
||||
/proc/specops_process()
|
||||
var/area/centcom/control/cent_com = locate()//To find announcer. This area should exist for this proc to work.
|
||||
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
|
||||
var/mob/living/silicon/decoy/announcer = locate() in cent_com//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
var/message = "THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
|
||||
if(announcer)
|
||||
announcer.say(message)
|
||||
message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
|
||||
announcer.say(message)
|
||||
|
||||
while(specops_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = specops_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
specops_shuttle_time = world.timeofday + 10 // midnight rollover
|
||||
specops_shuttle_timeleft = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
if(announcer)
|
||||
var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
|
||||
if(rounded_time_left==0)
|
||||
message = "ALERT: TAKEOFF"
|
||||
announcer.say(message)
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
|
||||
specops_shuttle_moving_to_station = 0
|
||||
specops_shuttle_moving_to_centcom = 0
|
||||
|
||||
specops_shuttle_at_station = 1
|
||||
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if(!specops_can_move())
|
||||
to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
|
||||
return
|
||||
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.open()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.open()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.open()
|
||||
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
P.failchance = 0//So it has no fail chance when teleporting.
|
||||
P.target = pick(spawn_marauder)//Where the marauder will arrive.
|
||||
spawn_marauder.Remove(P.target)
|
||||
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.drive()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.drive()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.drive()
|
||||
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT1")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT2")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT3")
|
||||
spawn(0)
|
||||
M.close()
|
||||
special_ops.readyreset()//Reset firealarm after the team launched.
|
||||
//End Marauder launchpad.
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/specops/centcom)
|
||||
var/area/end_location = locate(/area/shuttle/specops/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)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
start_location.move_contents_to(end_location)
|
||||
|
||||
for(var/turf/T in get_area_turfs(end_location) )
|
||||
var/mob/M = locate(/mob) in T
|
||||
to_chat(M, "\red You have arrived to [station_name]. Commence operation!")
|
||||
|
||||
/proc/specops_can_move()
|
||||
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return 0
|
||||
else return 1
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params)
|
||||
if(istype(I,/obj/item/card/emag))
|
||||
to_chat(user, "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals.")
|
||||
else
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
to_chat(user, "\red Access Denied.")
|
||||
return
|
||||
|
||||
if(sent_strike_team == 0)
|
||||
to_chat(usr, "\red The strike team has not yet deployed.")
|
||||
return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(temp)
|
||||
dat = temp
|
||||
else
|
||||
dat += {"
|
||||
<b>Location:</b> [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "Departing for [station_name] in ([specops_shuttle_timeleft] seconds.)":specops_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.*<BR>\n<BR>":specops_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
//user << browse(dat, "window=computer;size=575x450")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/specops_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["sendtodock"])
|
||||
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
to_chat(usr, "\blue Central Command will not allow the Special Operations shuttle to return.")
|
||||
return
|
||||
|
||||
else if(href_list["sendtostation"])
|
||||
if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if(!specops_can_move())
|
||||
to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
|
||||
return
|
||||
|
||||
to_chat(usr, "\blue The Special Operations shuttle will arrive on [station_name] in [(SPECOPS_MOVETIME/10)] seconds.")
|
||||
|
||||
temp += "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
updateUsrDialog()
|
||||
|
||||
var/area/centcom/specops/special_ops = locate()
|
||||
if(special_ops)
|
||||
special_ops.readyalert()//Trigger alarm for the spec ops area.
|
||||
specops_shuttle_moving_to_station = 1
|
||||
|
||||
specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME
|
||||
spawn(0)
|
||||
specops_process()
|
||||
|
||||
else if(href_list["mainmenu"])
|
||||
temp = null
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -1,103 +0,0 @@
|
||||
#define SYNDICATE_SHUTTLE_MOVE_TIME 240
|
||||
#define SYNDICATE_SHUTTLE_COOLDOWN 200
|
||||
|
||||
/obj/machinery/computer3/syndicate_station
|
||||
name = "syndicate shuttle terminal"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "syndishuttle"
|
||||
req_access = list(access_syndicate)
|
||||
var/area/curr_location
|
||||
var/moving = 0
|
||||
var/lastMove = 0
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/New()
|
||||
curr_location= locate(/area/syndicate_station/start)
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/proc/syndicate_move_to(area/destination as area)
|
||||
if(moving) return
|
||||
if(lastMove + SYNDICATE_SHUTTLE_COOLDOWN > world.time) return
|
||||
var/area/dest_location = locate(destination)
|
||||
if(curr_location == dest_location) return
|
||||
|
||||
moving = 1
|
||||
lastMove = world.time
|
||||
|
||||
if(curr_location.z != dest_location.z)
|
||||
var/area/transit_location = locate(/area/syndicate_station/transit)
|
||||
curr_location.move_contents_to(transit_location)
|
||||
curr_location = transit_location
|
||||
sleep(SYNDICATE_SHUTTLE_MOVE_TIME)
|
||||
|
||||
curr_location.move_contents_to(dest_location)
|
||||
curr_location = dest_location
|
||||
moving = 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attack_ai(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/attack_hand(mob/user as mob)
|
||||
if(!allowed(user))
|
||||
to_chat(user, "\red Access Denied")
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = {"Location: [curr_location]<br>
|
||||
Ready to move[max(lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time, 0) ? " in [max(round((lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time) * 0.1), 0)] seconds" : ": now"]<br>
|
||||
<a href='?src=\ref[src];syndicate=1'>Syndicate Space</a><br>
|
||||
<a href='?src=\ref[src];station_nw=1'>North West of SS13</a> |
|
||||
<a href='?src=\ref[src];station_n=1'>North of SS13</a> |
|
||||
<a href='?src=\ref[src];station_ne=1'>North East of SS13</a><br>
|
||||
<a href='?src=\ref[src];station_sw=1'>South West of SS13</a> |
|
||||
<a href='?src=\ref[src];station_s=1'>South of SS13</a> |
|
||||
<a href='?src=\ref[src];station_se=1'>South East of SS13</a><br>
|
||||
<a href='?src=\ref[src];mining=1'>North East of the Mining Asteroid</a><br>
|
||||
<a href='?src=\ref[user];mach_close=computer'>Close</a>"}
|
||||
|
||||
user << browse(dat, "window=computer;size=575x450")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/Topic(href, href_list)
|
||||
if(!isliving(usr)) return
|
||||
var/mob/living/user = usr
|
||||
|
||||
if(in_range(src, user) || istype(user, /mob/living/silicon))
|
||||
user.set_machine(src)
|
||||
|
||||
if(href_list["syndicate"])
|
||||
syndicate_move_to(/area/syndicate_station/start)
|
||||
else if(href_list["station_nw"])
|
||||
syndicate_move_to(/area/syndicate_station/northwest)
|
||||
else if(href_list["station_n"])
|
||||
syndicate_move_to(/area/syndicate_station/north)
|
||||
else if(href_list["station_ne"])
|
||||
syndicate_move_to(/area/syndicate_station/northeast)
|
||||
else if(href_list["station_sw"])
|
||||
syndicate_move_to(/area/syndicate_station/southwest)
|
||||
else if(href_list["station_s"])
|
||||
syndicate_move_to(/area/syndicate_station/south)
|
||||
else if(href_list["station_se"])
|
||||
syndicate_move_to(/area/syndicate_station/southeast)
|
||||
// else if(href_list["commssat"])
|
||||
// syndicate_move_to(/area/syndicate_station/commssat)
|
||||
else if(href_list["mining"])
|
||||
syndicate_move_to(/area/syndicate_station/mining)
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/syndicate_station/bullet_act(var/obj/item/projectile/Proj)
|
||||
visible_message("[Proj] ricochets off [src]!") //let's not let them fuck themselves in the rear
|
||||
@@ -1,259 +0,0 @@
|
||||
//Config stuff
|
||||
#define SYNDICATE_ELITE_MOVETIME 600 //Time to station is deciseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
|
||||
#define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station
|
||||
#define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock
|
||||
|
||||
var/syndicate_elite_shuttle_moving_to_station = 0
|
||||
var/syndicate_elite_shuttle_moving_to_mothership = 0
|
||||
var/syndicate_elite_shuttle_at_station = 0
|
||||
var/syndicate_elite_shuttle_can_send = 1
|
||||
var/syndicate_elite_shuttle_time = 0
|
||||
var/syndicate_elite_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle
|
||||
name = "Elite Syndicate Squad Shuttle Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "syndishuttle"
|
||||
req_access = list(access_cent_specops)
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
|
||||
/proc/syndicate_elite_process()
|
||||
var/area/syndicate_mothership/control/syndicate_ship = locate()//To find announcer. This area should exist for this proc to work.
|
||||
var/area/syndicate_mothership/elite_squad/elite_squad = locate()//Where is the specops area located?
|
||||
var/mob/living/silicon/decoy/announcer = locate() in syndicate_ship//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
var/message = "THE SYNDICATE ELITE SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
|
||||
if(announcer)
|
||||
announcer.say(message)
|
||||
// message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
|
||||
// announcer.say(message)
|
||||
|
||||
while(syndicate_elite_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = syndicate_elite_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
syndicate_elite_shuttle_time = world.timeofday // midnight rollover
|
||||
syndicate_elite_shuttle_timeleft = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
if(announcer)
|
||||
var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
|
||||
if(rounded_time_left==0)
|
||||
message = "ALERT: TAKEOFF"
|
||||
announcer.say(message)
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
|
||||
syndicate_elite_shuttle_moving_to_station = 0
|
||||
syndicate_elite_shuttle_moving_to_mothership = 0
|
||||
|
||||
syndicate_elite_shuttle_at_station = 1
|
||||
if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
|
||||
|
||||
if(!syndicate_elite_can_move())
|
||||
to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
|
||||
return
|
||||
|
||||
sleep(600)
|
||||
/*
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in elite_squad)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.open()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.open()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.open()
|
||||
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
P.failchance = 0//So it has no fail chance when teleporting.
|
||||
P.target = pick(spawn_marauder)//Where the marauder will arrive.
|
||||
spawn_marauder.Remove(P.target)
|
||||
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in elite_squad)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.drive()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.drive()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.drive()
|
||||
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in elite_squad)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT1")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT2")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT3")
|
||||
spawn(0)
|
||||
M.close()
|
||||
*/
|
||||
elite_squad.readyreset()//Reset firealarm after the team launched.
|
||||
//End Marauder launchpad.
|
||||
/*
|
||||
var/obj/explosionmarker = locate("Syndicate Breach Area")
|
||||
if(explosionmarker)
|
||||
var/turf/simulated/T = explosionmarker.loc
|
||||
if(T)
|
||||
explosion(T,4,6,8,10,0)
|
||||
|
||||
sleep(40)
|
||||
// proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
|
||||
|
||||
*/
|
||||
var/area/start_location = locate(/area/shuttle/syndicate_elite/mothership)
|
||||
var/area/end_location = locate(/area/shuttle/syndicate_elite/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)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
start_location.move_contents_to(end_location)
|
||||
|
||||
for(var/turf/T in get_area_turfs(end_location) )
|
||||
var/mob/M = locate(/mob) in T
|
||||
to_chat(M, "\red You have arrived to [station_name]. Commence operation!")
|
||||
|
||||
/proc/syndicate_elite_can_move()
|
||||
if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0
|
||||
else return 1
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params)
|
||||
if(istype(I,/obj/item/card/emag))
|
||||
to_chat(user, "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals.")
|
||||
else
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
to_chat(user, "\red Access Denied.")
|
||||
return
|
||||
|
||||
// if(sent_syndicate_strike_team == 0)
|
||||
// to_chat(usr, "\red The strike team has not yet deployed.")
|
||||
// return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(temp)
|
||||
dat = temp
|
||||
else
|
||||
dat = {"<b>Location:</b> [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*<BR>\n<BR>":syndicate_elite_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
//user << browse(dat, "window=computer;size=575x450")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/syndicate_elite_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["sendtodock"])
|
||||
if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
|
||||
|
||||
to_chat(usr, "\blue The Syndicate will not allow the Elite Squad shuttle to return.")
|
||||
return
|
||||
|
||||
else if(href_list["sendtostation"])
|
||||
if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
|
||||
|
||||
if(!specops_can_move())
|
||||
to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
|
||||
return
|
||||
|
||||
to_chat(usr, "\blue The Syndicate Elite shuttle will arrive on [station_name] in [(SYNDICATE_ELITE_MOVETIME/10)] seconds.")
|
||||
|
||||
temp = "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
updateUsrDialog()
|
||||
|
||||
var/area/syndicate_mothership/elite_squad/elite_squad = locate()
|
||||
if(elite_squad)
|
||||
elite_squad.readyalert()//Trigger alarm for the spec ops area.
|
||||
syndicate_elite_shuttle_moving_to_station = 1
|
||||
|
||||
syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME
|
||||
spawn(0)
|
||||
syndicate_elite_process()
|
||||
|
||||
|
||||
else if(href_list["mainmenu"])
|
||||
temp = null
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user