Start rebalancing anomalies - Rock and Flesh anomaly reworked (#24381)

* rework

* bruh

* all fixed

* balance

* bb

* Update TileAnomalySystem.cs

* Update EntityAnomalySystem.cs
This commit is contained in:
Ed
2024-01-23 15:32:05 +03:00
committed by GitHub
parent 1ab06db7ae
commit b02c211e2f
17 changed files with 660 additions and 205 deletions

View File

@@ -1,17 +1,18 @@
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Effects;
using Content.Shared.Anomaly.Effects.Components; using Content.Shared.Anomaly.Effects.Components;
using Content.Shared.Physics; using Content.Shared.Physics;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics; using Robust.Shared.Physics;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
namespace Content.Server.Anomaly.Effects; namespace Content.Server.Anomaly.Effects;
public sealed class EntityAnomalySystem : EntitySystem public sealed class EntityAnomalySystem : SharedEntityAnomalySystem
{ {
[Dependency] private readonly IMapManager _map = default!; [Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
@@ -22,55 +23,70 @@ public sealed class EntityAnomalySystem : EntitySystem
SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalyPulseEvent>(OnPulse); SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalyPulseEvent>(OnPulse);
SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical); SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical);
SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged); SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged);
SubscribeLocalEvent<EntitySpawnAnomalyComponent, AnomalySeverityChangedEvent>(OnSeverityChanged);
} }
private void OnPulse(EntityUid uid, EntitySpawnAnomalyComponent component, ref AnomalyPulseEvent args) private void OnPulse(Entity<EntitySpawnAnomalyComponent> component, ref AnomalyPulseEvent args)
{ {
if (!component.SpawnOnPulse) foreach (var entry in component.Comp.Entries)
return; {
if (!entry.SpawnOnPulse)
continue;
var range = component.SpawnRange * args.Stability; SpawnEntitesOnOpenTiles(component, entry, args.Stability, args.Severity);
var amount = (int) (component.MaxSpawnAmount * args.Severity + 0.5f); }
var xform = Transform(uid);
SpawnEntitesOnOpenTiles(component, xform, amount, range, component.Spawns);
} }
private void OnSupercritical(EntityUid uid, EntitySpawnAnomalyComponent component, ref AnomalySupercriticalEvent args) private void OnSupercritical(Entity<EntitySpawnAnomalyComponent> component, ref AnomalySupercriticalEvent args)
{ {
if (!component.SpawnOnSuperCritical) foreach (var entry in component.Comp.Entries)
return; {
if (!entry.SpawnOnSuperCritical)
continue;
var xform = Transform(uid); SpawnEntitesOnOpenTiles(component, entry, 1, 1);
// A cluster of entities }
SpawnEntitesOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, component.Spawns);
// And so much meat (for the meat anomaly at least)
SpawnEntitesOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, component.SuperCriticalSpawns);
} }
private void OnStabilityChanged(EntityUid uid, EntitySpawnAnomalyComponent component, ref AnomalyStabilityChangedEvent args) private void OnStabilityChanged(Entity<EntitySpawnAnomalyComponent> component, ref AnomalyStabilityChangedEvent args)
{ {
if (!component.SpawnOnStabilityChanged) foreach (var entry in component.Comp.Entries)
return; {
if (!entry.SpawnOnStabilityChanged)
continue;
var range = component.SpawnRange * args.Stability; SpawnEntitesOnOpenTiles(component, entry, args.Stability, args.Severity);
var amount = (int) (component.MaxSpawnAmount * args.Stability + 0.5f); }
var xform = Transform(uid);
SpawnEntitesOnOpenTiles(component, xform, amount, range, component.Spawns);
} }
private void SpawnEntitesOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius, List<EntProtoId> spawns) private void OnSeverityChanged(Entity<EntitySpawnAnomalyComponent> component, ref AnomalySeverityChangedEvent args)
{ {
if (!component.Spawns.Any()) foreach (var entry in component.Comp.Entries)
{
if (!entry.SpawnOnSeverityChanged)
continue;
SpawnEntitesOnOpenTiles(component, entry, args.Stability, args.Severity);
}
}
//TheShuEd:
//I know it's a shitcode! I didn't write it! I just restructured the functions
// To Do: make it reusable with TileAnomalySystem
private void SpawnEntitesOnOpenTiles(Entity<EntitySpawnAnomalyComponent> component, EntitySpawnSettingsEntry entry, float stability, float severity)
{
if (entry.Spawns.Count == 0)
return; return;
if (!_map.TryGetGrid(xform.GridUid, out var grid)) var xform = Transform(component.Owner);
if (!TryComp<MapGridComponent>(xform.GridUid, out var grid))
return; return;
var amount = (int) (MathHelper.Lerp(entry.MinAmount, entry.MaxAmount, severity * stability) + 0.5f);
var localpos = xform.Coordinates.Position; var localpos = xform.Coordinates.Position;
var tilerefs = grid.GetLocalTilesIntersecting( var tilerefs = grid.GetLocalTilesIntersecting(
new Box2(localpos + new Vector2(-radius, -radius), localpos + new Vector2(radius, radius))).ToArray(); new Box2(localpos + new Vector2(-entry.MaxRange, -entry.MaxRange), localpos + new Vector2(entry.MaxRange, entry.MaxRange))).ToArray();
if (tilerefs.Length == 0) if (tilerefs.Length == 0)
return; return;
@@ -80,6 +96,14 @@ public sealed class EntityAnomalySystem : EntitySystem
var amountCounter = 0; var amountCounter = 0;
foreach (var tileref in tilerefs) foreach (var tileref in tilerefs)
{ {
//cut outer circle
if (MathF.Sqrt(MathF.Pow(tileref.X - xform.LocalPosition.X, 2) + MathF.Pow(tileref.Y - xform.LocalPosition.Y, 2)) > entry.MaxRange)
continue;
//cut inner circle
if (MathF.Sqrt(MathF.Pow(tileref.X - xform.LocalPosition.X, 2) + MathF.Pow(tileref.Y - xform.LocalPosition.Y, 2)) < entry.MinRange)
continue;
var valid = true; var valid = true;
foreach (var ent in grid.GetAnchoredEntities(tileref.GridIndices)) foreach (var ent in grid.GetAnchoredEntities(tileref.GridIndices))
{ {
@@ -97,7 +121,7 @@ public sealed class EntityAnomalySystem : EntitySystem
if (!valid) if (!valid)
continue; continue;
amountCounter++; amountCounter++;
Spawn(_random.Pick(spawns), tileref.GridIndices.ToEntityCoordinates(xform.GridUid.Value, _map)); Spawn(_random.Pick(entry.Spawns), tileref.GridIndices.ToEntityCoordinates(xform.GridUid.Value, _map));
if (amountCounter >= amount) if (amountCounter >= amount)
return; return;
} }

View File

@@ -1,13 +1,16 @@
using System.Linq;
using System.Numerics; using System.Numerics;
using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Effects;
using Content.Shared.Anomaly.Effects.Components; using Content.Shared.Anomaly.Effects.Components;
using Content.Shared.Maps; using Content.Shared.Maps;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random; using Robust.Shared.Random;
namespace Content.Server.Anomaly.Effects; namespace Content.Server.Anomaly.Effects;
public sealed class TileAnomalySystem : EntitySystem public sealed class TileAnomalySystem : SharedTileAnomalySystem
{ {
[Dependency] private readonly IMapManager _map = default!; [Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
@@ -17,25 +20,93 @@ public sealed class TileAnomalySystem : EntitySystem
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()
{ {
SubscribeLocalEvent<TileSpawnAnomalyComponent, AnomalyStabilityChangedEvent>(OnSeverityChanged);
SubscribeLocalEvent<TileSpawnAnomalyComponent, AnomalyPulseEvent>(OnPulse);
SubscribeLocalEvent<TileSpawnAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical);
SubscribeLocalEvent<TileSpawnAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged);
SubscribeLocalEvent<TileSpawnAnomalyComponent, AnomalySeverityChangedEvent>(OnSeverityChanged);
} }
private void OnSeverityChanged(EntityUid uid, TileSpawnAnomalyComponent component, ref AnomalyStabilityChangedEvent args) private void OnPulse(Entity<TileSpawnAnomalyComponent> component, ref AnomalyPulseEvent args)
{ {
var xform = Transform(uid); foreach (var entry in component.Comp.Entries)
if (!_map.TryGetGrid(xform.GridUid, out var grid)) {
if (!entry.SpawnOnPulse)
continue;
SpawnTiles(component, entry, args.Stability, args.Severity);
}
}
private void OnSupercritical(Entity<TileSpawnAnomalyComponent> component, ref AnomalySupercriticalEvent args)
{
foreach (var entry in component.Comp.Entries)
{
if (!entry.SpawnOnSuperCritical)
continue;
SpawnTiles(component, entry, 1, 1);
}
}
private void OnStabilityChanged(Entity<TileSpawnAnomalyComponent> component, ref AnomalyStabilityChangedEvent args)
{
foreach (var entry in component.Comp.Entries)
{
if (!entry.SpawnOnStabilityChanged)
continue;
SpawnTiles(component, entry, args.Stability, args.Severity);
}
}
private void OnSeverityChanged(Entity<TileSpawnAnomalyComponent> component, ref AnomalySeverityChangedEvent args)
{
foreach (var entry in component.Comp.Entries)
{
if (!entry.SpawnOnSeverityChanged)
continue;
SpawnTiles(component, entry, args.Stability, args.Severity);
}
}
//TheShuEd:
//I know it's a shitcode! I didn't write it! I just restructured the functions
// To Do: make it reusable with EntityAnomalySustem
private void SpawnTiles(Entity<TileSpawnAnomalyComponent> component, TileSpawnSettingsEntry entry, float stability, float severity)
{
var xform = Transform(component.Owner);
if (!TryComp<MapGridComponent>(xform.GridUid, out var grid))
return; return;
var radius = component.SpawnRange * args.Stability; var amount = (int) (MathHelper.Lerp(entry.MinAmount, entry.MaxAmount, stability * severity) + 0.5f);
var fleshTile = (ContentTileDefinition) _tiledef[component.FloorTileId];
var localpos = xform.Coordinates.Position; var localpos = xform.Coordinates.Position;
var tilerefs = grid.GetLocalTilesIntersecting( var tilerefs = grid.GetLocalTilesIntersecting(
new Box2(localpos + new Vector2(-radius, -radius), localpos + new Vector2(radius, radius))); new Box2(localpos + new Vector2(-entry.MaxRange, -entry.MaxRange), localpos + new Vector2(entry.MaxRange, entry.MaxRange))).ToArray();
if (tilerefs.Length == 0)
return;
_random.Shuffle(tilerefs);
var amountCounter = 0;
foreach (var tileref in tilerefs) foreach (var tileref in tilerefs)
{ {
if (!_random.Prob(component.SpawnChance)) //cut outer circle
if (MathF.Sqrt(MathF.Pow(tileref.X - xform.LocalPosition.X, 2) + MathF.Pow(tileref.Y - xform.LocalPosition.Y, 2)) > entry.MaxRange)
continue; continue;
_tile.ReplaceTile(tileref, fleshTile);
//cut inner circle
if (MathF.Sqrt(MathF.Pow(tileref.X - xform.LocalPosition.X, 2) + MathF.Pow(tileref.Y - xform.LocalPosition.Y, 2)) < entry.MinRange)
continue;
amountCounter++;
var tile = (ContentTileDefinition) _tiledef[entry.Floor];
_tile.ReplaceTile(tileref, tile);
if (amountCounter >= amount)
return;
} }
} }
} }

View File

@@ -268,13 +268,13 @@ public readonly record struct AnomalyShutdownEvent(EntityUid Anomaly, bool Super
/// </summary> /// </summary>
/// <param name="Anomaly">The anomaly being changed</param> /// <param name="Anomaly">The anomaly being changed</param>
[ByRefEvent] [ByRefEvent]
public readonly record struct AnomalySeverityChangedEvent(EntityUid Anomaly, float Severity); public readonly record struct AnomalySeverityChangedEvent(EntityUid Anomaly, float Stability, float Severity);
/// <summary> /// <summary>
/// Event broadcast when an anomaly's stability is changed. /// Event broadcast when an anomaly's stability is changed.
/// </summary> /// </summary>
[ByRefEvent] [ByRefEvent]
public readonly record struct AnomalyStabilityChangedEvent(EntityUid Anomaly, float Stability); public readonly record struct AnomalyStabilityChangedEvent(EntityUid Anomaly, float Stability, float Severity);
/// <summary> /// <summary>
/// Event broadcast when an anomaly's health is changed. /// Event broadcast when an anomaly's health is changed.

View File

@@ -2,52 +2,71 @@ using Robust.Shared.Prototypes;
namespace Content.Shared.Anomaly.Effects.Components; namespace Content.Shared.Anomaly.Effects.Components;
[RegisterComponent] [RegisterComponent, Access(typeof(SharedEntityAnomalySystem))]
public sealed partial class EntitySpawnAnomalyComponent : Component public sealed partial class EntitySpawnAnomalyComponent : Component
{
/// <summary>
/// All types of entity spawns with their settings
/// </summary>
[DataField]
public List<EntitySpawnSettingsEntry> Entries = new();
}
[DataDefinition, Serializable]
public partial record struct EntitySpawnSettingsEntry()
{ {
/// <summary> /// <summary>
/// A list of entities that are random picked to be spawned on each pulse /// A list of entities that are random picked to be spawned on each pulse
/// </summary> /// </summary>
[DataField] [DataField]
public List<EntProtoId> Spawns = new(); public List<EntProtoId> Spawns { get; set; } = new();
/// <summary> /// <summary>
/// A list of entities that are random picked to be spawned when supercritical; /// The minimum number of entities that spawn per pulse
/// </summary> /// </summary>
[DataField] [DataField]
public List<EntProtoId> SuperCriticalSpawns = new(); public int MinAmount { get; set; } = 0;
/// <summary> /// <summary>
/// The maximum number of entities that spawn per pulse /// The maximum number of entities that spawn per pulse
/// scales with severity. /// scales with severity.
/// </summary> /// </summary>
[DataField("maxSpawnAmount"), ViewVariables(VVAccess.ReadWrite)] [DataField]
public int MaxSpawnAmount = 7; public int MaxAmount { get; set; } = 1;
/// <summary>
/// The distance from the anomaly in which the entities will not appear
/// </summary>
[DataField]
public float MinRange { get; set; } = 0f;
/// <summary> /// <summary>
/// The maximum radius the entities will spawn in. /// The maximum radius the entities will spawn in.
/// Also governs the maximum reach of flesh tiles
/// scales with stability
/// </summary> /// </summary>
[DataField("spawnRange"), ViewVariables(VVAccess.ReadWrite)] [DataField]
public float SpawnRange = 5f; public float MaxRange { get; set; } = 1f;
/// <summary> /// <summary>
/// Whether or not anomaly spawns entities on Pulse /// Whether or not anomaly spawns entities on Pulse
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField]
public bool SpawnOnPulse = true; public bool SpawnOnPulse { get; set; } = false;
/// <summary> /// <summary>
/// Whether or not anomaly spawns entities on SuperCritical /// Whether or not anomaly spawns entities on SuperCritical
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField]
public bool SpawnOnSuperCritical = true; public bool SpawnOnSuperCritical { get; set; } = false;
/// <summary> /// <summary>
/// Whether or not anomaly spawns entities on StabilityChanged /// Whether or not anomaly spawns entities on StabilityChanged
/// The idea was to spawn entities either on Pulse/Supercritical OR StabilityChanged
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField]
public bool SpawnOnStabilityChanged = false; public bool SpawnOnStabilityChanged { get; set; } = false;
/// <summary>
/// Whether or not anomaly spawns entities on SeverityChanged
/// </summary>
[DataField]
public bool SpawnOnSeverityChanged { get; set; } = false;
} }

View File

@@ -1,26 +0,0 @@
using Content.Shared.Maps;
using Robust.Shared.Prototypes;
namespace Content.Shared.Anomaly.Effects.Components;
[RegisterComponent]
public sealed partial class TileSpawnAnomalyComponent : Component
{
/// <summary>
/// The maximum radius of tiles scales with stability
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float SpawnRange = 5f;
/// <summary>
/// The probability a tile will spawn.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float SpawnChance = 0.33f;
/// <summary>
/// The tile that is spawned by the anomaly's effect
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public ProtoId<ContentTileDefinition> FloorTileId = "FloorFlesh";
}

View File

@@ -0,0 +1,73 @@
using Content.Shared.Maps;
using Robust.Shared.Prototypes;
namespace Content.Shared.Anomaly.Effects.Components;
[RegisterComponent, Access(typeof(SharedTileAnomalySystem))]
public sealed partial class TileSpawnAnomalyComponent : Component
{
/// <summary>
/// All types of floors spawns with their settings
/// </summary>
[DataField]
public List<TileSpawnSettingsEntry> Entries = new();
}
[DataDefinition, Serializable]
public partial record struct TileSpawnSettingsEntry()
{
/// <summary>
/// The tile that is spawned by the anomaly's effect
/// </summary>
[DataField(required: true)]
public ProtoId<ContentTileDefinition> Floor { get; set; } = default!;
/// <summary>
/// The minimum number of tiles that spawn per pulse
/// </summary>
[DataField]
public int MinAmount { get; set; } = 0;
/// <summary>
/// The maximum number of tiles that spawn per pulse
/// scales with severity.
/// </summary>
[DataField]
public int MaxAmount { get; set; } = 1;
/// <summary>
/// The distance from the anomaly in which the tiles will not appear
/// </summary>
[DataField]
public float MinRange { get; set; } = 0f;
/// <summary>
/// The maximum radius the tiles will spawn in.
/// </summary>
[DataField]
public float MaxRange { get; set; } = 1f;
/// <summary>
/// Whether or not anomaly spawns tiles on Pulse
/// </summary>
[DataField]
public bool SpawnOnPulse { get; set; } = false;
/// <summary>
/// Whether or not anomaly spawns tiles on SuperCritical
/// </summary>
[DataField]
public bool SpawnOnSuperCritical { get; set; } = false;
/// <summary>
/// Whether or not anomaly spawns tiles on StabilityChanged
/// </summary>
[DataField]
public bool SpawnOnStabilityChanged { get; set; } = false;
/// <summary>
/// Whether or not anomaly spawns tiles on StabilityChanged
/// </summary>
[DataField]
public bool SpawnOnSeverityChanged { get; set; } = false;
}

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.Anomaly.Effects;
public abstract class SharedEntityAnomalySystem : EntitySystem
{
}

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.Anomaly.Effects;
public abstract class SharedTileAnomalySystem : EntitySystem
{
}

View File

@@ -227,7 +227,7 @@ public abstract class SharedAnomalySystem : EntitySystem
component.Stability = Math.Clamp(newVal, 0, 1); component.Stability = Math.Clamp(newVal, 0, 1);
Dirty(component); Dirty(component);
var ev = new AnomalyStabilityChangedEvent(uid, component.Stability); var ev = new AnomalyStabilityChangedEvent(uid, component.Stability, component.Severity);
RaiseLocalEvent(uid, ref ev, true); RaiseLocalEvent(uid, ref ev, true);
} }
@@ -250,7 +250,7 @@ public abstract class SharedAnomalySystem : EntitySystem
component.Severity = Math.Clamp(newVal, 0, 1); component.Severity = Math.Clamp(newVal, 0, 1);
Dirty(component); Dirty(component);
var ev = new AnomalySeverityChangedEvent(uid, component.Severity); var ev = new AnomalySeverityChangedEvent(uid, component.Stability, component.Severity);
RaiseLocalEvent(uid, ref ev, true); RaiseLocalEvent(uid, ref ev, true);
} }

