Adds equip/unequip times to rigid suits

Also stops helmets being worn without the rigid suit already on the mob.
This commit is contained in:
Bone White
2014-08-18 08:16:06 +01:00
parent 9ec8db00f6
commit d2129341b9
3 changed files with 73 additions and 0 deletions
+36
View File
@@ -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)