Skip to content

Commit

Permalink
Push space dungeons into gameset, name dungeons
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Oct 22, 2024
1 parent 33258e8 commit deed491
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Content.Shared.Procedural;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server._NF.GameRule.Components;

[RegisterComponent, Access(typeof(NfAdventureRuleSystem))]
Expand All @@ -9,4 +12,7 @@ public sealed partial class AdventureRuleComponent : Component
public List<EntityUid> RequiredPois = new();
public List<EntityUid> OptionalPois = new();
public List<EntityUid> UniquePois = new();

[DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<DungeonConfigPrototype>))]
public List<string> SpaceDungeons = new();
}
9 changes: 5 additions & 4 deletions Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,9 @@ protected override void Started(EntityUid uid, AdventureRuleComponent component,
// Using invalid entity, we don't have a relevant entity to reference here.
RaiseLocalEvent(EntityUid.Invalid, new StationsGeneratedEvent(), broadcast: true); // TODO: attach this to a meaningful entity.

var dungenTypes = _prototypeManager.EnumeratePrototypes<DungeonConfigPrototype>();

foreach (var dunGen in dungenTypes)
foreach (var dungeonProto in component.SpaceDungeons)
{
if (dunGen.SkipDungeonGen)
if (!_prototypeManager.TryIndex<DungeonConfigPrototype>(dungeonProto, out var dunGen))
continue;

var seed = _random.Next();
Expand All @@ -279,6 +277,9 @@ protected override void Started(EntityUid uid, AdventureRuleComponent component,
_shuttle.AddIFFFlag(grids[0], IFFFlags.HideLabel);
_console.WriteLine(null, $"dungeon spawned at {offset}");

string dungeonName = Loc.GetString("adventure-space-dungeon-name", ("dungeonPrototype", dungeonProto));
_meta.SetEntityName(grids[0], dungeonName);

//pls fit the grid I beg, this is so hacky
//its better now but i think i need to do a normalization pass on the dungeon configs
//because they are all offset. confirmed good size grid, just need to fix all the offsets.
Expand Down
5 changes: 0 additions & 5 deletions Content.Shared/Procedural/DungeonConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,4 @@ public sealed class DungeonConfigPrototype : DungeonConfig, IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;

// Frontier: skip dungeon generation
[DataField]
public bool SkipDungeonGen = false;
// End Frontier
}
4 changes: 3 additions & 1 deletion Resources/Locale/en-US/_NF/adventure/adventure.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ changelog-tab-title-Upstream = Upstream Changelog
multiauth-already-connected = Already connected to Frontier Official servers.
public-transit-departure = Now departing for {$destination}. Estimated travel time: {$flytime} seconds.
public-transit-arrival = Thank you for choosing NT Public Transit. Next transfer to {$destination} departs in {$waittime} seconds.
public-transit-arrival = Thank you for choosing NT Public Transit. Next transfer to {$destination} departs in {$waittime} seconds.
adventure-space-dungeon-name = Space Dungeon: {$dungeonPrototype}
1 change: 0 additions & 1 deletion Resources/Prototypes/Procedural/dungeon_configs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Base configs
- type: dungeonConfig
id: PlanetBase
skipDungeonGen: true # Frontier
layers:
- !type:PrefabDunGen
presets:
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/_NF/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
categories: [ HideSpawnMenu ]
components:
- type: AdventureRule
spaceDungeons:
- CaveFactory
- MedSci
- FactoryDorms
- LavaMercenary
- VirologyLab
- SalvageOutpost
# Upstream definitions
- Experiment
- SnowyLabs
- LavaBrig # Skipping Mineshaft, Haunted; they're in caves

- type: entity
id: BluespaceEventScheduler
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/_NF/Procedural/dungeon_configs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Base dungeon prototypes
- type: dungeonConfig
id: Everything
skipDungeonGen: true # Frontier
layers:
- !type:PrefabDunGen
presets:
Expand Down

0 comments on commit deed491

Please sign in to comment.