Ports TG Pickup, Equip, and Drop Sounds (#15572)

* Ports TG Pickup, Equip, and Drop Sounds

* really
This commit is contained in:
Fox McCloud
2021-02-24 12:51:59 +00:00
committed by GitHub
parent 7b7ea0a191
commit efa3aecb61
95 changed files with 271 additions and 139 deletions
+7 -11
View File
@@ -196,7 +196,7 @@
//This is a SAFE proc. Use this instead of equip_to_slot()!
//set del_on_fail to have it delete W if it fails to equip
//set disable_warning to disable the 'you are unable to equip that' warning.
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, del_on_fail = 0, disable_warning = 0)
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, del_on_fail = FALSE, disable_warning = FALSE, initial = FALSE)
if(!istype(W)) return 0
if(!W.mob_can_equip(src, slot, disable_warning))
@@ -208,24 +208,24 @@
return 0
equip_to_slot(W, slot) //This proc should not ever fail.
equip_to_slot(W, slot, initial) //This proc should not ever fail.
return 1
//This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task.
//In most cases you will want to use equip_to_slot_if_possible()
/mob/proc/equip_to_slot(obj/item/W, slot)
/mob/proc/equip_to_slot(obj/item/W, slot, initial = FALSE)
return
//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot)
return equip_to_slot_if_possible(W, slot, TRUE, TRUE)
/mob/proc/equip_to_slot_or_del(obj/item/W, slot, initial = FALSE)
return equip_to_slot_if_possible(W, slot, TRUE, TRUE, initial)
// Convinience proc. Collects crap that fails to equip either onto the mob's back, or drops it.
// Used in job equipping so shit doesn't pile up at the start loc.
/mob/living/carbon/human/proc/equip_or_collect(var/obj/item/W, var/slot)
/mob/living/carbon/human/proc/equip_or_collect(obj/item/W, slot, initial = FALSE)
if(W.mob_can_equip(src, slot, 1))
//Mob can equip. Equip it.
equip_to_slot_or_del(W, slot)
equip_to_slot_or_del(W, slot, initial)
else
//Mob can't equip it. Put it their backpack or toss it on the floor
if(istype(back, /obj/item/storage))
@@ -419,8 +419,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(slot_flags & SLOT_DENYPOCKET)
return
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_POCKET) )
return 1
if(slot_r_store)
@@ -430,8 +428,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(slot_flags & SLOT_DENYPOCKET)
return 0
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_POCKET) )
return 1
return 0