diff --git a/Content.Client/_CP14/MagicWeakness/CP14ClientMagicWeaknessSystem.cs b/Content.Client/_CP14/MagicWeakness/CP14ClientMagicWeaknessSystem.cs new file mode 100644 index 0000000000..3a76475d62 --- /dev/null +++ b/Content.Client/_CP14/MagicWeakness/CP14ClientMagicWeaknessSystem.cs @@ -0,0 +1,7 @@ +using Content.Shared._CP14.MagicWeakness; + +namespace Content.Client._CP14.MagicWeakness; + +public class CP14ClientMagicWeaknessSystem : CP14SharedMagicWeaknessSystem +{ +} diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Destruction.cs b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Destruction.cs new file mode 100644 index 0000000000..91995a4a8e --- /dev/null +++ b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Destruction.cs @@ -0,0 +1,47 @@ +using Content.Shared._CP14.Demiplane.Components; +using Robust.Shared.Audio; + +namespace Content.Server._CP14.Demiplane; + +public sealed partial class CP14DemiplaneSystem +{ + private void InitDestruction() + { + SubscribeLocalEvent(OnDestructionStarted); + } + + private void OnDestructionStarted(Entity ent, ref ComponentAdd args) + { + ent.Comp.EndTime = _timing.CurTime + ent.Comp.TimeToDestruction; + ent.Comp.SelectedSong = new SoundPathSpecifier(_audio.GetSound(ent.Comp.Sound)); + } + + private void UpdateDestruction(float frameTime) + { + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var destruction, out var demiplane)) + { + var remaining = destruction.EndTime - _timing.CurTime; + + if (destruction.SelectedSong is null) + continue; + + var audioLength = _audio.GetAudioLength(destruction.SelectedSong.Path.ToString()); + + if (destruction.Stream is null && remaining < audioLength) + { + var audio = _audio.PlayPvs(destruction.Sound, uid); + destruction.Stream = audio?.Entity; + _audio.SetMapAudio(audio); + Dirty(uid, destruction); + DemiplaneAnnounce(uid, Loc.GetString("cp14-demiplane-countdown", ("duration", audioLength.Minutes))); + } + + if (remaining <= TimeSpan.Zero) + { + _audio.Stop(destruction.Stream); + DeleteDemiplane((uid, demiplane)); + } + } + } +} diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Echoes.cs b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Echoes.cs index c93e70f2e4..e0b759542c 100644 --- a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Echoes.cs +++ b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Echoes.cs @@ -5,8 +5,6 @@ namespace Content.Server._CP14.Demiplane; public sealed partial class CP14DemiplaneSystem { - [Dependency] private readonly ChatSystem _chat = default!; - private void InitEchoes() { SubscribeLocalEvent(OnSpeak); diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Generation.cs b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Generation.cs index 26e3949fe5..6eb11bb04e 100644 --- a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Generation.cs +++ b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Generation.cs @@ -248,26 +248,13 @@ public sealed partial class CP14DemiplaneSystem foreach (var modifier in _proto.EnumeratePrototypes()) { var passed = true; - //Tag blacklist filter - foreach (var configTag in selectedConfig.Tags) - { - if (modifier.BlacklistTags.Count != 0 && modifier.BlacklistTags.Contains(configTag)) - { - passed = false; - break; - } - } - //Tag required filter + //Random prob filter if (passed) { - foreach (var reqTag in modifier.RequiredTags) + if (!_random.Prob(modifier.GenerationProb)) { - if (!selectedConfig.Tags.Contains(reqTag)) - { - passed = false; - break; - } + passed = false; } } @@ -306,12 +293,26 @@ public sealed partial class CP14DemiplaneSystem } } - //Random prob filter - if (passed) + //Tag blacklist filter + foreach (var configTag in selectedConfig.Tags) { - if (!_random.Prob(modifier.GenerationProb)) + if (modifier.BlacklistTags.Count != 0 && modifier.BlacklistTags.Contains(configTag)) { passed = false; + break; + } + } + + //Tag required filter + if (passed) + { + foreach (var reqTag in modifier.RequiredTags) + { + if (!selectedConfig.Tags.Contains(reqTag)) + { + passed = false; + break; + } } } diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs index e64cb94ce7..19d619df45 100644 --- a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs +++ b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs @@ -1,13 +1,18 @@ using Content.Server._CP14.Demiplane.Components; using Content.Server._CP14.RoundStatistic; +using Content.Server.Chat.Managers; +using Content.Server.Chat.Systems; using Content.Server.Flash; using Content.Server.Procedural; using Content.Shared._CP14.Demiplane; using Content.Shared._CP14.Demiplane.Components; +using Content.Shared.Chat; using Content.Shared.Popups; using Robust.Server.Audio; using Robust.Shared.Audio; using Robust.Shared.Map; +using Robust.Shared.Map.Components; +using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -29,6 +34,8 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly CP14RoundStatTrackerSystem _statistic = default!; + [Dependency] private readonly ChatSystem _chat = default!; + [Dependency] private readonly IChatManager _chatManager = default!; private EntityQuery _demiplaneQuery; @@ -42,6 +49,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem InitConnections(); InitStabilization(); InitEchoes(); + InitDestruction(); SubscribeLocalEvent(OnDemiplanShutdown); SubscribeLocalEvent(OnSpawnOutOfDemiplane); @@ -75,6 +83,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem UpdateGeneration(frameTime); UpdateStabilization(frameTime); + UpdateDestruction(frameTime); } /// @@ -161,4 +170,19 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem RemoveDemiplaneRandomEntryPoint(demiplane, entry); } } + + private void DemiplaneAnnounce(EntityUid mapUid, string text) + { + var mapId = Comp(mapUid).MapId; + + _chatManager.ChatMessageToManyFiltered( + Filter.BroadcastMap(mapId), + ChatChannel.Radio, + text, + text, + _mapManager.GetMapEntityId(mapId), + false, + true, + null); + } } diff --git a/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs b/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs index f1b9030df6..2d49f26655 100644 --- a/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs +++ b/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs @@ -95,18 +95,14 @@ public sealed class CP14SpawnRandomDemiplaneJob : Job if (!_prototypeManager.TryIndex(modifier, out var indexedModifier)) continue; - dungeonConfig.Layers.AddRange(indexedModifier.Layers); - _entManager.AddComponents(DemiplaneMapUid, indexedModifier.Components); + if (indexedModifier.Layers != null) + dungeonConfig.Layers.AddRange(indexedModifier.Layers); + if (indexedModifier.Components != null) + _entManager.AddComponents(DemiplaneMapUid, indexedModifier.Components); _sawmill.Debug($"Added modifier: {_seed} - {modifier.Id}"); } - //Enter and exits - if (_prototypeManager.TryIndex("DemiplaneConnections", out var indexedConnections)) - { - dungeonConfig.Layers.AddRange(indexedConnections.Layers); - } - //Setup gravity var gravity = _entManager.EnsureComponent(grid); gravity.Enabled = true; diff --git a/Content.Server/_CP14/MagicWeakness/CP14MagicWeaknessSystem.cs b/Content.Server/_CP14/MagicWeakness/CP14MagicWeaknessSystem.cs new file mode 100644 index 0000000000..81a6ceecc1 --- /dev/null +++ b/Content.Server/_CP14/MagicWeakness/CP14MagicWeaknessSystem.cs @@ -0,0 +1,28 @@ +using Content.Server.Explosion.EntitySystems; +using Content.Shared._CP14.MagicEnergy; +using Content.Shared._CP14.MagicWeakness; + +namespace Content.Server._CP14.MagicWeakness; + +public class CP14MagicWeaknessSystem : CP14SharedMagicWeaknessSystem +{ + [Dependency] private readonly TriggerSystem _trigger = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnMagicEnergyBurnOutTrigger); + SubscribeLocalEvent(OnMagicEnergyOverloadTrigger); + } + + private void OnMagicEnergyOverloadTrigger(Entity ent, ref CP14MagicEnergyOverloadEvent args) + { + _trigger.Trigger(ent); + } + + private void OnMagicEnergyBurnOutTrigger(Entity ent, ref CP14MagicEnergyBurnOutEvent args) + { + _trigger.Trigger(ent); + } +} diff --git a/Content.Server/_CP14/UniqueLoot/CP14UniqueLootSystem.cs b/Content.Server/_CP14/UniqueLoot/CP14UniqueLootSystem.cs index cc62f44028..f9b6affd61 100644 --- a/Content.Server/_CP14/UniqueLoot/CP14UniqueLootSystem.cs +++ b/Content.Server/_CP14/UniqueLoot/CP14UniqueLootSystem.cs @@ -29,9 +29,6 @@ public sealed partial class CP14UniqueLootSystem : EntitySystem if (!Deleted(ent)) Spawn(loot, Transform(ent).Coordinates); - - if (!TerminatingOrDeleted(ent) && Exists(ent)) - QueueDel(ent); } private void OnRoundStart(RoundStartingEvent ev) diff --git a/Content.Shared/_CP14/Demiplane/Components/CP14DemiplaneTimedDestructionComponent.cs b/Content.Shared/_CP14/Demiplane/Components/CP14DemiplaneTimedDestructionComponent.cs new file mode 100644 index 0000000000..9495598efc --- /dev/null +++ b/Content.Shared/_CP14/Demiplane/Components/CP14DemiplaneTimedDestructionComponent.cs @@ -0,0 +1,37 @@ +using Robust.Shared.Audio; + +namespace Content.Shared._CP14.Demiplane.Components; + +/// +/// Destroy demiplane after time +/// +[RegisterComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(CP14SharedDemiplaneSystem))] +public sealed partial class CP14DemiplaneTimedDestructionComponent : Component +{ + [DataField] + public TimeSpan TimeToDestruction = TimeSpan.FromSeconds(150f); + + [DataField, AutoPausedField] + public TimeSpan EndTime = TimeSpan.Zero; + + /// + /// Countdown audio stream. + /// + [DataField, AutoNetworkedField] + public EntityUid? Stream = null; + + /// + /// Sound that plays when the demiplane start to collapse. + /// + [DataField] + public SoundSpecifier Sound = new SoundCollectionSpecifier("ExpeditionEnd") + { + Params = AudioParams.Default.WithVolume(-5), + }; + + /// + /// Song selected on MapInit so we can predict the audio countdown properly. + /// + [DataField] + public SoundPathSpecifier? SelectedSong; +} diff --git a/Content.Shared/_CP14/Demiplane/Prototypes/CP14DemiplaneModifierPrototype.cs b/Content.Shared/_CP14/Demiplane/Prototypes/CP14DemiplaneModifierPrototype.cs index 02cb7f5196..41b136bcc8 100644 --- a/Content.Shared/_CP14/Demiplane/Prototypes/CP14DemiplaneModifierPrototype.cs +++ b/Content.Shared/_CP14/Demiplane/Prototypes/CP14DemiplaneModifierPrototype.cs @@ -15,13 +15,13 @@ public sealed partial class CP14DemiplaneModifierPrototype : IPrototype /// /// Modifier Tier. Can be generated only in demiplane keys with the corresponding tier /// - [DataField(required: true)] + [DataField] public List Tiers = new(); /// /// Each modifier belongs to specific categories. Used by the generator to determine what to generate /// - [DataField(required: true)] + [DataField] public Dictionary, float> Categories = new(); /// @@ -48,13 +48,13 @@ public sealed partial class CP14DemiplaneModifierPrototype : IPrototype /// Generation layers that will be added to the location generation after the main layers. /// [DataField] - public List Layers = new(); + public List? Layers; /// /// Components that will be added to the map /// [DataField] - public ComponentRegistry Components = new(); + public ComponentRegistry? Components; /// /// Modifier cannot be applied to locations with the following tags. Leave empty for disable diff --git a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeDamageComponent.cs b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeDamageComponent.cs index 88ca27ccf4..d777481cd5 100644 --- a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeDamageComponent.cs +++ b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeDamageComponent.cs @@ -8,7 +8,7 @@ namespace Content.Shared._CP14.MagicWeakness; /// imposes damage on excessive use of magic /// [RegisterComponent, NetworkedComponent] -[Access(typeof(CP14MagicWeaknessSystem))] +[Access(typeof(CP14SharedMagicWeaknessSystem))] public sealed partial class CP14MagicUnsafeDamageComponent : Component { [DataField] diff --git a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs index 214bcab11f..eac89558ce 100644 --- a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs +++ b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeSleepComponent.cs @@ -7,7 +7,7 @@ namespace Content.Shared._CP14.MagicWeakness; /// imposes debuffs on excessive use of magic /// [RegisterComponent, NetworkedComponent] -[Access(typeof(CP14MagicWeaknessSystem))] +[Access(typeof(CP14SharedMagicWeaknessSystem))] public sealed partial class CP14MagicUnsafeSleepComponent : Component { [DataField] diff --git a/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeTriggerComponent.cs b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeTriggerComponent.cs new file mode 100644 index 0000000000..ce9e49f952 --- /dev/null +++ b/Content.Shared/_CP14/MagicWeakness/CP14MagicUnsafeTriggerComponent.cs @@ -0,0 +1,12 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared._CP14.MagicWeakness; + +/// +/// trigger entity on unsafe magic energy damage +/// +[RegisterComponent, NetworkedComponent] +[Access(typeof(CP14SharedMagicWeaknessSystem))] +public sealed partial class CP14MagicUnsafeTriggerComponent : Component +{ +} diff --git a/Content.Shared/_CP14/MagicWeakness/CP14MagicWeaknessSystem.cs b/Content.Shared/_CP14/MagicWeakness/CP14SharedMagicWeaknessSystem.cs similarity index 98% rename from Content.Shared/_CP14/MagicWeakness/CP14MagicWeaknessSystem.cs rename to Content.Shared/_CP14/MagicWeakness/CP14SharedMagicWeaknessSystem.cs index 86bb5cf63a..dc02376a1e 100644 --- a/Content.Shared/_CP14/MagicWeakness/CP14MagicWeaknessSystem.cs +++ b/Content.Shared/_CP14/MagicWeakness/CP14SharedMagicWeaknessSystem.cs @@ -7,7 +7,7 @@ using Content.Shared.StatusEffect; namespace Content.Shared._CP14.MagicWeakness; -public partial class CP14MagicWeaknessSystem : EntitySystem +public abstract class CP14SharedMagicWeaknessSystem : EntitySystem { [ValidatePrototypeId] private const string StatusEffectKey = "ForcedSleep"; diff --git a/Resources/Locale/en-US/_CP14/demiplane/demiplane.ftl b/Resources/Locale/en-US/_CP14/demiplane/demiplane.ftl index 595630ca8f..8b76b39390 100644 --- a/Resources/Locale/en-US/_CP14/demiplane/demiplane.ftl +++ b/Resources/Locale/en-US/_CP14/demiplane/demiplane.ftl @@ -9,4 +9,6 @@ cp14-round-end-monolith-recharged = Contact with the other worlds is being re-es cp14-round-end = The demiplane link crystal was completely discharged. The connection to the other worlds has been severed. The "interesting" part of the story is over here.... -cp14-demiplane-echoes = Echoes of voices \ No newline at end of file +cp14-demiplane-echoes = Echoes of voices + +cp14-demiplane-countdown = The Demiplane is beginning to collapse! You have {$duration} minutes to escape! \ No newline at end of file diff --git a/Resources/Locale/en-US/_CP14/demiplane/modifiers.ftl b/Resources/Locale/en-US/_CP14/demiplane/modifiers.ftl index af530f3227..0578473637 100644 --- a/Resources/Locale/en-US/_CP14/demiplane/modifiers.ftl +++ b/Resources/Locale/en-US/_CP14/demiplane/modifiers.ftl @@ -18,4 +18,5 @@ cp14-modifier-rabbits = rabbits cp14-modifier-boars = wild boars cp14-modifier-chasm = bottomless chasms cp14-modifier-air-lily = air lilies -cp14-modifier-unstable-demiplane-crystal = unstable demiplane crystal \ No newline at end of file +cp14-modifier-time-limit-10 = temporary disintegration (10 minutes) +cp14-modifier-shadow-kudzu = spreading darkness \ No newline at end of file diff --git a/Resources/Locale/en-US/_CP14/events/events.ftl b/Resources/Locale/en-US/_CP14/events/events.ftl index 1de31c8519..9399d96285 100644 --- a/Resources/Locale/en-US/_CP14/events/events.ftl +++ b/Resources/Locale/en-US/_CP14/events/events.ftl @@ -1,2 +1,2 @@ cp14-event-announcement-demiplane-outbreak = A sense of danger pierces the air... Something from other worlds is invading your town. -cp14-event-announcement-unstable-demiplane = Tension is building... an unstable demiplane has opened somewhere in the settlement. Close it down before the monsters come out. \ No newline at end of file +cp14-event-announcement-unstable-demiplane = Tension is building... an wild demiplane has opened somewhere in the settlement. Close it down before the monsters come out. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/demiplane/demiplane.ftl b/Resources/Locale/ru-RU/_CP14/demiplane/demiplane.ftl index 58ad6f2b2d..eefb224b30 100644 --- a/Resources/Locale/ru-RU/_CP14/demiplane/demiplane.ftl +++ b/Resources/Locale/ru-RU/_CP14/demiplane/demiplane.ftl @@ -9,4 +9,6 @@ cp14-round-end-monolith-recharged = Связь с другими мирами в cp14-round-end = Кристалл связи с демипланами окончательно разрядился. Связь с другими мирами оборвалась. "Интересная" часть этой истории окончена... -cp14-demiplane-echoes = Эхо голосов \ No newline at end of file +cp14-demiplane-echoes = Эхо голосов + +cp14-demiplane-countdown = Демиплан начинает коллапсировать! У вас {$duration} минут, чтобы покинуть его! \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/demiplane/modifiers.ftl b/Resources/Locale/ru-RU/_CP14/demiplane/modifiers.ftl index 8af9e009f1..6df7f73f1c 100644 --- a/Resources/Locale/ru-RU/_CP14/demiplane/modifiers.ftl +++ b/Resources/Locale/ru-RU/_CP14/demiplane/modifiers.ftl @@ -18,4 +18,5 @@ cp14-modifier-rabbits = кроликов cp14-modifier-boars = диких кабанов cp14-modifier-chasm = бездонных пропастей cp14-modifier-air-lily = воздушных лилий -cp14-modifier-unstable-demiplane-crystal = нестабильного кристалла демипланов +cp14-modifier-time-limit-10 = временного распада (10 минут) +cp14-modifier-shadow-kudzu = распространяющейся тьмы \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/events/events.ftl b/Resources/Locale/ru-RU/_CP14/events/events.ftl index 6d41e64e72..fd9fbba4a7 100644 --- a/Resources/Locale/ru-RU/_CP14/events/events.ftl +++ b/Resources/Locale/ru-RU/_CP14/events/events.ftl @@ -1,2 +1,2 @@ cp14-event-announcement-demiplane-outbreak = Воздух пронзает чувство опасности... Что-то из других миров вторгается в ваш городок. -cp14-event-announcement-unstable-demiplane = Нарастает напряжение... где-то в городе открылся нестабильный демиплан. Закройте его, до того как из него вырвутся толпы монстров. \ No newline at end of file +cp14-event-announcement-unstable-demiplane = Нарастает напряжение... где-то в городе открылся дикий демиплан. Закройте его, до того как из него вырвутся толпы монстров. \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/demiplane_keys.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/demiplane_keys.yml index 12595d9f62..b4a76e2152 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Tools/demiplane_keys.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/demiplane_keys.yml @@ -33,6 +33,9 @@ Fun: 1 Weather: 1 MapLight: 1 + selectedModifiers: + - EntryRoom + - Exit - type: entity id: CP14DemiplaneKeyT2 @@ -46,11 +49,14 @@ color: red - type: CP14DemiplaneGeneratorData tiersContent: - 1: 0.75 # We dont have lot t2 content now. In future, decrease to 0.33 + 1: 0.6 # We dont have lot t2 content now. In future, decrease to 0.33 2: 1 limits: - Reward: 1.5 - Danger: 2 + Reward: 1 + Danger: 1 Fun: 1 Weather: 1 - MapLight: 1 \ No newline at end of file + MapLight: 1 + selectedModifiers: + - EntryRoom + - Exit \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/rifts.yml b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/rifts.yml index 5db1953b75..b7c06d3e7b 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/rifts.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/rifts.yml @@ -1,3 +1,36 @@ +- type: entity + id: CP14DemiplanRiftCore + categories: [ ForkFiltered ] + name: demiplan rift core + description: A subtle connection between the real world and the demiplane where the adventurers went. Sooner or later they will return from there. + components: + - type: CP14DemiplaneRift + - type: Transform + anchored: True + - type: Clickable + - type: Physics + canCollide: false + bodyType: Static + - type: Sprite + noRot: true + drawdepth: Effects + sprite: /Textures/_CP14/Structures/Dungeon/demiplan_rift_core.rsi + layers: + - state: connective + shader: unshaded + - type: PointLight + radius: 2 + energy: 2 + color: "#371c5c" + netsync: false + - type: GuideHelp + guides: + - CP14_RU_Demiplanes + - CP14_EN_Demiplanes + - type: Speech + speechVerb: Ghost + + - type: entity id: CP14DemiplaneTimedRadiusPassway parent: CP14DemiplanRiftCore @@ -70,35 +103,4 @@ shader: unshaded color: red - type: PointLight - color: red - -- type: entity - id: CP14DemiplanRiftCore - categories: [ ForkFiltered ] - name: demiplan rift core - description: A subtle connection between the real world and the demiplane where the adventurers went. Sooner or later they will return from there. - components: - - type: CP14DemiplaneRift - - type: Transform - anchored: True - - type: Clickable - - type: Physics - canCollide: false - bodyType: Static - - type: Sprite - drawdepth: Effects - sprite: /Textures/_CP14/Structures/Dungeon/demiplan_rift_core.rsi - layers: - - state: connective - shader: unshaded - - type: PointLight - radius: 2 - energy: 2 - color: "#371c5c" - netsync: false - - type: GuideHelp - guides: - - CP14_RU_Demiplanes - - CP14_EN_Demiplanes - - type: Speech - speechVerb: Ghost + color: red \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/unstable_rift.yml b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/unstable_rift.yml index 0a004d6675..16f5e8f486 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/unstable_rift.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Demiplanes/unstable_rift.yml @@ -45,51 +45,96 @@ - type: Damageable - type: Destructible thresholds: - - trigger: - !type:DamageTypeTrigger - damageType: Heat - damage: 2 - behaviors: - - !type:TriggerBehavior - - !type:DoActsBehavior - acts: [ "Destruction" ] + + # First wave - trigger: !type:DamageTrigger damage: 50 behaviors: - - !type:DoActsBehavior - acts: [ "Destruction" ] - !type:SpawnEntitiesBehavior + offset: 6 spawn: - CP14DemiplaneKeyT1: - min: 0 - max: 2 + CP14MobGroupSpawnerMosquito: + min: 1 + max: 1 + + # Second wave + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: - !type:SpawnEntitiesBehavior + offset: 6 + spawn: + CP14MobGroupSpawnerHydras: + min: 1 + max: 1 + + # Third wave + - trigger: + !type:DamageTrigger + damage: 200 + behaviors: + - !type:SpawnEntitiesBehavior + offset: 6 + spawn: + CP14MobGroupSpawnerIceSpectres: + min: 1 + max: 1 + - !type:SpawnEntitiesBehavior + offset: 6 + spawn: + CP14MobGroupSpawnerZombie: + min: 1 + max: 1 + + # Destroyed Yay! + - trigger: + !type:DamageTrigger + damage: 300 + behaviors: + - !type:SpawnEntitiesBehavior # Reward + offset: 5 + spawn: + CP14SpawnerDemiplaneLootT1: + min: 4 + max: 8 + - !type:SpawnEntitiesBehavior + offset: 2 spawn: CP14DemiplaneKeyT2: min: 1 max: 1 - - !type:PlaySoundBehavior + - !type:SpawnEntitiesBehavior # Exit + spawn: + CP14DemiplanePasswayRed: + min: 1 + max: 1 + - !type:PlaySoundBehavior #SFX sound: collection: GlassBreak + - !type:PlaySoundBehavior + sound: + path: /Audio/Effects/demon_dies.ogg + params: + pitch: 1.5 + - !type:DoActsBehavior + acts: [ "Destruction" ] - type: CP14MagicEnergyExaminable - type: CP14MagicEnergyContainer - maxEnergy: 500 - energy: 500 + maxEnergy: 600 + energy: 600 - type: CP14MagicEnergyDraw - energy: -5 + energy: -6 delay: 6 # 10m to discharge safe: false - - type: CP14MagicUnsafeDamage - damagePerEnergy: - types: - Heat: 0.1 + - type: CP14MagicUnsafeTrigger - type: DeleteOnTrigger - type: SpawnOnTrigger proto: CP14MobGroupSpawnerRandom - type: CP14DemiplaneStabilizer - type: AmbientSound - volume: 10 + volume: 20 range: 15 sound: path: /Audio/_CP14/Effects/demiplane_heartbeat.ogg @@ -98,6 +143,7 @@ parent: MarkerBase name: mob group random spawner id: CP14MobGroupSpawnerRandom + suffix: Spawn self copy out of demiplane categories: [ ForkFiltered ] components: - type: CP14SpawnOutOfDemiplane @@ -105,16 +151,15 @@ offset: 3 table: !type:GroupSelector rolls: !type:RangeNumberSelector - range: 1, 2 + range: 2, 2 children: - - id: CP14MobGroupSpawnerHydras - - id: CP14MobGroupSpawnerMosquito + - id: CP14MobGroupSpawnerIceSpectres - id: CP14MobGroupSpawnerZombie - type: entity id: CP14AutoDemiplaneKeyT1 parent: CP14DemiplaneKeyT1 - suffix: T1, Auto Open + suffix: T1 Unstable rift event, Auto Open components: - type: CP14DemiplaneAutoOpen - type: CP14DemiplaneGeneratorData @@ -122,12 +167,14 @@ - CP14DemiplanRiftCore - CP14DemiplanePasswayRed selectedModifiers: - - UnstableDemiplaneCrystal + - EntryRoom + - UnstableDemiplaneCrystal #Spawn exit when broken + - TimeLimit10 - type: entity id: CP14AutoDemiplaneKeyT2 parent: CP14DemiplaneKeyT2 - suffix: T2, Auto Open + suffix: T2 Unstable rift event, Auto Open components: - type: CP14DemiplaneAutoOpen - type: CP14DemiplaneGeneratorData @@ -135,4 +182,6 @@ - CP14DemiplanRiftCore - CP14DemiplanePasswayRed selectedModifiers: - - UnstableDemiplaneCrystal \ No newline at end of file + - EntryRoom + - UnstableDemiplaneCrystal #Spawn exit when broken + - TimeLimit10 diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/Danger/misc.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/Danger/misc.yml index ac81d34850..5ce75be0c2 100644 --- a/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/Danger/misc.yml +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/Danger/misc.yml @@ -18,9 +18,9 @@ - CP14FloorSnow - CP14FloorSnowDeep - CP14FloorSnowDeepDeep - count: 5 - minGroupSize: 2 - maxGroupSize: 5 + count: 4 + minGroupSize: 5 + maxGroupSize: 8 # TIER 2 @@ -32,7 +32,7 @@ name: cp14-modifier-explosive generationWeight: 0.25 categories: - Danger: 0.4 + Danger: 0.2 layers: - !type:OreDunGen entity: LandMineExplosive @@ -45,6 +45,7 @@ tiers: - 2 - 3 + name: cp14-modifier-shadow-kudzu categories: Danger: 0.3 layers: @@ -55,17 +56,14 @@ maxGroupSize: 1 - type: cp14DemiplaneModifier - id: UnstableDemiplaneCrystal - generationWeight: 0.05 # Very rare + id: TimeLimit10 + generationWeight: 0.4 tiers: + - 1 - 2 - - 3 - name: cp14-modifier-unstable-demiplane-crystal + name: cp14-modifier-time-limit-10 categories: - Danger: 0.3 - layers: - - !type:OreDunGen - entity: CP14DangerousMobSpawnCrystal - count: 1 - minGroupSize: 1 - maxGroupSize: 1 + Danger: 0.1 + components: + - type: CP14DemiplaneTimedDestruction + timeToDestruction: 600 # 10 minutes \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/special.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/special.yml new file mode 100644 index 0000000000..c359fecba8 --- /dev/null +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/special.yml @@ -0,0 +1,28 @@ +- type: cp14DemiplaneModifier + id: UnstableDemiplaneCrystal + layers: + - !type:OreDunGen + entity: CP14DangerousMobSpawnCrystal + count: 1 + minGroupSize: 1 + maxGroupSize: 1 + +- type: cp14DemiplaneModifier + id: EntryRoom + generationProb: 0 + layers: + - !type:OreDunGen + entity: CP14DemiplanEnterRoomMarker + count: 1 + minGroupSize: 1 + maxGroupSize: 1 + +- type: cp14DemiplaneModifier + id: Exit + generationProb: 0 + layers: + - !type:OreDunGen + entity: CP14DemiplanePassway + count: 2 + minGroupSize: 1 + maxGroupSize: 1 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml deleted file mode 100644 index 250ea54bb6..0000000000 --- a/Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml +++ /dev/null @@ -1,18 +0,0 @@ -- type: dungeonConfig - id: DemiplaneConnections - layers: - #- !type:OreDunGen - # entity: CP14DemiplaneEntryPointMarker - # count: 1 - # minGroupSize: 4 - # maxGroupSize: 4 - - !type:OreDunGen - entity: CP14DemiplanEnterRoomMarker - count: 1 - minGroupSize: 1 - maxGroupSize: 1 - - !type:OreDunGen - entity: CP14DemiplanePassway - count: 2 - minGroupSize: 1 - maxGroupSize: 1 \ No newline at end of file