Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into BiomeBladeChanges
No files matched your search
@@ -5,6 +5,7 @@ using Terraria.Graphics.Effects;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Skies;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
@@ -80,7 +81,7 @@ namespace CalamityMod.Backgrounds
|
||||
var bgParallax = 0.4;
|
||||
var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
var bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceMiddle.Width * bgScale);
|
||||
var bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax);
|
||||
var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -91,7 +92,7 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralDesertSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralDesertSurfaceMiddle.Width, CalamityMod.AstralDesertSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +100,7 @@ namespace CalamityMod.Backgrounds
|
||||
bgParallax = 0.43;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceClose.Width * bgScale);
|
||||
bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -113,7 +114,7 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralDesertSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralDesertSurfaceClose.Width, CalamityMod.AstralDesertSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Value.Width, SkyTextureRefs.AstralDesertSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.GameContent.UI.States;
|
||||
using CalamityMod.Skies;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
@@ -82,7 +83,7 @@ namespace CalamityMod.Backgrounds
|
||||
var bgParallax = 0.4;
|
||||
var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
var bgWidthScaled = (int)((float)CalamityMod.AstralSnowSurfaceMiddle.Width * bgScale);
|
||||
var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax);
|
||||
var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -93,7 +94,7 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSnowSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSnowSurfaceMiddle.Width, CalamityMod.AstralSnowSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSnowSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +102,7 @@ namespace CalamityMod.Backgrounds
|
||||
bgParallax = 0.43;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.Width * bgScale);
|
||||
bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -115,15 +116,15 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceClose.Width, CalamityMod.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceCloseGlow.Width, CalamityMod.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
bgScale = 1.34f;
|
||||
bgParallax = 0.49;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.Width * bgScale);
|
||||
bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -137,8 +138,8 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFront.Width, CalamityMod.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFrontGlow.Width, CalamityMod.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Skies;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
@@ -86,7 +87,7 @@ namespace CalamityMod.Backgrounds
|
||||
var bgParallax = 0.4; //The parallax of the background layer
|
||||
var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; //the Y position of the background
|
||||
bgScale *= bgGlobalScaleMultiplier; //Scale of the background
|
||||
var bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceMiddle.Width * bgScale); //The Width of the bg texture scaled to the correct size
|
||||
var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceMiddle.Value.Width * bgScale); //The Width of the bg texture scaled to the correct size
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax);
|
||||
var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); //The starting position of the background layer
|
||||
if (Main.gameMenu)
|
||||
@@ -98,8 +99,8 @@ namespace CalamityMod.Backgrounds
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
//Draw the texture and its glowmask to each loop of the texture
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceMiddle.Width, CalamityMod.AstralSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceMiddleGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceMiddleGlow.Width, CalamityMod.AstralSurfaceMiddleGlow.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ namespace CalamityMod.Backgrounds
|
||||
bgParallax = 0.43;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.Width * bgScale);
|
||||
bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -123,8 +124,8 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceClose.Width, CalamityMod.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceCloseGlow.Width, CalamityMod.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +135,7 @@ namespace CalamityMod.Backgrounds
|
||||
bgParallax = 0.49;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.Width * bgScale);
|
||||
bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
@@ -148,8 +149,8 @@ namespace CalamityMod.Backgrounds
|
||||
{
|
||||
for (int i = 0; i < bgLoops; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFront.Width, CalamityMod.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFrontGlow.Width, CalamityMod.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,7 @@ using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Balancing
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public static class BalancingChangesManager
|
||||
public sealed class BalancingChangesManager : ModSystem
|
||||
{
|
||||
internal static List<IBalancingRule[]> UniversalBalancingChanges = null;
|
||||
internal static List<NPCBalancingChange> NPCSpecificBalancingChanges = null;
|
||||
@@ -36,7 +35,7 @@ namespace CalamityMod.Balancing
|
||||
// For ease of change, changes that are not exclusive to one specific weapon are not bundled into one line if they share the same resistance factor.
|
||||
// To give an example of this, Thanatos having a 50% resist to Chicken Cannon and Prismatic Breaker should be two distinct lines with a 0.5x factor instead of hamfisting them all
|
||||
// into one single resist that may have to be split later.
|
||||
internal static void Load()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// Dirty shorthand for true melee resists, because they're super common and other class resists aren't.
|
||||
IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance);
|
||||
@@ -522,7 +521,7 @@ namespace CalamityMod.Balancing
|
||||
#endregion
|
||||
}
|
||||
|
||||
internal static void Unload()
|
||||
public override void Unload()
|
||||
{
|
||||
UniversalBalancingChanges = null;
|
||||
NPCSpecificBalancingChanges = null;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CalamityMod.Buffs.Mounts
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
// Disables crouching with the Crouch, Crawl, and Roll Mod
|
||||
Mod crouchMod = CalamityMod.Instance.crouchMod;
|
||||
Mod crouchMod = ExternalMods.crouchMod;
|
||||
if (crouchMod != null)
|
||||
{
|
||||
// Mod Call inputs
|
||||
|
||||
@@ -1405,7 +1405,7 @@ namespace CalamityMod.CalPlayer
|
||||
boost.AddWithCondition("HasCraftedDraedonsForge", HasCraftedDraedonsForge);
|
||||
|
||||
// Calculate the new total time of all sessions at the instant of this player save.
|
||||
TimeSpan newSessionTotal = previousSessionTotal.Add(CalamityMod.SpeedrunTimer.Elapsed);
|
||||
TimeSpan newSessionTotal = previousSessionTotal.Add(SpeedrunTimerSystem.Elapsed);
|
||||
long totalTicks = newSessionTotal.Ticks;
|
||||
|
||||
// Save all cooldowns which are marked as persisting through save/load.
|
||||
@@ -4998,10 +4998,10 @@ namespace CalamityMod.CalPlayer
|
||||
// Enabling the config while a player is loaded will show the timer immediately.
|
||||
// But it won't start running until you save and quit and re-enter a world.
|
||||
if (CalamityClientConfig.Instance.SpeedrunTimer)
|
||||
CalamityMod.SpeedrunTimer.Restart();
|
||||
SpeedrunTimerSystem.Restart();
|
||||
|
||||
bool showWikiMessage = CalamityClientConfig.Instance.WikiStatusMessage;
|
||||
bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
|
||||
bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !ExternalMods.VCMMAvailable;
|
||||
bool showStartupMessages = showWikiMessage || showVCMMMessage;
|
||||
|
||||
// Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display
|
||||
|
||||
@@ -13,6 +13,7 @@ using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.ExtraTextures;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Ammo;
|
||||
@@ -787,8 +788,8 @@ namespace CalamityMod.CalPlayer
|
||||
// Update Carpet textures
|
||||
if (Main.netMode != NetmodeID.Server && Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Asset<Texture2D> carpetAuric = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AuricCarpet");
|
||||
Asset<Texture2D> carpetOriginal = CalamityMod.carpetOriginal;
|
||||
Asset<Texture2D> carpetAuric = ExtraTextureRefs.FlyingCarpetAuric;
|
||||
Asset<Texture2D> carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla;
|
||||
TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal);
|
||||
}
|
||||
|
||||
@@ -2866,7 +2867,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// 50% movement speed bonus so that you don't feel like a snail in the early game
|
||||
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
|
||||
if (CalamityMod.Instance.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
|
||||
if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
|
||||
Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost;
|
||||
|
||||
// Reduce how slow Chilled makes the player, because it's cancerous right now
|
||||
@@ -4319,7 +4320,7 @@ namespace CalamityMod.CalPlayer
|
||||
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2");
|
||||
}
|
||||
|
||||
if (CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
|
||||
if (CalamityClientConfig.Instance.VCMMStatusMessage && !ExternalMods.VCMMAvailable)
|
||||
{
|
||||
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.VCMMStatus");
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Core;
|
||||
|
||||
namespace CalamityMod.CalPlayer.Dashes
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public static class PlayerDashManager
|
||||
public sealed class PlayerDashManager : ModSystem
|
||||
{
|
||||
internal static Dictionary<string, PlayerDashEffect> DashIdentificationTable = new();
|
||||
|
||||
@@ -41,28 +41,20 @@ namespace CalamityMod.CalPlayer.Dashes
|
||||
|
||||
}
|
||||
|
||||
internal static void Load()
|
||||
public override void OnModLoad()
|
||||
{
|
||||
DashIdentificationTable = new();
|
||||
Type baseType = typeof(PlayerDashEffect);
|
||||
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
|
||||
foreach (Type type in types)
|
||||
ReflectionHelper.IterateCalamityTypes<PlayerDashEffect>(action: type =>
|
||||
{
|
||||
// Ignore any types which are not dash effects or are abstract.
|
||||
// This eliminates the PlayerDashEffect template type, which cannot have instances.
|
||||
if (!type.IsSubclassOf(baseType) || type.IsAbstract)
|
||||
continue;
|
||||
|
||||
// Use reflection to get the static ID manually. This shouldn't be a performance problem, as this only happens at load-time.
|
||||
string id = (string)type.GetProperty("ID").GetValue(null);
|
||||
|
||||
PlayerDashEffect dashEffect = (PlayerDashEffect)Activator.CreateInstance(type);
|
||||
DashIdentificationTable[id] = dashEffect;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
internal static void Unload()
|
||||
public override void Unload()
|
||||
{
|
||||
DashIdentificationTable = null;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/AuralisGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<AuroraBlazer>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<ChromaticEruption>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/ChromaticEruptionGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<CleansingBlaze>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<CosmicImmaterializer>())
|
||||
@@ -66,6 +68,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<GreatswordofJudgement>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/GreatswordofJudgementGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<LegionofCelestia>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Summon/LegionofCelestiaGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<NecroplasmicBeacon>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<Orderbringer>())
|
||||
@@ -80,6 +84,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/DraedonsArsenal/PulseRifleGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<SoulPiercer>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<StarburstShiv>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/StarburstShivGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<SubsumingVortex>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/SubsumingVortexSmallGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<TerrorBlade>())
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.UI.DraedonsArsenal;
|
||||
@@ -25,6 +26,24 @@ namespace CalamityMod
|
||||
ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit);
|
||||
}
|
||||
|
||||
internal static void SaveConfig()
|
||||
{
|
||||
// There is no current way to manually save a mod configuration file in tModLoader.
|
||||
// The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it.
|
||||
try
|
||||
{
|
||||
MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (saveMethodInfo is not null)
|
||||
saveMethodInfo.Invoke(null, [Instance]);
|
||||
else
|
||||
CalamityMod.Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
CalamityMod.Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error.");
|
||||
}
|
||||
}
|
||||
|
||||
#region Multi-Threading Settings
|
||||
[Header("Multithreading")]
|
||||
|
||||
|
||||
@@ -77,8 +77,7 @@ using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public class CalamityLists
|
||||
public sealed class CalamityLists : ModSystem
|
||||
{
|
||||
public static IList<string> donatorList;
|
||||
public static List<int> projectileDestroyExceptionList;
|
||||
@@ -158,7 +157,7 @@ namespace CalamityMod
|
||||
|
||||
public static List<int> VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic
|
||||
|
||||
public static void LoadLists()
|
||||
public override void OnModLoad()
|
||||
{
|
||||
donatorList = new List<string>()
|
||||
{
|
||||
@@ -390,7 +389,7 @@ namespace CalamityMod
|
||||
"Spider region",
|
||||
"WinterTire",
|
||||
"Nycro",
|
||||
"Bewearium",
|
||||
"Vyster", // previously "Bewearium"
|
||||
"William",
|
||||
"HellGoat2",
|
||||
"116taj",
|
||||
@@ -2203,7 +2202,8 @@ namespace CalamityMod
|
||||
ProjectileID.Bee,
|
||||
ProjectileID.GiantBee,
|
||||
ProjectileType<AeroExplosive>(),
|
||||
ProjectileID.ScarabBomb
|
||||
ProjectileID.ScarabBomb,
|
||||
ProjectileID.TNTBarrel
|
||||
};
|
||||
|
||||
ZeroContactDamageNPCList = new List<int>
|
||||
@@ -2713,7 +2713,7 @@ namespace CalamityMod
|
||||
};
|
||||
}
|
||||
|
||||
public static void UnloadLists()
|
||||
public override void Unload()
|
||||
{
|
||||
donatorList = null;
|
||||
projectileDestroyExceptionList = null;
|
||||
|
||||
@@ -1,72 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.CalPlayer.Dashes;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Effects;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.FluidSimulation;
|
||||
using CalamityMod.Graphics.Primitives;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Dyes.HairDye;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.NPCs.AquaticScourge;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.AstrumDeus;
|
||||
using CalamityMod.NPCs.BrimstoneElemental;
|
||||
using CalamityMod.NPCs.Bumblebirb;
|
||||
using CalamityMod.NPCs.CalClone;
|
||||
using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
using CalamityMod.NPCs.Cryogen;
|
||||
using CalamityMod.NPCs.DesertScourge;
|
||||
using CalamityMod.NPCs.DevourerofGods;
|
||||
using CalamityMod.NPCs.ExoMechs.Apollo;
|
||||
using CalamityMod.NPCs.ExoMechs.Ares;
|
||||
using CalamityMod.NPCs.ExoMechs.Artemis;
|
||||
using CalamityMod.NPCs.ExoMechs.Thanatos;
|
||||
using CalamityMod.NPCs.HiveMind;
|
||||
using CalamityMod.NPCs.Leviathan;
|
||||
using CalamityMod.NPCs.OldDuke;
|
||||
using CalamityMod.NPCs.Perforator;
|
||||
using CalamityMod.NPCs.PlaguebringerGoliath;
|
||||
using CalamityMod.NPCs.Polterghast;
|
||||
using CalamityMod.NPCs.PrimordialWyrm;
|
||||
using CalamityMod.NPCs.ProfanedGuardians;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.NPCs.Ravager;
|
||||
using CalamityMod.NPCs.Signus;
|
||||
using CalamityMod.NPCs.SlimeGod;
|
||||
using CalamityMod.NPCs.StormWeaver;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Schematics;
|
||||
using CalamityMod.Skies;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.UI.CalamitasEnchants;
|
||||
using CalamityMod.UI.DraedonsArsenal;
|
||||
using CalamityMod.UI.Rippers;
|
||||
using CalamityMod.Waters;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Dyes;
|
||||
using Terraria.GameContent.Liquid;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
|
||||
@@ -76,78 +18,6 @@ namespace CalamityMod
|
||||
{
|
||||
public class CalamityMod : Mod
|
||||
{
|
||||
// TODO -- A huge amount of random floating variables exist here.
|
||||
// These should all be moved to other files, whether that's CalamityLists or brand new ModSystems.
|
||||
// It is best to have a ton of small ModSystems.
|
||||
|
||||
// Boss Spawners
|
||||
public static int ghostKillCount = 0;
|
||||
public static int sharkKillCount = 0;
|
||||
|
||||
// Boss Head Icons
|
||||
public static int chadPrimeIcon;
|
||||
|
||||
public static Asset<Texture2D> carpetOriginal;
|
||||
|
||||
// Astral Sky/BG
|
||||
public static Texture2D AstralSky;
|
||||
public static Texture2D AstralSurfaceFront;
|
||||
public static Texture2D AstralSurfaceFrontGlow;
|
||||
public static Texture2D AstralSurfaceClose;
|
||||
public static Texture2D AstralSurfaceCloseGlow;
|
||||
public static Texture2D AstralSurfaceMiddle;
|
||||
public static Texture2D AstralSurfaceMiddleGlow;
|
||||
|
||||
// Astral Desert Sky/BG
|
||||
public static Texture2D AstralDesertSurfaceClose;
|
||||
public static Texture2D AstralDesertSurfaceMiddle;
|
||||
|
||||
// Astral Snow Sky/BG
|
||||
public static Texture2D AstralSnowSurfaceMiddle;
|
||||
|
||||
// Sulphur Sea Sky/BG
|
||||
public static Texture2D SulphurSeaSky;
|
||||
public static Texture2D SulphurSeaSkyFront;
|
||||
public static Texture2D SulphurSeaSurface;
|
||||
|
||||
// Destroyer glowmasks
|
||||
public static Asset<Texture2D>[] DestroyerGlowmasks = new Asset<Texture2D>[3];
|
||||
|
||||
// Probe glowmask
|
||||
public static Asset<Texture2D> ProbeGlowmask;
|
||||
|
||||
// Holds the Texture Arrays for all the lava textures.
|
||||
// These are used for the lava styles. They are seperate from Textureasset.Instance._liquidTexture as they will conflict with ModWaterStyle
|
||||
// Can hold up to 255 lava styles (more than enough) (excluding the normal lava texture which is liquidTexture 1)
|
||||
public struct LavaTextures
|
||||
{
|
||||
public static Asset<Texture2D>[] liquid = new Asset<Texture2D>[1];
|
||||
public static Asset<Texture2D>[] slope = new Asset<Texture2D>[1];
|
||||
public static Asset<Texture2D>[] block = new Asset<Texture2D>[1];
|
||||
public static Asset<Texture2D>[] fall = new Asset<Texture2D>[1];
|
||||
}
|
||||
|
||||
public static int LavaStyle;
|
||||
|
||||
public static float[] lavaAlpha = new float[1];
|
||||
|
||||
// Wall of Flesh glowmasks
|
||||
public static Asset<Texture2D> WallOfFleshEyeGlowmask;
|
||||
public static Asset<Texture2D> WallOfFleshDemonSickleTexture;
|
||||
|
||||
// Master Rev+ Skeletron Prime
|
||||
public static Asset<Texture2D> ChadPrime;
|
||||
public static Asset<Texture2D> ChadPrimeEyeGlowmask;
|
||||
|
||||
// DR data structure
|
||||
public static SortedDictionary<int, float> DRValues;
|
||||
|
||||
// Boss Kill Time data structure
|
||||
public static SortedDictionary<int, int> bossKillTimes;
|
||||
|
||||
// Speedrun timer
|
||||
internal static Stopwatch SpeedrunTimer = new Stopwatch();
|
||||
|
||||
#region External Flags
|
||||
// External flag to disable non-Revengeance boss AI edits
|
||||
// This can be edited by other mods using reflection to prevent compatibility issues
|
||||
@@ -160,369 +30,41 @@ namespace CalamityMod
|
||||
public static bool ExternalFlag_DisableDefenseDamage = false;
|
||||
#endregion
|
||||
|
||||
internal static CalamityMod Instance;
|
||||
|
||||
// TODO -- Mod references should be contained in a ModSystem (example name "ModLoadedChecker")
|
||||
|
||||
// This is Calamity's official music mod, CalamityModMusic. It is now a hard dependency.
|
||||
internal Mod musicMod = null;
|
||||
internal bool MusicAvailable => musicMod is not null;
|
||||
|
||||
// This is Vanilla Calamity Mod Music, internally named UnCalamityModMusic.
|
||||
// VCMM is an official music add-on. Unlike the main music mod, it is not a dependency.
|
||||
internal Mod vcmm = null;
|
||||
internal bool VCMMAvailable => vcmm is not null;
|
||||
|
||||
// Please keep this in alphabetical order so it's easy to read
|
||||
internal Mod ancientsAwakened = null;
|
||||
internal Mod biomeLava = null;
|
||||
internal Mod bossChecklist = null;
|
||||
internal Mod coloredDamageTypes = null;
|
||||
internal Mod crouchMod = null;
|
||||
internal Mod dialogueTweak = null;
|
||||
internal Mod fargos = null;
|
||||
internal Mod luminance = null;
|
||||
internal Mod magicStorage = null;
|
||||
internal Mod overhaul = null;
|
||||
internal Mod redemption = null;
|
||||
internal Mod soa = null;
|
||||
internal Mod subworldLibrary = null;
|
||||
internal Mod summonersAssociation = null;
|
||||
internal Mod thorium = null;
|
||||
internal Mod varia = null;
|
||||
internal Mod wikithis = null;
|
||||
|
||||
//hell background
|
||||
//private List<HellBGLoad> loadCache;
|
||||
internal static CalamityMod Instance => _Instance ??= ModContent.GetInstance<CalamityMod>();
|
||||
private static CalamityMod _Instance;
|
||||
|
||||
#region Load
|
||||
public override void Load()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
carpetOriginal = TextureAssets.FlyingCarpet;
|
||||
|
||||
// If any of these mods aren't loaded, it will simply keep them as null.
|
||||
musicMod = null;
|
||||
ModLoader.TryGetMod("CalamityModMusic", out musicMod);
|
||||
vcmm = null;
|
||||
ModLoader.TryGetMod("UnCalamityModMusic", out vcmm);
|
||||
|
||||
ancientsAwakened = null;
|
||||
ModLoader.TryGetMod("AAMod", out ancientsAwakened);
|
||||
biomeLava = null;
|
||||
ModLoader.TryGetMod("BiomeLava", out biomeLava);
|
||||
bossChecklist = null;
|
||||
ModLoader.TryGetMod("BossChecklist", out bossChecklist);
|
||||
coloredDamageTypes = null;
|
||||
ModLoader.TryGetMod("ColoredDamageTypes", out coloredDamageTypes);
|
||||
crouchMod = null;
|
||||
ModLoader.TryGetMod("CrouchMod", out crouchMod);
|
||||
dialogueTweak = null;
|
||||
ModLoader.TryGetMod("DialogueTweak", out dialogueTweak);
|
||||
fargos = null;
|
||||
ModLoader.TryGetMod("Fargowiltas", out fargos);
|
||||
luminance = null;
|
||||
ModLoader.TryGetMod("Luminance", out luminance);
|
||||
magicStorage = null;
|
||||
ModLoader.TryGetMod("MagicStorage", out magicStorage);
|
||||
overhaul = null;
|
||||
ModLoader.TryGetMod("TerrariaOverhaul", out overhaul);
|
||||
redemption = null;
|
||||
ModLoader.TryGetMod("Redemption", out redemption);
|
||||
soa = null;
|
||||
ModLoader.TryGetMod("SacredTools", out soa);
|
||||
subworldLibrary = null;
|
||||
ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary);
|
||||
summonersAssociation = null;
|
||||
ModLoader.TryGetMod("SummonersAssociation", out summonersAssociation);
|
||||
thorium = null;
|
||||
ModLoader.TryGetMod("ThoriumMod", out thorium);
|
||||
varia = null;
|
||||
ModLoader.TryGetMod("Varia", out varia);
|
||||
wikithis = null;
|
||||
ModLoader.TryGetMod("Wikithis", out wikithis);
|
||||
|
||||
// Initialize the EnemyStats struct as early as it is safe to do so
|
||||
NPCStats.Load();
|
||||
|
||||
// Initialize Calamity Lists so they may be used elsewhere immediately
|
||||
CalamityLists.LoadLists();
|
||||
|
||||
// Initialize Calamity Balance, since it is tightly coupled with the remaining lists
|
||||
// Initialize Calamity Balance, since it is tightly coupled with the remaining systems
|
||||
CalamityGlobalItem.LoadTweaks();
|
||||
CalamityGlobalProjectile.LoadTweaks();
|
||||
|
||||
// Mount balancing occurs during runtime and is undone when Calamity is unloaded.
|
||||
Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower;
|
||||
Mount.mounts[MountID.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower;
|
||||
|
||||
// Buff DCU's pickaxe power to equal PML pickaxe capabilities
|
||||
Mount.drillPickPower = 225;
|
||||
|
||||
// Make Graveyard biomes require more Gravestones
|
||||
SceneMetrics.GraveyardTileMax = 60;
|
||||
SceneMetrics.GraveyardTileMin = 40;
|
||||
SceneMetrics.GraveyardTileThreshold = 52;
|
||||
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
LoadClient();
|
||||
GeneralParticleHandler.Load();
|
||||
PrimitiveRenderer.Initialize();
|
||||
ForegroundDrawing.ForegroundManager.Load();
|
||||
|
||||
// Wikithis support
|
||||
WeakReferenceSupport.WikiThisSupport();
|
||||
// This must be done separately from immediate loading, as loading is now multithreaded.
|
||||
// However, render targets and certain other graphical objects can only be created on the main thread.
|
||||
Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets);
|
||||
}
|
||||
|
||||
CooldownRegistry.Load();
|
||||
BossRushEvent.Load();
|
||||
// TODO -- As ModBossBarStyle is a ModType, its Load function does not need to be called directly here.
|
||||
BossHealthBarManager.Load(this);
|
||||
EnchantmentManager.LoadAllEnchantments();
|
||||
VanillaArmorChangeManager.Load();
|
||||
SetupVanillaDR();
|
||||
SetupBossKillTimes();
|
||||
SchematicManager.Load();
|
||||
|
||||
//lava
|
||||
LavaRendering.instance = new LavaRendering();
|
||||
WeakReferenceSupport.LavaStytleToBiomeLava();
|
||||
|
||||
Attunement.Load();
|
||||
BalancingChangesManager.Load();
|
||||
BaseIdleHoldoutProjectile.LoadAll();
|
||||
PlayerDashManager.Load();
|
||||
}
|
||||
|
||||
private void LoadClient()
|
||||
{
|
||||
// Astral Sky/BG
|
||||
AstralSky = ModContent.Request<Texture2D>("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralSurfaceFront = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralSurfaceFrontGlow = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralSurfaceClose = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralSurfaceCloseGlow = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralSurfaceMiddle = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralSurfaceMiddleGlow = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
//Astral Desert Sky/BG
|
||||
AstralDesertSurfaceClose = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value;
|
||||
AstralDesertSurfaceMiddle = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
//Astral Snow Sky/BG
|
||||
AstralSnowSurfaceMiddle = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
// Sulpher Sea Sky/BG
|
||||
SulphurSeaSky = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value;
|
||||
SulphurSeaSkyFront = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value;
|
||||
SulphurSeaSurface = ModContent.Request<Texture2D>("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
// Destroyer glowmasks
|
||||
DestroyerGlowmasks[0] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad);
|
||||
DestroyerGlowmasks[1] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
|
||||
DestroyerGlowmasks[2] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// Lava Texture
|
||||
LavaTextures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1];
|
||||
LavaTextures.slope[0] = TextureAssets.LiquidSlope[1];
|
||||
LavaTextures.block[0] = TextureAssets.Liquid[1];
|
||||
var waterfallTexture = (Asset<Texture2D>[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager);
|
||||
LavaTextures.fall[0] = waterfallTexture[1];
|
||||
|
||||
// Probe glowmask
|
||||
ProbeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// Wall of Flesh glowmasks
|
||||
WallOfFleshEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad);
|
||||
WallOfFleshDemonSickleTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// Master Rev+ Skeletron Prime textures
|
||||
ChadPrime = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad);
|
||||
ChadPrimeEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// TODO -- Sky shaders should probably be loaded in a ModSystem
|
||||
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky();
|
||||
|
||||
Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:CalamitasRun3"] = new CalSky();
|
||||
|
||||
Filters.Scene["CalamityMod:PlaguebringerGoliath"] = new Filter(new PbGScreenShaderData("FilterMiniTower").UseColor(0.2f, 0.6f, 0.2f).UseOpacity(0.35f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:PlaguebringerGoliath"] = new PbGSky();
|
||||
|
||||
Filters.Scene["CalamityMod:Yharon"] = new Filter(new YScreenShaderData("FilterMiniTower").UseColor(1f, 0.4f, 0f).UseOpacity(0.75f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:Yharon"] = new YSky();
|
||||
|
||||
Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky();
|
||||
|
||||
Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(Color.Transparent).UseOpacity(0f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky();
|
||||
|
||||
Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:Signus"] = new SignusSky();
|
||||
|
||||
Filters.Scene["CalamityMod:BossRush"] = new Filter(new BossRushScreenShader("FilterMiniTower").UseOpacity(0.75f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:BossRush"] = new BossRushSky();
|
||||
|
||||
Filters.Scene["CalamityMod:ExoMechs"] = new Filter(new ExoMechsScreenShaderData("FilterMiniTower").UseColor(ExoMechsSky.DrawColor).UseOpacity(0.25f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:ExoMechs"] = new ExoMechsSky();
|
||||
|
||||
Filters.Scene["CalamityMod:MonolithAccursed"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:MonolithAccursed"] = new MonolithSky();
|
||||
|
||||
// Normal intensity is 4f
|
||||
Texture2D DistortionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/BlobbyNoise", AssetRequestMode.ImmediateLoad).Value;
|
||||
Filters.Scene["CalamityMod:DrunkCrabulon"] = new Filter(new DrunkCrabScreenShaderData("FilterHeatDistortion").UseImage(DistortionTexture, 0, null).UseIntensity(20f), EffectPriority.VeryHigh);
|
||||
|
||||
Filters.Scene["CalamityMod:BrimstoneCrag"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:BrimstoneCrag"] = new BrimstoneCragSky();
|
||||
|
||||
SkyManager.Instance["CalamityMod:Astral"] = new AstralSky();
|
||||
SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky();
|
||||
SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky();
|
||||
SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky();
|
||||
|
||||
CalamityShaders.LoadShaders();
|
||||
|
||||
// This must be done separately from immediate loading, as loading is now multithreaded.
|
||||
// However, render targets and certain other graphical objects can only be created on the main thread.
|
||||
Main.QueueMainThreadAction(() =>
|
||||
{
|
||||
Main.OnPreDraw += PrepareRenderTargets;
|
||||
});
|
||||
|
||||
RipperUI.Load();
|
||||
StealthUI.Load();
|
||||
ChargeMeterUI.Load();
|
||||
FlightBar.Load();
|
||||
|
||||
// TODO -- Is this not possible to place in ModNPC.Load or ModNPC.SetStaticDefaults ?
|
||||
// Centralizing head texture registration like this seems absurdly stiff
|
||||
Apollo.LoadHeadIcons();
|
||||
Artemis.LoadHeadIcons();
|
||||
Cryogen.LoadHeadIcons();
|
||||
DevourerofGodsHead.LoadHeadIcons();
|
||||
DevourerofGodsBody.LoadHeadIcons();
|
||||
DevourerofGodsTail.LoadHeadIcons();
|
||||
HiveMind.LoadHeadIcons();
|
||||
Polterghast.LoadHeadIcons();
|
||||
StormWeaverHead.LoadHeadIcons();
|
||||
SupremeCalamitas.LoadHeadIcons();
|
||||
ThanatosHead.LoadHeadIcons();
|
||||
ThanatosBody1.LoadHeadIcons();
|
||||
ThanatosBody2.LoadHeadIcons();
|
||||
ThanatosTail.LoadHeadIcons();
|
||||
|
||||
// All the head icon loading shit is done here, so I'm putting this here
|
||||
string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss";
|
||||
CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1);
|
||||
chadPrimeIcon = ModContent.GetModBossHeadSlot(chadPrimeIconPath);
|
||||
|
||||
// TODO -- Is this not possible to place in ModItem.Load or ModItem.SetStaticDefaults ?
|
||||
// Centralizing hair dye shaders like this seems absurdly stiff
|
||||
GameShaders.Hair.BindShader(ModContent.ItemType<AdrenalineHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax))));
|
||||
GameShaders.Hair.BindShader(ModContent.ItemType<RageHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(255, 83, 48), ((float)player.Calamity().rage / (float)player.Calamity().rageMax))));
|
||||
GameShaders.Hair.BindShader(ModContent.ItemType<WingTimeHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) =>
|
||||
{
|
||||
float flightTimeInterpolant = player.wingTime / player.wingTimeMax;
|
||||
if (player.mount.Active)
|
||||
flightTimeInterpolant = 1f;
|
||||
else if (float.IsInfinity(flightTimeInterpolant) || float.IsNaN(flightTimeInterpolant))
|
||||
flightTimeInterpolant = 0f;
|
||||
|
||||
return Color.Lerp(player.hairColor, new Color(139, 205, 255), flightTimeInterpolant);
|
||||
}));
|
||||
GameShaders.Hair.BindShader(ModContent.ItemType<StealthHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) =>
|
||||
{
|
||||
float stealthInterpolant = player.Calamity().rogueStealth / player.Calamity().rogueStealthMax;
|
||||
if (float.IsInfinity(stealthInterpolant) || float.IsNaN(stealthInterpolant))
|
||||
stealthInterpolant = 0f;
|
||||
|
||||
return Color.Lerp(player.hairColor, new Color(186, 85, 211), stealthInterpolant);
|
||||
}));
|
||||
|
||||
InvasionProgressUIManager.LoadGUIs();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Unload
|
||||
public override void Unload()
|
||||
{
|
||||
musicMod = null;
|
||||
vcmm = null;
|
||||
|
||||
ancientsAwakened = null;
|
||||
biomeLava = null;
|
||||
bossChecklist = null;
|
||||
coloredDamageTypes = null;
|
||||
crouchMod = null;
|
||||
dialogueTweak = null;
|
||||
fargos = null;
|
||||
luminance = null;
|
||||
magicStorage = null;
|
||||
overhaul = null;
|
||||
redemption = null;
|
||||
soa = null;
|
||||
subworldLibrary = null;
|
||||
summonersAssociation = null;
|
||||
thorium = null;
|
||||
varia = null;
|
||||
wikithis = null;
|
||||
|
||||
AstralSky = null;
|
||||
|
||||
DRValues?.Clear();
|
||||
DRValues = null;
|
||||
bossKillTimes?.Clear();
|
||||
bossKillTimes = null;
|
||||
|
||||
BalancingChangesManager.Unload();
|
||||
Attunement.Unload();
|
||||
EnchantmentManager.UnloadAllEnchantments();
|
||||
VanillaArmorChangeManager.Unload();
|
||||
CalamityLists.UnloadLists();
|
||||
NPCStats.Unload();
|
||||
CalamityGlobalItem.UnloadTweaks();
|
||||
CalamityGlobalProjectile.UnloadTweaks();
|
||||
|
||||
PopupGUIManager.UnloadGUIs();
|
||||
InvasionProgressUIManager.UnloadGUIs();
|
||||
BossRushEvent.Unload();
|
||||
SchematicManager.Unload();
|
||||
CooldownRegistry.Unload();
|
||||
PlayerDashManager.Unload();
|
||||
|
||||
Main.QueueMainThreadAction(() =>
|
||||
{
|
||||
Main.OnPreDraw -= PrepareRenderTargets;
|
||||
});
|
||||
|
||||
RipperUI.Unload();
|
||||
StealthUI.Unload();
|
||||
ChargeMeterUI.Unload();
|
||||
FlightBar.Unload();
|
||||
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
TextureAssets.FlyingCarpet = carpetOriginal;
|
||||
GeneralParticleHandler.Unload();
|
||||
}
|
||||
|
||||
Mount.mounts[MountID.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower;
|
||||
Mount.mounts[MountID.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower;
|
||||
|
||||
Mount.drillPickPower = 210;
|
||||
|
||||
SceneMetrics.GraveyardTileMax = 36;
|
||||
SceneMetrics.GraveyardTileMin = 16;
|
||||
SceneMetrics.GraveyardTileThreshold = 28;
|
||||
|
||||
carpetOriginal = null;
|
||||
|
||||
Instance = null;
|
||||
_Instance = null;
|
||||
base.Unload();
|
||||
}
|
||||
#endregion
|
||||
@@ -536,258 +78,18 @@ namespace CalamityMod
|
||||
}
|
||||
#endregion Render Target Management
|
||||
|
||||
#region Force ModConfig save (Reflection)
|
||||
internal static void SaveConfig(CalamityClientConfig cfg)
|
||||
{
|
||||
// There is no current way to manually save a mod configuration file in tModLoader.
|
||||
// The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it.
|
||||
try
|
||||
{
|
||||
MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (saveMethodInfo is not null)
|
||||
saveMethodInfo.Invoke(null, new object[] { cfg });
|
||||
else
|
||||
Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error.");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Vanilla Enemy DR
|
||||
private void SetupVanillaDR()
|
||||
{
|
||||
DRValues = new SortedDictionary<int, float> {
|
||||
{ NPCID.AngryBonesBig, 0.2f },
|
||||
{ NPCID.AngryBonesBigHelmet, 0.2f },
|
||||
{ NPCID.AngryBonesBigMuscle, 0.2f },
|
||||
{ NPCID.AnomuraFungus, 0.1f },
|
||||
{ NPCID.Antlion, 0.1f },
|
||||
{ NPCID.Arapaima, 0.1f },
|
||||
{ NPCID.ArmoredSkeleton, 0.15f },
|
||||
{ NPCID.ArmoredViking, 0.1f },
|
||||
{ NPCID.BigMimicCorruption, 0.3f },
|
||||
{ NPCID.BigMimicCrimson, 0.3f },
|
||||
{ NPCID.BigMimicHallow, 0.3f },
|
||||
{ NPCID.BigMimicJungle, 0.3f }, // unused vanilla enemy
|
||||
{ NPCID.BlueArmoredBones, 0.2f },
|
||||
{ NPCID.BlueArmoredBonesMace, 0.2f },
|
||||
{ NPCID.BlueArmoredBonesNoPants, 0.2f },
|
||||
{ NPCID.BlueArmoredBonesSword, 0.2f },
|
||||
{ NPCID.BoneLee, 0.2f },
|
||||
{ NPCID.Crab, 0.05f },
|
||||
{ NPCID.Crawdad, 0.2f },
|
||||
{ NPCID.Crawdad2, 0.2f },
|
||||
{ NPCID.CultistBoss, 0.15f },
|
||||
{ NPCID.Deerclops, 0.05f },
|
||||
{ NPCID.DD2Betsy, 0.1f },
|
||||
{ NPCID.DD2OgreT2, 0.1f },
|
||||
{ NPCID.DD2OgreT3, 0.15f },
|
||||
{ NPCID.DeadlySphere, 0.4f },
|
||||
{ NPCID.DiabolistRed, 0.2f },
|
||||
{ NPCID.DiabolistWhite, 0.2f },
|
||||
{ NPCID.DukeFishron, 0.15f },
|
||||
{ NPCID.DungeonGuardian, 0.9f },
|
||||
{ NPCID.DungeonSpirit, 0.2f },
|
||||
{ NPCID.ElfCopter, 0.15f },
|
||||
{ NPCID.Everscream, 0.1f },
|
||||
{ NPCID.FlyingAntlion, 0.05f },
|
||||
{ NPCID.GiantCursedSkull, 0.2f },
|
||||
{ NPCID.GiantShelly, 0.2f },
|
||||
{ NPCID.GiantShelly2, 0.2f },
|
||||
{ NPCID.GiantTortoise, 0.35f },
|
||||
{ NPCID.Golem, 0.25f },
|
||||
{ NPCID.GolemFistLeft, 0.25f },
|
||||
{ NPCID.GolemFistRight, 0.25f },
|
||||
{ NPCID.GolemHead, 0.25f },
|
||||
{ NPCID.GolemHeadFree, 0.25f },
|
||||
{ NPCID.GraniteFlyer, 0.1f },
|
||||
{ NPCID.GraniteGolem, 0.15f },
|
||||
{ NPCID.GreekSkeleton, 0.1f },
|
||||
{ NPCID.HellArmoredBones, 0.2f },
|
||||
{ NPCID.HellArmoredBonesMace, 0.2f },
|
||||
{ NPCID.HellArmoredBonesSpikeShield, 0.2f },
|
||||
{ NPCID.HellArmoredBonesSword, 0.2f },
|
||||
{ NPCID.IceGolem, 0.1f },
|
||||
{ NPCID.IceQueen, 0.1f },
|
||||
{ NPCID.IceTortoise, 0.35f },
|
||||
{ NPCID.HeadlessHorseman, 0.05f },
|
||||
{ NPCID.MartianDrone, 0.2f },
|
||||
{ NPCID.MartianSaucer, 0.2f },
|
||||
{ NPCID.MartianSaucerCannon, 0.2f },
|
||||
{ NPCID.MartianSaucerCore, 0.2f },
|
||||
{ NPCID.MartianSaucerTurret, 0.2f },
|
||||
{ NPCID.MartianTurret, 0.2f },
|
||||
{ NPCID.MartianWalker, 0.35f },
|
||||
{ NPCID.Mimic, 0.3f },
|
||||
{ NPCID.MoonLordCore, 0.15f },
|
||||
{ NPCID.MoonLordHand, 0.15f },
|
||||
{ NPCID.MoonLordHead, 0.15f },
|
||||
{ NPCID.Mothron, 0.2f },
|
||||
{ NPCID.MothronEgg, 0.5f },
|
||||
{ NPCID.MourningWood, 0.1f },
|
||||
{ NPCID.Necromancer, 0.2f },
|
||||
{ NPCID.NecromancerArmored, 0.2f },
|
||||
{ NPCID.Paladin, 0.45f },
|
||||
{ NPCID.PirateCaptain, 0.05f },
|
||||
{ NPCID.PirateShipCannon, 0.15f },
|
||||
{ NPCID.Plantera, 0.15f },
|
||||
{ NPCID.PlanterasTentacle, 0.1f },
|
||||
{ NPCID.HallowBoss, 0.15f },
|
||||
{ NPCID.PossessedArmor, 0.25f },
|
||||
{ NPCID.PresentMimic, 0.3f },
|
||||
{ NPCID.PrimeCannon, 0.2f },
|
||||
{ NPCID.PrimeLaser, 0.2f },
|
||||
{ NPCID.PrimeSaw, 0.2f },
|
||||
{ NPCID.PrimeVice, 0.2f },
|
||||
{ NPCID.Probe, 0.2f },
|
||||
{ NPCID.Pumpking, 0.1f },
|
||||
{ NPCID.QueenBee, 0.05f },
|
||||
{ NPCID.RaggedCaster, 0.2f },
|
||||
{ NPCID.RaggedCasterOpenCoat, 0.2f },
|
||||
{ NPCID.Retinazer, 0.2f },
|
||||
{ NPCID.RustyArmoredBonesAxe, 0.2f },
|
||||
{ NPCID.RustyArmoredBonesFlail, 0.2f },
|
||||
{ NPCID.RustyArmoredBonesSword, 0.2f },
|
||||
{ NPCID.RustyArmoredBonesSwordNoArmor, 0.2f },
|
||||
{ NPCID.SandElemental, 0.1f },
|
||||
{ NPCID.SantaNK1, 0.35f },
|
||||
{ NPCID.SeaSnail, 0.05f },
|
||||
{ NPCID.SkeletonArcher, 0.1f },
|
||||
{ NPCID.SkeletonCommando, 0.2f },
|
||||
{ NPCID.SkeletonSniper, 0.2f },
|
||||
{ NPCID.SkeletronHand, 0.05f },
|
||||
{ NPCID.SkeletronHead, 0.05f },
|
||||
{ NPCID.SkeletronPrime, 0.2f },
|
||||
{ NPCID.Spazmatism, 0.2f },
|
||||
{ NPCID.TacticalSkeleton, 0.2f },
|
||||
{ NPCID.TheDestroyer, 0.1f },
|
||||
{ NPCID.TheDestroyerBody, 0.2f },
|
||||
{ NPCID.TheDestroyerTail, 0.35f },
|
||||
{ NPCID.TheHungry, 0.1f },
|
||||
{ NPCID.UndeadViking, 0.1f },
|
||||
{ NPCID.WalkingAntlion, 0.1f },
|
||||
{ NPCID.WallofFlesh, 0.5f },
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Boss Kill Times
|
||||
private void SetupBossKillTimes()
|
||||
{
|
||||
// Kill times are measured exactly in frames.
|
||||
// 60 frames = 1 second
|
||||
// 3600 frames = 1 minute
|
||||
bossKillTimes = new SortedDictionary<int, int> {
|
||||
//
|
||||
// VANILLA BOSSES
|
||||
//
|
||||
{ NPCID.KingSlime, 5400 }, // 1:30 (90 seconds)
|
||||
{ NPCID.EyeofCthulhu, 5400 }, // 1:30 (90 seconds)
|
||||
{ NPCID.EaterofWorldsHead, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.EaterofWorldsBody, 7200 },
|
||||
{ NPCID.EaterofWorldsTail, 7200 },
|
||||
{ NPCID.BrainofCthulhu, 7200 }, // 2:00 (120 seconds, total length of fight including Creepers phase)
|
||||
{ NPCID.Creeper, 1800 }, // 0:30 (30 seconds, length of Creepers phase)
|
||||
{ NPCID.Deerclops, 5400 }, // 1:30 (90 seconds)
|
||||
{ NPCID.QueenBee, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.SkeletronHead, 9000 }, // 2:30 (150 seconds)
|
||||
{ NPCID.WallofFlesh, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.WallofFleshEye, 7200 },
|
||||
{ NPCID.QueenSlimeBoss, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.Spazmatism, 10800 }, // 3:00 (180 seconds)
|
||||
{ NPCID.Retinazer, 10800 },
|
||||
{ NPCID.TheDestroyer, 10800 }, // 3:00 (180 seconds)
|
||||
{ NPCID.TheDestroyerBody, 10800 },
|
||||
{ NPCID.TheDestroyerTail, 10800 },
|
||||
{ NPCID.SkeletronPrime, 10800 }, // 3:00 (180 seconds)
|
||||
{ NPCID.Plantera, 10800 }, // 3:00 (180 seconds)
|
||||
{ NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds)
|
||||
{ NPCID.Golem, 9000 }, // 2:30 (150 seconds)
|
||||
{ NPCID.GolemHead, 3600 }, // 1:00 (60 seconds)
|
||||
{ NPCID.DukeFishron, 9000 }, // 2:30 (150 seconds)
|
||||
{ NPCID.CultistBoss, 9000 }, // 2:30 (150 seconds)
|
||||
{ NPCID.MoonLordCore, 14400 }, // 4:00 (240 seconds)
|
||||
{ NPCID.MoonLordHand, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.MoonLordHead, 7200 }, // 2:00 (120 seconds)
|
||||
|
||||
//
|
||||
// CALAMITY BOSSES
|
||||
//
|
||||
{ ModContent.NPCType<DesertScourgeHead>(), 5400 }, // 1:30 (90 seconds)
|
||||
{ ModContent.NPCType<DesertScourgeBody>(), 5400 },
|
||||
{ ModContent.NPCType<DesertScourgeTail>(), 5400 },
|
||||
{ ModContent.NPCType<Crabulon>(), 5400 }, // 1:30 (90 seconds)
|
||||
{ ModContent.NPCType<HiveMind>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<PerforatorHive>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<SlimeGodCore>(), 9000 }, // 2:30 (150 seconds) -- total length of Slime God fight
|
||||
{ ModContent.NPCType<EbonianPaladin>(), 4500 }, // 1:15 (75 seconds)
|
||||
{ ModContent.NPCType<CrimulanPaladin>(), 4500 }, // 1:15 (75 seconds)
|
||||
{ ModContent.NPCType<SplitEbonianPaladin>(), 4500 }, // 1:15 (75 seconds) -- split slimes should spawn at 1:15 and die at around 2:30
|
||||
{ ModContent.NPCType<SplitCrimulanPaladin>(), 4500 }, // 1:15 (75 seconds)
|
||||
{ ModContent.NPCType<Cryogen>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<AquaticScourgeHead>(), 9000 }, // 2:30 (150 seconds)
|
||||
{ ModContent.NPCType<AquaticScourgeBody>(), 9000 },
|
||||
{ ModContent.NPCType<AquaticScourgeBodyAlt>(), 9000 },
|
||||
{ ModContent.NPCType<AquaticScourgeTail>(), 9000 },
|
||||
{ ModContent.NPCType<BrimstoneElemental>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<CalamitasClone>(), 14400 }, // 4:00 (240 seconds)
|
||||
{ ModContent.NPCType<Anahita>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<Leviathan>(), 10800 },
|
||||
{ ModContent.NPCType<AstrumAureus>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<AstrumDeusHead>(), 7200 }, // 2:00 (120 seconds) -- first phase is 1:00
|
||||
{ ModContent.NPCType<AstrumDeusBody>(), 7200 },
|
||||
{ ModContent.NPCType<AstrumDeusTail>(), 7200 },
|
||||
{ ModContent.NPCType<PlaguebringerGoliath>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<RavagerBody>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<ProfanedGuardianCommander>(), 5400 }, // 1:30 (90 seconds)
|
||||
{ ModContent.NPCType<Bumblefuck>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<Providence>(), 14400 }, // 4:00 (240 seconds)
|
||||
{ ModContent.NPCType<CeaselessVoid>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<DarkEnergy>(), 1200 }, // 0:20 (20 seconds)
|
||||
{ ModContent.NPCType<StormWeaverHead>(), 8100 }, // 2:15 (135 seconds)
|
||||
{ ModContent.NPCType<StormWeaverBody>(), 8100 },
|
||||
{ ModContent.NPCType<StormWeaverTail>(), 8100 },
|
||||
{ ModContent.NPCType<Signus>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<Polterghast>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<OldDuke>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<DevourerofGodsHead>(), 14400 }, // 4:00 (240 seconds)
|
||||
{ ModContent.NPCType<DevourerofGodsBody>(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30
|
||||
{ ModContent.NPCType<DevourerofGodsTail>(), 14400 },
|
||||
{ ModContent.NPCType<Yharon>(), 14700 }, // 4:05 (245 seconds) -- he spends 5 seconds invincible where you can't do anything
|
||||
{ ModContent.NPCType<Apollo>(), 21600 }, // 6:00 (360 seconds)
|
||||
{ ModContent.NPCType<Artemis>(), 21600 },
|
||||
{ ModContent.NPCType<AresBody>(), 21600 }, // 6:00 (360 seconds)
|
||||
{ ModContent.NPCType<AresGaussNuke>(), 21600 },
|
||||
{ ModContent.NPCType<AresLaserCannon>(), 21600 },
|
||||
{ ModContent.NPCType<AresPlasmaFlamethrower>(), 21600 },
|
||||
{ ModContent.NPCType<AresTeslaCannon>(), 21600 },
|
||||
{ ModContent.NPCType<ThanatosHead>(), 21600 }, // 6:00 (360 seconds)
|
||||
{ ModContent.NPCType<ThanatosBody1>(), 21600 },
|
||||
{ ModContent.NPCType<ThanatosBody2>(), 21600 },
|
||||
{ ModContent.NPCType<ThanatosTail>(), 21600 },
|
||||
{ ModContent.NPCType<SupremeCalamitas>(), 18000 }, // 5:00 (300 seconds)
|
||||
{ ModContent.NPCType<PrimordialWyrmHead>(), 18000 } // 5:00 (300 seconds)
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Music
|
||||
|
||||
// This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available.
|
||||
public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? MusicLoader.GetMusicSlot(musicMod, "Sounds/Music/" + songFilename) : null;
|
||||
public int? GetMusicFromMusicMod(string songFilename) => ExternalMods.MusicAvailable ? MusicLoader.GetMusicSlot(ExternalMods.musicMod, "Sounds/Music/" + songFilename) : null;
|
||||
|
||||
// This function returns an available VCMM track, or null if VCMM is not available.
|
||||
// Unlike the main Music Mod, VCMM is hierarchical.
|
||||
public int? GetMusicFromVCMM(string songPath) => VCMMAvailable ? MusicLoader.GetMusicSlot(vcmm, "Assets/" + songPath) : null;
|
||||
public int? GetMusicFromVCMM(string songPath) => ExternalMods.VCMMAvailable ? MusicLoader.GetMusicSlot(ExternalMods.vcmm, "Assets/" + songPath) : null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mod Support
|
||||
public override void PostSetupContent() => WeakReferenceSupport.Setup();
|
||||
|
||||
public override object Call(params object[] args) => ModCalls.Call(args);
|
||||
#endregion
|
||||
|
||||
@@ -822,16 +124,6 @@ namespace CalamityMod
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Stop Rain
|
||||
public static void StopRain()
|
||||
{
|
||||
if (!Main.raining)
|
||||
return;
|
||||
Main.raining = false;
|
||||
CalamityNetcode.SyncWorld();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Netcode
|
||||
public override void HandlePacket(BinaryReader reader, int whoAmI) => CalamityNetcode.HandlePacket(this, reader, whoAmI);
|
||||
#endregion
|
||||
|
||||
@@ -33,16 +33,12 @@ namespace CalamityMod
|
||||
{
|
||||
_PacketRegistry = new CalamityPacket[256]; // This should allow to use 0-255 range (full byte range)
|
||||
|
||||
var types = ModLoader.Mods.SelectMany(mod => AssemblyManager.GetLoadableTypes(mod.Code));
|
||||
foreach (var type in types)
|
||||
ReflectionHelper.IterateEveryModsTypes<CalamityPacket>(action: type =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (type.IsAbstract || !type.IsSubclassOf(typeof(CalamityPacket)))
|
||||
continue;
|
||||
|
||||
if (Activator.CreateInstance(type) is not CalamityPacket packetHandler)
|
||||
continue;
|
||||
return;
|
||||
|
||||
var msgType = packetHandler.MessageType;
|
||||
var existingHandler = _PacketRegistry[msgType];
|
||||
@@ -52,7 +48,7 @@ namespace CalamityMod
|
||||
$" [Failed On: '{type.FullName}'" +
|
||||
$" Current Owner: '{existingHandler.GetType().FullName}'," +
|
||||
$" msgTypeToRegister: '{msgType}']");
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
_PacketRegistry[packetHandler.MessageType] = packetHandler;
|
||||
@@ -81,9 +77,9 @@ namespace CalamityMod
|
||||
catch (Exception e)
|
||||
{
|
||||
CalamityMod.Instance.Logger.Error($"Exception was thrown while loading for Packets! {e}");
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override void OnModUnload()
|
||||
|
||||
@@ -7,7 +7,7 @@ using Terraria.ModLoader.Core;
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public class CooldownRegistry
|
||||
public sealed class CooldownRegistry : ModSystem
|
||||
{
|
||||
// Indexed by ushort netID. Contains every registered cooldown.
|
||||
// Cooldowns are given netIDs when they are registered.
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Cooldowns
|
||||
|
||||
private static Dictionary<string, ushort> nameToNetID = null;
|
||||
|
||||
public static void Load()
|
||||
public override void Load()
|
||||
{
|
||||
registry = new Cooldown[defaultSize];
|
||||
nameToNetID = new Dictionary<string, ushort>(defaultSize);
|
||||
@@ -60,7 +60,7 @@ namespace CalamityMod.Cooldowns
|
||||
#endregion
|
||||
}
|
||||
|
||||
public static void RegisterModCooldowns()
|
||||
public override void OnModLoad()
|
||||
{
|
||||
Type baseHandlerType = typeof(CooldownHandler);
|
||||
foreach (Mod mod in ModLoader.Mods)
|
||||
@@ -87,7 +87,7 @@ namespace CalamityMod.Cooldowns
|
||||
}
|
||||
}
|
||||
|
||||
public static void Unload()
|
||||
public override void Unload()
|
||||
{
|
||||
registry = null;
|
||||
nameToNetID?.Clear();
|
||||
|
||||
@@ -4,11 +4,13 @@ using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Effects
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public class CalamityShaders
|
||||
[Autoload(Side = ModSide.Client)]
|
||||
public sealed class CalamityShaders : ModSystem
|
||||
{
|
||||
private const string ShaderPath = "Effects/";
|
||||
internal const string CalamityShaderPrefix = "CalamityMod:";
|
||||
@@ -204,38 +206,8 @@ namespace CalamityMod.Effects
|
||||
internal static Effect TeslaTrailShader;
|
||||
#endregion
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
// All shaders registered this way are accessible under GameShaders.Misc
|
||||
// They will use the prefix described above
|
||||
private static void RegisterMiscShader(Effect shader, string passName, string registrationName)
|
||||
public override void PostSetupContent()
|
||||
{
|
||||
Ref<Effect> shaderPointer = new(shader);
|
||||
MiscShaderData passParamRegistration = new(shaderPointer, passName);
|
||||
GameShaders.Misc[$"{CalamityShaderPrefix}{registrationName}"] = passParamRegistration;
|
||||
}
|
||||
|
||||
private static void RegisterSceneFilter(ScreenShaderData passReg, string registrationName, EffectPriority priority = EffectPriority.High)
|
||||
{
|
||||
string prefixedRegistrationName = $"{CalamityShaderPrefix}{registrationName}";
|
||||
Filters.Scene[prefixedRegistrationName] = new Filter(passReg, priority);
|
||||
Filters.Scene[prefixedRegistrationName].Load();
|
||||
}
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
// All shaders registered this way are accessible under Filters.Scene
|
||||
// They will use the prefix described above
|
||||
private static void RegisterScreenShader(Effect shader, string passName, string registrationName, EffectPriority priority = EffectPriority.High)
|
||||
{
|
||||
Ref<Effect> shaderPointer = new(shader);
|
||||
ScreenShaderData passParamRegistration = new(shaderPointer, passName);
|
||||
RegisterSceneFilter(passParamRegistration, registrationName, priority);
|
||||
}
|
||||
|
||||
public static void LoadShaders()
|
||||
{
|
||||
if (Main.dedServ)
|
||||
return;
|
||||
|
||||
AssetRepository calAss = CalamityMod.Instance.Assets;
|
||||
|
||||
// Shorthand to load shaders immediately.
|
||||
@@ -437,5 +409,32 @@ namespace CalamityMod.Effects
|
||||
RegisterMiscShader(TeslaTrailShader, "TrailPass", "TeslaTrail");
|
||||
#endregion
|
||||
}
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
// All shaders registered this way are accessible under GameShaders.Misc
|
||||
// They will use the prefix described above
|
||||
private static void RegisterMiscShader(Effect shader, string passName, string registrationName)
|
||||
{
|
||||
Ref<Effect> shaderPointer = new(shader);
|
||||
MiscShaderData passParamRegistration = new(shaderPointer, passName);
|
||||
GameShaders.Misc[$"{CalamityShaderPrefix}{registrationName}"] = passParamRegistration;
|
||||
}
|
||||
|
||||
private static void RegisterSceneFilter(ScreenShaderData passReg, string registrationName, EffectPriority priority = EffectPriority.High)
|
||||
{
|
||||
string prefixedRegistrationName = $"{CalamityShaderPrefix}{registrationName}";
|
||||
Filters.Scene[prefixedRegistrationName] = new Filter(passReg, priority);
|
||||
Filters.Scene[prefixedRegistrationName].Load();
|
||||
}
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
// All shaders registered this way are accessible under Filters.Scene
|
||||
// They will use the prefix described above
|
||||
private static void RegisterScreenShader(Effect shader, string passName, string registrationName, EffectPriority priority = EffectPriority.High)
|
||||
{
|
||||
Ref<Effect> shaderPointer = new(shader);
|
||||
ScreenShaderData passParamRegistration = new(shaderPointer, passName);
|
||||
RegisterSceneFilter(passParamRegistration, registrationName, priority);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace CalamityMod.Events
|
||||
|
||||
public static Dictionary<int, AcidRainSpawnData> PossibleMinibossesPolter = new();
|
||||
|
||||
public static List<int> AllMinibosses => PossibleMinibossesAS.Select(miniboss => miniboss.Key).ToList().Concat(PossibleMinibossesPolter.Select(miniboss => miniboss.Key)).Distinct().ToList();
|
||||
public static List<int> AllMinibosses => PossibleMinibossesAS.Select(miniboss => miniboss.Key).Concat(PossibleMinibossesPolter.Select(miniboss => miniboss.Key)).Distinct().ToList();
|
||||
|
||||
public static bool AnyRainMinibosses
|
||||
{
|
||||
@@ -331,7 +331,7 @@ namespace CalamityMod.Events
|
||||
DownedBossSystem.downedAquaticScourgeAcidRain = DownedBossSystem.downedAquaticScourge;
|
||||
}
|
||||
HasTriedToSummonOldDuke = false;
|
||||
CalamityMod.StopRain();
|
||||
CalamityWorld.StopRain();
|
||||
}
|
||||
CalamityNetcode.SyncWorld();
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Skies;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.UI.DraedonSummoning;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -51,8 +52,7 @@ using ArtemisBoss = CalamityMod.NPCs.ExoMechs.Artemis.Artemis;
|
||||
|
||||
namespace CalamityMod.Events
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public class BossRushEvent
|
||||
public sealed class BossRushEvent : ModSystem
|
||||
{
|
||||
public enum TimeChangeContext
|
||||
{
|
||||
@@ -136,7 +136,7 @@ namespace CalamityMod.Events
|
||||
public static readonly SoundStyle VictorySound = new("CalamityMod/Sounds/Custom/BossRush/BossRushVictory");
|
||||
|
||||
#region Loading and Unloading
|
||||
public static void Load()
|
||||
public override void OnModLoad()
|
||||
{
|
||||
BossIDsAfterDeath = new Dictionary<int, int[]>();
|
||||
|
||||
@@ -455,7 +455,7 @@ namespace CalamityMod.Events
|
||||
};
|
||||
}
|
||||
|
||||
public static void Unload()
|
||||
public override void Unload()
|
||||
{
|
||||
Bosses = null;
|
||||
BossIDsAfterDeath = null;
|
||||
@@ -489,7 +489,7 @@ namespace CalamityMod.Events
|
||||
return -1;
|
||||
}
|
||||
int tier = CurrentTier;
|
||||
if (CalamityMod.Instance.MusicAvailable)
|
||||
if (ExternalMods.MusicAvailable)
|
||||
{
|
||||
// Boss Rush music for tier 5 doesn't exist
|
||||
if (tier > 4)
|
||||
@@ -590,7 +590,7 @@ namespace CalamityMod.Events
|
||||
|
||||
// Change time as necessary.
|
||||
if (Bosses[BossRushStage].ToChangeTimeTo != TimeChangeContext.None)
|
||||
CalamityUtils.ChangeTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day);
|
||||
CalamityWorld.ResetTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day);
|
||||
|
||||
// Play a special boss roar sound by default.
|
||||
if (!Bosses[BossRushStage].UsesSpecialSound)
|
||||
|
||||
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.ExtraTextures
|
||||
{
|
||||
[Autoload(Side = ModSide.Client)]
|
||||
internal sealed class ExtraTextureRefs : ModSystem
|
||||
{
|
||||
// Destroyer glowmasks
|
||||
public static Asset<Texture2D> DestroyerHeadGlowmask;
|
||||
public static Asset<Texture2D> DestroyerBodyGlowmask;
|
||||
public static Asset<Texture2D> DestroyerTailGlowmask;
|
||||
public static Asset<Texture2D> ProbeGlowmask;
|
||||
|
||||
// Master Rev+ Skeletron Prime
|
||||
public static Asset<Texture2D> ChadPrime;
|
||||
public static Asset<Texture2D> ChadPrimeEyeGlowmask;
|
||||
|
||||
// WoF, These are not "exactly" the ExtraTextures. But
|
||||
public static Asset<Texture2D> WallOfFleshEyeGlowmask;
|
||||
public static Asset<Texture2D> WallOfFleshDemonSickleTexture;
|
||||
|
||||
// Flying Carpet Replacements
|
||||
public static Asset<Texture2D> FlyingCarpetVanilla;
|
||||
public static Asset<Texture2D> FlyingCarpetAuric;
|
||||
|
||||
// Boss Heads
|
||||
// I know it's not exactly a Texture2D but it belongs to ExtraTextures.
|
||||
public static int BossHeadIndex_ChadPrime;
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss";
|
||||
BossHeadIndex_ChadPrime = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1);
|
||||
}
|
||||
|
||||
|
||||
// TODO: - Every other ExtraTextures Reference could be move in here
|
||||
public override void OnModLoad()
|
||||
{
|
||||
DestroyerHeadGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad);
|
||||
DestroyerBodyGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
|
||||
DestroyerTailGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
ProbeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
ChadPrime = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad);
|
||||
ChadPrimeEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
WallOfFleshEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad);
|
||||
WallOfFleshDemonSickleTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad);
|
||||
|
||||
FlyingCarpetVanilla = TextureAssets.FlyingCarpet;
|
||||
FlyingCarpetAuric = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AuricCarpet", AssetRequestMode.AsyncLoad);
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
TextureAssets.FlyingCarpet = FlyingCarpetVanilla;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Core;
|
||||
|
||||
namespace CalamityMod.ForegroundDrawing
|
||||
{
|
||||
interface IForegroundTile
|
||||
{
|
||||
void ForegroundDraw(int x, int y, SpriteBatch spriteBatch);
|
||||
}
|
||||
|
||||
public static class ForegroundManager
|
||||
{
|
||||
private static List<Point> _foregroundElements;
|
||||
private static int _foregroundElementCount;
|
||||
|
||||
internal static void Load()
|
||||
{
|
||||
_foregroundElements = new List<Point>(1000);
|
||||
_foregroundElementCount = 0;
|
||||
}
|
||||
|
||||
public static void AddForegroundDrawingPoint(int x, int y)
|
||||
{
|
||||
_foregroundElements.Add(new Point(x, y));
|
||||
_foregroundElementCount++;
|
||||
}
|
||||
|
||||
|
||||
public static void DrawTiles()
|
||||
{
|
||||
for (int i = 0; i < _foregroundElementCount; i++)
|
||||
{
|
||||
ushort type = Main.tile[_foregroundElements[i]].TileType;
|
||||
if (TileLoader.GetTile(type) is IForegroundTile fgTile)
|
||||
fgTile.ForegroundDraw(_foregroundElements[i].X, _foregroundElements[i].Y, Main.spriteBatch);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearTiles()
|
||||
{
|
||||
_foregroundElements.Clear();
|
||||
_foregroundElementCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Graphics.Primitives
|
||||
{
|
||||
@@ -19,7 +20,8 @@ namespace CalamityMod.Graphics.Primitives
|
||||
/// If you wish to use pixelation, you <b>MUST</b> make the NPC/Projectile inherit <see cref="IPixelatedPrimitiveRenderer"/> and use <see cref="IPixelatedPrimitiveRenderer.RenderPixelatedPrimitives"/> instead of predraw..<br/>
|
||||
/// You can also optionally specify a render layer with <see cref="IPixelatedPrimitiveRenderer.LayerToRenderTo"/>. It is <see cref="PixelationPrimitiveLayer.BeforeNPCs"/> by default.
|
||||
/// </summary>
|
||||
public static class PrimitiveRenderer
|
||||
[Autoload(Side = ModSide.Client)]
|
||||
public sealed class PrimitiveRenderer : ModSystem
|
||||
{
|
||||
#region Static Members
|
||||
private static DynamicVertexBuffer VertexBuffer;
|
||||
@@ -46,7 +48,7 @@ namespace CalamityMod.Graphics.Primitives
|
||||
|
||||
private static short IndicesIndex;
|
||||
|
||||
internal static void Initialize()
|
||||
public override void OnModLoad()
|
||||
{
|
||||
Main.QueueMainThreadAction(() =>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Mono.Cecil.Cil;
|
||||
using MonoMod.Cil;
|
||||
using Terraria;
|
||||
@@ -16,8 +15,8 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
private static bool AdjustShimmerRequirements(On_ShimmerTransforms.orig_IsItemTransformLocked orig, int type)
|
||||
{
|
||||
//Rod of Harmony / psc requires Draedong and SCal dead instead of Moon Lord.
|
||||
if (type == ItemID.RodofDiscord || type == ModContent.ItemType<ProfanedSoulCrystal>())
|
||||
//Rod of Harmony requires Draedong and SCal dead instead of Moon Lord.
|
||||
if (type == ItemID.RodofDiscord)
|
||||
{
|
||||
return !DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs;
|
||||
}
|
||||
@@ -464,6 +463,35 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Reduce Eater of Worlds Grenade Resist
|
||||
private static void ReduceEoWGrenadeResist(ILContext il)
|
||||
{
|
||||
// Reduce Expert+ Eater of Worlds' resist to explosives from 80% to 60%.
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
// Of course, this is 800 lines into Projectile.Damage, so we must do funky things.
|
||||
for (int f = 0; f < 2; f++)
|
||||
{
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(1002)))
|
||||
{
|
||||
LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchDiv()))
|
||||
{
|
||||
LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the division instruction, then pop the 5 off the stack to destroy it. Replace it with loading a 0.4 and then multiplying by it.
|
||||
cursor.Remove();
|
||||
cursor.EmitPop();
|
||||
cursor.EmitLdcR4(0.4f);
|
||||
cursor.EmitMul();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Terrarian Projectile Limitation for Extra Updates
|
||||
private static void LimitTerrarianProjectiles(ILContext il)
|
||||
{
|
||||
|
||||
@@ -40,11 +40,9 @@ namespace CalamityMod.ILEditing
|
||||
// Graphics
|
||||
IL_Main.DoDraw += AdditiveDrawing;
|
||||
IL_Main.DoDraw += DrawFloralParadiseFog;
|
||||
On_Main.DrawGore += DrawForegroundStuff;
|
||||
On_Main.DrawCursor += UseCoolFireCursorEffect;
|
||||
On_Main.SortDrawCacheWorms += DrawFusableParticles;
|
||||
On_Main.DrawInfernoRings += DrawForegroundParticles;
|
||||
On_TileDrawing.PreDrawTiles += ClearForegroundStuff;
|
||||
On_TileDrawing.Draw += ClearTilePings;
|
||||
On_CommonCode.ModifyItemDropFromNPC += ColorBlightedGel;
|
||||
|
||||
@@ -54,6 +52,11 @@ namespace CalamityMod.ILEditing
|
||||
On_Player.ApplyEquipVanity_Item += DyeableShadersRenderer.CheckVanityDetour;
|
||||
On_Player.UpdateArmorSets += DyeableShadersRenderer.CheckArmorSetsDetour;
|
||||
|
||||
// Graphics (ModPlant stuff)
|
||||
IL_TileDrawing.DrawSingleTile += DisableCullingForTreeAndCactus;
|
||||
IL_TileDrawing.DrawTrees += DrawTreeGlowMask;
|
||||
On_TileDrawing.DrawBasicTile += DrawTreeTrunkAndCactusGlowMask;
|
||||
|
||||
// NPC behavior
|
||||
IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning;
|
||||
On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate;
|
||||
@@ -91,7 +94,7 @@ namespace CalamityMod.ILEditing
|
||||
IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal;
|
||||
|
||||
//LavaStyles
|
||||
if (CalamityMod.Instance.biomeLava == null)
|
||||
if (ExternalMods.biomeLava == null)
|
||||
{
|
||||
//Rendering/Drawing
|
||||
IL_Main.DoDraw += DoDrawLavas;
|
||||
@@ -138,6 +141,7 @@ namespace CalamityMod.ILEditing
|
||||
// Damage and health balance
|
||||
On_Main.DamageVar_float_int_float += AdjustDamageVariance;
|
||||
IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling;
|
||||
IL_Projectile.Damage += ReduceEoWGrenadeResist;
|
||||
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
|
||||
IL_Player.UpdateBuffs += NerfSharpeningStation;
|
||||
IL_Player.UpdateBuffs += NerfBeetleScaleMail;
|
||||
@@ -178,6 +182,7 @@ namespace CalamityMod.ILEditing
|
||||
On_WorldGen.MakeDungeon += LimitDungeonEntranceXPosition;
|
||||
IL_WorldGen.DungeonHalls += LimitDungeonHallsXPosition;
|
||||
IL_WorldGen.MakeDungeon += ChangeDungeonSpikeQuantities;
|
||||
Terraria.GameContent.Biomes.On_JunglePass.GenerateFinishingTouches += AddStohne;
|
||||
|
||||
// Removal of vanilla stupidity
|
||||
IL_Player.UpdateBuffs += RemoveFeralBiteRandomDebuffs;
|
||||
|
||||
@@ -9,7 +9,6 @@ using CalamityMod.CalPlayer;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.FluidSimulation;
|
||||
using CalamityMod.ForegroundDrawing;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Items.Dyes;
|
||||
@@ -41,6 +40,7 @@ using Terraria.Chat;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Achievements;
|
||||
using Terraria.GameContent.Biomes;
|
||||
using Terraria.GameContent.Drawing;
|
||||
using Terraria.GameContent.Events;
|
||||
using Terraria.GameContent.Liquid;
|
||||
@@ -56,6 +56,7 @@ using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.UI.Gamepad;
|
||||
using Terraria.WorldBuilding;
|
||||
using static Terraria.WaterfallManager;
|
||||
|
||||
namespace CalamityMod.ILEditing
|
||||
@@ -886,7 +887,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLavas(isBackground: true);
|
||||
LavaRenderingSystem.Instance.DrawLavas(isBackground: true);
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdsfld<Main>("drawToScreen"), i => i.MatchBrfalse(out _), i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchCall<Main>("DrawWaters")))
|
||||
{
|
||||
@@ -894,7 +895,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLavas();
|
||||
LavaRenderingSystem.Instance.DrawLavas();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -907,7 +908,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLavas();
|
||||
LavaRenderingSystem.Instance.DrawLavas();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -920,7 +921,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLavas(isBackground: true);
|
||||
LavaRenderingSystem.Instance.DrawLavas(isBackground: true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -933,7 +934,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.alphaSave = CalamityMod.lavaAlpha.ToArray();
|
||||
LavaRenderingSystem.LavaAlpha.CopyTo(LavaRenderingSystem.AlphaSave, 0);
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(0), i => i.MatchStloc(34), i => i.MatchBr(out _), i => i.MatchLdloc(34), i => i.MatchLdcI4(1), i => i.MatchBeq(out _)))
|
||||
{
|
||||
@@ -944,7 +945,7 @@ namespace CalamityMod.ILEditing
|
||||
cursor.EmitDelegate((CaptureBiome biome) => {
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
CalamityMod.lavaAlpha[i] = ((i == CalamityMod.LavaStyle) ? 1f : 0f);
|
||||
LavaRenderingSystem.LavaAlpha[i] = ((i == LavaRenderingSystem.LavaStyle) ? 1f : 0f);
|
||||
}
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(1), i => i.MatchLdsfld<Main>("waterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
|
||||
@@ -953,7 +954,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLiquid(bg: true, CalamityMod.LavaStyle);
|
||||
LavaRenderingSystem.Instance.DrawLiquid(bg: true, LavaRenderingSystem.LavaStyle);
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(1), i => i.MatchLdsfld<Main>("bloodMoon"), i => i.MatchBrtrue(out _), i => i.MatchLdloc(8), i => i.MatchLdfld<CaptureBiome>("WaterStyle"), i => i.MatchBr(out _), i => i.MatchLdcI4(9), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
|
||||
{
|
||||
@@ -961,7 +962,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLiquid(bg: true, CalamityMod.LavaStyle);
|
||||
LavaRenderingSystem.Instance.DrawLiquid(bg: true, LavaRenderingSystem.LavaStyle);
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchLdsfld<Main>("waterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
|
||||
{
|
||||
@@ -969,7 +970,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLiquid(bg: false, CalamityMod.LavaStyle);
|
||||
LavaRenderingSystem.Instance.DrawLiquid(bg: false, LavaRenderingSystem.LavaStyle);
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchLdloc(8), i => i.MatchLdfld<CaptureBiome>("WaterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
|
||||
{
|
||||
@@ -977,7 +978,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
LavaRendering.instance.DrawLiquid(bg: false, CalamityMod.LavaStyle);
|
||||
LavaRenderingSystem.Instance.DrawLiquid(bg: false, LavaRenderingSystem.LavaStyle);
|
||||
});
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc2(), i => i.MatchStsfld<Main>("liquidAlpha")))
|
||||
{
|
||||
@@ -985,7 +986,7 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate(() => {
|
||||
CalamityMod.lavaAlpha = LavaRendering.alphaSave;
|
||||
LavaRenderingSystem.AlphaSave.CopyTo(LavaRenderingSystem.LavaAlpha, 0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1003,7 +1004,7 @@ namespace CalamityMod.ILEditing
|
||||
cursor.EmitLdloc(13);
|
||||
cursor.EmitLdloc(14);
|
||||
cursor.EmitDelegate((Vector2 unscaledPosition, Vector2 vector, int j, int i, Tile tile) => {
|
||||
LavaRendering.instance.DrawTile_LiquidBehindTile(solidLayer: false, inFrontOfPlayers: false, -1, unscaledPosition, vector, j, i, tile);
|
||||
LavaRenderingSystem.Instance.DrawTile_LiquidBehindTile(solidLayer: false, inFrontOfPlayers: false, -1, unscaledPosition, vector, j, i, tile);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
@@ -1026,7 +1027,7 @@ namespace CalamityMod.ILEditing
|
||||
cursor.EmitLdarg3();
|
||||
cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter)
|
||||
cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type"));
|
||||
cursor.EmitDelegate<Func<bool, int, int, bool>>((IsVisible, style, type) => IsVisible && ((type == 1 && style >= LavaRendering.instance.WaterStyleMaxCount + 1) || (type != 1 && style <= LavaRendering.instance.WaterStyleMaxCount)));
|
||||
cursor.EmitDelegate<Func<bool, int, int, bool>>((IsVisible, style, type) => IsVisible && ((type == 1 && style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1) || (type != 1 && style <= LavaRenderingSystem.Instance.WaterStyleMaxCount)));
|
||||
|
||||
//Lava alpha color, if the liquid drawn is lava, multiply num by the water alpha
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(2), i => i.MatchLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type")), i => i.MatchStloc(8)))
|
||||
@@ -1054,7 +1055,11 @@ namespace CalamityMod.ILEditing
|
||||
cursor.EmitLdarg3();
|
||||
cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter)
|
||||
cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type"));
|
||||
cursor.EmitDelegate<Func<Texture2D, int, int, Texture2D>>((initialTexture, style, type) => (style >= LavaRendering.instance.WaterStyleMaxCount + 1 && type == LiquidID.Lava) ? CalamityMod.LavaTextures.liquid[style - LavaRendering.instance.WaterStyleMaxCount - 1].Value : initialTexture);
|
||||
cursor.EmitDelegate<Func<Texture2D, int, int, Texture2D>>((initialTexture, style, type) =>
|
||||
(style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1 && type == LiquidID.Lava)
|
||||
? LavaRenderingSystem.Textures.liquid[style - LavaRenderingSystem.Instance.WaterStyleMaxCount - 1].Value
|
||||
: initialTexture
|
||||
);
|
||||
}
|
||||
|
||||
private void BlockLavaDrawingForSlopes(On_TileDrawing.orig_DrawTile_LiquidBehindTile orig, TileDrawing self, bool solidLayer, bool inFrontOfPlayers, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, Tile tileCache)
|
||||
@@ -1136,13 +1141,13 @@ namespace CalamityMod.ILEditing
|
||||
LogFailure("Ambient lava bubble replacer", "Could not locate the bubble newdust parameters");
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate<Func<int, int>>(type => LavaRendering.dustLava());
|
||||
cursor.EmitDelegate<Func<int, int>>(type => LavaRenderingSystem.dustLava());
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(16), i => i.MatchLdcI4(8), i => i.MatchLdcI4(35)))
|
||||
{
|
||||
LogFailure("Ambient lava bubble replacer", "Could not locate the surface bubble newdust parameters");
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate<Func<int, int>>(type2 => LavaRendering.dustLava());
|
||||
cursor.EmitDelegate<Func<int, int>>(type2 => LavaRenderingSystem.dustLava());
|
||||
}
|
||||
|
||||
private void LavaDropletReplacer(ILContext il)
|
||||
@@ -1153,7 +1158,7 @@ namespace CalamityMod.ILEditing
|
||||
LogFailure("Ambient lava droplet replacer", "Could not locate the lava droplet newgore parameters");
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate<Func<int, int>>(type => LavaRendering.goreLava());
|
||||
cursor.EmitDelegate<Func<int, int>>(type => LavaRenderingSystem.goreLava());
|
||||
}
|
||||
|
||||
private void SplashEntityLava(ILContext il)
|
||||
@@ -1164,13 +1169,13 @@ namespace CalamityMod.ILEditing
|
||||
LogFailure("Entity Lava Splashing (Item, Projectile, NPC, Player)", "Could not locate the first lava bubble splashing");
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate<Func<int, int>>(type => LavaRendering.dustLava());
|
||||
cursor.EmitDelegate<Func<int, int>>(type => LavaRenderingSystem.dustLava());
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld<Entity>("width"), i => i.MatchLdcI4(12), i => i.MatchAdd(), i => i.MatchLdcI4(24), i => i.MatchLdcI4(35)))
|
||||
{
|
||||
LogFailure("Entity Lava Splashing (Item, Projectile, NPC, Player)", "Could not locate the second lava bubble splashing");
|
||||
return;
|
||||
}
|
||||
cursor.EmitDelegate<Func<int, int>>(type2 => LavaRendering.dustLava());
|
||||
cursor.EmitDelegate<Func<int, int>>(type2 => LavaRenderingSystem.dustLava());
|
||||
}
|
||||
|
||||
private void PlayerDebuffEdit(ILContext il)
|
||||
@@ -1186,7 +1191,7 @@ namespace CalamityMod.ILEditing
|
||||
cursor.EmitLdloc(161);
|
||||
cursor.EmitDelegate((Player player, int onFiretime) =>
|
||||
{
|
||||
LavaStylesLoader.InflictDebuff(player, CalamityMod.LavaStyle, onFiretime);
|
||||
LavaStylesLoader.InflictDebuff(player, LavaRenderingSystem.LavaStyle, onFiretime);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
@@ -1194,7 +1199,7 @@ namespace CalamityMod.ILEditing
|
||||
#region Other
|
||||
private Color WaterfallGlowmaskEditor(On_WaterfallManager.orig_StylizeColor orig, float alpha, int maxSteps, int waterfallType, int y, int s, Tile tileCache, Color aColor)
|
||||
{
|
||||
if (CalamityMod.LavaStyle != 0 && !LavaStylesLoader.Get(CalamityMod.LavaStyle).LavafallGlowmask())
|
||||
if (LavaRenderingSystem.LavaStyle != 0 && !LavaStylesLoader.Get(LavaRenderingSystem.LavaStyle).LavafallGlowmask())
|
||||
{
|
||||
return aColor;
|
||||
}
|
||||
@@ -1207,7 +1212,7 @@ namespace CalamityMod.ILEditing
|
||||
private void LavaFallRedrawer(On_WaterfallManager.orig_Draw orig, WaterfallManager self, SpriteBatch spriteBatch)
|
||||
{
|
||||
orig.Invoke(self, spriteBatch);
|
||||
LavaRendering.instance.InitialDrawLavafall(self);
|
||||
LavaRenderingSystem.Instance.InitialDrawLavafall(self);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1244,32 +1249,32 @@ namespace CalamityMod.ILEditing
|
||||
lightColor.Y = Math.Max(lightColor.Y, G);
|
||||
lightColor.Z = Math.Max(lightColor.Z, B);
|
||||
}
|
||||
else if (tile.LiquidType == LiquidID.Lava && CalamityMod.Instance.biomeLava == null)
|
||||
else if (tile.LiquidType == LiquidID.Lava && ExternalMods.biomeLava == null)
|
||||
{
|
||||
Vector3 lavaLight = new Vector3(0.55f, 0.33f, 0.11f);
|
||||
|
||||
float R = CalamityMod.LavaStyle == 0 ? lavaLight.X : 0f;
|
||||
float G = CalamityMod.LavaStyle == 0 ? lavaLight.Y : 0f;
|
||||
float B = CalamityMod.LavaStyle == 0 ? lavaLight.Z : 0f;
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, CalamityMod.LavaStyle, ref R, ref G, ref B);
|
||||
float R = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.X : 0f;
|
||||
float G = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Y : 0f;
|
||||
float B = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Z : 0f;
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref R, ref G, ref B);
|
||||
|
||||
for (int styleIndex = 0; styleIndex < LavaStylesLoader.TotalCount; styleIndex++)
|
||||
{
|
||||
if (CalamityMod.lavaAlpha[styleIndex] > 0f && styleIndex != CalamityMod.LavaStyle)
|
||||
if (LavaRenderingSystem.LavaAlpha[styleIndex] > 0f && styleIndex != LavaRenderingSystem.LavaStyle)
|
||||
{
|
||||
float r = styleIndex == 0 ? lavaLight.X : 0f;
|
||||
float g = styleIndex == 0 ? lavaLight.Y : 0f;
|
||||
float b = styleIndex == 0 ? lavaLight.Z : 0f;
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, styleIndex, ref r, ref g, ref b);
|
||||
|
||||
float r2 = CalamityMod.LavaStyle == 0 ? lavaLight.X : 0f;
|
||||
float g2 = CalamityMod.LavaStyle == 0 ? lavaLight.Y : 0f;
|
||||
float b2 = CalamityMod.LavaStyle == 0 ? lavaLight.Z : 0f;
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, CalamityMod.LavaStyle, ref r2, ref g2, ref b2);
|
||||
float r2 = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.X : 0f;
|
||||
float g2 = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Y : 0f;
|
||||
float b2 = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Z : 0f;
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref r2, ref g2, ref b2);
|
||||
|
||||
R = float.Lerp(r, r2, CalamityMod.lavaAlpha[CalamityMod.LavaStyle]);
|
||||
G = float.Lerp(g, g2, CalamityMod.lavaAlpha[CalamityMod.LavaStyle]);
|
||||
B = float.Lerp(b, b2, CalamityMod.lavaAlpha[CalamityMod.LavaStyle]);
|
||||
R = float.Lerp(r, r2, LavaRenderingSystem.LavaAlpha[LavaRenderingSystem.LavaStyle]);
|
||||
G = float.Lerp(g, g2, LavaRenderingSystem.LavaAlpha[LavaRenderingSystem.LavaStyle]);
|
||||
B = float.Lerp(b, b2, LavaRenderingSystem.LavaAlpha[LavaRenderingSystem.LavaStyle]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1295,7 +1300,7 @@ namespace CalamityMod.ILEditing
|
||||
float r = 0.55f;
|
||||
float g = 0.33f;
|
||||
float b = 0.11f;
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, CalamityMod.LavaStyle, ref r, ref g, ref b);
|
||||
LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref r, ref g, ref b);
|
||||
if (!(r == 0 && g == 0 && b == 0))
|
||||
{
|
||||
float r8;
|
||||
@@ -1330,9 +1335,9 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
CalamityWaterLoader.DrawColorSetup(x, y, Main.waterStyle, ref initialColor);
|
||||
}
|
||||
else if (liquidType == LiquidID.Lava && CalamityMod.Instance.biomeLava == null)
|
||||
else if (liquidType == LiquidID.Lava && ExternalMods.biomeLava == null)
|
||||
{
|
||||
LavaStylesLoader.DrawColorSetup(x, y, CalamityMod.LavaStyle, ref initialColor);
|
||||
LavaStylesLoader.DrawColorSetup(x, y, LavaRenderingSystem.LavaStyle, ref initialColor);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1388,7 +1393,7 @@ namespace CalamityMod.ILEditing
|
||||
// Reason: Flag6 is "IsWater" flag, and since we don't modified that behaviour "yet" it will never be triggered here
|
||||
// Fix this when there will be new lava style with dynamic color changes
|
||||
else if (tileCache.LiquidType == LiquidID.Lava)
|
||||
LavaStylesLoader.DrawColorSetup(x, y, CalamityMod.LavaStyle, ref initialColor);
|
||||
LavaStylesLoader.DrawColorSetup(x, y, LavaRenderingSystem.LavaStyle, ref initialColor);
|
||||
});
|
||||
|
||||
// And now remaining TotalCount is now could pass to local variable
|
||||
@@ -1515,23 +1520,6 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Foreground tiles drawing
|
||||
private static void DrawForegroundStuff(Terraria.On_Main.orig_DrawGore orig, Main self)
|
||||
{
|
||||
orig(self);
|
||||
if (Main.PlayerLoaded && !Main.gameMenu)
|
||||
ForegroundManager.DrawTiles();
|
||||
}
|
||||
|
||||
private static void ClearForegroundStuff(On_TileDrawing.orig_PreDrawTiles orig, TileDrawing self, bool solidLayer, bool forRenderTargets, bool intoRenderTargets)
|
||||
{
|
||||
orig(self, solidLayer, forRenderTargets, intoRenderTargets);
|
||||
|
||||
if (!solidLayer && (intoRenderTargets || Lighting.UpdateEveryFrame))
|
||||
ForegroundManager.ClearTiles();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tile ping overlay
|
||||
private static void ClearTilePings(On_TileDrawing.orig_Draw orig, TileDrawing self, bool solidLayer, bool forRenderTargets, bool intoRenderTargets, int waterStyleOverride)
|
||||
{
|
||||
@@ -1847,8 +1835,8 @@ namespace CalamityMod.ILEditing
|
||||
return;
|
||||
|
||||
var glowMask = glowMaskTile.GlowMask;
|
||||
int xPos = drawData.tileFrameX + drawData.addFrX;
|
||||
int yPos = drawData.tileFrameY + drawData.addFrY;
|
||||
var xPos = drawData.tileFrameX + drawData.addFrX;
|
||||
var yPos = drawData.tileFrameY + drawData.addFrY;
|
||||
if (glowMask.HasContentInFramePos(xPos, yPos))
|
||||
{
|
||||
ref Tile tileCache = ref drawData.tileCache;
|
||||
@@ -1888,12 +1876,398 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 drawPos = new Vector2(tileX * 16, tileY * 16 + 2) - screenPosition + screenOffset;
|
||||
Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset;
|
||||
Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16);
|
||||
Main.spriteBatch.Draw(glowMask.Texture, drawPos, drawRect, drawColor, 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add Stohne to the Jungle
|
||||
public static void AddStohne(Terraria.GameContent.Biomes.On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY)
|
||||
{
|
||||
int anchorX = oldX;
|
||||
int anchorY = oldY;
|
||||
double worldScale = (double)Main.maxTilesX / 4200.0 * 1.5;
|
||||
// Generate mud
|
||||
for (int i = 0; (double)i <= 20.0 * worldScale; i++)
|
||||
{
|
||||
progress.Set((60.0 + (double)i / worldScale) * 0.01);
|
||||
anchorX += WorldGen.genRand.Next((int)(-5.0 * worldScale), (int)(6.0 * worldScale));
|
||||
anchorY += WorldGen.genRand.Next((int)(-5.0 * worldScale), (int)(6.0 * worldScale));
|
||||
WorldGen.TileRunner(anchorX, anchorY, WorldGen.genRand.Next(40, 100), WorldGen.genRand.Next(300, 500), TileID.Mud);
|
||||
}
|
||||
for (int j = 0; (double)j <= 10.0 * worldScale; j++)
|
||||
{
|
||||
progress.Set((80.0 + (double)j / worldScale * 2.0) * 0.01);
|
||||
anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale));
|
||||
anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale));
|
||||
while (anchorX < 1 || anchorX >= Main.maxTilesX - 1 || anchorY < 1 || anchorY >= Main.maxTilesY - 1 || Main.tile[anchorX, anchorY].TileType != TileID.Mud)
|
||||
{
|
||||
anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale));
|
||||
anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale));
|
||||
}
|
||||
for (int k = 0; (double)k < 8.0 * worldScale; k++)
|
||||
{
|
||||
anchorX += WorldGen.genRand.Next(-30, 31);
|
||||
anchorY += WorldGen.genRand.Next(-30, 31);
|
||||
int type = -1;
|
||||
if (WorldGen.genRand.NextBool(7))
|
||||
{
|
||||
type = -2;
|
||||
}
|
||||
WorldGen.TileRunner(anchorX, anchorY, WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(30, 70), type);
|
||||
}
|
||||
}
|
||||
int stoneType = ModContent.TileType<Stohne>();
|
||||
for (int l = 0; (double)l <= 300.0 * worldScale; l++)
|
||||
{
|
||||
anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale));
|
||||
anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale));
|
||||
while (anchorX < 1 || anchorX >= Main.maxTilesX - 1 || anchorY < 1 || anchorY >= Main.maxTilesY - 1 || Main.tile[anchorX, anchorY].TileType != 59)
|
||||
{
|
||||
anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale));
|
||||
anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale));
|
||||
}
|
||||
WorldGen.TileRunner(anchorX, anchorY, WorldGen.genRand.Next(4, 10), WorldGen.genRand.Next(5, 30), stoneType);
|
||||
// Generate Gems
|
||||
if (WorldGen.genRand.NextBool(4))
|
||||
{
|
||||
int gem = WorldGen.genRand.Next(63, 69);
|
||||
WorldGen.TileRunner(anchorX + WorldGen.genRand.Next(-1, 2), anchorY + WorldGen.genRand.Next(-1, 2), WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(4, 8), gem);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Hellscape for GlowMask ModPlants
|
||||
|
||||
#region Tree Trunk / Cactus GlowMask
|
||||
private static void DrawTreeTrunkAndCactusGlowMask(On_TileDrawing.orig_DrawBasicTile orig, TileDrawing self, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition)
|
||||
{
|
||||
orig(self, screenPosition, screenOffset, tileX, tileY, drawData, normalTileRect, normalTilePosition);
|
||||
|
||||
var type = drawData.typeCache;
|
||||
|
||||
#region GlowMask Cactus
|
||||
if (type == TileID.Cactus)
|
||||
{
|
||||
var frameX = drawData.tileFrameX;
|
||||
var frameY = drawData.tileFrameY;
|
||||
var xPos = drawData.tileFrameX + drawData.addFrX;
|
||||
var yPos = drawData.tileFrameY + drawData.addFrY;
|
||||
|
||||
WorldGen.GetCactusType(tileX, tileY, frameX, frameY, out var sandType);
|
||||
if (PlantLoader.Get<ModCactus>(TileID.Cactus, sandType) is GlowMaskCactus glowCacti)
|
||||
{
|
||||
Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset;
|
||||
Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16);
|
||||
|
||||
// Fruit Check
|
||||
var isFruit = drawData.tileFrameX == 204 || drawData.tileFrameY == 202;
|
||||
var textureToDraw = isFruit ? glowCacti.GetFruitGlowTexture() : glowCacti.GetGlowTexture();
|
||||
var texture = textureToDraw?.Value;
|
||||
if (texture is not null)
|
||||
Main.spriteBatch.Draw(texture, drawPos, drawRect, glowCacti.GetGlowColor(tileX, tileY), 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GlowMask Tree Trunk
|
||||
else if (type == TileID.Trees)
|
||||
{
|
||||
var xPos = drawData.tileFrameX + drawData.addFrX;
|
||||
var yPos = drawData.tileFrameY + drawData.addFrY;
|
||||
|
||||
WorldGen.GetTreeBottom(tileX, tileY, out var groundX, out var groundY);
|
||||
Tile tile = Main.tile[groundX, groundY];
|
||||
if (PlantLoader.Get<ModTree>(TileID.Trees, tile.TileType) is GlowMaskTree glowTree)
|
||||
{
|
||||
Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset;
|
||||
Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16);
|
||||
|
||||
var texture = glowTree.GetGlowTexture()?.Value;
|
||||
if (texture is not null)
|
||||
Main.spriteBatch.Draw(texture, drawPos, drawRect, glowTree.GetGlowColor(tileX, tileY), 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GlowMask Palm Tree Trunk
|
||||
else if (type == TileID.PalmTree)
|
||||
{
|
||||
var xPos = drawData.tileFrameX + drawData.addFrX;
|
||||
var yPos = drawData.tileFrameY + drawData.addFrY;
|
||||
|
||||
WorldGen.GetTreeBottom(tileX, tileY, out var groundX, out var groundY);
|
||||
Tile tile = Main.tile[groundX, groundY];
|
||||
if (PlantLoader.Get<ModPalmTree>(TileID.PalmTree, tile.TileType) is GlowMaskPalmTree glowTree)
|
||||
{
|
||||
Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16);
|
||||
|
||||
var texture = glowTree.GetGlowTexture()?.Value;
|
||||
if (texture is not null)
|
||||
Main.spriteBatch.Draw(texture, normalTilePosition, drawRect, glowTree.GetGlowColor(tileX, tileY), 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Disable Tree/Cactus Culling
|
||||
private static void DisableCullingForTreeAndCactus(ILContext il)
|
||||
{
|
||||
// Justification:
|
||||
// Culling for Tree/Cactus should be disabled to simplify the GlowMask rendering on Plants
|
||||
// Without this We would need to setup more ilchanges to properly gather draw position
|
||||
// Furthermore we might need to clone the whole vanilla code for tree rendering
|
||||
//
|
||||
// And disable culling for pitch black tree/cactus would not affect the performance that much as it's really niche case
|
||||
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
int visibleFlagIndex = 0;
|
||||
if (!cursor.TryGotoNext(MoveType.Before,
|
||||
[
|
||||
x => x.MatchLdloc(out visibleFlagIndex),
|
||||
x => x.MatchLdarg(out _),
|
||||
x => x.MatchLdfld(out _),
|
||||
x => x.MatchCallOrCallvirt<TileDrawing>("IsVisible")
|
||||
]))
|
||||
{
|
||||
LogFailure("Disable Tree And Cactus Culling", "Unable to Locate IsVisible Call");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.TryGotoPrev(MoveType.Before, x => x.MatchBrfalse(out _)))
|
||||
{
|
||||
LogFailure("Disable Tree And Cactus Culling", "Unable to Locate Brfalse.s");
|
||||
return;
|
||||
}
|
||||
|
||||
cursor.EmitLdarg1(); // TileDrawInfo drawInfo
|
||||
cursor.EmitDelegate((TileDrawInfo drawInfo) =>
|
||||
{
|
||||
var type = drawInfo.typeCache;
|
||||
return type == TileID.Cactus || type == TileID.Trees || type == TileID.PalmTree;
|
||||
});
|
||||
cursor.EmitLdloc(visibleFlagIndex);
|
||||
cursor.EmitOr(); // visible || isTree || isCactus || isPalmTree
|
||||
cursor.EmitStloc(visibleFlagIndex);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tree Parts GlowMask
|
||||
private static void DrawTreeGlowMask(ILContext il)
|
||||
{
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
if (!cursor.TryGotoNext(MoveType.After, x => x.MatchLdfld<Point>("X")))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", "Unable to Locate Ldfld for Point::X");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.Next.MatchStloc(out var xLocaIdx))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", "Unable to Locate Stloc Index for Point::X");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.TryGotoNext(MoveType.After, x => x.MatchLdfld<Point>("Y")))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", "Unable to Locate Ldfld for Point::Y");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.Next.MatchStloc(out var yLocaIdx))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", "Unable to Locate Stloc Index for Point::Y");
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyTreeGlowMaskSubParts<GlowMaskTree>(cursor, "GlowMaskTree-Top", "GetTreeTopTexture", xLocaIdx, yLocaIdx,
|
||||
(glowMaskTree, tileX, tileY) =>
|
||||
{
|
||||
return new GlowMaskPlantDrawInfo()
|
||||
{
|
||||
Texture = glowMaskTree.GetTopGlowTextures().Value,
|
||||
Color = glowMaskTree.GetGlowColor(tileX, tileY)
|
||||
};
|
||||
});
|
||||
|
||||
ApplyTreeGlowMaskSubParts<GlowMaskTree>(cursor, "GlowMaskTree-R", "GetTreeBranchTexture", xLocaIdx, yLocaIdx,
|
||||
(glowMaskTree, tileX, tileY) =>
|
||||
{
|
||||
return new GlowMaskPlantDrawInfo()
|
||||
{
|
||||
Texture = glowMaskTree.GetBranchGlowTextures().Value,
|
||||
Color = glowMaskTree.GetGlowColor(tileX, tileY)
|
||||
};
|
||||
});
|
||||
|
||||
ApplyTreeGlowMaskSubParts<GlowMaskTree>(cursor, "GlowMaskTree-L", "GetTreeBranchTexture", xLocaIdx, yLocaIdx,
|
||||
(glowMaskTree, tileX, tileY) =>
|
||||
{
|
||||
return new GlowMaskPlantDrawInfo()
|
||||
{
|
||||
Texture = glowMaskTree.GetBranchGlowTextures().Value,
|
||||
Color = glowMaskTree.GetGlowColor(tileX, tileY)
|
||||
};
|
||||
});
|
||||
|
||||
ApplyPalmTreeGlowMaskSubParts<GlowMaskPalmTree>(cursor, "GlowMaskPalmTree-Top", "GetTreeTopTexture", xLocaIdx, yLocaIdx,
|
||||
(glowMaskPalmTree, tileX, tileY) =>
|
||||
{
|
||||
return new GlowMaskPlantDrawInfo()
|
||||
{
|
||||
Texture = WorldGen.IsPalmOasisTree(tileX) ?
|
||||
glowMaskPalmTree.GetOasisTopGlowTextures().Value :
|
||||
glowMaskPalmTree.GetTopGlowTextures().Value,
|
||||
|
||||
Color = glowMaskPalmTree.GetGlowColor(tileX, tileY)
|
||||
};
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GlowMask Patch Tree Sub Parts
|
||||
private static void ApplyTreeGlowMaskSubParts<PlantType>(
|
||||
ILCursor cursor,
|
||||
string debugSubpartName,
|
||||
string getTextureMethodName,
|
||||
int xLocaIdx,
|
||||
int yLocaIdx,
|
||||
Func<PlantType, int, int, GlowMaskPlantDrawInfo?> onPlantDrawn) where PlantType : IPlant
|
||||
{
|
||||
if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt<TileDrawing>(getTextureMethodName)))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", $"Could not locate First {getTextureMethodName} call ({debugSubpartName})");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.TryGotoPrev([x => x.MatchLdcI4(out var styleEq) && styleEq == 14, x => x.MatchBneUn(out _)]))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", $"Could not locate Bne.Un for TreeStyleIndex ({debugSubpartName})");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.Prev.MatchLdloc(out var treeStyleLocaIdx))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", $"Prev Instruction is not a LdLoc. Cannot locate TreeStyleIndex ({debugSubpartName})");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt<SpriteBatch>("Draw")))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", $"Could not locate DrawCall ({debugSubpartName})");
|
||||
return;
|
||||
}
|
||||
|
||||
cursor.EmitLdloc(treeStyleLocaIdx); // TreeStyle
|
||||
cursor.EmitLdloc(xLocaIdx);
|
||||
cursor.EmitLdloc(yLocaIdx);
|
||||
cursor.EmitDelegate((
|
||||
SpriteBatch spriteBatch,
|
||||
Texture2D texture,
|
||||
Vector2 position,
|
||||
Rectangle? sourceRectangle,
|
||||
Color color,
|
||||
float rotation,
|
||||
Vector2 origin,
|
||||
float scale,
|
||||
SpriteEffects effects,
|
||||
float layerDepth,
|
||||
|
||||
int style,
|
||||
int tileX,
|
||||
int tileY) =>
|
||||
{
|
||||
spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth);
|
||||
|
||||
// Spooky Hardcoded Index: style above 100 is modded tile
|
||||
if (style < 100)
|
||||
return;
|
||||
|
||||
int lookup = style - 100;
|
||||
if (PlantLoader.Get<ModTree>(TileID.Trees, lookup) is not PlantType plant)
|
||||
return;
|
||||
|
||||
GlowMaskPlantDrawInfo? drawInfo = onPlantDrawn?.Invoke(plant, tileX, tileY) ?? default;
|
||||
if (drawInfo.HasValue)
|
||||
{
|
||||
var info = drawInfo.Value;
|
||||
spriteBatch.Draw(info.Texture, position, sourceRectangle, info.Color, rotation, origin, scale, effects, layerDepth);
|
||||
}
|
||||
});
|
||||
cursor.Next.OpCode = OpCodes.Nop; // remove next drawcall
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GlowMask Patch Palm Tree Sub Parts
|
||||
private static void ApplyPalmTreeGlowMaskSubParts<PlantType>(
|
||||
ILCursor cursor,
|
||||
string debugSubpartName,
|
||||
string getTextureMethodName,
|
||||
int xLocaIdx,
|
||||
int yLocaIdx,
|
||||
Func<PlantType, int, int, GlowMaskPlantDrawInfo?> onPlantDrawn)
|
||||
{
|
||||
if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt<TileDrawing>(getTextureMethodName)))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", $"Could not locate First {getTextureMethodName} call ({debugSubpartName})");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt<SpriteBatch>("Draw")))
|
||||
{
|
||||
LogFailure("GlowMask Tree Rendering", $"Could not locate DrawCall ({debugSubpartName})");
|
||||
return;
|
||||
}
|
||||
|
||||
cursor.EmitLdloc(xLocaIdx);
|
||||
cursor.EmitLdloc(yLocaIdx);
|
||||
cursor.EmitDelegate((
|
||||
SpriteBatch spriteBatch,
|
||||
Texture2D texture,
|
||||
Vector2 position,
|
||||
Rectangle? sourceRectangle,
|
||||
Color color,
|
||||
float rotation,
|
||||
Vector2 origin,
|
||||
float scale,
|
||||
SpriteEffects effects,
|
||||
float layerDepth,
|
||||
|
||||
int tileX,
|
||||
int tileY) =>
|
||||
{
|
||||
spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth);
|
||||
|
||||
// TODO: This can be replace to read style and biome index from ilcode
|
||||
// ... When we can figure out how to extract info from them
|
||||
// Check TileDrawing.DrawTrees for context
|
||||
WorldGen.GetTreeBottom(tileX, tileY, out var sandX, out var sandY);
|
||||
var sandType = Main.tile[sandX, sandY].TileType;
|
||||
|
||||
if (PlantLoader.Get<ModPalmTree>(TileID.PalmTree, sandType) is not PlantType plant)
|
||||
return;
|
||||
|
||||
GlowMaskPlantDrawInfo? drawInfo = onPlantDrawn?.Invoke(plant, tileX, tileY) ?? default;
|
||||
if (drawInfo.HasValue)
|
||||
{
|
||||
var info = drawInfo.Value;
|
||||
spriteBatch.Draw(info.Texture, position, sourceRectangle, info.Color, rotation, origin, scale, effects, layerDepth);
|
||||
}
|
||||
});
|
||||
cursor.Next.OpCode = OpCodes.Nop; // remove next drawcall
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1086,6 +1086,7 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
// 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value.
|
||||
#region Store The Stupid Fucking Private Wind Map In Public Property
|
||||
[/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)]
|
||||
private static void StoreWindGrid(On_TileDrawing.orig_Update orig, TileDrawing self)
|
||||
{
|
||||
orig(self);
|
||||
|
||||
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 319 B |
@@ -522,6 +522,7 @@ namespace CalamityMod.Items.Accessories
|
||||
AddIngredient<DivineGeode>(50).
|
||||
AddIngredient<UnholyEssence>(100).
|
||||
AddTile<ProfanedCrucible>().
|
||||
AddDecraftCondition(CalamityConditions.DownedSupremeCalamitas, CalamityConditions.DownedExoMechs).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace CalamityMod.Items.Accessories
|
||||
modPlayer.DashID = StatisVoidSashDash.ID;
|
||||
player.dashType = 0;
|
||||
player.spikedBoots = 2;
|
||||
player.accFlipper = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Items
|
||||
public partial class CalamityGlobalItem : GlobalItem
|
||||
{
|
||||
// 02AUG2023: Ozzatron: Having Overhaul enabled turns off all scaling changes, per direct request from Mirsario on 8/2/23.
|
||||
private static bool DisableScalingForOverhaul => CalamityMod.Instance.overhaul is not null;
|
||||
private static bool DisableScalingForOverhaul => ExternalMods.overhaul is not null;
|
||||
|
||||
#region Database and Initialization
|
||||
internal static SortedDictionary<int, IItemTweak[]> currentTweaks = null;
|
||||
@@ -126,7 +126,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.GrenadeLauncher, Do(DamageExact(112)) },
|
||||
{ ItemID.Gungnir, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(92), ShootSpeedRatio(1.25f)) },
|
||||
{ ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) },
|
||||
{ ItemID.Handgun, Do(PointBlank, UseExact(22)) },
|
||||
{ ItemID.Handgun, Do(PointBlank, UseExact(20)) },
|
||||
{ ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) },
|
||||
{ ItemID.HighVelocityBullet, Do(DamageExact(13)) },
|
||||
{ ItemID.HiveFive, Do(AutoReuse, DamageExact(27)) },
|
||||
|
||||
|
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 299 B |
@@ -1,4 +1,7 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Dyes;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -7,6 +10,22 @@ namespace CalamityMod.Items.Dyes.HairDye
|
||||
public class AdrenalineHairDye : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Dyes";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye));
|
||||
}
|
||||
}
|
||||
|
||||
private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting)
|
||||
{
|
||||
var calPlayer = player.Calamity();
|
||||
var adrenalineP = calPlayer.adrenaline / calPlayer.adrenalineMax;
|
||||
return Color.Lerp(player.hairColor, new Color(0, 255, 171), adrenalineP);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Dyes;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -7,6 +10,22 @@ namespace CalamityMod.Items.Dyes.HairDye
|
||||
public class RageHairDye : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Dyes";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye));
|
||||
}
|
||||
}
|
||||
|
||||
private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting)
|
||||
{
|
||||
var calPlayer = player.Calamity();
|
||||
var rageP = calPlayer.rage / calPlayer.rageMax;
|
||||
return Color.Lerp(player.hairColor, new Color(255, 83, 48), rageP);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Dyes;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -7,6 +10,25 @@ namespace CalamityMod.Items.Dyes.HairDye
|
||||
public class StealthHairDye : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Dyes";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye));
|
||||
}
|
||||
}
|
||||
|
||||
private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting)
|
||||
{
|
||||
float stealthP = player.Calamity().rogueStealth / player.Calamity().rogueStealthMax;
|
||||
|
||||
if (float.IsInfinity(stealthP) || float.IsNaN(stealthP))
|
||||
stealthP = 0f;
|
||||
|
||||
return Color.Lerp(player.hairColor, new Color(186, 85, 211), stealthP);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Dyes;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -7,6 +10,25 @@ namespace CalamityMod.Items.Dyes.HairDye
|
||||
public class WingTimeHairDye : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Dyes";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye));
|
||||
}
|
||||
}
|
||||
|
||||
private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting)
|
||||
{
|
||||
float wingP = player.wingTime / player.wingTimeMax;
|
||||
|
||||
if (player.mount.Active) wingP = 1f;
|
||||
else if (float.IsInfinity(wingP) || float.IsNaN(wingP)) wingP = 0f;
|
||||
|
||||
return Color.Lerp(player.hairColor, new Color(139, 205, 255), wingP);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Fishing
|
||||
itemLoot.Add(ItemID.Amber, 8, gemMin, gemMax);
|
||||
|
||||
// Add Thorium gems if Thorium is loaded.
|
||||
Mod thorium = CalamityMod.Instance.thorium;
|
||||
Mod thorium = ExternalMods.thorium;
|
||||
if (thorium is null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace CalamityMod.Items.Fishing
|
||||
itemLoot.AddIf(() => Main.hardMode, ItemID.HallowedSeeds, 20, seedMin, seedMax);
|
||||
|
||||
// Add Thorium Marine Kelp if Thorium is loaded.
|
||||
Mod thorium = CalamityMod.Instance.thorium;
|
||||
Mod thorium = ExternalMods.thorium;
|
||||
if (thorium is null)
|
||||
return;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 565 B |
|
Before Width: | Height: | Size: 922 B After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,25 @@
|
||||
using CalamityMod.Items.Placeables.Walls;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.FurnitureEutrophic
|
||||
{
|
||||
public class AncientSmoothNavystone : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 100;
|
||||
}
|
||||
|
||||
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.FurnitureEutrophic.AncientSmoothNavystone>());
|
||||
|
||||
/*public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<AncientSmoothNavystoneWall>(4).
|
||||
AddTile(TileID.WorkBenches).
|
||||
Register();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 264 B |
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 100;
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<AncientSmoothNavystone>();
|
||||
}
|
||||
|
||||
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.FurnitureEutrophic.SmoothNavystone>());
|
||||
|
||||
|
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 215 B |
@@ -0,0 +1,16 @@
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables
|
||||
{
|
||||
public class Stohne : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 100;
|
||||
}
|
||||
|
||||
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.Stohne>());
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 238 B |
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -39,9 +40,9 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
return true;
|
||||
|
||||
if (SandstormEvent.Happening)
|
||||
CalamityUtils.StopSandstorm();
|
||||
CalamityWorld.StopSandstorm();
|
||||
else
|
||||
CalamityUtils.StartSandstorm();
|
||||
CalamityWorld.StartSandstorm();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -37,11 +38,11 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
|
||||
if (!Main.raining)
|
||||
{
|
||||
CalamityUtils.StartRain(torrentialTear: true, worldSync: true);
|
||||
CalamityWorld.StartRain(adjustSeverity: true, worldSync: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
CalamityUtils.StopRain(clearWeather: false, worldSync: true);
|
||||
CalamityWorld.StopRain(clearWeather: false, worldSync: true);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags
|
||||
itemLoot.Add(ItemID.Chest, 1, 3, 3);
|
||||
|
||||
// Calamity title theme music box (if music mod is enabled)
|
||||
Mod musicMod = CalamityMod.Instance.musicMod;
|
||||
Mod musicMod = ExternalMods.musicMod;
|
||||
if (musicMod is not null)
|
||||
itemLoot.Add(musicMod.Find<ModItem>("CalamityMusicbox").Type);
|
||||
|
||||
|
||||
@@ -4,29 +4,28 @@ using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Core;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public static class VanillaArmorChangeManager
|
||||
public class VanillaArmorChangeManager : ModSystem
|
||||
{
|
||||
internal static List<VanillaArmorChange> ArmorChanges;
|
||||
|
||||
internal static void Load()
|
||||
public override void OnModLoad()
|
||||
{
|
||||
ArmorChanges = new List<VanillaArmorChange>();
|
||||
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
|
||||
foreach (Type type in types)
|
||||
ArmorChanges = [];
|
||||
ReflectionHelper.IterateCalamityTypes<VanillaArmorChange>(action: type =>
|
||||
{
|
||||
if (!type.IsSubclassOf(typeof(VanillaArmorChange)) || type.IsAbstract)
|
||||
continue;
|
||||
|
||||
ArmorChanges.Add((VanillaArmorChange)FormatterServices.GetUninitializedObject(type));
|
||||
}
|
||||
ArmorChanges.Add((VanillaArmorChange)Activator.CreateInstance(type));
|
||||
});
|
||||
}
|
||||
|
||||
internal static void Unload() => ArmorChanges = null;
|
||||
public override void Unload()
|
||||
{
|
||||
ArmorChanges = null;
|
||||
}
|
||||
|
||||
public static void ApplySetBonusTooltipChanges(Item checkItem, ref string setBonusText)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 52;
|
||||
Item.height = 30;
|
||||
Item.damage = 225;
|
||||
Item.damage = 175;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 25;
|
||||
Item.crit += 4;
|
||||
|
||||
@@ -7,6 +7,7 @@ using CalamityMod.Items.BaseItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -160,8 +161,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
int attunement1 = tag.GetInt("mainAttunement");
|
||||
int attunement2 = tag.GetInt("secondaryAttunement");
|
||||
|
||||
mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1];
|
||||
secondaryAttunement = Attunement.attunementArray[attunement2 != -1 ? attunement2 : Attunement.attunementArray.Length - 1];
|
||||
mainAttunement = AttunementSystem.FindOrNull(attunement1);
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(attunement2);
|
||||
|
||||
if (mainAttunement == secondaryAttunement)
|
||||
secondaryAttunement = null;
|
||||
@@ -171,14 +172,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID);
|
||||
writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : AttunementSystem.EmptyID);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
mainAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
secondaryAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -190,10 +191,21 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public void SafeCheckAttunements()
|
||||
{
|
||||
if (mainAttunement != null)
|
||||
mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.Default, (float)AttunementID.Evil)];
|
||||
mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id));
|
||||
|
||||
if (secondaryAttunement != null)
|
||||
secondaryAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)secondaryAttunement.id, (float)AttunementID.Default, (float)AttunementID.Evil)];
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)secondaryAttunement.id));
|
||||
}
|
||||
|
||||
private static int ClampAttunementRange(int input)
|
||||
{
|
||||
if (input < (int)AttunementID.Default)
|
||||
return (int)AttunementID.Default;
|
||||
|
||||
if (input > (int)AttunementID.Evil)
|
||||
return (int)AttunementID.Evil;
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
|
||||
@@ -12,6 +12,18 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public class DeathsAscension : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Melee";
|
||||
|
||||
public const int RiftLifeTime = 600;
|
||||
|
||||
public const float OrbitalScytheDamageMult = 0.4f;
|
||||
|
||||
public const float RiftScytheDamageMult = 0.125f;
|
||||
|
||||
public const int RiftOrbitalAmount = 4;
|
||||
|
||||
public const int ScytheShotAmount = 4;
|
||||
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
|
||||
@@ -80,12 +92,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
int spreadfactor = 9;
|
||||
if (player.altFunctionUse == 2f)
|
||||
{
|
||||
for (int index = 0; index < 4; ++index)
|
||||
for (int index = 0; index < ScytheShotAmount; ++index)
|
||||
{
|
||||
float SpeedX = velocity.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1);
|
||||
float SpeedY = velocity.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.125f), knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
// Tell the rift(s) to shoot
|
||||
foreach (Projectile p in Main.ActiveProjectiles)
|
||||
{
|
||||
if (p.type == ModContent.ProjectileType<DeathsAscensionRift>() && p.owner == player.whoAmI && p.ai[0] <= 0)
|
||||
p.ai[0] = 10f; // Cooldown before scythes can be shot again because right click code is cool and shoots twice without this
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -153,17 +154,17 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
int attunement1 = tag.GetInt("mainAttunement");
|
||||
|
||||
mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1];
|
||||
mainAttunement = AttunementSystem.FindOrNull(attunement1);
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
mainAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -187,10 +188,21 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public void SafeCheckAttunements()
|
||||
{
|
||||
if (mainAttunement == null)
|
||||
mainAttunement = Attunement.attunementArray[(int)AttunementID.Phoenix];
|
||||
mainAttunement = AttunementSystem.FindOrNull(AttunementID.Phoenix);
|
||||
|
||||
else
|
||||
mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.Phoenix, (float)AttunementID.Andromeda)];
|
||||
mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id));
|
||||
}
|
||||
|
||||
private static int ClampAttunementRange(int input)
|
||||
{
|
||||
if (input < (int)AttunementID.Phoenix)
|
||||
return (int)AttunementID.Phoenix;
|
||||
|
||||
if (input > (int)AttunementID.Andromeda)
|
||||
return (int)AttunementID.Andromeda;
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
@@ -240,7 +252,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
if (mainAttunement == null)
|
||||
mainAttunement = Attunement.attunementArray[(int)AttunementID.Phoenix];
|
||||
mainAttunement = AttunementSystem.FindOrNull(AttunementID.Phoenix);
|
||||
|
||||
Texture2D itemTexture = Request<Texture2D>((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDusk" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawn").Value;
|
||||
Texture2D outlineTexture = Request<Texture2D>((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDuskOutline" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawnOutline").Value;
|
||||
@@ -264,7 +276,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
if (mainAttunement == null)
|
||||
mainAttunement = Attunement.attunementArray[(int)AttunementID.Phoenix];
|
||||
mainAttunement = AttunementSystem.FindOrNull(AttunementID.Phoenix);
|
||||
|
||||
Texture2D itemTexture = Request<Texture2D>((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDusk" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawn").Value;
|
||||
Texture2D outlineTexture = Request<Texture2D>((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDuskOutline" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawnOutline").Value;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 124;
|
||||
Item.height = 124;
|
||||
Item.damage = 2777; // Feel free to change these 7s as balance requires. The other 7s should stay
|
||||
Item.damage = 1977; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :(
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useAnimation = 77;
|
||||
Item.useTime = 77;
|
||||
|
||||
@@ -6,6 +6,7 @@ using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -218,8 +219,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
int attunement1 = tag.GetInt("mainAttunement");
|
||||
int attunement2 = tag.GetInt("secondaryAttunement");
|
||||
|
||||
mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1];
|
||||
secondaryAttunement = Attunement.attunementArray[attunement2 != -1 ? attunement2 : Attunement.attunementArray.Length - 1];
|
||||
mainAttunement = AttunementSystem.FindOrNull(attunement1);
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(attunement2);
|
||||
|
||||
if (mainAttunement == secondaryAttunement)
|
||||
secondaryAttunement = null;
|
||||
@@ -229,14 +230,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID);
|
||||
writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : AttunementSystem.EmptyID);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
mainAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
secondaryAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -252,10 +253,21 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public void SafeCheckAttunements()
|
||||
{
|
||||
if (mainAttunement != null)
|
||||
mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.Whirlwind, (float)AttunementID.Shockwave)];
|
||||
mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id));
|
||||
|
||||
if (secondaryAttunement != null)
|
||||
secondaryAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)secondaryAttunement.id, (float)AttunementID.Whirlwind, (float)AttunementID.Shockwave)];
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)secondaryAttunement.id));
|
||||
}
|
||||
|
||||
private static int ClampAttunementRange(int input)
|
||||
{
|
||||
if (input < (int)AttunementID.Whirlwind)
|
||||
return (int)AttunementID.Whirlwind;
|
||||
|
||||
if (input > (int)AttunementID.Shockwave)
|
||||
return (int)AttunementID.Shockwave;
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Melee.Shortswords;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -13,8 +15,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 44;
|
||||
Item.height = 44;
|
||||
Item.width = 74;
|
||||
Item.height = 94;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.autoReuse = true;
|
||||
@@ -32,6 +34,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override bool MeleePrefix() => true;
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/StarburstShivGlow").Value);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
|
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -7,6 +7,7 @@ using CalamityMod.Items.BaseItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -179,8 +180,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
int attunement1 = tag.GetInt("mainAttunement");
|
||||
int attunement2 = tag.GetInt("secondaryAttunement");
|
||||
|
||||
mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1];
|
||||
secondaryAttunement = Attunement.attunementArray[attunement2 != -1 ? attunement2 : Attunement.attunementArray.Length - 1];
|
||||
mainAttunement = AttunementSystem.FindOrNull(attunement1);
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(attunement2);
|
||||
|
||||
if (mainAttunement == secondaryAttunement)
|
||||
secondaryAttunement = null;
|
||||
@@ -190,14 +191,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : Attunement.attunementArray.Length - 1);
|
||||
writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID);
|
||||
writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : AttunementSystem.EmptyID);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
mainAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
secondaryAttunement = Attunement.attunementArray[reader.ReadInt32()];
|
||||
mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(reader.ReadInt32());
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -213,10 +214,21 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public void SafeCheckAttunements()
|
||||
{
|
||||
if (mainAttunement != null)
|
||||
mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.TrueDefault, (float)AttunementID.Holy)];
|
||||
mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id));
|
||||
|
||||
if (secondaryAttunement != null)
|
||||
secondaryAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)secondaryAttunement.id, (float)AttunementID.TrueDefault, (float)AttunementID.Holy)];
|
||||
secondaryAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)secondaryAttunement.id));
|
||||
}
|
||||
|
||||
private static int ClampAttunementRange(int input)
|
||||
{
|
||||
if (input < (int)AttunementID.TrueDefault)
|
||||
return (int)AttunementID.TrueDefault;
|
||||
|
||||
if (input > (int)AttunementID.Marine)
|
||||
return (int)AttunementID.Marine;
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
@@ -19,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 64;
|
||||
Item.height = 34;
|
||||
Item.width = 166;
|
||||
Item.height = 60;
|
||||
Item.damage = 94;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useAnimation = Item.useTime = 6;
|
||||
@@ -54,6 +55,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/ChromaticEruptionGlow").Value);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,6 +1,11 @@
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using System;
|
||||
using System.Diagnostics.Metrics;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Build.Tasks;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -10,48 +15,108 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Leviatitan : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
// Every sixth shot fires homing Aberrations, then resets the counter to 2.
|
||||
// This is intentional so you don't get the Aberrations instantly when you start firing and have to play around it.
|
||||
private int shotCounter = 1;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 82;
|
||||
Item.height = 28;
|
||||
Item.damage = 77;
|
||||
Item.damage = 121;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 10;
|
||||
Item.useAnimation = 10;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useTime = Item.useAnimation = 18; //Try not to change this if you can help it.
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 5f;
|
||||
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.UseSound = SoundID.Item92;
|
||||
Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.4f };
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<AquaBlast>();
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shootSpeed = 13f;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return new Vector2(-15, 0);
|
||||
return true;
|
||||
}
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
Item.UseSound = player.altFunctionUse == 2 ? SoundID.NPCHit56 : new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.3f };
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
public override float UseSpeedMultiplier(Player player) => player.altFunctionUse == 2 ? (1f / 3f) : 1f;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float SpeedX = velocity.X + Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-10, 11) * 0.05f;
|
||||
// Reposition to the gun's tip. Calculated seperately due to the two different shot styles.
|
||||
Vector2 boulderPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation());
|
||||
Vector2 shotPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -6f : 3f)).RotatedBy(velocity.ToRotation());
|
||||
|
||||
if (type == ProjectileID.Bullet)
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<AquaBlastToxic>(), (int)(damage * 1.5), knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<AquaBlast>(), damage, knockback, player.whoAmI);
|
||||
int index = Projectile.NewProjectile(source, boulderPos, velocity * 0.7f, ModContent.ProjectileType<LeviatitanMeteor>(), (int)(damage * 2f), knockback, player.whoAmI);
|
||||
}
|
||||
else
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
|
||||
{
|
||||
Projectile.NewProjectile(source, shotPos, velocity, Item.shoot, damage, knockback, player.whoAmI);
|
||||
}
|
||||
if (shotCounter == 7)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f });
|
||||
for (int i = 0; i <= 1; i++)
|
||||
{
|
||||
float projSpeed = Item.shootSpeed;
|
||||
Projectile.NewProjectile(source, position + Main.rand.NextVector2Circular(150, 150), velocity * projSpeed, ModContent.ProjectileType<LeviatitanAberration>(), (int)(damage * 1.3), knockback, player.whoAmI);
|
||||
}
|
||||
}
|
||||
shotCounter++;
|
||||
if (shotCounter > 7)
|
||||
shotCounter = 2;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Thanks to Xyk's incredible recoil code, we give both left click and right click different recoils without having to use a holdout.
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
float pullback = 7f;
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
if (animProgress < 0.1f)
|
||||
pullback -= (2.75f) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2);
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * pullback;
|
||||
Vector2 itemSize = new Vector2(52, 28);
|
||||
Vector2 itemOrigin = new Vector2(-24, 4);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
if (animProgress < 0.4f)
|
||||
rotation += (player.altFunctionUse == 2 ? -0.15f : 0) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
[LegacyName("TerraDisk")]
|
||||
public class SamsaraSlicer : RogueWeapon
|
||||
{
|
||||
public static float Speed = 12f;
|
||||
public static float Speed = 20f;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 60;
|
||||
Item.height = 64;
|
||||
Item.damage = 100;
|
||||
Item.damage = 80;
|
||||
Item.knockBack = 4f;
|
||||
Item.useAnimation = Item.useTime = 30;
|
||||
Item.autoReuse = true;
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.noUseGraphic = true;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.UseSound = SoundID.DD2_GoblinBomberThrow;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
@@ -36,10 +36,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override float StealthVelocityMultiplier => 0.75f;
|
||||
public override float StealthVelocityMultiplier => 1.5f;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.ownedProjectileCounts[type] > 4) return false;
|
||||
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
@@ -48,6 +50,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.ownedProjectileCounts[Item.shoot] > 4) return false;
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
@@ -14,8 +15,8 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
public new string LocalizationCategory => "Items.Weapons.Summon";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 36;
|
||||
Item.width = 100;
|
||||
Item.height = 128;
|
||||
Item.damage = 57;
|
||||
Item.DamageType = DamageClass.Summon;
|
||||
Item.mana = 10;
|
||||
@@ -31,6 +32,11 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
Item.shootSpeed = 10f;
|
||||
}
|
||||
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.itemLocation += new Vector2(-20f * player.direction, 34f * player.gravDir).RotatedBy(player.itemRotation);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.altFunctionUse != 2)
|
||||
@@ -45,6 +51,8 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Summon/LegionofCelestiaGlow").Value);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,102 @@
|
||||
// Put their internal name here
|
||||
NPCName: {
|
||||
Dryad: Dryads practice the art of Life Magic, pioneered by Silva. She is connected with nature and can analyze its purity worldwide. She sells seeds, too!
|
||||
Mechanic: The Mechanic was imprisoned for sticking her nose where she shouldn't. She sells wiring and tools for putting together anything imaginable.
|
||||
EmpressButterfly: These familiars conjured by the Empress draw power from their surroundings and later bring it to their master. They remind her of a lost loved one, and should one perish in the chaos of night, she shall unleash her full fury upon the attacker.
|
||||
DemonEye: "{$CommonEntries.DemonEye}"
|
||||
CataractEye: "{$CommonEntries.DemonEye}"
|
||||
DialatedEye: "{$CommonEntries.DemonEye}"
|
||||
SleepyEye: "{$CommonEntries.DemonEye}"
|
||||
GreenEye: "{$CommonEntries.DemonEye}"
|
||||
PurpleEye: "{$CommonEntries.DemonEye}"
|
||||
Wraith: Souls belonging to devotees of gods were once sealed inside the Wall of Flesh. Now, they roam the night in search of vengeance.
|
||||
BloodNautilus: The intense red glow of the Blood Moon becomes even greater in contact with water, making aquatic creatures affected more strongly than their land counterparts. This enormous shelled water demon directly feeds off that energy, responding brutally to being pestered.
|
||||
DiggerHead: Exposure to the effects of godly magicks flowing throughout the cracks of the world causes unusual rapid growths in giant worms.
|
||||
GraniteGolem: These strong magicked constructs were utilized in mines for carrying heavy ores and machinery. They continue to inhabit the mines deep below, even after their abandonment.
|
||||
GreekSkeleton: Marble caves were used as arenas during the Deific Era. Fighters looking for glory flocked to them, but now only their bodies populate the area.
|
||||
UndeadViking: After the Crusade left the continent in shambles, many factions attempted to conquer it. These vikings were one such group, but the icy winds of the tundra made short work of them.
|
||||
IcyMerman: Mermen rarely stray far from the ocean, favoring the vast waters where their revered Elemental now lives in. Those that do can become lost, wander into cold caverns, and become icy undead fish men.
|
||||
DesertBeast: Minor draconic offshoots who thrive in arid climates, the Basilisk's hardened bodies make them formidable threats.
|
||||
DuneSplicerHead: The largest worm native to the Desert. Even strengthened by divine magicks, they fall short of the Scourge, and run amok in a hunger-induced frenzy.
|
||||
SandShark: "{$CommonEntries.SandShark}"
|
||||
SandsharkCorrupt: "{$CommonEntries.SandShark}"
|
||||
SandsharkCrimson: "{$CommonEntries.SandShark}"
|
||||
SandsharkHallow: "{$CommonEntries.SandShark}"
|
||||
MeteorHead: When meteorites strike the surface, their fragments lay scattered for the taking. Some pieces have a higher mana density, coming to life and attacking anything nearby.
|
||||
AngryBones: "{$CommonEntries.AngryBones}"
|
||||
AngryBonesBig: "{$CommonEntries.AngryBones}"
|
||||
AngryBonesBigMuscle: "{$CommonEntries.AngryBones}"
|
||||
AngryBonesBigHelmet: "{$CommonEntries.AngryBones}"
|
||||
BlueArmoredBones: "{$CommonEntries.BlueArmoredBones}"
|
||||
BlueArmoredBonesMace: "{$CommonEntries.BlueArmoredBones}"
|
||||
BlueArmoredBonesNoPants: "{$CommonEntries.BlueArmoredBones}"
|
||||
BlueArmoredBonesSword: "{$CommonEntries.BlueArmoredBones}"
|
||||
HellArmoredBones: "{$CommonEntries.HellArmoredBones}"
|
||||
HellArmoredBonesSpikeShield: "{$CommonEntries.HellArmoredBones}"
|
||||
HellArmoredBonesMace: "{$CommonEntries.HellArmoredBones}"
|
||||
HellArmoredBonesSword: "{$CommonEntries.HellArmoredBones}"
|
||||
RustyArmoredBonesAxe: "{$CommonEntries.RustyArmoredBones}"
|
||||
RustyArmoredBonesFlail: "{$CommonEntries.RustyArmoredBones}"
|
||||
RustyArmoredBonesSword: "{$CommonEntries.RustyArmoredBones}"
|
||||
RustyArmoredBonesSwordNoArmor: "{$CommonEntries.RustyArmoredBones}"
|
||||
SkeletonSniper: Part of Yharim's military force in their past lives, these eagle-eyed sharpshooters let nothing escape their crosshairs, even when their place of operation were these cramped halls.
|
||||
TacticalSkeleton: Part of Yharim's military force in their past lives, with thick armor and mighty boomsticks, they were the frontline against the invader that massacred the guards in these halls.
|
||||
SkeletonCommando: Part of Yharim's military force in their past lives, their rocket-powered rage could wipe out entire crowds of escapees had they ever once dared to step out of their cells.
|
||||
BoneLee: This Onyx Kinsman was apprehended by Yharim's troops, and after countless failed escape attempts, used as an example to other prisoners.
|
||||
Paladin: Several Godseeker Knights were assigned to guard the Dungeon, yet not even they could fight against, much less see, their killer. Word of the massacre that happened in these halls never got out, the wails of the dead forever silenced.
|
||||
DiabolistRed: "{$CommonEntries.Diabolist}"
|
||||
DiabolistWhite: "{$CommonEntries.Diabolist}"
|
||||
Necromancer: "{$CommonEntries.Necromancer}"
|
||||
NecromancerArmored: "{$CommonEntries.Necromancer}"
|
||||
RaggedCaster: "{$CommonEntries.RaggedCaster}"
|
||||
RaggedCasterOpenCoat: "{$CommonEntries.RaggedCaster}"
|
||||
DungeonGuardian: The Old Man is cursed to never leave nor enter the Dungeon, much less die. Whoever crosses paths with him and dares to descend into those halls shall not pass!
|
||||
BoneSerpentHead: Mighty serpents once ruled hell, but long ago shed their obsidian scales and became naught but skeletal husks. Subdued by Demons with stolen Azafurian spells, they now protect the demonic territory fiercely.
|
||||
Demon: Despite being a primitive civilization, demons populate most of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic.
|
||||
VoodooDemon: Demons have several religious practices, specially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer.
|
||||
RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity.
|
||||
WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land.
|
||||
Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers.
|
||||
MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources.
|
||||
SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms.
|
||||
DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility.
|
||||
ChaosElemental: Manifestations of the unstable Essence of the Hallow, they erratically make chase with an uncontrollable surge of luminous power.
|
||||
GoblinThief: Thieves forcefully conscripted in the Goblin Army in exchange for freedom, these pesky foes specialize in nimble movement and close-quarters combat.
|
||||
GoblinSummoner: Goblins that reach such a mastery over the arcane are treated like royalty, prize jewels of their society. Warlocks in particular conjure unfathomable shadowflame ghasts through a powerful hex.
|
||||
GoblinSorcerer: Goblins struggle to manipulate magic, only scantily capable of conjuring the simplest of spells. Those that can have the potential for manipulating magicked shadow energy through a form of hexing.
|
||||
PirateCaptain: A pirate captain's love for riches is only rivaled by his desire to explore! Word that the Crusade had seemingly ended spread fast across the world, and abundances to plunder in this continent attracted this sea dweller and his motley crew.
|
||||
MartianSaucerCore: Following the destruction of their planet by otherworldly creatures, the Martians' military evolved at an unprecedented rate. They were prepared to fight back any future threats, and also pillage any other worlds they could find.
|
||||
TorchGod: An unknown entity responsible for a torch's eternal flicker, however easily angered by the unsightly, ungrateful abuse of torch placement.
|
||||
EyeofCthulhu: A gargantuan monster of unknown origins, responsible for plaguing the night with Demon Eyes. It was given the title of "Cthulhu", which means "Great Beast" in the language of dragons.
|
||||
BrainofCthulhu: The death of a god often birthed great monsters due to the volatile nature of godly essence. The culling of such abominations used to be cause for songs and festivities, but now, they only give birth to disappointments.
|
||||
SkeletronHead: A demonic construct that bursts out of the Old Man when necessary and the most dangerous part of the curse laid by the Dragon Cult. They hoped to stop all intruders with it, but one was too cunning even for them.
|
||||
WallofFlesh: Originally created by Azafurian mages as a gambit to seal away godly essence, the towering wall broke free after the city's destruction. Its existence was problematic, but its demise has ushered even greater instability upon the world.
|
||||
QueenSlimeBoss: After fleeing the initial battle, the Slime God attempted to rebuild its Paladins with the emerged energy of the Hallow. However, it was ensnared by its own creation, unable to control the vast and unstable power of it.
|
||||
Retinazer: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Retinazer focuses its energy into firing powerful lasers.
|
||||
Spazmatism: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Spazmatism chases at high speed, exhaling cursed flames.
|
||||
TheDestroyer: Despite being made with repurposed mining equipment, the Destroyer was built for fighting other deities in single combat, decorated in laser-armed probes, which detach from its body when damaged.
|
||||
SkeletronPrime: Built with the express purpose of inciting fear into the hearts of any god worshiper, this machine has more arms than ever before, and a variety of fierce weapons.
|
||||
Plantera: A creation of the Vernal Pass meant to replace Braelor in his absence. They harnessed dead animal souls to give it life, but the span of such magic was far larger than anticipated. It didn't take long for the Plantera to grow out of control and slaughter its masters.
|
||||
HallowBoss: Despite their parentage, children of gods do not inherit a shred of their power. The Empress chose to claim power for herself by siphoning it from other places and beings. She found a perfect candidate in the Hallow due to its unstable nature, and is now transformed into a mighty fae.
|
||||
Golem: A remarkable display of ingenuity constructed by the Lihzahrd race. Seeking light after they hid away in their temple out of shame for driving their goddess away, they built this construct. Powered by solar energy cells, it is ready to guard the Temple.
|
||||
DukeFishron: An aquatic-evolved species which lives in isolation in the depths of the ocean. Despite their shortcomings, they still share blood with the dragons of old, claiming near complete dominion over the oceans. Legends claim it only surfaces in search of a rare, savory type of worm.
|
||||
CultistBoss: The fanatical leader of the Dragon Cult, hell-bent on resurrecting a dragon. He upholds their sacred duty of keeping the cosmic behemoth sealed far away on the moon, an oath he swore to long ago when he pledged himself in their service.
|
||||
CultistDevote: Utterly devoted, Lunatic Devotees are so paranoid over the prospect of their ritual failing that they stay unflinching even when threatened with death. Fear only makes them work harder.
|
||||
LunarTowerNebula: The second pillar, created to spawn beings from beyond that filled the Minds of all with gloom. These troops specialized in disabling the enemy's intelligence, ensuring no countermeasures could be planned against the dominator.
|
||||
LunarTowerSolar: The fourth and last pillar, created as Sunlight bled and marked doom. A miniscule shard of its power was used to make it, and yet its spawns accompanied the dominator directly in his conquest against the dragons.
|
||||
LunarTowerVortex: The first pillar, created as black Storm clouds on the horizon loomed. While the dominator fought the mightiest of dragons, the spawns of this pillar focused on exterminating any mundane life they could find, appearing in seemingly infinite droves.
|
||||
LunarTowerStardust: The third Pillar, created as Life rose to fight, but was given no room. Its spawns found particular utility in searching and picking off stronger beings that could pose a threat to the creatures of the Vortex.
|
||||
MoonLordCore: The cosmic behemoth that brought Terraria to its knees 800 years ago, freed from its lunar prison in a weakened state. It had the power to siphon and dominate souls, including those possessed by dragons, permanently wounding them. It hails from an incomprehensible fissure of broken spacetime which leeches energy from our dimension to sustain itself.
|
||||
}
|
||||
|
||||
CommonEntries: {
|
||||
DemonEye: That suspicious feeling of being watched may very well come true in the dark of night, when the Eye of Cthulhu's minions roam the skies.
|
||||
SandShark: Sand Sharks lived in the shallow waters of Ilmeris, hiding beneath the sand. They were thankfully well equipped to deal with the fallout of the Incineration.
|
||||
AngryBones: Cursed with undeath, the former prisoners of the Dungeon roam endlessly through its halls, seeking a victim for their unending fury.
|
||||
BlueArmoredBones: Mercenaries hired by Yharim to guard the Dungeon, the Marching Bones were disciplined and relentless, sundering any escapees that decided to rise against their jailors.
|
||||
HellArmoredBones: Mercenaries hired by Yharim to guard the Dungeon hailing from Azafure, the fiery glow of the Molten Legion is unmistakable. If anyone ever tried to hide, their red-hot armaments would melt the hideout immediately.
|
||||
RustyArmoredBones: Mercenaries hired by Yharim to guard the Dungeon hailing from Underground factions, the Rusted Company's weapons are jagged and rough through use and neglect. The brutality they employed on the field was enough to make many prisoners give up on freedom.
|
||||
Diabolist: Mages of Azafure who bear the Diabolic Sigil, wielding flames as intense as any in the underworld. They were effective at blocking passageways and at making prisoners talk.
|
||||
Necromancer: These sorcerers were trained in Azafure and bore the Necromantic Sign. Much like they terrorized prisoners with the bodies of their friends, so do they terrorize the Dungeon now.
|
||||
RaggedCaster: Casters directly from the Dragon Cult, their cursed magic leaves their victims helplessly lost in utter darkness. They perished attempting to contain the onslaught that happened beneath their halls.
|
||||
}
|
||||
@@ -1648,7 +1648,7 @@ StatisVoidSash: {
|
||||
Tooltip:
|
||||
'''
|
||||
32% increased jump speed, allows auto-jump, and negates fall damage
|
||||
Can climb walls, dash, and dodge attacks
|
||||
Can swim, climb walls, dash, and dodge attacks
|
||||
'''
|
||||
HoldShiftTooltip:
|
||||
'''
|
||||
|
||||
@@ -1691,6 +1691,11 @@ CosmiliteWorkBench: {
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
AncientSmoothNavystone: {
|
||||
DisplayName: Ancient Smooth Navystone
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
EutrophicBathtub: {
|
||||
DisplayName: Eutrophic Bathtub
|
||||
Tooltip: ""
|
||||
@@ -3320,6 +3325,11 @@ SpineSapling: {
|
||||
Tooltip: Plants Giant Spine saplings on Brimstone Slag
|
||||
}
|
||||
|
||||
Stohne: {
|
||||
DisplayName: Stohne
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
SulphurousSand: {
|
||||
DisplayName: Sulphurous Sand
|
||||
Tooltip: ""
|
||||
|
||||
@@ -331,7 +331,9 @@ DeathsAscension: {
|
||||
DisplayName: Death's Ascension
|
||||
Tooltip:
|
||||
'''
|
||||
Performs powerful soul-infused swings that creates a rift orbited by scythes on enemy hits
|
||||
Press <right> to launch a barrage of homing scythes
|
||||
The rift will fire scythes along with you
|
||||
'It feels just right in your grip...
|
||||
[c/660066:But the hands that wield it are not yours']
|
||||
'''
|
||||
|
||||
@@ -682,7 +682,13 @@ Kingsbane: {
|
||||
|
||||
Leviatitan: {
|
||||
DisplayName: Leviatitan
|
||||
Tooltip: Converts musket balls into toxic and normal water blasts
|
||||
Tooltip:
|
||||
'''
|
||||
Fires high velocity aqua blasts
|
||||
Releases homing aberrations that shred enemy defense every six shots
|
||||
<right> to vomit a meteor that explodes on hit
|
||||
'The L in LMG stands for Leviathan'
|
||||
'''
|
||||
}
|
||||
|
||||
LunarianBow: {
|
||||
|
||||
@@ -958,7 +958,7 @@ ScarletDevil: {
|
||||
DisplayName: Scarlet Devil
|
||||
Tooltip:
|
||||
'''
|
||||
Throws an ultra high velocity spear, which creates more projectiles that home in
|
||||
Throws an ultra high velocity spear, which leaves a trail of homing bullets
|
||||
The spear creates a Scarlet Blast upon hitting an enemy
|
||||
Stealth strikes grant you lifesteal and summon a star of projectiles upon hitting an enemy
|
||||
'Divine Spear "Spear the Gungnir"'
|
||||
|
||||
@@ -80,6 +80,7 @@ DarklightGreatswordSlashCreator.DisplayName: Darklight Greatsword Slash Creator
|
||||
DarkMasterBeam.DisplayName: Dark Master Beam
|
||||
DarkMasterClone.DisplayName: Dark Terrarian
|
||||
DeathsAscensionProjectile.DisplayName: Ascended Scythe
|
||||
DeathsAscensionRift.DisplayName: Rift
|
||||
DecaysRetort.DisplayName: Decay's Retort
|
||||
DecaysRetortDash.DisplayName: Evisceration Lunge
|
||||
DemonBlast.DisplayName: Devil Fork
|
||||
@@ -115,6 +116,7 @@ ExobeamSlashCreator.DisplayName: Anime Sword Effect
|
||||
Exoboom.DisplayName: Exoplasma Explosion
|
||||
ExtantAbhorrence.DisplayName: Extant Abhorrence
|
||||
FallenBlast.DisplayName: Fallen Paladin's Wrath
|
||||
FallenExplosionSmall.DisplayName: Fallen Hammer Blast
|
||||
FallenPaladinsHammerEcho.DisplayName: Fallen Paladin's Hammer Echo
|
||||
FallenPaladinsHammerProj.DisplayName: Fallen Paladin's Hammer
|
||||
Feather.DisplayName: Feather
|
||||
@@ -303,4 +305,3 @@ WulfrumScrew.DisplayName: Wulfrum Screw
|
||||
WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver
|
||||
YinYoDark.DisplayName: Dark Shard
|
||||
YinYoLight.DisplayName: Light Shard
|
||||
FallenExplosionSmall.DisplayName: Fallen Hammer Blast
|
||||
@@ -252,3 +252,6 @@ HellbornProj.DisplayName: Hell-born Gunblast
|
||||
HellbornShell.DisplayName: Hell's Shell
|
||||
RubicoPrimeMag.DisplayName: Rubico Prime Mag
|
||||
MegalodonShot.DisplayName: Megalodon Shot
|
||||
LeviatitanAberration.DisplayName: Leviatitan Aberration
|
||||
LeviatitanMeteor.DisplayName: Leviatitan Meteor
|
||||
LeviatitanExplosion.DisplayName: Leviatitan Explosion
|
||||
@@ -48,7 +48,7 @@ ChaliceOfTheBloodGodUnequip: "{0} violated their pact with the Blood God."
|
||||
ChibiiDoggo: "{0} couldn't stand the sharp objects."
|
||||
CirrusSlap1: "{0} was slapped too hard."
|
||||
CirrusSlap2: "{0} forked around and found out."
|
||||
CorpusAvertor: "{0} became the blood god's sacrifice."
|
||||
CorpusAvertor: "{0} became the Blood God's sacrifice."
|
||||
CrushDepth1: "{0} was crushed by the pressure."
|
||||
CrushDepth2: "{0}'s lungs collapsed."
|
||||
CrushDepth3: "{0}'s bones crunched under the deep pressure."
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
public sealed class ExternalMods : ModSystem
|
||||
{
|
||||
// This is Calamity's official music mod, CalamityModMusic. It is now a hard dependency.
|
||||
internal static Mod musicMod = null;
|
||||
internal static bool MusicAvailable => musicMod is not null;
|
||||
|
||||
// This is Vanilla Calamity Mod Music, internally named UnCalamityModMusic.
|
||||
// VCMM is an official music add-on. Unlike the main music mod, it is not a dependency.
|
||||
internal static Mod vcmm = null;
|
||||
internal static bool VCMMAvailable => vcmm is not null;
|
||||
|
||||
// Please keep this in alphabetical order so it's easy to read
|
||||
internal static Mod ancientsAwakened = null;
|
||||
internal static Mod biomeLava = null;
|
||||
internal static Mod bossChecklist = null;
|
||||
internal static Mod coloredDamageTypes = null;
|
||||
internal static Mod crouchMod = null;
|
||||
internal static Mod dialogueTweak = null;
|
||||
internal static Mod fargos = null;
|
||||
internal static Mod luminance = null;
|
||||
internal static Mod magicStorage = null;
|
||||
internal static Mod overhaul = null;
|
||||
internal static Mod redemption = null;
|
||||
internal static Mod soa = null;
|
||||
internal static Mod subworldLibrary = null;
|
||||
internal static Mod summonersAssociation = null;
|
||||
internal static Mod thorium = null;
|
||||
internal static Mod varia = null;
|
||||
internal static Mod wikithis = null;
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
musicMod = null;
|
||||
ModLoader.TryGetMod("CalamityModMusic", out musicMod);
|
||||
vcmm = null;
|
||||
ModLoader.TryGetMod("UnCalamityModMusic", out vcmm);
|
||||
|
||||
ancientsAwakened = null;
|
||||
ModLoader.TryGetMod("AAMod", out ancientsAwakened);
|
||||
biomeLava = null;
|
||||
ModLoader.TryGetMod("BiomeLava", out biomeLava);
|
||||
bossChecklist = null;
|
||||
ModLoader.TryGetMod("BossChecklist", out bossChecklist);
|
||||
coloredDamageTypes = null;
|
||||
ModLoader.TryGetMod("ColoredDamageTypes", out coloredDamageTypes);
|
||||
crouchMod = null;
|
||||
ModLoader.TryGetMod("CrouchMod", out crouchMod);
|
||||
dialogueTweak = null;
|
||||
ModLoader.TryGetMod("DialogueTweak", out dialogueTweak);
|
||||
fargos = null;
|
||||
ModLoader.TryGetMod("Fargowiltas", out fargos);
|
||||
luminance = null;
|
||||
ModLoader.TryGetMod("Luminance", out luminance);
|
||||
magicStorage = null;
|
||||
ModLoader.TryGetMod("MagicStorage", out magicStorage);
|
||||
overhaul = null;
|
||||
ModLoader.TryGetMod("TerrariaOverhaul", out overhaul);
|
||||
redemption = null;
|
||||
ModLoader.TryGetMod("Redemption", out redemption);
|
||||
soa = null;
|
||||
ModLoader.TryGetMod("SacredTools", out soa);
|
||||
subworldLibrary = null;
|
||||
ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary);
|
||||
summonersAssociation = null;
|
||||
ModLoader.TryGetMod("SummonersAssociation", out summonersAssociation);
|
||||
thorium = null;
|
||||
ModLoader.TryGetMod("ThoriumMod", out thorium);
|
||||
varia = null;
|
||||
ModLoader.TryGetMod("Varia", out varia);
|
||||
wikithis = null;
|
||||
ModLoader.TryGetMod("Wikithis", out wikithis);
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
musicMod = null;
|
||||
vcmm = null;
|
||||
|
||||
ancientsAwakened = null;
|
||||
biomeLava = null;
|
||||
bossChecklist = null;
|
||||
coloredDamageTypes = null;
|
||||
crouchMod = null;
|
||||
dialogueTweak = null;
|
||||
fargos = null;
|
||||
luminance = null;
|
||||
magicStorage = null;
|
||||
overhaul = null;
|
||||
redemption = null;
|
||||
soa = null;
|
||||
subworldLibrary = null;
|
||||
summonersAssociation = null;
|
||||
thorium = null;
|
||||
varia = null;
|
||||
wikithis = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -719,9 +719,9 @@ namespace CalamityMod
|
||||
// Sets the damage reduction for an NPC type
|
||||
public static float SetDamageReduction(int npcID, float dr)
|
||||
{
|
||||
CalamityMod.DRValues.TryGetValue(npcID, out float oldDR);
|
||||
CalamityMod.DRValues.Remove(npcID);
|
||||
CalamityMod.DRValues.Add(npcID, dr);
|
||||
CalamityGlobalNPC.DRValues.TryGetValue(npcID, out float oldDR);
|
||||
CalamityGlobalNPC.DRValues.Remove(npcID);
|
||||
CalamityGlobalNPC.DRValues.Add(npcID, dr);
|
||||
return oldDR;
|
||||
}
|
||||
// Sets a specific NPC's damage reduction
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace CalamityMod
|
||||
public static readonly Func<bool> DownedBossRush = () => DownedBossSystem.downedBossRush;
|
||||
}
|
||||
|
||||
internal class WeakReferenceSupport
|
||||
internal class WeakReferenceSupport : ModSystem
|
||||
{
|
||||
public const string CalamityWikiURLOld = "calamitymod.wiki.gg";
|
||||
public const string CalamityWikiURL = "https://calamitymod.wiki.gg/wiki/{}";
|
||||
@@ -188,28 +188,27 @@ namespace CalamityMod
|
||||
// { "Xeroc", 26f },
|
||||
};
|
||||
|
||||
public static void Setup()
|
||||
public override void PostSetupContent()
|
||||
{
|
||||
LavaStyleToBiomeLava();
|
||||
BossChecklistSupport();
|
||||
FargosSupport();
|
||||
DialogueTweakSupport();
|
||||
SummonersAssociationSupport();
|
||||
ColoredDamageTypesSupport();
|
||||
LuminanceSupport();
|
||||
// done here to assure that all other mods have already loaded so that Calamity can automatically grab any of these types they may have
|
||||
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
GeneralParticleHandler.LoadModParticleInstances();
|
||||
CooldownRegistry.RegisterModCooldowns();
|
||||
PopupGUIManager.LoadGUIs();
|
||||
WikiThisSupport();
|
||||
}
|
||||
}
|
||||
|
||||
#region BiomeLava
|
||||
public static void LavaStytleToBiomeLava()
|
||||
private static void LavaStyleToBiomeLava()
|
||||
{
|
||||
CalamityMod calamity = GetInstance<CalamityMod>();
|
||||
Mod biomelava = calamity.biomeLava;
|
||||
Mod biomelava = ExternalMods.biomeLava;
|
||||
if (biomelava == null)
|
||||
return;
|
||||
|
||||
@@ -255,14 +254,14 @@ namespace CalamityMod
|
||||
|
||||
#region WikiThis
|
||||
// This is a separate function because it only runs clientside
|
||||
public static void WikiThisSupport()
|
||||
private static void WikiThisSupport()
|
||||
{
|
||||
// Wikithis is a clientside mod
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
return;
|
||||
|
||||
CalamityMod calamity = GetInstance<CalamityMod>();
|
||||
Mod wiki = calamity.wikithis;
|
||||
Mod wiki = ExternalMods.wikithis;
|
||||
if (wiki is null)
|
||||
return;
|
||||
|
||||
@@ -350,15 +349,15 @@ namespace CalamityMod
|
||||
// Wrapper function to detect if a subworld is in use for Subworld Library.
|
||||
internal static bool InAnySubworld()
|
||||
{
|
||||
if (CalamityMod.Instance.subworldLibrary is null)
|
||||
if (ExternalMods.subworldLibrary is null)
|
||||
return false;
|
||||
|
||||
foreach (Mod mod in ModLoader.Mods)
|
||||
{
|
||||
if (mod.Name.Equals(CalamityMod.Instance.subworldLibrary.Name))
|
||||
if (mod.Name.Equals(ExternalMods.subworldLibrary.Name))
|
||||
continue;
|
||||
|
||||
bool anySubworldForMod = (CalamityMod.Instance.subworldLibrary.Call("AnyActive", mod) as bool?) ?? false;
|
||||
bool anySubworldForMod = (ExternalMods.subworldLibrary.Call("AnyActive", mod) as bool?) ?? false;
|
||||
if (anySubworldForMod)
|
||||
return true;
|
||||
}
|
||||
@@ -386,8 +385,8 @@ namespace CalamityMod
|
||||
|
||||
private static void BossChecklistSupport()
|
||||
{
|
||||
CalamityMod calamity = GetInstance<CalamityMod>();
|
||||
Mod bossChecklist = calamity.bossChecklist;
|
||||
CalamityMod calamity = CalamityMod.Instance;
|
||||
Mod bossChecklist = ExternalMods.bossChecklist;
|
||||
if (bossChecklist is null)
|
||||
return;
|
||||
|
||||
@@ -1111,7 +1110,7 @@ namespace CalamityMod
|
||||
#region Fargo's Mutant Mod
|
||||
private static void FargosSupport()
|
||||
{
|
||||
Mod fargos = GetInstance<CalamityMod>().fargos;
|
||||
Mod fargos = ExternalMods.fargos;
|
||||
if (fargos is null)
|
||||
return;
|
||||
|
||||
@@ -1141,7 +1140,7 @@ namespace CalamityMod
|
||||
#region Dialogue Tweaks
|
||||
private static void DialogueTweakSupport()
|
||||
{
|
||||
Mod dialogueMod = GetInstance<CalamityMod>().dialogueTweak;
|
||||
Mod dialogueMod = ExternalMods.dialogueTweak;
|
||||
if (dialogueMod != null)
|
||||
{
|
||||
dialogueMod.Call("ReplaceShopButtonIcon", NPCType<WITCH>(), "Head");
|
||||
@@ -1152,7 +1151,7 @@ namespace CalamityMod
|
||||
#region Summoner's Association
|
||||
private static void SummonersAssociationSupport()
|
||||
{
|
||||
Mod sAssociation = GetInstance<CalamityMod>().summonersAssociation;
|
||||
Mod sAssociation = ExternalMods.summonersAssociation;
|
||||
if (sAssociation is null)
|
||||
return;
|
||||
|
||||
@@ -1292,9 +1291,9 @@ namespace CalamityMod
|
||||
private static Color StealthDamageColor = new(185, 105, 250);
|
||||
private static Color StealthCritColor = new(144, 33, 235);
|
||||
|
||||
public static void ColoredDamageTypesSupport()
|
||||
private static void ColoredDamageTypesSupport()
|
||||
{
|
||||
Mod coloredDamageTypes = GetInstance<CalamityMod>().coloredDamageTypes;
|
||||
Mod coloredDamageTypes = ExternalMods.coloredDamageTypes;
|
||||
if (coloredDamageTypes is null)
|
||||
return;
|
||||
|
||||
@@ -1319,9 +1318,9 @@ namespace CalamityMod
|
||||
private static void RegisterWorldInfoIcon(Mod luminance, string texturePath, string hoverTextKey, Func<WorldFileData, bool> shouldAppear, byte priority)
|
||||
=> luminance.Call("RegisterWorldInfoIcon", texturePath, hoverTextKey, shouldAppear, priority);
|
||||
|
||||
public static void LuminanceSupport()
|
||||
private static void LuminanceSupport()
|
||||
{
|
||||
Mod luminance = GetInstance<CalamityMod>().luminance;
|
||||
Mod luminance = ExternalMods.luminance;
|
||||
if (luminance is null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
|
||||
{
|
||||
CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/EidolonWyrm_Bestiary",
|
||||
PortraitPositionXOverride = 40
|
||||
};
|
||||
value.Position.X += 40;
|
||||
@@ -419,8 +418,19 @@ namespace CalamityMod.NPCs.Abyss
|
||||
return null;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
{
|
||||
return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType<EidolonWyrmBody>()].Value, TextureAssets.Npc[ModContent.NPCType<EidolonWyrmBodyAlt>()].Value, 2, 26, 0.6f, new Vector2(70, 30), 2, 20);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
return;
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
{
|
||||
|
||||
@@ -133,9 +133,9 @@ namespace CalamityMod.NPCs.Abyss
|
||||
NPC.position.Y = NPC.position.Y + targetYDirection;
|
||||
|
||||
if (targetXDirection < 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
else if (targetXDirection > 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
else if (targetXDirection > 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 769 B After Width: | Height: | Size: 442 B |
@@ -133,9 +133,9 @@ namespace CalamityMod.NPCs.Abyss
|
||||
NPC.position.Y = NPC.position.Y + targetYDirection;
|
||||
|
||||
if (targetXDirection < 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
else if (targetXDirection > 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
else if (targetXDirection > 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 743 B After Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 245 B |
|
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 233 B |
@@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.Abyss
|
||||
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
|
||||
{
|
||||
Scale = 0.75f,
|
||||
CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/GulperEel_Bestiary",
|
||||
PortraitPositionXOverride = 40,
|
||||
PortraitPositionYOverride = 20
|
||||
};
|
||||
@@ -157,9 +156,9 @@ namespace CalamityMod.NPCs.Abyss
|
||||
}
|
||||
|
||||
if (NPC.velocity.X < 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
else if (NPC.velocity.X > 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
else if (NPC.velocity.X > 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
|
||||
if (Main.player[NPC.target].dead)
|
||||
NPC.TargetClosest(false);
|
||||
@@ -339,8 +338,20 @@ namespace CalamityMod.NPCs.Abyss
|
||||
return null;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
{
|
||||
Texture2D mainBody = TextureAssets.Npc[ModContent.NPCType<GulperEelBodyAlt>()].Value;
|
||||
return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, [TextureAssets.Npc[ModContent.NPCType<GulperEelBody>()].Value, mainBody, mainBody], 3, 26, 0.3f, new Vector2(0, 20), 3, 10, 0, 0.1f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
return;
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
{
|
||||
|
||||