From 1a93d052750384cd2c38e8a6c20123063e0efabc Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Sun, 19 May 2019 20:04:26 +0200 Subject: [PATCH] Gamma borgs are now reset when security level is dropped below Gamma --- .../objects/items/robot/robot_upgrades.dm | 26 ++---------------- .../modules/mob/living/silicon/robot/robot.dm | 27 ++++++++++++++++++- .../security_levels/security levels.dm | 21 +++++++-------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 0b9f6c3aca9..a13bce6fb61 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -31,31 +31,9 @@ if(..()) return - R.notify_ai(2) + R.reset_module() - R.uneq_all() - R.sight_mode = null - R.hands.icon_state = "nomod" - R.icon_state = "robot" - R.module.remove_subsystems_and_actions(R) - QDEL_NULL(R.module) - - R.camera.network.Remove(list("Engineering", "Medical", "Mining Outpost")) - R.rename_character(R.real_name, R.get_default_name("Default")) - R.languages = list() - R.speech_synthesizer_langs = list() - - R.update_icons() - R.update_headlamp() - - R.speed = 0 // Remove upgrades. - R.ionpulse = 0 - R.magpulse = 0 - R.add_language("Robot Talk", 1) - - R.status_flags |= CANPUSH - - return 1 + return TRUE /obj/item/borg/upgrade/rename name = "cyborg reclassification board" diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index da793b2f3d3..d716c397111 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -287,7 +287,7 @@ var/list/robot_verbs_default = list( if(islist(force_modules) && force_modules.len) modules = force_modules.Copy() if(security_level == (SEC_LEVEL_GAMMA || SEC_LEVEL_EPSILON) || crisis) - to_chat(src, "Crisis mode active. Combat module available.") + to_chat(src, "Crisis mode active. The combat module is now available.") modules += "Combat" if(mmi != null && mmi.alien) modules = list("Hunter") @@ -415,6 +415,31 @@ var/list/robot_verbs_default = list( radio.config(module.channels) notify_ai(2) +/mob/living/silicon/robot/proc/reset_module() + notify_ai(2) + + uneq_all() + sight_mode = null + hands.icon_state = "nomod" + icon_state = "robot" + module.remove_subsystems_and_actions(src) + QDEL_NULL(module) + + camera.network.Remove(list("Engineering", "Medical", "Mining Outpost")) + rename_character(real_name, get_default_name("Default")) + languages = list() + speech_synthesizer_langs = list() + + update_icons() + update_headlamp() + + speed = 0 // Remove upgrades. + ionpulse = FALSE + magpulse = FALSE + add_language("Robot Talk", 1) + + status_flags |= CANPUSH + //for borg hotkeys, here module refers to borg inv slot, not core module /mob/living/silicon/robot/verb/cmd_toggle_module(module as num) set name = "Toggle Module" diff --git a/code/modules/security_levels/security levels.dm b/code/modules/security_levels/security levels.dm index 050326891fb..c24874cb39e 100644 --- a/code/modules/security_levels/security levels.dm +++ b/code/modules/security_levels/security levels.dm @@ -31,6 +31,15 @@ // Mark down this time to prevent shuttle cheese SSshuttle.emergency_sec_level_time = world.time + // Reset gamma borgs if the new security level is lower than Gamma. + if(level < SEC_LEVEL_GAMMA) + for(var/M in GLOB.silicon_mob_list) + if(isrobot(M)) + var/mob/living/silicon/robot/R = M + if(istype(R.module, /obj/item/robot_module/combat)) + R.reset_module() + to_chat(R, "Crisis mode deactivated. The combat module is no longer available and your module has been reset.") + switch(level) if(SEC_LEVEL_GREEN) security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.") @@ -176,15 +185,3 @@ return SEC_LEVEL_EPSILON if("delta") return SEC_LEVEL_DELTA - - -/*DEBUG -/mob/verb/set_thing0() - set_security_level(0) -/mob/verb/set_thing1() - set_security_level(1) -/mob/verb/set_thing2() - set_security_level(2) -/mob/verb/set_thing3() - set_security_level(3) -*/