From 4c2ceac15354c15264ca72186330269ef6729ca4 Mon Sep 17 00:00:00 2001 From: SoundScopes Date: Mon, 6 Apr 2015 23:21:55 +0100 Subject: [PATCH] Attach more things --- code/modules/admin/verbs/debug.dm | 6 +- code/modules/clothing/clothing.dm | 89 +++++++++++++++++-- code/modules/clothing/under/ties.dm | 4 +- .../mob/living/carbon/human/examine.dm | 14 ++- code/modules/mob/living/carbon/human/human.dm | 5 +- .../mob/living/carbon/human/inventory.dm | 33 +++++++ .../mob/living/carbon/human/update_icons.dm | 10 +++ 7 files changed, 144 insertions(+), 17 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 49948f13..d4f06144 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -864,7 +864,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that hold.holstered = weapon var/obj/item/clothing/under/rank/ert/under = new(M) - under.hastie = hold + under.holster = hold hold.has_suit = under hold.has_suit.overlays += hold.inv_overlay @@ -1092,7 +1092,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if("syndicate operator") var/obj/item/clothing/under/syndicate/combat/tac_uniform = new(M) - tac_uniform.hastie = new /obj/item/clothing/tie/storage/black_vest(tac_uniform) + tac_uniform.webbing = new /obj/item/clothing/tie/storage/black_vest(tac_uniform) M.equip_to_slot_or_del(tac_uniform, slot_w_uniform) M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi(M), slot_wear_suit) @@ -1131,7 +1131,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if("iac_medic") var/obj/item/clothing/under/rank/medical/iac = new(M) - iac.hastie = new /obj/item/clothing/tie/armband/iac(iac) + iac.aband = new /obj/item/clothing/tie/armband/iac(iac) M.equip_to_slot_or_del(iac, slot_w_uniform) M.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat/iac(M), slot_wear_suit) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 77867600..8f32efd1 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -394,6 +394,8 @@ BLIND // can't see anything */ var/obj/item/clothing/tie/hastie = null var/obj/item/clothing/tie/armband/aband = null + var/obj/item/clothing/tie/holster/holster = null + var/obj/item/clothing/tie/storage/webbing = null var/displays_id = 1 var/rolled_down = 0 var/rolled_sleeves = 0 @@ -406,28 +408,58 @@ BLIND // can't see anything M.update_inv_w_uniform() /obj/item/clothing/under/attackby(obj/item/I, mob/user) + var/bandType = 0 //Tracking for hastie becuase I don't want to recode the lot yet if(istype(I, /obj/item/clothing/tie)) if(istype(I, /obj/item/clothing/tie/armband)) if(!aband) user.drop_item() aband = I aband.on_attached(src, user) - if(istype(loc, /mob/living/carbon/human)) var/mob/living/carbon/human/H = loc H.update_inv_w_uniform() return - if(!hastie) + bandType = 1 + + if(istype(I, /obj/item/clothing/tie/holster)) + if(!holster && !webbing) + user.drop_item() + holster = I + holster.on_attached(src, user) + if(istype(loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = loc + H.update_inv_w_uniform() + return + bandType = 2 + + if(istype(I, /obj/item/clothing/tie/storage)) + if(!holster && !webbing) + user.drop_item() + webbing = I + webbing.on_attached(src, user) + if(istype(loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = loc + H.update_inv_w_uniform() + return + bandType = 3 + + if(!hastie && !bandType) user.drop_item() hastie = I hastie.on_attached(src, user) - if(istype(loc, /mob/living/carbon/human)) var/mob/living/carbon/human/H = loc H.update_inv_w_uniform() - return + + if(istype(I, /obj/item/weapon/gun)) + if(holster) + holster.attackby(I, user) + return + if(webbing && bandType != 3) + webbing.attackby(I, user) + return if(hastie) hastie.attackby(I, user) return @@ -436,6 +468,13 @@ BLIND // can't see anything /obj/item/clothing/under/attack_hand(mob/user as mob) //only forward to the attached accessory if the clothing is equipped (not in a storage) + + if(webbing && src.loc == user) + webbing.attack_hand(user) + return + if(holster && src.loc == user) + holster.attack_hand(user) + return if(hastie && src.loc == user) hastie.attack_hand(user) return @@ -480,6 +519,10 @@ BLIND // can't see anything usr << "\A [hastie] is clipped to it." if(aband) usr << "\A [aband] is wrapped around the sleeve." + if(webbing) + usr << "\A [webbing] is attached to it." + if(holster) + usr << "\A [holster] is attached to it." /obj/item/clothing/under/proc/set_sensors(mob/usr as mob) var/mob/M = usr @@ -579,11 +622,37 @@ BLIND // can't see anything rolled_sleeves = 1 /obj/item/clothing/under/proc/remove_accessory(mob/user as mob) - if(!hastie) + var/list/attachedItems = list() + if(aband) + attachedItems += "armband" + if(holster) + attachedItems += "holster" + if(webbing) + attachedItems += "webbing" + if(hastie) + attachedItems += "other" + + if(!attachedItems) return - hastie.on_removed(user) - hastie = null + var/selection = input("Select what Accessory to remove","",null) as null|anything in attachedItems + + if(!selection) + return + + switch(selection) + if("armband") + aband.on_removed(user) + aband = null + if("holster") + holster.on_removed(user) + holster = null + if("webbing") + webbing.on_removed(user) + webbing = null + if("other") + hastie.on_removed(user) + hastie = null update_clothing_icon() /obj/item/clothing/under/verb/removetie() @@ -595,6 +664,7 @@ BLIND // can't see anything src.remove_accessory(usr) +/* /obj/item/clothing/under/proc/remove_armband(mob/user as mob) if(!aband) return @@ -611,6 +681,7 @@ BLIND // can't see anything if(usr.stat) return src.remove_armband(usr) +*/ /obj/item/clothing/under/rank/New() sensor_mode = pick(0,1,2,3) @@ -619,5 +690,9 @@ BLIND // can't see anything /obj/item/clothing/under/emp_act(severity) if (hastie) hastie.emp_act(severity) + if (webbing) + webbing.emp_act(severity) + if (holster) + holster.emp_act(severity) ..() diff --git a/code/modules/clothing/under/ties.dm b/code/modules/clothing/under/ties.dm index 8712a74f..60909f5e 100644 --- a/code/modules/clothing/under/ties.dm +++ b/code/modules/clothing/under/ties.dm @@ -243,8 +243,8 @@ H = src else if (istype(src, /obj/item/clothing/under)) var/obj/item/clothing/under/S = src - if (S.hastie) - H = S.hastie + if (S.holster) + H = S.holster if (!H) usr << "/red Something is very wrong." diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index cb74f095..c31aebbb 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -68,13 +68,19 @@ var/aband_msg if(istype(w_uniform,/obj/item/clothing/under)) var/obj/item/clothing/under/U = w_uniform - if(U.hastie) - tie_msg += " with \icon[U.hastie] \a [U.hastie]" - else if(U.hastie && U.aband) + if(U.hastie && U.aband) tie_msg += " with \icon[U.hastie] \a [U.hastie] and \icon[U.aband] \a [U.aband]" - if(U.aband) + else if(U.hastie) + tie_msg += " with \icon[U.hastie] \a [U.hastie]" + else if(U.aband) aband_msg+= " with \icon[U.aband] \a [U.aband]" + if(U.webbing || U.holster) + if(U.holster) + aband_msg += " with \icon[U.holster] \a [U.holster]" + else + aband_msg += " with \icon[U.webbing] \a [U.webbing]" + if(w_uniform.blood_DNA) msg += "[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name][tie_msg][aband_msg]!\n" else if(w_uniform.wasbloody == 2) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d231544e..ea02387b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -457,7 +457,10 @@
Suit Storage: [(s_store ? s_store : "Nothing")] [((istype(wear_mask, /obj/item/clothing/mask) && istype(s_store, /obj/item/weapon/tank) && !( internal )) ? text(" Set Internal", src) : "")]
[(handcuffed ? text("Handcuffed") : text("Not Handcuffed"))]
[(legcuffed ? text("Legcuffed") : text(""))] -
[(suit) ? ((suit.hastie) ? text(" Remove Accessory", src) : "") :] + [(suit) ? ((suit.hastie) ? text("
Remove Accessory", src) : "") :] + [(suit) ? ((suit.webbing) ? text("
Remove Webbing", src) : "") :] + [(suit) ? ((suit.aband) ? text("
Remove Armband", src) : "") :] + [(suit) ? ((suit.holster) ? text("
Remove Holster", src) : "") :]
[(internal ? text("Remove Internal") : "")]
Remove Splints
Empty Pockets diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 7687af7a..6d86cbb3 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -532,6 +532,24 @@ return else message = "\red [source] is trying to take off \a [suit.hastie] from [target]'s suit!" + if("webbing") + var/obj/item/clothing/under/suit = target.w_uniform + target.attack_log += text("\[[time_stamp()]\] Has had their webbing ([suit.webbing]) removed by [source.name] ([source.ckey])") + source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) webbing ([suit.webbing])") + message = "\red [source] is trying to take off \a [suit.webbing] from [target]'s suit!" + if("holster") + var/obj/item/clothing/under/suit = target.w_uniform + target.attack_log += text("\[[time_stamp()]\] Has had their holster ([suit.holster]) removed by [source.name] ([source.ckey])") + source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) holster ([suit.holster])") + message = "\red [source] is trying to take off \a [suit.hastie] from [target]'s suit!" + if("aband") + var/obj/item/clothing/under/suit = target.w_uniform + target.attack_log += text("\[[time_stamp()]\] Has had their armand ([suit.aband]) removed by [source.name] ([source.ckey])") + source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) armband ([suit.aband])") + for(var/mob/M in viewers(target, null)) + M.show_message("\red [source] tears off \the [suit.aband] from [target]'s suit!" , 1) + done() + return if("s_store") target.attack_log += text("\[[time_stamp()]\] Has had their suit storage item ([target.s_store]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) suit storage item ([target.s_store])") @@ -669,6 +687,21 @@ It can still be worn/put on as normal. suit.hastie.on_removed(usr) suit.hastie = null target.update_inv_w_uniform() + if("aband") + var/obj/item/clothing/under/suit = target.w_uniform + suit.aband.on_removed(usr) + suit.aband = null + target.update_inv_w_uniform() + if("holster") + var/obj/item/clothing/under/suit = target.w_uniform + suit.holster.on_removed(usr) + suit.holster = null + target.update_inv_w_uniform() + if("webbing") + var/obj/item/clothing/under/suit = target.w_uniform + suit.webbing.on_removed(usr) + suit.webbing = null + target.update_inv_w_uniform() if("id") slot_to_process = slot_wear_id if (target.wear_id) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 4210264c..b04b3035 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -597,6 +597,16 @@ proc/get_damage_icon_part(damage_state, body_part) if(!aband_color) aband_color = w_uniform:aband.icon_state standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[aband_color]") + if(w_uniform:webbing) //SAME THING AS ABOVE, LETS ADD TWO MORE FOR LOLS + var/webbing_color = w_uniform:webbing.item_color + if(!webbing_color) webbing_color = w_uniform:webbing.icon_state + standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[webbing_color]") + + if(w_uniform:holster) //SAME THING AS ABOVE, THIS IS FUN + var/holster_color = w_uniform:holster.item_color + if(!holster_color) holster_color = w_uniform:holster.icon_state + standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[holster_color]") + overlays_standing[UNIFORM_LAYER] = standing else overlays_standing[UNIFORM_LAYER] = null