Files
Bubberstation/code/game/objects/items/botpad_remote.dm
SkyratBot 66e322715d [MIRROR] Allows for proxy atoms in object melee attack chain (#28608)
* Allows for proxy atoms in object melee attack chain (#83860)

## About The Pull Request
1. Objects now have an `get_proxy_for()` proc. This returns an atom that
will participate in the object melee attack chain on behalf of your
atom. Allows for general purpose polymorphism per object interaction
2. Cleaned up some multitool acts to accommodate proxy behaviour
3. You can pry tiles as an Engiborg with crowbar in hand & do other
similar behaviour with crowbar
5. Improves & Depends on #83880. We don't need a hidden omni toolbox &
can create the tools directly in the omnitool and pass them in the
attack chain as a proxy rather than calling the attack chain manually.
All tools are on the borg directly
   - Fixes #84355
   - Fixes #84359
   - Fixes #84393

## Changelog
SyncIt21,zxaber
🆑
fix: omni crowbar tool interaction for replacing tiles has been fixed
fix: techfab screentip does not runtime when you hover over it with an
omnitool multitool
fix: medi borgs can do brain surgery again
code: improved multitool & general tool code for some machines
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* Allows for proxy atoms in object melee attack chain

* Update bsa_cannon.dm

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
2024-07-04 21:48:11 +05:30

60 lines
2.0 KiB
Plaintext

/obj/item/botpad_remote
name = "Bot pad controller"
desc = "Use this device to control the connected bot pad."
desc_controls = "Left-click for launch, right-click for recall."
icon = 'icons/obj/devices/remote.dmi'
icon_state = "botpad_controller"
w_class = WEIGHT_CLASS_SMALL
// ID of the remote, used for linking up
var/id = "botlauncher"
var/obj/machinery/botpad/connected_botpad
/obj/item/botpad_remote/Destroy()
if(connected_botpad)
connected_botpad.connected_remote = null
connected_botpad = null
return ..()
/obj/item/botpad_remote/attack_self(mob/living/user)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
try_launch(user)
return
/obj/item/botpad_remote/attack_self_secondary(mob/living/user)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
if(connected_botpad)
connected_botpad.recall(user)
return
user?.balloon_alert(user, "no connected pad!")
return
/obj/item/botpad_remote/multitool_act(mob/living/user, obj/item/multitool/multitool)
. = NONE
if(!istype(multitool.buffer, /obj/machinery/botpad))
return
var/obj/machinery/botpad/buffered_remote = multitool.buffer
if(buffered_remote == connected_botpad)
to_chat(user, span_warning("Controller cannot connect to its own botpad!"))
return ITEM_INTERACT_BLOCKING
if(!connected_botpad && istype(buffered_remote, /obj/machinery/botpad))
connected_botpad = buffered_remote
connected_botpad.connected_remote = src
connected_botpad.id = id
multitool.set_buffer(null)
to_chat(user, span_notice("You connect the controller to the pad with data from the [multitool.name]'s buffer."))
return ITEM_INTERACT_SUCCESS
/obj/item/botpad_remote/proc/try_launch(mob/living/user)
if(!connected_botpad)
user?.balloon_alert(user, "no connected pad!")
return
if(connected_botpad.panel_open)
user?.balloon_alert(user, "close the panel!")
return
if(!(locate(/mob/living) in get_turf(connected_botpad)))
user?.balloon_alert(user, "no bots detected on the pad!")
return
connected_botpad.launch(user)