Allow AI and observers to see electrified doors #33466
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the PR
Adds a HUD showing electrification status of doors. Can be given to any mob by adding
ShowElectrocutionHUDComponent
.For now I added it only to the AI and observers, but it could be easily extended to include borgs and the diagnostics HUD as well.
Why / Balance
I recently played on tg and they have this. It makes is easier for the AI to see which doors are currently electrified without having to check every single one of them.
Technical details
The sprite is a simple layer on the electrified entity, so this could easily be extended to any other objects with
ElectrifiedComponent
.This works a little like a mix of an overlay and normal VisualizerSystem. We add a new layer to the electrified entity, which is hidden by default. If the electrification status is changed and the client's current player mob has the
ShowElectrificationHUDComponent
the layer will be toggled. To handle adding/removing the component or switching mobs, we search for all currently existing electrifyable entities and toggle the layer if neccessary.For sanity reasons I renamed the
ElectrifiedVisuals.IsPowered
enum entry toShowSparks
because the old name was a total lie and had nothing to do with the entity being powered, but instead istrue
for a few seconds when zapping someone, which is used for chain fences to show electric sparks. A new entryElectrified
has been added to the enum for storing the electrification status of the entity.Removed some sprite layers from
AirlockShuttle
because those were inherited anyways.The sprite for the HUD was ported from tg, I also ported over
apc_hacked.png
from the same dmi file since that can likely be used later for another AI HUD.Media
electrified.hud.small.mp4
Requirements
Breaking changes
Renamed
enum.ElectrifiedVisuals.IsPowered
toenum.ElectrifiedVisuals.ShowSparks
.Renamed
enum.ElectrifiedLayers.Powered
toenum.ElectrifiedLayers.Sparks
.Changelog
🆑