diff --git a/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs b/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs index 30b159b615..ee4e2ac115 100644 --- a/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs @@ -1,18 +1,17 @@ using System.Linq; using System.Numerics; using Content.Shared.Anomaly.Components; -using Content.Shared.Anomaly.Effects; using Content.Shared.Anomaly.Effects.Components; using Content.Shared.Physics; using Robust.Shared.Map; -using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server.Anomaly.Effects; -public sealed class EntityAnomalySystem : SharedEntityAnomalySystem +public sealed class EntityAnomalySystem : EntitySystem { [Dependency] private readonly IMapManager _map = default!; [Dependency] private readonly IRobustRandom _random = default!; @@ -23,70 +22,55 @@ public sealed class EntityAnomalySystem : SharedEntityAnomalySystem SubscribeLocalEvent(OnPulse); SubscribeLocalEvent(OnSupercritical); SubscribeLocalEvent(OnStabilityChanged); - SubscribeLocalEvent(OnSeverityChanged); } - private void OnPulse(Entity component, ref AnomalyPulseEvent args) + private void OnPulse(EntityUid uid, EntitySpawnAnomalyComponent component, ref AnomalyPulseEvent args) { - foreach (var entry in component.Comp.Entries) - { - if (!entry.SpawnOnPulse) - continue; - - SpawnEntitesOnOpenTiles(component, entry, args.Stability, args.Severity); - } - } - - private void OnSupercritical(Entity component, ref AnomalySupercriticalEvent args) - { - foreach (var entry in component.Comp.Entries) - { - if (!entry.SpawnOnSuperCritical) - continue; - - SpawnEntitesOnOpenTiles(component, entry, 1, 1); - } - } - - private void OnStabilityChanged(Entity component, ref AnomalyStabilityChangedEvent args) - { - foreach (var entry in component.Comp.Entries) - { - if (!entry.SpawnOnStabilityChanged) - continue; - - SpawnEntitesOnOpenTiles(component, entry, args.Stability, args.Severity); - } - } - - private void OnSeverityChanged(Entity component, ref AnomalySeverityChangedEvent args) - { - 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 component, EntitySpawnSettingsEntry entry, float stability, float severity) - { - if (entry.Spawns.Count == 0) + if (!component.SpawnOnPulse) return; - var xform = Transform(component.Owner); - if (!TryComp(xform.GridUid, out var grid)) + var range = component.SpawnRange * args.Stability; + 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) + { + if (!component.SpawnOnSuperCritical) return; - var amount = (int) (MathHelper.Lerp(entry.MinAmount, entry.MaxAmount, severity * stability) + 0.5f); + var xform = Transform(uid); + // 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) + { + if (!component.SpawnOnStabilityChanged) + return; + + var range = component.SpawnRange * args.Stability; + 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 spawns) + { + if (!component.Spawns.Any()) + return; + + if (!_map.TryGetGrid(xform.GridUid, out var grid)) + return; var localpos = xform.Coordinates.Position; var tilerefs = grid.GetLocalTilesIntersecting( - new Box2(localpos + new Vector2(-entry.MaxRange, -entry.MaxRange), localpos + new Vector2(entry.MaxRange, entry.MaxRange))).ToArray(); + new Box2(localpos + new Vector2(-radius, -radius), localpos + new Vector2(radius, radius))).ToArray(); if (tilerefs.Length == 0) return; @@ -96,14 +80,6 @@ public sealed class EntityAnomalySystem : SharedEntityAnomalySystem var amountCounter = 0; 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; foreach (var ent in grid.GetAnchoredEntities(tileref.GridIndices)) { @@ -121,7 +97,7 @@ public sealed class EntityAnomalySystem : SharedEntityAnomalySystem if (!valid) continue; amountCounter++; - Spawn(_random.Pick(entry.Spawns), tileref.GridIndices.ToEntityCoordinates(xform.GridUid.Value, _map)); + Spawn(_random.Pick(spawns), tileref.GridIndices.ToEntityCoordinates(xform.GridUid.Value, _map)); if (amountCounter >= amount) return; } diff --git a/Content.Server/Anomaly/Effects/TileAnomalySystem.cs b/Content.Server/Anomaly/Effects/TileAnomalySystem.cs index 1cc81aecc0..08ec3a1c93 100644 --- a/Content.Server/Anomaly/Effects/TileAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/TileAnomalySystem.cs @@ -1,16 +1,13 @@ -using System.Linq; using System.Numerics; using Content.Shared.Anomaly.Components; -using Content.Shared.Anomaly.Effects; using Content.Shared.Anomaly.Effects.Components; using Content.Shared.Maps; using Robust.Shared.Map; -using Robust.Shared.Map.Components; using Robust.Shared.Random; namespace Content.Server.Anomaly.Effects; -public sealed class TileAnomalySystem : SharedTileAnomalySystem +public sealed class TileAnomalySystem : EntitySystem { [Dependency] private readonly IMapManager _map = default!; [Dependency] private readonly IRobustRandom _random = default!; @@ -20,93 +17,25 @@ public sealed class TileAnomalySystem : SharedTileAnomalySystem /// public override void Initialize() { - - SubscribeLocalEvent(OnPulse); - SubscribeLocalEvent(OnSupercritical); - SubscribeLocalEvent(OnStabilityChanged); - SubscribeLocalEvent(OnSeverityChanged); + SubscribeLocalEvent(OnSeverityChanged); } - private void OnPulse(Entity component, ref AnomalyPulseEvent args) + private void OnSeverityChanged(EntityUid uid, TileSpawnAnomalyComponent component, ref AnomalyStabilityChangedEvent args) { - foreach (var entry in component.Comp.Entries) - { - if (!entry.SpawnOnPulse) - continue; - - SpawnTiles(component, entry, args.Stability, args.Severity); - } - } - private void OnSupercritical(Entity component, ref AnomalySupercriticalEvent args) - { - foreach (var entry in component.Comp.Entries) - { - if (!entry.SpawnOnSuperCritical) - continue; - - SpawnTiles(component, entry, 1, 1); - } - } - - private void OnStabilityChanged(Entity 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 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 component, TileSpawnSettingsEntry entry, float stability, float severity) - { - var xform = Transform(component.Owner); - if (!TryComp(xform.GridUid, out var grid)) + var xform = Transform(uid); + if (!_map.TryGetGrid(xform.GridUid, out var grid)) return; - var amount = (int) (MathHelper.Lerp(entry.MinAmount, entry.MaxAmount, stability * severity) + 0.5f); - + var radius = component.SpawnRange * args.Stability; + var fleshTile = (ContentTileDefinition) _tiledef[component.FloorTileId]; var localpos = xform.Coordinates.Position; var tilerefs = grid.GetLocalTilesIntersecting( - 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; - + new Box2(localpos + new Vector2(-radius, -radius), localpos + new Vector2(radius, radius))); 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) + if (!_random.Prob(component.SpawnChance)) 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; - - amountCounter++; - var tile = (ContentTileDefinition) _tiledef[entry.Floor]; - _tile.ReplaceTile(tileref, tile); - - if (amountCounter >= amount) - return; + _tile.ReplaceTile(tileref, fleshTile); } } } diff --git a/Content.Shared/Anomaly/Components/AnomalyComponent.cs b/Content.Shared/Anomaly/Components/AnomalyComponent.cs index 89afbb0122..0e83861863 100644 --- a/Content.Shared/Anomaly/Components/AnomalyComponent.cs +++ b/Content.Shared/Anomaly/Components/AnomalyComponent.cs @@ -268,13 +268,13 @@ public readonly record struct AnomalyShutdownEvent(EntityUid Anomaly, bool Super /// /// The anomaly being changed [ByRefEvent] -public readonly record struct AnomalySeverityChangedEvent(EntityUid Anomaly, float Stability, float Severity); +public readonly record struct AnomalySeverityChangedEvent(EntityUid Anomaly, float Severity); /// /// Event broadcast when an anomaly's stability is changed. /// [ByRefEvent] -public readonly record struct AnomalyStabilityChangedEvent(EntityUid Anomaly, float Stability, float Severity); +public readonly record struct AnomalyStabilityChangedEvent(EntityUid Anomaly, float Stability); /// /// Event broadcast when an anomaly's health is changed. diff --git a/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs b/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs index 6b4ea208c3..7a816e4312 100644 --- a/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs +++ b/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs @@ -2,71 +2,52 @@ using Robust.Shared.Prototypes; namespace Content.Shared.Anomaly.Effects.Components; -[RegisterComponent, Access(typeof(SharedEntityAnomalySystem))] +[RegisterComponent] public sealed partial class EntitySpawnAnomalyComponent : Component -{ - /// - /// All types of entity spawns with their settings - /// - [DataField] - public List Entries = new(); -} - -[DataDefinition, Serializable] -public partial record struct EntitySpawnSettingsEntry() { /// /// A list of entities that are random picked to be spawned on each pulse /// [DataField] - public List Spawns { get; set; } = new(); + public List Spawns = new(); /// - /// The minimum number of entities that spawn per pulse + /// A list of entities that are random picked to be spawned when supercritical; /// [DataField] - public int MinAmount { get; set; } = 0; + public List SuperCriticalSpawns = new(); /// /// The maximum number of entities that spawn per pulse /// scales with severity. /// - [DataField] - public int MaxAmount { get; set; } = 1; - - /// - /// The distance from the anomaly in which the entities will not appear - /// - [DataField] - public float MinRange { get; set; } = 0f; + [DataField("maxSpawnAmount"), ViewVariables(VVAccess.ReadWrite)] + public int MaxSpawnAmount = 7; /// /// The maximum radius the entities will spawn in. + /// Also governs the maximum reach of flesh tiles + /// scales with stability /// - [DataField] - public float MaxRange { get; set; } = 1f; + [DataField("spawnRange"), ViewVariables(VVAccess.ReadWrite)] + public float SpawnRange = 5f; /// /// Whether or not anomaly spawns entities on Pulse /// - [DataField] - public bool SpawnOnPulse { get; set; } = false; + [DataField, ViewVariables(VVAccess.ReadWrite)] + public bool SpawnOnPulse = true; /// /// Whether or not anomaly spawns entities on SuperCritical /// - [DataField] - public bool SpawnOnSuperCritical { get; set; } = false; + [DataField, ViewVariables(VVAccess.ReadWrite)] + public bool SpawnOnSuperCritical = true; /// /// Whether or not anomaly spawns entities on StabilityChanged + /// The idea was to spawn entities either on Pulse/Supercritical OR StabilityChanged /// - [DataField] - public bool SpawnOnStabilityChanged { get; set; } = false; - - /// - /// Whether or not anomaly spawns entities on SeverityChanged - /// - [DataField] - public bool SpawnOnSeverityChanged { get; set; } = false; + [DataField, ViewVariables(VVAccess.ReadWrite)] + public bool SpawnOnStabilityChanged = false; } diff --git a/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs b/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs new file mode 100644 index 0000000000..7e3125ba20 --- /dev/null +++ b/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs @@ -0,0 +1,26 @@ +using Content.Shared.Maps; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Anomaly.Effects.Components; + +[RegisterComponent] +public sealed partial class TileSpawnAnomalyComponent : Component +{ + /// + /// The maximum radius of tiles scales with stability + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float SpawnRange = 5f; + + /// + /// The probability a tile will spawn. + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float SpawnChance = 0.33f; + + /// + /// The tile that is spawned by the anomaly's effect + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public ProtoId FloorTileId = "FloorFlesh"; +} diff --git a/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomalyComponent.cs b/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomalyComponent.cs deleted file mode 100644 index 1e54803948..0000000000 --- a/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomalyComponent.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Content.Shared.Maps; -using Robust.Shared.Prototypes; - -namespace Content.Shared.Anomaly.Effects.Components; - -[RegisterComponent, Access(typeof(SharedTileAnomalySystem))] -public sealed partial class TileSpawnAnomalyComponent : Component -{ - /// - /// All types of floors spawns with their settings - /// - [DataField] - public List Entries = new(); -} - -[DataDefinition, Serializable] -public partial record struct TileSpawnSettingsEntry() -{ - /// - /// The tile that is spawned by the anomaly's effect - /// - [DataField(required: true)] - public ProtoId Floor { get; set; } = default!; - - /// - /// The minimum number of tiles that spawn per pulse - /// - [DataField] - public int MinAmount { get; set; } = 0; - - /// - /// The maximum number of tiles that spawn per pulse - /// scales with severity. - /// - [DataField] - public int MaxAmount { get; set; } = 1; - - /// - /// The distance from the anomaly in which the tiles will not appear - /// - [DataField] - public float MinRange { get; set; } = 0f; - - /// - /// The maximum radius the tiles will spawn in. - /// - [DataField] - public float MaxRange { get; set; } = 1f; - - /// - /// Whether or not anomaly spawns tiles on Pulse - /// - [DataField] - public bool SpawnOnPulse { get; set; } = false; - - /// - /// Whether or not anomaly spawns tiles on SuperCritical - /// - [DataField] - public bool SpawnOnSuperCritical { get; set; } = false; - - /// - /// Whether or not anomaly spawns tiles on StabilityChanged - /// - [DataField] - public bool SpawnOnStabilityChanged { get; set; } = false; - - /// - /// Whether or not anomaly spawns tiles on StabilityChanged - /// - [DataField] - public bool SpawnOnSeverityChanged { get; set; } = false; -} diff --git a/Content.Shared/Anomaly/Effects/SharedEntityAnomalySystem.cs b/Content.Shared/Anomaly/Effects/SharedEntityAnomalySystem.cs deleted file mode 100644 index 28732f4022..0000000000 --- a/Content.Shared/Anomaly/Effects/SharedEntityAnomalySystem.cs +++ /dev/null @@ -1,6 +0,0 @@ - -namespace Content.Shared.Anomaly.Effects; - -public abstract class SharedEntityAnomalySystem : EntitySystem -{ -} diff --git a/Content.Shared/Anomaly/Effects/SharedTileAnomalySystem.cs b/Content.Shared/Anomaly/Effects/SharedTileAnomalySystem.cs deleted file mode 100644 index 199c6b6f13..0000000000 --- a/Content.Shared/Anomaly/Effects/SharedTileAnomalySystem.cs +++ /dev/null @@ -1,6 +0,0 @@ - -namespace Content.Shared.Anomaly.Effects; - -public abstract class SharedTileAnomalySystem : EntitySystem -{ -} diff --git a/Content.Shared/Anomaly/SharedAnomalySystem.cs b/Content.Shared/Anomaly/SharedAnomalySystem.cs index 7390cbda0a..c014ff90e1 100644 --- a/Content.Shared/Anomaly/SharedAnomalySystem.cs +++ b/Content.Shared/Anomaly/SharedAnomalySystem.cs @@ -227,7 +227,7 @@ public abstract class SharedAnomalySystem : EntitySystem component.Stability = Math.Clamp(newVal, 0, 1); Dirty(component); - var ev = new AnomalyStabilityChangedEvent(uid, component.Stability, component.Severity); + var ev = new AnomalyStabilityChangedEvent(uid, component.Stability); RaiseLocalEvent(uid, ref ev, true); } @@ -250,7 +250,7 @@ public abstract class SharedAnomalySystem : EntitySystem component.Severity = Math.Clamp(newVal, 0, 1); Dirty(component); - var ev = new AnomalySeverityChangedEvent(uid, component.Stability, component.Severity); + var ev = new AnomalySeverityChangedEvent(uid, component.Severity); RaiseLocalEvent(uid, ref ev, true); } diff --git a/Resources/Prototypes/Entities/Effects/wallspawn.yml b/Resources/Prototypes/Entities/Effects/wallspawn.yml index f1bd236a8a..2010b8e73e 100644 --- a/Resources/Prototypes/Entities/Effects/wallspawn.yml +++ b/Resources/Prototypes/Entities/Effects/wallspawn.yml @@ -26,57 +26,15 @@ prototype: AsteroidRock - type: entity - id: WallSpawnAsteroidUraniumCrab + id: WallSpawnAsteroidCrab parent: WallSpawnAsteroid components: - type: SpawnOnDespawn - prototype: AsteroidRockUraniumCrab + prototype: AsteroidRockCrab - type: entity - id: WallSpawnAsteroidUranium + id: WallSpawnAsteroidCrab1 parent: WallSpawnAsteroid components: - type: SpawnOnDespawn - 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 \ No newline at end of file + prototype: AsteroidRockCrab1 diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml index c81c840fb0..6d2149965f 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml @@ -16,26 +16,8 @@ - AnomalyFlesh - AnomalyBluespace - AnomalyIce - - RandomRockAnomalySpawner + - AnomalyRock - AnomalyLiquid - AnomalyFlora 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. - -- 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 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/asteroidcrab.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/asteroidcrab.yml new file mode 100644 index 0000000000..4c4b969335 --- /dev/null +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/asteroidcrab.yml @@ -0,0 +1,31 @@ +- 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 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Misc/ice_crust.yml b/Resources/Prototypes/Entities/Objects/Misc/ice_crust.yml index bc3488aaf4..ad1f876675 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/ice_crust.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/ice_crust.yml @@ -10,7 +10,8 @@ - type: MeleeSound soundGroups: Brute: - collection: GlassBreak + path: + "/Audio/Weapons/slash.ogg" - type: Sprite sprite: Objects/Misc/ice_crust.rsi layers: diff --git a/Resources/Prototypes/Entities/Structures/Specific/Anomaly/anomalies.yml b/Resources/Prototypes/Entities/Structures/Specific/Anomaly/anomalies.yml index 2a4a934861..aecef8c637 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/Anomaly/anomalies.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/Anomaly/anomalies.yml @@ -147,58 +147,16 @@ color: "#cb5b7e" castShadows: false - type: TileSpawnAnomaly - entries: - - spawnOnPulse: true - spawnOnStabilityChanged: true - minAmount: 3 - maxAmount: 7 - maxRange: 4 - floor: FloorFlesh - - spawnOnSuperCritical: true - minAmount: 10 - maxAmount: 30 - maxRange: 10 - floor: FloorFlesh + floorTileId: FloorFlesh - type: EntitySpawnAnomaly - entries: - - spawnOnPulse: true - minAmount: 1 - maxAmount: 4 - minRange: 1.5 - maxRange: 2.5 - spawns: - - 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 + superCriticalSpawns: + - FleshKudzu + spawns: + - MobFleshJared + - MobFleshGolem + - MobFleshClamp + - MobFleshLover + - FleshBlocker - type: entity id: AnomalyBluespace @@ -283,13 +241,12 @@ projectilePrototype: ProjectileIcicle targetNonSentientChance: 0.1 - type: EntitySpawnAnomaly - entries: - - spawnOnStabilityChanged: true - minAmount: 5 - maxAmount: 15 - maxRange: 4 - spawns: - - IceCrust + spawns: + - IceCrust + maxSpawnAmount: 17 + spawnOnPulse: false + spawnOnSuperCritical: false + spawnOnStabilityChanged: true - type: TempAffectingAnomaly tempChangePerSecond: -25 hotspotExposeTemperature: -1000 @@ -299,9 +256,8 @@ spawnRadius: 0 - type: entity - id: AnomalyRockBase + id: AnomalyRock parent: BaseAnomaly - abstract: true suffix: Rock components: - type: Anomaly @@ -320,201 +276,18 @@ color: "#5ca8cb" castShadows: false - type: TileSpawnAnomaly - entries: - - 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" + floorTileId: FloorAsteroidTile + spawnChance: 0.8 - type: EntitySpawnAnomaly - entries: - - spawnOnPulse: true - minAmount: 8 - maxAmount: 15 - minRange: 4.5 - maxRange: 7.5 - spawns: - - WallSpawnAsteroid - - 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 + maxSpawnAmount: 50 + spawnRange: 10 + spawns: + - WallSpawnAsteroid + - RockAnomCrabSpawner + - CrystalSpawner + superCriticalSpawns: + - WallSpawnAsteroid + - SpawnMobOreCrab - type: entity id: AnomalyFlora @@ -543,31 +316,15 @@ types: Slash: 0 - type: TileSpawnAnomaly - entries: - - spawnOnPulse: true - minAmount: 3 - maxAmount: 7 - maxRange: 5 - floor: FloorAstroGrass - - spawnOnSuperCritical: true - minAmount: 10 - maxAmount: 30 - maxRange: 15 - floor: FloorAstroGrass + floorTileId: FloorAstroGrass + spawnRange: 6 - type: EntitySpawnAnomaly - entries: - - spawnOnPulse: true - minAmount: 2 - maxAmount: 5 - maxRange: 2 - spawns: - - KudzuFlowerFriendly - - spawnOnSuperCritical: true - minAmount: 5 - maxAmount: 10 - maxRange: 6 - spawns: - - KudzuFlowerAngry + maxSpawnAmount: 15 + spawnRange: 6 + superCriticalSpawns: + - KudzuFlowerAngry + spawns: + - KudzuFlowerFriendly - type: entity id: AnomalyFloraBulb @@ -643,13 +400,10 @@ types: Slash: 1 - type: EntitySpawnAnomaly - entries: - - spawnOnSuperCritical: true - minAmount: 3 - maxAmount: 8 - maxRange: 2 - spawns: - - ReagentSlimeSpawner + superCriticalSpawns: + - ReagentSlimeSpawner + spawns: + - PuddleSparkle - type: SolutionContainerManager solutions: anomaly: diff --git a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml index aa5f1421c7..d5c542a0a1 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml @@ -148,28 +148,6 @@ state: rock_asteroid_west - 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 id: AsteroidRockSilver parent: AsteroidRock @@ -191,15 +169,6 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - 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 - type: entity @@ -223,15 +192,6 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_tin - -- type: entity - id: AsteroidRockTinCrab - parent: AsteroidRockTin - suffix: Iron - components: - - type: OreVein - oreChance: 1.0 - currentOre: OreIronCrab - type: entity id: AsteroidRockUranium @@ -255,14 +215,6 @@ state: rock_asteroid_west - state: rock_uranium -- type: entity - id: AsteroidRockUraniumCrab - parent: AsteroidRockUranium - suffix: Uranium Crab - components: - - type: OreVein - oreChance: 1.0 - currentOre: OreUraniumCrab - type: entity id: AsteroidRockBananium @@ -319,6 +271,46 @@ oreChance: 0.33 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 id: IronRock parent: AsteroidRock diff --git a/Resources/Textures/Structures/Specific/anomaly.rsi/anom6-pulse.png b/Resources/Textures/Structures/Specific/anomaly.rsi/anom6-pulse.png index cfeabdaa81..f92a77a95e 100644 Binary files a/Resources/Textures/Structures/Specific/anomaly.rsi/anom6-pulse.png and b/Resources/Textures/Structures/Specific/anomaly.rsi/anom6-pulse.png differ diff --git a/Resources/Textures/Structures/Specific/anomaly.rsi/anom6.png b/Resources/Textures/Structures/Specific/anomaly.rsi/anom6.png index 14fc7d80c0..04c772bca1 100644 Binary files a/Resources/Textures/Structures/Specific/anomaly.rsi/anom6.png and b/Resources/Textures/Structures/Specific/anomaly.rsi/anom6.png differ