From 919c23d146d0d8baffcbcf187d9bda0092bf256f Mon Sep 17 00:00:00 2001 From: Atlantis Date: Fri, 29 May 2015 11:42:46 +0200 Subject: [PATCH] Adjustments - Implements AI Control for floodlights - Adds \the suggestion from github --- code/game/machinery/floodlight.dm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index abf2dc4875..f72c231f95 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -51,7 +51,7 @@ set_light(brightness_on, brightness_on / 2) update_icon() if(loud) - visible_message("\the [src] turns on.") + visible_message("\The [src] turns on.") return 1 /obj/machinery/floodlight/proc/turn_off(var/loud = 0) @@ -59,7 +59,17 @@ set_light(0, 0) update_icon() if(loud) - visible_message("\the [src] shuts down.") + visible_message("\The [src] shuts down.") + +/obj/machinery/floodlight/attack_ai(mob/user as mob) + if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) + return attack_hand(user) + + if(on) + turn_off(1) + else + if(!turn_on(1)) + user << "You try to turn on \the [src] but it does not work." /obj/machinery/floodlight/attack_hand(mob/user as mob)