public void DispatchStationEventMusic(EntityUid source, SoundSpecifier sound, StationEventMusicType type) { var audio = AudioParams.Default.WithVolume(-8); var soundFile = sound.GetSound(); var msg = new StationEventMusicEvent(soundFile, type, audio); var filter = GetStationAndPvs(source); RaiseNetworkEvent(msg, filter); }
private void PlaySound(EntityUid uid, SoundSpecifier sound, float varyPitch = 0f, NukeComponent?component = null) { if (!Resolve(uid, ref component)) { return; } SoundSystem.Play(Filter.Pvs(uid), sound.GetSound(), uid, AudioHelpers.WithVariation(varyPitch).WithVolume(-5f)); }
public void CopyFrom(ItemSlot other) { // These fields are mutable reference types. But they generally don't get modified, so this should be fine. Whitelist = other.Whitelist; InsertSound = other.InsertSound; EjectSound = other.EjectSound; SoundOptions = other.SoundOptions; Name = other.Name; Locked = other.Locked; InsertOnInteract = other.InsertOnInteract; EjectOnInteract = other.EjectOnInteract; EjectOnUse = other.EjectOnUse; InsertVerbText = other.InsertVerbText; EjectVerbText = other.EjectVerbText; WhitelistFailPopup = other.WhitelistFailPopup; Swap = other.Swap; Priority = other.Priority; }
public static void SpawnFoam(string entityPrototype, EntityCoordinates coords, Solution?contents, int amount, float duration, float spreadDelay, float removeDelay, SoundSpecifier sound, IEntityManager?entityManager = null) { entityManager ??= IoCManager.Resolve <IEntityManager>(); var ent = entityManager.SpawnEntity(entityPrototype, coords.SnapToGrid()); var areaEffectComponent = entityManager.GetComponentOrNull <FoamSolutionAreaEffectComponent>(ent); if (areaEffectComponent == null) { Logger.Error("Couldn't get AreaEffectComponent from " + entityPrototype); IoCManager.Resolve <IEntityManager>().QueueDeleteEntity(ent); return; } if (contents != null) { areaEffectComponent.TryAddSolution(contents); } areaEffectComponent.Start(amount, duration, spreadDelay, removeDelay); SoundSystem.Play(sound.GetSound(), Filter.Pvs(ent), ent, AudioHelpers.WithVariation(0.125f)); }
public PolymorphQueuedData(EntityUid ent, SoundSpecifier sound, string polymorph) { Ent = ent; Sound = sound; Polymorph = polymorph; }
private void PlaceAt(IMapGrid mapGrid, EntityCoordinates location, ushort tileId, SoundSpecifier placeSound, float offset = 0) { var variant = _random.Pick(((ContentTileDefinition)_tileDefinitionManager[tileId]).PlacementVariants); mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId, 0, variant)); SoundSystem.Play(placeSound.GetSound(), Filter.Pvs(location), location, AudioHelpers.WithVariation(0.125f, _random)); }