mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 11:32:20 +00:00
* Renames a few variables. Also reorders fallback order again. Renames item_state to inhand_icon_state Renames mob_overlay_icon to worn_icon Renames mob_overlay_state to worn_icon_state worn_icon_state/mob_overlay_state now never gets used for inhands. * Fixes some comments * Fixes map issue * Restart lints * Properly resolves conflicts
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
/obj/item/beacon
|
|
name = "\improper tracking beacon"
|
|
desc = "A beacon used by a teleporter."
|
|
icon = 'icons/obj/device.dmi'
|
|
icon_state = "beacon"
|
|
inhand_icon_state = "beacon"
|
|
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
|
var/enabled = TRUE
|
|
var/renamed = FALSE
|
|
|
|
/obj/item/beacon/Initialize()
|
|
. = ..()
|
|
if (enabled)
|
|
GLOB.teleportbeacons += src
|
|
else
|
|
icon_state = "beacon-off"
|
|
|
|
/obj/item/beacon/Destroy()
|
|
GLOB.teleportbeacons.Remove(src)
|
|
return ..()
|
|
|
|
/obj/item/beacon/attack_self(mob/user)
|
|
enabled = !enabled
|
|
if (enabled)
|
|
icon_state = "beacon"
|
|
GLOB.teleportbeacons += src
|
|
else
|
|
icon_state = "beacon-off"
|
|
GLOB.teleportbeacons.Remove(src)
|
|
to_chat(user, "<span class='notice'>You [enabled ? "enable" : "disable"] the beacon.</span>")
|
|
return
|
|
|
|
/obj/item/beacon/attackby(obj/item/W, mob/user)
|
|
if(istype(W, /obj/item/pen)) // needed for things that use custom names like the locator
|
|
var/new_name = stripped_input(user, "What would you like the name to be?")
|
|
if(!user.canUseTopic(src, BE_CLOSE))
|
|
return
|
|
if(new_name)
|
|
name = new_name
|
|
renamed = TRUE
|
|
return
|
|
else
|
|
return ..()
|