Files
Bubberstation/code/game/objects/items/binoculars.dm
SkyratBot 4ecf8128e1 [MIRROR] Changes the scope component to be appliable to other items and not just guns. Binocs and the Curator's mothic cap use it. [MDB IGNORE] (#25962)
* Changes the scope component to be appliable to other items and not just guns. Binocs and the Curator's mothic cap use it.

* Update moth.dm

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2024-01-04 21:40:24 -05:00

30 lines
1.5 KiB
Plaintext

/obj/item/binoculars
name = "binoculars"
desc = "Used for long-distance surveillance."
inhand_icon_state = "binoculars"
icon = 'icons/obj/devices/tool.dmi'
icon_state = "binoculars"
worn_icon_state = "binoculars"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
slot_flags = ITEM_SLOT_NECK | ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
/obj/item/binoculars/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, force_unwielded=8, force_wielded=12, wield_callback = CALLBACK(src, PROC_REF(on_wield)), unwield_callback = CALLBACK(src, PROC_REF(on_unwield)))
AddComponent(/datum/component/scope, range_modifier = 4, zoom_method = ZOOM_METHOD_WIELD)
/obj/item/binoculars/proc/on_wield(obj/item/source, mob/user)
user.visible_message(span_notice("[user] holds [src] up to [user.p_their()] eyes."), span_notice("You hold [src] up to your eyes."))
inhand_icon_state = "binoculars_wielded"
user.regenerate_icons()
//Have you ever tried running with binocs on? It takes some willpower not to stop as things appear way too close than they're.
user.add_movespeed_modifier(/datum/movespeed_modifier/binocs_wielded)
/obj/item/binoculars/proc/on_unwield(obj/item/source, mob/user)
user.visible_message(span_notice("[user] lowers [src]."), span_notice("You lower [src]."))
inhand_icon_state = "binoculars"
user.regenerate_icons()
user.remove_movespeed_modifier(/datum/movespeed_modifier/binocs_wielded)