diff --git a/Content.Server/DeltaV/StationEvents/Components/GlimmerMobRuleComponent.cs b/Content.Server/DeltaV/StationEvents/Components/GlimmerMobRuleComponent.cs new file mode 100644 index 00000000000..bde0422a1ae --- /dev/null +++ b/Content.Server/DeltaV/StationEvents/Components/GlimmerMobRuleComponent.cs @@ -0,0 +1,11 @@ +using Content.Server.StationEvents.Events; +using Robust.Shared.Prototypes; + +namespace Content.Server.StationEvents.Components; + +[RegisterComponent, Access(typeof(GlimmerMobRule))] +public sealed partial class GlimmerMobRuleComponent : Component +{ + [DataField(required: true)] + public EntProtoId MobPrototype = string.Empty; +} diff --git a/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs b/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs new file mode 100644 index 00000000000..ec9ec770313 --- /dev/null +++ b/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs @@ -0,0 +1,56 @@ +using System.Linq; +using Robust.Shared.Random; +using Content.Server.GameTicking.Rules.Components; +using Content.Server.NPC.Components; +using Content.Server.Psionics.Glimmer; +using Content.Server.StationEvents.Components; +using Content.Shared.Psionics.Glimmer; +using Content.Shared.Abilities.Psionics; + +namespace Content.Server.StationEvents.Events; + +public sealed class GlimmerMobRule : StationEventSystem +{ + [Dependency] private readonly IRobustRandom _robustRandom = default!; + [Dependency] private readonly GlimmerSystem _glimmerSystem = default!; + + + protected override void Started(EntityUid uid, GlimmerMobRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) + { + base.Started(uid, component, gameRule, args); + + var glimmerSources = EntityQuery().ToList(); + var normalSpawnLocations = EntityQuery().ToList(); + var hiddenSpawnLocations = EntityQuery().ToList(); + + var baseCount = Math.Max(1, EntityQuery().Count() / 10); + int multiplier = Math.Max(1, (int) _glimmerSystem.GetGlimmerTier() - 2); + + var total = baseCount * multiplier; + + int i = 0; + while (i < total) + { + if (glimmerSources.Count != 0 && _robustRandom.Prob(0.4f)) + { + Spawn(component.MobPrototype, _robustRandom.Pick(glimmerSources).Item2.Coordinates); + i++; + continue; + } + + if (normalSpawnLocations.Count != 0) + { + Spawn(component.MobPrototype, _robustRandom.Pick(normalSpawnLocations).Item2.Coordinates); + i++; + continue; + } + + if (hiddenSpawnLocations.Count != 0) + { + Spawn(component.MobPrototype, _robustRandom.Pick(hiddenSpawnLocations).Item2.Coordinates); + i++; + continue; + } + } + } +} diff --git a/Resources/Audio/DeltaV/Glimmer_Creatures/attributions.yml b/Resources/Audio/DeltaV/Glimmer_Creatures/attributions.yml new file mode 100644 index 00000000000..6ef81adf314 --- /dev/null +++ b/Resources/Audio/DeltaV/Glimmer_Creatures/attributions.yml @@ -0,0 +1,4 @@ +- files: [mite.ogg] + copyright: '"mite.ogg" by leonardo-dabepis' + license: CC0-1.0 + source: https://github.com/DeltaV-Station/Delta-v/pull/564 \ No newline at end of file diff --git a/Resources/Audio/DeltaV/Glimmer_Creatures/mite.ogg b/Resources/Audio/DeltaV/Glimmer_Creatures/mite.ogg new file mode 100644 index 00000000000..63c99254b30 Binary files /dev/null and b/Resources/Audio/DeltaV/Glimmer_Creatures/mite.ogg differ diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/glimmer_creatures.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/glimmer_creatures.yml new file mode 100644 index 00000000000..8dc9062a006 --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/glimmer_creatures.yml @@ -0,0 +1,35 @@ +- type: entity + name: glimmer mite + parent: MobCockroach + id: MobGlimmerMite + description: A strange pest from a world beyond the noosphere. + components: + - type: Sprite + sprite: DeltaV/Mobs/Ghosts/glimmermite.rsi + layers: + - map: ["enum.DamageStateVisualLayers.Base"] + state: mite + - type: DamageStateVisuals + states: + Alive: + Base: mite + Dead: + Base: mite_dead + baseDecayRate: 0.25 + - type: SolutionContainerManager + solutions: + food: + reagents: + - ReagentId: Ectoplasm + Quantity: 5 + - type: Bloodstream + bloodReagent: Ectoplasm + bloodMaxVolume: 20 + - type: PotentialPsionic + - type: Psionic + - type: GlimmerSource + - type: AmbientSound + range: 6 + volume: -3 + sound: /Audio/DeltaV/Glimmer_Creatures/mite.ogg + - type: AmbientOnPowered diff --git a/Resources/Prototypes/Nyanotrasen/GameRules/events.yml b/Resources/Prototypes/Nyanotrasen/GameRules/events.yml index 8f2320170c8..61cf6eaf1f0 100644 --- a/Resources/Prototypes/Nyanotrasen/GameRules/events.yml +++ b/Resources/Prototypes/Nyanotrasen/GameRules/events.yml @@ -133,3 +133,15 @@ maximumGlimmer: 900 report: glimmer-event-report-signatures - type: GlimmerRevenantRule + +- type: entity + id: GlimmerMiteSpawn + parent: BaseGlimmerEvent + noSpawn: true + components: + - type: GlimmerEvent + minimumGlimmer: 50 + maximumGlimmer: 900 + report: glimmer-event-report-signatures + - type: GlimmerMobRule + mobPrototype: MobGlimmerMite diff --git a/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/icon.png b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/icon.png new file mode 100644 index 00000000000..31fc55ec826 Binary files /dev/null and b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/icon.png differ diff --git a/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/meta.json b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/meta.json new file mode 100644 index 00000000000..b078d98ad3f --- /dev/null +++ b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/meta.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "leonardo_dabepis (232229415176634368) on Discord", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "mite", + "directions": 4, + "delays": [ + [ + 0.2, + 0.3 + ], + [ + 0.2, + 0.3 + ], + [ + 0.2, + 0.3 + ], + [ + 0.2, + 0.3 + ] + ] + }, + { + "name": "icon" + }, + { + "name": "mite_dead" + } + ] +} diff --git a/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/mite.png b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/mite.png new file mode 100644 index 00000000000..222d81f9165 Binary files /dev/null and b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/mite.png differ diff --git a/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/mite_dead.png b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/mite_dead.png new file mode 100644 index 00000000000..a2e2e2e62f4 Binary files /dev/null and b/Resources/Textures/DeltaV/Mobs/Ghosts/glimmermite.rsi/mite_dead.png differ