From 2781da8d5b79cce2cc4628d757b03cc1ec0a40f1 Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Sat, 9 Jun 2012 13:57:10 +0000 Subject: [PATCH] - Added basic heavy-duty cables, they cannot be destroyed with wirecutters, unfortunately they currently cannot be created either. Not present anywhere on the map yet. - Fixed a bug with masks, which did not follow the equipment rules of the SLOT_MASK flag. - Fixed a problem where monkeys could not equip a backpack. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3774 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 2 +- .../mob/living/carbon/monkey/monkey.dm | 2 +- code/modules/mob/mob.dm | 15 ++++++++++- code/modules/power/cable_heavyduty.dm | 27 +++++++++++++++++++ tgstation.dme | 1 + 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 code/modules/power/cable_heavyduty.dm diff --git a/code/defines/obj.dm b/code/defines/obj.dm index ed6ce312f8e..3032db0956b 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -523,7 +523,7 @@ anchored =1 var/netnum = 0 name = "power cable" - desc = "A flexible superconducting cable for heavy-duty power transfer. Comes in clown colors now." + desc = "A flexible superconducting cable for heavy-duty power transfer" icon = 'power_cond_red.dmi' icon_state = "0-1" var/d1 = 0 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 73bc79adbb3..27b6bc4d0a9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -438,7 +438,7 @@ if (emptyHand) wear_mask.DblClick() return - if (!( istype(W, /obj/item/clothing/mask) )) + if (!( W.slot_flags & SLOT_MASK )) return u_equip(W) wear_mask = W diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 5969f3bf6a3..fddb26cfbaf 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -721,7 +721,7 @@ W.layer = initial(W.layer) W.add_fingerprint(source) else - if ((istype(item, /obj/item) && item.flags & 1)) + if ((istype(item, /obj/item) && item.slot_flags & SLOT_BACK )) source.drop_item() loc = target item.layer = 20 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6e2d865dbeb..1a9a8599eef 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -114,11 +114,24 @@ if("mask") if (wear_mask) return - if (!( istype(W, /obj/item/clothing/mask) )) + if (!( W.slot_flags & SLOT_MASK )) return u_equip(W) wear_mask = W W.equipped(src, text) + if("back") + if (back) + return + if (!istype(W, /obj/item)) + return + if (!( W.slot_flags & SLOT_BACK )) + return + if(istype(W,/obj/item/weapon/twohanded) && W:wielded) + usr << "Unwield the [initial(W.name)] first!" + return + u_equip(W) + back = W + W.equipped(src, text) if("back") if ((back || !( istype(W, /obj/item/weapon) ))) return diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm new file mode 100644 index 00000000000..7bfc2d94794 --- /dev/null +++ b/code/modules/power/cable_heavyduty.dm @@ -0,0 +1,27 @@ +/obj/item/weapon/cable_coil/heavyduty + name = "heavy cable coil" + icon = 'power.dmi' + icon_state = "wire" + +/obj/structure/cable/heavyduty + icon = 'power_local.dmi' + name = "large power cable" + desc = "This cable is tough. It cannot be cut with simple hand tools." + +/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user) + + var/turf/T = src.loc + if(T.intact) + return + + if(istype(W, /obj/item/weapon/wirecutters)) + usr << "\blue These cables are too tough to be cut with those [W.name]." + return + else if(istype(W, /obj/item/weapon/cable_coil)) + usr << "\blue You will need heavier cables to connect to these." + return + else + ..() + +/obj/structure/cable/heavyduty/cableColor(var/colorC) + return \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index 6b5482a2608..d4f41386561 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1006,6 +1006,7 @@ #include "code\modules\paperwork\stamps.dm" #include "code\modules\power\apc.dm" #include "code\modules\power\cable.dm" +#include "code\modules\power\cable_heavyduty.dm" #include "code\modules\power\cell.dm" #include "code\modules\power\engine.dm" #include "code\modules\power\generator.dm"