-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
InnerBodyAnomalies now send an event when the host dies. Zombies cancels this event if the host is turning into a zombie.
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
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
🆑