diff --git a/Content.Server/ATLAS/Supermatter/EntitySystems/SupermatterSystem.cs b/Content.Server/ATLAS/Supermatter/EntitySystems/SupermatterSystem.cs index 1629efb2207519..b73ef4b2787086 100644 --- a/Content.Server/ATLAS/Supermatter/EntitySystems/SupermatterSystem.cs +++ b/Content.Server/ATLAS/Supermatter/EntitySystems/SupermatterSystem.cs @@ -9,6 +9,7 @@ using Robust.Server.GameObjects; using Content.Shared.Atmos; using Content.Shared.Damage; +using Content.Shared.Interaction; using Content.Shared.Projectiles; using Content.Shared.Tag; using Content.Shared.Damage.Prototypes; @@ -53,6 +54,7 @@ public override void Initialize() base.Initialize(); SubscribeLocalEvent(OnCollideEvent); + SubscribeLocalEvent(OnHandInteract); } public override void Update(float frameTime) @@ -400,6 +402,21 @@ private void Delamination(EntityUid uid, float frameTime, float damageArchived, sMcomponent.FinalCountdown = false; } + private void HandleSoundLoop(EntityUid uid, SupermatterComponent sMcomponent,DamageableComponent damageable) + { + var isAggressive = damageable.TotalDamage.Float() >= 50; + var smSound = isAggressive ? SuperMatterSound.Aggressive : SuperMatterSound.Calm; + + if (sMcomponent.SmSound == smSound) + return; + + sMcomponent.Stream?.Stop(); + var sounds = isAggressive ? sMcomponent.DelamSound : sMcomponent.CalmSound; + var sound = _audio.GetSound(sounds); + var param = sounds.Params.WithLoop(true).WithVolume(5f).WithMaxDistance(20f); + sMcomponent.Stream = _audio.Play(sound, Filter.Pvs(uid), uid, false, param); + sMcomponent.SmSound = smSound; + } /// /// Determines if an entity can be dusted @@ -442,20 +459,13 @@ private void OnCollideEvent(EntityUid uid, SupermatterComponent supermatter, ref EntityManager.QueueDeleteEntity(target); } - private void HandleSoundLoop(EntityUid uid, SupermatterComponent sMcomponent,DamageableComponent damageable) + private void OnHandInteract(EntityUid uid, SupermatterComponent supermatter, InteractHandEvent args) { - var isAggressive = damageable.TotalDamage.Float() >= 50; - var smSound = isAggressive ? SuperMatterSound.Aggressive : SuperMatterSound.Calm; - - if (sMcomponent.SmSound == smSound) - return; - - sMcomponent.Stream?.Stop(); - var sounds = isAggressive ? sMcomponent.DelamSound : sMcomponent.CalmSound; - var sound = _audio.GetSound(sounds); - var param = sounds.Params.WithLoop(true).WithVolume(5f).WithMaxDistance(20f); - sMcomponent.Stream = _audio.Play(sound, Filter.Pvs(uid), uid, false, param); - sMcomponent.SmSound = smSound; + var target = args.User; + supermatter.MatterPower += 200; + EntityManager.SpawnEntity("Ash", Transform(target).Coordinates); + _audio.Play(supermatter.DustSound, Filter.Pvs(uid), uid, false); + EntityManager.QueueDeleteEntity(target); } } } diff --git a/Resources/Prototypes/ATLAS/supermatter.yml b/Resources/Prototypes/ATLAS/supermatter.yml index 800bb08b52086f..0f1862331e1e73 100644 --- a/Resources/Prototypes/ATLAS/supermatter.yml +++ b/Resources/Prototypes/ATLAS/supermatter.yml @@ -38,6 +38,9 @@ - HighImpassable - BulletImpassable - InteractImpassable + - type: Transform + anchored: true + noRot: true - type: CollisionWake enabled: false - type: Clickable