Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

2 new tags for hiding the shield bar or recharge shields

Open FS-21 opened this issue 2 years ago • 9 comments

  • Pips.HideIfNoStrength can be used to hide the shield's pip frame if the Strength is 0.

  • PoweredBy can be used to control the self-heal of the shield. If the owner has no structures from this list then the shield won't self-heal.

[SOMESHIELDTYPE] ; ShieldType name PoweredBy= ; List of BuildingType names Pips.HideIfNoStrength=false ; boolean

Summary by CodeRabbit

  • New Features
    • Shields now have a self-healing feature, enabled by specific building types.
    • Shields' pip frame will now be hidden if the strength is zero.
  • Bug Fixes
    • Adjustments made for building weapons, info tip, and reveal production cameo positioning.
    • Added support for TurretOffset for SHP vehicles.
  • Documentation
    • Updated documentation to reflect new and enhanced logics for shields.
  • Credits
    • Acknowledged the contribution of an unspecified contributor for the new shield features.

FS-21 avatar Nov 08 '23 15:11 FS-21

## Walkthrough

The recent changes primarily focus on enhancing the shield functionality in the game. New properties have been introduced to control the self-healing of shields, hide the shield's pip frame when the strength is zero, and specify the buildings that enable self-healing. These changes have been implemented across various files, including documentation, source code, and credits.

## Changes

| File(s) | Summary |
| --- | --- |
| `CREDITS.md`, `docs/New-or-Enhanced-Logics.md`, `docs/Whats-New.md` | Added and documented new properties for shields: `SelfHealing.EnabledBy`, `Pips.HideIfNoStrength`, and `PoweredBy`. Also mentioned various fixes and enhancements. |
| `src/New/Entity/ShieldClass.cpp` | Introduced a new member variable `IsPoweredBy` and function `PoweredByCheck` to handle the power status of the shield. Modified existing functions to accommodate the new properties. |
| `src/New/Type/ShieldTypeClass.cpp`, `src/New/Type/ShieldTypeClass.h` | Added new properties to the `ShieldTypeClass`: `SelfHealing_EnabledBy`, `Pips_HideIfNoStrength`, and `Pips_HideIfNoStrength`. These properties are loaded from an INI file and serialized. |

## Poem

> 🍂 As the leaves fall, the shields rise, 🛡️
>
> With strength unseen by mortal eyes. 👀
>
> Healing themselves, hiding their pips, 🌟
>
> Powered by buildings, giving enemies slips. 🏢
>
> On this day, we celebrate the code, 🎉
>
> A rabbit's journey on the open road. 🐇
>
> So here's to changes, big and small, 🥂
>
> In the spirit of autumn, we embrace them all. 🍁

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

:bangbang: IMPORTANT Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Nov 08 '23 15:11 coderabbitai[bot]

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Nov 08 '23 15:11 github-actions[bot]

@coderabbitai review

Metadorius avatar Nov 08 '23 16:11 Metadorius

@coderabbitai review

FS-21 avatar Nov 08 '23 19:11 FS-21

PoweredBy as a name is extremely misleading considering it only affects SelfHealing. It should be made clear it is only self-healing related if it is to stay like that.

Starkku avatar Nov 09 '23 11:11 Starkku

SelfHealing.EnabledBy ?

FS-21 avatar Nov 09 '23 11:11 FS-21

SelfHealing.EnabledBy ?

Much more appropriate.

EDIT: Technically probably also currently doable without bespoke logic using the Warhead modifiers to enable self-healing. Possible that there's some edge-cases where they don't behave quite identically depending on the exact numbers put in though.

Starkku avatar Nov 09 '23 13:11 Starkku

Applied the tag rename "SelfHealing.EnabledBy"

FS-21 avatar Nov 09 '23 16:11 FS-21

The current implementation also disables shield regen / respawn when the buildings are depowered or deactivated, so I'd open this discussion to see whether there's a need to support this case: disabling regen / respawn when these buildings (and to an extent, Technos) are existed no matter their stats.

Coronia avatar May 19 '24 11:05 Coronia