lurker hunt trying
This commit is contained in:
30
Content.Server/_CP14/GameTicking/Rules/CP14LurkerHuntRule.cs
Normal file
30
Content.Server/_CP14/GameTicking/Rules/CP14LurkerHuntRule.cs
Normal 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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
10
Resources/Prototypes/_CP14/GameRules/subgamemodes.yml
Normal file
10
Resources/Prototypes/_CP14/GameRules/subgamemodes.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- type: entity
|
||||
id: CP14LurkerHuntRule
|
||||
parent: CP14BaseGameRule
|
||||
components:
|
||||
- type: CP14StationAdditionalModifierRule
|
||||
modifiers:
|
||||
- Geodes
|
||||
- Geodes
|
||||
- Geodes
|
||||
- Geodes
|
||||
Reference in New Issue
Block a user