mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Co-authored-by: Selis <selis@xynolabs.com> Co-authored-by: Selis <sirlionfur@hotmail.de> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: SatinIsle <thesatinisle@gmail.com> Co-authored-by: Heroman <alesha3000@list.ru> Co-authored-by: Casey <a.roaming.shadow@gmail.com> Co-authored-by: Raeschen <rycoop29@gmail.com>
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
// 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, /decl/observ/mob_equipped, new)
|
|
|
|
/decl/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.
|
|
GLOBAL_DATUM_INIT(item_equipped_event, /decl/observ/item_equipped, new)
|
|
|
|
/decl/observ/item_equipped
|
|
name = "Item Equipped"
|
|
expected_type = /obj/item
|
|
*/
|
|
//Deprecated in favor of comsigs
|
|
/********************
|
|
* Equipped Handling *
|
|
********************/
|
|
|
|
/obj/item/equipped(var/mob/user, var/slot)
|
|
. = ..()
|
|
SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_EQUIPPED, src, slot)
|
|
SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_EQUIPPED, user, slot)
|