Esempio n. 1
0
        public static void Initialize()
        {
            var mod = ModContent.GetInstance <TerrariaAmbience>();

            // var loader = Instance;

            if (!Main.dedServ)
            {
                MorningCrickets         = !Directories.ExistsInSFXReplace("forest_morning") ? mod.GetSound(Directories.ForestMorning) : GetSoundFromPath(SFXReplacePath + "/forest_morning.wav");
                MorningCricketsInstance = MorningCrickets.CreateInstance();
                MorningCrickets.Name    = "Morning Crickets";
                DayCrickets             = !Directories.ExistsInSFXReplace("forest_day") ? mod.GetSound(Directories.ForestDay) : GetSoundFromPath(SFXReplacePath + "/forest_day.wav");
                DayCricketsInstance     = DayCrickets.CreateInstance();
                DayCrickets.Name        = "Daytime Crickets";
                EveningCrickets         = !Directories.ExistsInSFXReplace("forest_evening") ? mod.GetSound(Directories.ForestEvening) : GetSoundFromPath(SFXReplacePath + "/forest_evening.wav");
                EveningCricketsInstance = EveningCrickets.CreateInstance();
                EveningCrickets.Name    = "Evening Crickets";
                NightCrickets           = !Directories.ExistsInSFXReplace("forest_night") ? mod.GetSound(Directories.ForestNight) : GetSoundFromPath(SFXReplacePath + "/forest_night.wav");
                NightCricketsInstance   = NightCrickets.CreateInstance();
                NightCrickets.Name      = "Night Crickets";

                DesertAmbience         = !Directories.ExistsInSFXReplace("desert_crickets") ? mod.GetSound(Directories.Desert) : GetSoundFromPath(SFXReplacePath + "/desert_crickets.wav");
                DesertAmbienceInstance = DesertAmbience.CreateInstance();
                DesertAmbience.Name    = "Desert Animals";

                CampfireCrackle         = mod.GetSound(Directories.Campfire);
                CampfireCrackleInstance = CampfireCrackle.CreateInstance();
                CampfireCrackle.Name    = "Campfire Embers";

                CavesAmbience         = !Directories.ExistsInSFXReplace("ug_drip") ? mod.GetSound(Directories.CavernLayer) : GetSoundFromPath(SFXReplacePath + "/ug_drip.wav");
                CavesAmbienceInstance = CavesAmbience.CreateInstance();
                CavesAmbience.Name    = "Caves";

                SnowBreezeDay         = !Directories.ExistsInSFXReplace("snowfall_day") ? mod.GetSound(Directories.SnowDay) : GetSoundFromPath(SFXReplacePath + "/snowfall_day.wav");
                SnowBreezeDayInstance = SnowBreezeDay.CreateInstance();
                SnowBreezeDay.Name    = "Daytime Snowfall";

                SnowBreezeNight         = !Directories.ExistsInSFXReplace("snowfall_night") ? mod.GetSound(Directories.SnowNight) : GetSoundFromPath(SFXReplacePath + "/snowfall_night.wav");
                SnowBreezeNightInstance = SnowBreezeNight.CreateInstance();
                SnowBreezeNight.Name    = "Night Snowfall";

                CrimsonRumbles         = !Directories.ExistsInSFXReplace("crimson_rumbles") ? mod.GetSound(Directories.Crimson) : GetSoundFromPath(SFXReplacePath + "/crimson_rumbles.wav");
                CrimsonRumblesInstance = CrimsonRumbles.CreateInstance();
                CrimsonRumbles.Name    = "Crimson Rumbles";

                CorruptionRoars         = !Directories.ExistsInSFXReplace("corruption_roars") ? mod.GetSound(Directories.Corruption) : GetSoundFromPath(SFXReplacePath + "/corruption_roars.wav");
                CorruptionRoarsInstance = CorruptionRoars.CreateInstance();
                CorruptionRoars.Name    = "Corruption Roars";

                DayJungle             = !Directories.ExistsInSFXReplace("jungle_day") ? mod.GetSound(Directories.JungleDay) : GetSoundFromPath(SFXReplacePath + "/jungle_day.wav");
                DaytimeJungleInstance = DayJungle.CreateInstance();
                DayJungle.Name        = "Daytime Jungle";
                NightJungle           = !Directories.ExistsInSFXReplace("jungle_night") ? mod.GetSound(Directories.JungleNight) : GetSoundFromPath(SFXReplacePath + "/jungle_night.wav");
                NightJungleInstance   = NightJungle.CreateInstance();
                NightJungle.Name      = "Night Jungle";

                BeachWaves         = !Directories.ExistsInSFXReplace("beach_waves") ? mod.GetSound(Directories.Beach) : GetSoundFromPath(SFXReplacePath + "/beach_waves.wav");
                BeachWavesInstance = BeachWaves.CreateInstance();
                BeachWaves.Name    = "Beach Waves";

                HellRumble         = !Directories.ExistsInSFXReplace("hell_rumble") ? mod.GetSound(Directories.HellLayer) : GetSoundFromPath(SFXReplacePath + "/hell_rumble.wav");
                HellRumbleInstance = HellRumble.CreateInstance();
                HellRumble.Name    = "Hell Rumbling";

                Drip1         = mod.GetSound($"{AmbientPath}/environment/liquid/liquid_drip1");
                Drip2         = mod.GetSound($"{AmbientPath}/environment/liquid/liquid_drip2");
                Drip3         = mod.GetSound($"{AmbientPath}/environment/liquid/liquid_drip3");
                Drip1Instance = Drip1.CreateInstance();
                Drip2Instance = Drip2.CreateInstance();
                Drip3Instance = Drip3.CreateInstance();

                SplashNew         = mod.GetSound($"{AmbientPath}/environment/liquid/entity_splash_light");
                SplashNewInstance = SplashNew.CreateInstance();
                SplashNew.Name    = "Water Splash (Light)";

                LavaStream          = mod.GetSound($"{AmbientPath}/environment/liquid/stream_lava");
                WaterStream         = mod.GetSound($"{AmbientPath}/environment/liquid/stream_water");
                LavaStreamInstance  = LavaStream.CreateInstance();
                WaterStreamInstance = WaterStream.CreateInstance();

                Rain         = !Directories.ExistsInSFXReplace("rain_new") ? mod.GetSound(Directories.Rain) : GetSoundFromPath(SFXReplacePath + "/rain_new.wav");
                RainInstance = Rain.CreateInstance();
                Rain.Name    = "Rain Outside";

                Breeze         = mod.GetSound(Directories.Breeze);
                BreezeInstance = Breeze.CreateInstance();
                Breeze.Name    = "Wind Breeze";

                DayCricketsInstance.IsLooped     = true;
                EveningCricketsInstance.IsLooped = true;
                NightCricketsInstance.IsLooped   = true;
                CampfireCrackleInstance.IsLooped = true;
                DesertAmbienceInstance.IsLooped  = true;
                CavesAmbienceInstance.IsLooped   = true;
                SnowBreezeDayInstance.IsLooped   = true;
                SnowBreezeNightInstance.IsLooped = true;
                CrimsonRumblesInstance.IsLooped  = true;
                CorruptionRoarsInstance.IsLooped = true;
                DaytimeJungleInstance.IsLooped   = true;
                NightJungleInstance.IsLooped     = true;
                BeachWavesInstance.IsLooped      = true;
                HellRumbleInstance.IsLooped      = true;
                RainInstance.IsLooped            = true;
                LavaStreamInstance.IsLooped      = true;
                WaterStreamInstance.IsLooped     = true;
                MorningCricketsInstance.IsLooped = true;
                BreezeInstance.IsLooped          = true;
            }
        }