[MIRROR] Borgs synced to an AI using Doomsday will have their lights force-set to red and enabled to at least level 1 (#1659)

* Borgs synced to an AI using Doomsday will have their lights force-set to red and enabled to at least level 1 (#54677)

* Borgs synced to an AI using Doomsday will have their lights force-set to red and enabled to at least level 1

Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-11-11 02:47:11 +00:00
committed by GitHub
co-authored by zxaber
parent 8db24d79e6
commit 63a78950cd
3 changed files with 33 additions and 17 deletions
@@ -45,13 +45,6 @@
/mob/living/silicon/ai/proc/ShutOffDoomsdayDevice()
if(nuking)
set_security_level("red")
nuking = FALSE
for(var/obj/item/pinpointer/nuke/P in GLOB.pinpointer_list)
P.switch_mode_to(TRACK_NUKE_DISK) //Party's over, back to work, everyone
P.alert = FALSE
if(doomsday_device)
doomsday_device.timing = FALSE
SSshuttle.clearHostileEnvironment(doomsday_device)
qdel(doomsday_device)
+12 -4
View File
@@ -84,6 +84,8 @@
var/lamp_enabled = FALSE
///Set lamp color
var/lamp_color = COLOR_WHITE
///Set to true if a doomsday event is locking our lamp to on and RED
var/lamp_doom = FALSE
///Lamp brightness. Starts at 3, but can be 1 - 5.
var/lamp_intensity = 3
///Lamp button reference
@@ -431,9 +433,9 @@
if(stat != DEAD && !(HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || IsStun() || IsParalyzed() || low_power_mode)) //Not dead, not stunned.
if(!eye_lights)
eye_lights = new()
if(lamp_enabled)
if(lamp_enabled || lamp_doom)
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
eye_lights.color = lamp_color
eye_lights.color = lamp_doom? COLOR_RED : lamp_color
eye_lights.plane = 19 //glowy eyes
else
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_e"
@@ -553,13 +555,15 @@
/mob/living/silicon/robot/proc/toggle_headlamp(turn_off = FALSE, update_color = FALSE)
//if both lamp is enabled AND the update_color flag is on, keep the lamp on. Otherwise, if anything listed is true, disable the lamp.
if(!(update_color && lamp_enabled) && (turn_off || lamp_enabled || update_color || !lamp_functional || stat || low_power_mode))
set_light_on(FALSE)
set_light_on(lamp_functional && stat != DEAD && lamp_doom) //If the lamp isn't broken and borg isn't dead, doomsday borgs cannot disable their light fully.
set_light_color(COLOR_RED) //This should only matter for doomsday borgs, as any other time the lamp will be off and the color not seen
set_light_range(1) //Again, like above, this only takes effect when the light is forced on by doomsday mode.
lamp_enabled = FALSE
lampButton.update_icon()
update_icons()
return
set_light_range(lamp_intensity)
set_light_color(lamp_color)
set_light_color(lamp_doom? COLOR_RED : lamp_color) //Red for doomsday killborgs, borg's choice otherwise
set_light_on(TRUE)
lamp_enabled = TRUE
lampButton.update_icon()
@@ -824,6 +828,7 @@
locked = TRUE
notify_ai(NEW_BORG)
. = TRUE
toggle_headlamp(FALSE, TRUE) //This will reenable borg headlamps if doomsday is currently going on still.
/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
..()
@@ -1094,8 +1099,11 @@
if(.)
var/mob/living/silicon/ai/old_ai = .
old_ai.connected_robots -= src
lamp_doom = FALSE
if(connected_ai)
connected_ai.connected_robots |= src
lamp_doom = connected_ai.doomsday_device ? TRUE : FALSE
toggle_headlamp(FALSE, TRUE)
/**
* Records an IC event log entry in the cyborg's internal tablet.