This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
forked from new-frontiers-14/frontier-station-14
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Space VGRoids support (new-frontiers-14#2334)
* Fix older files * Restore code to support vg roids * Update RoomFillComponent.cs * Update base.yml * Fix unused BaseStationShuttles from outpost * SpawnableFrontierOutpost<RecordsFrontierOutpost --------- Co-authored-by: Whatstone <[email protected]>
- Loading branch information
Showing
17 changed files
with
3,125 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Content.Shared.Procedural; | ||
using Content.Shared.Whitelist; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Procedural; | ||
|
||
/// <summary> | ||
/// Marker that indicates the specified room prototype should occupy this space. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class RoomFillComponent : Component | ||
{ | ||
/// <summary> | ||
/// Are we allowed to rotate room templates? | ||
/// If the room is not a square this will only do 180 degree rotations. | ||
/// </summary> | ||
[DataField] | ||
public bool Rotation = true; | ||
|
||
/// <summary> | ||
/// Size of the room to fill. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public Vector2i Size; | ||
|
||
/// <summary> | ||
/// Rooms allowed for the marker. | ||
/// </summary> | ||
[DataField] | ||
public EntityWhitelist? RoomWhitelist; | ||
|
||
/// <summary> | ||
/// Should any existing entities / decals be bulldozed first. | ||
/// </summary> | ||
[DataField] | ||
public bool ClearExisting; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using Robust.Shared.Map.Components; | ||
|
||
namespace Content.Server.Procedural; | ||
|
||
public sealed class RoomFillSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly DungeonSystem _dungeon = default!; | ||
[Dependency] private readonly SharedMapSystem _maps = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<RoomFillComponent, MapInitEvent>(OnRoomFillMapInit); | ||
} | ||
|
||
private void OnRoomFillMapInit(EntityUid uid, RoomFillComponent component, MapInitEvent args) | ||
{ | ||
// Just test things. | ||
if (component.Size == Vector2i.Zero) | ||
return; | ||
|
||
var xform = Transform(uid); | ||
|
||
if (xform.GridUid != null) | ||
{ | ||
var random = new Random(); | ||
var room = _dungeon.GetRoomPrototype(component.Size, random, component.RoomWhitelist); | ||
|
||
if (room != null) | ||
{ | ||
var mapGrid = Comp<MapGridComponent>(xform.GridUid.Value); | ||
_dungeon.SpawnRoom( | ||
xform.GridUid.Value, | ||
mapGrid, | ||
_maps.LocalToTile(xform.GridUid.Value, mapGrid, xform.Coordinates), | ||
room, | ||
random, | ||
null, | ||
clearExisting: component.ClearExisting, | ||
rotation: component.Rotation); | ||
} | ||
else | ||
{ | ||
Log.Error($"Unable to find matching room prototype for {ToPrettyString(uid)}"); | ||
} | ||
} | ||
|
||
// Final cleanup | ||
QueueDel(uid); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# - type: entity | ||
# id: BaseRoomMarker | ||
# name: Room marker | ||
# parent: MarkerBase | ||
# suffix: Weh | ||
# components: | ||
# - type: RoomFill | ||
# size: 5,5 | ||
# - type: Sprite | ||
# layers: | ||
# - state: red | ||
# - sprite: Mobs/Aliens/elemental.rsi | ||
# state: alive | ||
- type: entity | ||
id: BaseRoomMarker | ||
name: Room marker | ||
parent: MarkerBase | ||
suffix: Weh | ||
components: | ||
- type: RoomFill | ||
size: 5,5 | ||
- type: Sprite | ||
layers: | ||
- state: red | ||
- sprite: Mobs/Aliens/elemental.rsi | ||
state: alive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
186 changes: 93 additions & 93 deletions
186
Resources/Prototypes/Procedural/Themes/vgroidinterior.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,105 @@ | ||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5a | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 0,0 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5a | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 0,0 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5b | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 6,0 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5b | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 6,0 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5c | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 12,0 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5c | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 12,0 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5d | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 18,0 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5d | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 18,0 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5e | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 0,6 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5e | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 0,6 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5f | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 6,6 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5f | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 6,6 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5g | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 12,6 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5g | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 12,6 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5h | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 18,6 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5h | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 18,6 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5i | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 0,12 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5i | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 0,12 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5j | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 6,12 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5j | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 6,12 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5k | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 12,12 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5k | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 12,12 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: dungeonRoom | ||
# id: VGRoidInterior5x5l | ||
# size: 5,5 | ||
# atlas: /Maps/Dungeon/vgroidinterior.yml | ||
# offset: 18,12 | ||
# tags: | ||
# - VGRoidInterior | ||
- type: dungeonRoom | ||
id: VGRoidInterior5x5l | ||
size: 5,5 | ||
atlas: /Maps/Dungeon/vgroidinterior.yml | ||
offset: 18,12 | ||
tags: | ||
- VGRoidInterior | ||
|
||
# - type: entity | ||
# id: VGRoidInteriorRoomMarker | ||
# parent: BaseRoomMarker | ||
# name: VGRoid interior marker | ||
# components: | ||
# - type: RoomFill | ||
# roomWhitelist: | ||
# tags: | ||
# - VGRoidInterior | ||
- type: entity | ||
id: VGRoidInteriorRoomMarker | ||
parent: BaseRoomMarker | ||
name: VGRoid interior marker | ||
components: | ||
- type: RoomFill | ||
roomWhitelist: | ||
tags: | ||
- VGRoidInterior |
Oops, something went wrong.