Files
Bubberstation/code/modules/unit_tests/cyborg_tool.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

21 lines
796 B
Plaintext

/// Regression test for the cyborg omnitool to ensure it goes through proper channels
/datum/unit_test/cyborg_tool
var/times_wrenched = 0
/datum/unit_test/cyborg_tool/Run()
var/mob/living/carbon/human/consistent/not_a_borg = allocate(__IMPLIED_TYPE__)
var/obj/item/borg/cyborg_omnitool/engineering/tool = allocate(__IMPLIED_TYPE__)
tool.tool_behaviour = TOOL_WRENCH
not_a_borg.put_in_active_hand(tool)
var/obj/structure/frame/machine/frame = allocate(__IMPLIED_TYPE__)
RegisterSignal(frame, COMSIG_ATOM_TOOL_ACT(TOOL_WRENCH), PROC_REF(wrenched))
not_a_borg.ClickOn(frame)
TEST_ASSERT_EQUAL(times_wrenched, 1, "Wrenching the frame with a cyborg omnitool should have triggered the wrenched signal")
/datum/unit_test/cyborg_tool/proc/wrenched(...)
SIGNAL_HANDLER
times_wrenched += 1