* create biome tile spawner * spawner now spawn decals and entities * fancy spawners * remove old decals * randomize seed * fix bugs * update alchemy test map to new system * update z-level system * autolink tweak * add documentation * Update GravityComponent.cs * Update GravityComponent.cs
47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using Content.Server.Parallax;
|
|
using Content.Server.Station.Components;
|
|
using Content.Server.Station.Events;
|
|
using Content.Server.Station.Systems;
|
|
using Content.Shared.Teleportation.Systems;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Server.Maps;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Server._CP14.StationDungeonMap;
|
|
|
|
public sealed partial class CP14StationAdditionalMapSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly BiomeSystem _biome = default!;
|
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
|
[Dependency] private readonly MapSystem _map = default!;
|
|
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
|
[Dependency] private readonly LinkedEntitySystem _linkedEntity = default!;
|
|
[Dependency] private readonly StationSystem _station = default!;
|
|
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<CP14StationAdditionalMapComponent, StationPostInitEvent>(OnStationPostInit);
|
|
}
|
|
|
|
private void OnStationPostInit(Entity<CP14StationAdditionalMapComponent> addMap, ref StationPostInitEvent args)
|
|
{
|
|
if (!TryComp(addMap, out StationDataComponent? dataComp))
|
|
return;
|
|
|
|
foreach (var path in addMap.Comp.MapPaths)
|
|
{
|
|
var mapUid = _map.CreateMap(out var mapId);
|
|
Log.Info($"Created map {mapId} for StationAdditionalMap system");
|
|
var options = new MapLoadOptions { LoadMap = true };
|
|
if (!_mapLoader.TryLoad(mapId, path.ToString(), out var roots, options))
|
|
{
|
|
Log.Error($"Failed to load map from {path}!");
|
|
Del(mapUid);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|