Emag refactor

This commit is contained in:
Markolie
2015-02-13 16:59:20 +01:00
parent e7713a4662
commit 0b937d5ace
60 changed files with 569 additions and 649 deletions
+9 -9
View File
@@ -85,6 +85,15 @@
var/dualslot = 0 // faster than typechecking
attackby_types = list(/obj/item/weapon/card)
emag_act(user as mob)
if(!writer)
usr << "You insert \the card, and the computer grinds, sparks, and beeps. After a moment, the card ejects itself."
computer.emagged = 1
return 1
else
usr << "You are unable to insert \the card, as the reader slot is occupied"
return 0
attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I,/obj/item/weapon/card))
insert(I)
@@ -102,14 +111,6 @@
usr << "This device has only one card slot"
return 0
if(istype(card,/obj/item/weapon/card/emag)) // emag reader slot
if(!writer)
usr << "You insert \the [card], and the computer grinds, sparks, and beeps. After a moment, the card ejects itself."
computer.emagged = 1
return 1
else
usr << "You are unable to insert \the [card], as the reader slot is occupied"
var/mob/living/L = usr
switch(slot)
if(1)
@@ -132,7 +133,6 @@
else
usr << "There is already something in the reader slot."
// Usage of insert() preferred, as it also tells result to the user.
proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
if(!reader)
@@ -68,9 +68,7 @@
authenticated = 1
if(access_captain in I.GetAccess())
authenticated = 2
if(istype(I,/obj/item/weapon/card/emag))
authenticated = 2
computer.emagged = 1
if("logout" in href_list)
authenticated = 0
+5 -4
View File
@@ -60,11 +60,13 @@
world << "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>"
src.authorized.len = 0
src.authorized = list( )
else if (istype(W, /obj/item/card/emag) && !emagged)
return
emag_act(user as mob)
if (!emagged)
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
if(!emagged && emergency_shuttle.location == 1 && user.get_active_hand() == W)
if(!emagged && emergency_shuttle.location == 1)
switch(choice)
if("Launch")
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
@@ -72,4 +74,3 @@
emagged = 1
if("Cancel")
return
return