Refactored item equipement observable away (#19241)

Refactored item equipement observable away, turned them into signals.
Partially ported on_equipped / equipped procs from TG, updated logic,
added signals for them.
This commit is contained in:
Fluffy
2024-05-31 21:25:02 +00:00
committed by GitHub
parent 7fdfb4ce02
commit 37814ef383
7 changed files with 134 additions and 75 deletions
-38
View File
@@ -1,38 +0,0 @@
// Observer Pattern Implementation: Equipped
// Registration type: /mob
//
// Raised when: A mob equips an item.
//
// Arguments that the called proc should expect:
// /mob/equipper: The mob that equipped the item.
// /obj/item/item: The equipped item.
// slot: The slot equipped to.
GLOBAL_DATUM_INIT(mob_equipped_event, /singleton/observ/mob_equipped, new)
/singleton/observ/mob_equipped
name = "Mob Equipped"
expected_type = /mob
// Observer Pattern Implementation: Equipped
// Registration type: /obj/item
//
// Raised when: A mob equips an item.
//
// Arguments that the called proc should expect:
// /obj/item/item: The equipped item.
// /mob/equipper: The mob that equipped the item.
// slot: The slot equipped to.
var/singleton/observ/item_equipped/item_equipped_event = new()
/singleton/observ/item_equipped
name = "Item Equipped"
expected_type = /obj/item
/********************
* Equipped Handling *
********************/
/obj/item/proc/check_equipped(var/mob/user, var/slot, var/assisted_equip = FALSE)
return TRUE