lurker hunt trying

This commit is contained in:
Ed
2025-09-24 01:13:53 +03:00
parent ab47b92ad2
commit 22254734aa
5 changed files with 63 additions and 7 deletions

View File

@@ -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<CP14LurkerHuntRuleComponent>
{
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)
{
}
}

View File

@@ -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<CP14Stati
base.Initialize();
SubscribeLocalEvent<CP14BeforeStationLocationGenerationEvent>(OnBeforeStationLocationGeneration);
SubscribeLocalEvent<BecomesStationComponent, CP14LocationGeneratedEvent>(OnFinishMapGeneration);
}
private void OnFinishMapGeneration(Entity<BecomesStationComponent> 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);
}
}
}

View File

@@ -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
{
}

View File

@@ -132,11 +132,6 @@ public sealed class CP14BeforeStationLocationGenerationEvent(List<ProtoId<CP14Pr
{
public List<ProtoId<CP14ProceduralModifierPrototype>> Modifiers = modifiers;
public void AddModifier(ProtoId<CP14ProceduralModifierPrototype> toAdd)
{
Modifiers.Add(toAdd);
}
public void AddModifiers(IEnumerable<ProtoId<CP14ProceduralModifierPrototype>> toAdd)
{
Modifiers.AddRange(toAdd);

View File

@@ -0,0 +1,10 @@
- type: entity
id: CP14LurkerHuntRule
parent: CP14BaseGameRule
components:
- type: CP14StationAdditionalModifierRule
modifiers:
- Geodes
- Geodes
- Geodes
- Geodes