Rock Anomaly (#20635)

This commit is contained in:
brainfood1183 2023-10-05 20:53:53 +01:00 committed by Debug
parent 5f93ea1ff8
commit 5d1182b8af
22 changed files with 424 additions and 20 deletions

View File

@ -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<string>(){component.SupercriticalSpawn});
SpawnMonstersOnOpenTiles(component, xform, component.MaxSpawnAmount, component.SpawnRange, component.SuperCriticalSpawns);
}
private void SpawnMonstersOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius, List<string> spawns)
private void SpawnMonstersOnOpenTiles(EntitySpawnAnomalyComponent component, TransformComponent xform, int amount, float radius, List<EntProtoId> 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;
}

View File

@ -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);
}

View File

@ -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
/// <summary>
/// A list of entities that are random picked to be spawned on each pulse
/// </summary>
[DataField("spawns", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public List<string> Spawns = new();
[DataField]
public List<EntProtoId> Spawns = new();
/// <summary>
/// A list of entities that are random picked to be spawned when supercritical;
/// </summary>
[DataField]
public List<EntProtoId> SuperCriticalSpawns = new();
/// <summary>
/// The maximum number of entities that spawn per pulse
@ -34,10 +40,4 @@ public sealed partial class EntitySpawnAnomalyComponent : Component
/// </summary>
[DataField("floorTileId", customTypeSerializer: typeof(PrototypeIdSerializer<ContentTileDefinition>)), ViewVariables(VVAccess.ReadWrite)]
public string FloorTileId = "FloorFlesh";
/// <summary>
/// The entity spawned when the anomaly goes supercritical
/// </summary>
[DataField("superCriticalSpawn", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string SupercriticalSpawn = "FleshKudzu";
}

View File

@ -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;
/// <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>

View File

@ -16,4 +16,5 @@
- AnomalyFlesh
- AnomalyBluespace
- AnomalyIce
- AnomalyRock
chance: 1

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -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
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -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
]
]
}
]
}

View File

@ -52,6 +52,12 @@
{
"name": "rock_wall_west"
},
{
"name": "rock_asteroid_ore"
},
{
"name": "rock_asteroid_ore1"
},
{
"name": "rock_asteroid"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB