ГНОМЫ (#411)
* This adds the basic wirework for the gnomes, very unfinished * GNOMES ARE DONE EXCEPT FOR GLUE WOOO * removes gnome id, fixes ai and punch sounds, comments out the code for glue to take fuel * changed sounds to non meme versions * HAT NOW GIVES THE GNOME ACCENT TOO * fixes a typo with Unclippable being Unclipable * removed cuffable component (iforgotaboutit) * added unrevivable to gnomes so defibs wont try (it was immpossible anyways but this is better) * removes scrap code i put in the repair system * remove the carrot mutation code i made (its bad) clean up some things in the repairable system * changes accent system from rplacging g to replacing no * Fix the conflict (plz work) * adds another comment bleh bleh im trying to fix things * PAIN.jpeg * work plz? * FIX FOR REAL * camel case mayhaps? * adds unfinished glue use code (you can still see lit or not lit when held >:/ ) * temporary fix * add: GNOMES REVAMPED * fix: fix accent, sounds and add spawners * add: gnome seeds to seed vendor --------- Co-authored-by: BITTERLYNX <gagestemmerman@gmail.com>
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
using Robust.Shared.Audio;
|
||||
|
||||
namespace Content.Server._White.Other.DeathGasps;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class DeathGaspsComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public SoundSpecifier DeathSounds = new SoundCollectionSpecifier("deathSounds");
|
||||
|
||||
[DataField]
|
||||
public SoundSpecifier HeartSounds = new SoundCollectionSpecifier("heartSounds");
|
||||
|
||||
[DataField]
|
||||
public bool CanOtherHearDeathSound;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@ public sealed class OnDeath : EntitySystem
|
||||
}
|
||||
|
||||
private readonly Dictionary<EntityUid, EntityUid> _playingStreams = new();
|
||||
private static readonly SoundSpecifier DeathSounds = new SoundCollectionSpecifier("deathSounds");
|
||||
private static readonly SoundSpecifier HeartSounds = new SoundCollectionSpecifier("heartSounds");
|
||||
|
||||
|
||||
private void HandleDeathEvent(EntityUid uid, DeathGaspsComponent component, MobStateChangedEvent args)
|
||||
{
|
||||
@@ -31,23 +30,23 @@ public sealed class OnDeath : EntitySystem
|
||||
StopPlayingStream(uid);
|
||||
break;
|
||||
case MobState.Critical:
|
||||
PlayPlayingStream(uid);
|
||||
PlayPlayingStream(uid, component);
|
||||
break;
|
||||
case MobState.Dead:
|
||||
StopPlayingStream(uid);
|
||||
PlayDeathSound(uid);
|
||||
PlayDeathSound(uid, component);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayPlayingStream(EntityUid uid)
|
||||
private void PlayPlayingStream(EntityUid uid, DeathGaspsComponent component)
|
||||
{
|
||||
if (_playingStreams.TryGetValue(uid, out var currentStream))
|
||||
{
|
||||
_audio.Stop(currentStream);
|
||||
}
|
||||
|
||||
var newStream = _audio.PlayEntity(HeartSounds, uid, uid, AudioParams.Default.WithLoop(true));
|
||||
var newStream = _audio.PlayEntity(component.HeartSounds, uid, uid, AudioParams.Default.WithLoop(true));
|
||||
|
||||
if (newStream.HasValue)
|
||||
{
|
||||
@@ -64,9 +63,12 @@ public sealed class OnDeath : EntitySystem
|
||||
_playingStreams.Remove(uid);
|
||||
}
|
||||
|
||||
private void PlayDeathSound(EntityUid uid)
|
||||
private void PlayDeathSound(EntityUid uid, DeathGaspsComponent component)
|
||||
{
|
||||
_audio.PlayEntity(DeathSounds, uid, uid, AudioParams.Default);
|
||||
if (component.CanOtherHearDeathSound)
|
||||
_audio.PlayPvs(component.DeathSounds, uid, AudioParams.Default);
|
||||
else
|
||||
_audio.PlayEntity(component.DeathSounds, uid, uid, AudioParams.Default);
|
||||
}
|
||||
|
||||
private void OnDetach(EntityUid uid, DeathGaspsComponent component, PlayerDetachedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user