From 09a5764c3ba8abc57c07b7f67f79d396ffefa7d3 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 15 Feb 2016 19:01:00 -0800 Subject: [PATCH 1/4] Lets you put accessories on other people by attacking them with it --- code/modules/clothing/under/accessories/accessory.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index bdf0c955ca4..efa4804dca7 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -34,6 +34,18 @@ usr.put_in_hands(src) src.add_fingerprint(user) +/obj/item/clothing/accessory/attack(mob/living/carbon/human/H, mob/living/user) + // This code lets you put accessories on other people by attacking their sprite with the accessory + if(istype(H)) + var/obj/item/clothing/under/U = H.w_uniform + if(istype(U)) + user.visible_message("[user] is putting a [src] on [H]'s [U]!", "You begin to put a [src] on [H]'s [U]...") + if(do_after(user,40,target=U)) + user.visible_message("[user] puts a [src] on [H]'s [U]!", "You finish putting a [src] on [H]'s [U].") + U.attackby(src, user) + return 1 + return ..() + //default attackby behaviour /obj/item/clothing/accessory/attackby(obj/item/I, mob/user, params) ..() From 41fdd62d5c2cef0f1cefd82a722b6ea8601faad6 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 15 Feb 2016 19:10:54 -0800 Subject: [PATCH 2/4] Makes things a tad bit better grammarwise --- code/modules/clothing/under/accessories/accessory.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index efa4804dca7..fdd1bb07541 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -39,9 +39,9 @@ if(istype(H)) var/obj/item/clothing/under/U = H.w_uniform if(istype(U)) - user.visible_message("[user] is putting a [src] on [H]'s [U]!", "You begin to put a [src] on [H]'s [U]...") - if(do_after(user,40,target=U)) - user.visible_message("[user] puts a [src] on [H]'s [U]!", "You finish putting a [src] on [H]'s [U].") + user.visible_message("[user] is putting a [src.name] on [H]'s [U.name]!", "You begin to put a [src.name] on [H]'s [U.name]...") + if(do_after(user,40,target=H)) + user.visible_message("[user] puts a [src.name] on [H]'s [U.name]!", "You finish putting a [src.name] on [H]'s [U.name].") U.attackby(src, user) return 1 return ..() From 3e41bf62b426f14468d98c4bff065152fcf88420 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 15 Feb 2016 19:22:04 -0800 Subject: [PATCH 3/4] Adds further checks to attaching accessories --- code/modules/clothing/under/accessories/accessory.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index fdd1bb07541..ed9e9c1bf2e 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -37,13 +37,18 @@ /obj/item/clothing/accessory/attack(mob/living/carbon/human/H, mob/living/user) // This code lets you put accessories on other people by attacking their sprite with the accessory if(istype(H)) + if(H.wear_suit && H.wear_suit.flags_inv & HIDEJUMPSUIT) + user << "[H]'s body is covered, and you cannot attach \the [src]." + return 1 var/obj/item/clothing/under/U = H.w_uniform if(istype(U)) user.visible_message("[user] is putting a [src.name] on [H]'s [U.name]!", "You begin to put a [src.name] on [H]'s [U.name]...") if(do_after(user,40,target=H)) user.visible_message("[user] puts a [src.name] on [H]'s [U.name]!", "You finish putting a [src.name] on [H]'s [U.name].") U.attackby(src, user) - return 1 + else + user << "[H] is not wearing anything to attach \the [src] to." + return 1 return ..() //default attackby behaviour From 5a105a979beb480c7c8c14543396ae9d3886d89d Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 15 Feb 2016 19:22:48 -0800 Subject: [PATCH 4/4] Even even more sanity checks --- code/modules/clothing/under/accessories/accessory.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index ed9e9c1bf2e..c7712fef200 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -43,7 +43,7 @@ var/obj/item/clothing/under/U = H.w_uniform if(istype(U)) user.visible_message("[user] is putting a [src.name] on [H]'s [U.name]!", "You begin to put a [src.name] on [H]'s [U.name]...") - if(do_after(user,40,target=H)) + if(do_after(user,40,target=H) && H.w_uniform == U) user.visible_message("[user] puts a [src.name] on [H]'s [U.name]!", "You finish putting a [src.name] on [H]'s [U.name].") U.attackby(src, user) else