mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Initial commit of Computer 3 from Paradise, along with a bunch of fixes.
This commit is contained in:
254
code/WorkInProgress/computer3/computers/HolodeckControl.dm
Normal file
254
code/WorkInProgress/computer3/computers/HolodeckControl.dm
Normal file
@@ -0,0 +1,254 @@
|
||||
/obj/machinery/computer3/HolodeckControl
|
||||
default_prog = /datum/file/program/holodeck
|
||||
|
||||
|
||||
// Todo: I personally would like to add a second holodeck in the theater for making appropriate playgrounds.
|
||||
// perhaps a holodeck association keyfile?
|
||||
// One more thing while I'm here
|
||||
// C3 allows multiple computers to run this program, but it was designed on the assumption that only one would, ever
|
||||
// I am not going to add or remove anything right now, I'm just porting it
|
||||
|
||||
|
||||
/datum/file/program/holodeck
|
||||
name = "Holodeck Control Console"
|
||||
desc = "Used to control a nearby holodeck."
|
||||
active_state = "holocontrol"
|
||||
var/area/linkedholodeck = null
|
||||
var/area/target = null
|
||||
var/active = 0
|
||||
var/list/holographic_items = list()
|
||||
var/damaged = 0
|
||||
var/last_change = 0
|
||||
var/emagged = 0
|
||||
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat = "<h3>Current Loaded Programs</h3>"
|
||||
dat += "<A href='?src=\ref[src];emptycourt'>((Empty Court)</font>)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];boxingcourt'>((Boxing Court)</font>)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];basketball'>((Basketball Court)</font>)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];thunderdomecourt'>((Thunderdome Court)</font>)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];beach'>((Beach)</font>)</A><BR>"
|
||||
// dat += "<A href='?src=\ref[src];turnoff'>((Shutdown System)</font>)</A><BR>"
|
||||
|
||||
dat += "<span class='notice'>Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.</span><BR>"
|
||||
|
||||
if(emagged)
|
||||
dat += "<A href='?src=\ref[src];burntest'>(<font color=red>Begin Atmospheric Burn Simulation</font>)</A><BR>"
|
||||
dat += "Ensure the holodeck is empty before testing.<BR>"
|
||||
dat += "<BR>"
|
||||
dat += "<A href='?src=\ref[src];wildlifecarp'>(<font color=red>Begin Wildlife Simulation</font>)</A><BR>"
|
||||
dat += "Ensure the holodeck is empty before testing.<BR>"
|
||||
dat += "<BR>"
|
||||
if(issilicon(usr))
|
||||
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=green>Re-Enable Safety Protocols?</font>)</A><BR>"
|
||||
dat += "Safety Protocols are <font class='bad'>DISABLED</font><BR>"
|
||||
else
|
||||
if(issilicon(usr))
|
||||
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=red>Override Safety Protocols?</font>)</A><BR>"
|
||||
dat += "<BR>"
|
||||
dat += "Safety Protocols are <font class='good'>ENABLED</font><BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("emptycourt" in href_list)
|
||||
target = locate(/area/holodeck/source_emptycourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("boxingcourt" in href_list)
|
||||
target = locate(/area/holodeck/source_boxingcourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("basketball" in href_list)
|
||||
target = locate(/area/holodeck/source_basketball)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("thunderdomecourt" in href_list)
|
||||
target = locate(/area/holodeck/source_thunderdomecourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("beach" in href_list)
|
||||
target = locate(/area/holodeck/source_beach)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("turnoff" in href_list)
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("burntest" in href_list)
|
||||
if(!emagged) return
|
||||
target = locate(/area/holodeck/source_burntest)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("wildlifecarp" in href_list)
|
||||
if(!emagged) return
|
||||
target = locate(/area/holodeck/source_wildlife)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("AIoverride" in href_list)
|
||||
if(!issilicon(usr)) return
|
||||
emagged = !emagged
|
||||
if(emagged)
|
||||
message_admins("[key_name_admin(usr)] overrode the holodeck's safeties")
|
||||
log_game("[key_name(usr)] overrided the holodeck's safeties")
|
||||
else
|
||||
message_admins("[key_name_admin(usr)] restored the holodeck's safeties")
|
||||
log_game("[key_name(usr)] restored the holodeck's safeties")
|
||||
|
||||
interact()
|
||||
return
|
||||
|
||||
Reset()
|
||||
emergencyShutdown()
|
||||
|
||||
process()
|
||||
if(active)
|
||||
if(!checkInteg(linkedholodeck))
|
||||
damaged = 1
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
active = 0
|
||||
for(var/mob/M in range(10,src))
|
||||
M.show_message("The holodeck overloads!")
|
||||
|
||||
|
||||
for(var/turf/T in linkedholodeck)
|
||||
if(prob(30))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
T.ex_act(3)
|
||||
T.hotspot_expose(1000,500,1)
|
||||
|
||||
|
||||
for(var/item in holographic_items)
|
||||
if(!(get_turf(item) in linkedholodeck))
|
||||
derez(item, 0)
|
||||
|
||||
|
||||
|
||||
proc/derez(var/obj/obj , var/silent = 1)
|
||||
holographic_items.Remove(obj)
|
||||
|
||||
if(obj == null)
|
||||
return
|
||||
|
||||
if(isobj(obj))
|
||||
var/mob/M = obj.loc
|
||||
if(ismob(M))
|
||||
M.u_equip(obj)
|
||||
M.update_icons() //so their overlays update
|
||||
|
||||
if(!silent)
|
||||
var/obj/oldobj = obj
|
||||
obj.visible_message("The [oldobj.name] fades away!")
|
||||
del(obj)
|
||||
|
||||
proc/checkInteg(var/area/A)
|
||||
for(var/turf/T in A)
|
||||
if(istype(T, /turf/space))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
proc/togglePower(var/toggleOn = 0)
|
||||
|
||||
if(toggleOn)
|
||||
var/area/targetsource = locate(/area/holodeck/source_emptycourt)
|
||||
holographic_items = targetsource.copy_contents_to(linkedholodeck)
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
if(L.name=="Atmospheric Test Start")
|
||||
spawn(20)
|
||||
var/turf/T = get_turf(L)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
if(T)
|
||||
T.temperature = 5000
|
||||
T.hotspot_expose(50000,50000,1)
|
||||
|
||||
active = 1
|
||||
else
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
|
||||
|
||||
proc/loadProgram(var/area/A)
|
||||
|
||||
if(world.time < (last_change + 25))
|
||||
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve
|
||||
return
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("\b ERROR. Recalibrating projetion apparatus.")
|
||||
last_change = world.time
|
||||
return
|
||||
|
||||
last_change = world.time
|
||||
active = 1
|
||||
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck)
|
||||
del(B)
|
||||
|
||||
for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck)
|
||||
del(C)
|
||||
|
||||
holographic_items = A.copy_contents_to(linkedholodeck , 1)
|
||||
|
||||
if(emagged)
|
||||
for(var/obj/item/weapon/holo/esword/H in linkedholodeck)
|
||||
H.damtype = BRUTE
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
if(L.name=="Atmospheric Test Start")
|
||||
spawn(20)
|
||||
var/turf/T = get_turf(L)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
if(T)
|
||||
T.temperature = 5000
|
||||
T.hotspot_expose(50000,50000,1)
|
||||
if(L.name=="Holocarp Spawn")
|
||||
new /mob/living/simple_animal/hostile/carp(L.loc)
|
||||
|
||||
|
||||
proc/emergencyShutdown()
|
||||
//Get rid of any items
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
//Turn it back to the regular non-holographic room
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
|
||||
47
code/WorkInProgress/computer3/computers/Operating.dm
Normal file
47
code/WorkInProgress/computer3/computers/Operating.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
/obj/machinery/computer3/operating
|
||||
default_prog = /datum/file/program/op_monitor
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/prox)
|
||||
icon_state = "frame-med"
|
||||
|
||||
/datum/file/program/op_monitor
|
||||
name = "operating table monitor"
|
||||
desc = "Monitors patient status during surgery."
|
||||
active_state = "operating"
|
||||
var/mob/living/carbon/human/patient = null
|
||||
var/obj/machinery/optable/table = null
|
||||
|
||||
|
||||
/datum/file/program/op_monitor/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
table = computer.net.connect_to(/obj/machinery/optable,table)
|
||||
|
||||
var/dat = ""
|
||||
if(table)
|
||||
dat += "<B>Patient information:</B><BR>"
|
||||
if(src.table && (src.table.check_victim()))
|
||||
src.patient = src.table.victim
|
||||
dat += {"<B>Patient Status:</B> [patient.stat ? "Non-Responsive" : "Stable"]<BR>
|
||||
<B>Blood Type:</B> [patient.b_type]<BR>
|
||||
<BR>
|
||||
<B>Health:</B> [round(patient.health)]<BR>
|
||||
<B>Brute Damage:</B> [round(patient.getBruteLoss())]<BR>
|
||||
<B>Toxins Damage:</B> [round(patient.getToxLoss())]<BR>
|
||||
<B>Fire Damage:</B> [round(patient.getFireLoss())]<BR>
|
||||
<B>Suffocation Damage:</B> [round(patient.getOxyLoss())]<BR>
|
||||
"}
|
||||
else
|
||||
src.patient = null
|
||||
dat += "<B>No patient detected</B>"
|
||||
else
|
||||
dat += "<B>Operating table not found.</B>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
/datum/file/program/op_monitor/Topic()
|
||||
if(!interactable())
|
||||
return
|
||||
..()
|
||||
117
code/WorkInProgress/computer3/computers/aifixer.dm
Normal file
117
code/WorkInProgress/computer3/computers/aifixer.dm
Normal file
@@ -0,0 +1,117 @@
|
||||
/obj/machinery/computer3/aifixer
|
||||
default_prog = /datum/file/program/aifixer
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/ai_holder)
|
||||
icon_state = "frame-rnd"
|
||||
|
||||
|
||||
/datum/file/program/aifixer
|
||||
name = "AI system integrity restorer"
|
||||
desc = "Repairs and revives artificial intelligence cores."
|
||||
image = 'icons/NTOS/airestore.png'
|
||||
active_state = "ai-fixer-empty"
|
||||
req_access = list(access_captain, access_robotics, access_heads)
|
||||
|
||||
update_icon()
|
||||
if(!computer || !computer.cradle)
|
||||
overlay.icon_state = "ai-fixer-404"
|
||||
return // what
|
||||
|
||||
if(!computer.cradle.occupant)
|
||||
overlay.icon_state = "ai-fixer-empty"
|
||||
else
|
||||
if (computer.cradle.occupant.health >= 0 && computer.cradle.occupant.stat != 2)
|
||||
overlay.icon_state = "ai-fixer-full"
|
||||
else
|
||||
overlay.icon_state = "ai-fixer-404"
|
||||
computer.update_icon()
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.cradle)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
popup.set_content(aifixer_menu())
|
||||
popup.open()
|
||||
return
|
||||
|
||||
proc/aifixer_menu()
|
||||
var/dat = ""
|
||||
if (computer.cradle.occupant)
|
||||
var/laws
|
||||
dat += "<h3>Stored AI: [computer.cradle.occupant.name]</h3>"
|
||||
dat += "<b>System integrity:</b> [(computer.cradle.occupant.health+100)/2]%<br>"
|
||||
|
||||
if (computer.cradle.occupant.laws.zeroth)
|
||||
laws += "<b>0:</b> [computer.cradle.occupant.laws.zeroth]<BR>"
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= computer.cradle.occupant.laws.inherent.len, index++)
|
||||
var/law = computer.cradle.occupant.laws.inherent[index]
|
||||
if (length(law) > 0)
|
||||
laws += "<b>[number]:</b> [law]<BR>"
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= computer.cradle.occupant.laws.supplied.len, index++)
|
||||
var/law = computer.cradle.occupant.laws.supplied[index]
|
||||
if (length(law) > 0)
|
||||
laws += "<b>[number]:</b> [law]<BR>"
|
||||
number++
|
||||
|
||||
dat += "<b>Laws:</b><br>[laws]<br>"
|
||||
|
||||
if (computer.cradle.occupant.stat == 2)
|
||||
dat += "<span class='bad'>AI non-functional</span>"
|
||||
else
|
||||
dat += "<span class='good'>AI functional</span>"
|
||||
if (!computer.cradle.busy)
|
||||
dat += "<br><br>[topic_link(src,"fix","Begin Reconstruction")]"
|
||||
else
|
||||
dat += "<br><br>Reconstruction in process, please wait.<br>"
|
||||
dat += "<br>[topic_link(src,"close","Close")]"
|
||||
return dat
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.cradle || ..(href,href_list))
|
||||
return
|
||||
|
||||
if ("fix" in href_list)
|
||||
var/mob/living/silicon/ai/occupant = computer.cradle.occupant
|
||||
if(!occupant) return
|
||||
|
||||
computer.cradle.busy = 1
|
||||
computer.overlays += image('icons/obj/computer.dmi', "ai-fixer-on")
|
||||
|
||||
var/i = 0
|
||||
while (occupant.health < 100)
|
||||
if(!computer || (computer.stat&~MAINT)) // takes some time, keep checking
|
||||
break
|
||||
|
||||
occupant.adjustOxyLoss(-1)
|
||||
occupant.adjustFireLoss(-1)
|
||||
occupant.adjustToxLoss(-1)
|
||||
occupant.adjustBruteLoss(-1)
|
||||
occupant.updatehealth()
|
||||
if (occupant.health >= 0 && computer.cradle.occupant.stat == 2)
|
||||
occupant.stat = 0
|
||||
occupant.lying = 0
|
||||
dead_mob_list -= occupant
|
||||
living_mob_list += occupant
|
||||
update_icon()
|
||||
|
||||
i++
|
||||
if(i == 5)
|
||||
computer.use_power(50) // repairing an AI is nontrivial. laptop battery may not be enough.
|
||||
computer.power_change() // if the power runs out, set stat
|
||||
i = 0
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
sleep(10)
|
||||
computer.cradle.busy = 0
|
||||
computer.overlays -= image('icons/obj/computer.dmi', "ai-fixer-on")
|
||||
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
180
code/WorkInProgress/computer3/computers/arcade.dm
Normal file
180
code/WorkInProgress/computer3/computers/arcade.dm
Normal file
@@ -0,0 +1,180 @@
|
||||
/obj/machinery/computer3/arcade
|
||||
default_prog = /datum/file/program/arcade
|
||||
spawn_parts = list(/obj/item/part/computer/toybox) //NO HDD - the game is loaded on the circuitboard's OS slot
|
||||
|
||||
/obj/item/part/computer/toybox
|
||||
var/list/prizes = list( /obj/item/weapon/storage/box/snappops = 2,
|
||||
/obj/item/toy/blink = 2,
|
||||
/obj/item/clothing/under/syndicate/tacticool = 2,
|
||||
/obj/item/toy/sword = 2,
|
||||
/obj/item/toy/gun = 2,
|
||||
/obj/item/toy/crossbow = 2,
|
||||
/obj/item/clothing/suit/syndicatefake = 2,
|
||||
/obj/item/weapon/storage/fancy/crayons = 2,
|
||||
/obj/item/toy/spinningtoy = 2,
|
||||
/obj/item/toy/prize/ripley = 1,
|
||||
/obj/item/toy/prize/fireripley = 1,
|
||||
/obj/item/toy/prize/deathripley = 1,
|
||||
/obj/item/toy/prize/gygax = 1,
|
||||
/obj/item/toy/prize/durand = 1,
|
||||
/obj/item/toy/prize/honk = 1,
|
||||
/obj/item/toy/prize/marauder = 1,
|
||||
/obj/item/toy/prize/seraph = 1,
|
||||
/obj/item/toy/prize/mauler = 1,
|
||||
/obj/item/toy/prize/odysseus = 1,
|
||||
/obj/item/toy/prize/phazon = 1
|
||||
)
|
||||
proc/dispense()
|
||||
if(computer && !computer.stat)
|
||||
var/prizeselect = pickweight(prizes)
|
||||
new prizeselect(computer.loc)
|
||||
if(istype(prizeselect, /obj/item/toy/gun)) //Ammo comes with the gun
|
||||
new /obj/item/toy/ammo/gun(computer.loc)
|
||||
else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit
|
||||
new /obj/item/clothing/head/syndicatefake(computer.loc)
|
||||
feedback_inc("arcade_win_normal")
|
||||
computer.use_power(500)
|
||||
|
||||
|
||||
/datum/file/program/arcade
|
||||
desc = "The best arcade game ever produced by Nanotrasen's short-lived entertainment divison."
|
||||
//headcanon: they also ported E.T. for the atari 2600, superman 64, and basically every other movie tie-in game ever
|
||||
|
||||
active_state = "generic"
|
||||
|
||||
var/turtle = 0
|
||||
var/enemy_name = "Space Villian"
|
||||
var/temp = "Winners Don't Use Spacedrugs" //Temporary message, for attack messages, etc
|
||||
var/player_hp = 30 //Player health/attack points
|
||||
var/player_mp = 10
|
||||
var/enemy_hp = 45 //Enemy health/attack points
|
||||
var/enemy_mp = 20
|
||||
var/gameover = 0
|
||||
var/blocked = 0 //Player cannot attack/heal while set
|
||||
|
||||
/datum/file/program/arcade/New()
|
||||
..()
|
||||
var/name_action
|
||||
var/name_part1
|
||||
var/name_part2
|
||||
|
||||
name_action = pick("Defeat ", "Annihilate ", "Save ", "Strike ", "Stop ", "Destroy ", "Robust ", "Romance ", "Pwn ", "Own ", "ERP ")
|
||||
|
||||
name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Great ", "Duke ", "General ")
|
||||
name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn")
|
||||
|
||||
enemy_name = replacetext(name_part1, "the ", "") + name_part2
|
||||
name = (name_action + name_part1 + name_part2)
|
||||
|
||||
|
||||
/datum/file/program/arcade/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat// = topic_link(src,"close","Close")
|
||||
dat = "<center><h4>[enemy_name]</h4></center>"
|
||||
|
||||
dat += "<br><center><h3>[temp]</h3></center>"
|
||||
dat += "<br><center>Health: [player_hp] | Magic: [player_mp] | Enemy Health: [enemy_hp]</center>"
|
||||
|
||||
if (gameover)
|
||||
dat += "<center><b>[topic_link(src,"newgame","New Game")]"
|
||||
else
|
||||
dat += "<center><b>[topic_link(src,"attack","Attack")] | [topic_link(src,"heal","Heal")] | [topic_link(src,"charge","Recharge Power")]"
|
||||
|
||||
dat += "</b></center>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/datum/file/program/arcade/Topic(href, list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
if (!blocked && !gameover)
|
||||
if ("attack" in href_list)
|
||||
blocked = 1
|
||||
var/attackamt = rand(2,6)
|
||||
temp = "You attack for [attackamt] damage!"
|
||||
computer.updateUsrDialog()
|
||||
if(turtle > 0)
|
||||
turtle--
|
||||
|
||||
sleep(10)
|
||||
enemy_hp -= attackamt
|
||||
arcade_action()
|
||||
|
||||
else if ("heal" in href_list)
|
||||
blocked = 1
|
||||
var/pointamt = rand(1,3)
|
||||
var/healamt = rand(6,8)
|
||||
temp = "You use [pointamt] magic to heal for [healamt] damage!"
|
||||
computer.updateUsrDialog()
|
||||
turtle++
|
||||
|
||||
sleep(10)
|
||||
player_mp -= pointamt
|
||||
player_hp += healamt
|
||||
blocked = 1
|
||||
computer.updateUsrDialog()
|
||||
arcade_action()
|
||||
|
||||
else if ("charge" in href_list)
|
||||
blocked = 1
|
||||
var/chargeamt = rand(4,7)
|
||||
temp = "You regain [chargeamt] points"
|
||||
player_mp += chargeamt
|
||||
if(turtle > 0)
|
||||
turtle--
|
||||
|
||||
computer.updateUsrDialog()
|
||||
sleep(10)
|
||||
arcade_action()
|
||||
|
||||
if ("newgame" in href_list) //Reset everything
|
||||
temp = "New Round"
|
||||
player_hp = 30
|
||||
player_mp = 10
|
||||
enemy_hp = 45
|
||||
enemy_mp = 20
|
||||
gameover = 0
|
||||
turtle = 0
|
||||
computer.updateUsrDialog()
|
||||
|
||||
|
||||
/datum/file/program/arcade/proc/arcade_action()
|
||||
if ((enemy_mp <= 0) || (enemy_hp <= 0))
|
||||
if(!gameover)
|
||||
gameover = 1
|
||||
temp = "[enemy_name] has fallen! Rejoice!"
|
||||
if(computer.toybox)
|
||||
computer.toybox.dispense()
|
||||
|
||||
else if ((enemy_mp <= 5) && (prob(70)))
|
||||
var/stealamt = rand(2,3)
|
||||
temp = "[enemy_name] steals [stealamt] of your power!"
|
||||
player_mp -= stealamt
|
||||
|
||||
if (player_mp <= 0)
|
||||
gameover = 1
|
||||
sleep(10)
|
||||
temp = "You have been drained! GAME OVER"
|
||||
feedback_inc("arcade_loss_mana_normal")
|
||||
|
||||
else if ((enemy_hp <= 10) && (enemy_mp > 4))
|
||||
temp = "[enemy_name] heals for 4 health!"
|
||||
enemy_hp += 4
|
||||
enemy_mp -= 4
|
||||
|
||||
else
|
||||
var/attackamt = rand(3,6)
|
||||
temp = "[enemy_name] attacks for [attackamt] damage!"
|
||||
player_hp -= attackamt
|
||||
|
||||
if ((player_mp <= 0) || (player_hp <= 0))
|
||||
gameover = 1
|
||||
temp = "You have been crushed! GAME OVER"
|
||||
feedback_inc("arcade_loss_hp_normal")
|
||||
|
||||
if(interactable())
|
||||
computer.updateUsrDialog()
|
||||
blocked = 0
|
||||
return
|
||||
110
code/WorkInProgress/computer3/computers/atmos_alert.dm
Normal file
110
code/WorkInProgress/computer3/computers/atmos_alert.dm
Normal file
@@ -0,0 +1,110 @@
|
||||
/obj/machinery/computer3/atmos_alert
|
||||
default_prog = /datum/file/program/atmos_alert
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio)
|
||||
icon_state = "frame-eng"
|
||||
|
||||
/datum/file/program/atmos_alert
|
||||
name = "atmospheric alert monitor"
|
||||
desc = "Recieves alerts over the radio."
|
||||
active_state = "alert:2"
|
||||
refresh = 1
|
||||
var/list/priority_alarms = list()
|
||||
var/list/minor_alarms = list()
|
||||
|
||||
|
||||
execute(var/datum/file/program/source)
|
||||
..(source)
|
||||
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
|
||||
computer.radio.set_frequency(1437,RADIO_ATMOSIA)
|
||||
|
||||
|
||||
Reset()
|
||||
..()
|
||||
// Never save your work
|
||||
priority_alarms.Cut()
|
||||
minor_alarms.Cut()
|
||||
|
||||
|
||||
// This will be called as long as the program is running on the parent computer
|
||||
// and the computer has the radio peripheral
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
if(!zone || !severity) return
|
||||
|
||||
minor_alarms -= zone
|
||||
priority_alarms -= zone
|
||||
if(severity=="severe")
|
||||
priority_alarms += zone
|
||||
else if (severity=="minor")
|
||||
minor_alarms += zone
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
|
||||
popup.set_content(return_text())
|
||||
popup.open()
|
||||
|
||||
|
||||
update_icon()
|
||||
..()
|
||||
if(priority_alarms.len > 0)
|
||||
overlay.icon_state = "alert:2"
|
||||
else if(minor_alarms.len > 0)
|
||||
overlay.icon_state = "alert:1"
|
||||
else
|
||||
overlay.icon_state = "alert:0"
|
||||
|
||||
if(computer)
|
||||
computer.update_icon()
|
||||
|
||||
|
||||
proc/return_text()
|
||||
var/priority_text = "<h2>Priority Alerts:</h2>"
|
||||
var/minor_text = "<h2>Minor Alerts:</h2>"
|
||||
|
||||
if(priority_alarms.len)
|
||||
for(var/zone in priority_alarms)
|
||||
priority_text += "<FONT color='red'><B>[format_text(zone)]</B></FONT> [topic_link(src,"priority_clear=[ckey(zone)]","X")]<BR>"
|
||||
else
|
||||
priority_text += "No priority alerts detected.<BR>"
|
||||
|
||||
if(minor_alarms.len)
|
||||
for(var/zone in minor_alarms)
|
||||
minor_text += "<B>[format_text(zone)]</B> [topic_link(src,"minor_clear=[ckey(zone)]","X")]<BR>"
|
||||
else
|
||||
minor_text += "No minor alerts detected.<BR>"
|
||||
|
||||
return "[priority_text]<BR><HR>[minor_text]<BR>[topic_link(src,"close","Close")]"
|
||||
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("priority_clear" in href_list)
|
||||
var/removing_zone = href_list["priority_clear"]
|
||||
for(var/zone in priority_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
usr << "\green Priority Alert for area [zone] cleared."
|
||||
priority_alarms -= zone
|
||||
|
||||
if("minor_clear" in href_list)
|
||||
var/removing_zone = href_list["minor_clear"]
|
||||
for(var/zone in minor_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
usr << "\green Minor Alert for area [zone] cleared."
|
||||
minor_alarms -= zone
|
||||
|
||||
computer.updateUsrDialog()
|
||||
277
code/WorkInProgress/computer3/computers/camera.dm
Normal file
277
code/WorkInProgress/computer3/computers/camera.dm
Normal file
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
Camera monitoring computers
|
||||
|
||||
NOTE: If we actually split the station camera network into regions that will help with sorting through the
|
||||
tediously large list of cameras. The new camnet_key architecture lets you switch between keys easily,
|
||||
so you don't lose the capability of seeing everything, you just switch to a subnet.
|
||||
*/
|
||||
|
||||
/obj/machinery/computer3/security
|
||||
default_prog = /datum/file/program/security
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/cameras)
|
||||
spawn_files = list(/datum/file/camnet_key)
|
||||
icon_state = "frame-sec"
|
||||
|
||||
|
||||
/obj/machinery/computer3/security/wooden_tv
|
||||
name = "security cameras"
|
||||
desc = "An old TV hooked into the stations camera network."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "security_det"
|
||||
|
||||
legacy_icon = 1
|
||||
allow_disassemble = 0
|
||||
|
||||
// No operating system
|
||||
New()
|
||||
..(built=0)
|
||||
os = program
|
||||
circuit.OS = os
|
||||
|
||||
|
||||
/obj/machinery/computer3/security/mining
|
||||
name = "Outpost Cameras"
|
||||
desc = "Used to access the various cameras on the outpost."
|
||||
spawn_files = list(/datum/file/camnet_key/mining)
|
||||
|
||||
/*
|
||||
Camera monitoring computers, wall-mounted
|
||||
*/
|
||||
/obj/machinery/computer3/wall_comp/telescreen
|
||||
default_prog = /datum/file/program/security
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/cameras)
|
||||
spawn_files = list(/datum/file/camnet_key)
|
||||
|
||||
/obj/machinery/computer3/wall_comp/telescreen/entertainment
|
||||
desc = "Damn, they better have /tg/thechannel on these things."
|
||||
spawn_files = list(/datum/file/camnet_key/entertainment)
|
||||
|
||||
|
||||
/*
|
||||
File containing an encrypted camera network key.
|
||||
|
||||
(Where by encrypted I don't actually mean encrypted at all)
|
||||
*/
|
||||
/datum/file/camnet_key
|
||||
name = "Security Camera Network Main Key"
|
||||
var/title = "Station"
|
||||
var/desc = "Connects to station security cameras."
|
||||
var/list/networks = list("SS13")
|
||||
var/screen = "cameras"
|
||||
|
||||
execute(var/datum/file/source)
|
||||
if(istype(source,/datum/file/program/security))
|
||||
var/datum/file/program/security/prog = source
|
||||
prog.key = src
|
||||
prog.camera_list = null
|
||||
return
|
||||
if(istype(source,/datum/file/program/NTOS))
|
||||
for(var/obj/item/part/computer/storage/S in list(computer.hdd,computer.floppy))
|
||||
for(var/datum/file/F in S.files)
|
||||
if(istype(F,/datum/file/program/security))
|
||||
var/datum/file/program/security/Sec = F
|
||||
Sec.key = src
|
||||
Sec.camera_list = null
|
||||
Sec.execute(source)
|
||||
return
|
||||
computer.Crash(MISSING_PROGRAM)
|
||||
|
||||
/datum/file/camnet_key/mining
|
||||
name = "Mining Camera Network Key"
|
||||
title = "mining station"
|
||||
desc = "Connects to mining security cameras."
|
||||
networks = list("MINE")
|
||||
screen = "miningcameras"
|
||||
|
||||
/datum/file/camnet_key/research
|
||||
name = "Research Camera Network Key"
|
||||
title = "research"
|
||||
networks = list("RD")
|
||||
|
||||
/datum/file/camnet_key/bombrange
|
||||
name = "R&D Bomb Range Camera Network Key"
|
||||
title = "bomb range"
|
||||
desc = "Monitors the bomb range."
|
||||
networks = list("Toxins")
|
||||
|
||||
/datum/file/camnet_key/xeno
|
||||
name = "R&D Misc. Research Camera Network Key"
|
||||
title = "special research"
|
||||
networks = list("Misc")
|
||||
|
||||
/datum/file/camnet_key/singulo
|
||||
name = "Singularity Camera Network Key"
|
||||
title = "singularity"
|
||||
networks = list("Singularity")
|
||||
|
||||
/datum/file/camnet_key/entertainment
|
||||
name = "Entertainment Channel Encryption Key"
|
||||
title = "entertainment"
|
||||
desc = "Damn, I hope they have /tg/thechannel on here."
|
||||
networks = list("thunder")
|
||||
screen = "entertainment"
|
||||
|
||||
/datum/file/camnet_key/creed
|
||||
name = "Special Ops Camera Encryption Key"
|
||||
title = "special ops"
|
||||
desc = "Connects to special ops secure camera feeds."
|
||||
networks = list("CREED")
|
||||
|
||||
/datum/file/camnet_key/prison
|
||||
name = "Prison Camera Network Key"
|
||||
title = "prison"
|
||||
desc = "Monitors the prison."
|
||||
networks = list("Prison")
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Computer part needed to connect to cameras
|
||||
*/
|
||||
|
||||
/obj/item/part/computer/networking/cameras
|
||||
name = "camera network access module"
|
||||
desc = "Connects a computer to the camera network."
|
||||
|
||||
// I have no idea what the following does
|
||||
var/mapping = 0//For the overview file, interesting bit of code.
|
||||
|
||||
//proc/camera_list(var/datum/file/camnet_key/key)
|
||||
get_machines(var/datum/file/camnet_key/key)
|
||||
if (!computer || computer.z > 6)
|
||||
return null
|
||||
|
||||
var/list/L = list()
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
var/list/temp = C.network & key.networks
|
||||
if(temp.len)
|
||||
L.Add(C)
|
||||
|
||||
//camera_sort(L)
|
||||
|
||||
return L
|
||||
verify_machine(var/obj/machinery/camera/C,var/datum/file/camnet_key/key = null)
|
||||
if(!istype(C) || !C.can_use())
|
||||
return 0
|
||||
|
||||
if(key)
|
||||
var/list/temp = C.network & key.networks
|
||||
if(!temp.len)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/*
|
||||
Camera monitoring program
|
||||
|
||||
The following things should break you out of the camera view:
|
||||
* The computer resetting, being damaged, losing power, etc
|
||||
* The program quitting
|
||||
* Closing the window
|
||||
* Going out of range of the computer
|
||||
* Becoming incapacitated
|
||||
* The camera breaking, emping, disconnecting, etc
|
||||
*/
|
||||
|
||||
/datum/file/program/security
|
||||
name = "camera monitor"
|
||||
desc = "Connets to the Nanotrasen Camera Network"
|
||||
image = 'icons/NTOS/camera.png'
|
||||
active_state = "camera-static"
|
||||
|
||||
var/datum/file/camnet_key/key = null
|
||||
var/last_pic = 1.0
|
||||
var/last_camera_refresh = 0
|
||||
var/camera_list = null
|
||||
|
||||
var/obj/machinery/camera/current = null
|
||||
|
||||
execute(var/datum/file/program/caller)
|
||||
..(caller)
|
||||
if(computer && !key)
|
||||
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
|
||||
if(fkeys && fkeys.len)
|
||||
key = fkeys[1]
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
for(var/mob/living/L in viewers(1))
|
||||
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
|
||||
L.reset_view(null)
|
||||
|
||||
|
||||
Reset()
|
||||
..()
|
||||
current = null
|
||||
for(var/mob/living/L in viewers(1))
|
||||
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
|
||||
L.reset_view(null)
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.camnet)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
if(!key)
|
||||
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
|
||||
if(fkeys && fkeys.len)
|
||||
key = fkeys[1]
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
if(!key)
|
||||
return
|
||||
|
||||
if(computer.camnet.verify_machine(current))
|
||||
usr.reset_view(current)
|
||||
|
||||
if(world.time - last_camera_refresh > 50 || !camera_list)
|
||||
last_camera_refresh = world.time
|
||||
|
||||
var/list/temp_list = computer.camnet.get_machines(key)
|
||||
|
||||
camera_list = "Network Key: [key.title] [topic_link(src,"keyselect","\[ Select key \]")]<hr>"
|
||||
for(var/obj/machinery/camera/C in temp_list)
|
||||
if(C.status)
|
||||
camera_list += "[C.c_tag] - [topic_link(src,"show=\ref[C]","Show")]<br>"
|
||||
else
|
||||
camera_list += "[C.c_tag] - <b>DEACTIVATED</b><br>"
|
||||
//camera_list += "<br>" + topic_link(src,"close","Close")
|
||||
|
||||
popup.set_content(camera_list)
|
||||
popup.open()
|
||||
|
||||
|
||||
update_icon()
|
||||
if(key)
|
||||
overlay.icon_state = key.screen
|
||||
name = key.title + " Camera Monitor"
|
||||
else
|
||||
overlay.icon_state = "camera-static"
|
||||
name = initial(name)
|
||||
|
||||
|
||||
|
||||
Topic(var/href,var/list/href_list)
|
||||
if(!interactable() || !computer.camnet || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("show" in href_list)
|
||||
var/obj/machinery/camera/C = locate(href_list["show"])
|
||||
current = C
|
||||
usr.reset_view(C)
|
||||
interact()
|
||||
return
|
||||
|
||||
if("keyselect" in href_list)
|
||||
current = null
|
||||
usr.reset_view(null)
|
||||
key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key)
|
||||
camera_list = null
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
if(key)
|
||||
interact()
|
||||
else
|
||||
usr << "The screen turns to static."
|
||||
return
|
||||
289
code/WorkInProgress/computer3/computers/card.dm
Normal file
289
code/WorkInProgress/computer3/computers/card.dm
Normal file
@@ -0,0 +1,289 @@
|
||||
/obj/machinery/computer3/card
|
||||
default_prog = /datum/file/program/card_comp
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/cardslot/dual)
|
||||
/obj/machinery/computer3/card/hop
|
||||
default_prog = /datum/file/program/card_comp
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/cardslot/dual)
|
||||
spawn_files = list(/datum/file/program/arcade, /datum/file/program/security, /datum/file/camnet_key/mining, /datum/file/camnet_key/entertainment,/datum/file/camnet_key/prison)
|
||||
|
||||
|
||||
/obj/machinery/computer3/card/centcom
|
||||
default_prog = /datum/file/program/card_comp/centcom
|
||||
|
||||
/datum/file/program/card_comp
|
||||
name = "identification card console"
|
||||
desc = "Used to modify magnetic strip ID cards."
|
||||
image = 'icons/NTOS/cardcomp.png'
|
||||
active_state = "id"
|
||||
|
||||
var/obj/item/weapon/card/id/reader = null
|
||||
var/obj/item/weapon/card/id/writer = null
|
||||
|
||||
var/mode = 0
|
||||
var/auth = 0
|
||||
var/printing = 0
|
||||
|
||||
proc/list_jobs()
|
||||
return get_all_jobs() + "Custom"
|
||||
|
||||
// creates the block with the script in it
|
||||
// cache the result since it's almost constant but not quite
|
||||
// the list of jobs won't change after all...
|
||||
proc/scriptblock()
|
||||
var/global/dat = null
|
||||
if(!dat)
|
||||
var/jobs_all = ""
|
||||
for(var/job in list_jobs())
|
||||
jobs_all += topic_link(src,"assign=[job]",replacetext(job," "," ")) + " "//make sure there isn't a line break in the middle of a job
|
||||
dat = {"<script type="text/javascript">
|
||||
function markRed(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function markGreen(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function showAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>[jobs_all]";
|
||||
}
|
||||
function hideAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>change</a>";
|
||||
}
|
||||
</script>"}
|
||||
return dat
|
||||
|
||||
// creates the list of access rights on the card
|
||||
proc/accessblock()
|
||||
var/accesses = "<div align='center'><b>Access</b></div>"
|
||||
accesses += "<table style='width:100%'>"
|
||||
accesses += "<tr>"
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
accesses += "<td style='width:14%'><b>[get_region_accesses_name(i)]:</b></td>"
|
||||
accesses += "</tr><tr>"
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
accesses += "<td style='width:14%' valign='top'>"
|
||||
for(var/A in get_region_accesses(i))
|
||||
if(A in writer.access)
|
||||
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_access_desc(A), " ", " ")]</font>") + " "
|
||||
else
|
||||
accesses += topic_link(src,"access=[A]",replacetext(get_access_desc(A), " ", " ")) + " "
|
||||
accesses += "<br>"
|
||||
accesses += "</td>"
|
||||
accesses += "</tr></table>"
|
||||
return accesses
|
||||
|
||||
proc/card_modify_menu()
|
||||
//assume peripherals and cards, do checks for them in interact
|
||||
|
||||
// Header
|
||||
var/dat = "<div align='center'><br>"
|
||||
dat += topic_link(src,"remove=writer","Remove [writer.name]") + " || "
|
||||
dat += topic_link(src,"remove=reader","Remove [reader.name]") + " <br> "
|
||||
dat += topic_link(src,"mode=1","Access Crew Manifest") + " || "
|
||||
dat += topic_link(src,"logout","Log Out") + "</div>"
|
||||
dat += "<hr>" + scriptblock()
|
||||
|
||||
// form for renaming the ID
|
||||
dat += "<form name='cardcomp' action='byond://' method='get'>"
|
||||
dat += "<input type='hidden' name='src' value='\ref[src]'>"
|
||||
dat += "<b>registered_name:</b> <input type='text' id='namefield' name='reg' value='[writer.registered_name]' style='width:250px; background-color:white;' onchange='markRed()'>"
|
||||
dat += "<input type='submit' value='Rename' onclick='markGreen()'>"
|
||||
dat += "</form>"
|
||||
|
||||
// form for changing assignment, taken care of by scriptblock() mostly
|
||||
var/assign_temp = writer.assignment
|
||||
if(!assign_temp || assign_temp == "") assign_temp = "Unassigned"
|
||||
dat += "<b>Assignment:</b> [assign_temp] <span id='alljobsslot'><a href='#' onclick='showAll()'>change</a></span>"
|
||||
|
||||
// list of access rights
|
||||
dat += accessblock()
|
||||
|
||||
return dat
|
||||
|
||||
proc/login_menu()
|
||||
//assume peripherals and cards, do checks for them in interact
|
||||
var/dat = "<br><i>Please insert the cards into the slots</i><br>"
|
||||
|
||||
if(istype(writer))
|
||||
dat += "Target: [topic_link(src,"remove=writer",writer.name)]<br>"
|
||||
else
|
||||
dat += "Target: [topic_link(src,"insert=writer","--------")]<br>"
|
||||
|
||||
if(istype(reader))
|
||||
dat += "Confirm Identity: [topic_link(src,"remove=reader",reader.name)]<br>"
|
||||
else
|
||||
dat += "Confirm Identity: [topic_link(src,"insert=reader","--------")]<br>"
|
||||
dat += "[topic_link(src,"auth","{Log in}")]<br><hr>"
|
||||
dat += topic_link(src,"mode=1","Access Crew Manifest")
|
||||
return dat
|
||||
|
||||
proc/show_manifest()
|
||||
// assume linked_db since called by interact()
|
||||
var/crew = ""
|
||||
var/list/L = list()
|
||||
for (var/datum/data/record/t in data_core.general)
|
||||
var/R = t.fields["name"] + " - " + t.fields["rank"]
|
||||
L += R
|
||||
for(var/R in sortList(L))
|
||||
crew += "[R]<br>"
|
||||
return "<tt><b>Crew Manifest:</b><br>Please use security record computer to modify entries.<br><br>[crew][topic_link(src,"print","Print")]<br><br>[topic_link(src,"mode=0","Access ID modification console.")]<br></tt>"
|
||||
|
||||
// These are here partly in order to be overwritten by the centcom card computer code
|
||||
proc/authenticate()
|
||||
if(access_change_ids in reader.access)
|
||||
return 1
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/set_default_access(var/jobname)
|
||||
var/datum/job/jobdatum
|
||||
for(var/jobtype in typesof(/datum/job))
|
||||
var/datum/job/J = new jobtype
|
||||
if(ckey(J.title) == ckey(jobname))
|
||||
jobdatum = J
|
||||
break
|
||||
if(jobdatum)
|
||||
writer.access = jobdatum.get_access() // ( istype(src,/obj/machinery/computer/card/centcom) ? get_centcom_access(t1)
|
||||
|
||||
|
||||
interact()
|
||||
if(!interactable()) return
|
||||
|
||||
if(!computer.cardslot || !computer.cardslot.dualslot)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
reader = computer.cardslot.reader
|
||||
writer = computer.cardslot.writer
|
||||
|
||||
var/dat
|
||||
|
||||
switch(mode)
|
||||
if(0)
|
||||
if( !istype(writer) || !istype(reader) )
|
||||
auth = 0
|
||||
if( !auth )
|
||||
dat = login_menu()
|
||||
else
|
||||
dat = card_modify_menu()
|
||||
if(1)
|
||||
dat = show_manifest()
|
||||
|
||||
|
||||
popup = new(usr, "ID Computer", name, 940, 520)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, list/href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
// todo distance/disability checks
|
||||
|
||||
if("mode" in href_list)
|
||||
mode = text2num(href_list["mode"])
|
||||
if(mode != 0 && mode != 1)
|
||||
mode = 0
|
||||
|
||||
auth = 0 // always log out if switching modes just in case
|
||||
|
||||
if("remove" in href_list)
|
||||
var/which = href_list["remove"]
|
||||
if(which == "writer")
|
||||
computer.cardslot.remove(computer.cardslot.writer)
|
||||
else
|
||||
computer.cardslot.remove(computer.cardslot.reader)
|
||||
auth = 0
|
||||
|
||||
if("insert" in href_list)
|
||||
var/obj/item/weapon/card/card = usr.get_active_hand()
|
||||
if(!istype(card)) return
|
||||
|
||||
var/which = href_list["insert"]
|
||||
if(which == "writer")
|
||||
computer.cardslot.insert(card,1)
|
||||
else
|
||||
computer.cardslot.insert(card,2)
|
||||
|
||||
if("print" in href_list)
|
||||
if (printing)
|
||||
return
|
||||
|
||||
printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<B>Crew Manifest:</B><BR>"
|
||||
var/list/L = list()
|
||||
for (var/datum/data/record/t in data_core.general)
|
||||
var/R = t.fields["name"] + " - " + t.fields["rank"]
|
||||
L += R
|
||||
for(var/R in sortList(L))
|
||||
P.info += "[R]<br>"
|
||||
P.name = "paper- 'Crew Manifest'"
|
||||
printing = 0
|
||||
|
||||
if("auth" in href_list)
|
||||
auth = 0
|
||||
if(istype(reader) && istype(writer) && authenticate())
|
||||
auth = 1
|
||||
|
||||
if("logout" in href_list)
|
||||
auth = 0
|
||||
|
||||
// Actual ID changing
|
||||
|
||||
if("access" in href_list)
|
||||
if(auth)
|
||||
var/access_type = text2num(href_list["access"])
|
||||
writer.access ^= list(access_type) //logical xor: remove if present, add if not
|
||||
|
||||
if("assign" in href_list)
|
||||
if(auth)
|
||||
var/t1 = href_list["assign"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN)
|
||||
if(temp_t)
|
||||
t1 = temp_t
|
||||
set_default_access(t1)
|
||||
|
||||
writer.assignment = t1
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
|
||||
if("reg" in href_list)
|
||||
if(auth)
|
||||
writer.registered_name = href_list["reg"]
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/file/program/card_comp/centcom
|
||||
name = "CentCom identification console"
|
||||
drm = 1
|
||||
|
||||
list_jobs()
|
||||
return get_all_centcom_jobs() + "Custom"
|
||||
|
||||
accessblock()
|
||||
var/accesses = "<h5>Central Command:</h5>"
|
||||
for(var/A in get_all_centcom_access())
|
||||
if(A in writer.access)
|
||||
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_centcom_access_desc(A), " ", " ")]</font>") + " "
|
||||
else
|
||||
accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", " ")) + " "
|
||||
return accesses
|
||||
|
||||
authenticate()
|
||||
if(access_cent_captain in reader.access)
|
||||
return 1
|
||||
return 0
|
||||
363
code/WorkInProgress/computer3/computers/cloning.dm
Normal file
363
code/WorkInProgress/computer3/computers/cloning.dm
Normal file
@@ -0,0 +1,363 @@
|
||||
/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>"
|
||||
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>"
|
||||
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
|
||||
384
code/WorkInProgress/computer3/computers/communications.dm
Normal file
384
code/WorkInProgress/computer3/computers/communications.dm
Normal file
@@ -0,0 +1,384 @@
|
||||
/obj/machinery/computer3/communications
|
||||
default_prog = /datum/file/program/communications
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio/subspace)
|
||||
|
||||
/obj/machinery/computer3/communications/captain
|
||||
default_prog = /datum/file/program/communications
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/cardslot/dual)
|
||||
spawn_files = list(/datum/file/program/card_comp, /datum/file/program/security, /datum/file/program/crew, /datum/file/program/arcade,
|
||||
/datum/file/camnet_key, /datum/file/camnet_key/entertainment, /datum/file/camnet_key/singulo)
|
||||
|
||||
|
||||
/datum/file/program/communications
|
||||
var/const/STATE_DEFAULT = 1
|
||||
var/const/STATE_CALLSHUTTLE = 2
|
||||
var/const/STATE_CANCELSHUTTLE = 3
|
||||
var/const/STATE_MESSAGELIST = 4
|
||||
var/const/STATE_VIEWMESSAGE = 5
|
||||
var/const/STATE_DELMESSAGE = 6
|
||||
var/const/STATE_STATUSDISPLAY = 7
|
||||
var/const/STATE_ALERT_LEVEL = 8
|
||||
var/const/STATE_CONFIRM_LEVEL = 9
|
||||
|
||||
|
||||
/datum/file/program/communications
|
||||
name = "Centcom communications relay"
|
||||
desc = "Used to connect to Centcom."
|
||||
active_state = "comm"
|
||||
req_access = list(access_heads)
|
||||
|
||||
var/prints_intercept = 1
|
||||
var/authenticated = 0
|
||||
var/list/messagetitle = list()
|
||||
var/list/messagetext = list()
|
||||
var/currmsg = 0
|
||||
var/aicurrmsg = 0
|
||||
var/state = STATE_DEFAULT
|
||||
var/aistate = STATE_DEFAULT
|
||||
var/message_cooldown = 0
|
||||
var/centcomm_message_cooldown = 0
|
||||
var/tmp_alertlevel = 0
|
||||
|
||||
var/status_display_freq = "1435"
|
||||
var/stat_msg1
|
||||
var/stat_msg2
|
||||
|
||||
Reset()
|
||||
..()
|
||||
authenticated = 0
|
||||
state = STATE_DEFAULT
|
||||
aistate = STATE_DEFAULT
|
||||
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.radio || ..(href,href_list) )
|
||||
return
|
||||
if (computer.z > 1)
|
||||
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return
|
||||
|
||||
if("main" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if("login" in href_list)
|
||||
var/mob/M = usr
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
if(I)
|
||||
I = I.GetID()
|
||||
if(istype(I,/obj/item/weapon/card/id) && check_access(I))
|
||||
authenticated = 1
|
||||
if(access_captain in I.GetAccess())
|
||||
authenticated = 2
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
authenticated = 2
|
||||
computer.emagged = 1
|
||||
if("logout" in href_list)
|
||||
authenticated = 0
|
||||
|
||||
if("swipeidseclevel" in href_list)
|
||||
var/mob/M = usr
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
I = I.GetID()
|
||||
|
||||
if (istype(I,/obj/item/weapon/card/id))
|
||||
if(access_captain in I.GetAccess())
|
||||
var/old_level = security_level
|
||||
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
|
||||
set_security_level(tmp_alertlevel)
|
||||
if(security_level != old_level)
|
||||
//Only notify the admins if an actual change happened
|
||||
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
|
||||
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
|
||||
switch(security_level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
feedback_inc("alert_comms_green",1)
|
||||
if(SEC_LEVEL_BLUE)
|
||||
feedback_inc("alert_comms_blue",1)
|
||||
tmp_alertlevel = 0
|
||||
else:
|
||||
usr << "You are not authorized to do this."
|
||||
tmp_alertlevel = 0
|
||||
state = STATE_DEFAULT
|
||||
else
|
||||
usr << "You need to swipe your ID."
|
||||
if("announce" in href_list)
|
||||
if(authenticated==2)
|
||||
if(message_cooldown) return
|
||||
var/input = stripped_input(usr, "Please choose a message to announce to the station crew.", "What?")
|
||||
if(!input || !interactable())
|
||||
return
|
||||
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
|
||||
log_say("[key_name(usr)] has made a captain announcement: [input]")
|
||||
message_admins("[key_name_admin(usr)] has made a captain announcement.", 1)
|
||||
message_cooldown = 1
|
||||
spawn(600)//One minute cooldown
|
||||
message_cooldown = 0
|
||||
|
||||
if("callshuttle" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if(authenticated)
|
||||
state = STATE_CALLSHUTTLE
|
||||
if("callshuttle2" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
if(authenticated)
|
||||
call_shuttle_proc(usr)
|
||||
if(emergency_shuttle.online)
|
||||
post_status("shuttle")
|
||||
state = STATE_DEFAULT
|
||||
if("cancelshuttle" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if(authenticated)
|
||||
state = STATE_CANCELSHUTTLE
|
||||
if("messagelist" in href_list)
|
||||
currmsg = 0
|
||||
state = STATE_MESSAGELIST
|
||||
if("viewmessage" in href_list)
|
||||
state = STATE_VIEWMESSAGE
|
||||
if (!currmsg)
|
||||
if(href_list["message-num"])
|
||||
currmsg = text2num(href_list["message-num"])
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
if("delmessage" in href_list)
|
||||
state = (currmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
|
||||
if("delmessage2" in href_list)
|
||||
if(authenticated)
|
||||
if(currmsg)
|
||||
var/title = messagetitle[currmsg]
|
||||
var/text = messagetext[currmsg]
|
||||
messagetitle.Remove(title)
|
||||
messagetext.Remove(text)
|
||||
if(currmsg == aicurrmsg)
|
||||
aicurrmsg = 0
|
||||
currmsg = 0
|
||||
state = STATE_MESSAGELIST
|
||||
else
|
||||
state = STATE_VIEWMESSAGE
|
||||
if("status" in href_list)
|
||||
state = STATE_STATUSDISPLAY
|
||||
|
||||
// Status display stuff
|
||||
if("setstat" in href_list)
|
||||
switch(href_list["statdisp"])
|
||||
if("message")
|
||||
post_status("message", stat_msg1, stat_msg2)
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
if("setmsg1" in href_list)
|
||||
stat_msg1 = reject_bad_text(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40)
|
||||
computer.updateDialog()
|
||||
if("setmsg2" in href_list)
|
||||
stat_msg2 = reject_bad_text(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40)
|
||||
computer.updateDialog()
|
||||
|
||||
// OMG CENTCOMM LETTERHEAD
|
||||
if("MessageCentcomm" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
if(authenticated==2)
|
||||
if(centcomm_message_cooldown)
|
||||
usr << "Arrays recycling. Please stand by."
|
||||
return
|
||||
var/input = stripped_input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
|
||||
if(!input || !interactable())
|
||||
return
|
||||
Centcomm_announce(input, usr)
|
||||
usr << "Message transmitted."
|
||||
log_say("[key_name(usr)] has made a Centcomm announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(600)//10 minute cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
|
||||
|
||||
// OMG SYNDICATE ...LETTERHEAD
|
||||
if("MessageSyndicate" in href_list)
|
||||
if((authenticated==2) && (computer.emagged))
|
||||
if(centcomm_message_cooldown)
|
||||
usr << "Arrays recycling. Please stand by."
|
||||
return
|
||||
var/input = stripped_input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
|
||||
if(!input || !interactable())
|
||||
return
|
||||
Syndicate_announce(input, usr)
|
||||
usr << "Message transmitted."
|
||||
log_say("[key_name(usr)] has made a Syndicate announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(600)//10 minute cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
|
||||
if("RestoreBackup" in href_list)
|
||||
usr << "Backup routing data restored!"
|
||||
computer.emagged = 0
|
||||
computer.updateDialog()
|
||||
|
||||
|
||||
|
||||
// AI interface
|
||||
if("ai-main" in href_list)
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_DEFAULT
|
||||
if("ai-callshuttle" in href_list)
|
||||
aistate = STATE_CALLSHUTTLE
|
||||
if("ai-callshuttle2" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
call_shuttle_proc(usr)
|
||||
aistate = STATE_DEFAULT
|
||||
if("ai-messagelist" in href_list)
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_MESSAGELIST
|
||||
if("ai-viewmessage" in href_list)
|
||||
aistate = STATE_VIEWMESSAGE
|
||||
if (!aicurrmsg)
|
||||
if(href_list["message-num"])
|
||||
aicurrmsg = text2num(href_list["message-num"])
|
||||
else
|
||||
aistate = STATE_MESSAGELIST
|
||||
if("ai-delmessage" in href_list)
|
||||
aistate = (aicurrmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
|
||||
if("ai-delmessage2" in href_list)
|
||||
if(aicurrmsg)
|
||||
var/title = messagetitle[aicurrmsg]
|
||||
var/text = messagetext[aicurrmsg]
|
||||
messagetitle.Remove(title)
|
||||
messagetext.Remove(text)
|
||||
if(currmsg == aicurrmsg)
|
||||
currmsg = 0
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_MESSAGELIST
|
||||
if("ai-status" in href_list)
|
||||
aistate = STATE_STATUSDISPLAY
|
||||
|
||||
if("securitylevel" in href_list)
|
||||
tmp_alertlevel = text2num( href_list["newalertlevel"] )
|
||||
if(!tmp_alertlevel) tmp_alertlevel = 0
|
||||
state = STATE_CONFIRM_LEVEL
|
||||
|
||||
if("changeseclevel" in href_list)
|
||||
state = STATE_ALERT_LEVEL
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
proc/main_menu()
|
||||
var/dat = ""
|
||||
if (computer.radio.subspace)
|
||||
if(emergency_shuttle.online && emergency_shuttle.location==0)
|
||||
var/timeleft = emergency_shuttle.timeleft()
|
||||
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]<BR>"
|
||||
refresh = 1
|
||||
else
|
||||
refresh = 0
|
||||
if (authenticated)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];logout'>Log Out</A> \]"
|
||||
if (authenticated==2)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];announce'>Make An Announcement</A> \]"
|
||||
if(computer.emagged == 0)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];MessageCentcomm'>Send an emergency message to Centcomm</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];MessageSyndicate'>Send an emergency message to \[UNKNOWN\]</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];RestoreBackup'>Restore Backup Routing Data</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];changeseclevel'>Change alert level</A> \]"
|
||||
if(emergency_shuttle.location==0)
|
||||
if (emergency_shuttle.online)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];cancelshuttle'>Cancel Shuttle Call</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];callshuttle'>Call Emergency Shuttle</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];status'>Set Status Display</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];login'>Log In</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];messagelist'>Message List</A> \]"
|
||||
return dat
|
||||
|
||||
proc/confirm_menu(var/prompt,var/yes_option)
|
||||
return "Are you sure you want to [prompt]? \[ [topic_link(src,yes_option,"OK")] | [topic_link(src,"main","Cancel")] \]"
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
switch(state)
|
||||
if(STATE_DEFAULT)
|
||||
dat = main_menu()
|
||||
if(STATE_CALLSHUTTLE)
|
||||
dat = confirm_menu("call the shuttle","callshuttle2")
|
||||
if(STATE_CANCELSHUTTLE)
|
||||
dat = confirm_menu("cancel the shuttle","cancelshuttle2")
|
||||
if(STATE_MESSAGELIST)
|
||||
dat += "Messages:"
|
||||
for(var/i = 1; i<=messagetitle.len; i++)
|
||||
dat += "<BR><A HREF='?src=\ref[src];viewmessage;message-num=[i]'>[messagetitle[i]]</A>"
|
||||
if(STATE_VIEWMESSAGE)
|
||||
if (currmsg)
|
||||
dat += "<B>[messagetitle[currmsg]]</B><BR><BR>[messagetext[currmsg]]"
|
||||
if (authenticated)
|
||||
dat += "<BR><BR>\[ <A HREF='?src=\ref[src];delmessage'>Delete \]"
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
interact()
|
||||
return
|
||||
if(STATE_DELMESSAGE)
|
||||
if (currmsg)
|
||||
dat += "Are you sure you want to delete this message? \[ <A HREF='?src=\ref[src];delmessage2'>OK</A> | <A HREF='?src=\ref[src];viewmessage'>Cancel</A> \]"
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
interact()
|
||||
return
|
||||
if(STATE_STATUSDISPLAY)
|
||||
dat += "\[ <A HREF='?src=\ref[src];main'>Back</A> \]<BR>"
|
||||
dat += "Set Status Displays<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=blank'>Clear</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=message'>Message</A> \]"
|
||||
dat += "<ul><li> Line 1: <A HREF='?src=\ref[src];setmsg1'>[ stat_msg1 ? stat_msg1 : "(none)"]</A>"
|
||||
dat += "<li> Line 2: <A HREF='?src=\ref[src];setmsg2'>[ stat_msg2 ? stat_msg2 : "(none)"]</A></ul><br>"
|
||||
dat += "\[ Alert: <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=default'>None</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=redalert'>Red Alert</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=lockdown'>Lockdown</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
|
||||
if(STATE_ALERT_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
if(security_level == SEC_LEVEL_DELTA)
|
||||
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
|
||||
else
|
||||
dat += "<A HREF='?src=\ref[src];securitylevel;newalertlevel=[SEC_LEVEL_BLUE]'>Blue</A><BR>"
|
||||
dat += "<A HREF='?src=\ref[src];securitylevel;newalertlevel=[SEC_LEVEL_GREEN]'>Green</A>"
|
||||
if(STATE_CONFIRM_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
dat += "Confirm the change to: [num2seclevel(tmp_alertlevel)]<BR>"
|
||||
dat += "<A HREF='?src=\ref[src];swipeidseclevel'>Swipe ID</A> to confirm change.<BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
|
||||
proc/post_status(var/command, var/data1, var/data2)
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
|
||||
switch(command)
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
status_signal.data["msg2"] = data2
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
71
code/WorkInProgress/computer3/computers/crew.dm
Normal file
71
code/WorkInProgress/computer3/computers/crew.dm
Normal file
@@ -0,0 +1,71 @@
|
||||
/obj/machinery/computer3/crew
|
||||
default_prog = /datum/file/program/crew
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio)
|
||||
icon_state = "frame-med"
|
||||
|
||||
/datum/file/program/crew
|
||||
name = "Crew Monitoring Console"
|
||||
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
|
||||
active_state = "crew"
|
||||
var/list/tracked = list( )
|
||||
|
||||
interact(mob/user)
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
scan()
|
||||
var/t = ""
|
||||
t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A> "
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
t += "<table width='100%'><tr><td width='40%'><h3>Name</h3></td><td width='30%'><h3>Vitals</h3></td><td width='30%'><h3>Position</h3></td></tr>"
|
||||
var/list/logs = list()
|
||||
for(var/obj/item/clothing/under/C in tracked)
|
||||
var/log = ""
|
||||
var/turf/pos = get_turf(C)
|
||||
if((C) && (C.has_sensor) && (pos) && (pos.z == computer.z) && C.sensor_mode)
|
||||
if(istype(C.loc, /mob/living/carbon/human))
|
||||
|
||||
var/mob/living/carbon/human/H = C.loc
|
||||
|
||||
var/dam1 = round(H.getOxyLoss(),1)
|
||||
var/dam2 = round(H.getToxLoss(),1)
|
||||
var/dam3 = round(H.getFireLoss(),1)
|
||||
var/dam4 = round(H.getBruteLoss(),1)
|
||||
|
||||
var/life_status = "[H.stat > 1 ? "<span class='bad'>Deceased</span>" : "<span class='good'>Living</span>"]"
|
||||
var/damage_report = "(<font color='blue'>[dam1]</font>/<font color='green'>[dam2]</font>/<font color='orange'>[dam3]</font>/<font color='red'>[dam4]</font>)"
|
||||
|
||||
if(H.wear_id)
|
||||
log += "<tr><td width='40%'>[H.wear_id.name]</td>"
|
||||
else
|
||||
log += "<tr><td width='40%'>Unknown</td>"
|
||||
|
||||
switch(C.sensor_mode)
|
||||
if(1)
|
||||
log += "<td width='30%'>[life_status]</td><td width='30%'>Not Available</td></tr>"
|
||||
if(2)
|
||||
log += "<td width='30%'>[life_status] [damage_report]</td><td width='30%'>Not Available</td></tr>"
|
||||
if(3)
|
||||
var/area/player_area = get_area(H)
|
||||
log += "<td width='30%'>[life_status] [damage_report]</td><td width='30%'>[format_text(player_area.name)] ([pos.x], [pos.y])</td></tr>"
|
||||
logs += log
|
||||
logs = sortList(logs)
|
||||
for(var/log in logs)
|
||||
t += log
|
||||
t += "</table>"
|
||||
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
|
||||
|
||||
proc/scan()
|
||||
for(var/obj/item/clothing/under/C in world)
|
||||
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
|
||||
tracked |= C
|
||||
return 1
|
||||
|
||||
Topic(href, list/href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
3
code/WorkInProgress/computer3/computers/customs.dm
Normal file
3
code/WorkInProgress/computer3/computers/customs.dm
Normal file
@@ -0,0 +1,3 @@
|
||||
/obj/machinery/computer3/customs
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio/subspace,/obj/item/part/computer/networking/cameras)
|
||||
spawn_files = list(/datum/file/program/arcade,/datum/file/program/security,/datum/file/camnet_key/entertainment,/datum/file/program/crew)
|
||||
84
code/WorkInProgress/computer3/computers/law.dm
Normal file
84
code/WorkInProgress/computer3/computers/law.dm
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
|
||||
/obj/machinery/computer3/aiupload
|
||||
name = "AI Upload"
|
||||
desc = "Used to upload laws to the AI."
|
||||
icon_state = "frame-rnd"
|
||||
circuit = "/obj/item/part/board/circuit/aiupload"
|
||||
var/mob/living/silicon/ai/current = null
|
||||
var/opened = 0
|
||||
|
||||
|
||||
verb/AccessInternals()
|
||||
set category = "Object"
|
||||
set name = "Access Computer's Internals"
|
||||
set src in oview(1)
|
||||
if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon))
|
||||
return
|
||||
|
||||
opened = !opened
|
||||
if(opened)
|
||||
usr << "\blue The access panel is now open."
|
||||
else
|
||||
usr << "\blue The access panel is now closed."
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if (user.z > 6)
|
||||
user << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
usr << "The upload computer has no power!"
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
usr << "No active AIs detected."
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer3/borgupload
|
||||
name = "Cyborg Upload"
|
||||
desc = "Used to upload laws to Cyborgs."
|
||||
icon_state = "frame-rnd"
|
||||
circuit = "/obj/item/part/board/circuit/borgupload"
|
||||
var/mob/living/silicon/robot/current = null
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
usr << "The upload computer has no power!"
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
|
||||
src.current = freeborg()
|
||||
|
||||
if (!src.current)
|
||||
usr << "No free cyborgs detected."
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
return
|
||||
503
code/WorkInProgress/computer3/computers/medical.dm
Normal file
503
code/WorkInProgress/computer3/computers/medical.dm
Normal file
@@ -0,0 +1,503 @@
|
||||
/*
|
||||
I hate to make this a todo, but I cannot possibly complete all of computer3
|
||||
if I have to rearchitecture datacores and everything else that uses them right now.
|
||||
|
||||
In the future the datacore should probably be a server, perhaps on station, perhaps on centcom,
|
||||
with data records as files probably. It's not difficult unless you're trying to do a million
|
||||
impossible things before breakfast.
|
||||
*/
|
||||
|
||||
/obj/machinery/computer3/med_data
|
||||
default_prog = /datum/file/program/med_data
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/cardslot,/obj/item/part/computer/networking/radio)
|
||||
|
||||
/datum/file/program/med_data
|
||||
name = "Medical Records"
|
||||
desc = "This can be used to check medical records."
|
||||
active_state = "medcomp"
|
||||
req_one_access = list(access_medical, access_forensics_lockers)
|
||||
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/authenticated = null
|
||||
var/rank = null
|
||||
var/screen = null
|
||||
var/datum/data/record/active1 = null
|
||||
var/datum/data/record/active2 = null
|
||||
var/a_id = null
|
||||
var/temp = null
|
||||
var/printing = null
|
||||
|
||||
|
||||
proc/authenticate()
|
||||
if(access_medical in scan.access)
|
||||
return 1
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
interact()
|
||||
usr.set_machine(src)
|
||||
scan = computer.cardslot.reader
|
||||
if(!interactable())
|
||||
return
|
||||
if (computer.z > 6)
|
||||
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = text("<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>")
|
||||
else
|
||||
dat = text("Confirm Identity: <A href='?src=\ref[];scan=1'>[]</A><HR>", src, (src.scan ? text("[]", src.scan.name) : "----------"))
|
||||
if (src.authenticated)
|
||||
switch(src.screen)
|
||||
if(1.0)
|
||||
dat += {"
|
||||
<A href='?src=\ref[src];search=1'>Search Records</A>
|
||||
<BR><A href='?src=\ref[src];screen=2'>List Records</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=5'>Virus Database</A>
|
||||
<BR><A href='?src=\ref[src];screen=6'>Medbot Tracking</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=3'>Record Maintenance</A>
|
||||
<BR><A href='?src=\ref[src];logout=1'>{Log Out}</A><BR>
|
||||
"}
|
||||
if(2.0)
|
||||
dat += "<B>Record List</B>:<HR>"
|
||||
if(!isnull(data_core.general))
|
||||
for(var/datum/data/record/R in sortRecord(data_core.general))
|
||||
dat += text("<A href='?src=\ref[];d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
|
||||
//Foreach goto(132)
|
||||
dat += text("<HR><A href='?src=\ref[];screen=1'>Back</A>", src)
|
||||
if(3.0)
|
||||
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];screen=1'>Back</A>", src, src, src, src)
|
||||
if(4.0)
|
||||
var/icon/front = new(active1.fields["photo"], dir = SOUTH)
|
||||
var/icon/side = new(active1.fields["photo"], dir = WEST)
|
||||
usr << browse_rsc(front, "front.png")
|
||||
usr << browse_rsc(side, "side.png")
|
||||
dat += "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
dat += "<table><tr><td>Name: [active1.fields["name"]] \
|
||||
ID: [active1.fields["id"]]<BR>\n \
|
||||
Sex: <A href='?src=\ref[src];field=sex'>[active1.fields["sex"]]</A><BR>\n \
|
||||
Age: <A href='?src=\ref[src];field=age'>[active1.fields["age"]]</A><BR>\n \
|
||||
Fingerprint: <A href='?src=\ref[src];field=fingerprint'>[active1.fields["fingerprint"]]</A><BR>\n \
|
||||
Physical Status: <A href='?src=\ref[src];field=p_stat'>[active1.fields["p_stat"]]</A><BR>\n \
|
||||
Mental Status: <A href='?src=\ref[src];field=m_stat'>[active1.fields["m_stat"]]</A><BR></td><td align = center valign = top> \
|
||||
Photo:<br><img src=front.png height=64 width=64 border=5><img src=side.png height=64 width=64 border=5></td></tr></table>"
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
dat += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: <A href='?src=\ref[];field=b_type'>[]</A><BR>\nDNA: <A href='?src=\ref[];field=b_dna'>[]</A><BR>\n<BR>\nMinor Disabilities: <A href='?src=\ref[];field=mi_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=mi_dis_d'>[]</A><BR>\n<BR>\nMajor Disabilities: <A href='?src=\ref[];field=ma_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=ma_dis_d'>[]</A><BR>\n<BR>\nAllergies: <A href='?src=\ref[];field=alg'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=alg_d'>[]</A><BR>\n<BR>\nCurrent Diseases: <A href='?src=\ref[];field=cdi'>[]</A> (per disease info placed in log/comment section)<BR>\nDetails: <A href='?src=\ref[];field=cdi_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, src.active2.fields["b_type"], src, src.active2.fields["b_dna"], src, src.active2.fields["mi_dis"], src, src.active2.fields["mi_dis_d"], src, src.active2.fields["ma_dis"], src, src.active2.fields["ma_dis_d"], src, src.active2.fields["alg"], src, src.active2.fields["alg_d"], src, src.active2.fields["cdi"], src, src.active2.fields["cdi_d"], src, decode(src.active2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
dat += text("[]<BR><A href='?src=\ref[];del_c=[]'>Delete Entry</A><BR><BR>", src.active2.fields[text("com_[]", counter)], src, counter)
|
||||
counter++
|
||||
dat += text("<A href='?src=\ref[];add_c=1'>Add Entry</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];del_r=1'>Delete Record (Medical Only)</A><BR><BR>", src)
|
||||
else
|
||||
dat += "<B>Medical Record Lost!</B><BR>"
|
||||
dat += text("<A href='?src=\ref[src];new=1'>New Record</A><BR><BR>")
|
||||
dat += text("\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];screen=2'>Back</A><BR>", src, src)
|
||||
if(5.0)
|
||||
dat += "<CENTER><B>Virus Database</B></CENTER>"
|
||||
/* Advanced diseases is weak! Feeble! Glory to virus2!
|
||||
for(var/Dt in typesof(/datum/disease/))
|
||||
var/datum/disease/Dis = new Dt(0)
|
||||
if(istype(Dis, /datum/disease/advance))
|
||||
continue // TODO (tm): Add advance diseases to the virus database which no one uses.
|
||||
if(!Dis.desc)
|
||||
continue
|
||||
dat += "<br><a href='?src=\ref[src];vir=[Dt]'>[Dis.name]</a>"
|
||||
*/
|
||||
for (var/ID in virusDB)
|
||||
var/datum/data/record/v = virusDB[ID]
|
||||
dat += "<br><a href='?src=\ref[src];vir=\ref[v]'>[v.fields["name"]]</a>"
|
||||
|
||||
dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
if(6.0)
|
||||
dat += "<center><b>Medical Robot Monitor</b></center>"
|
||||
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
dat += "<br><b>Medical Robots:</b>"
|
||||
var/bdat = null
|
||||
for(var/obj/machinery/bot/medbot/M in world)
|
||||
|
||||
if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
|
||||
var/turf/bl = get_turf(M)
|
||||
if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up
|
||||
bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
|
||||
if((!isnull(M.reagent_glass)) && M.use_beaker)
|
||||
bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]<br>"
|
||||
else
|
||||
bdat += "Using Internal Synthesizer.<br>"
|
||||
if(!bdat)
|
||||
dat += "<br><center>None detected</center>"
|
||||
else
|
||||
dat += "<br>[bdat]"
|
||||
|
||||
else
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
|
||||
var/datum/browser/popup = new(usr, "med_comp", "Medical Records", 600, 400)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
|
||||
if (!( data_core.general.Find(src.active1) ))
|
||||
src.active1 = null
|
||||
|
||||
if (!( data_core.medical.Find(src.active2) ))
|
||||
src.active2 = null
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
|
||||
if (href_list["scan"])
|
||||
if (scan)
|
||||
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
|
||||
computer.cardslot.remove(scan)
|
||||
else
|
||||
scan.loc = get_turf(src)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
computer.cardslot.insert(I)
|
||||
scan = I
|
||||
|
||||
else if (href_list["logout"])
|
||||
src.authenticated = null
|
||||
src.screen = null
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
else if (href_list["login"])
|
||||
|
||||
if (istype(usr, /mob/living/silicon/ai))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
src.rank = "AI"
|
||||
src.screen = 1
|
||||
|
||||
else if (istype(usr, /mob/living/silicon/robot))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
src.rank = "[R.modtype] [R.braintype]"
|
||||
src.screen = 1
|
||||
|
||||
else if (istype(src.scan, /obj/item/weapon/card/id))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if (src.check_access(src.scan))
|
||||
src.authenticated = src.scan.registered_name
|
||||
src.rank = src.scan.assignment
|
||||
src.screen = 1
|
||||
|
||||
if (src.authenticated)
|
||||
|
||||
if(href_list["screen"])
|
||||
src.screen = text2num(href_list["screen"])
|
||||
if(src.screen < 1)
|
||||
src.screen = 1
|
||||
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if(href_list["vir"])
|
||||
var/datum/data/record/v = locate(href_list["vir"])
|
||||
src.temp = "<center>GNAv2 based virus lifeform V-[v.fields["id"]]</center>"
|
||||
src.temp += "<br><b>Name:</b> <A href='?src=\ref[src];field=vir_name;edit_vir=\ref[v]'>[v.fields["name"]]</A>"
|
||||
src.temp += "<br><b>Antigen:</b> [v.fields["antigen"]]"
|
||||
src.temp += "<br><b>Spread:</b> [v.fields["spread type"]] "
|
||||
src.temp += "<br><b>Details:</b><br> <A href='?src=\ref[src];field=vir_desc;edit_vir=\ref[v]'>[v.fields["description"]]</A>"
|
||||
|
||||
if (href_list["del_all"])
|
||||
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
|
||||
if (href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
//R = null
|
||||
del(R)
|
||||
//Foreach goto(494)
|
||||
src.temp = "All records deleted."
|
||||
|
||||
if (href_list["field"])
|
||||
var/a1 = src.active1
|
||||
var/a2 = src.active2
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
if (src.active1.fields["sex"] == "Male")
|
||||
src.active1.fields["sex"] = "Female"
|
||||
else
|
||||
src.active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = copytext(html_encode(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
if("p_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Physical Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=deceased'>*Deceased*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=ssd'>*SSD*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=active'>Active</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unfit'>Physically Unfit</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=disabled'>Disabled</A><BR>", src, src, src, src, src)
|
||||
if("m_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Mental Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=insane'>*Insane*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=unstable'>*Unstable*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=watch'>*Watch*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=stable'>Stable</A><BR>", src, src, src, src)
|
||||
if("b_type")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
if("b_dna")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["dna"] = t1
|
||||
if("vir_name")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = copytext(sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["name"] = t1
|
||||
if("vir_desc")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = copytext(sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["description"] = t1
|
||||
else
|
||||
|
||||
if (href_list["p_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["p_stat"])
|
||||
if("deceased")
|
||||
src.active1.fields["p_stat"] = "*Deceased*"
|
||||
if("ssd")
|
||||
src.active1.fields["p_stat"] = "*SSD*"
|
||||
if("active")
|
||||
src.active1.fields["p_stat"] = "Active"
|
||||
if("unfit")
|
||||
src.active1.fields["p_stat"] = "Physically Unfit"
|
||||
if("disabled")
|
||||
src.active1.fields["p_stat"] = "Disabled"
|
||||
|
||||
if (href_list["m_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["m_stat"])
|
||||
if("insane")
|
||||
src.active1.fields["m_stat"] = "*Insane*"
|
||||
if("unstable")
|
||||
src.active1.fields["m_stat"] = "*Unstable*"
|
||||
if("watch")
|
||||
src.active1.fields["m_stat"] = "*Watch*"
|
||||
if("stable")
|
||||
src.active1.fields["m_stat"] = "Stable"
|
||||
|
||||
|
||||
if (href_list["b_type"])
|
||||
if (src.active2)
|
||||
switch(href_list["b_type"])
|
||||
if("an")
|
||||
src.active2.fields["b_type"] = "A-"
|
||||
if("bn")
|
||||
src.active2.fields["b_type"] = "B-"
|
||||
if("abn")
|
||||
src.active2.fields["b_type"] = "AB-"
|
||||
if("on")
|
||||
src.active2.fields["b_type"] = "O-"
|
||||
if("ap")
|
||||
src.active2.fields["b_type"] = "A+"
|
||||
if("bp")
|
||||
src.active2.fields["b_type"] = "B+"
|
||||
if("abp")
|
||||
src.active2.fields["b_type"] = "AB+"
|
||||
if("op")
|
||||
src.active2.fields["b_type"] = "O+"
|
||||
|
||||
|
||||
if (href_list["del_r"])
|
||||
if (src.active2)
|
||||
src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
|
||||
if (href_list["del_r2"])
|
||||
if (src.active2)
|
||||
//src.active2 = null
|
||||
del(src.active2)
|
||||
|
||||
if (href_list["d_rec"])
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/datum/data/record/M = locate(href_list["d_rec"])
|
||||
if (!( data_core.general.Find(R) ))
|
||||
src.temp = "Record Not Found!"
|
||||
return
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
M = E
|
||||
else
|
||||
//Foreach continue //goto(2540)
|
||||
src.active1 = R
|
||||
src.active2 = M
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["new"])
|
||||
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
R.fields["name"] = src.active1.fields["name"]
|
||||
R.fields["id"] = src.active1.fields["id"]
|
||||
R.name = text("Medical Record #[]", R.fields["id"])
|
||||
R.fields["b_type"] = "Unknown"
|
||||
R.fields["b_dna"] = "Unknown"
|
||||
R.fields["mi_dis"] = "None"
|
||||
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
R.fields["ma_dis"] = "None"
|
||||
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
R.fields["alg"] = "None"
|
||||
R.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
R.fields["cdi"] = "None"
|
||||
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.medical += R
|
||||
src.active2 = R
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["add_c"])
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
|
||||
|
||||
if (href_list["del_c"])
|
||||
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
|
||||
if (href_list["search"])
|
||||
var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || ((!interactable()) && (!istype(usr, /mob/living/silicon)))))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"])))
|
||||
src.active2 = R
|
||||
else
|
||||
//Foreach continue //goto(3229)
|
||||
if (!( src.active2 ))
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.general)
|
||||
if ((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"]))
|
||||
src.active1 = E
|
||||
else
|
||||
//Foreach continue //goto(3334)
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["print_p"])
|
||||
if (!( src.printing ))
|
||||
src.printing = 1
|
||||
var/datum/data/record/record1 = null
|
||||
var/datum/data/record/record2 = null
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
record1 = active1
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
record2 = active2
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if (record1)
|
||||
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
|
||||
P.name = text("Medical Record ([])", record1.fields["name"])
|
||||
else
|
||||
P.info += "<B>General Record Lost!</B><BR>"
|
||||
P.name = "Medical Record"
|
||||
if (record2)
|
||||
P.info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(record2.fields[text("com_[]", counter)])
|
||||
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
P.info += "<B>Medical Record Lost!</B><BR>"
|
||||
P.info += "</TT>"
|
||||
src.printing = null
|
||||
|
||||
interact()
|
||||
return
|
||||
441
code/WorkInProgress/computer3/computers/message.dm
Normal file
441
code/WorkInProgress/computer3/computers/message.dm
Normal file
@@ -0,0 +1,441 @@
|
||||
/obj/machinery/computer3/message_monitor
|
||||
default_prog = /datum/file/program/message_mon
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/prox)
|
||||
|
||||
/datum/file/program/message_mon
|
||||
name = "Message Monitor Console"
|
||||
desc = "Used to Monitor the crew's messages, that are sent via PDA. Can also be used to view Request Console messages."
|
||||
active_state = "comm_logs"
|
||||
var/hack_icon = "comm_logsc"
|
||||
var/normal_icon = "comm_logs"
|
||||
|
||||
//Server linked to.
|
||||
var/obj/machinery/message_server/linkedServer = null
|
||||
//Sparks effect - For emag
|
||||
//var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
|
||||
|
||||
//Messages - Saves me time if I want to change something.
|
||||
var/noserver = "<span class='alert'>ALERT: No server detected.</span>"
|
||||
var/incorrectkey = "<span class='warning'>ALERT: Incorrect decryption key!</span>"
|
||||
var/defaultmsg = "<span class='notice'>Welcome. Please select an option.</span>"
|
||||
var/rebootmsg = "<span class='warning'>%$&(<28>: Critical %$$@ Error // !RestArting! <lOadiNg backUp iNput ouTput> - ?pLeaSe wAit!</span>"
|
||||
|
||||
//Computer properties
|
||||
var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message
|
||||
var/hacking = 0 // Is it being hacked into by the AI/Cyborg
|
||||
var/emag = 0 // When it is emagged.
|
||||
var/message = "<span class='notice'>System bootup complete. Please select an option.</span>" // The message that shows on the main menu.
|
||||
var/auth = 0 // Are they authenticated?
|
||||
var/optioncount = 7
|
||||
|
||||
// Custom Message Properties
|
||||
var/customsender = "System Administrator"
|
||||
var/obj/item/device/pda/customrecepient = null
|
||||
var/customjob = "Admin"
|
||||
var/custommessage = "This is a test, please ignore."
|
||||
|
||||
|
||||
update_icon()
|
||||
if(emag || hacking)
|
||||
overlay.icon_state = hack_icon
|
||||
else
|
||||
overlay.icon_state = normal_icon
|
||||
computer.update_icon()
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
//If the computer is being hacked or is emagged, display the reboot message.
|
||||
if(hacking || emag)
|
||||
message = rebootmsg
|
||||
|
||||
var/dat = "<center><font color='blue'[message]</font>/</center>"
|
||||
|
||||
if(auth)
|
||||
dat += "<h4><dd><A href='?src=\ref[src];auth=1'>	<font color='green'>\[Authenticated\]</font></a>	/"
|
||||
dat += " Server Power: <A href='?src=\ref[src];active=1'>[src.linkedServer && src.linkedServer.active ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</a></h4>"
|
||||
else
|
||||
dat += "<h4><dd><A href='?src=\ref[src];auth=1'>	<font color='red'>\[Unauthenticated\]</font></a>	/"
|
||||
dat += " Server Power: <u>[src.linkedServer && src.linkedServer.active ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</u></h4>"
|
||||
|
||||
if(hacking || emag)
|
||||
screen = 2
|
||||
else
|
||||
if(!auth)
|
||||
screen = 0
|
||||
if( !linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)) )
|
||||
message = noserver
|
||||
screen = 0
|
||||
|
||||
switch(screen)
|
||||
//Main menu
|
||||
if(0)
|
||||
//	 = TAB
|
||||
var/i = 0
|
||||
dat += "<dd><A href='?src=\ref[src];find=1'>	[++i]. Link To A Server</a></dd>"
|
||||
if(auth)
|
||||
if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
dat += "<dd><A>	ERROR: Server not found!</A><br></dd>"
|
||||
else
|
||||
dat += "<dd><A href='?src=\ref[src];view=1'>	[++i]. View Message Logs </a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];viewr=1'>	[++i]. View Request Console Logs </a></br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clear=1'>	[++i]. Clear Message Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];clearr=1'>	[++i]. Clear Request Console Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];pass=1'>	[++i]. Set Custom Key</a><br></dd>"
|
||||
dat += "<dd><A href='?src=\ref[src];msg=1'>	[++i]. Send Admin Message</a><br></dd>"
|
||||
else
|
||||
for(var/n = ++i; n <= optioncount; n++)
|
||||
dat += "<dd><font color='blue'>	[n]. ---------------</font><br></dd>"
|
||||
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
|
||||
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
|
||||
dat += "<dd><A href='?src=\ref[src];hack=1'><i><font color='Red'>*&@#. Bruteforce Key</font></i></font></a><br></dd>"
|
||||
else
|
||||
dat += "<br>"
|
||||
|
||||
//Bottom message
|
||||
if(!auth)
|
||||
dat += "<br><hr><dd><span class='notice'>Please authenticate with the server in order to show additional options.</span>"
|
||||
else
|
||||
dat += "<br><hr><dd><span class='warning'>Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties.</span>"
|
||||
|
||||
//Message Logs
|
||||
if(1)
|
||||
var/index = 0
|
||||
//var/recipient = "Unspecified" //name of the person
|
||||
//var/sender = "Unspecified" //name of the sender
|
||||
//var/message = "Blank" //transferred message
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
|
||||
dat += "<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sender</th><th width='15%'>Recipient</th><th width='300px' word-wrap: break-word>Message</th></tr>"
|
||||
for(var/datum/data_pda_msg/pda in src.linkedServer.pda_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Sender - Recepient - Message
|
||||
// X - Al Green - Your Mom - WHAT UP!?
|
||||
dat += "<tr><td width = '5%'><center><A href='?src=\ref[src];delete=\ref[pda]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[pda.sender]</td><td width='15%'>[pda.recipient]</td><td width='300px'>[pda.message]</td></tr>"
|
||||
dat += "</table>"
|
||||
//Hacking screen.
|
||||
if(2)
|
||||
if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
|
||||
dat += "Brute-forcing for server key.<br> It will take 20 seconds for every character that the password has."
|
||||
dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time."
|
||||
else
|
||||
//It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever.
|
||||
dat += {"01000010011100100111010101110100011001010010110<br>
|
||||
10110011001101111011100100110001101101001011011100110011<br>
|
||||
10010000001100110011011110111001000100000011100110110010<br>
|
||||
10111001001110110011001010111001000100000011010110110010<br>
|
||||
10111100100101110001000000100100101110100001000000111011<br>
|
||||
10110100101101100011011000010000001110100011000010110101<br>
|
||||
10110010100100000001100100011000000100000011100110110010<br>
|
||||
10110001101101111011011100110010001110011001000000110011<br>
|
||||
00110111101110010001000000110010101110110011001010111001<br>
|
||||
00111100100100000011000110110100001100001011100100110000<br>
|
||||
10110001101110100011001010111001000100000011101000110100<br>
|
||||
00110000101110100001000000111010001101000011001010010000<br>
|
||||
00111000001100001011100110111001101110111011011110111001<br>
|
||||
00110010000100000011010000110000101110011001011100010000<br>
|
||||
00100100101101110001000000111010001101000011001010010000<br>
|
||||
00110110101100101011000010110111001110100011010010110110<br>
|
||||
10110010100101100001000000111010001101000011010010111001<br>
|
||||
10010000001100011011011110110111001110011011011110110110<br>
|
||||
00110010100100000011000110110000101101110001000000111001<br>
|
||||
00110010101110110011001010110000101101100001000000111100<br>
|
||||
10110111101110101011100100010000001110100011100100111010<br>
|
||||
10110010100100000011010010110111001110100011001010110111<br>
|
||||
00111010001101001011011110110111001110011001000000110100<br>
|
||||
10110011000100000011110010110111101110101001000000110110<br>
|
||||
00110010101110100001000000111001101101111011011010110010<br>
|
||||
10110111101101110011001010010000001100001011000110110001<br>
|
||||
10110010101110011011100110010000001101001011101000010111<br>
|
||||
00010000001001101011000010110101101100101001000000111001<br>
|
||||
10111010101110010011001010010000001101110011011110010000<br>
|
||||
00110100001110101011011010110000101101110011100110010000<br>
|
||||
00110010101101110011101000110010101110010001000000111010<br>
|
||||
00110100001100101001000000111001001101111011011110110110<br>
|
||||
10010000001100100011101010111001001101001011011100110011<br>
|
||||
10010000001110100011010000110000101110100001000000111010<br>
|
||||
001101001011011010110010100101110"}
|
||||
|
||||
//Fake messages
|
||||
if(3)
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];Reset=1'>Reset</a></center><hr>"
|
||||
|
||||
dat += {"<table border='1' width='100%'>
|
||||
<tr><td width='20%'><A href='?src=\ref[src];select=Sender'>Sender</a></td>
|
||||
<td width='20%'><A href='?src=\ref[src];select=RecJob'>Sender's Job</a></td>
|
||||
<td width='20%'><A href='?src=\ref[src];select=Recepient'>Recipient</a></td>
|
||||
<td width='300px' word-wrap: break-word><A href='?src=\ref[src];select=Message'>Message</a></td></tr>"}
|
||||
//Sender - Sender's Job - Recepient - Message
|
||||
//Al Green- Your Dad - Your Mom - WHAT UP!?
|
||||
|
||||
dat += {"<tr><td width='20%'>[customsender]</td>
|
||||
<td width='20%'>[customjob]</td>
|
||||
<td width='20%'>[customrecepient ? customrecepient.owner : "NONE"]</td>
|
||||
<td width='300px'>[custommessage]</td></tr>"}
|
||||
dat += "</table><br><center><A href='?src=\ref[src];select=Send'>Send</a>"
|
||||
|
||||
//Request Console Logs
|
||||
if(4)
|
||||
|
||||
var/index = 0
|
||||
/* data_rc_msg
|
||||
X - 5%
|
||||
var/rec_dpt = "Unspecified" //name of the person - 15%
|
||||
var/send_dpt = "Unspecified" //name of the sender- 15%
|
||||
var/message = "Blank" //transferred message - 300px
|
||||
var/stamp = "Unstamped" - 15%
|
||||
var/id_auth = "Unauthenticated" - 15%
|
||||
var/priority = "Normal" - 10%
|
||||
*/
|
||||
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
|
||||
dat += {"<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sending Dep.</th><th width='15%'>Receiving Dep.</th>
|
||||
<th width='300px' word-wrap: break-word>Message</th><th width='15%'>Stamp</th><th width='15%'>ID Auth.</th><th width='15%'>Priority.</th></tr>"}
|
||||
for(var/datum/data_rc_msg/rc in src.linkedServer.rc_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Sender - Recepient - Message
|
||||
// X - Al Green - Your Mom - WHAT UP!?
|
||||
dat += {"<tr><td width = '5%'><center><A href='?src=\ref[src];deleter=\ref[rc]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[rc.send_dpt]</td>
|
||||
<td width='15%'>[rc.rec_dpt]</td><td width='300px'>[rc.message]</td><td width='15%'>[rc.stamp]</td><td width='15%'>[rc.id_auth]</td><td width='15%'>[rc.priority]</td></tr>"}
|
||||
dat += "</table>"
|
||||
|
||||
message = defaultmsg
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
proc/BruteForce(mob/usr as mob)
|
||||
if(isnull(linkedServer))
|
||||
usr << "<span class='warning'>Could not complete brute-force: Linked Server Disconnected!</span>"
|
||||
else
|
||||
var/currentKey = src.linkedServer.decryptkey
|
||||
usr << "<span class='warning'>Brute-force completed! The key is '[currentKey]'.</span>"
|
||||
src.hacking = 0
|
||||
src.active_state = normal_icon
|
||||
src.screen = 0 // Return the screen back to normal
|
||||
|
||||
proc/UnmagConsole()
|
||||
src.active_state = normal_icon
|
||||
src.emag = 0
|
||||
|
||||
proc/ResetMessage()
|
||||
customsender = "System Administrator"
|
||||
customrecepient = null
|
||||
custommessage = "This is a test, please ignore."
|
||||
customjob = "Admin"
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if ("auth" in href_list)
|
||||
if(auth)
|
||||
auth = 0
|
||||
screen = 0
|
||||
else
|
||||
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
|
||||
if(dkey && dkey != "")
|
||||
if(src.linkedServer.decryptkey == dkey)
|
||||
auth = 1
|
||||
else
|
||||
message = incorrectkey
|
||||
|
||||
//Turn the server on/off.
|
||||
if ("active" in href_list)
|
||||
if(auth) linkedServer.active = !linkedServer.active
|
||||
//Find a server
|
||||
if ("find" in href_list)
|
||||
if(message_servers && message_servers.len > 1)
|
||||
src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers
|
||||
message = "<span class='alert'>NOTICE: Server selected.</span>"
|
||||
else if(message_servers && message_servers.len > 0)
|
||||
linkedServer = message_servers[1]
|
||||
message = "<span class='notice'>NOTICE: Only Single Server Detected - Server selected.</span>"
|
||||
else
|
||||
message = noserver
|
||||
|
||||
//View the logs - KEY REQUIRED
|
||||
if ("view" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 1
|
||||
|
||||
//Clears the logs - KEY REQUIRED
|
||||
if ("clear" in href_list)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.linkedServer.pda_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Clears the request console logs - KEY REQUIRED
|
||||
if ("clearr" in href_list)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.linkedServer.rc_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Change the password - KEY REQUIRED
|
||||
if ("pass" in href_list)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
|
||||
if(dkey && dkey != "")
|
||||
if(src.linkedServer.decryptkey == dkey)
|
||||
var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):"))
|
||||
if(length(newkey) <= 3)
|
||||
message = "<span class='notice'>NOTICE: Decryption key too short!</span>"
|
||||
else if(length(newkey) > 16)
|
||||
message = "<span class='notice'>NOTICE: Decryption key too long!</span>"
|
||||
else if(newkey && newkey != "")
|
||||
src.linkedServer.decryptkey = newkey
|
||||
message = "<span class='notice'>NOTICE: Decryption key set.</span>"
|
||||
else
|
||||
message = incorrectkey
|
||||
|
||||
//Hack the Console to get the password
|
||||
if ("hack" in href_list)
|
||||
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
|
||||
src.hacking = 1
|
||||
src.screen = 2
|
||||
src.active_state = hack_icon
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
spawn(100*length(src.linkedServer.decryptkey))
|
||||
if(src && src.linkedServer && usr)
|
||||
BruteForce(usr)
|
||||
//Delete the log.
|
||||
if ("delete" in href_list)
|
||||
//Are they on the view logs screen?
|
||||
if(screen == 1)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else //if(istype(href_list["delete"], /datum/data_pda_msg))
|
||||
src.linkedServer.pda_msgs -= locate(href_list["delete"])
|
||||
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Delete the request console log.
|
||||
if ("deleter" in href_list)
|
||||
//Are they on the view logs screen?
|
||||
if(screen == 4)
|
||||
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else //if(istype(href_list["delete"], /datum/data_pda_msg))
|
||||
src.linkedServer.rc_msgs -= locate(href_list["deleter"])
|
||||
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Create a custom message
|
||||
if ("msg" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 3
|
||||
//Fake messaging selection - KEY REQUIRED
|
||||
if ("select" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
screen = 0
|
||||
else
|
||||
switch(href_list["select"])
|
||||
|
||||
//Reset
|
||||
if("Reset")
|
||||
ResetMessage()
|
||||
|
||||
//Select Your Name
|
||||
if("Sender")
|
||||
customsender = input(usr, "Please enter the sender's name.") as text|null
|
||||
|
||||
//Select Receiver
|
||||
if("Recepient")
|
||||
//Get out list of viable PDAs
|
||||
var/list/obj/item/device/pda/sendPDAs = list()
|
||||
for(var/obj/item/device/pda/P in PDAs)
|
||||
if(!P.owner || P.toff || P.hidden) continue
|
||||
sendPDAs += P
|
||||
if(PDAs && PDAs.len > 0)
|
||||
customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortAtom(sendPDAs)
|
||||
else
|
||||
customrecepient = null
|
||||
|
||||
|
||||
//Enter custom job
|
||||
if("RecJob")
|
||||
customjob = input(usr, "Please enter the sender's job.") as text|null
|
||||
|
||||
//Enter message
|
||||
if("Message")
|
||||
custommessage = input(usr, "Please enter your message.") as text|null
|
||||
custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN)
|
||||
|
||||
//Send message
|
||||
if("Send")
|
||||
|
||||
if(isnull(customsender) || customsender == "")
|
||||
customsender = "UNKNOWN"
|
||||
|
||||
if(isnull(customrecepient))
|
||||
message = "<span class='notice'>NOTICE: No recepient selected!</span>"
|
||||
return src.attack_hand(usr)
|
||||
|
||||
if(isnull(custommessage) || custommessage == "")
|
||||
message = "<span class='notice'>NOTICE: No message entered!</span>"
|
||||
return src.attack_hand(usr)
|
||||
|
||||
var/obj/item/device/pda/PDARec = null
|
||||
for (var/obj/item/device/pda/P in PDAs)
|
||||
if (!P.owner || P.toff || P.hidden) continue
|
||||
if(P.owner == customsender)
|
||||
PDARec = P
|
||||
//Sender isn't faking as someone who exists
|
||||
if(isnull(PDARec))
|
||||
src.linkedServer.send_pda_message("[customrecepient.owner]", "[customsender]","[custommessage]")
|
||||
customrecepient.tnote += "<i><b>← From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[src]'>[customsender]</a> ([customjob]):</b></i><br>[custommessage]<br>"
|
||||
if (!customrecepient.silent)
|
||||
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, customrecepient.loc))
|
||||
O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
|
||||
if( customrecepient.loc && ishuman(customrecepient.loc) )
|
||||
var/mob/living/carbon/human/H = customrecepient.loc
|
||||
H << "\icon[customrecepient] <b>Message from [customsender] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
|
||||
log_pda("[usr] (PDA: [customsender]) sent \"[custommessage]\" to [customrecepient.owner]")
|
||||
customrecepient.overlays.Cut()
|
||||
customrecepient.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
//Sender is faking as someone who exists
|
||||
else
|
||||
src.linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]")
|
||||
customrecepient.tnote += "<i><b>← From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[PDARec]'>[PDARec.owner]</a> ([customjob]):</b></i><br>[custommessage]<br>"
|
||||
if (!customrecepient.silent)
|
||||
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(3, customrecepient.loc))
|
||||
O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
|
||||
if( customrecepient.loc && ishuman(customrecepient.loc) )
|
||||
var/mob/living/carbon/human/H = customrecepient.loc
|
||||
H << "\icon[customrecepient] <b>Message from [PDARec.owner] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[customrecepient];choice=Message;skiprefresh=1;target=\ref[PDARec]'>Reply</a>)"
|
||||
log_pda("[usr] (PDA: [PDARec.owner]) sent \"[custommessage]\" to [customrecepient.owner]")
|
||||
customrecepient.overlays.Cut()
|
||||
customrecepient.overlays += image('icons/obj/pda.dmi', "pda-r")
|
||||
//Finally..
|
||||
ResetMessage()
|
||||
|
||||
//Request Console Logs - KEY REQUIRED
|
||||
if("viewr" in href_list)
|
||||
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
message = noserver
|
||||
else
|
||||
if(auth)
|
||||
src.screen = 4
|
||||
|
||||
//usr << href_list["select"]
|
||||
|
||||
if ("back" in href_list)
|
||||
src.screen = 0
|
||||
interact()
|
||||
218
code/WorkInProgress/computer3/computers/pod.dm
Normal file
218
code/WorkInProgress/computer3/computers/pod.dm
Normal file
@@ -0,0 +1,218 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer3/pod
|
||||
name = "Pod Launch Control"
|
||||
desc = "A controll for launching pods. Some people prefer firing Mechas."
|
||||
icon_state = "computer_generic"
|
||||
var/id = 1.0
|
||||
var/obj/machinery/mass_driver/connected = null
|
||||
var/timing = 0.0
|
||||
var/time = 30.0
|
||||
var/title = "Mass Driver Controls"
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.id == id)
|
||||
connected = M
|
||||
else
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/proc/alarm()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(!( connected ))
|
||||
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == id)
|
||||
M.open()
|
||||
return
|
||||
sleep(20)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
if(M.id == id)
|
||||
M.power = connected.power
|
||||
M.drive()
|
||||
|
||||
sleep(50)
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == id)
|
||||
M.close()
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/tool/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if(stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
|
||||
new /obj/item/trash/shard( loc )
|
||||
|
||||
//generate appropriate circuitboard. Accounts for /pod/old computer types
|
||||
var/obj/item/part/board/circuit/pod/M = null
|
||||
if(istype(src, /obj/machinery/computer/pod/old))
|
||||
M = new /obj/item/part/board/circuit/olddoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/syndicate))
|
||||
M = new /obj/item/part/board/circuit/syndicatedoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/swf))
|
||||
M = new /obj/item/part/board/circuit/swfdoor( A )
|
||||
else //it's not an old computer. Generate standard pod circuitboard.
|
||||
M = new /obj/item/part/board/circuit/pod( A )
|
||||
|
||||
for (var/obj/C in src)
|
||||
C.loc = loc
|
||||
M.id = id
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
|
||||
|
||||
//generate appropriate circuitboard. Accounts for /pod/old computer types
|
||||
var/obj/item/part/board/circuit/pod/M = null
|
||||
if(istype(src, /obj/machinery/computer/pod/old))
|
||||
M = new /obj/item/part/board/circuit/olddoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/syndicate))
|
||||
M = new /obj/item/part/board/circuit/syndicatedoor( A )
|
||||
if(istype(src, /obj/machinery/computer/pod/old/swf))
|
||||
M = new /obj/item/part/board/circuit/swfdoor( A )
|
||||
else //it's not an old computer. Generate standard pod circuitboard.
|
||||
M = new /obj/item/part/board/circuit/pod( A )
|
||||
|
||||
for (var/obj/C in src)
|
||||
C.loc = loc
|
||||
M.id = id
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
user.set_machine(src)
|
||||
if(connected)
|
||||
var/d2
|
||||
if(timing) //door controls do not need timers.
|
||||
d2 = "<A href='?src=\ref[src];time=0'>Stop Time Launch</A>"
|
||||
else
|
||||
d2 = "<A href='?src=\ref[src];time=1'>Initiate Time Launch</A>"
|
||||
var/second = time % 60
|
||||
var/minute = (time - second) / 60
|
||||
dat += "<HR>\nTimer System: [d2]\nTime Left: [minute ? "[minute]:" : null][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>"
|
||||
var/temp = ""
|
||||
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
|
||||
for(var/t in L)
|
||||
if(t == connected.power)
|
||||
temp += "[t] "
|
||||
else
|
||||
temp += "<A href = '?src=\ref[src];power=[t]'>[t]</A> "
|
||||
dat += "<HR>\nPower Level: [temp]<BR>\n<A href = '?src=\ref[src];alarm=1'>Firing Sequence</A><BR>\n<A href = '?src=\ref[src];drive=1'>Test Fire Driver</A><BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
else
|
||||
dat += "<BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
dat += "<BR><BR><A href='?src=\ref[user];mach_close=computer'>Close</A>"
|
||||
add_fingerprint(usr)
|
||||
//user << browse(dat, "window=computer;size=400x500")
|
||||
//onclose(user, "computer")
|
||||
var/datum/browser/popup = new(user, "computer", title, 400, 500)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/process()
|
||||
if(!..())
|
||||
return
|
||||
if(timing)
|
||||
if(time > 0)
|
||||
time = round(time) - 1
|
||||
else
|
||||
alarm()
|
||||
time = 0
|
||||
timing = 0
|
||||
updateDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/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["power"])
|
||||
var/t = text2num(href_list["power"])
|
||||
t = min(max(0.25, t), 16)
|
||||
if(connected)
|
||||
connected.power = t
|
||||
if(href_list["alarm"])
|
||||
alarm()
|
||||
if(href_list["time"])
|
||||
timing = text2num(href_list["time"])
|
||||
if(href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
time += tp
|
||||
time = min(max(round(time), 0), 120)
|
||||
if(href_list["door"])
|
||||
for(var/obj/machinery/door/poddoor/M in world)
|
||||
if(M.id == id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
else
|
||||
M.close()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/old
|
||||
icon_state = "old"
|
||||
name = "DoorMex Control Console"
|
||||
title = "Door Controls"
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer3/pod/old/syndicate
|
||||
name = "ProComp Executive IIc"
|
||||
desc = "The Syndicate operate on a tight budget. Operates external airlocks."
|
||||
title = "External Airlock Controls"
|
||||
req_access = list(access_syndicate)
|
||||
|
||||
/obj/machinery/computer3/pod/old/syndicate/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied"
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/computer3/pod/old/swf
|
||||
name = "Magix System IV"
|
||||
desc = "An arcane artifact that holds much magic. Running E-Knock 2.2: Sorceror's Edition"
|
||||
47
code/WorkInProgress/computer3/computers/power.dm
Normal file
47
code/WorkInProgress/computer3/computers/power.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
/obj/machinery/computer3/powermonitor
|
||||
default_prog = /datum/file/program/powermon
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/cable)
|
||||
icon_state = "frame-eng"
|
||||
|
||||
/datum/file/program/powermon
|
||||
name = "power monitoring console"
|
||||
desc = "It monitors APC status."
|
||||
active_state = "power"
|
||||
|
||||
proc/format(var/obj/machinery/power/apc/A)
|
||||
var/static/list/S = list(" Off","AOff"," On", " AOn")
|
||||
var/static/list/chg = list("N","C","F")
|
||||
return "[copytext(add_tspace("\The [A.area]", 30), 1, 30)] [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
var/list/L = computer.net.get_machines(/obj/machinery/power/apc)
|
||||
var/t = ""
|
||||
t += "<A href='?src=\ref[src]'>Refresh</A><br /><br />"
|
||||
if(!L || !L.len)
|
||||
t += "\red No connection"
|
||||
else
|
||||
var/datum/powernet/powernet = computer.net.connect_to(/datum/powernet,null)
|
||||
if(powernet)
|
||||
t += "<PRE>Total power: [powernet.avail] W<BR>Total load: [num2text(powernet.viewload,10)] W<BR>"
|
||||
else
|
||||
t += "<PRE><i>Power statistics unavailable</i><BR>"
|
||||
t += "<FONT SIZE=-1>"
|
||||
|
||||
if(L.len > 0)
|
||||
t += "Area Eqp./Lgt./Env. Load Cell<HR>"
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
t += src.format(A)
|
||||
t += "</FONT></PRE>"
|
||||
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
interact()
|
||||
109
code/WorkInProgress/computer3/computers/prisoner.dm
Normal file
109
code/WorkInProgress/computer3/computers/prisoner.dm
Normal file
@@ -0,0 +1,109 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer3/prisoner
|
||||
name = "Prisoner Management Comsole"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "explosive"
|
||||
req_access = list(access_armory)
|
||||
circuit = "/obj/item/part/board/circuit/prisoner"
|
||||
var/id = 0.0
|
||||
var/temp = null
|
||||
var/status = 0
|
||||
var/timeleft = 60
|
||||
var/stop = 0.0
|
||||
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed
|
||||
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_paw(var/mob/user as mob)
|
||||
return
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
dat += "<B>Prisoner Implant Manager System</B><BR>"
|
||||
if(screen == 0)
|
||||
dat += "<HR><A href='?src=\ref[src];lock=1'>Unlock Console</A>"
|
||||
else if(screen == 1)
|
||||
dat += "<HR>Chemical Implants<BR>"
|
||||
var/turf/Tr = null
|
||||
for(var/obj/item/weapon/implant/chem/C in world)
|
||||
Tr = get_turf(C)
|
||||
if((Tr) && (Tr.z != src.z)) continue//Out of range
|
||||
if(!C.implanted) continue
|
||||
dat += "[C.imp_in.name] | Remaining Units: [C.reagents.total_volume] | Inject: "
|
||||
dat += "<A href='?src=\ref[src];inject1=\ref[C]'>(<font color=red>(1)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject5=\ref[C]'>(<font color=red>(5)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR>Tracking Implants<BR>"
|
||||
for(var/obj/item/weapon/implant/tracking/T in world)
|
||||
Tr = get_turf(T)
|
||||
if((Tr) && (Tr.z != src.z)) continue//Out of range
|
||||
if(!T.implanted) continue
|
||||
var/loc_display = "Unknown"
|
||||
var/mob/living/carbon/M = T.imp_in
|
||||
if(M.z == 1 && !istype(M.loc, /turf/space))
|
||||
var/turf/mob_loc = get_turf_loc(M)
|
||||
loc_display = mob_loc.loc
|
||||
if(T.malfunction)
|
||||
loc_display = pick(teleportlocs)
|
||||
dat += "ID: [T.id] | Location: [loc_display]<BR>"
|
||||
dat += "<A href='?src=\ref[src];warn=\ref[T]'>(<font color=red><i>Message Holder</i></font>)</A> |<BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];lock=1'>Lock Console</A>"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
|
||||
process()
|
||||
if(!..())
|
||||
src.updateDialog()
|
||||
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["inject1"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject1"])
|
||||
if(I) I.activate(1)
|
||||
|
||||
else if(href_list["inject5"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject5"])
|
||||
if(I) I.activate(5)
|
||||
|
||||
else if(href_list["inject10"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject10"])
|
||||
if(I) I.activate(10)
|
||||
|
||||
else if(href_list["lock"])
|
||||
if(src.allowed(usr))
|
||||
screen = !screen
|
||||
else
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["warn"])
|
||||
var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
|
||||
if(!warning) return
|
||||
var/obj/item/weapon/implant/I = locate(href_list["warn"])
|
||||
if((I)&&(I.imp_in))
|
||||
var/mob/living/carbon/R = I.imp_in
|
||||
R << "\green You hear a voice in your head saying: '[warning]'"
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
242
code/WorkInProgress/computer3/computers/prisonshuttle.dm
Normal file
242
code/WorkInProgress/computer3/computers/prisonshuttle.dm
Normal file
@@ -0,0 +1,242 @@
|
||||
//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)
|
||||
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)
|
||||
if(istype(I, /obj/item/tool/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
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)
|
||||
user << "\blue The broken glass falls out."
|
||||
new /obj/item/trash/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
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
|
||||
user << "\blue You disable the lock."
|
||||
else
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(!src.allowed(user) && (!hacked))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
if(prison_break)
|
||||
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())
|
||||
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")
|
||||
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())
|
||||
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")
|
||||
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())
|
||||
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())
|
||||
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
|
||||
211
code/WorkInProgress/computer3/computers/robot.dm
Normal file
211
code/WorkInProgress/computer3/computers/robot.dm
Normal file
@@ -0,0 +1,211 @@
|
||||
/obj/machinery/computer3/robotics
|
||||
default_prog = /datum/file/program/borg_control
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio)
|
||||
icon_state = "frame-rnd"
|
||||
|
||||
/datum/file/program/borg_control
|
||||
name = "Cyborg Control"
|
||||
desc = "Used to remotely lockdown or detonate linked Cyborgs."
|
||||
active_state = "robot"
|
||||
var/id = 0.0
|
||||
var/temp = null
|
||||
var/status = 0
|
||||
var/timeleft = 60
|
||||
var/stop = 0.0
|
||||
var/screen = 0 // 0 - Main Menu, 1 - Cyborg Status, 2 - Kill 'em All! -- In text
|
||||
req_access = list(access_robotics)
|
||||
|
||||
proc/start_sequence()
|
||||
do
|
||||
if(src.stop)
|
||||
src.stop = 0
|
||||
return
|
||||
src.timeleft--
|
||||
sleep(10)
|
||||
while(src.timeleft)
|
||||
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(!R.scrambledcodes)
|
||||
R.self_destruct()
|
||||
return
|
||||
|
||||
|
||||
interact()
|
||||
if(!interactable() || computer.z > 6)
|
||||
return
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
|
||||
else
|
||||
if(screen == 0)
|
||||
//dat += "<h3>Cyborg Control Console</h3><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=1'>1. Cyborg Status</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=2'>2. Emergency Full Destruct</A><BR>"
|
||||
if(screen == 1)
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
if (R.connected_ai != usr)
|
||||
continue
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
if (R != usr)
|
||||
continue
|
||||
if(R.scrambledcodes)
|
||||
continue
|
||||
|
||||
dat += "[R.name] |"
|
||||
if(R.stat)
|
||||
dat += " Not Responding |"
|
||||
else if (!R.canmove)
|
||||
dat += " Locked Down |"
|
||||
else
|
||||
dat += " Operating Normally |"
|
||||
if (!R.canmove)
|
||||
else if(R.cell)
|
||||
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
|
||||
else
|
||||
dat += " No Cell Installed |"
|
||||
if(R.module)
|
||||
dat += " Module Installed ([R.module.name]) |"
|
||||
else
|
||||
dat += " No Module Installed |"
|
||||
if(R.connected_ai)
|
||||
dat += " Slaved to [R.connected_ai.name] |"
|
||||
else
|
||||
dat += " Independent from AI |"
|
||||
if (istype(usr, /mob/living/silicon))
|
||||
if(issilicon(usr) && is_special_character(usr) && !R.emagged)
|
||||
dat += "<A href='?src=\ref[src];magbot=\ref[R]'>(<font color=blue><i>Hack</i></font>)</A> "
|
||||
dat += "<A href='?src=\ref[src];stopbot=\ref[R]'>(<font color=green><i>[R.canmove ? "Lockdown" : "Release"]</i></font>)</A> "
|
||||
dat += "<A href='?src=\ref[src];killbot=\ref[R]'>(<font color=red><i>Destroy</i></font>)</A>"
|
||||
dat += "<BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=0'>(Return to Main Menu)</A><BR>"
|
||||
if(screen == 2)
|
||||
if(!src.status)
|
||||
dat += {"<BR><B>Emergency Robot Self-Destruct</B><HR>\nStatus: Off<BR>
|
||||
\n<BR>
|
||||
\nCountdown: [src.timeleft]/60 <A href='?src=\ref[src];reset=1'>\[Reset\]</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[src];killall'>Start Sequence</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[usr];close'>Close</A>"}
|
||||
else
|
||||
dat = {"<B>Emergency Robot Self-Destruct</B><HR>\nStatus: Activated<BR>
|
||||
\n<BR>
|
||||
\nCountdown: [src.timeleft]/60 \[Reset\]<BR>
|
||||
\n<BR>\n<A href='?src=\ref[src];stop=1'>Stop Sequence</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[usr];mach_close=computer'>Close</A>"}
|
||||
dat += "<A href='?src=\ref[src];screen=0'>(Return to Main Menu)</A><BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if ("killall" in href_list)
|
||||
src.temp = {"Destroy Robots?<BR>
|
||||
<BR><B><A href='?src=\ref[src];do_killall'>\[Swipe ID to initiate destruction sequence\]</A></B><BR>
|
||||
<A href='?src=\ref[src];temp=1'>Cancel</A>"}
|
||||
|
||||
if ("do_killall" in href_list)
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
if (istype(I))
|
||||
if(src.check_access(I))
|
||||
if (!status)
|
||||
message_admins("\blue [key_name_admin(usr)] has initiated the global cyborg killswitch!")
|
||||
log_game("\blue [key_name(usr)] has initiated the global cyborg killswitch!")
|
||||
src.status = 1
|
||||
src.start_sequence()
|
||||
src.temp = null
|
||||
|
||||
else
|
||||
usr << "\red Access Denied."
|
||||
|
||||
if ("stop" in href_list)
|
||||
src.temp = {"
|
||||
Stop Robot Destruction Sequence?<BR>
|
||||
<BR><A href='?src=\ref[src];stop2=1'>Yes</A><BR>
|
||||
<A href='?src=\ref[src];temp=1'>No</A>"}
|
||||
|
||||
if ("stop2" in href_list)
|
||||
src.stop = 1
|
||||
src.temp = null
|
||||
src.status = 0
|
||||
|
||||
if ("reset" in href_list)
|
||||
src.timeleft = 60
|
||||
|
||||
if ("temp" in href_list)
|
||||
src.temp = null
|
||||
if ("screen" in href_list)
|
||||
switch(href_list["screen"])
|
||||
if("0")
|
||||
screen = 0
|
||||
if("1")
|
||||
screen = 1
|
||||
if("2")
|
||||
screen = 2
|
||||
if ("killbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["killbot"])
|
||||
if(R)
|
||||
var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
if(R.mind && R.mind.special_role && R.emagged)
|
||||
R << "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered."
|
||||
R.ResetSecurityCodes()
|
||||
|
||||
else
|
||||
message_admins("\blue [key_name_admin(usr)] detonated [R.name]!")
|
||||
log_game("\blue [key_name_admin(usr)] detonated [R.name]!")
|
||||
R.self_destruct()
|
||||
else
|
||||
usr << "\red Access Denied."
|
||||
|
||||
if ("stopbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["stopbot"])
|
||||
if(R && istype(R)) // Extra sancheck because of input var references
|
||||
var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
message_admins("\blue [key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
|
||||
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
|
||||
R.canmove = !R.canmove
|
||||
if (R.lockcharge)
|
||||
// R.cell.charge = R.lockcharge
|
||||
R.lockcharge = !R.lockcharge
|
||||
R << "Your lockdown has been lifted!"
|
||||
else
|
||||
R.lockcharge = !R.lockcharge
|
||||
// R.cell.charge = 0
|
||||
R << "You have been locked down!"
|
||||
|
||||
else
|
||||
usr << "\red Access Denied."
|
||||
|
||||
if ("magbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
|
||||
if(R)
|
||||
var/choice = input("Are you certain you wish to hack [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
// message_admins("\blue [key_name_admin(usr)] emagged [R.name] using robotic console!")
|
||||
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
|
||||
R.emagged = 1
|
||||
if(R.mind.special_role)
|
||||
R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes
|
||||
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
|
||||
1274
code/WorkInProgress/computer3/computers/scanconsole.dm
Normal file
1274
code/WorkInProgress/computer3/computers/scanconsole.dm
Normal file
File diff suppressed because it is too large
Load Diff
606
code/WorkInProgress/computer3/computers/security.dm
Normal file
606
code/WorkInProgress/computer3/computers/security.dm
Normal file
@@ -0,0 +1,606 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
/obj/machinery/computer3/secure_data
|
||||
default_prog = /datum/file/program/secure_data
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/cardslot,/obj/item/part/computer/networking/radio)
|
||||
icon_state = "frame-sec"
|
||||
|
||||
/obj/machinery/computer3/laptop/secure_data
|
||||
default_prog = /datum/file/program/secure_data
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd/big,/obj/item/part/computer/cardslot,/obj/item/part/computer/networking/radio)
|
||||
icon_state = "laptop"
|
||||
|
||||
|
||||
/datum/file/program/secure_data//TODO:SANITY
|
||||
name = "Security Records"
|
||||
desc = "Used to view and edit personnel's security records"
|
||||
active_state = "security"
|
||||
image = 'icons/NTOS/records.png'
|
||||
|
||||
req_one_access = list(access_security, access_forensics_lockers)
|
||||
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/authenticated = null
|
||||
var/rank = null
|
||||
var/screen = null
|
||||
var/datum/data/record/active1 = null
|
||||
var/datum/data/record/active2 = null
|
||||
var/a_id = null
|
||||
var/temp = null
|
||||
var/printing = null
|
||||
var/can_change_id = 0
|
||||
var/list/Perp
|
||||
var/tempname = null
|
||||
//Sorting Variables
|
||||
var/sortBy = "name"
|
||||
var/order = 1 // -1 = Descending - 1 = Ascending
|
||||
|
||||
|
||||
|
||||
proc/authenticate()
|
||||
if(access_security in scan.access || access_forensics_lockers in scan.access )
|
||||
return 1
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
interact()
|
||||
usr.set_machine(src)
|
||||
scan = computer.cardslot.reader
|
||||
if(!interactable())
|
||||
return
|
||||
if (computer.z > 6)
|
||||
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return
|
||||
var/dat
|
||||
|
||||
if (temp)
|
||||
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];choice=Clear Screen'>Clear Screen</A>", temp, src)
|
||||
else
|
||||
dat = text("Confirm Identity: <A href='?src=\ref[];choice=Confirm Identity'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
|
||||
if (authenticated)
|
||||
switch(screen)
|
||||
if(1.0)
|
||||
dat += {"
|
||||
<p style='text-align:center;'>"}
|
||||
dat += text("<A href='?src=\ref[];choice=Search Records'>Search Records</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];choice=New Record (General)'>New Record</A><BR>", src)
|
||||
dat += {"
|
||||
</p>
|
||||
<table style="text-align:center;" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<th>Records:</th>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="text-align:center;" border="1" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<th><A href='?src=\ref[src];choice=Sorting;sort=name'>Name</A></th>
|
||||
<th><A href='?src=\ref[src];choice=Sorting;sort=id'>ID</A></th>
|
||||
<th><A href='?src=\ref[src];choice=Sorting;sort=rank'>Rank</A></th>
|
||||
<th><A href='?src=\ref[src];choice=Sorting;sort=fingerprint'>Fingerprints</A></th>
|
||||
<th>Criminal Status</th>
|
||||
</tr>"}
|
||||
if(!isnull(data_core.general))
|
||||
for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order))
|
||||
var/crimstat = ""
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]))
|
||||
crimstat = E.fields["criminal"]
|
||||
var/background
|
||||
switch(crimstat)
|
||||
if("*Arrest*")
|
||||
background = "'background-color:#DC143C;'"
|
||||
if("Incarcerated")
|
||||
background = "'background-color:#CD853F;'"
|
||||
if("Parolled")
|
||||
background = "'background-color:#CD853F;'"
|
||||
if("Released")
|
||||
background = "'background-color:#3BB9FF;'"
|
||||
if("None")
|
||||
background = "'background-color:#00FF7F;'"
|
||||
if("")
|
||||
background = "'background-color:#00FF00;'"
|
||||
crimstat = "No Record."
|
||||
dat += text("<tr style=[]><td><A href='?src=\ref[];choice=Browse Record;d_rec=\ref[]'>[]</a></td>", background, src, R, R.fields["name"])
|
||||
dat += text("<td>[]</td>", R.fields["id"])
|
||||
dat += text("<td>[]</td>", R.fields["rank"])
|
||||
dat += text("<td>[]</td>", R.fields["fingerprint"])
|
||||
dat += text("<td>[]</td></tr>", crimstat)
|
||||
dat += "</table><hr width='75%' />"
|
||||
dat += text("<A href='?src=\ref[];choice=Record Maintenance'>Record Maintenance</A><br><br>", src)
|
||||
dat += text("<A href='?src=\ref[];choice=Log Out'>{Log Out}</A>",src)
|
||||
if(2.0)
|
||||
dat += "<B>Records Maintenance</B><HR>"
|
||||
dat += "<BR><A href='?src=\ref[src];choice=Delete All Records'>Delete All Records</A><BR><BR><A href='?src=\ref[src];choice=Return'>Back</A>"
|
||||
if(3.0)
|
||||
dat += "<CENTER><B>Security Record</B></CENTER><BR>"
|
||||
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
|
||||
var/icon/front = new(active1.fields["photo"], dir = SOUTH)
|
||||
var/icon/side = new(active1.fields["photo"], dir = WEST)
|
||||
usr << browse_rsc(front, "front.png")
|
||||
usr << browse_rsc(side, "side.png")
|
||||
dat += text("<table><tr><td> \
|
||||
Name: <A href='?src=\ref[src];choice=Edit Field;field=name'>[active1.fields["name"]]</A><BR> \
|
||||
ID: <A href='?src=\ref[src];choice=Edit Field;field=id'>[active1.fields["id"]]</A><BR>\n \
|
||||
Sex: <A href='?src=\ref[src];choice=Edit Field;field=sex'>[active1.fields["sex"]]</A><BR>\n \
|
||||
Age: <A href='?src=\ref[src];choice=Edit Field;field=age'>[active1.fields["age"]]</A><BR>\n \
|
||||
Rank: <A href='?src=\ref[src];choice=Edit Field;field=rank'>[active1.fields["rank"]]</A><BR>\n \
|
||||
Fingerprint: <A href='?src=\ref[src];choice=Edit Field;field=fingerprint'>[active1.fields["fingerprint"]]</A><BR>\n \
|
||||
Physical Status: [active1.fields["p_stat"]]<BR>\n \
|
||||
Mental Status: [active1.fields["m_stat"]]<BR></td> \
|
||||
<td align = center valign = top>Photo:<br><img src=front.png height=80 width=80 border=4> \
|
||||
<img src=side.png height=80 width=80 border=4></td></tr></table>")
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
|
||||
dat += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: <A href='?src=\ref[];choice=Edit Field;field=criminal'>[]</A><BR>\n<BR>\nMinor Crimes: <A href='?src=\ref[];choice=Edit Field;field=mi_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];choice=Edit Field;field=mi_crim_d'>[]</A><BR>\n<BR>\nMajor Crimes: <A href='?src=\ref[];choice=Edit Field;field=ma_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];choice=Edit Field;field=ma_crim_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];choice=Edit Field;field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, active2.fields["criminal"], src, active2.fields["mi_crim"], src, active2.fields["mi_crim_d"], src, active2.fields["ma_crim"], src, active2.fields["ma_crim_d"], src, decode(active2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(active2.fields[text("com_[]", counter)])
|
||||
dat += text("[]<BR><A href='?src=\ref[];choice=Delete Entry;del_c=[]'>Delete Entry</A><BR><BR>", active2.fields[text("com_[]", counter)], src, counter)
|
||||
counter++
|
||||
dat += text("<A href='?src=\ref[];choice=Add Entry'>Add Entry</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];choice=Delete Record (Security)'>Delete Record (Security Only)</A><BR><BR>", src)
|
||||
else
|
||||
dat += "<B>Security Record Lost!</B><BR>"
|
||||
dat += text("<A href='?src=\ref[];choice=New Record (Security)'>New Security Record</A><BR><BR>", src)
|
||||
dat += text("\n<A href='?src=\ref[];choice=Delete Record (ALL)'>Delete Record (ALL)</A><BR><BR>\n<A href='?src=\ref[];choice=Print Record'>Print Record</A><BR>\n<A href='?src=\ref[];choice=Return'>Back</A><BR>", src, src, src)
|
||||
if(4.0)
|
||||
if(!Perp.len)
|
||||
dat += text("ERROR. String could not be located.<br><br><A href='?src=\ref[];choice=Return'>Back</A>", src)
|
||||
else
|
||||
dat += {"
|
||||
<table style="text-align:center;" cellspacing="0" width="100%">
|
||||
<tr> "}
|
||||
dat += text("<th>Search Results for '[]':</th>", tempname)
|
||||
dat += {"
|
||||
</tr>
|
||||
</table>
|
||||
<table style="text-align:center;" border="1" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>ID</th>
|
||||
<th>Rank</th>
|
||||
<th>Fingerprints</th>
|
||||
<th>Criminal Status</th>
|
||||
</tr> "}
|
||||
for(var/i=1, i<=Perp.len, i += 2)
|
||||
var/crimstat = ""
|
||||
var/datum/data/record/R = Perp[i]
|
||||
if(istype(Perp[i+1],/datum/data/record/))
|
||||
var/datum/data/record/E = Perp[i+1]
|
||||
crimstat = E.fields["criminal"]
|
||||
var/background
|
||||
switch(crimstat)
|
||||
if("*Arrest*")
|
||||
background = "'background-color:#DC143C;'"
|
||||
if("Incarcerated")
|
||||
background = "'background-color:#CD853F;'"
|
||||
if("Parolled")
|
||||
background = "'background-color:#CD853F;'"
|
||||
if("Released")
|
||||
background = "'background-color:#3BB9FF;'"
|
||||
if("None")
|
||||
background = "'background-color:#00FF7F;'"
|
||||
if("")
|
||||
background = "'background-color:#FFFFFF;'"
|
||||
crimstat = "No Record."
|
||||
dat += text("<tr style=[]><td><A href='?src=\ref[];choice=Browse Record;d_rec=\ref[]'>[]</a></td>", background, src, R, R.fields["name"])
|
||||
dat += text("<td>[]</td>", R.fields["id"])
|
||||
dat += text("<td>[]</td>", R.fields["rank"])
|
||||
dat += text("<td>[]</td>", R.fields["fingerprint"])
|
||||
dat += text("<td>[]</td></tr>", crimstat)
|
||||
dat += "</table><hr width='75%' />"
|
||||
dat += text("<br><A href='?src=\ref[];choice=Return'>Return to index.</A>", src)
|
||||
else
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];choice=Log In'>{Log In}</A>", src)
|
||||
var/datum/browser/popup = new(usr, "secure_rec", "Security Records", 600, 400)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/*Revised /N
|
||||
I can't be bothered to look more of the actual code outside of switch but that probably needs revising too.
|
||||
What a mess.*/
|
||||
Topic(href, href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
if (!( data_core.general.Find(active1) ))
|
||||
active1 = null
|
||||
if (!( data_core.security.Find(active2) ))
|
||||
active2 = null
|
||||
switch(href_list["choice"])
|
||||
// SORTING!
|
||||
if("Sorting")
|
||||
// Reverse the order if clicked twice
|
||||
if(sortBy == href_list["sort"])
|
||||
if(order == 1)
|
||||
order = -1
|
||||
else
|
||||
order = 1
|
||||
else
|
||||
// New sorting order!
|
||||
sortBy = href_list["sort"]
|
||||
order = initial(order)
|
||||
//BASIC FUNCTIONS
|
||||
if("Clear Screen")
|
||||
temp = null
|
||||
|
||||
if ("Return")
|
||||
screen = 1
|
||||
active1 = null
|
||||
active2 = null
|
||||
|
||||
if("Confirm Identity")
|
||||
if (scan)
|
||||
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
|
||||
computer.cardslot.remove(scan)
|
||||
else
|
||||
scan.loc = get_turf(src)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
computer.cardslot.insert(I)
|
||||
scan = I
|
||||
|
||||
if("Log Out")
|
||||
authenticated = null
|
||||
screen = null
|
||||
active1 = null
|
||||
active2 = null
|
||||
|
||||
if("Log In")
|
||||
if (istype(usr, /mob/living/silicon/ai))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
src.rank = "AI"
|
||||
src.screen = 1
|
||||
else if (istype(usr, /mob/living/silicon/robot))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
src.rank = "[R.modtype] [R.braintype]"
|
||||
src.screen = 1
|
||||
else if (istype(scan, /obj/item/weapon/card/id))
|
||||
active1 = null
|
||||
active2 = null
|
||||
if(authenticate())
|
||||
authenticated = scan.registered_name
|
||||
rank = scan.assignment
|
||||
screen = 1
|
||||
//RECORD FUNCTIONS
|
||||
if("Search Records")
|
||||
var/t1 = input("Search String: (Partial Name or ID or Fingerprints or Rank)", "Secure. records", null, null) as text
|
||||
world << "input [t1]"
|
||||
if ((!( t1 ) || usr.stat || !( authenticated ) || usr.restrained() || !interactable()))
|
||||
return
|
||||
Perp = new/list()
|
||||
t1 = lowertext(t1)
|
||||
var/list/components = text2list(t1, " ")
|
||||
if(components.len > 5)
|
||||
return //Lets not let them search too greedily.
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
var/temptext = R.fields["name"] + " " + R.fields["id"] + " " + R.fields["fingerprint"] + " " + R.fields["rank"]
|
||||
for(var/i = 1, i<=components.len, i++)
|
||||
if(findtext(temptext,components[i]))
|
||||
var/prelist = new/list(2)
|
||||
prelist[1] = R
|
||||
Perp += prelist
|
||||
for(var/i = 1, i<=Perp.len, i+=2)
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
var/datum/data/record/R = Perp[i]
|
||||
if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]))
|
||||
Perp[i+1] = E
|
||||
tempname = t1
|
||||
screen = 4
|
||||
|
||||
if("Record Maintenance")
|
||||
screen = 2
|
||||
active1 = null
|
||||
active2 = null
|
||||
|
||||
if ("Browse Record")
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/S = locate(href_list["d_rec"])
|
||||
if (!( data_core.general.Find(R) ))
|
||||
temp = "Record Not Found!"
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
S = E
|
||||
active1 = R
|
||||
active2 = S
|
||||
screen = 3
|
||||
|
||||
/* if ("Search Fingerprints")
|
||||
var/t1 = input("Search String: (Fingerprint)", "Secure. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || !( authenticated ) || usr.restrained() || (!interactable()) && (!istype(usr, /mob/living/silicon))))
|
||||
return
|
||||
active1 = null
|
||||
active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
if (lowertext(R.fields["fingerprint"]) == t1)
|
||||
active1 = R
|
||||
if (!( active1 ))
|
||||
temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == active1.fields["name"] || E.fields["id"] == active1.fields["id"]))
|
||||
active2 = E
|
||||
screen = 3 */
|
||||
|
||||
if ("Print Record")
|
||||
if (!( printing ))
|
||||
printing = 1
|
||||
var/datum/data/record/record1 = null
|
||||
var/datum/data/record/record2 = null
|
||||
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
|
||||
record1 = active1
|
||||
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
|
||||
record2 = active2
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
|
||||
if (record1)
|
||||
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
|
||||
P.name = text("Security Record ([])", record1.fields["name"])
|
||||
else
|
||||
P.info += "<B>General Record Lost!</B><BR>"
|
||||
P.name = "Security Record"
|
||||
if (record2)
|
||||
P.info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []<BR>\n<BR>\nMinor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nMajor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["criminal"], record2.fields["mi_crim"], record2.fields["mi_crim_d"], record2.fields["ma_crim"], record2.fields["ma_crim_d"], decode(record2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(record2.fields[text("com_[]", counter)])
|
||||
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
P.info += "<B>Security Record Lost!</B><BR>"
|
||||
P.info += "</TT>"
|
||||
printing = null
|
||||
computer.updateUsrDialog()
|
||||
//RECORD DELETE
|
||||
if ("Delete All Records")
|
||||
temp = ""
|
||||
temp += "Are you sure you wish to delete all Security records?<br>"
|
||||
temp += "<a href='?src=\ref[src];choice=Purge All Records'>Yes</a><br>"
|
||||
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
|
||||
|
||||
if ("Purge All Records")
|
||||
for(var/datum/data/record/R in data_core.security)
|
||||
del(R)
|
||||
temp = "All Security records deleted."
|
||||
|
||||
if ("Add Entry")
|
||||
if (!( istype(active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = active2
|
||||
var/t1 = copytext(sanitize(input("Add Comment:", "Secure. records", null, null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
while(active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
|
||||
|
||||
if ("Delete Record (ALL)")
|
||||
if (active1)
|
||||
temp = "<h5>Are you sure you wish to delete the record (ALL)?</h5>"
|
||||
temp += "<a href='?src=\ref[src];choice=Delete Record (ALL) Execute'>Yes</a><br>"
|
||||
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
|
||||
|
||||
if ("Delete Record (Security)")
|
||||
if (active2)
|
||||
temp = "<h5>Are you sure you wish to delete the record (Security Portion Only)?</h5>"
|
||||
temp += "<a href='?src=\ref[src];choice=Delete Record (Security) Execute'>Yes</a><br>"
|
||||
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
|
||||
|
||||
if ("Delete Entry")
|
||||
if ((istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
//RECORD CREATE
|
||||
if ("New Record (Security)")
|
||||
if ((istype(active1, /datum/data/record) && !( istype(active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record()
|
||||
R.fields["name"] = active1.fields["name"]
|
||||
R.fields["id"] = active1.fields["id"]
|
||||
R.name = text("Security Record #[]", R.fields["id"])
|
||||
R.fields["criminal"] = "None"
|
||||
R.fields["mi_crim"] = "None"
|
||||
R.fields["mi_crim_d"] = "No minor crime convictions."
|
||||
R.fields["ma_crim"] = "None"
|
||||
R.fields["ma_crim_d"] = "No major crime convictions."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.security += R
|
||||
active2 = R
|
||||
screen = 3
|
||||
|
||||
if ("New Record (General)")
|
||||
var/datum/data/record/G = new /datum/data/record()
|
||||
G.fields["name"] = "New Record"
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
G.fields["rank"] = "Unassigned"
|
||||
G.fields["real_rank"] = "Unassigned"
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = "Unknown"
|
||||
G.fields["fingerprint"] = "Unknown"
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
G.fields["species"] = "Human"
|
||||
data_core.general += G
|
||||
active1 = G
|
||||
active2 = null
|
||||
|
||||
//FIELD FUNCTIONS
|
||||
if ("Edit Field")
|
||||
var/a1 = active1
|
||||
var/a2 = active2
|
||||
switch(href_list["field"])
|
||||
if("name")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text
|
||||
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
|
||||
return
|
||||
active1.fields["name"] = t1
|
||||
if("id")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["id"] = t1
|
||||
if("fingerprint")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if (istype(active1, /datum/data/record))
|
||||
if (active1.fields["sex"] == "Male")
|
||||
active1.fields["sex"] = "Female"
|
||||
else
|
||||
active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["age"] = t1
|
||||
if("mi_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["mi_crim"] = t1
|
||||
if("mi_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["mi_crim_d"] = t1
|
||||
if("ma_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["ma_crim"] = t1
|
||||
if("ma_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["ma_crim_d"] = t1
|
||||
if("notes")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(html_encode(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["notes"] = t1
|
||||
if("criminal")
|
||||
if (istype(active2, /datum/data/record))
|
||||
temp = "<h5>Criminal Status:</h5>"
|
||||
temp += "<ul>"
|
||||
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=none'>None</a></li>"
|
||||
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=arrest'>*Arrest*</a></li>"
|
||||
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=incarcerated'>Incarcerated</a></li>"
|
||||
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=parolled'>Parolled</a></li>"
|
||||
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=released'>Released</a></li>"
|
||||
temp += "</ul>"
|
||||
if("rank")
|
||||
var/list/L = list( "Head of Personnel", "Captain", "AI" )
|
||||
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
|
||||
if ((istype(active1, /datum/data/record) && L.Find(rank)))
|
||||
temp = "<h5>Rank:</h5>"
|
||||
temp += "<ul>"
|
||||
for(var/rank in joblist)
|
||||
temp += "<li><a href='?src=\ref[src];choice=Change Rank;rank=[rank]'>[rank]</a></li>"
|
||||
temp += "</ul>"
|
||||
else
|
||||
alert(usr, "You do not have the required rank to do this!")
|
||||
if("species")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = copytext(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["species"] = t1
|
||||
|
||||
//TEMPORARY MENU FUNCTIONS
|
||||
else//To properly clear as per clear screen.
|
||||
temp=null
|
||||
switch(href_list["choice"])
|
||||
if ("Change Rank")
|
||||
if (active1)
|
||||
active1.fields["rank"] = href_list["rank"]
|
||||
if(href_list["rank"] in joblist)
|
||||
active1.fields["real_rank"] = href_list["real_rank"]
|
||||
|
||||
if ("Change Criminal Status")
|
||||
if (active2)
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
H.hud_updateflag |= 1 << WANTED_HUD
|
||||
switch(href_list["criminal2"])
|
||||
if("none")
|
||||
active2.fields["criminal"] = "None"
|
||||
if("arrest")
|
||||
active2.fields["criminal"] = "*Arrest*"
|
||||
if("incarcerated")
|
||||
active2.fields["criminal"] = "Incarcerated"
|
||||
if("parolled")
|
||||
active2.fields["criminal"] = "Parolled"
|
||||
if("released")
|
||||
active2.fields["criminal"] = "Released"
|
||||
|
||||
if ("Delete Record (Security) Execute")
|
||||
if (active2)
|
||||
del(active2)
|
||||
|
||||
if ("Delete Record (ALL) Execute")
|
||||
if (active1)
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
|
||||
del(R)
|
||||
else
|
||||
del(active1)
|
||||
if (active2)
|
||||
del(active2)
|
||||
else
|
||||
temp = "This function does not appear to be working at the moment. Our apologies."
|
||||
|
||||
//computer.updateUsrDialog()
|
||||
interact()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/secure_data/emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
for(var/datum/data/record/R in data_core.security)
|
||||
if(prob(10/severity))
|
||||
switch(rand(1,6))
|
||||
if(1)
|
||||
R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]"
|
||||
if(2)
|
||||
R.fields["sex"] = pick("Male", "Female")
|
||||
if(3)
|
||||
R.fields["age"] = rand(5, 85)
|
||||
if(4)
|
||||
R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released")
|
||||
if(5)
|
||||
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
|
||||
if(6)
|
||||
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
|
||||
continue
|
||||
|
||||
else if(prob(1))
|
||||
del(R)
|
||||
continue
|
||||
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/computer3/secure_data/detective_computer
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "messyfiles"
|
||||
75
code/WorkInProgress/computer3/computers/shuttle.dm
Normal file
75
code/WorkInProgress/computer3/computers/shuttle.dm
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
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)
|
||||
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
|
||||
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
|
||||
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
|
||||
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")
|
||||
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")
|
||||
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
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
|
||||
if("Abort")
|
||||
world << "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>"
|
||||
src.authorized.len = 0
|
||||
src.authorized = list( )
|
||||
|
||||
else if (istype(W, /obj/item/card/emag) && !emagged)
|
||||
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
|
||||
|
||||
if(!emagged && emergency_shuttle.location == 1 && user.get_active_hand() == W)
|
||||
switch(choice)
|
||||
if("Launch")
|
||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||
emergency_shuttle.settimeleft( 10 )
|
||||
emagged = 1
|
||||
if("Cancel")
|
||||
return
|
||||
return
|
||||
246
code/WorkInProgress/computer3/computers/specops_shuttle.dm
Normal file
246
code/WorkInProgress/computer3/computers/specops_shuttle.dm
Normal file
@@ -0,0 +1,246 @@
|
||||
//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())
|
||||
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
|
||||
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)
|
||||
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)
|
||||
if(istype(I,/obj/item/card/emag))
|
||||
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))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
|
||||
if (sent_strike_team == 0)
|
||||
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
|
||||
|
||||
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())
|
||||
usr << "\red The Special Operations shuttle is unable to leave."
|
||||
return
|
||||
|
||||
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
|
||||
114
code/WorkInProgress/computer3/computers/station_alert.dm
Normal file
114
code/WorkInProgress/computer3/computers/station_alert.dm
Normal file
@@ -0,0 +1,114 @@
|
||||
|
||||
/obj/machinery/computer3/station_alert
|
||||
name = "Station Alert Console"
|
||||
desc = "Used to access the station's automated alert system."
|
||||
icon_state = "alert:0"
|
||||
circuit = "/obj/item/part/board/circuit/stationalert"
|
||||
var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list())
|
||||
|
||||
|
||||
attack_ai(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
return
|
||||
|
||||
|
||||
attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
return
|
||||
|
||||
|
||||
interact(mob/user)
|
||||
usr.set_machine(src)
|
||||
var/dat = ""
|
||||
for (var/cat in src.alarms)
|
||||
dat += text("<h2>[]</h2>", cat)
|
||||
var/list/L = src.alarms[cat]
|
||||
if (L.len)
|
||||
for (var/alarm in L)
|
||||
var/list/alm = L[alarm]
|
||||
var/area/A = alm[1]
|
||||
var/list/sources = alm[3]
|
||||
dat += "<NOBR>"
|
||||
dat += "• "
|
||||
dat += "[format_text(A.name)]"
|
||||
if (sources.len > 1)
|
||||
dat += text(" - [] sources", sources.len)
|
||||
dat += "</NOBR><BR>\n"
|
||||
else
|
||||
dat += "-- All Systems Nominal<BR>\n"
|
||||
dat += "<BR>\n"
|
||||
//user << browse(dat, "window=alerts")
|
||||
//onclose(user, "alerts")
|
||||
var/datum/browser/popup = new(user, "alerts", "Current Station Alerts")
|
||||
popup.add_head_content("<META HTTP-EQUIV='Refresh' CONTENT='10'>")
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = src.alarms[class]
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(alarmsource in sources))
|
||||
sources += alarmsource
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if (O && istype(O, /list))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if (O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
return 1
|
||||
|
||||
|
||||
proc/cancelAlarm(var/class, area/A as area, obj/origin)
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = src.alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
return !cleared
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "atmos0"
|
||||
return
|
||||
var/active_alarms = 0
|
||||
for (var/cat in src.alarms)
|
||||
var/list/L = src.alarms[cat]
|
||||
if(L.len) active_alarms = 1
|
||||
if(active_alarms)
|
||||
icon_state = "alert:2"
|
||||
else
|
||||
icon_state = "alert:0"
|
||||
..()
|
||||
return
|
||||
103
code/WorkInProgress/computer3/computers/syndicate_shuttle.dm
Normal file
103
code/WorkInProgress/computer3/computers/syndicate_shuttle.dm
Normal file
@@ -0,0 +1,103 @@
|
||||
#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)
|
||||
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))
|
||||
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
|
||||
@@ -0,0 +1,259 @@
|
||||
//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())
|
||||
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
|
||||
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)
|
||||
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)
|
||||
if(istype(I,/obj/item/card/emag))
|
||||
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))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
|
||||
// if (sent_syndicate_strike_team == 0)
|
||||
// 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
|
||||
|
||||
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())
|
||||
usr << "\red The Syndicate Elite shuttle is unable to leave."
|
||||
return
|
||||
|
||||
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