-
Notifications
You must be signed in to change notification settings - Fork 189
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
Graytide Virus Event #1293
Graytide Virus Event #1293
Conversation
Content.Server/StationEvents/Components/AirlockVirusRuleComponent.cs
Outdated
Show resolved
Hide resolved
airlocks.Add(airlockUid); | ||
} | ||
foreach (var target in airlocks) | ||
Timer.Spawn(TimeSpan.FromSeconds(_random.NextDouble(component.MinimumTimeToEmag, component.MaximumTimeToEmag)), () => | ||
_emag.DoEmagEffect(uid, 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 can probably remove the whole airlocks
list and do it inside the while
block
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.
I'm fatally allergic to while loops lmao. I'm horribly foreachpilled.
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're iterating over the airlocks twice basically. First time you're gathering them in while
querry, next time you're applying effects to them. This is simply redundant
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.
Ahhh. Actually I see how you're right. gimme a few minutes to drop the PR I'm about to drop and I'll do this right away.
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.
Got it! There is now no longer a second loop. If an airlock passes the check, it targets that airlock with the emag timer.
Description
This is a simple event remake of the classic Graytide Virus event from SS13. A virus infects "Some of the airlocks" on the station, but more specifically it infects the security airlocks, causing them to emag themselves after a short delay. As the name of the airlock virus implies, this lets the prisoners out, and the greytiders in, until an engineer can get to sec and repair the airlocks. It can be a rare and somewhat very literal "Get Outa Jail/Second Chance" for traitors who are caught and permabrigged earlier in the round.
Changelog
🆑