From d2129341b9c369538a01b3c22dd6f7d95e3fab4e Mon Sep 17 00:00:00 2001 From: Bone White Date: Mon, 18 Aug 2014 08:16:06 +0100 Subject: [PATCH] Adds equip/unequip times to rigid suits Also stops helmets being worn without the rigid suit already on the mob. --- code/game/objects/items.dm | 36 +++++++++++++++++++++++++ code/modules/clothing/clothing.dm | 35 ++++++++++++++++++++++++ code/modules/clothing/spacesuits/rig.dm | 2 ++ 3 files changed, 73 insertions(+) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 9da98cac877..fcda1df0199 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -152,11 +152,47 @@ if(!src.canremove) return 0 else + + if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + if(istype(src, /obj/item/clothing/suit/space/rig)) // If the item to unequip item is a rigid suit + if(! istype(H.head, /obj/item/clothing/head/helmet/space/rig)) // If the person is NOT wearing a rigid suit helmet + var/tempX = H.x + var/tempY = H.y + H << "\blue You unfastening the seals and clambering out of the [src]. (This will take a while)." + var/obj/item/clothing/head/helmet/space/rig/this_rig = src + var/equip_time = round(this_rig.equip_time/10) + var/i + for(i=1; i<=equip_time; i++) + sleep (10) // Check if they've moved every 10 time units + if ((tempX != usr.x) || (tempY != usr.y)) + H << "\red \The [src] is too fiddly to remove whilst moving." + return 0 + H << "\blue You finish removing the [src]." + else + H << "\red You must remove \the [H.head] first." + return 0 + + if(istype(src, /obj/item/clothing/head/helmet/space/rig)) // If the item to unequip is a rigid suit helmet + var/tempX = H.x + var/tempY = H.y + H << "\blue You start unfastening the [src]. (This will take a while)." + var/obj/item/clothing/suit/space/rig/this_helmet = src + var/equip_time = round(this_helmet.equip_time/10) + var/i + for(i=1; i<=equip_time; i++) + sleep (10) // Check if they've moved every 10 time units + if ((tempX != usr.x) || (tempY != usr.y)) + H << "\red \The [src] is too fiddly to remove whilst moving." + return 0 + H << "\blue You finish removing the [src]." + user.u_equip(src) else if(isliving(src.loc)) return 0 user.next_move = max(user.next_move+2,world.time + 2) + src.pickup(user) add_fingerprint(user) user.put_in_active_hand(src) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index dff5bde016f..d89fc8185fd 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -5,6 +5,41 @@ //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) + if(istype(M,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + if(istype(src, /obj/item/clothing/head/helmet/space/rig)) // If the item to be equipped is a rigid suit helmet + if(istype(H.wear_suit, /obj/item/clothing/suit/space/rig)) // If the person is wearing a rigid suit + var/tempX = H.x + var/tempY = H.y + H << "\blue You start securing the [src] to your suit. (This will take a while)." + var/obj/item/clothing/head/helmet/space/rig/this_helmet = src + var/equip_time = round(this_helmet.equip_time/10) + var/i + for(i=1; i<=equip_time; i++) + sleep (10) // Check if they've moved every 10 time units + if ((tempX != usr.x) || (tempY != usr.y)) + H << "\red \The [src] is too fiddly to fasten whilst moving. \..." + return 0 + H << "\blue \The [src] clicks into place, sealing the suit to be space-proof." + + else + M << "\red \The [src] is too heavy too wear without a rigid suit to support it. \..." + return 0 + + if(istype(src, /obj/item/clothing/suit/space/rig)) // If the equipped item is a rigid suit + var/tempX = H.x + var/tempY = H.y + M << "\blue You start climbing into the [src] and fasten the seals." + var/obj/item/clothing/suit/space/rig/this_rig = src + var/equip_time = round(this_rig.equip_time/10) + var/i + for(i=1; i<=equip_time; i++) + sleep (10) // Check if they've moved every 10 time units + if ((tempX != usr.x) || (tempY != usr.y)) + H << "\red \The [src] is too fiddly to fasten whilst moving. \..." + return 0 + M << "\blue You have finished fastening the [src]'s seals." + //if we can equip the item anyway, don't bother with species_restricted (aslo cuts down on spam) if (!..()) return 0 diff --git a/code/modules/clothing/spacesuits/rig.dm b/code/modules/clothing/spacesuits/rig.dm index c6dd02ad103..49ac911f3f1 100644 --- a/code/modules/clothing/spacesuits/rig.dm +++ b/code/modules/clothing/spacesuits/rig.dm @@ -57,6 +57,7 @@ desc = "A special helmet designed for work in a hazardous, low-pressure environment. Has radiation shielding." icon_state = "rig0-engineering" item_state = "eng_helm" + var/equip_time = 60 // Bone White - time to equip/unequip. see /obj/item/attack_hand (items.dm) and /obj/item/clothing/mob_can_equip (clothing.dm) armor = list(melee = 40, bullet = 5, laser = 20,energy = 5, bomb = 35, bio = 100, rad = 80) allowed = list(/obj/item/device/flashlight) var/brightness_on = 4 //luminosity when on @@ -102,6 +103,7 @@ desc = "A special suit that protects against hazardous, low pressure environments. Has radiation shielding." icon_state = "rig-engineering" item_state = "eng_hardsuit" + var/equip_time = 100 // Bone White - time to equip/unequip. see /obj/item/attack_hand (items.dm) and /obj/item/clothing/mob_can_equip (clothing.dm) slowdown = 4 armor = list(melee = 30, bullet = 5, laser = 20,energy = 5, bomb = 35, bio = 100, rad = 80) allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/bag/ore,/obj/item/device/t_scanner,/obj/item/weapon/pickaxe, /obj/item/weapon/rcd)