mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user