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

Zombies keep their anomalies on zombification #33867

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

Conversation

pcaessayrs
Copy link

@pcaessayrs pcaessayrs commented Dec 15, 2024

About the PR

Infected people will no longer lose their anomaly when they turn into a zombie. Normally, an entity hosting an anomaly loses that anomaly when dying, which also is when they would turn into a zombie - instead they will turn into a zombie first, and their zombie will still have the anomaly.

Why / Balance

This allows for anomaly zombies to exist, increasing the variety and interest of zombie types by allowing anomalies and zombies to interact.

Technical details

InnerBodyAnomalySystem checks for PendingZombieComponent before removing the anomaly in OnMobStateChanged to dead.

Media

anombies.webm
Shows a person turning into a zombie, still having anomaly powers, and then dying as a zombie and finally losing it.

Requirements

Breaking changes

None

Changelog

🆑

  • tweak: Anomaly hosts keep their anomaly when turning into a zombie.

@pcaessayrs pcaessayrs requested a review from TheShuEd as a code owner December 15, 2024 00:41
@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/XS Denotes a PR that changes 0-9 lines. S: Needs Review Status: Requires additional reviews before being fully accepted labels Dec 15, 2024
Copy link
Contributor

@beck-thompson beck-thompson left a comment

Choose a reason for hiding this comment

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

Great first PR!

@@ -186,6 +187,9 @@ private void OnMobStateChanged(Entity<InnerBodyAnomalyComponent> ent, ref MobSta
if (args.NewMobState != MobState.Dead)
return;

if (EntityManager.HasComponent<PendingZombieComponent>(args.Target))
Copy link
Contributor

Choose a reason for hiding this comment

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

You should use HasComp<PendingZombieComponent>(args.Target) instead (Same thing but neater)! Also, what you should probably also do is instead send an event the target seeing if it wants to cancel, and then then the zombie system can listen for that and then cancel it. If you need some examples of how this is done let me know or ask in the discord!

Copy link
Member

@slarticodefast slarticodefast Dec 15, 2024

Choose a reason for hiding this comment

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

Yep, using an event is the right way to go. The way you are doing it you are hardcoding zombies into the anomaly system. If a fork does not have zombies this will break.

Copy link
Author

Choose a reason for hiding this comment

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

Okay! I will make those changes tomorrow.

Copy link
Author

Choose a reason for hiding this comment

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

Okay, @beck-thompson, do you have examples of where to look for how this is done?

@beck-thompson beck-thompson added T: Bugfix Type: Bugs and/or bugfixes P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. D3: Low Difficulty: Some codebase knowledge required. A: Roundflow/Antag Area: Roundflow - "What happens in the game", including antagonist roles and their capabilities A: Science Area: Science department, not including Silicons. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Dec 15, 2024
@slarticodefast slarticodefast added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted labels Dec 15, 2024
@TheShuEd TheShuEd added the S: Conceptual Approval Status: Discussed by maintainers and has conceptual approval, but needs code review label Dec 15, 2024
InnerBodyAnomalies now send an event when the host dies.
Zombies cancels this event if the host is turning into a zombie.
@github-actions github-actions bot added size/S Denotes a PR that changes 10-29 lines. and removed size/XS Denotes a PR that changes 0-9 lines. labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Roundflow/Antag Area: Roundflow - "What happens in the game", including antagonist roles and their capabilities A: Science Area: Science department, not including Silicons. D3: Low Difficulty: Some codebase knowledge required. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Awaiting Changes Status: Changes are required before another review can happen S: Conceptual Approval Status: Discussed by maintainers and has conceptual approval, but needs code review size/S Denotes a PR that changes 10-29 lines. T: Bugfix Type: Bugs and/or bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants