mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
// Observer Pattern Implementation: Unequipped (dropped)
|
|
// Registration type: /mob
|
|
//
|
|
// Raised when: A mob unequips/drops an item.
|
|
//
|
|
// Arguments that the called proc should expect:
|
|
// /mob/equipped: The mob that unequipped/dropped the item.
|
|
// /obj/item/item: The unequipped item.
|
|
/*
|
|
GLOBAL_DATUM_INIT(mob_unequipped_event, /decl/observ/mob_unequipped, new)
|
|
|
|
/decl/observ/mob_unequipped
|
|
name = "Mob Unequipped"
|
|
expected_type = /mob
|
|
|
|
// Observer Pattern Implementation: Unequipped (dropped)
|
|
// Registration type: /obj/item
|
|
//
|
|
// Raised when: A mob unequips/drops an item.
|
|
//
|
|
// Arguments that the called proc should expect:
|
|
// /obj/item/item: The unequipped item.
|
|
// /mob/equipped: The mob that unequipped/dropped the item.
|
|
|
|
GLOBAL_DATUM_INIT(item_unequipped_event, /decl/observ/item_unequipped, new)
|
|
|
|
/decl/observ/item_unequipped
|
|
name = "Item Unequipped"
|
|
expected_type = /obj/item
|
|
*/
|
|
//Deprecated in favor of comsigs
|
|
|
|
/**********************
|
|
* Unequipped Handling *
|
|
**********************/
|
|
|
|
/obj/item/dropped(var/mob/user)
|
|
. = ..(user)
|
|
//SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_UNEQUIPPED, src)
|
|
//SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED, user)
|
|
if(user) // Cannot always guarantee that user won't be null
|
|
SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_UNEQUIPPED, src)
|
|
SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED, user)
|
|
else
|
|
SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED)
|