View File

@@ -26,15 +26,57 @@
prototype: AsteroidRock prototype: AsteroidRock
- type: entity - type: entity
id: WallSpawnAsteroidCrab id: WallSpawnAsteroidUraniumCrab
parent: WallSpawnAsteroid parent: WallSpawnAsteroid
components: components:
- type: SpawnOnDespawn - type: SpawnOnDespawn
prototype: AsteroidRockCrab prototype: AsteroidRockUraniumCrab
- type: entity - type: entity
id: WallSpawnAsteroidCrab1 id: WallSpawnAsteroidUranium
parent: WallSpawnAsteroid parent: WallSpawnAsteroid
components: components:
- type: SpawnOnDespawn - type: SpawnOnDespawn
prototype: AsteroidRockCrab1 prototype: AsteroidRockUranium
- type: entity
id: WallSpawnAsteroidQuartzCrab
parent: WallSpawnAsteroid
components:
- type: SpawnOnDespawn
prototype: AsteroidRockQuartzCrab
- type: entity
id: WallSpawnAsteroidQuartz
parent: WallSpawnAsteroid
components:
- type: SpawnOnDespawn
prototype: AsteroidRockQuartz
- type: entity
id: WallSpawnAsteroidSilverCrab
parent: WallSpawnAsteroid
components:
- type: SpawnOnDespawn
prototype: AsteroidRockSilverCrab
- type: entity
id: WallSpawnAsteroidSilver
parent: WallSpawnAsteroid
components:
- type: SpawnOnDespawn
prototype: AsteroidRockSilver
- type: entity
id: WallSpawnAsteroidIronCrab
parent: WallSpawnAsteroid
components:
- type: SpawnOnDespawn
prototype: AsteroidRockTinCrab
- type: entity
id: WallSpawnAsteroidIron
parent: WallSpawnAsteroid
components:
- type: SpawnOnDespawn
prototype: AsteroidRockTin

