mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-13 10:23:15 +00:00
Conflicts: code/ATMOSPHERICS/components/unary_devices/cryo.dm code/_onclick/hud/alert.dm code/_onclick/hud/hud.dm code/datums/mutations.dm code/datums/wires/robot.dm code/game/atoms.dm code/game/gamemodes/blob/overmind.dm code/game/machinery/alarm.dm code/game/machinery/machinery.dm code/game/machinery/suit_storage_unit.dm code/game/objects/items/weapons/tanks/tanks.dm code/game/objects/items/weapons/tools.dm code/game/objects/structures/morgue.dm code/modules/admin/verbs/adminjump.dm code/modules/atmospherics/machinery/atmosmachinery.dm code/modules/mob/inventory.dm code/modules/mob/living/carbon/alien/humanoid/death.dm code/modules/mob/living/carbon/alien/larva/death.dm code/modules/mob/living/carbon/brain/death.dm code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/human/death.dm code/modules/mob/living/carbon/human/human.dm code/modules/mob/living/carbon/human/human_damage.dm code/modules/mob/living/carbon/human/life.dm code/modules/mob/living/carbon/human/species.dm code/modules/mob/living/carbon/human/species_types.dm code/modules/mob/living/carbon/life.dm code/modules/mob/living/carbon/monkey/death.dm code/modules/mob/living/life.dm code/modules/mob/living/living.dm code/modules/mob/living/silicon/ai/ai.dm code/modules/mob/living/silicon/ai/death.dm code/modules/mob/living/silicon/ai/life.dm code/modules/mob/living/silicon/pai/death.dm code/modules/mob/living/silicon/pai/pai.dm code/modules/mob/living/silicon/robot/death.dm code/modules/mob/living/silicon/robot/life.dm code/modules/mob/living/silicon/robot/robot.dm code/modules/mob/living/silicon/silicon.dm code/modules/mob/living/simple_animal/guardian/guardian.dm code/modules/mob/login.dm code/modules/mob/mob.dm code/modules/projectiles/gun.dm code/modules/reagents/chemistry/reagents/blob_reagents.dm tgstation.dme
67 lines
2.2 KiB
Plaintext
67 lines
2.2 KiB
Plaintext
/datum/wires/robot
|
|
holder_type = /mob/living/silicon/robot
|
|
randomize = TRUE
|
|
|
|
/datum/wires/robot/New(atom/holder)
|
|
wires = list(
|
|
WIRE_AI, WIRE_CAMERA,
|
|
WIRE_LAWSYNC, WIRE_LOCKDOWN
|
|
)
|
|
add_duds(2)
|
|
..()
|
|
|
|
/datum/wires/robot/interactable(mob/user)
|
|
var/mob/living/silicon/robot/R = holder
|
|
if(R.wiresexposed)
|
|
return TRUE
|
|
|
|
/datum/wires/robot/get_status()
|
|
var/mob/living/silicon/robot/R = holder
|
|
var/list/status = list()
|
|
status += "The law sync module is [R.lawupdate ? "on" : "off"]."
|
|
status += "The intelligence link display shows [R.connected_ai ? R.connected_ai.name : "NULL"]."
|
|
status += "The camera light is [!isnull(R.camera) && R.camera.status ? "on" : "off"]."
|
|
status += "The lockdown indicator is [R.lockcharge ? "on" : "off"]."
|
|
return status
|
|
|
|
/datum/wires/robot/on_pulse(wire)
|
|
var/mob/living/silicon/robot/R = holder
|
|
switch(wire)
|
|
if(WIRE_AI) // Pulse to pick a new AI.
|
|
if(!R.emagged)
|
|
var/new_ai = select_active_ai(R)
|
|
if(new_ai && (new_ai != R.connected_ai))
|
|
R.connected_ai = new_ai
|
|
R.notify_ai(TRUE)
|
|
if(WIRE_CAMERA) // Pulse to disable the camera.
|
|
if(!isnull(R.camera) && !R.scrambledcodes)
|
|
R.camera.toggle_cam(usr, 0)
|
|
R.visible_message("[R]'s camera lense focuses loudly.", "Your camera lense focuses loudly.")
|
|
if(WIRE_LAWSYNC) // Forces a law update if possible.
|
|
if(R.lawupdate)
|
|
R.visible_message("[R] gently chimes.", "LawSync protocol engaged.")
|
|
R.lawsync()
|
|
R.show_laws()
|
|
if(WIRE_LOCKDOWN)
|
|
R.SetLockdown(!R.lockcharge) // Toggle
|
|
|
|
/datum/wires/robot/on_cut(wire, mend)
|
|
var/mob/living/silicon/robot/R = holder
|
|
switch(wire)
|
|
if(WIRE_AI) // Cut the AI wire to reset AI control.
|
|
if(!mend)
|
|
R.connected_ai = null
|
|
if(WIRE_LAWSYNC) // Cut the law wire, and the borg will no longer receive law updates from its AI. Repair and it will re-sync.
|
|
if(mend)
|
|
if(!R.emagged)
|
|
R.lawupdate = TRUE
|
|
else
|
|
R.lawupdate = FALSE
|
|
if (WIRE_CAMERA) // Disable the camera.
|
|
if(!isnull(R.camera) && !R.scrambledcodes)
|
|
R.camera.status = mend
|
|
R.camera.toggle_cam(usr, 0)
|
|
R.visible_message("[R]'s camera lense focuses loudly.", "Your camera lense focuses loudly.")
|
|
if(WIRE_LOCKDOWN) // Simple lockdown.
|
|
R.SetLockdown(!mend)
|