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

Uncloaking based on unit HP is hard coded #12741

Closed
forcecore opened this issue Feb 10, 2017 · 5 comments
Closed

Uncloaking based on unit HP is hard coded #12741

forcecore opened this issue Feb 10, 2017 · 5 comments

Comments

@forcecore
Copy link
Contributor

forcecore commented Feb 10, 2017

Hi, I'm trying to make ants keep burrowed to the ground even when the ant is in critical damage state. It seems the related code is hardcoded.

if (damageDisabled || Info.UncloakOn.HasFlag(UncloakType.Damage))

void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
{
    damageDisabled = e.DamageState >= DamageState.Critical;
    if (damageDisabled || Info.UncloakOn.HasFlag(UncloakType.Damage))
        Uncloak();
}

No SC1 Dark Templars for OpenRA :(

@forcecore
Copy link
Contributor Author

forcecore commented Feb 10, 2017

UncloakType.Damage seems ambiguous to me. If it is supposed to reveal a clocked unit when the unit has been hit by something, then a better name would be OnHit or OnDamage. In this case, damageDisabled is hard coded.

On the other hand, if it was supposed to mean damage state, then || operator should become &&, and the could be renamed to CriticalDamageState.

@pchote
Copy link
Member

pchote commented Feb 10, 2017

The damageDisabled bit can be removed completely, mods that want to disable based on damage state can do this using conditions.

@forcecore
Copy link
Contributor Author

Sounds like an easy fix. I'll branch from bleed and submit a PR when done. Both Cloak.cs and YAML files.

forcecore added a commit to forcecore/OpenRA that referenced this issue Feb 12, 2017
To unhard code uncloak behavior getting disabled by the unit's critical HP.
forcecore added a commit to forcecore/OpenRA that referenced this issue Feb 25, 2017
To unhard code uncloak behavior getting disabled by the unit's critical HP.
pchote added a commit that referenced this issue Mar 3, 2017
Unhardcode disableCloak on critical HP (#12741)
@forcecore
Copy link
Contributor Author

PR #12759 accepted, closing.

@pchote
Copy link
Member

pchote commented Mar 3, 2017

Note that you can make GitHub close issues automatically by putting e.g. "Fixes #12741" in a PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants