-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into BorgBorgBorg
- Loading branch information
Showing
25 changed files
with
26,773 additions
and
7 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
Content.Server/DeltaV/StationEvents/Components/GlimmerMobRuleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Content.Server.StationEvents.Events; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.StationEvents.Components; | ||
|
||
[RegisterComponent, Access(typeof(GlimmerMobRule))] | ||
public sealed partial class GlimmerMobRuleComponent : Component | ||
{ | ||
[DataField(required: true)] | ||
public EntProtoId MobPrototype = string.Empty; | ||
} |
56 changes: 56 additions & 0 deletions
56
Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Linq; | ||
using Robust.Shared.Random; | ||
using Content.Server.GameTicking.Rules.Components; | ||
using Content.Server.NPC.Components; | ||
using Content.Server.Psionics.Glimmer; | ||
using Content.Server.StationEvents.Components; | ||
using Content.Shared.Psionics.Glimmer; | ||
using Content.Shared.Abilities.Psionics; | ||
|
||
namespace Content.Server.StationEvents.Events; | ||
|
||
public sealed class GlimmerMobRule : StationEventSystem<GlimmerMobRuleComponent> | ||
{ | ||
[Dependency] private readonly IRobustRandom _robustRandom = default!; | ||
[Dependency] private readonly GlimmerSystem _glimmerSystem = default!; | ||
|
||
|
||
protected override void Started(EntityUid uid, GlimmerMobRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) | ||
{ | ||
base.Started(uid, component, gameRule, args); | ||
|
||
var glimmerSources = EntityQuery<GlimmerSourceComponent, TransformComponent>().ToList(); | ||
var normalSpawnLocations = EntityQuery<VentCritterSpawnLocationComponent, TransformComponent>().ToList(); | ||
var hiddenSpawnLocations = EntityQuery<MidRoundAntagSpawnLocationComponent, TransformComponent>().ToList(); | ||
|
||
var baseCount = Math.Max(1, EntityQuery<PsionicComponent, NpcFactionMemberComponent>().Count() / 10); | ||
int multiplier = Math.Max(1, (int) _glimmerSystem.GetGlimmerTier() - 2); | ||
|
||
var total = baseCount * multiplier; | ||
|
||
int i = 0; | ||
while (i < total) | ||
{ | ||
if (glimmerSources.Count != 0 && _robustRandom.Prob(0.4f)) | ||
{ | ||
Spawn(component.MobPrototype, _robustRandom.Pick(glimmerSources).Item2.Coordinates); | ||
i++; | ||
continue; | ||
} | ||
|
||
if (normalSpawnLocations.Count != 0) | ||
{ | ||
Spawn(component.MobPrototype, _robustRandom.Pick(normalSpawnLocations).Item2.Coordinates); | ||
i++; | ||
continue; | ||
} | ||
|
||
if (hiddenSpawnLocations.Count != 0) | ||
{ | ||
Spawn(component.MobPrototype, _robustRandom.Pick(hiddenSpawnLocations).Item2.Coordinates); | ||
i++; | ||
continue; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- files: [mite.ogg] | ||
copyright: '"mite.ogg" by leonardo-dabepis' | ||
license: CC0-1.0 | ||
source: https://github.com/DeltaV-Station/Delta-v/pull/564 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.