diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 2dea5689c51..34979d03325 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -297,6 +297,23 @@ so as to remain in compliance with the most up-to-date laws." icon_state = "newlaw" timeout = 300 +/obj/screen/alert/hackingapc + name = "Hacking APC" + desc = "An Area Power Controller is being hacked. When the process is \ + complete, you will have exclusive control of it, and you will gain \ + additional processing time to unlock more malfunction abilities." + icon_state = "hackingapc" + timeout = 600 + var/atom/target = null + +/obj/screen/alert/hackingapc/Click() + if(!usr || !usr.client) return + if(!target) return + var/mob/living/silicon/ai/AI = usr + var/turf/T = get_turf(target) + if(T) + AI.eyeobj.setLoc(T) + //MECHS /obj/screen/alert/low_mech_integrity diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index ce1f045bf28..13aff60e511 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -212,7 +212,6 @@ var/datum/browser/popup = new(user, "microwave", name, 300, 300) popup.set_content(dat) popup.open() - return /*********************************** * Microwave Menu Handling/Cooking @@ -340,4 +339,3 @@ if ("dispose") dispose() updateUsrDialog() - return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 0ef5232ec18..69546fc8e49 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -156,7 +156,9 @@ var/list/ai_list = list() shuttle_caller_list -= src SSshuttle.autoEvac() qdel(eyeobj) // No AI, no Eye - return ..() + malfhack = null + + . = ..() /mob/living/silicon/ai/verb/pick_icon() @@ -319,8 +321,6 @@ var/list/ai_list = list() if(C) C.post_status("shuttle") - return - /mob/living/silicon/ai/cancel_camera() src.view_core() @@ -384,8 +384,6 @@ var/list/ai_list = list() if (stat != DEAD) adjustBruteLoss(30) - return - /mob/living/silicon/ai/Topic(href, href_list) if(usr != src) return @@ -469,7 +467,6 @@ var/list/ai_list = list() return ..() - return /mob/living/silicon/ai/proc/switchCamera(obj/machinery/camera/C) @@ -745,7 +742,6 @@ var/list/ai_list = list() light_cameras() src << "Camera lights activated." - return //AI_CAMERA_LUMINOSITY @@ -897,3 +893,27 @@ var/list/ai_list = list() if(..()) //successfully ressuscitated from death icon_state = "ai" . = 1 + +/mob/living/silicon/ai/proc/malfhacked(obj/machinery/power/apc/apc) + malfhack = null + malfhacking = FALSE + + if(!istype(apc) || qdeleted(apc) || apc.stat & BROKEN) + src << "Hack aborted. The designated APC no longer exists on the \ + power network." + playsound(get_turf(src), 'sound/machines/buzz-two.ogg', 50, 1) + else if(apc.aidisabled) + src << "Hack aborted. \The [apc] is no longer responding \ + to our systems." + playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 50, 1) + else + malf_picker.processing_time += 10 + + apc.malfai = parent || src + apc.malfhack = TRUE + apc.locked = TRUE + + playsound(get_turf(src), 'sound/machines/ding.ogg', 50, 1) + src << "Hack complete. \The [apc] is now under your \ + exclusive control." + apc.update_icon() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2063a91ae68..9c17ba8db9b 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -114,7 +114,7 @@ setDir(SOUTH) if(auto_name) - name = "[get_area(src)] APC" + name = "\improper [get_area(src)] APC" pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24) pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0 @@ -147,7 +147,7 @@ qdel(cell) if(terminal) disconnect_terminal() - return ..() + . = ..() /obj/machinery/power/apc/proc/make_terminal() // create a terminal object at the same position as original turf loc @@ -797,24 +797,11 @@ malf << "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process." malf.malfhack = src malf.malfhacking = TRUE - addtimer(src, "malfhacked", 600, FALSE, malf) + addtimer(malf, "malfhacked", 600, FALSE, src) -/obj/machinery/power/apc/proc/malfhacked(mob/living/silicon/ai/malf) - if(!istype(malf)) - return - malf.malfhack = null - malf.malfhacking = FALSE - if(src && !src.aidisabled) - malf.malf_picker.processing_time += 10 - - malfai = malf.parent || malf - malfhack = TRUE - locked = TRUE - - malf << "Hack complete. The APC is now under your exclusive control." - update_icon() - else - malf << "Hack aborted. The designated APC has stopped responding and no longer exists on the power network." + var/obj/screen/alert/hackingapc/A + A = malf.throw_alert("hackingapc", /obj/screen/alert/hackingapc) + A.target = src /obj/machinery/power/apc/proc/malfoccupy(mob/living/silicon/ai/malf) if(!istype(malf)) diff --git a/icons/mob/screen_alert.dmi b/icons/mob/screen_alert.dmi index bbfc87049aa..4998f8638b2 100644 Binary files a/icons/mob/screen_alert.dmi and b/icons/mob/screen_alert.dmi differ