From 27125b9df48dd2b5d25e842f86af4bb43f6f5f38 Mon Sep 17 00:00:00 2001 From: Werner Date: Tue, 7 May 2019 20:16:42 +0200 Subject: [PATCH] Borg Upgrades (#6395) --- .../mob/living/silicon/robot/drone/drone.dm | 2 + code/modules/mob/living/silicon/robot/life.dm | 13 ++++++ .../modules/mob/living/silicon/robot/robot.dm | 8 +++- html/changelogs/arrow768-anti-borg-theft.yml | 41 +++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/arrow768-anti-borg-theft.yml diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index e7d231c8cf4..5910a11b45e 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -249,6 +249,8 @@ return 1 //DRONE LIFE/DEATH +/mob/living/silicon/robot/drone/process_level_restrictions() + return //For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here. /mob/living/silicon/robot/drone/updatehealth() diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index a50bb171d9f..b6c39f95c5b 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -19,6 +19,7 @@ process_killswitch() process_locks() process_queued_alarms() + process_level_restrictions() update_canmove() /mob/living/silicon/robot/proc/clamp_values() @@ -332,6 +333,18 @@ else canmove = 1 return canmove +/mob/living/silicon/robot/proc/process_level_restrictions() + //If they are on a player level -> abort + if (src.z in current_map.player_levels) + return + //If they are on centcom -> abort + if (istype(get_area(src), /area/centcom) || istype(get_area(src), /area/shuttle/escape) || istype(get_area(src), /area/shuttle/arrival)) + return + //Make sure they should not get blown + if (lockcharge || scrambledcodes || emagged) + return + self_destruct(TRUE) + /mob/living/silicon/robot/update_fire() cut_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")) if(on_fire) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 59c75590345..b3bd95cba24 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1016,8 +1016,12 @@ to_chat(cleaned_human, "[src] cleans your face!") return -/mob/living/silicon/robot/proc/self_destruct() - say("WARNING: Self-destruct initiated. Unit [src] will self destruct in five seconds.") +/mob/living/silicon/robot/proc/self_destruct(var/anti_theft=FALSE) + if(anti_theft) + say("WARNING: Removal from NanoTrasen property detected. Anti-Theft mode activated. Unit [src] will self destruct in five seconds.") + to_chat(src,"All databases containing information related to NanoTrasen have been wiped!") + else + say("WARNING: Self-destruct initiated. Unit [src] will self destruct in five seconds.") lockcharge = 1 update_canmove() sleep(20) diff --git a/html/changelogs/arrow768-anti-borg-theft.yml b/html/changelogs/arrow768-anti-borg-theft.yml new file mode 100644 index 00000000000..1872795691c --- /dev/null +++ b/html/changelogs/arrow768-anti-borg-theft.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Arrow768 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Borgs now have a anti-theft mode."