From: brainfood1183 <113240905+brainfood1183@users.noreply.github.com> Date: Thu, 5 Oct 2023 19:53:53 +0000 (+0100) Subject: Rock Anomaly (#20635) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d4ed37d2663dafe62507ba5e897c2ab08f927ad2;p=space-station-14.git Rock Anomaly (#20635) --- diff --git a/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs b/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs index 5c8e92044c..5f20183314 100644 --- a/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/EntityAnomalySystem.cs @@ -1,13 +1,12 @@ -using System.Linq; +using System.Linq; using System.Numerics; -using Content.Server.Maps; using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Effects.Components; -using Content.Shared.Maps; using Content.Shared.Physics; using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server.Anomaly.Effects; @@ -39,11 +38,10 @@ public sealed class EntityAnomalySystem : EntitySystem // A cluster of monsters SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, component.Spawns); // And so much meat (for the meat anomaly at least) - Spawn(component.SupercriticalSpawn, xform.Coordinates); - SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, new List(){component.SupercriticalSpawn}); + SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, component.SuperCriticalSpawns); } - private void SpawnMonstersOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius, List spawns) + private void SpawnMonstersOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius, List spawns) { if (!component.Spawns.Any()) return; @@ -68,10 +66,12 @@ public sealed class EntityAnomalySystem : EntitySystem { if (!physQuery.TryGetComponent(ent, out var body)) continue; + if (body.BodyType != BodyType.Static || !body.Hard || (body.CollisionLayer & (int) CollisionGroup.Impassable) == 0) continue; + valid = false; break; } diff --git a/Content.Server/Anomaly/Effects/TileAnomalySystem.cs b/Content.Server/Anomaly/Effects/TileAnomalySystem.cs index 69644045d2..16f32f6f4b 100644 --- a/Content.Server/Anomaly/Effects/TileAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/TileAnomalySystem.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Numerics; using Content.Server.Maps; using Content.Shared.Anomaly.Components; @@ -38,7 +38,7 @@ public sealed class TileAnomalySystem : EntitySystem new Box2(localpos + new Vector2(-radius, -radius), localpos + new Vector2(radius, radius))); foreach (var tileref in tilerefs) { - if (!_random.Prob(0.33f)) + if (!_random.Prob(component.SpawnChance)) continue; _tile.ReplaceTile(tileref, fleshTile); } diff --git a/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs b/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs index 1dbe59a09b..7083c91040 100644 --- a/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs +++ b/Content.Shared/Anomaly/Effects/Components/EntitySpawnAnomalyComponent.cs @@ -1,4 +1,4 @@ -using Content.Shared.Maps; +using Content.Shared.Maps; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; @@ -11,8 +11,14 @@ public sealed partial class EntitySpawnAnomalyComponent : Component /// /// A list of entities that are random picked to be spawned on each pulse /// - [DataField("spawns", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer)), ViewVariables(VVAccess.ReadWrite)] - public List Spawns = new(); + [DataField] + public List Spawns = new(); + + /// + /// A list of entities that are random picked to be spawned when supercritical; + /// + [DataField] + public List SuperCriticalSpawns = new(); /// /// The maximum number of entities that spawn per pulse @@ -34,10 +40,4 @@ public sealed partial class EntitySpawnAnomalyComponent : Component /// [DataField("floorTileId", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] public string FloorTileId = "FloorFlesh"; - - /// - /// The entity spawned when the anomaly goes supercritical - /// - [DataField("superCriticalSpawn", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] - public string SupercriticalSpawn = "FleshKudzu"; } diff --git a/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs b/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs index 3ea1475c75..69209680bb 100644 --- a/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs +++ b/Content.Shared/Anomaly/Effects/Components/TileSpawnAnomaly.cs @@ -1,4 +1,4 @@ -using Content.Shared.Maps; +using Content.Shared.Maps; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; @@ -14,6 +14,12 @@ public sealed partial class TileSpawnAnomalyComponent : Component [DataField("spawnRange"), 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 /// diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml index a21ce2b13f..e1f1e56480 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/anomaly.yml @@ -16,4 +16,5 @@ - AnomalyFlesh - AnomalyBluespace - AnomalyIce + - AnomalyRock chance: 1 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..07820e91cd --- /dev/null +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/asteroidcrab.yml @@ -0,0 +1,15 @@ +- type: entity + name: Asteroid Crab Spawner + id: AsteroidCrabSpawner + parent: MarkerBase + components: + - type: Sprite + layers: + - state: red + - sprite: Structures/Decoration/crystal.rsi + state: crystal_cyan + - type: RandomSpawner + prototypes: + - AsteroidRockCrab + - AsteroidRockCrab1 + chance: 1 diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/crystal.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/crystal.yml new file mode 100644 index 0000000000..c90f2d0bf6 --- /dev/null +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/crystal.yml @@ -0,0 +1,19 @@ +- type: entity + name: Crystal Spawner + suffix: 70% + id: CrystalSpawner + parent: MarkerBase + components: + - type: Sprite + layers: + - state: red + - sprite: Structures/Decoration/crystal.rsi + state: crystal_cyan + - type: RandomSpawner + prototypes: + - CrystalGreen + - CrystalPink + - CrystalOrange + - CrystalBlue + - CrystalCyan + chance: 0.7 diff --git a/Resources/Prototypes/Entities/Markers/Spawners/mobs.yml b/Resources/Prototypes/Entities/Markers/Spawners/mobs.yml index b9a68ba556..3bc1b637ff 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/mobs.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/mobs.yml @@ -705,3 +705,19 @@ - type: ConditionalSpawner prototypes: - MobPenguin + +- type: entity + name: ore crab spawner + id: SpawnMobOreCrab + parent: MarkerBase + components: + - type: Sprite + layers: + - state: green + - state: quartzcrab + sprite: Mobs/Elemental/orecrab.rsi + - type: RandomSpawner + prototypes: + - MobUraniumCrab + - MobIronCrab + - MobQuartzCrab diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml new file mode 100644 index 0000000000..a49d095535 --- /dev/null +++ b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml @@ -0,0 +1,208 @@ +- type: entity + save: false + abstract: true + id: MobElementalBase + components: + - type: LagCompensation + - type: Reactive + groups: + Acidic: [Touch] + - type: Clickable + - type: Damageable + damageContainer: Inorganic + - type: InteractionOutline + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeCircle + radius: 0.35 + density: 50 + mask: + - MobMask + layer: + - MobLayer + - type: MovementSpeedModifier + baseWalkSpeed : 2 + baseSprintSpeed : 3 + - type: Sprite + noRot: true + drawdepth: Mobs + - type: NpcFactionMember + factions: + - SimpleNeutral + - type: MovedByPressure + - type: Physics + bodyType: KinematicController # Same for all inheritors + - type: StatusEffects + allowed: + - Stun + - KnockedDown + - SlowedDown + - Stutter + - Electrocution + - type: Pullable + - type: Tag + tags: + - DoorBumpOpener + - ShoesRequiredStepTriggerImmune + - type: MobState + allowedStates: + - Alive + - Dead + - type: MobThresholds + thresholds: + 0: Alive + 120: Dead + - type: Stamina + critThreshold: 120 + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:TriggerBehavior + - trigger: + !type:DamageTrigger + damage: 120 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: Input + context: "human" + - type: InputMover + - type: MobMover + - type: ZombieImmune + +- type: entity + parent: MobElementalBase + id: MobQuartzCrab + name: quartz crab + description: An ore crab made from quartz. + components: + - type: Sprite + sprite: Mobs/Elemental/orecrab.rsi + state: quartzcrab + - type: HTN + rootTask: + task: SimpleHostileCompound + - type: MeleeWeapon + hidden: true + soundHit: + path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg + damage: + types: + Piercing: 12 + - type: CombatMode + - type: NpcFactionMember + factions: + - SimpleHostile + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 40 + behaviors: + - !type:PlaySoundBehavior + sound: + collection: GlassBreak + - !type:SpawnEntitiesBehavior + spawn: + SpaceQuartz: + min: 4 + max: 6 + - !type:DoActsBehavior + acts: [ "Destruction" ] + +- type: entity + parent: MobElementalBase + id: MobIronCrab + name: ore crab + description: An ore crab made from iron. + components: + - type: Sprite + sprite: Mobs/Elemental/orecrab.rsi + state: ironcrab + - type: HTN + rootTask: + task: SimpleHostileCompound + - type: MeleeWeapon + hidden: true + soundHit: + path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg + damage: + types: + Blunt: 8 + - type: CombatMode + - type: MovementSpeedModifier + baseWalkSpeed : 1.5 + baseSprintSpeed : 2 + - type: NpcFactionMember + factions: + - SimpleHostile + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 80 + behaviors: + - !type:PlaySoundBehavior + sound: + collection: GlassBreak + - !type:SpawnEntitiesBehavior + spawn: + SteelOre1: + min: 4 + max: 6 + - !type:DoActsBehavior + acts: [ "Destruction" ] + +- type: entity + parent: MobElementalBase + id: MobUraniumCrab + name: ore crab + description: An ore crab made from uranium. + components: + - type: Sprite + sprite: Mobs/Elemental/orecrab.rsi + state: uraniumcrab + - type: HTN + rootTask: + task: IdleCompound + - type: MeleeWeapon + hidden: true + soundHit: + path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg + damage: + types: + Blunt: 8 + - type: CombatMode + - type: MovementSpeedModifier + baseWalkSpeed : 2 + baseSprintSpeed : 2.5 + - type: NpcFactionMember + factions: + - SimpleHostile + - type: RadiationSource + intensity: 0.3 + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 80 + behaviors: + - !type:PlaySoundBehavior + sound: + collection: GlassBreak + - !type:SpawnEntitiesBehavior + spawn: + UraniumOre1: + min: 4 + max: 6 + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: PointLight + radius: 2 + energy: 3 + color: "#06DF24" diff --git a/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml b/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml index 5a368044b3..16d9365b9f 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml @@ -137,7 +137,8 @@ - type: TileSpawnAnomaly floorTileId: FloorFlesh - type: EntitySpawnAnomaly - superCriticalSpawn: FleshKudzu + superCriticalSpawns: + - FleshKudzu spawns: - MobFleshJared - MobFleshGolem @@ -231,3 +232,34 @@ releasedGas: 8 # Frezon. Please replace if there is a better way to specify this releaseOnMaxSeverity: true spawnRadius: 0 + +- type: entity + id: AnomalyRock + parent: BaseAnomaly + suffix: Rock + components: + - type: Sprite + layers: + - state: anom6 + map: ["enum.AnomalyVisualLayers.Base"] + - state: anom6-pulse + map: ["enum.AnomalyVisualLayers.Animated"] + visible: false + - type: PointLight + radius: 2.0 + energy: 7.5 + color: "#5ca8cb" + castShadows: false + - type: TileSpawnAnomaly + floorTileId: FloorAsteroidTile + spawnChance: 0.8 + - type: EntitySpawnAnomaly + maxSpawnAmount: 50 + spawnRange: 10 + spawns: + - AsteroidRock + - AsteroidCrabSpawner + - CrystalSpawner + superCriticalSpawns: + - AsteroidRock + - SpawnMobOreCrab diff --git a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml index 415eff5659..5ecbb8214c 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml @@ -68,6 +68,47 @@ 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 + noRot: true + 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 + noRot: true + 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 diff --git a/Resources/Prototypes/ore.yml b/Resources/Prototypes/ore.yml index 67c3d0c5e2..c8411940a4 100644 --- a/Resources/Prototypes/ore.yml +++ b/Resources/Prototypes/ore.yml @@ -36,6 +36,18 @@ id: OreBananium oreEntity: BananiumOre1 +- type: ore + id: OreQuartzCrab + oreEntity: MobQuartzCrab + +- type: ore + id: OreIronCrab + oreEntity: MobIronCrab + +- type: ore + id: OreUraniumCrab + oreEntity: MobUraniumCrab + - type: ore id: OreArtifactFragment oreEntity: ArtifactFragment @@ -53,3 +65,10 @@ OreUranium: 1 OreBananium: 0.5 OreArtifactFragment: 0.5 + +- type: weightedRandomOre + id: OreCrab + weights: + OreQuartzCrab: 5 + OreIronCrab: 5 + OreUraniumCrab: 3 diff --git a/Resources/Textures/Mobs/Elemental/orecrab.rsi/ironcrab.png b/Resources/Textures/Mobs/Elemental/orecrab.rsi/ironcrab.png new file mode 100644 index 0000000000..0852205314 Binary files /dev/null and b/Resources/Textures/Mobs/Elemental/orecrab.rsi/ironcrab.png differ diff --git a/Resources/Textures/Mobs/Elemental/orecrab.rsi/meta.json b/Resources/Textures/Mobs/Elemental/orecrab.rsi/meta.json new file mode 100644 index 0000000000..b8ffd5034d --- /dev/null +++ b/Resources/Textures/Mobs/Elemental/orecrab.rsi/meta.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Made by brainfood1183 (github)", + "states": [ + { + "name": "ironcrab", + "directions": 4 + }, + { + "name": "uraniumcrab", + "directions": 4 + }, + { + "name": "quartzcrab", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/Mobs/Elemental/orecrab.rsi/quartzcrab.png b/Resources/Textures/Mobs/Elemental/orecrab.rsi/quartzcrab.png new file mode 100644 index 0000000000..1da12987aa Binary files /dev/null and b/Resources/Textures/Mobs/Elemental/orecrab.rsi/quartzcrab.png differ diff --git a/Resources/Textures/Mobs/Elemental/orecrab.rsi/uraniumcrab.png b/Resources/Textures/Mobs/Elemental/orecrab.rsi/uraniumcrab.png new file mode 100644 index 0000000000..ae76b4d734 Binary files /dev/null and b/Resources/Textures/Mobs/Elemental/orecrab.rsi/uraniumcrab.png differ diff --git a/Resources/Textures/Structures/Specific/anomaly.rsi/anom6-pulse.png b/Resources/Textures/Structures/Specific/anomaly.rsi/anom6-pulse.png new file mode 100644 index 0000000000..f92a77a95e Binary files /dev/null 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 new file mode 100644 index 0000000000..04c772bca1 Binary files /dev/null and b/Resources/Textures/Structures/Specific/anomaly.rsi/anom6.png differ diff --git a/Resources/Textures/Structures/Specific/anomaly.rsi/meta.json b/Resources/Textures/Structures/Specific/anomaly.rsi/meta.json index c318e8116b..9337c5277f 100644 --- a/Resources/Textures/Structures/Specific/anomaly.rsi/meta.json +++ b/Resources/Textures/Structures/Specific/anomaly.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC0-1.0", - "copyright": "Created by EmoGarbage; anom3, anom3-pulse, anom4, anom4-pulse are CC-BY-SA-3.0 at https://github.com/ParadiseSS13/Paradise/blob/master/icons/effects/effects.dmi; anom5, anom5-pulse are CC-BY-SA-3.0 by Aleksh#7552 (discord) for space-station-14", + "copyright": "Created by EmoGarbage; anom3, anom3-pulse, anom4, anom4-pulse are CC-BY-SA-3.0 at https://github.com/ParadiseSS13/Paradise/blob/master/icons/effects/effects.dmi; anom5, anom5-pulse are CC-BY-SA-3.0 by Aleksh#7552 (discord) for space-station-14, anom6 & anom6-pulse are CC-BY-SA-3.0 by brainfood1183 (github) for space-station-14", "size": { "x": 32, "y": 32 @@ -106,6 +106,24 @@ 0.25 ] ] + }, + { + "name": "anom6" + }, + { + "name": "anom6-pulse", + "delays": [ + [ + 0.15625, + 0.15625, + 0.15625, + 0.15625, + 0.15625, + 0.15625, + 0.15625, + 0.15625 + ] + ] } ] } diff --git a/Resources/Textures/Structures/Walls/rock.rsi/meta.json b/Resources/Textures/Structures/Walls/rock.rsi/meta.json index 75e173270e..5c5277dad5 100644 --- a/Resources/Textures/Structures/Walls/rock.rsi/meta.json +++ b/Resources/Textures/Structures/Walls/rock.rsi/meta.json @@ -52,6 +52,12 @@ { "name": "rock_wall_west" }, + { + "name": "rock_asteroid_ore" + }, + { + "name": "rock_asteroid_ore1" + }, { "name": "rock_asteroid" }, diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_asteroid_ore.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_asteroid_ore.png new file mode 100644 index 0000000000..ef51386274 Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_asteroid_ore.png differ diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_asteroid_ore1.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_asteroid_ore1.png new file mode 100644 index 0000000000..ad31358aaa Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_asteroid_ore1.png differ