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

Damaged Unit image #1446

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Fryone
Copy link
Contributor

@Fryone Fryone commented Dec 8, 2024

This changes unit's image if it's health is in ConditionYellow or ConditionRed

[SOMEUNIT] ; UnitType
DamagedImage.ConditionYellow= ; UnitType entry
DamagedImage.ConditionRed= ; UnitType entry
WaterDamagedImage.ConditionYellow= ; UnitType entry
WaterDamagedImage.ConditionRed= ; UnitType entry

2 new sections for image changes
Copy link

github-actions bot commented Dec 8, 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.

@NetsuNegi
Copy link
Contributor

is there possibly to specify shp filename instead of unittype ?

@Fryone
Copy link
Contributor Author

Fryone commented Dec 10, 2024

That would be awesome, but it's harder to implement. Instead, this one using same method as Ares' WaterImage. Plus, you don't need to have/copy all of the entries of unittype for this images, instead only those that affect image, like Turret=yes or NoSpawnAlt=yes

@Fryone
Copy link
Contributor Author

Fryone commented Dec 10, 2024

And, in theory, it also should work for shp units, but I couldn't implement for the terror drone, so probably, I'm missing something.

@Aephiex
Copy link
Contributor

Aephiex commented Dec 10, 2024

Maybe HeavilyDamagedImage= and HeavilyDamagedWaterImage= for red HP as well? If not specified, fallback to the yellow HP.

@NetsuNegi
Copy link
Contributor

Maybe HeavilyDamagedImage= and HeavilyDamagedWaterImage= for red HP as well? If not specified, fallback to the yellow HP.

I think DamagedImage.ConditionYellow, DamagedImage.ConditionRed is more better, water image also

- separated damage images for yellow and red states
- fixed, so it's working with SHP units now
}
}

R->EAX(pThis->WalkedFramesSoFar);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just return 0 and the overlapped assembly will be recovered. As far as I know, you only need to restore the assembly manually if you overlapped some jump code, like jz or jmp.

@@ -466,6 +466,20 @@ int TechnoExt::ExtData::GetAttachedEffectCumulativeCount(AttachEffectTypeClass*
return foundCount;
}

UnitTypeClass* TechnoExt::ExtData::GetUnitTypeExtra(bool isRedHP) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you should move the health checks into the extra function. Thus others can reuse this function if they want to further expand the image.

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.

4 participants