diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 13dfa8b8469..a91cdd75268 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -36,6 +36,7 @@ var/opened = 0 var/emagged = 0 + var/emag_cooldown = 0 var/wiresexposed = 0 var/locked = 1 var/list/req_access = list(access_robotics) @@ -578,10 +579,26 @@ user << "The cover is already unlocked!" return if(opened)//Cover is open + if((world.time - 100) < emag_cooldown) + return + + var/ai_is_antag = 0 + if(connected_ai && connected_ai.mind) + if(connected_ai.mind.special_role) + ai_is_antag = (connected_ai.mind.special_role == "malfunction") || (connected_ai.mind.special_role == "traitor") + if(ai_is_antag) + user << "You emag [src]'s interface." + src << "ALERT: Foreign software execution prevented." + connected_ai << "ALERT: Cyborg unit \[[src]] successfuly defended against subversion." + log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] slaved to traitor AI [connected_ai].") + emag_cooldown = world.time + return + if(wiresexposed) user << "You must close the cover first!" return else + emag_cooldown = world.time sleep(6) SetEmagged(1) SetLockdown(1) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown