From 62987c071608744864a8930a3169caff7b89841d Mon Sep 17 00:00:00 2001 From: kingofkosmos Date: Mon, 16 Nov 2015 20:41:11 +0200 Subject: [PATCH 1/4] Enables putting an ID into a PDA when the PDA not in your inventory. --- code/game/objects/items/devices/PDA/PDA.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index d7384c6b6d1..4b8ab2ecde3 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -237,7 +237,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if(user && ismob(user)) if(user.incapacitated()) return 0 - if(loc == user) + else return 1 return 0 From 38e542083209a32f49626061418cedc9317f083f Mon Sep 17 00:00:00 2001 From: kingofkosmos Date: Tue, 17 Nov 2015 21:26:42 +0200 Subject: [PATCH 2/4] Removes can_use -proc from PDA.dm and replaces all instances of it with canUseTopic. Adds kingofkosmos to admins.txt --- code/game/objects/items/devices/PDA/PDA.dm | 27 ++++++++-------------- config/admins.txt | 1 + 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 4b8ab2ecde3..1039c7f2b5f 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -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 - else - 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,15 @@ 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 << "This PDA does not have an ID in it!" - else + if (usr.restrained()) usr << "You cannot do that while restrained!" + else + return /obj/item/device/pda/verb/verb_remove_id() set category = "Object" @@ -810,7 +803,7 @@ 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 @@ -827,7 +820,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)) @@ -889,7 +882,7 @@ 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(user.canUseTopic(src))//If they can still act. if(!id_check(user, 2)) return user << "You put the ID into \the [src]'s slot." diff --git a/config/admins.txt b/config/admins.txt index 89985b5b835..cb269cfc531 100644 --- a/config/admins.txt +++ b/config/admins.txt @@ -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 From a121b9308c1ecf26d27c09395edcf18235f7b343 Mon Sep 17 00:00:00 2001 From: kingofkosmos Date: Wed, 18 Nov 2015 06:08:31 +0200 Subject: [PATCH 3/4] Removes unneeded restrained-warnings and one canUseTopic-check. --- code/game/objects/items/devices/PDA/PDA.dm | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 1039c7f2b5f..5ec2aae2118 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -790,10 +790,6 @@ var/global/list/obj/item/device/pda/PDAs = list() remove_id() else usr << "This PDA does not have an ID in it!" - if (usr.restrained()) - usr << "You cannot do that while restrained!" - else - return /obj/item/device/pda/verb/verb_remove_id() set category = "Object" @@ -808,9 +804,6 @@ var/global/list/obj/item/device/pda/PDAs = list() remove_id() else usr << "This PDA does not have an ID in it!" - else - usr << "You cannot do that while restrained!" - /obj/item/device/pda/verb/verb_remove_pen() set category = "Object" @@ -832,8 +825,6 @@ var/global/list/obj/item/device/pda/PDAs = list() O.loc = get_turf(src) else usr << "This PDA does not have a pen in it!" - else - usr << "You cannot do that while restrained!" /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) @@ -882,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(user.canUseTopic(src))//If they can still act. - if(!id_check(user, 2)) - return - user << "You put the ID into \the [src]'s slot." - updateSelfDialog()//Update self dialog on success. + if(!id_check(user, 2)) + return + user << "You put the ID into \the [src]'s slot." + 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) From 50b55e54e8d09375ea396ea4e47a45ec151cc941 Mon Sep 17 00:00:00 2001 From: kingofkosmos Date: Wed, 18 Nov 2015 06:24:23 +0200 Subject: [PATCH 4/4] Removes checks for seclite/hydrid taser + suppressor/gun to be in hands for combining them. --- code/modules/projectiles/gun.dm | 6 ------ code/modules/projectiles/guns/projectile.dm | 5 +---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 423f7523d67..d64258b66af 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -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 << "You'll need [src] in your hands to do that!" - return if(!user.unEquip(A)) return user << "You click [S] into place on [src]." @@ -276,9 +273,6 @@ if(istype(A, /obj/item/weapon/screwdriver)) if(F) - if(user.l_hand != src && user.r_hand != src) - user << "You'll need [src] in your hands to do that!" - return for(var/obj/item/device/flashlight/seclite/S in src) user << "You unscrew the seclite from [src]." F = null diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index f3f93102e14..dcb69e3d0eb 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -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 << "You'll need [src] in your hands to do that." - return if(!user.unEquip(A)) return user << "You screw [S] onto [src]." @@ -157,4 +154,4 @@ icon_state = "suppressor" w_class = 2 var/oldsound = null - var/initial_w_class = null + var/initial_w_class = null