public override void Unload() { spiritRNG = null; auroraEffect = null; noise = null; instance = null; SpiritGlowmask.Unload(); StructureLoader.Unload(); glitchEffect = null; glitchScreenShader = null; TrailManager = null; }
public override void Load() { //Always keep this call in the first line of Load! LoadReferences(); AdventurerQuests = new AdventurerQuestHandler(this); StructureLoader.Load(this); TrailManager = new TrailManager(this); On.Terraria.Main.DrawProjectiles += Main_DrawProjectiles; On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float += Projectile_NewProjectile; instance = this; if (Main.rand == null) { Main.rand = new Terraria.Utilities.UnifiedRandom(); } //Don't add any code before this point, // unless you know what you're doing. Items.Halloween.CandyBag.Initialize(); if (Main.netMode != NetmodeID.Server) { Ref <Effect> screenRef = new Ref <Effect>(GetEffect("Effects/ShockwaveEffect")); // The path to the compiled shader file. Filters.Scene["Shockwave"] = new Filter(new ScreenShaderData(screenRef, "Shockwave"), EffectPriority.VeryHigh); Filters.Scene["Shockwave"].Load(); } Filters.Scene["SpiritMod:ReachSky"] = new Filter(new ScreenShaderData("FilterBloodMoon").UseColor(0.05f, 0.05f, .05f).UseOpacity(0.7f), EffectPriority.High); Filters.Scene["SpiritMod:SpiritUG1"] = new Filter(new ScreenShaderData("FilterBloodMoon").UseColor(0.2f, 0.2f, .2f).UseOpacity(0.8f), EffectPriority.High); Filters.Scene["SpiritMod:SpiritUG2"] = new Filter(new ScreenShaderData("FilterBloodMoon").UseColor(0.45f, 0.45f, .45f).UseOpacity(0.9f), EffectPriority.High); Filters.Scene["SpiritMod:WindEffect"] = new Filter((new BlizzardShaderData("FilterBlizzardForeground")).UseColor(0.4f, 0.4f, 0.4f).UseSecondaryColor(0.2f, 0.2f, 0.2f).UseImage("Images/Misc/noise", 0, null).UseOpacity(0.249f).UseImageScale(new Vector2(3f, 0.75f), 0), EffectPriority.High); Filters.Scene["SpiritMod:WindEffect2"] = new Filter((new BlizzardShaderData("FilterBlizzardForeground")).UseColor(0.4f, 0.4f, 0.4f).UseSecondaryColor(0.2f, 0.2f, 0.2f).UseImage("Images/Misc/noise", 0, null).UseOpacity(0.549f).UseImageScale(new Vector2(3f, 0.75f), 0), EffectPriority.High); SpecialKey = RegisterHotKey("Armor Bonus", "Q"); GlyphCurrencyID = CustomCurrencyManager.RegisterCurrency(new Currency(ModContent.ItemType <Items.Glyphs.Glyph>(), 999L)); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Legs, "TalonGarb_Legs", "SpiritMod/Items/Armor/TalonGarb_Legs"); EmptyTexture = GetTexture("Empty"); auroraEffect = GetEffect("Effects/aurora"); noise = GetTexture("Textures/noise"); noise = GetTexture("Textures/BlueMoonTexture"); glitchEffect = GetEffect("Effects/glitch"); glitchScreenShader = new GlitchScreenShader(glitchEffect); Filters.Scene["SpiritMod:Glitch"] = new Filter(glitchScreenShader, EffectPriority.High); SkyManager.Instance["SpiritMod:AuroraSky"] = new AuroraSky(); Filters.Scene["SpiritMod:AuroraSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); Terraria.Graphics.Effects.Overlays.Scene["SpiritMod:AuroraSky"] = new AuroraOverlay(); Filters.Scene["SpiritMod:BlueMoonSky"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.1f, 0.2f, 0.5f).UseOpacity(0.53f), EffectPriority.High); SkyManager.Instance["SpiritMod:BlueMoonSky"] = new BlueMoonSky(); SkyManager.Instance["SpiritMod:MeteorSky"] = new MeteorSky(); SkyManager.Instance["SpiritMod:AsteroidSky2"] = new MeteorBiomeSky2(); Filters.Scene["SpiritMod:MeteorSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); Filters.Scene["SpiritMod:AsteroidSky2"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:SpiritBiomeSky"] = new SpiritBiomeSky(); Filters.Scene["SpiritMod:SpiritBiomeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:PurpleAlgaeSky"] = new PurpleAlgaeSky(); Filters.Scene["SpiritMod:PurpleAlgaeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:GreenAlgaeSky"] = new GreenAlgaeSky(); Filters.Scene["SpiritMod:GreenAlgaeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:BlueAlgaeSky"] = new BlueAlgaeSky(); Filters.Scene["SpiritMod:BlueAlgaeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:AshstormParticles"] = new AshstormSky(); Filters.Scene["SpiritMod:AshstormParticles"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); Terraria.Graphics.Effects.Overlays.Scene["SpiritMod:AshstormParticles"] = new AshstormOverlay(EffectPriority.VeryHigh); Filters.Scene["SpiritMod:Overseer"] = new Filter(new SeerScreenShaderData("FilterMiniTower").UseColor(0f, 0.3f, 1f).UseOpacity(0.75f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:Overseer"] = new SeerSky(); Filters.Scene["SpiritMod:Atlas"] = new Filter(new AtlasScreenShaderData("FilterMiniTower").UseColor(0.5f, 0.5f, 0.5f).UseOpacity(0.6f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:Atlas"] = new AtlasSky(); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Asteroids"), ItemType("AsteroidBox"), TileType("AsteroidBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Starplate"), ItemType("StarplateBox"), TileType("StarplateBox")); } }