mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 12:02:31 +01:00
Refactored hitby to be in line with TG's version. Refactored item weight defines to a more clear naming scheme, also in line with TG's version. Refactored how the movement bumps are handled, ported signals to handle them, in preparation for the movement update. Fixed disposal hit bouncing the hitting atom on the wall. Items do not push other items anymore if they are tiny.
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
/obj/item/clothing/accessory/locket
|
|
name = "silver locket"
|
|
desc = "A silver locket that seems to have space for a photo within."
|
|
icon_state = "locket"
|
|
item_state = "locket"
|
|
slot_flags = SLOT_MASK | SLOT_TIE
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
var/open
|
|
var/obj/item/held //Item inside locket.
|
|
|
|
drop_sound = 'sound/items/drop/ring.ogg'
|
|
pickup_sound = 'sound/items/pickup/ring.ogg'
|
|
|
|
/obj/item/clothing/accessory/locket/get_mask_examine_text(mob/user)
|
|
return "around [user.get_pronoun("his")] neck"
|
|
|
|
/obj/item/clothing/accessory/locket/attack_self(mob/user as mob)
|
|
if(!base_icon)
|
|
base_icon = icon_state
|
|
|
|
if(!("[base_icon]_open" in icon_states(icon)))
|
|
to_chat(user, "\The [src] doesn't seem to open.")
|
|
return
|
|
|
|
open = !open
|
|
to_chat(user, "You flip \the [src] [open?"open":"closed"].")
|
|
if(open)
|
|
icon_state = "[base_icon]_open"
|
|
if(held)
|
|
to_chat(user, "\The [held] falls out!")
|
|
held.forceMove(get_turf(user))
|
|
src.held = null
|
|
else
|
|
icon_state = "[base_icon]"
|
|
|
|
/obj/item/clothing/accessory/locket/attackby(obj/item/attacking_item, mob/user)
|
|
if(!open)
|
|
to_chat(user, "You have to open it first.")
|
|
return
|
|
|
|
if(istype(attacking_item,/obj/item/paper) || istype(attacking_item, /obj/item/photo))
|
|
if(held)
|
|
to_chat(usr, "\The [src] already has something inside it.")
|
|
else
|
|
to_chat(usr, "You slip [attacking_item] into [src].")
|
|
user.drop_from_inventory(attacking_item, src)
|
|
src.held = attacking_item
|
|
return
|
|
..()
|