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

Faking Digital Display of Health #1418

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Coronia
Copy link
Contributor

@Coronia Coronia commented Nov 7, 2024

  • If a TechnoType has a DigitalDisplayType with InfoType=Health, it's allowed to display fake values to enemy players.
    • DigitalDisplay.Health.FakeStrength, if set, will be used as the maximum value of health display. The current value will be displayed as the percentage of its current health multiplies the new maximum value.
    • DigitalDisplay.Health.FakeAtDisguise, if set to true on an InfantryType with Disguise, will use the disguised TechnoType's Strength value as the maximum value of health display. The current value will be displayed as the percentage of its current health multiplies the new maximum value. This will be applied before DigitalDisplay.Health.FakeStrength.

In rulesmd.ini:

[SOMETECHNOTYPE]
DigitalDisplay.Health.FakeStrength=-1       ; integer
DigitalDisplay.Health.FakeAtDisguise=true   ; boolean

Copy link

github-actions bot commented Nov 7, 2024

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.

Copy link
Member

@Metadorius Metadorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks mostly good, can be simplified though IMO.

src/Ext/Techno/Body.Visuals.cpp Outdated Show resolved Hide resolved
@@ -46,50 +46,56 @@ IngameScore.LoseTheme= ; Soundtrack theme ID
- Default `Shape.Spacing` for buildings is `4,-2`, `4,0` for others.
- `ValueScaleDivisor` can be used to adjust scale of displayed values. Both the current & maximum value will be divided by the integer number given, if higher than 1.

- If a TechnoType has a DigitalDisplayType with `InfoType=Health`, it's allowed to display fake values to enemy players.
- `DigitalDisplay.Health.FakeStrength`, if set, will be used as the maximum value of health display. The current value will be displayed as the percentage of its current health multiplies the new maximum value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what is the use of this tag? IMO it makes sense to almost always have digital display to display the disguise target's strength.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be used in cases where you want to cheat your enemies. For example, there's a decoy type of units which only have half of the strength as the original one, so we can use this tag to fake it like the real ones.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't they just disguise as the main unit and automatically inherit it's display of strength?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I explained clearly, but I meant something like Nod's Decoy Army in CnC3, which is unit with same appearance but weaker in order to confuse enemies and attract firepower. Disguise as main unit won't work for decoys of VehicleTypes, also using value instead of reading from another TechnoType allows more customization.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I understood that. IMO it's better to fix disguise logic to work with vehicles and ensure disguising can work for decoy purposes (I know for sure people already use it like this using Phobos logics). If that is done, I feel like there would be no use case for such tag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recall correctly, @Otamaa has vehicle disguising fixed in his fork.

@Metadorius Metadorius self-assigned this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants