From 22254734aa57b6c626a877b7fa64592d84e10792 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 24 Sep 2025 01:13:53 +0300 Subject: [PATCH] lurker hunt trying --- .../GameTicking/Rules/CP14LurkerHuntRule.cs | 30 +++++++++++++++++++ .../CP14StationAdditionalModifierRule.cs | 16 ++++++++-- .../Components/CP14LurkerHuntRuleComponent.cs | 9 ++++++ .../CP14LocationGenerationSystem.cs | 5 ---- .../_CP14/GameRules/subgamemodes.yml | 10 +++++++ 5 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 Content.Server/_CP14/GameTicking/Rules/CP14LurkerHuntRule.cs create mode 100644 Content.Server/_CP14/GameTicking/Rules/Components/CP14LurkerHuntRuleComponent.cs create mode 100644 Resources/Prototypes/_CP14/GameRules/subgamemodes.yml diff --git a/Content.Server/_CP14/GameTicking/Rules/CP14LurkerHuntRule.cs b/Content.Server/_CP14/GameTicking/Rules/CP14LurkerHuntRule.cs new file mode 100644 index 0000000000..c9a652ef38 --- /dev/null +++ b/Content.Server/_CP14/GameTicking/Rules/CP14LurkerHuntRule.cs @@ -0,0 +1,30 @@ +using Content.Server._CP14.GameTicking.Rules.Components; +using Content.Server.GameTicking.Rules; +using Content.Shared.GameTicking.Components; + +namespace Content.Server._CP14.GameTicking.Rules; + +public sealed class CP14LurkerHuntRule : GameRuleSystem +{ + public override void Initialize() + { + base.Initialize(); + + } + + + protected override void Added(EntityUid uid, CP14LurkerHuntRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args) + { + + + + } + + protected override void Started(EntityUid uid, + CP14LurkerHuntRuleComponent component, + GameRuleComponent gameRule, + GameRuleStartedEvent args) + { + + } +} diff --git a/Content.Server/_CP14/GameTicking/Rules/CP14StationAdditionalModifierRule.cs b/Content.Server/_CP14/GameTicking/Rules/CP14StationAdditionalModifierRule.cs index 586b3c88a6..a223d6817d 100644 --- a/Content.Server/_CP14/GameTicking/Rules/CP14StationAdditionalModifierRule.cs +++ b/Content.Server/_CP14/GameTicking/Rules/CP14StationAdditionalModifierRule.cs @@ -1,6 +1,8 @@ +using Content.Server._CP14.Demiplane; using Content.Server._CP14.GameTicking.Rules.Components; using Content.Server._CP14.Procedural; using Content.Server.GameTicking.Rules; +using Content.Server.Station.Components; namespace Content.Server._CP14.GameTicking.Rules; @@ -11,14 +13,24 @@ public sealed class CP14StationAdditionalModifierRule : GameRuleSystem(OnBeforeStationLocationGeneration); + SubscribeLocalEvent(OnFinishMapGeneration); + } + + private void OnFinishMapGeneration(Entity ent, ref CP14LocationGeneratedEvent args) + { + var query = QueryAllRules(); + while (query.MoveNext(out var uid, out var rule, out var gameRule)) + { + + } } private void OnBeforeStationLocationGeneration(CP14BeforeStationLocationGenerationEvent ev) { var query = QueryAllRules(); - while (query.MoveNext(out var uid, out var huntRule, out var gameRule)) + while (query.MoveNext(out var uid, out var rule, out var gameRule)) { - ev.AddModifiers(huntRule.Modifiers); + ev.AddModifiers(rule.Modifiers); } } } diff --git a/Content.Server/_CP14/GameTicking/Rules/Components/CP14LurkerHuntRuleComponent.cs b/Content.Server/_CP14/GameTicking/Rules/Components/CP14LurkerHuntRuleComponent.cs new file mode 100644 index 0000000000..807749ba15 --- /dev/null +++ b/Content.Server/_CP14/GameTicking/Rules/Components/CP14LurkerHuntRuleComponent.cs @@ -0,0 +1,9 @@ +using Content.Shared._CP14.Procedural.Prototypes; +using Robust.Shared.Prototypes; + +namespace Content.Server._CP14.GameTicking.Rules.Components; + +[RegisterComponent, Access(typeof(CP14LurkerHuntRule))] +public sealed partial class CP14LurkerHuntRuleComponent : Component +{ +} diff --git a/Content.Server/_CP14/Procedural/CP14LocationGenerationSystem.cs b/Content.Server/_CP14/Procedural/CP14LocationGenerationSystem.cs index 7afd9da44c..1415ae0bd0 100644 --- a/Content.Server/_CP14/Procedural/CP14LocationGenerationSystem.cs +++ b/Content.Server/_CP14/Procedural/CP14LocationGenerationSystem.cs @@ -132,11 +132,6 @@ public sealed class CP14BeforeStationLocationGenerationEvent(List> Modifiers = modifiers; - public void AddModifier(ProtoId toAdd) - { - Modifiers.Add(toAdd); - } - public void AddModifiers(IEnumerable> toAdd) { Modifiers.AddRange(toAdd); diff --git a/Resources/Prototypes/_CP14/GameRules/subgamemodes.yml b/Resources/Prototypes/_CP14/GameRules/subgamemodes.yml new file mode 100644 index 0000000000..a4fef3b28e --- /dev/null +++ b/Resources/Prototypes/_CP14/GameRules/subgamemodes.yml @@ -0,0 +1,10 @@ +- type: entity + id: CP14LurkerHuntRule + parent: CP14BaseGameRule + components: + - type: CP14StationAdditionalModifierRule + modifiers: + - Geodes + - Geodes + - Geodes + - Geodes \ No newline at end of file