Goonstation Forums
[PR] `/obj/item/assembly`-Rework - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Ideas & Suggestions (https://forum.ss13.co/forumdisplay.php?fid=8)
+--- Thread: [PR] `/obj/item/assembly`-Rework (/showthread.php?tid=23643)



[PR] `/obj/item/assembly`-Rework - github_bot - 02-24-2025

PULL REQUEST DETAILS

[Rework][Game Objects][Input Wanted]




About the PR

This PR aims to unify all assemblies under `/obj/item/assembly` into a common object

This object functions as a holder that relays signals and triggers to the corresponding parts of the assembly. It also dynamically handles sprite generation and assembly steps that fall in this category.

Assemblies will fall under a structure of 4 categories of items:

- `obj/item/trigger`: This is an object that will send the signal to the assembly to activate it's applier, e.g. a timer, proximity sensor or signaler
- `obj/item/applier`: This is an object that will cause the assemblies main effect once triggered, e.g. igniters or signalers. If a `target` is attached, the assembly tries to use the applier on it
- `obj/item/target`: This is an object the `applier` will try to interact with once it is activated, e.g. a pipebomb or a beaker
- `list/additional_components`: This list contains all components that are attached to the assembly for advanced interactions or crafting recipes, e.g. cabling or vuvuzelas for canbombs

The goal of this PR is to rework each assembly to work within this structure.

This PR adds multiple signals which will be send to the corresponding items when anything within the assembly changed, e.g. an item gets inserted (`COMSIG_ITEM_ASSEMBLY_ITEM_SETUP`), an item is checked if its ready to be build into an assembly (`COMSIG_ITEM_ASSEMBLY_COMBINATION_CHECK`), or if it gets activated while the assembly is secured (`COMSIG_ITEM_ASSEMBLY_ACTIVATION`) or while unsecured (`COMSIG_ITEM_ASSEMBLY_MANIPULATION`).

The above mentioned behaviour is used for a change in the handling of assemblies: Using an assembly in hand while unsecured opens the UI of it's components. Using it in hand while secured activates any timer on it.

To start an assembly, a suitable trigger and a suitable applier needs to be combined. The applier then adds a `/datum/component/assembly`-component to continue the craft, when needed. For this, the `TOOL_ASSEMBLY_APPLIER`-Toolflag has been added for suitable appliers and the `/datum/component/assembly/trigger_applier_assembly`-component for suitable components.

Also, new sprites were added which are used within the assembly for modular building of its sprite.

Why's this needed?

Assemblies are a complete mess of code that is hard to work with, to phrase it in a diplomatic way. They also suffer from bad usability because of the need to activate them via their UI. Last but not least, the way they are constructed (securing/unsecuring seemingly random stuff, need to use certain items on others but not the other way around) is cumbersome and outdated. This PR aims to solve these issues.

The 3-part structure is chosen because it is a intuitive way of building them (you have something that starts a second thing that is used on a third thing). Sticking to this structure should massively improve the handling of building them.

fixes #11617, fixes #17571,fixes #10393, fixes #18114, fixes #20275, fixes #17641 (mostly by completely redoing the behaviour in question)
closes #19637 by deeming it intended behaviour, as well as closes #8642

Current progress of the Draft : Ready for review!

Implemented items:
- [x] igniters (applier)
- [x] timers (trigger)
- [x] signalers (trigger)
- [x] proximity sensors (trigger)
- [x] pipebombs (target)
- [x] beakers (target)
- [x] plasma tanks (target)
- [x] grenades (applier)
- [x] gimmick-grenades (applier)
- [x] grenades-old (applier)
- [x] cyborg arm-mousetrap (trigger)
- [x] multitool (applier) + canbombs (special behaviour)
- [x] health analyser (trigger)
- [x] mouse rollers (trigger)
- [x] mousetrap carts (special)
- [x] bike horn (applier)
- [x] suicide vests (special)
- [ ] ~~Butts~~ (this will require me to merge buttbombs into assemblies, that is better done in a followup PR)

Current ToDo's of the infrastructure:
- [x] redo the sprite generation (it's horrible and semi-functional, please don't judge me)
- [x] relay outside impulses, e.g. shock and temperature on beaker assemblies or material parts
- [x] add signals for `list/additional_components`
- [x] Catch corner cases like e.g. parts of the assembly blowing up (beakers, material parts)
- [x] Discuss the way of handling unsecuring/securing
- [x] Get rid of igniter/signaler-unsecuring/securing
- [x] Converting all other `/obj/item/assembly`-objects and turn ``/obj/item/assembly/complete` into the parent object
- [x] Add help-messages
- [x] Cleanup and polishing
- [x] Split off unrelated items from `/obj/item/assembly`, e.g. shock kits and flamethrower construction
- [x] Add admin logging
- [x] Add securities against ghostcritter abuse
- [x] Adjustments for Mapping
- [x] Creation of a few assemblies for testing/loot-purpose
- [x] implement `last_armer` properly for logging and pie-shenanigans
- [x] add bomb-assemblies into `datum/bomb_monitor`
- [x] Make scanners show the contents of the target of the assembly (chem scanner, atmos scanner)
- [ ] Add more documentation

Full list of changes

- It doesn't matter anymore if you use an igniter on a timer or the other way around for assembly-production
- Igniters can't be unsecured anymore
- Radios don't need to be unsecured to be build into an assembly
- A secured assembly directly starts its timer when used in hand instead of opening its UI's
- Bikehorns can be combined with timers, proximity sensors, mousetraps and others
- Chemical grenades don't require an igniter to be strapped into an assembly anymore.
- Most kind of grenades can now be used in assemblies, like chem grenades
- Pipebomb assemblies now have a 1 second explosion delay accross the board. No more easy unreactable insta-gibs through mousetrap bombs.
- Mousetrap rollers are now compatible with anything normal-sized you can put onto a mousetrap-assembly
- The size of assemblies is now equal to the bulkiest item used in the assembly
- Health-analyser assemblies can now be created with grenades/igniters/bikehorns and others
- Health-analyser assemblies activate their attached equipment 3 seconds after the death of someone when worn directly. Use a suicide vests if you want to use bigger appliences like pipebombs or plasmatanks
- Attaching a multitool onto an assembly with a plasma tank allows it to detonate akin to using an igniter
- Attaching a borg arm onto an assembly enables pies to be placed onto the arm
- Borg arms on assemblies throw their pie at the nearest target in a 6 tile radius around the assembly when triggered
- Assemblies cam't be electroplated anymore. Instead, the materials of the parts within the assembly are affected correctly
- Singletank bombs or beaker assemblies now show their contents when scanned with atmospheric or chemical scanners respectively
- There is an internal 3 second cooldown between activation of assemblies. You need to try harder to spam bikehorn assemblies, clown...

Changelog



Code:
changelog
(u)Lord_Earthfire
(*)The way of constructing igniter/pipebomb/whatever-assemblies has been completely reworked. Check out the [PR page](https://github.com/goonstation/goonstation/pull/22115) for full details.
(*)The assembly of canbombs has been changed. You start their construction with a timer/multitool/plasma-tank-assembly, add an igniter to it, add some cabling and then you can complete the construction or add additions like bikehorns or signalers to it.


PULL REQUEST DETAILS


RE: [PR] `/obj/item/assembly`-Rework - Lord_earthfire - 02-24-2025

I will extend the PR's description to contain all changes done to assemblies. But the changelog should have everything that will be new about them.

Overall, they should be much easier to build, wield, modify and use. No more unsecuring igniters or radios, no more does it block using an igniter on a timer but allowing the use of a timer on an igniter (or the other way around)

Also, no more fiddling around with TGUI to activate and throw a beaker assembly. Take a secured timer/igniter assembly, use it in hand and throw it. Just like a grenade!

In general, much more types of assemblies should be able to be done with this PR.


RE: [PR] `/obj/item/assembly`-Rework - Lefinch - 02-24-2025

Seems like an awesome no-nonsense QoL improvement, I'm not so sure about the mail chute bomb effort but that's from more of an RP/player behaviour perspective than its handling itself so not really relevant to the PR.


RE: [PR] `/obj/item/assembly`-Rework - Lord_earthfire - 02-25-2025

There is quite a bit mire than QoL innthat rework. There are new assembly types and some changes in behaviour. E.g. borg arms can be attached onto timers and when activated throw pies at the nearest person in a radius. Singletank bombs can be placed unto mousetrap rollers. Or bike horns onto proximity sensors.


RE: [PR] `/obj/item/assembly`-Rework - Lefinch - 02-25-2025

Oh I apologise that you felt the QoL were implied to be exclusive. They were not in any way shape or form, given there's a nice checklist above and in the PR itself it was just a part of what I was commenting on. To be clear: I like the QoL improvements, there are other things going on in the PR, I'm not commenting on them currently. Hopefully others will!


RE: [PR] `/obj/item/assembly`-Rework - Lord_earthfire - 02-25-2025

Don't worry, i was only concerned if i didn't communicated properly and people had the impression its mostly QoL. I don't want to hide the other balance implications that come from the changes.