From fb88011dcd88aead4b31610bde1e70db6f8fbcd4 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Sun, 26 Feb 2017 05:53:11 -0800 Subject: [PATCH] Robots can now work with firelocks again --- code/game/machinery/doors/door.dm | 6 ++-- code/game/machinery/doors/firedoor.dm | 50 ++++++++++++++++----------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index fe0d1a37b47..e1532051632 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -118,8 +118,8 @@ /obj/machinery/door/attack_ghost(mob/user) if(user.can_advanced_admin_interact()) - return attack_hand(user) - + return attack_hand(user) + /obj/machinery/door/attack_hand(mob/user) return attackby(user, user) @@ -132,7 +132,7 @@ if(istype(I, /obj/item/device/detective_scanner)) return - if(operating || isrobot(user)) + if(operating || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them. add_fingerprint(user) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index c9538303490..052f0a99bea 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -23,7 +23,7 @@ var/can_force = TRUE var/force_open_time = 300 var/can_crush = TRUE - var/assembly_type = /obj/structure/firelock_frame + var/assembly_type = /obj/structure/firelock_frame var/nextstate = null var/welded = FALSE var/boltslocked = TRUE @@ -31,9 +31,9 @@ var/active_alarm = FALSE /obj/machinery/door/firedoor/Bumped(atom/AM) - if(p_open || operating) + if(p_open || operating) return - if(!density) + if(!density) return ..() return 0 @@ -86,27 +86,27 @@ if(istype(C, /obj/item/weapon/crowbar) || istype(C, /obj/item/weapon/twohanded/fireaxe)) if(istype(C, /obj/item/weapon/twohanded/fireaxe)) - var/obj/item/weapon/twohanded/fireaxe/F = C + var/obj/item/weapon/twohanded/fireaxe/F = C if(!F.wielded) return user.visible_message("[user] forces \the [src] with [C].", - "You force \the [src] with [C].") + "You force \the [src] with [C].") if(density) autoclose = TRUE open() else close() -/obj/machinery/door/firedoor/attack_hand(mob/user) +/obj/machinery/door/firedoor/attack_hand(mob/user) if(operating || !density) return add_fingerprint(user) - + if(can_force && (!glass || user.a_intent != I_HELP)) user.visible_message("[user] begins forcing \the [src].", \ - "You begin forcing \the [src].") + "You begin forcing \the [src].") if(do_after(user, force_open_time, target = src)) user.visible_message("[user] forces \the [src].", \ "You force \the [src].") @@ -116,14 +116,14 @@ user.changeNext_move(CLICK_CD_MELEE) user.visible_message("[user] bangs on \the [src].", "You bang on \the [src].") - playsound(get_turf(src), 'sound/effects/Glassknock.ogg', 10, 1) + playsound(get_turf(src), 'sound/effects/Glassknock.ogg', 10, 1) /obj/machinery/door/firedoor/attack_ai(mob/user) - attack_hand(user) - + forcetoggle() + /obj/machinery/door/firedoor/attack_ghost(mob/user) if(user.can_advanced_admin_interact()) - attack_hand(user) + forcetoggle(TRUE) /obj/machinery/door/firedoor/attack_alien(mob/user) add_fingerprint(user) @@ -151,11 +151,11 @@ icon_state = "door_open" if(welded) overlays += "welded_open" - + /obj/machinery/door/firedoor/proc/activate_alarm() active_alarm = TRUE update_icon() - + /obj/machinery/door/firedoor/proc/deactivate_alarm() active_alarm = FALSE update_icon() @@ -169,7 +169,7 @@ if(can_crush) crush() latetoggle() - + /obj/machinery/door/firedoor/autoclose() if(active_alarm) . = ..() @@ -184,7 +184,15 @@ if(CLOSED) nextstate = null close() - + +/obj/machinery/door/firedoor/proc/forcetoggle(magic = FALSE) + if(!magic && (operating || stat & NOPOWER)) + return + if(density) + open() + else + close() + /obj/machinery/door/firedoor/proc/deconstruct(disassembled = TRUE) if(can_deconstruct) var/obj/structure/firelock_frame/F = new assembly_type(get_turf(src)) @@ -194,8 +202,8 @@ F.constructionStep = CONSTRUCTION_WIRES_EXPOSED F.update_icon() qdel(src) - -/obj/machinery/door/firedoor/border_only + +/obj/machinery/door/firedoor/border_only icon = 'icons/obj/doors/edge_Doorfire.dmi' flags = ON_BORDER can_crush = FALSE @@ -229,7 +237,7 @@ opacity = 1 assembly_type = /obj/structure/firelock_frame/heavy can_force = FALSE - + /obj/machinery/door/firedoor/heavy/ex_act(severity) switch(severity) if(1.0) @@ -252,7 +260,7 @@ density = 1 var/constructionStep = CONSTRUCTION_NOCIRCUIT var/reinforced = 0 - + /obj/structure/firelock_frame/heavy name = "heavy firelock frame" reinforced = 1 @@ -435,4 +443,4 @@ constructionStep = CONSTRUCTION_GUTTED update_icon() return - return ..() \ No newline at end of file + return ..()