Skip to content

Commit

Permalink
Merge branch 'master' into hydroco-powdered-drinks
Browse files Browse the repository at this point in the history
Signed-off-by: DisposableCrewmember42 <[email protected]>
  • Loading branch information
DisposableCrewmember42 authored Nov 25, 2024
2 parents 53c90e0 + 02f4007 commit d0e5f52
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 43 deletions.
25 changes: 9 additions & 16 deletions Content.Server/Procedural/DungeonJob/DungeonJob.PostGenBiome.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Threading.Tasks;
using Content.Server.Parallax;
using Content.Shared.Maps;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Procedural;
using Content.Shared.Procedural.PostGeneration;
Expand All @@ -16,43 +15,35 @@ public sealed partial class DungeonJob
/// </summary>
private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon, HashSet<Vector2i> reservedTiles, Random random)
{
if (!_prototype.TryIndex(dunGen.BiomeTemplate, out var indexedBiome))
if (_entManager.TryGetComponent(_gridUid, out BiomeComponent? biomeComp))
return;

biomeComp = _entManager.AddComponent<BiomeComponent>(_gridUid);
var biomeSystem = _entManager.System<BiomeSystem>();

biomeSystem.SetTemplate(_gridUid, biomeComp, _prototype.Index(dunGen.BiomeTemplate));
var seed = random.Next();
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();

var tiles = _maps.GetAllTilesEnumerator(_gridUid, _grid);
while (tiles.MoveNext(out var tileRef))
foreach (var node in dungeon.RoomTiles)
{
var node = tileRef.Value.GridIndices;

if (reservedTiles.Contains(node))
continue;

if (dunGen.TileMask is not null)
{
if (!dunGen.TileMask.Contains(((ContentTileDefinition) _tileDefManager[tileRef.Value.Tile.TypeId]).ID))
continue;
}

// Need to set per-tile to override data.
if (biomeSystem.TryGetTile(node, indexedBiome.Layers, seed, _grid, out var tile))
if (biomeSystem.TryGetTile(node, biomeComp.Layers, seed, _grid, out var tile))
{
_maps.SetTile(_gridUid, _grid, node, tile.Value);
}

if (biomeSystem.TryGetDecals(node, indexedBiome.Layers, seed, _grid, out var decals))
if (biomeSystem.TryGetDecals(node, biomeComp.Layers, seed, _grid, out var decals))
{
foreach (var decal in decals)
{
_decals.TryAddDecal(decal.ID, new EntityCoordinates(_gridUid, decal.Position), out _);
}
}

if (tile is not null && biomeSystem.TryGetEntity(node, indexedBiome.Layers, tile.Value, seed, _grid, out var entityProto))
if (biomeSystem.TryGetEntity(node, biomeComp, _grid, out var entityProto))
{
var ent = _entManager.SpawnEntity(entityProto, new EntityCoordinates(_gridUid, node + _grid.TileSizeHalfVector));
var xform = xformQuery.Get(ent);
Expand All @@ -70,5 +61,7 @@ private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon
if (!ValidateResume())
return;
}

biomeComp.Enabled = false;
}
}
2 changes: 1 addition & 1 deletion Content.Shared/Parallax/Biomes/SharedBiomeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public bool TryGetEntity(Vector2i indices, BiomeComponent component, MapGridComp
}


public bool TryGetEntity(Vector2i indices, List<IBiomeLayer> layers, Tile tileRef, int seed, MapGridComponent grid,
private bool TryGetEntity(Vector2i indices, List<IBiomeLayer> layers, Tile tileRef, int seed, MapGridComponent grid,
[NotNullWhen(true)] out string? entity)
{
var tileId = TileDefManager[tileRef.TypeId].ID;
Expand Down
7 changes: 0 additions & 7 deletions Content.Shared/Procedural/PostGeneration/BiomeDunGen.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Content.Shared.Maps;
using Content.Shared.Parallax.Biomes;
using Robust.Shared.Prototypes;

Expand All @@ -12,10 +11,4 @@ public sealed partial class BiomeDunGen : IDunGenLayer
{
[DataField(required: true)]
public ProtoId<BiomeTemplatePrototype> BiomeTemplate;

/// <summary>
/// creates a biome only on the specified tiles
/// </summary>
[DataField]
public HashSet<ProtoId<ContentTileDefinition>>? TileMask;
}
40 changes: 22 additions & 18 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
Entries:
- author: Gregg
changes:
- message: Adjusted the rules in regards to PDA confiscation and borg memory.
type: Tweak
id: 206
time: '2024-01-19T10:30:34.0000000+00:00'
- author: DebugOk
changes:
- message: Zombies can no longer be psionic
type: Remove
id: 207
time: '2024-01-19T20:53:05.0000000+00:00'
- author: Adrian16199
changes:
- message: Fixes mantis and them not be able to spawn with duffelbags and satchels.
type: Fix
id: 208
time: '2024-01-19T20:54:29.0000000+00:00'
- author: Adrian16199
changes:
- message: Laika no longer takes 200 damage before dying from critical.
Expand Down Expand Up @@ -3764,3 +3746,25 @@
id: 705
time: '2024-11-24T10:15:12.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2277
- author: Big Orthagonal
changes:
- message: Diagonal secborgs are not real and were never real.
type: Fix
id: 706
time: '2024-11-24T11:57:37.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2278
- author: deltanedas
changes:
- message: Fixed salvage debris not having anything.
type: Fix
id: 707
time: '2024-11-24T20:25:25.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2280
- author: DisposableCrewmember42
changes:
- message: Hungry? Stuff your face with cream from an emergency pie delivery for
a change!
type: Add
id: 708
time: '2024-11-25T05:30:25.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2211
10 changes: 10 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/Cargo/cargo_food.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
category: Food
group: market

- type: cargoProduct
id: FoodEmergencyPie
icon:
sprite: Objects/Consumable/Food/Baked/pie.rsi
state: tin
product: CrateFoodEmergencyPie
cost: 3333
category: Food
group: market

- type: cargoProduct
id: FoodHydroCoDairy
icon:
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/Fills/Crates/food.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
- id: FoodBoxDonkpocketDink
prob: 0.1

- type: entity
id: CrateFoodEmergencyPie
parent: CratePlastic
name: emergency pie delivery
description: '"Then let them eat pie."'
components:
- type: StorageFill
contents:
- id: FoodPieBananaCream
amount: 13

- type: entity
parent: CratePlastic
id: CrateHydroCoDairy
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/DeltaV/borg_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# Visual
clientComponents:
- type: Sprite
noRot: true
drawdepth: Mobs
sprite: DeltaV/Mobs/Silicon/chassis.rsi
layers:
- state: security
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You must roleplay. Your character's actions, feelings, and knowledge in-game sho
- Do not engage in meta-communications (i.e. using external channels to communicate with other players in the same game).

## Rule B1.3: If you die and return to life, follow the new life rules.
If a player dies, they forget the specific details of their death. [color=#ff0000]Please report players who break this rule.[/color] A borg being removed from its chassis is not a death, and there is no memory loss.
If a player dies, they forget the specific details of their death. [color=#ff0000]Please report players who break this rule.[/color] A borg being removed from its chassis is not a death, and may decide for itself whether or not it experiences memory loss.
- If they are revived by using a defibrillator, they can only recall vague information such as “Someone shot me” or “I was set ablaze”.
- If they are revived by any other method, they forget the last five minutes leading up to their death, and cannot describe their death in any capacity.

Expand Down

0 comments on commit d0e5f52

Please sign in to comment.