View File

@@ -16,8 +16,26 @@
- AnomalyFlesh - AnomalyFlesh
- AnomalyBluespace - AnomalyBluespace
- AnomalyIce - AnomalyIce
- AnomalyRock - RandomRockAnomalySpawner
- AnomalyLiquid - AnomalyLiquid
- AnomalyFlora - AnomalyFlora
chance: 1 chance: 1
offset: 0.15 # not to put it higher. The anomaly sychnronizer looks for anomalies within this radius, and if the radius is higher, the anomaly can be attracted from a neighboring tile. offset: 0.15 # not to put it higher. The anomaly sychnronizer looks for anomalies within this radius, and if the radius is higher, the anomaly can be attracted from a neighboring tile.
- type: entity
id: RandomRockAnomalySpawner
parent: MarkerBase
components:
- type: Sprite
layers:
- state: red
- sprite: Structures/Specific/anomaly.rsi
state: anom6
- type: RandomSpawner
prototypes:
- AnomalyRockIron
- AnomalyRockSilver
- AnomalyRockQuartz
- AnomalyRockUranium
chance: 1
offset: 0.15

View File

@@ -1,31 +0,0 @@
- type: entity
name: Asteroid Crab Spawner
id: AsteroidCrabSpawner
parent: MarkerBase
components:
- type: Sprite
layers:
- state: red
- sprite: Structures/Walls/rock.rsi
state: rock_asteroid_ore
- type: RandomSpawner
prototypes:
- AsteroidRockCrab
- AsteroidRockCrab1
chance: 1
- type: entity
name: Rock Anom Crab Spawner
id: RockAnomCrabSpawner
parent: MarkerBase
components:
- type: Sprite
layers:
- state: red
- sprite: Structures/Walls/rock.rsi
state: rock_asteroid_ore
- type: RandomSpawner
prototypes:
- WallSpawnAsteroidCrab
- WallSpawnAsteroidCrab1
chance: 1

