Beispiel #1
0
        internal void PlaySound(int type, int x = -1, int y = -1, int style = 1)
        {
            bool nearbyMuffler = WorldGen.InWorld(x, y) && MachineMufflerTile.AnyMufflersNearby(new Vector2(x, y));

            Main.PlaySound(type, x, y, style, volumeScale: nearbyMuffler ? 0.1f : 1f);
        }
Beispiel #2
0
        internal void PlaySound(int type, Vector2 position, int style = 1)
        {
            bool nearbyMuffler = WorldGen.InWorld((int)position.X >> 4, (int)position.Y >> 4) && MachineMufflerTile.AnyMufflersNearby(position);

            Main.PlaySound(type, (int)position.X, (int)position.Y, style, volumeScale: nearbyMuffler ? 0.1f : 1f);
        }
Beispiel #3
0
        internal void PlaySound(Terraria.Audio.LegacySoundStyle type, Vector2 position)
        {
            bool nearbyMuffler = WorldGen.InWorld((int)position.X >> 4, (int)position.Y >> 4) && MachineMufflerTile.AnyMufflersNearby(position);

            Main.PlaySound(type.SoundId, (int)position.X, (int)position.Y, type.Style, volumeScale: nearbyMuffler ? 0.1f : 1f);
        }
Beispiel #4
0
        internal SoundEffectInstance PlayCustomSound(Vector2 position, string path)
        {
            bool nearbyMuffler = WorldGen.InWorld((int)position.X >> 4, (int)position.Y >> 4) && MachineMufflerTile.AnyMufflersNearby(position);

            return(Main.PlaySound(SoundLoader.customSoundType, (int)position.X, (int)position.Y, TechMod.Instance.GetSoundSlot(SoundType.Custom, $"Sounds/Custom/{path}"), volumeScale: nearbyMuffler ? 0.1f : 1f));
        }