Updates emag attackby usages to emag_act where it's not too much of a headache.

This commit is contained in:
PsiOmegaDelta
2015-06-15 17:17:49 +02:00
parent dea924541c
commit cc7c502fb8
73 changed files with 701 additions and 688 deletions

View File

@@ -145,16 +145,19 @@ won't update every console in existence) but it's more of a hassle to do. Also,
user.drop_item()
D.loc = src
user << "<span class='notice'>You add \the [D] to the machine.</span>"
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
emagged = 1
user << "<span class='notice'>You you disable the security protocols.</span>"
else
//The construction/deconstruction of the console code.
..()
src.updateUsrDialog()
return
/obj/machinery/computer/rdconsole/emp_act(var/remaining_charges, var/mob/user)
if(!emagged)
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
emagged = 1
user << "<span class='notice'>You you disable the security protocols.</span>"
return 1
/obj/machinery/computer/rdconsole/Topic(href, href_list)
if(..())

View File

@@ -295,13 +295,13 @@
onclose(user, "server_control")
return
/obj/machinery/computer/rdservercontrol/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
if(istype(D, /obj/item/weapon/card/emag) && !emagged)
/obj/machinery/computer/rdservercontrol/emag_act(var/remaining_charges, var/mob/user)
if(!emagged)
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
emagged = 1
user << "\blue You you disable the security protocols"
src.updateUsrDialog()
return ..()
user << "<span class='notice'>You you disable the security protocols.</span>"
src.updateUsrDialog()
return 1
/obj/machinery/r_n_d/server/robotics
name = "Robotics R&D Server"

View File

@@ -131,7 +131,7 @@
usr.drop_item()
I.loc = src
auth_card = I
if(attempt_unlock(I))
if(attempt_unlock(I, usr))
usr << "<span class='info'>You insert [I], the console flashes \'<i>Access granted.</a>\'</span>"
else
usr << "<span class='warning'>You insert [I], the console flashes \'<i>Access denied.</a>\'</span>"
@@ -215,25 +215,27 @@
else if(istype(W, /obj/item/weapon/card))
var/obj/item/weapon/card/I = W
if(!auth_card)
if(attempt_unlock(I))
if(attempt_unlock(I, user))
user << "<span class='info'>You swipe [I], the console flashes \'<i>Access granted.</i>\'</span>"
else
user << "<span class='warning'>You swipe [I], console flashes \'<i>Access denied.</i>\'</span>"
else
user << "<span class='warning'>Remove [auth_card] first.</span>"
/obj/machinery/suspension_gen/proc/attempt_unlock(var/obj/item/weapon/card/C)
/obj/machinery/suspension_gen/proc/attempt_unlock(var/obj/item/weapon/card/C, var/mob/user)
if(!open)
if(istype(C, /obj/item/weapon/card/emag) && cell.charge > 0)
//put sparks here
if(prob(95))
locked = 0
if(istype(C, /obj/item/weapon/card/emag))
C.resolve_attackby(src, user)
else if(istype(C, /obj/item/weapon/card/id) && check_access(C))
locked = 0
if(!locked)
return 1
/obj/machinery/suspension_gen/emag_act(var/remaining_charges, var/mob/user)
if(cell.charge > 0 && locked)
locked = 0
return 1
//checks for whether the machine can be activated or not should already have occurred by this point
/obj/machinery/suspension_gen/proc/activate()
//depending on the field type, we might pickup certain items