View File

@@ -10,8 +10,7 @@
- type: MeleeSound - type: MeleeSound
soundGroups: soundGroups:
Brute: Brute:
path: collection: GlassBreak
"/Audio/Weapons/slash.ogg"
- type: Sprite - type: Sprite
sprite: Objects/Misc/ice_crust.rsi sprite: Objects/Misc/ice_crust.rsi
layers: layers:

View File

@@ -147,16 +147,58 @@
color: "#cb5b7e" color: "#cb5b7e"
castShadows: false castShadows: false
- type: TileSpawnAnomaly - type: TileSpawnAnomaly
floorTileId: FloorFlesh entries:
- spawnOnPulse: true
spawnOnStabilityChanged: true
minAmount: 3
maxAmount: 7
maxRange: 4
floor: FloorFlesh
- spawnOnSuperCritical: true
minAmount: 10
maxAmount: 30
maxRange: 10
floor: FloorFlesh
- type: EntitySpawnAnomaly - type: EntitySpawnAnomaly
superCriticalSpawns: entries:
- FleshKudzu - spawnOnPulse: true
spawns: minAmount: 1
- MobFleshJared maxAmount: 4
- MobFleshGolem minRange: 1.5
- MobFleshClamp maxRange: 2.5
- MobFleshLover spawns:
- FleshBlocker - FleshBlocker
- spawnOnPulse: true
maxAmount: 3
minRange: 3
maxRange: 4.5
spawns:
- MobFleshJared
- MobFleshGolem
- MobFleshClamp
- MobFleshLover
- spawnOnSuperCritical: true
minAmount: 10
maxAmount: 15
minRange: 5
maxRange: 15
spawns:
- FleshBlocker
- spawnOnSuperCritical: true
minAmount: 5
maxAmount: 10
maxRange: 8
spawns:
- MobFleshJared
- MobFleshGolem
- MobFleshClamp
- MobFleshLover
- spawnOnSuperCritical: true
minAmount: 5
maxAmount: 8
maxRange: 10
spawns:
- FleshKudzu
- type: entity - type: entity
id: AnomalyBluespace id: AnomalyBluespace
@@ -241,12 +283,13 @@
projectilePrototype: ProjectileIcicle projectilePrototype: ProjectileIcicle
targetNonSentientChance: 0.1 targetNonSentientChance: 0.1
- type: EntitySpawnAnomaly - type: EntitySpawnAnomaly
spawns: entries:
- IceCrust - spawnOnStabilityChanged: true
maxSpawnAmount: 17 minAmount: 5
spawnOnPulse: false maxAmount: 15
spawnOnSuperCritical: false maxRange: 4
spawnOnStabilityChanged: true spawns:
- IceCrust
- type: TempAffectingAnomaly - type: TempAffectingAnomaly
tempChangePerSecond: -25 tempChangePerSecond: -25
hotspotExposeTemperature: -1000 hotspotExposeTemperature: -1000
@@ -256,8 +299,9 @@
spawnRadius: 0 spawnRadius: 0
- type: entity - type: entity
id: AnomalyRock id: AnomalyRockBase
parent: BaseAnomaly parent: BaseAnomaly
abstract: true
suffix: Rock suffix: Rock
components: components:
- type: Anomaly - type: Anomaly
@@ -276,18 +320,201 @@
color: "#5ca8cb" color: "#5ca8cb"
castShadows: false castShadows: false
- type: TileSpawnAnomaly - type: TileSpawnAnomaly
floorTileId: FloorAsteroidTile entries:
spawnChance: 0.8 - spawnOnPulse: true
minAmount: 15
maxAmount: 20
maxRange: 7.5
floor: FloorAsteroidTile
- spawnOnSuperCritical: true
minAmount: 30
maxAmount: 50
maxRange: 12
floor: FloorAsteroidTile
- type: entity
id: AnomalyRockUranium
parent: AnomalyRockBase
suffix: Rock, Uranium
components:
- type: Sprite
color: "#52ff39"
- type: PointLight
radius: 2.0
energy: 7.5
color: "#52ff39"
- type: EntitySpawnAnomaly - type: EntitySpawnAnomaly
maxSpawnAmount: 50 entries:
spawnRange: 10 - spawnOnPulse: true
spawns: minAmount: 8
- WallSpawnAsteroid maxAmount: 15
- RockAnomCrabSpawner minRange: 4.5
- CrystalSpawner maxRange: 7.5
superCriticalSpawns: spawns:
- WallSpawnAsteroid - WallSpawnAsteroid
- SpawnMobOreCrab - WallSpawnAsteroid
- WallSpawnAsteroidUranium
- WallSpawnAsteroidUraniumCrab
- spawnOnPulse: true
maxAmount: 3
minRange: 2.5
maxRange: 4.5
spawns:
- CrystalGreen
- spawnOnSuperCritical: true
minAmount: 30
maxAmount: 40
minRange: 5
maxRange: 15
spawns:
- CrystalGreen
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidUraniumCrab
- spawnOnSuperCritical: true
minAmount: 6
maxAmount: 10
maxRange: 5
spawns:
- MobSpawnCrabUranium
- type: entity
id: AnomalyRockQuartz
parent: AnomalyRockBase
suffix: Rock, Quartz
components:
- type: Sprite
color: "#fb4747"
- type: PointLight
radius: 2.0
energy: 7.5
color: "#fb4747"
- type: EntitySpawnAnomaly
entries:
- spawnOnPulse: true
minAmount: 8
maxAmount: 15
minRange: 4.5
maxRange: 7.5
spawns:
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidQuartz
- WallSpawnAsteroidQuartzCrab
- spawnOnPulse: true
maxAmount: 3
minRange: 2.5
maxRange: 4.5
spawns:
- CrystalGrey
- spawnOnSuperCritical: true
minAmount: 30
maxAmount: 40
minRange: 5
maxRange: 15
spawns:
- CrystalGrey
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidQuartzCrab
- spawnOnSuperCritical: true
minAmount: 6
maxAmount: 10
maxRange: 5
spawns:
- MobSpawnCrabQuartz
- type: entity
id: AnomalyRockSilver
parent: AnomalyRockBase
suffix: Rock, Silver
components:
- type: Sprite
color: "#47f8ff"
- type: PointLight
radius: 2.0
energy: 7.5
color: "#47f8ff"
- type: EntitySpawnAnomaly
entries:
- spawnOnPulse: true
minAmount: 8
maxAmount: 15
minRange: 4.5
maxRange: 7.5
spawns:
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidSilver
- WallSpawnAsteroidSilverCrab
- spawnOnPulse: true
maxAmount: 3
minRange: 2.5
maxRange: 4.5
spawns:
- CrystalCyan
- spawnOnSuperCritical: true
minAmount: 30
maxAmount: 40
minRange: 5
maxRange: 15
spawns:
- CrystalCyan
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidSilverCrab
- spawnOnSuperCritical: true
minAmount: 6
maxAmount: 10
maxRange: 5
spawns:
- MobSpawnCrabSilver
- type: entity
id: AnomalyRockIron
parent: AnomalyRockBase
suffix: Rock, Iron
components:
- type: Sprite
color: "#ff8227"
- type: PointLight
radius: 2.0
energy: 7.5
color: "#ff8227"
- type: EntitySpawnAnomaly
entries:
- spawnOnPulse: true
minAmount: 8
maxAmount: 15
minRange: 4.5
maxRange: 7.5
spawns:
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidIron
- WallSpawnAsteroidIronCrab
- spawnOnPulse: true
maxAmount: 3
minRange: 2.5
maxRange: 4.5
spawns:
- CrystalOrange
- spawnOnSuperCritical: true
minAmount: 30
maxAmount: 40
minRange: 5
maxRange: 15
spawns:
- CrystalOrange
- WallSpawnAsteroid
- WallSpawnAsteroid
- WallSpawnAsteroidIronCrab
- spawnOnSuperCritical: true
minAmount: 6
maxAmount: 10
maxRange: 5
spawns:
- MobSpawnCrabIron
- type: entity - type: entity
id: AnomalyFlora id: AnomalyFlora
@@ -316,15 +543,31 @@
types: types:
Slash: 0 Slash: 0
- type: TileSpawnAnomaly - type: TileSpawnAnomaly
floorTileId: FloorAstroGrass entries:
spawnRange: 6 - spawnOnPulse: true
minAmount: 3
maxAmount: 7
maxRange: 5
floor: FloorAstroGrass
- spawnOnSuperCritical: true
minAmount: 10
maxAmount: 30
maxRange: 15
floor: FloorAstroGrass
- type: EntitySpawnAnomaly - type: EntitySpawnAnomaly
maxSpawnAmount: 15 entries:
spawnRange: 6 - spawnOnPulse: true
superCriticalSpawns: minAmount: 2
- KudzuFlowerAngry maxAmount: 5
spawns: maxRange: 2
- KudzuFlowerFriendly spawns:
- KudzuFlowerFriendly
- spawnOnSuperCritical: true
minAmount: 5
maxAmount: 10
maxRange: 6
spawns:
- KudzuFlowerAngry
- type: entity - type: entity
id: AnomalyFloraBulb id: AnomalyFloraBulb
@@ -400,10 +643,13 @@
types: types:
Slash: 1 Slash: 1
- type: EntitySpawnAnomaly - type: EntitySpawnAnomaly
superCriticalSpawns: entries:
- ReagentSlimeSpawner - spawnOnSuperCritical: true
spawns: minAmount: 3
- PuddleSparkle maxAmount: 8
maxRange: 2
spawns:
- ReagentSlimeSpawner
- type: SolutionContainerManager - type: SolutionContainerManager
solutions: solutions:
anomaly: anomaly:

