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

Graytide Virus Event #1293

Merged
merged 5 commits into from
Jan 2, 2025
Merged

Conversation

VMSolidus
Copy link
Member

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

🆑

  • add: Added the GR4YT1D3 Virus event.

@github-actions github-actions bot added Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: YML Changes any yml files labels Nov 29, 2024
@sleepyyapril sleepyyapril added Priority: 4-Low Should be resolved at some point Size: 3-Medium For medium issues/PRs Type: Feature Creation of or significant changes to a feature labels Nov 30, 2024
@sleepyyapril sleepyyapril self-requested a review November 30, 2024 20:59
@github-actions github-actions bot added the Status: Needs Review Someone please review this label Nov 30, 2024
@sleepyyapril sleepyyapril added Status: Do Not Merge Do not merge and removed Status: Needs Review Someone please review this labels Nov 30, 2024
@sleepyyapril sleepyyapril self-requested a review December 1, 2024 10:43
@github-actions github-actions bot added the Status: Needs Review Someone please review this label Dec 1, 2024
Comment on lines 47 to 51
airlocks.Add(airlockUid);
}
foreach (var target in airlocks)
Timer.Spawn(TimeSpan.FromSeconds(_random.NextDouble(component.MinimumTimeToEmag, component.MaximumTimeToEmag)), () =>
_emag.DoEmagEffect(uid, 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 can probably remove the whole airlocks list and do it inside the while block

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Member Author

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.

@Aidenkrz
Copy link
Contributor

Aidenkrz commented Jan 2, 2025

@VMSolidus VMSolidus merged commit 2e66dc9 into Simple-Station:master Jan 2, 2025
10 of 11 checks passed
SimpleStation14 added a commit that referenced this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: YML Changes any yml files Priority: 4-Low Should be resolved at some point Size: 3-Medium For medium issues/PRs Status: Do Not Merge Do not merge Status: Needs Review Someone please review this Type: Feature Creation of or significant changes to a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants