Files
CHOMPStation2/code/datums/observation/unequipped.dm
Cadyn b90f7ec922 The 515 MegaPR early downport (#7783)
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>
2024-02-27 20:17:32 +01:00

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)
..()
//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)