Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow AI and observers to see electrified doors #33466

Merged
merged 5 commits into from
Nov 23, 2024

Conversation

slarticodefast
Copy link
Member

@slarticodefast slarticodefast commented Nov 22, 2024

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 to ShowSparks because the old name was a total lie and had nothing to do with the entity being powered, but instead is true for a few seconds when zapping someone, which is used for chain fences to show electric sparks. A new entry Electrified 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 to enum.ElectrifiedVisuals.ShowSparks.
Renamed enum.ElectrifiedLayers.Powered to enum.ElectrifiedLayers.Sparks.

Changelog
🆑

  • add: The AI and observers can now see if doors are electrified.

@github-actions github-actions bot added S: Needs Review Status: Requires additional reviews before being fully accepted size/L Denotes a PR that changes 1000-4999 lines. Changes: Sprites Changes: Might require knowledge of spriting or visual design. labels Nov 22, 2024
Copy link
Contributor

github-actions bot commented Nov 22, 2024

RSI Diff Bot; head commit de51690 merging into 09ca45a
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/Interface/Misc/ai_hud.rsi

State Old New Status
apc_hacked Added
electrified Added

Edit: diff updated after de51690

@github-actions github-actions bot added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Nov 22, 2024
@beck-thompson beck-thompson added P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. T: New Feature Type: New feature or content, or extending existing content D2: Medium Difficulty: A good amount of codebase knowledge required. A: Silicons Area: Relates to Silicon roles, including AI. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Nov 22, 2024
@metalgearsloth metalgearsloth merged commit 5409815 into space-wizards:master Nov 23, 2024
14 of 15 checks passed
@slarticodefast slarticodefast deleted the powerhud branch November 23, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Silicons Area: Relates to Silicon roles, including AI. Changes: Sprites Changes: Might require knowledge of spriting or visual design. D2: Medium Difficulty: A good amount of codebase knowledge required. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Needs Review Status: Requires additional reviews before being fully accepted size/L Denotes a PR that changes 1000-4999 lines. T: New Feature Type: New feature or content, or extending existing content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants