Merge pull request #13051 from kingofkosmos/enableidtopdaonfloor

ID into PDA without PDA in your inventory and a few other similar things
This commit is contained in:
Aranclanos
2015-11-23 20:27:07 -03:00
4 changed files with 12 additions and 37 deletions
+10 -27
View File
@@ -233,14 +233,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/proc/update_label()
name = "PDA-[owner] ([ownjob])" //Name generalisation
/obj/item/device/pda/proc/can_use(mob/user)
if(user && ismob(user))
if(user.incapacitated())
return 0
if(loc == user)
return 1
return 0
/obj/item/device/pda/GetAccess()
if(id)
return id.GetAccess()
@@ -252,7 +244,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/MouseDrop(obj/over_object, src_location, over_location)
var/mob/M = usr
if((!istype(over_object, /obj/screen)) && can_use(M))
if((!istype(over_object, /obj/screen)) && usr.canUseTopic(src))
return attack_self(M)
return
@@ -450,9 +442,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
..()
var/mob/living/U = usr
//Looking for master was kind of pointless since PDAs don't appear to have one.
//if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) )
if(can_use(U)) //Why reinvent the wheel? There's a proc that does exactly that.
if(usr.canUseTopic(src))
add_fingerprint(U)
U.set_machine(src)
@@ -710,7 +701,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
return
if (!in_range(src, U) && loc != U)
return
if(!can_use(U))
if(!U.canUseTopic(src))
return
if(emped)
t = Gibberish(t, 100)
@@ -794,13 +785,11 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(issilicon(usr))
return
if(can_use(usr))
if(usr.canUseTopic(src))
if(id)
remove_id()
else
usr << "<span class='warning'>This PDA does not have an ID in it!</span>"
else
usr << "<span class='warning'>You cannot do that while restrained!</span>"
/obj/item/device/pda/verb/verb_remove_id()
set category = "Object"
@@ -810,14 +799,11 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(issilicon(usr))
return
if ( can_use(usr) )
if (usr.canUseTopic(src))
if(id)
remove_id()
else
usr << "<span class='warning'>This PDA does not have an ID in it!</span>"
else
usr << "<span class='warning'>You cannot do that while restrained!</span>"
/obj/item/device/pda/verb/verb_remove_pen()
set category = "Object"
@@ -827,7 +813,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(issilicon(usr))
return
if ( can_use(usr) )
if (usr.canUseTopic(src))
var/obj/item/weapon/pen/O = locate() in src
if(O)
if (istype(loc, /mob))
@@ -839,8 +825,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
O.loc = get_turf(src)
else
usr << "<span class='warning'>This PDA does not have a pen in it!</span>"
else
usr << "<span class='warning'>You cannot do that while restrained!</span>"
/obj/item/device/pda/proc/id_check(mob/user, choice as num)//To check for IDs; 1 for in-pda use, 2 for out of pda use.
if(choice == 1)
@@ -889,11 +873,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
else
//Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand.
if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) )
if( can_use(user) )//If they can still act.
if(!id_check(user, 2))
return
user << "<span class='notice'>You put the ID into \the [src]'s slot.</span>"
updateSelfDialog()//Update self dialog on success.
if(!id_check(user, 2))
return
user << "<span class='notice'>You put the ID into \the [src]'s slot.</span>"
updateSelfDialog()//Update self dialog on success.
return //Return in case of failed check or when successful.
updateSelfDialog()//For the non-input related code.
else if(istype(C, /obj/item/device/paicard) && !src.pai)
-6
View File
@@ -260,9 +260,6 @@
var/obj/item/device/flashlight/seclite/S = A
if(can_flashlight)
if(!F)
if(user.l_hand != src && user.r_hand != src)
user << "<span class='warning'>You'll need [src] in your hands to do that!</span>"
return
if(!user.unEquip(A))
return
user << "<span class='notice'>You click [S] into place on [src].</span>"
@@ -276,9 +273,6 @@
if(istype(A, /obj/item/weapon/screwdriver))
if(F)
if(user.l_hand != src && user.r_hand != src)
user << "<span class='warning'>You'll need [src] in your hands to do that!</span>"
return
for(var/obj/item/device/flashlight/seclite/S in src)
user << "<span class='notice'>You unscrew the seclite from [src].</span>"
F = null
+1 -4
View File
@@ -65,9 +65,6 @@
var/obj/item/weapon/suppressor/S = A
if(can_suppress)
if(!suppressed)
if(user.l_hand != src && user.r_hand != src)
user << "<span class='notice'>You'll need [src] in your hands to do that.</span>"
return
if(!user.unEquip(A))
return
user << "<span class='notice'>You screw [S] onto [src].</span>"
@@ -157,4 +154,4 @@
icon_state = "suppressor"
w_class = 2
var/oldsound = null
var/initial_w_class = null
var/initial_w_class = null
+1
View File
@@ -8,6 +8,7 @@
# NOTE: syntax was changed to allow hyphenation of ranknames, since spaces are stripped. #
###############################################################################################
Optimumtact = Host
kingofkosmos = Game Master
MrStonedOne = Game Master
microscopics = Game Master
Gun Hog = Game Master