View File

@@ -148,6 +148,28 @@
state: rock_asteroid_west state: rock_asteroid_west
- state: rock_quartz - state: rock_quartz
- type: entity
id: AsteroidRockQuartzCrab
parent: AsteroidRock
description: An ore vein rich with quartz.
suffix: Quartz Crab
components:
- type: OreVein
oreChance: 1.0
currentOre: OreQuartzCrab
- type: Sprite
layers:
- state: rock_asteroid
- map: [ "enum.EdgeLayer.South" ]
state: rock_asteroid_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_asteroid_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_asteroid_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_asteroid_west
- state: rock_quartz
- type: entity - type: entity
id: AsteroidRockSilver id: AsteroidRockSilver
parent: AsteroidRock parent: AsteroidRock
@@ -169,6 +191,15 @@
- map: [ "enum.EdgeLayer.West" ] - map: [ "enum.EdgeLayer.West" ]
state: rock_asteroid_west state: rock_asteroid_west
- state: rock_silver - state: rock_silver
- type: entity
id: AsteroidRockSilverCrab
parent: AsteroidRockSilver
suffix: Silver Crab
components:
- type: OreVein
oreChance: 1.0
currentOre: OreSilverCrab
# Yes I know it drops steel but we may get smelting at some point # Yes I know it drops steel but we may get smelting at some point
- type: entity - type: entity
@@ -192,6 +223,15 @@
- map: [ "enum.EdgeLayer.West" ] - map: [ "enum.EdgeLayer.West" ]
state: rock_asteroid_west state: rock_asteroid_west
- state: rock_tin - state: rock_tin
- type: entity
id: AsteroidRockTinCrab
parent: AsteroidRockTin
suffix: Iron
components:
- type: OreVein
oreChance: 1.0
currentOre: OreIronCrab
- type: entity - type: entity
id: AsteroidRockUranium id: AsteroidRockUranium
@@ -215,6 +255,14 @@
state: rock_asteroid_west state: rock_asteroid_west
- state: rock_uranium - state: rock_uranium
- type: entity
id: AsteroidRockUraniumCrab
parent: AsteroidRockUranium
suffix: Uranium Crab
components:
- type: OreVein
oreChance: 1.0
currentOre: OreUraniumCrab
- type: entity - type: entity
id: AsteroidRockBananium id: AsteroidRockBananium
@@ -271,46 +319,6 @@
oreChance: 0.33 oreChance: 0.33
oreRarityPrototypeId: RandomOreDistributionStandard oreRarityPrototypeId: RandomOreDistributionStandard
- type: entity
id: AsteroidRockCrab
parent: AsteroidRock
name: asteroid rock
suffix: orecrab
description: An asteroid.
components:
- type: Sprite
sprite: Structures/Walls/rock.rsi
layers:
- state: rock_asteroid_ore
- map: [ "enum.EdgeLayer.South" ]
state: rock_asteroid_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_asteroid_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_asteroid_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_asteroid_west
- type: OreVein
oreChance: 0.33
oreRarityPrototypeId: OreCrab
- type: entity
id: AsteroidRockCrab1
parent: AsteroidRockCrab
components:
- type: Sprite
sprite: Structures/Walls/rock.rsi
layers:
- state: rock_asteroid_ore1
- map: [ "enum.EdgeLayer.South" ]
state: rock_asteroid_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_asteroid_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_asteroid_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_asteroid_west
- type: entity - type: entity
id: IronRock id: IronRock
parent: AsteroidRock parent: AsteroidRock

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB