CMO Emergency Disk

Mind storage for evacuation.
This commit is contained in:
Arokha Sieyes
2017-02-24 21:09:12 -05:00
parent 9eeb7f2ce1
commit 2068b31fa1
5 changed files with 192 additions and 120 deletions

View File

@@ -16,6 +16,7 @@
var/datum/transhuman/infocore/TC //Easy debugging access
var/organic_capable = 1
var/synthetic_capable = 1
var/obj/item/weapon/disk/transcore/disk
/obj/machinery/computer/transhuman/resleeving/initialize()
..()
@@ -72,6 +73,11 @@
P.connected = src
P.name = "[initial(P.name)] #[pods.len]"
user << "<span class='notice'>You connect [P] to [src].</span>"
else if(istype(W, /obj/item/weapon/disk/transcore))
user.unEquip(W)
disk = W
disk.forceMove(src)
user << "<span class='notice'>You insert \the [W] into \the [src].</span>"
else
..()
return
@@ -179,6 +185,8 @@
data["spodsLen"] = spods.len
data["sleeversLen"] = sleevers.len
data["temp"] = temp
data["coredumped"] = transcore.core_dumped
data["emergency"] = disk ? 1 : 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
@@ -210,6 +218,16 @@
else if (href_list["refresh"])
updateUsrDialog()
else if (href_list["coredump"])
if(disk)
transcore.core_dump(disk)
disk.forceMove(get_turf(src))
disk = null
else if (href_list["ejectdisk"])
disk.forceMove(get_turf(src))
disk = null
else if (href_list["create"])
if(istype(active_br))
//Tried to grow a synth but no synth pods.
@@ -328,3 +346,31 @@
nanomanager.update_uis(src)
add_fingerprint(usr)
// In here because only relevant to computer
/obj/item/weapon/cmo_disk_holder
name = "cmo emergency packet"
desc = "A small paper packet with printing on one side. \"Tear open in case of Code Delta or Emergency Evacuation ONLY. Use in any other case is UNLAWFUL.\""
icon = 'icons/vore/custom_items_vr.dmi'
icon_state = "cmoemergency"
item_state = "card-id"
/obj/item/weapon/cmo_disk_holder/attack_self(var/mob/attacker)
playsound(src, 'sound/items/poster_ripped.ogg', 50)
attacker << "<span class='warning'>You tear open \the [name].</span>"
attacker.unEquip(src)
var/obj/item/weapon/disk/transcore/newdisk = new(get_turf(src))
attacker.put_in_any_hand_if_possible(newdisk)
qdel(src)
/obj/item/weapon/disk/transcore
name = "TransCore Dump Disk"
desc = "It has a small label. \n\
\"1.INSERT DISK INTO RESLEEVING CONSOLE\n\
2. BEGIN CORE DUMP PROCEDURE\n\
3. ENSURE DISK SAFETY WHEN EJECTED\""
icon = 'icons/obj/cloning.dmi'
icon_state = "harddisk"
item_state = "card-id"
w_class = ITEMSIZE_SMALL
var/datum/transhuman/mind_record/list/stored = list()

View File

@@ -12,6 +12,7 @@ var/datum/transhuman/infocore/transcore = new/datum/transhuman/infocore
/datum/transhuman/infocore
var/overdue_time = 15 MINUTES
var/process_time = 1 MINUTE
var/core_dumped = 0
var/datum/transhuman/mind_record/list/backed_up = list()
var/datum/transhuman/mind_record/list/has_left = list()
@@ -21,6 +22,7 @@ var/datum/transhuman/infocore/transcore = new/datum/transhuman/infocore
process()
/datum/transhuman/infocore/proc/process()
if(core_dumped) return
for(var/N in backed_up)
var/datum/transhuman/mind_record/curr_MR = backed_up[N]
if(!curr_MR)
@@ -40,7 +42,7 @@ var/datum/transhuman/infocore/transcore = new/datum/transhuman/infocore
/datum/transhuman/infocore/proc/m_backup(var/datum/mind/mind)
ASSERT(mind)
if(!mind.name) //Name is critical to everything here
if(!mind.name || core_dumped)
return 0
var/datum/transhuman/mind_record/MR
@@ -56,7 +58,7 @@ var/datum/transhuman/infocore/transcore = new/datum/transhuman/infocore
/datum/transhuman/infocore/proc/notify(var/name)
ASSERT(name)
var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset/heads/captain(null)
a.autosay("[name] is past-due for a mind backup. This will be the only notification.", "Backup Monitor", "Medical")
a.autosay("[name] is past-due for a mind backup. This will be the only notification.", "TransCore Oversight", "Medical")
qdel(a)
/datum/transhuman/infocore/proc/add_backup(var/datum/transhuman/mind_record/MR)
@@ -76,6 +78,18 @@ var/datum/transhuman/infocore/transcore = new/datum/transhuman/infocore
body_scans[BR.mydna.name] = BR
log_debug("Added [BR.mydna.name] to transcore body DB.")
/datum/transhuman/infocore/proc/core_dump(var/obj/item/weapon/disk/transcore/disk)
ASSERT(disk)
var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset/heads/captain(null)
a.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Command")
a.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Medical")
qdel(a)
disk.stored += backed_up
backed_up.Cut()
core_dumped = 1
return disk.stored.len
/////// Mind-backup record ///////
/datum/transhuman/mind_record
//User visible

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -3819,7 +3819,7 @@
"bvw" = (/obj/structure/table/reinforced,/turf/simulated/floor/tiled/white,/area/crew_quarters/heads/cmo)
"bvx" = (/obj/structure/table/reinforced,/obj/machinery/computer/skills{pixel_y = 4},/turf/simulated/floor/tiled/white,/area/crew_quarters/heads/cmo)
"bvy" = (/turf/simulated/floor/tiled/white,/area/crew_quarters/heads/cmo)
"bvz" = (/obj/structure/closet/secure_closet/CMO,/obj/effect/floor_decal/corner/paleblue{dir = 6},/obj/item/device/radio/intercom{dir = 4; name = "Station Intercom (General)"; pixel_x = 21},/obj/item/clothing/glasses/sunglasses/omnihud/cmo,/turf/simulated/floor/tiled/white,/area/crew_quarters/heads/cmo)
"bvz" = (/obj/structure/closet/secure_closet/CMO,/obj/effect/floor_decal/corner/paleblue{dir = 6},/obj/item/device/radio/intercom{dir = 4; name = "Station Intercom (General)"; pixel_x = 21},/obj/item/clothing/glasses/sunglasses/omnihud/cmo,/obj/item/weapon/cmo_disk_holder,/turf/simulated/floor/tiled/white,/area/crew_quarters/heads/cmo)
"bvA" = (/obj/structure/table/steel,/obj/item/weapon/autopsy_scanner,/obj/item/weapon/surgical/scalpel,/obj/machinery/light{dir = 1},/obj/item/weapon/surgical/cautery,/obj/effect/floor_decal/corner/paleblue{dir = 5},/turf/simulated/floor/tiled,/area/medical/morgue)
"bvB" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/firedoor/border_only,/turf/simulated/floor/plating,/area/medical/virology)
"bvC" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 4},/obj/machinery/door/firedoor/border_only,/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating,/area/medical/virology)

View File

@@ -1,3 +1,14 @@
{{if data.coredumped}}
<div class='item'>
<span class='bad'>TransCore dump complete. Disk ejected.</span>
</div>
{{else data.emergency}}
<div class='item'>
<span class='bad'>!!WARNING!!<br>Dump Disk Inserted! This will transfer all minds to the dump disk, and the TransCore will be made unusable until post-shift maintenance! This should only be used in emergencies!</span><br>
</div>
{{:helper.link('DUMP CORE', 'radiation', {'coredump' : data.emergency}, null, 'redButton')}}
{{:helper.link('Eject Disk', 'eject', {'ejectdisk' : data.emergency})}}
{{else}}
<b>{{:data.temp}}</b>
<!-- Menu1: Main Menu -->
@@ -124,3 +135,4 @@
<div class='item bad'>ERROR: Record not found.</div>
{{/if}}
{{/if}}
{{/if}}