Adds framework for equip delays and adds it to the straight jacket
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = 0)
|
||||
return dna.species.can_equip(I, slot, disable_warning, src)
|
||||
/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE)
|
||||
return dna.species.can_equip(I, slot, disable_warning, src, bypass_equip_delay_self)
|
||||
|
||||
// Return the item currently in the slot ID
|
||||
/mob/living/carbon/human/get_item_by_slot(slot_id)
|
||||
|
||||
@@ -765,7 +765,7 @@
|
||||
// handles the equipping of species-specific gear
|
||||
return
|
||||
|
||||
/datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H)
|
||||
/datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H, bypass_equip_delay_self = FALSE)
|
||||
if(slot in no_equip)
|
||||
if(!I.species_exception || !is_type_in_list(src, I.species_exception))
|
||||
return 0
|
||||
@@ -785,7 +785,7 @@
|
||||
return 0
|
||||
if(!H.get_bodypart("head"))
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_neck)
|
||||
if(H.wear_neck)
|
||||
return 0
|
||||
@@ -797,13 +797,13 @@
|
||||
return 0
|
||||
if( !(I.slot_flags & SLOT_BACK) )
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_wear_suit)
|
||||
if(H.wear_suit)
|
||||
return 0
|
||||
if( !(I.slot_flags & SLOT_OCLOTHING) )
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_gloves)
|
||||
if(H.gloves)
|
||||
return 0
|
||||
@@ -811,7 +811,7 @@
|
||||
return 0
|
||||
if(num_arms < 2)
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_shoes)
|
||||
if(H.shoes)
|
||||
return 0
|
||||
@@ -823,7 +823,7 @@
|
||||
if(!disable_warning)
|
||||
to_chat(H, "<span class='warning'>The footwear around here isn't compatible with your feet!</span>")
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_belt)
|
||||
if(H.belt)
|
||||
return 0
|
||||
@@ -833,7 +833,7 @@
|
||||
return 0
|
||||
if( !(I.slot_flags & SLOT_BELT) )
|
||||
return
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_glasses)
|
||||
if(H.glasses)
|
||||
return 0
|
||||
@@ -841,7 +841,7 @@
|
||||
return 0
|
||||
if(!H.get_bodypart("head"))
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_head)
|
||||
if(H.head)
|
||||
return 0
|
||||
@@ -849,7 +849,7 @@
|
||||
return 0
|
||||
if(!H.get_bodypart("head"))
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_ears)
|
||||
if(H.ears)
|
||||
return 0
|
||||
@@ -857,13 +857,13 @@
|
||||
return 0
|
||||
if(!H.get_bodypart("head"))
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_w_uniform)
|
||||
if(H.w_uniform)
|
||||
return 0
|
||||
if( !(I.slot_flags & SLOT_ICLOTHING) )
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_wear_id)
|
||||
if(H.wear_id)
|
||||
return 0
|
||||
@@ -873,7 +873,7 @@
|
||||
return 0
|
||||
if( !(I.slot_flags & SLOT_ID) )
|
||||
return 0
|
||||
return 1
|
||||
return equip_delay_self_check(I, H, bypass_equip_delay_self)
|
||||
if(slot_l_store)
|
||||
if(I.flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them.
|
||||
return 0
|
||||
@@ -945,6 +945,12 @@
|
||||
return 0
|
||||
return 0 //Unsupported slot
|
||||
|
||||
/datum/species/proc/equip_delay_self_check(obj/item/I, mob/living/carbon/human/H, bypass_equip_delay_self)
|
||||
if(!I.equip_delay_self || bypass_equip_delay_self)
|
||||
return TRUE
|
||||
H.visible_message("<span class='notice'>[H] start putting on [I]...</span>", "<span class='notice'>You start putting on [I]...</span>")
|
||||
return do_after(H, I.equip_delay_self, target = H)
|
||||
|
||||
/datum/species/proc/before_equip_job(datum/job/J, mob/living/carbon/human/H)
|
||||
return
|
||||
|
||||
|
||||
@@ -669,7 +669,7 @@
|
||||
return
|
||||
|
||||
visible_message("<span class='notice'>[src] tries to put [what] on [who].</span>")
|
||||
if(do_mob(src, who, what.put_on_delay))
|
||||
if(do_mob(src, who, what.equip_delay_other))
|
||||
if(what && Adjacent(who) && what.mob_can_equip(who, src, final_where, TRUE))
|
||||
if(temporarilyRemoveItemFromInventory(what))
|
||||
if(where_list)
|
||||
|
||||
Reference in New Issue
Block a user