Author SHA1 Message Date
Ozzatron 738d39521d Version bump to 2.0.2.003 2023-04-06 10:51:29 -04:00
Ozzatron 9b467fca0f Manual copy over of the following major bug fixes for a patch release:
- The dash hotkey bug(s)
- Shield of the High Ruler going sicko mode
- Exo Box hotkey bug
2023-04-06 10:51:29 -04:00
8642 changed files with 173293 additions and 264570 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
patreon: CalamityMod
patreon: Fabsol
-64
View File
@@ -1,64 +0,0 @@
# Maintenance notes:
# - change dotnet-version to 8.0.x once tML updates (keep doing this so long as tML updates .NET),
# - if/when we un-ignore the .csproj, get rid of creating one in this script.
name: .NET Linter
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: |
touch CalamityMod.csproj
echo '<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\tModLoader.targets" />
<PropertyGroup>
<AssemblyName>CalamityMod</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.5" />
</ItemGroup>
</Project>' > CalamityMod.csproj
dotnet restore
- name: Pull TML
run: |
cd ..
mkdir ./tmod
touch tModLoader.targets
echo '<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project=".\tmod\tMLMod.targets" />
</Project>' > tModLoader.targets
cd ./tmod
wget https://github.com/tModLoader/tModLoader/releases/latest/download/tModLoader.zip
unzip tModLoader.zip
cd ..
cd ./CalamityMod
- name: Lint
run: |
dotnet format style CalamityMod.csproj --verify-no-changes
+2 -1
View File
@@ -3,7 +3,9 @@ cronpull.sh
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
*.csproj
*.sln
Properties/
# User-specific files
*.suo
@@ -305,4 +307,3 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
/Projectiles/Ranged/BrimstoneRound.png
+11 -97
View File
@@ -1,23 +1,22 @@
using Microsoft.Xna.Framework.Graphics;
using System.Reflection;
using System;
using Terraria.Graphics.Effects;
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralDesertSurfaceBGStyle : ModSurfaceBackgroundStyle
{
internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic);
internal static readonly FieldInfo scAdjField = typeof(Main).GetField("scAdj", BindingFlags.Instance | BindingFlags.NonPublic);
internal static readonly FieldInfo COSBMAplhaField = typeof(Main).GetField("ColorOfSurfaceBackgroundsModified", BindingFlags.Static | BindingFlags.NonPublic);
readonly int CloseBGYOffset = 475;
readonly int MiddleBGYOffset = 475;
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
b -= 75f;
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
@@ -34,90 +33,5 @@ namespace CalamityMod.Backgrounds
}
}
}
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceHorizon");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralDesertSurfaceFar");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Skies/AstralDesertSurfaceMiddle");
public override bool PreDrawCloseBackground(SpriteBatch spriteBatch)
{
//Please see AstralSurfaceBGStyle for comments, code is pretty much identical here
float screenOff = (float)screenOffField.GetValue(Main.instance);
float scAdj = (float)scAdjField.GetValue(Main.instance);
Color COSBMAplha = (Color)COSBMAplhaField.GetValue(null);
Color ColorOfSurfaceBackgroundsModified = new Color(63, 51, 90, COSBMAplha.A);
bool canBGDraw = false;
if ((!Main.remixWorld || (Main.gameMenu && !WorldGen.remixWorldGen)) && (!WorldGen.remixWorldGen || !WorldGen.drunkWorldGen))
canBGDraw = true;
if (Main.mapFullscreen)
canBGDraw = false;
int offset = 30;
if (Main.gameMenu)
offset = 0;
if (WorldGen.drunkWorldGen)
offset = -180;
float surfacePosition = (float)Main.worldSurface;
if (surfacePosition == 0f)
surfacePosition = 1f;
float screenPosition = Main.screenPosition.Y + (float)(Main.screenHeight / 2) - 600f;
double backgroundTopMagicNumber = (0f - screenPosition + screenOff / 2f) / (surfacePosition * 16f);
float bgGlobalScaleMultiplier = 2f;
int pushBGTopHack;
int offset2 = -180;
int menuOffset = 0;
if (Main.gameMenu)
{
menuOffset -= offset2;
}
pushBGTopHack = menuOffset;
pushBGTopHack += offset;
pushBGTopHack += offset2;
if (canBGDraw)
{
var bgScale = 1.25f;
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);
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)
bgTopY = 320 + pushBGTopHack;
var bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
bgScale = 1.31f;
bgParallax = 0.43;
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
bgScale *= bgGlobalScaleMultiplier;
bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceClose.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)
{
bgTopY = 400 + pushBGTopHack;
bgStartX -= 80;
}
bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
}
return false;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 18 KiB

+7 -122
View File
@@ -1,25 +1,18 @@
using Microsoft.Xna.Framework.Graphics;
using System.Reflection;
using System;
using Terraria.Graphics.Effects;
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Terraria.GameContent.UI.States;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralSnowSurfaceBGStyle : ModSurfaceBackgroundStyle
{
internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic);
internal static readonly FieldInfo scAdjField = typeof(Main).GetField("scAdj", BindingFlags.Instance | BindingFlags.NonPublic);
internal static readonly FieldInfo COSBMAplhaField = typeof(Main).GetField("ColorOfSurfaceBackgroundsModified", BindingFlags.Static | BindingFlags.NonPublic);
readonly int FrontBGYOffset = 275;
readonly int CloseBGYOffset = 175;
readonly int MiddleBGYOffset = 475;
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
@@ -36,113 +29,5 @@ namespace CalamityMod.Backgrounds
}
}
}
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceHorizon");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceFar");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Skies/AstralSnowSurfaceMiddle");
public override bool PreDrawCloseBackground(SpriteBatch spriteBatch)
{
//Please see AstralSurfaceBGStyle for comments, code is pretty much identical here
float screenOff = (float)screenOffField.GetValue(Main.instance);
float scAdj = (float)scAdjField.GetValue(Main.instance);
Color COSBMAplha = (Color)COSBMAplhaField.GetValue(null);
Color ColorOfSurfaceBackgroundsModified = new Color(63, 51, 90, COSBMAplha.A);
bool canBGDraw = false;
if ((!Main.remixWorld || (Main.gameMenu && !WorldGen.remixWorldGen)) && (!WorldGen.remixWorldGen || !WorldGen.drunkWorldGen))
canBGDraw = true;
if (Main.mapFullscreen)
canBGDraw = false;
int offset = 30;
if (Main.gameMenu)
offset = 0;
if (WorldGen.drunkWorldGen)
offset = -180;
float surfacePosition = (float)Main.worldSurface;
if (surfacePosition == 0f)
surfacePosition = 1f;
float screenPosition = Main.screenPosition.Y + (float)(Main.screenHeight / 2) - 600f;
double backgroundTopMagicNumber = (0f - screenPosition + screenOff / 2f) / (surfacePosition * 16f);
float bgGlobalScaleMultiplier = 2f;
int pushBGTopHack;
int offset2 = -180;
int menuOffset = 0;
if (Main.gameMenu)
{
menuOffset -= offset2;
}
pushBGTopHack = menuOffset;
pushBGTopHack += offset;
pushBGTopHack += offset2;
if (canBGDraw)
{
var bgScale = 1.25f;
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);
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)
bgTopY = 320 + pushBGTopHack;
var bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
bgScale = 1.31f;
bgParallax = 0.43;
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
bgScale *= bgGlobalScaleMultiplier;
bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.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)
{
bgTopY = 400 + pushBGTopHack;
bgStartX -= 80;
}
bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
bgScale = 1.34f;
bgParallax = 0.49;
bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
bgScale *= bgGlobalScaleMultiplier;
bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.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)
{
bgTopY = 480 + pushBGTopHack;
bgStartX -= 120;
}
bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+11 -128
View File
@@ -1,24 +1,22 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System.Reflection;
using System;
using Terraria.Graphics.Effects;
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralSurfaceBGStyle : ModSurfaceBackgroundStyle
{
internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic);
internal static readonly FieldInfo scAdjField = typeof(Main).GetField("scAdj", BindingFlags.Instance | BindingFlags.NonPublic);
internal static readonly FieldInfo COSBMAplhaField = typeof(Main).GetField("ColorOfSurfaceBackgroundsModified", BindingFlags.Static | BindingFlags.NonPublic);
readonly int FrontBGYOffset = 275; //Offsets for the height positioning. Make these 0 for backgrounds that want to be the same as treeline backgrounds (backgrounds that have the front 3 layers as trees)
readonly int CloseBGYOffset = 175;
readonly int MiddleBGYOffset = 475;
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
scale *= 0.75f;
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
@@ -35,120 +33,5 @@ namespace CalamityMod.Backgrounds
}
}
}
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceHorizon"); //5th layer (Horizon)
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceFar"); //4th layer (Far)
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Skies/AstralSurfaceMiddle"); //Fallback texture, not nessesarily needed since predraw returns false
public override bool PreDrawCloseBackground(SpriteBatch spriteBatch) //Taken from vanilla to draw the front 3 layers, edited to fit tmod and astral background needs
{
float screenOff = (float)screenOffField.GetValue(Main.instance);
float scAdj = (float)scAdjField.GetValue(Main.instance);
Color COSBMAplha = (Color)COSBMAplhaField.GetValue(null);
Color ColorOfSurfaceBackgroundsModified = new Color(63, 51, 90, COSBMAplha.A); //Astral Biome Coloration with the alpha as the background fade
bool canBGDraw = false;
if ((!Main.remixWorld || (Main.gameMenu && !WorldGen.remixWorldGen)) && (!WorldGen.remixWorldGen || !WorldGen.drunkWorldGen))
canBGDraw = true;
if (Main.mapFullscreen)
canBGDraw = false;
int offset = 30;
if (Main.gameMenu)
offset = 0;
if (WorldGen.drunkWorldGen)
offset = -180;
float surfacePosition = (float)Main.worldSurface;
if (surfacePosition == 0f)
surfacePosition = 1f;
float screenPosition = Main.screenPosition.Y + (float)(Main.screenHeight / 2) - 600f;
double backgroundTopMagicNumber = (0f - screenPosition + screenOff / 2f) / (surfacePosition * 16f);
float bgGlobalScaleMultiplier = 2f;
int pushBGTopHack;
int offset2 = -180;
int menuOffset = 0;
if (Main.gameMenu)
{
menuOffset -= offset2;
}
pushBGTopHack = menuOffset;
pushBGTopHack += offset;
pushBGTopHack += offset2; //Offsets to the background placement
if (canBGDraw) //If the background can draw (player is not in a remix world or is not in a map). This can probably be removed since backgrounds already go through these checks
{
//3rd layer (Middle)
var bgScale = 1.25f; //Scale of the furthest of the closest background layers (3rd layer)
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
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)
bgTopY = 320 + pushBGTopHack; //increases the height in the main menu
var bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
//2nd layer (Close)
//Repeat of above with slight changes to variables
bgScale = 1.31f;
bgParallax = 0.43;
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
bgScale *= bgGlobalScaleMultiplier;
bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.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)
{
bgTopY = 400 + pushBGTopHack;
bgStartX -= 80; //the initial postion of where the background starts in the main menu is pushed back to not be directly ontop, mostly for tree bgs that use the same treeline texture but faded
}
bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
//1st layer (Front)
//Repeat of above with slight changes to variables
bgScale = 1.34f;
bgParallax = 0.49;
bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
bgScale *= bgGlobalScaleMultiplier;
bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.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)
{
bgTopY = 480 + pushBGTopHack;
bgStartX -= 120;
}
bgLoops = Main.screenWidth / bgWidthScaled + 2;
if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0)
{
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);
}
}
}
return false; //Stop the drawing of the base close background texture (note: does NOT stop the drawing of the Middle and Far textures because tmodloader is slight stupid :blushing:)
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 18 KiB

+37
View File
@@ -0,0 +1,37 @@
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralSurfaceFogBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
scale *= 0.75f;
return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
{
fades[i] += transitionSpeed;
if (fades[i] > 1f)
fades[i] = 1f;
}
else
{
fades[i] -= transitionSpeed;
if (fades[i] < 0f)
fades[i] = 0f;
}
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

+3 -4
View File
@@ -1,5 +1,4 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
@@ -7,8 +6,8 @@ namespace CalamityMod.Backgrounds
{
public override void FillTextureArray(int[] textureSlots)
{
for (int i = 0; i <= 4; i++)
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot(i == 4 ? "CalamityMod/Backgrounds/AstralUG" + i.ToString() + "_" + Main.hellBackStyle : "CalamityMod/Backgrounds/AstralUG" + i.ToString());
for (int i = 0; i <= 3; i++)
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG" + i.ToString());
}
}
}
+1 -1
View File
@@ -10,4 +10,4 @@ namespace CalamityMod.Backgrounds
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG" + i.ToString());
}
}
}
}
+185 -307
View File
@@ -1,28 +1,25 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.NPCs.CeaselessVoid;
using CalamityMod.NPCs.CeaselessVoid;
using CalamityMod.NPCs.Crabulon;
using CalamityMod.NPCs.ExoMechs.Apollo;
using CalamityMod.NPCs.ExoMechs.Artemis;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.Ravager;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.Yharon;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon.MirrorofKalandraMinions;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Projectiles.DraedonsArsenal;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
using CalamityMod.NPCs.ProfanedGuardians;
namespace CalamityMod.Balancing
{
@@ -38,13 +35,7 @@ namespace CalamityMod.Balancing
// into one single resist that may have to be split later.
internal static void Load()
{
// 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);
// Declare specific filters.
bool BigGaelsSkullFilter(Projectile p) =>
p.type == ProjectileType<GaelSkull>() && p.ai[1] == 1;
bool DragonRageFilter(Projectile p) =>
p.type == ProjectileType<DragonRageStaff>() || p.type == ProjectileType<DragonRageFireball>() || (p.type == ProjectileType<FuckYou>() && p.CountsAsClass<MeleeDamageClass>());
@@ -54,6 +45,12 @@ namespace CalamityMod.Balancing
bool MushroomSpearFilter(Projectile p) =>
p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear;
bool TrueNightsEdgeFilter(Projectile p) =>
p.type == ProjectileID.NightBeam && Main.player[p.owner].ActiveItem().type == ItemID.TrueNightsEdge;
bool TerraBladeFilter(Projectile p) =>
p.type == ProjectileID.TerraBeam && Main.player[p.owner].ActiveItem().type == ItemID.TerraBlade;
bool SpectreMaskSetBonusFilter(Projectile p) =>
p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt;
@@ -62,303 +59,213 @@ namespace CalamityMod.Balancing
UniversalBalancingChanges = new List<IBalancingRule[]>()
{
// Nerf Crystal bullet shards by 45%
// Currently crystal bullet projectiles deal 50% of the bullet's damage which is absurd in vanilla, this nerfs them to 27.5%
Do(new ProjectileResistBalancingRule(0.55f, ProjectileID.CrystalShard)),
// Nerf Sky Dragon's Fury's alt fire projectiles due to its strong primary fire buff.
// TODO -- Vanilla 1.4 already nerfs the projectiles to 0.5x, so this nerf is disabled for now.
// The multiplier can be changed as needed.
// Do(new ProjectileSpecificRequirementBalancingRule(0.25f, MonkStaffT3Filter)),
// Nerf Luminite Arrow trails by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.MoonlordArrowTrail)),
// Nerf Seedler seeds by 25%.
Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SeedlerNut, ProjectileID.SeedlerThorn)),
// Nerf Seedler seeds by 66.6%.
Do(new ProjectileResistBalancingRule(1f / 3f, ProjectileID.SeedlerNut, ProjectileID.SeedlerThorn)),
// Nerf Cursed Dart flames by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)),
// Nerf True Night's Edge projectiles by 33% to cancel out the 1.5x multiplier it gets.
Do(new ProjectileSpecificRequirementBalancingRule(1f / 3f * 2f, TrueNightsEdgeFilter)),
// Nerf Terra Blade projectiles by 33% to cancel out the 1.5x multiplier it gets.
Do(new ProjectileSpecificRequirementBalancingRule(1f / 3f * 2f, TerraBladeFilter)),
// Nerf Mushroom Spear projectiles by 50%.
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)),
// Nerf Spectre Mask set bonus projectiles by 30%.
Do(new ProjectileSpecificRequirementBalancingRule(0.7f, SpectreMaskSetBonusFilter)),
};
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
#region Desert Scourge
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DesertScourgeIDs, Do(ResistTrueMelee(0.5f))));
#endregion
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DesertScourgeIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
#endregion Desert Scourge
#region Crabulon
// 50% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.5f)));
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), new TrueMeleeResistBalancingRule(0.5f)));
#endregion
#region Brain of Cthulhu: Creepers
// 50% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.5f))));
#region Brain of Cthulhu / Creepers
// 50% resist to Demon Scythe.
// 50% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new TrueMeleeResistBalancingRule(0.5f))));
// 50% resist to Demon Scythes.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
#endregion
#endregion Brain of Cthulhu / Creepers
#region Eater of Worlds
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(ResistTrueMelee(0.5f))));
// 50% resist to Demon Scythe.
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
// 50% resist to Demon Scythes.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
// 40% resist to Sky Glaze.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<StickyFeather>()))));
#endregion
// 30% resist to Jester Arrows
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileID.JestersArrow))));
#endregion Eater of Worlds
#region The Perforators
// 50% resist to true melee
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.PerforatorIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
#endregion The Perforators
#region The Aquatic Scourge
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.PerforatorIDs, Do(ResistTrueMelee(0.5f))));
#endregion
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
#region Wall of Flesh
// 40% resist to Corro/Crimslime Staff.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.WallofFleshEye, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CrimslimeMinion>(), ProjectileType<CorroslimeMinion>()))));
#endregion
#region Aquatic Scourge
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(ResistTrueMelee(0.5f))));
// 50% resist to Adamantite Throwing Axe's lightning.
// Twisting Thunder and Gael's Greatsword use this projectile too, but they are far beyond progression, so who cares!
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
// 50% resist to Dormant Brimseeker.
// 50% resist to Dormant Brimseekers.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
// 50% resist to Mounted Scanner.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<MountedScannerLaser>()))));
// 40% resist to Cryophobia.
// 40% resist to Cryophobia
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
// 40% resist to SHPC.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<SHPExplosion>()))));
// 30% resist to Meowthrower.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
// 25% resist to Snowstorm Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
#endregion
#endregion The Aquatic Scourge
#region The Destroyer
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
// 50% resist to Adamantite Throwing Axe's lightning.
// See Aquatic Scourge comment.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
// 50% resist to Aftershock's rocks.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AftershockRock>()))));
// 50% resist to Avalanche's Ice Bombs and shards.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<IceBombFriendly>(), ProjectileType<FrostShardFriendly>()))));
// 50% resist to Dormant Brimseeker.
// 50% resist to Dormant Brimseekers.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
// 45% resist to Mounted Scanner.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<MountedScannerLaser>()))));
// 40% resist to Cryophobia
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
// 40% resist to Meowthrower.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<MeowFire>()))));
// 15% resist to Snowstorm Staff
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<Snowflake>()))));
// 25% resist to SHPC.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SHPExplosion>()))));
// 25% resist to Snowstorm Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
#endregion
#region Astrum Aureus
// 30% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<BallistaGreatArrow>()))));
#endregion
#endregion The Destroyer
#region Ravager
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<RavagerBody>(), new TrueMeleeResistBalancingRule(0.5f)));
// 50% resist to Aegis Blade's explosions because the true melee resist ain't enough.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
// 50% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<IcicleArrowProj>()))));
// 35% resist to Flying Dragon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
// 30% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
// 30% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<FlakKrakenProjectile>()))));
// 25% resist to Lucrecia.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<DNA>()))));
// 20% resist to The Hive.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<HiveNuke>(), ProjectileType<HiveMissile>()))));
#endregion
#endregion Ravager
#region Duke Fishron
// 20% vulnerability to The Hive's bees.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.2f, ProjectileType<BasicPlagueBee>()))));
// 25% vulnerability to Resurrection Butterfly.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.25f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
#endregion
// 35% vulnerability to Resurrection Butterfly.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
#region Empress of Light
// 25% resist to Abyss Blade's blade.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<AbyssBladeProjectile>()))));
#endregion Duke Fishron
// 20% resist to Plague Tainted SMG's drones.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<PlagueTaintedDrone>()))));
#endregion
#region Cultist
#region Lunatic Cultist
// 50% resist to Aegis Blade's explosions.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
// 25% resist to Resurrection Butterfly.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
// 35% resist to Subduction Slicer's flame pillars.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SubductionFlameburst>()))));
// 20% resist to Art Attack and Nightglow.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ArtAttackStrike>(), ProjectileID.FairyQueenMagicItemShot))));
// 20% resist to Art Attack.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ArtAttackStrike>()))));
// 20% resist to Nightglow.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FairyQueenMagicItemShot))));
#endregion
#endregion Cultist
#region Astrum Deus
// 75% resist to Plaguenades.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<PlaguenadeBee>(), ProjectileType<PlaguenadeProj>()))));
// 70% resist to Stardust Dragon Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 70% resist to Charged Blaster Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser))));
// 60% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<AuroraFire>()))));
// 55% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<FlakKrakenProjectile>()))));
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
// 35% resist to Ballistic Poison Bomb's clouds.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<BallisticPoisonCloud>()))));
// 25% resist to Resurrection Butterfly.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
// 35% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<IcicleArrowProj>()))));
// 20% resist to Cluster Fragments.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII))));
#endregion
#endregion Astrum Deus
#region Moon Lord
// 20% resist to Mercurial Tides (True Biome Blade).
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<MercurialTides>(), ProjectileType<MercurialTidesMonolith>(), ProjectileType<MercurialTidesBlast>()))));
// 20% resist to The Hive's nuke.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<HiveNuke>()))));
#endregion
#region Profaned Guardians
// 50% resist to true melee for the Defense Guardian's rocks.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<ProfanedRocks>(), ResistTrueMelee(0.5f)));
// 90% resist to the shockwave attunement from the True biome blade.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.1f, ProjectileType<MercurialTides>(), ProjectileType<MercurialTidesMonolith>(), ProjectileType<MercurialTidesBlast>()))));
#endregion
#region Providence
// 80% resist to Hell's Sun.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.2f, ProjectileType<HellsSunProj>())));
// 35% resist to Elemental Lance. This thing desperately needs a rework.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.65f, ProjectileType<SpatialSpear>(), ProjectileType<SpatialSpear2>(), ProjectileType<SpatialSpear3>(), ProjectileType<SpatialSpear4>())));
#endregion
#region Ceaseless Void: Dark Energies
#region Ceaseless Void / Dark Energies / Profaned Rocks
// 50% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), ResistTrueMelee(0.5f)));
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new TrueMeleeResistBalancingRule(0.5f)));
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<ProfanedRocks>(), new TrueMeleeResistBalancingRule(0.5f)));
// 40% resist to Stellar Torus Staff.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<StellarTorusBeam>())));
#endregion
#endregion Ceaseless Void / Dark Energies / Profaned Rocks
#region Storm Weaver
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(ResistTrueMelee(0.5f))));
// 50% resist to Dazzling Stabber Staff.
// 50% resist to true melee
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
// 50% resist to Dazzling Stabbers.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DazzlingStabber>()))));
// 50% resist to Elemental Axe.
// 50% resist to Elemental Axes.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ElementalAxeMinion>()))));
// 50% resist to Pristine Fury's alt fire.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineSecondary>()))));
// 50% resist to Pristine Fury.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineFire>()))));
// 50% resist to Tactician's Trump Card's explosions.
// 50% resist to Tactician's Trump Card explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
// 25% resist to Molten Amputator's blobs.
// 25% resist to Molten Amputator blobs.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<MoltenBlobThrown>()))));
#endregion
#endregion Storm Weaver
#region Old Duke
// 60% resist to Last Mourning.
// This will technically catch pumpkins from the Horseman's Blade but that shouldn't really matter.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<OldDuke>(), new ProjectileResistBalancingRule(0.4f, ProjectileType<MourningSkull>(), ProjectileID.FlamingJack)));
// 20% resist to Time Bolt.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<OldDuke>(), new ProjectileResistBalancingRule(0.8f, ProjectileType<TimeBoltKnife>())));
#endregion
#endregion Old Duke
#region The Devourer of Gods
// 80% resist to Wave Pounder.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.2f, ProjectileType<WavePounderBoom>()))));
// 50% resist to Eidolic Wail.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<EidolicWailSoundwave>()))));
// 35% resist to Venusian Trident's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<VenusianBolt>(), ProjectileType<VenusianExplosion>()))));
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
// 15% vulnerability to Time Bolt stealth strikes.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType<TimeBoltKnife>()))));
#endregion The Devourer of Gods
#region Yharon
// 15% resist to Time Bolt.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Yharon>(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<TimeBoltKnife>()))));
#endregion
#region Ares
#region Exo Mechs: Ares
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
// 30% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
// 25% resist to Aetherflux Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PhasedGodRay>()))));
// 20% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo))));
// 25% resist to Murasama.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<MurasamaSlash>()))));
// 20% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
@@ -366,162 +273,131 @@ namespace CalamityMod.Balancing
// 20% resist to Eclipse's Fall.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>(), ProjectileType<EclipsesFallMain>()))));
// 20% resist to Rancor.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<RancorLaserbeam>()))));
// 15% resist to Enforcer projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<EssenceFlame2>()))));
// 20% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<YharimsCrystalBeam>()))));
//55% resist to Dynamic Pursuer
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 20% resist to Zenith.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal))));
#endregion
#endregion Ares
#region Artemis and Apollo
#region Exo Mechs: Artemis and Apollo
// Artemis and Apollo have to be defined here because they aren't a pre-existing list.
// TODO -- NPC sets (mostly worm bosses) should probably be their own holding class.
int[] exoTwins = new int[] { NPCType<Artemis>(), NPCType<Apollo>() };
// 10% resist to Eclipse's Fall's mini spears.
// 10% resist to Eclipse's Fall stealth strike.
NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<EclipsesSmol>()))));
#endregion
#region Exo Mechs: Thanatos
// 10% resist to Seared Pan.
NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<SearedPanProjectile>(), ProjectileType<PanSpark>(), ProjectileType<NiceCock>()))));
#endregion Artemis and Apollo
#region Thanatos
// 50% resist to Dynamic Pursuer (the whole thing lol).
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 65% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(ResistTrueMelee(0.35f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new TrueMeleeResistBalancingRule(0.35f))));
// 65% resist to Stellar Torus Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<StellarTorusBeam>()))));
// 65% resist to The Enforcer's projectiles.
// 65% resist to Enforcer projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<EssenceFlame2>()))));
// 65% resist to The Final Dawn's lunge.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<FinalDawnThrow2>()))));
// 60% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 50% resist to Chicken Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
// 50% resist to Rancor.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<RancorLaserbeam>()))));
// 50% resist to Prismatic Breaker. (why is this more than BOTH Rancor and Yharim's Crystal?)
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PrismaticBeam>()))));
// 50% resist to Tarragon Throwing Dart's thorns. (LOL)
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TarraThornRight>()))));
// 50% resist to Tarragon Throwing Darts Thorns (LOL)
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TarraThornRight>(), ProjectileType<TarraThornTip>()))));
// 50% resist to Omicron's beam.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<OmicronBeam>()))));
// 50% resist to Vehemence skulls.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>(), ProjectileType<PrismaticBeam>()))));
// 50% resist to Vehemence's skulls.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>()))));
// 40% resist to Rancor.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<RancorLaserbeam>()))));
// 50% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<YharimsCrystalBeam>()))));
// 50% resist to Wrathwing stealth strike.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<WrathwingCinder>()))));
// 45% resist to Wrathwing's stealth strike fireballs.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<WrathwingCinder>()))));
// 40% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<YharimsCrystalBeam>()))));
// 35% resist to Prismatic Breaker's laser beam.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<PrismaticBeam>()))));
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
// 30% resist to Eclipse's Fall.
// 30% resist to Eclipse Fall.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<EclipsesFallMain>()))));
// 30% resist to Sirius.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<SiriusExplosion>()))));
// 30% resist to Ultima's rays.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<UltimaRay>()))));
// 30% resist to Dragon Scales and The Wand's tornadoes.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<InfernadoFriendly>(), ProjectileType<DragonScalesInfernado>()))));
// 25% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo))));
// 25% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
// 25% resist to Gael's Greatsword's big skulls.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter))));
// 25% resist to Godslayer Slugs.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<GodSlayerSlugProj>()))));
// 25% resist to Mirror of Kalandra's Paradoxica minion.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Paradoxica>()))));
// 25% resist to Luminite Bullets.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.MoonlordBullet))));
// 25% resist to Zenith.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal))));
// 20% resist to The Anomaly's Nanogun's bomb explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<AnomalysNanogunMPFBBoom>()))));
// 20% resist to Ariane's aura (Lilies of Finality).
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<LiliesOfFinalityAoE>()))));
// 20% resist to Blood Boiler.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BloodBoilerFire>()))));
// 20% resist to Eradicator's beams.
// 20% resist to Eradicator beams.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NebulaShot>()))));
// 20% resist to Plasma Grenade and Dynamic Pursuer's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<PlasmaGrenadeProjectile>(), ProjectileType<PlasmaGrenadeSmallExplosion>(), ProjectileType<MassivePlasmaExplosion>()))));
// 20% resist to Voltaic Climax / Void Vortex hitscan beams.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ClimaxBeam>()))));
// 15% resist to The Final Dawn's AoE sweep flames.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<FinalDawnFlame>()))));
// 20% resist to Blood Boiler fire.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BloodBoilerFire>()))));
// 15% resist to God Slayer Slugs.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<GodSlayerSlugProj>()))));
// 15% resist to Final Dawn AoE, 20% resist to Final Dawn lunge.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<FinalDawnFlame>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<FinalDawnThrow2>()))));
// 15% resist to Gruesome Eminence.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<SpiritCongregation>()))));
// 15% resist to Luminite Bullets.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileID.MoonlordBullet))));
#endregion
// 15% resist to Plasma Nades
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<PlasmaGrenadeProjectile>(), ProjectileType<PlasmaGrenadeSmallExplosion>()))));
#endregion Thanatos
#region Supreme Calamitas / Brimstone Heart
#region Supreme Calamitas: Brimstone Hearts
// 30% resist to Surge Driver's alt click comets.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<BrimstoneHeart>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<PrismComet>())));
// 30% resist to Supernova
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<BrimstoneHeart>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<SupernovaBoom>(), ProjectileType<SupernovaStealthBoom>())));
// 20% resist to Executioner's Blade stealth strikes.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<BrimstoneHeart>(), new ProjectileResistBalancingRule(0.8f, ProjectileType<ExecutionersBladeStealthProj>())));
#endregion
#region Supreme Calamitas: Soul Seekers
#region Supreme Calamitas / Soul Seekers
// 85% resist to Chicken Cannon.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.15f, ProjectileType<ChickenExplosion>())));
// 50% resist to Subsuming Vortex.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<ExoVortex>(), ProjectileType<ExoVortex2>(), ProjectileType<EnormousConsumingVortex>())));
// 40% resist to Supernova
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<SupernovaBoom>(), ProjectileType<SupernovaStealthBoom>())));
// 30% resist to Zenith.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.7f, ProjectileID.FinalFractal)));
// 30% resist to Murasama.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<MurasamaSlash>())));
// 25% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.75f, ProjectileType<YharimsCrystalBeam>())));
// 10% resist to Celestus.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<CelestusProj>(), ProjectileType<CelestusMiniScythe>())));
// 10% resist to Surge Driver's alt click comets.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<PrismComet>())));
// 10% resist to Executioner's Blade stealth strikes.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<ExecutionersBladeStealthProj>())));
// 10% resist to Surge Driver's alt click comets.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<PrismComet>())));
// 10% resist to Celestus.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<CelestusBoomerang>(), ProjectileType<Celestus2>())));
// 15% vulnerability to The Atom Splitter. (Yes, this is kinda weird, but it's what Piky asked for).
// 15% vulnerability to The Atom Splitter (Yes, this is kinda weird, but it's what Piky asked for).
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(1.15f, ProjectileType<TheAtomSplitterProjectile>(), ProjectileType<TheAtomSplitterDuplicate>())));
#endregion
#endregion Supreme Calamitas / Soul Seekers
}
internal static void Unload()
@@ -530,15 +406,17 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges = null;
}
public static void ApplyFromProjectile(NPC npc, ref NPC.HitModifiers modifiers, Projectile proj)
public static void ApplyFromProjectile(NPC npc, ref int damage, Projectile proj)
{
NPCHitContext hitContext = NPCHitContext.ConstructFromProjectile(proj);
// Apply universal balancing rules.
foreach (IBalancingRule[] balancingRules in UniversalBalancingChanges)
{
foreach (IBalancingRule balancingRule in balancingRules)
{
if (balancingRule.AppliesTo(npc, modifiers, proj))
balancingRule.ApplyBalancingChange(npc, ref modifiers);
if (balancingRule.AppliesTo(npc, hitContext))
balancingRule.ApplyBalancingChange(npc, ref damage);
}
}
@@ -550,8 +428,8 @@ namespace CalamityMod.Balancing
foreach (IBalancingRule balancingRule in balanceChange.BalancingRules)
{
if (balancingRule.AppliesTo(npc, modifiers, proj))
balancingRule.ApplyBalancingChange(npc, ref modifiers);
if (balancingRule.AppliesTo(npc, hitContext))
balancingRule.ApplyBalancingChange(npc, ref damage);
}
}
}
+44 -211
View File
@@ -2,7 +2,6 @@
{
public static class BalancingConstants
{
#region Movement
// When the relevant config is enabled: Gives the player a substantial +50% move speed boost at all times
internal static readonly float DefaultMoveSpeedBoost = 0.5f;
@@ -17,37 +16,9 @@
// This is a const because it replaces a hardcoded value in vanilla
internal const float BalloonJumpSpeedBoost = 0.75f;
// Default jump speed boost provided by Frog Leg and tinker combinations in vanilla
internal const float VanillaFrogLegJumpSpeedBoost = 1.6f;
// Sharpening Station grants this much armor penetration to melee weapons.
internal const float SharpeningStationArmorPenetration = 5f;
// Altered jump speed boost provided by Amphibian Boots via global item UpdateAccessory
internal static readonly float AmphibianBootsJumpSpeedBoost = 1f;
// Altered movement stats provided by Shadow Armor via IL edit
// This item is modified to not stack with Magiluminescence if on the ground. If in the air, it still functions.
internal static readonly float ShadowArmorRunAccelerationMultiplier = 1.25f; // Vanilla and Magi = 1.75f
internal static readonly float ShadowArmorMaxRunSpeedMultiplier = 1.05f; // Vanilla and Magi = 1.15f
internal static readonly float ShadowArmorAccRunSpeedMultiplier = 1.05f; // Vanilla and Magi = 1.15f
internal static readonly float ShadowArmorRunSlowdownMultiplier = 1.5f; // Vanilla and Magi = 1.75f
// Altered run acceleration multiplier provided by Soaring Insignia via IL edit
// This is a const because it replaces a hardcoded value in vanilla
internal const float SoaringInsigniaRunAccelerationMultiplier = 1.1f; // Vanilla = 1.75f
#endregion
#region Immunity Frames
// Default immunity frame rules
internal const int VanillaDefaultIFrames = 40;
internal const int VanillaParryIFrames = 60;
internal const int VanillaDodgeIFrames = 80;
// In vanilla, the Cross Necklace grants +40 iframes to all hits except for in PvP (where it does nothing)
// and Brand of the Inferno (where it only gives +30 instead).
internal const int CrossNecklaceIFrameBoost = 40;
internal const int CrossNecklaceIFrameBoost_Parry = 30;
#endregion
#region Dashes and Dodges
// Dash cooldowns (in frames)
internal const int UniversalDashCooldown = 30;
internal const int UniversalShieldSlamCooldown = 30;
@@ -62,26 +33,50 @@
// Dodge cooldowns (in frames)
// TODO -- Some of these could be moved to the respective item files
internal static readonly int BeltDodgeCooldownMin = 900;
internal static readonly int BeltDodgeCooldownMax = 5400;
internal static readonly int BrainDodgeCooldownMin = 900;
internal static readonly int BrainDodgeCooldownMax = 5400;
internal static readonly int AmalgamDodgeCooldownMin = 900;
internal static readonly int AmalgamDodgeCooldownMax = 5400;
internal static readonly int MirrorDodgeCooldownMin = 900;
internal static readonly int MirrorDodgeCooldownMax = 5400;
internal static readonly int DaedalusReflectCooldownMin = 900;
internal static readonly int DaedalusReflectCooldownMax = 5400;
internal static readonly int EvolutionReflectCooldownMin = 900;
internal static readonly int EvolutionReflectCooldownMax = 5400;
#endregion
internal static readonly int BeltDodgeCooldown = 5400;
internal static readonly int BrainDodgeCooldown = 5400;
internal static readonly int AmalgamDodgeCooldown = 5400;
internal static readonly int MirrorDodgeCooldown = 5400;
internal static readonly int DaedalusReflectCooldown = 5400;
internal static readonly int EvolutionReflectCooldown = 5400;
#region Damage
// Altered default damage deviation
internal const int NewDefaultDamageVariationPercent = 5;
// Internal vanilla item damage variables
internal static readonly float LeatherWhipTagDamageMultiplier = 1.08f;
internal static readonly float SnapthornTagDamageMultiplier = 1.04f;
internal static readonly float SpinalTapTagDamageMultiplier = 1.08f;
internal static readonly float FirecrackerExplosionDamageMultiplier = 2.25f; // Relative to the whip, not the summon.
internal static readonly float DurendalTagDamageMultiplier = 1.09f;
internal static readonly float MorningStarTagDamageMultiplier = 1.11f;
internal static readonly float KaleidoscopeTagDamageMultiplier = 1.12f;
// Summoner cross class nerf
internal static readonly float SummonerCrossClassNerf = 0.75f;
// Rogue stealth
// If stealth is too weak, increase this number. If stealth is too strong, decrease this number.
// This value is intentionally not readonly.
public static double UniversalStealthStrikeDamageFactor = 0.5;
internal static readonly float BaseStealthGenTime = 4f; // 4 seconds
internal static readonly float MovingStealthGenRatio = 0.5f;
// Rage
internal static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default.
internal static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(1); // Each booster is +1 second: 10, 11, 12.
internal static readonly int RageCombatDelayTime = CalamityUtils.SecondsToFrames(10);
internal static readonly int RageFadeTime = CalamityUtils.SecondsToFrames(30);
internal static readonly float DefaultRageDamageBoost = 0.35f; // +35%
// Proximity Rage
// These variables should be used in general to classify "enemies" vs "non-enemies" as well.
// See NPCUtils.IsAnEnemy
internal const int TinyHealthThreshold = 5;
internal const int TinyDamageThreshold = 5;
// If an enemy has more health than this, they are considered an enemy even if they have 0 contact damage
internal const int NoContactDamageHealthThreshold = 3000;
internal const int UnreasonableHealthThreshold = 25000000; // 25 million
// Adrenaline
internal static readonly float AdrenalineDamageBoost = 2f; // +200%
internal static readonly float AdrenalineDamagePerBooster = 0.15f; // +15%
internal static readonly float FullAdrenalineDR = 0.5f; // 50%
internal static readonly float AdrenalineDRPerBooster = 0.05f; // +5% per booster
// Summon damage bonuses counting less towards "scales with your best class"
internal static readonly float SummonAllClassScalingFactor = 0.75f;
@@ -90,168 +85,6 @@
internal static readonly float MinimumAllowedAttackSpeed = 0.25f;
internal static readonly float MaximumAllowedAttackSpeed = 10f;
// Internal vanilla whip damage variables
internal static readonly float LeatherWhipTagDamageMultiplier = 1.08f;
internal static readonly float SnapthornTagDamageMultiplier = 1.04f;
internal static readonly float SpinalTapTagDamageMultiplier = 1.08f;
internal static readonly float FirecrackerExplosionDamageMultiplier = 2f; // Note: Lasts for 1 hit
internal static readonly float CoolWhipTagDamageMultiplier = 1.08f;
internal static readonly float DurendalTagDamageMultiplier = 1.09f;
internal static readonly float MorningStarTagDamageMultiplier = 1.11f;
internal static readonly float KaleidoscopeTagDamageMultiplier = 1.12f;
// Sharpening Station grants this much armor penetration to melee weapons.
internal const float SharpeningStationArmorPenetration = 5f;
// Beetle Scale Mail stats
internal static readonly float BeetleScaleMailMeleeDamagePerBeetle = 0.1f;
internal static readonly float BeetleScaleMailMeleeSpeedPerBeetle = 0.05f;
// Nebula Armor Damage Booster
internal static readonly float NebulaDamagePerBooster = 0.075f; // 0.15f in vanilla
// Nebula Armor Mana Booster
// nothing here yet
#endregion
#region Life Steal
// Life steal cap
internal static readonly int LifeStealCap = 100;
// Life steal accessories require a more strict cooldown due to their ease of use and global application
internal static readonly float LifeStealAccessoryCooldownMultiplier = 3f;
// Life steal cooldown multipliers used for armor set bonuses
internal static readonly float LifeStealSetBonusCooldownMultiplier = 2f;
internal static readonly float LifeStealReaverTankCooldownMultiplier = 4f;
// The range was buffed in vanilla from 1200 to 3000 in 1.4.4, and I agree with that decision
internal static readonly float LifeStealRange = 3000f;
// Life steal caps (aka, how much life steal the player is allowed before it goes on cooldown)
internal static readonly float LifeStealCap_Classic = 60f;
internal static readonly float LifeStealCap_Expert = 50f;
internal static readonly float LifeStealCap_Revengeance = 40f;
internal static readonly float LifeStealCap_Death = 30f;
// Master nerfs the life steal cap by 10, resulting in 40 in non-Rev Master, 30 in Rev Master, and 20 in Death Master
internal static readonly float LifeStealCapReduction_Master = 10f;
// The base life steal cooldowns from vanilla
internal static readonly float LifeStealRecoveryRate_Classic = 0.6f;
internal static readonly float LifeStealRecoveryRate_Expert = 0.5f;
// The calculations below show the time (in frames) for 10 life steal cooldown to recover in each difficulty
// Classic: 10 / 0.2 = 50
// Expert: 10 / 0.15 = 66.667
// Revengeance: 10 / 0.125 = 80
// Death: 10 / 0.1 = 100
// Master: 10 / 0.1 = 100
// Revengeance Master: 10 / 0.075 = 133.333
// Death Master: 10 / 0.05 = 200
// Nerfs the life steal recovery rate in Classic from 0.6/s to 0.2/s
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f;
// Nerfs the life steal recovery rate in Expert from 0.5/s to 0.15/s
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f;
// Nerfs the life steal recovery rate in Revengeance from 0.5/s to 0.125/s
internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.375f;
// Nerfs the life steal recovery rate in Death from 0.5/s to 0.1/s
internal static readonly float LifeStealRecoveryRateReduction_Death = 0.4f;
// Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.1/s in non-Rev Master, 0.075/s in Rev Master, and 0.05/s in Death Master
internal static readonly float LifeStealRecoveryRateReduction_Master = 0.05f;
#endregion
#region Rogue Base Stats
// If stealth is too weak, increase this number. If stealth is too strong, decrease this number.
// This value is intentionally not readonly.
public static double UniversalStealthStrikeDamageFactor = 0.42;
// Shade 23/10/2023: So stealth apparently was indeed way too strong after the bugfix with nearly every weapon being way stronger than before
// due to Flawless now working properly and thus the stealth factor was changed back to 0.42 from 0.5.
// This nerf takes feedback from various players as well as my own personal experience with testing rogue stuff today; it feels too strong and
// something needed to be done about it.
internal static readonly float BaseStealthGenTime = 4f; // 4 seconds
internal static readonly float MovingStealthGenRatio = 0.5f;
#endregion
#region Defense, Health and Mana (Armor set stuff)
// Beetle Shell's multiplicative DR is removed by Calamity. In compensation, you get this much regular DR per beetle.
internal static readonly float BeetleShellDRPerBeetle = 0.1f;
// Solar Flare Armor's multiplicative DR is removed by Calamity. In compensation, you get this much DR from having at least one solar shield up.
internal static readonly float SolarFlareShieldDR = 0.25f;
// Nebula Armor Life Regen
internal static readonly int NebulaLifeRegenPerBooster = 4; // 6 in vanilla
// Nebula Armor Mana Regen
// This value works differently than you might expect. Raising it actually nerfs the mana regeneration of Nebula Armor
// Every frame, Terraria adds 1 to a counter for each Mana Booster the player has.
// If this counter reaches the below threshold, that player gains 1 mana.
// By default, it's 6, which has the following effects:
// 1 booster = +1 mana every 6 frames = +10 mana per second
// 2 boosters = +1 mana every 3 frames = +20 mana per second
// 3 boosters = +1 mana every 2 frames = +30 mana per second
//
// Calamity just halves this, that's probably good enough.
internal static readonly int NebulaManaRegenFrameCounterThreshold = 12; // 6 in vanilla
#endregion
#region Defense Damage
internal const double DefaultDefenseDamageRatio = 0.3333;
// Defense damage floor: PHM | HM | PML
//
// Normal/Expert: 3 | 8 | 16
// Revengeance: 4 | 10 | 20
// Death Mode: 5 | 12 | 24
// Boss Rush: 25
internal static readonly int DefenseDamageFloor_NormalPHM = 3;
internal static readonly int DefenseDamageFloor_NormalHM = 8;
internal static readonly int DefenseDamageFloor_NormalPML = 16;
internal static readonly int DefenseDamageFloor_RevPHM = 4;
internal static readonly int DefenseDamageFloor_RevHM = 10;
internal static readonly int DefenseDamageFloor_RevPML = 20;
internal static readonly int DefenseDamageFloor_DeathPHM = 5;
internal static readonly int DefenseDamageFloor_DeathHM = 12;
internal static readonly int DefenseDamageFloor_DeathPML = 24;
internal static readonly int DefenseDamageFloor_BossRush = 25;
#endregion
#region Rage and Adrenaline (Rippers)
internal static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default.
internal static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(1); // Each booster is +1 second: 10, 11, 12.
internal static readonly int RageCombatDelayTime = CalamityUtils.SecondsToFrames(10);
internal static readonly int RageFadeTime = CalamityUtils.SecondsToFrames(30);
internal static readonly float DefaultRageDamageBoost = 0.35f; // +35%
internal static readonly float AdrenalineDamageBoost = 1.5f; // +150%
internal static readonly float AdrenalineDamagePerBooster = 0.2f; // +20%
internal static readonly float FullAdrenalineDR = 0.5f; // 50%
internal static readonly float AdrenalineDRPerBooster = 0.05f; // +5% per booster
internal static readonly int AdrenalinePauseAfterDamage = CalamityUtils.SecondsToFrames(1);
internal static readonly float MinimumAdrenalineLoss = 0.25f; // No matter how small a hit, you will always lose at least 25% current Adrenaline
internal static readonly float AdrenalineFalloffTinyHitHealthRatio = 0.05f; // Hits for 5% max HP or less result in less Adrenaline loss
internal static readonly float TrueMeleeRipperReductionFactor = 0.5f; // True melee benefits less from rippers to prevent excessive melting.
#endregion
// TODO -- NPC classification is not done consistently with predictable thresholds.
// These variables should be used in general to classify "enemies" vs "non-enemies" as well.
// See NPCUtils.IsAnEnemy
#region NPC Classification
internal const int TinyHealthThreshold = 5;
internal const int TinyDamageThreshold = 5;
// If an enemy has more health than this, they are considered an enemy even if they have 0 contact damage
internal const int NoContactDamageHealthThreshold = 3000;
internal const int UnreasonableHealthThreshold = 25000000; // 25 million
#endregion
// TODO -- Add all balance related constants here that don't belong in other files.
// Review all constants and static readonlys in the entire mod to find things to add.
}
+52 -72
View File
@@ -1,43 +1,31 @@
using System;
using System.Linq;
using System.Linq;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Balancing
{
public interface IBalancingRule
{
bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile);
bool AppliesTo(NPC npc, NPCHitContext hitContext);
void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers);
void ApplyBalancingChange(NPC npc, ref int damage);
}
public class ClassResistBalancingRule : IBalancingRule
{
public float DamageMultiplier;
public DamageClass ApplicableClass;
public ClassResistBalancingRule(float damageMultiplier, DamageClass dc)
public ClassType ApplicableClass;
public ClassResistBalancingRule(float damageMultiplier, ClassType classType)
{
DamageMultiplier = damageMultiplier;
ApplicableClass = dc;
ApplicableClass = classType;
}
public bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile)
public bool AppliesTo(NPC npc, NPCHitContext hitContext)
{
// E.g. so that a melee resist also applies to MeleeNoSpeed, TrueMelee, and TrueMeleeNoSpeed.
return modifiers.DamageType.CountsAsClass(ApplicableClass);
return hitContext.Class == ApplicableClass;
}
public void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers)
{
// Changed from FinalDamage to SourceDamage to ensure that resists will also apply to on-hit effects.
// See this message in the Calamity Dev Discord for full rationale.
// https://discord.com/channels/458428222061936650/459003706575421440/1128002932000960592
//
// There is one limitation to this approach. Flat bonus damage, aka whip tags, won't be reduced.
// In the case that summons or whips need to be resisted, the best move is to consider them entirely separately.
modifiers.SourceDamage *= DamageMultiplier;
}
public void ApplyBalancingChange(NPC npc, ref int damage) => damage = (int)(damage * DamageMultiplier);
}
public class NPCSpecificRequirementBalancingRule : IBalancingRule
@@ -49,11 +37,11 @@ namespace CalamityMod.Balancing
Requirement = npcApplicationRequirement;
}
public bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile) => Requirement(npc);
public bool AppliesTo(NPC npc, NPCHitContext hitContext) => Requirement(npc);
// This "balancing" rule doesn't actually perform any changes. It simply serves as a means of enforcing NPC-specific requirements, and should be used only as a filter.
// As such, this method is empty.
public void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers) { }
public void ApplyBalancingChange(NPC npc, ref int damage) { }
}
public class PierceResistBalancingRule : IBalancingRule
@@ -61,21 +49,9 @@ namespace CalamityMod.Balancing
public float DamageMultiplier;
public PierceResistBalancingRule(float damageMultiplier) => DamageMultiplier = damageMultiplier;
public bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile)
{
return projectile is not null && (projectile.maxPenetrate > 1 || projectile.maxPenetrate == -1);
}
public bool AppliesTo(NPC npc, NPCHitContext hitContext) => hitContext.Pierce > 1 || hitContext.Pierce == -1;
public void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers)
{
// Changed from FinalDamage to SourceDamage to ensure that resists will also apply to on-hit effects.
// See this message in the Calamity Dev Discord for full rationale.
// https://discord.com/channels/458428222061936650/459003706575421440/1128002932000960592
//
// There is one limitation to this approach. Flat bonus damage, aka whip tags, won't be reduced.
// In the case that summons or whips need to be resisted, the best move is to consider them entirely separately.
modifiers.SourceDamage *= DamageMultiplier;
}
public void ApplyBalancingChange(NPC npc, ref int damage) => damage = (int)(damage * DamageMultiplier);
}
public class ProjectileResistBalancingRule : IBalancingRule
@@ -88,21 +64,17 @@ namespace CalamityMod.Balancing
ApplicableProjectileTypes = projTypes;
}
public bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile)
public bool AppliesTo(NPC npc, NPCHitContext hitContext)
{
return projectile is not null && ApplicableProjectileTypes.Contains(projectile.type);
if (hitContext.DamageSource != DamageSourceType.FriendlyProjectile)
return false;
if (!ApplicableProjectileTypes.Contains(hitContext.ProjectileType ?? -1))
return false;
return true;
}
public void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers)
{
// Changed from FinalDamage to SourceDamage to ensure that resists will also apply to on-hit effects.
// See this message in the Calamity Dev Discord for full rationale.
// https://discord.com/channels/458428222061936650/459003706575421440/1128002932000960592
//
// There is one limitation to this approach. Flat bonus damage, aka whip tags, won't be reduced.
// In the case that summons or whips need to be resisted, the best move is to consider them entirely separately.
modifiers.SourceDamage *= DamageMultiplier;
}
public void ApplyBalancingChange(NPC npc, ref int damage) => damage = (int)(damage * DamageMultiplier);
}
public class ProjectileSpecificRequirementBalancingRule : IBalancingRule
@@ -116,24 +88,17 @@ namespace CalamityMod.Balancing
Requirement = projApplicationRequirement;
}
public bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile)
public bool AppliesTo(NPC npc, NPCHitContext hitContext)
{
return projectile is not null && Requirement(projectile);
if (hitContext.DamageSource != DamageSourceType.FriendlyProjectile)
return false;
return Requirement(Main.projectile[hitContext.ProjectileIndex.Value]);
}
public void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers)
{
// Changed from FinalDamage to SourceDamage to ensure that resists will also apply to on-hit effects.
// See this message in the Calamity Dev Discord for full rationale.
// https://discord.com/channels/458428222061936650/459003706575421440/1128002932000960592
//
// There is one limitation to this approach. Flat bonus damage, aka whip tags, won't be reduced.
// In the case that summons or whips need to be resisted, the best move is to consider them entirely separately.
modifiers.SourceDamage *= DamageMultiplier;
}
public void ApplyBalancingChange(NPC npc, ref int damage) => damage = (int)(damage * DamageMultiplier);
}
// TODO -- this rule type should be deleted once stealth is finished as its own class
public class StealthStrikeBalancingRule : IBalancingRule
{
public float DamageMultiplier;
@@ -144,20 +109,35 @@ namespace CalamityMod.Balancing
ApplicableProjectileTypes = projTypes;
}
public bool AppliesTo(NPC npc, NPC.HitModifiers modifiers, Projectile? projectile)
public bool AppliesTo(NPC npc, NPCHitContext hitContext)
{
return projectile is not null && (modifiers.DamageType == StealthDamageClass.Instance || projectile.Calamity().stealthStrike);
if (hitContext.DamageSource != DamageSourceType.FriendlyProjectile)
return false;
if (!ApplicableProjectileTypes.Contains(hitContext.ProjectileType ?? -1))
return false;
return hitContext.IsStealthStrike;
}
public void ApplyBalancingChange(NPC npc, ref NPC.HitModifiers modifiers)
public void ApplyBalancingChange(NPC npc, ref int damage) => damage = (int)(damage * DamageMultiplier);
}
public class TrueMeleeResistBalancingRule : IBalancingRule
{
public float DamageMultiplier;
public TrueMeleeResistBalancingRule(float damageMultiplier)
{
// Changed from FinalDamage to SourceDamage to ensure that resists will also apply to on-hit effects.
// See this message in the Calamity Dev Discord for full rationale.
// https://discord.com/channels/458428222061936650/459003706575421440/1128002932000960592
//
// There is one limitation to this approach. Flat bonus damage, aka whip tags, won't be reduced.
// In the case that summons or whips need to be resisted, the best move is to consider them entirely separately.
modifiers.SourceDamage *= DamageMultiplier;
DamageMultiplier = damageMultiplier;
}
public bool AppliesTo(NPC npc, NPCHitContext hitContext)
{
if (hitContext.DamageSource == DamageSourceType.FriendlyProjectile)
return Main.projectile[hitContext.ProjectileIndex.Value].IsTrueMelee();
return hitContext.DamageSource == DamageSourceType.TrueMeleeSwing;
}
public void ApplyBalancingChange(NPC npc, ref int damage) => damage = (int)(damage * DamageMultiplier);
}
}
+8
View File
@@ -0,0 +1,8 @@
namespace CalamityMod.Balancing
{
public enum DamageSourceType
{
FriendlyProjectile,
TrueMeleeSwing,
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
namespace CalamityMod.Balancing
namespace CalamityMod.Balancing
{
public struct NPCBalancingChange
{
+44
View File
@@ -0,0 +1,44 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Balancing
{
public struct NPCHitContext
{
public int Pierce;
public int Damage;
public int? ProjectileIndex;
public int? ProjectileType => ProjectileIndex.HasValue ? Main.projectile[ProjectileIndex.Value].type : (int?)null;
public bool IsStealthStrike;
public ClassType? Class;
public DamageSourceType DamageSource;
public static NPCHitContext ConstructFromProjectile(Projectile proj)
{
ClassType? classType = null;
if (proj.active)
{
if (proj.CountsAsClass<MeleeDamageClass>())
classType = ClassType.Melee;
if (proj.CountsAsClass<RangedDamageClass>())
classType = ClassType.Ranged;
if (proj.CountsAsClass<MagicDamageClass>())
classType = ClassType.Magic;
if (proj.minion)
classType = ClassType.Summon;
if (proj.CountsAsClass<RogueDamageClass>())
classType = ClassType.Rogue;
}
return new NPCHitContext()
{
Pierce = proj.penetrate,
Damage = proj.damage,
ProjectileIndex = proj.whoAmI,
Class = classType,
IsStealthStrike = proj.active && proj.Calamity().stealthStrike,
DamageSource = DamageSourceType.FriendlyProjectile
};
}
}
}
+37
View File
@@ -0,0 +1,37 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceFogBGStyle");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Surface Fog");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950;
}
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
}
}
}
@@ -0,0 +1,44 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralBiomeSurface : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Surface");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneSnow && !player.ZoneDesert;
}
public override void SpecialVisuals(Player player, bool isActive)
{
if (SkyManager.Instance["CalamityMod:AstralSurface"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSurface"].IsActive())
{
if (isActive)
{
SkyManager.Instance.Activate("CalamityMod:AstralSurface");
}
else
{
SkyManager.Instance.Deactivate("CalamityMod:AstralSurface");
}
}
}
}
}
@@ -0,0 +1,45 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralDesertBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralDesertSurfaceBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon";
// Could use its own unique background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Desert Surface");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneDesert && !player.ZoneSnow;
}
public override void SpecialVisuals(Player player, bool isActive)
{
if (SkyManager.Instance["CalamityMod:AstralDesert"] != null && isActive != SkyManager.Instance["CalamityMod:AstralDesert"].IsActive())
{
if (isActive)
{
SkyManager.Instance.Activate("CalamityMod:AstralDesert");
}
else
{
SkyManager.Instance.Deactivate("CalamityMod:AstralDesert");
}
}
}
}
}
@@ -0,0 +1,44 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralSnowBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSnowSurfaceBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Snow Surface");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneSnow;
}
public override void SpecialVisuals(Player player, bool isActive)
{
if (SkyManager.Instance["CalamityMod:AstralSnow"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSnow"].IsActive())
{
if (isActive)
{
SkyManager.Instance.Activate("CalamityMod:AstralSnow");
}
else
{
SkyManager.Instance.Deactivate("CalamityMod:AstralSnow");
}
}
}
}
}
+16 -20
View File
@@ -1,7 +1,6 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Systems;
using CalamityMod.World;
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -11,7 +10,7 @@ namespace CalamityMod.BiomeManagers
{
public class AbyssLayer1Biome : ModBiome
{
// Keep this here even though layer one now uses a tile check, cannot be bothered to move it for now
//keep this here even though layer one now uses a tile check, cannot be bothered to move it for now
public static bool MeetsBaseAbyssRequirement(Player player, out int playerYTileCoords)
{
Point point = player.Center.ToTileCoordinates();
@@ -37,18 +36,14 @@ namespace CalamityMod.BiomeManagers
if (WeakReferenceSupport.InAnySubworld())
return false;
int abyssStartHeight = Main.remixWorld ? SulphurousSea.YStart : ((SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90);
int abyssStartHeight = (SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90;
if (Main.remixWorld)
return !player.lavaWet && !player.honeyWet && abyssPosX && playerYTileCoords < abyssStartHeight;
return !player.lavaWet && !player.honeyWet && abyssPosX && playerYTileCoords >= abyssStartHeight && playerYTileCoords <= Main.UnderworldLayer;
return !player.lavaWet && !player.honeyWet && abyssPosX && playerYTileCoords >= abyssStartHeight && playerYTileCoords <= Main.maxTilesY - 200;
}
// Temporarily use sulphur for now
//temporarily use sulphur for now
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricDepthsWater");
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer1Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
@@ -59,23 +54,24 @@ namespace CalamityMod.BiomeManagers
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer1") ?? MusicID.Desert;
return !Main.dayTime
? CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaNight") ?? MusicID.Desert // Nighttime
: CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaDay") ?? MusicID.Desert; // Daytime
}
}
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sulphuric Depths");
}
public override bool IsBiomeActive(Player player)
{
Point point = player.Center.ToTileCoordinates();
int abyssStartHeight = Main.remixWorld ? SulphurousSea.YStart : ((SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90);
int abyssStartHeight = (SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90;
if (Main.remixWorld)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && point.Y < abyssStartHeight &&
BiomeTileCounterSystem.Layer1Tiles >= 200 && !player.Calamity().ZoneAbyssLayer2 && !player.Calamity().ZoneAbyssLayer3 && !player.Calamity().ZoneAbyssLayer4;
}
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords2) && point.Y >= abyssStartHeight &&
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && point.Y >= abyssStartHeight &&
BiomeTileCounterSystem.Layer1Tiles >= 200 && !player.Calamity().ZoneAbyssLayer2 && !player.Calamity().ZoneAbyssLayer3 && !player.Calamity().ZoneAbyssLayer4;
}
}
+8 -12
View File
@@ -1,7 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Systems;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,22 +19,20 @@ namespace CalamityMod.BiomeManagers
}
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/UpperAbyssWater");
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer2Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Murky Waters");
}
public override bool IsBiomeActive(Player player)
{
if (Main.remixWorld)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer2Tiles >= 200 &&
playerYTileCoords <= SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.2f) && playerYTileCoords > SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.4f);
}
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords2) && BiomeTileCounterSystem.Layer2Tiles >= 200 &&
playerYTileCoords2 > Main.rockLayer - 10 && playerYTileCoords2 <= Main.rockLayer + Main.maxTilesY * 0.143;
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer2Tiles >= 200 &&
playerYTileCoords > Main.rockLayer - 10 && playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.143;
}
}
}
+8 -12
View File
@@ -1,7 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Systems;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,22 +19,20 @@ namespace CalamityMod.BiomeManagers
}
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/MiddleAbyssWater");
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer3Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Thermal Vents");
}
public override bool IsBiomeActive(Player player)
{
if (Main.remixWorld)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer3Tiles >= 200 &&
playerYTileCoords <= SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.4f) && playerYTileCoords > SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.6f);
}
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords2) && BiomeTileCounterSystem.Layer3Tiles >= 200 &&
playerYTileCoords2 > Main.rockLayer + Main.maxTilesY * 0.143 && playerYTileCoords2 <= Main.rockLayer + Main.maxTilesY * 0.268;
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer3Tiles >= 200 &&
playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.143 && playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.268;
}
}
}
+8 -12
View File
@@ -1,7 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Systems;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,22 +19,20 @@ namespace CalamityMod.BiomeManagers
}
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/VoidWater");
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer4Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("The Void");
}
public override bool IsBiomeActive(Player player)
{
if (Main.remixWorld)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer4Tiles >= 200 &&
playerYTileCoords <= SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.6f);
}
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords2) && BiomeTileCounterSystem.Layer4Tiles >= 200 &&
playerYTileCoords2 > Main.rockLayer + Main.maxTilesY * 0.268;
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && BiomeTileCounterSystem.Layer4Tiles >= 200 &&
playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.268;
}
}
}
@@ -11,6 +11,11 @@ namespace CalamityMod.BiomeManagers
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG"; //Probably needs a unique bg
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeLow; //Sulphurous Sea overrides it
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Acid Rain");
}
//Does this even need proper detection, the detection code is done elsewhere
/*public override bool IsBiomeActive(Player player)
{
+6 -1
View File
@@ -5,9 +5,14 @@ namespace CalamityMod.BiomeManagers
public class ArsenalLabBiome : ModBiome
{
public override string BestiaryIcon => "CalamityMod/BiomeManagers/LaboratoryIcon";
// Could use its own unique background if someone even bothers
// Could use its own unique background if someone even bothers
public override string BackgroundPath => "Terraria/Images/MapBG32";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Arsenal Labs");
}
//Does this even need proper detection, this file solely exists for a few critter entries and the detection code is done elsewhere
/*public override bool IsBiomeActive(Player player)
{
-112
View File
@@ -1,112 +0,0 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.GameContent.Events;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AstralInfectionBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle
{
get
{
if (Main.LocalPlayer.ZoneSnow) //Snow
{
return ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSnowSurfaceBGStyle");
}
else if (Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow) //Desert
{
return ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralDesertSurfaceBGStyle");
}
else //surface
{
return ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
}
}
}
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle
{
get
{
if (Main.LocalPlayer.ZoneSnow)
{
return ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle"); // Could use its own unique background
}
return ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
}
}
public override int BiomeTorchItemType => ModContent.ItemType<AstralTorch>();
public override SceneEffectPriority Priority
{
get
{
if (Main.LocalPlayer.ZoneDesert && Sandstorm.Happening && !(Main.LocalPlayer.ZoneSnow || Main.slimeRain || Main.eclipse))
{
return SceneEffectPriority.Environment;
}
else
{
return SceneEffectPriority.BiomeHigh;
}
}
}
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon";
public override string BackgroundPath
{
get
{
if (Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow)
{
//desert
return "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; // Could use its own unique background
}
else if (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight || Main.LocalPlayer.ZoneUnderworldHeight)
{
//underground
return "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; // Could use its own unique background
}
else
{
return "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
}
}
}
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override int Music
{
get
{
if (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight || Main.LocalPlayer.ZoneUnderworldHeight)
{
return CalamityMod.Instance.GetMusicFromMusicMod("AstralInfectionUnderground") ?? MusicID.Space;
}
return CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space;
}
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950;
}
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
if (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight || Main.LocalPlayer.ZoneUnderworldHeight)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); //underground
}
}
}
}
@@ -1,11 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers.BestiaryCategories
{
public class AstralCaveDesert : ModBiome //Unused, currently
{
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralCaveDesertIcon";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
}
}
@@ -1,11 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers.BestiaryCategories
{
public class AstralDesert : ModBiome
{
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
}
}
@@ -1,11 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers.BestiaryCategories
{
public class AstralIce : ModBiome //Unused, currently
{
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralIceIcon";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
}
}
@@ -1,11 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers.BestiaryCategories
{
public class AstralUnderground : ModBiome
{
public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
}
}
+7 -3
View File
@@ -1,5 +1,4 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -9,11 +8,16 @@ namespace CalamityMod.BiomeManagers
public class BrimstoneCragsBiome : ModBiome
{
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("BrimstoneCrags") ?? MusicID.Eerie;
public override int BiomeTorchItemType => ModContent.ItemType<GloomTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/BrimstoneCragsIcon";
public override string BackgroundPath => "Terraria/Images/MapBG3";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brimstone Crags");
}
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.BrimstoneCragTiles > 100 && player.ZoneUnderworldHeight;
+14 -24
View File
@@ -1,7 +1,6 @@
using System.Security.Policy;
using CalamityMod.CalPlayer;
using CalamityMod.Events;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -14,9 +13,8 @@ namespace CalamityMod.BiomeManagers
{
public class SulphurousSeaBiome : ModBiome
{
public override ModWaterStyle WaterStyle => Main.zenithWorld ? ModContent.Find<ModWaterStyle>("CalamityMod/PissWater") : ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => Main.zenithWorld ? ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/PissSeaSurfaceBGStyle") : ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/SulphurSeaSurfaceBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<SulphurousTorch>();
public override ModWaterStyle WaterStyle => CalamityWorld.getFixedBoi ? ModContent.Find<ModWaterStyle>("CalamityMod/PissWater") : ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => CalamityWorld.getFixedBoi ?ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/PissSeaSurfaceBGStyle") : ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/SulphurSeaSurfaceBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SulphurousSeaIcon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG";
@@ -30,7 +28,6 @@ namespace CalamityMod.BiomeManagers
if (!CalamityPlayer.areThereAnyDamnBosses)
{
bool acidRain = AcidRainEvent.AcidRainEventIsOngoing;
bool normalRain = Main.cloudAlpha > 0f;
// Acid Rain themes
if (acidRain)
@@ -42,24 +39,20 @@ namespace CalamityMod.BiomeManagers
// Regular Sulphur Sea themes, when Acid Rain is not occurring
else
{
if (normalRain)
{
music = CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaRain") ?? MusicID.Desert; // Normal Rain
}
else
{
music = !Main.dayTime
? CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaNight") ?? MusicID.Desert // Nighttime
: CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaDay") ?? MusicID.Desert; // Daytime
}
}
music = !Main.dayTime
? CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaNight") ?? MusicID.Desert // Nighttime
: CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSeaDay") ?? MusicID.Desert; // Daytime
}
return music;
}
}
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sulphurous Sea");
}
public override bool IsBiomeActive(Player player)
{
Point point = player.Center.ToTileCoordinates();
@@ -79,13 +72,10 @@ namespace CalamityMod.BiomeManagers
sulphurPosX = true;
}
}
if (Main.remixWorld)
return (BiomeTileCounterSystem.SulphurTiles >= 300 || (point.Y > SulphurousSea.YStart && point.Y < Main.UnderworldLayer && sulphurPosX && !WeakReferenceSupport.InAnySubworld())) && !player.Calamity().ZoneAbyss;
return (BiomeTileCounterSystem.SulphurTiles >= 300 || (point.Y < (Main.rockLayer - Main.maxTilesY / 13) && sulphurPosX && !WeakReferenceSupport.InAnySubworld())) && !player.Calamity().ZoneAbyss;
return (BiomeTileCounterSystem.SulphurTiles >= 300 || (point.Y < (Main.rockLayer - Main.maxTilesY / 13) && sulphurPosX)) && !player.Calamity().ZoneAbyss;
}
public override void SpecialVisuals(Player player, bool isActive)
{
string biomeName = "CalamityMod:SulphurSea";
+7 -4
View File
@@ -1,5 +1,4 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,14 +9,18 @@ namespace CalamityMod.BiomeManagers
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sunken Sea");
}
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.SunkenSeaTiles > 150;
+38
View File
@@ -0,0 +1,38 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class UndergroundAstralBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon";
// Could use its own unique background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfectionUnderground") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Underground");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight);
}
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
}
// Just slightly above the above-ground astral biomes.
public override float GetWeight(Player player) => 0.51f;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 437 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Alcohol Poisoning");
Description.SetDefault("You drank too much and you are now dying");
Main.debuff[Type] = true;
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 446 B

+2
View File
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Bloody Mary");
Description.SetDefault("Damage and movement speed boosted during a Blood Moon, life regen and defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

After

Width:  |  Height:  |  Size: 582 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Caribbean Rum");
Description.SetDefault("Life regen, movement speed, and wing flight time boosted, you are floaty and defense is reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 567 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Cinnamon Roll");
Description.SetDefault("Mana regen rate and fire debuff damage boosted, defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 517 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Everclear");
Description.SetDefault("Damage boosted, life regen and defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 633 B

+2
View File
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Evergreen Gin");
Description.SetDefault("Sickness and water debuff damage boosted, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 524 B

@@ -1,13 +1,15 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class OldFashionedBuff : ModBuff
public class FabsolVodkaBuff : ModBuff
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Fab");
Description.SetDefault("You feel fabulous");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
@@ -16,7 +18,7 @@ namespace CalamityMod.Buffs.Alcohol
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().oldFashioned = true;
player.Calamity().fabsolVodka = true;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Fireball");
Description.SetDefault("Fire debuff damage boosted, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

After

Width:  |  Height:  |  Size: 561 B

+2
View File
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Grape Beer");
Description.SetDefault("Defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 555 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Margarita");
Description.SetDefault("Reduced duration to most debuffs, defense and life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 594 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Moonshine");
Description.SetDefault("Defense and damage reduction boosted, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 591 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Moscow Mule");
Description.SetDefault("Damage, critical strike chance, and knockback boosted, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Red Wine");
Description.SetDefault("Life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 552 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Rum");
Description.SetDefault("Movement speed and life regen boosted, defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

After

Width:  |  Height:  |  Size: 591 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Screwdriver");
Description.SetDefault("Piercing projectile damage boosted, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 513 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Star Beam Rye");
Description.SetDefault("Max mana and magic damage increased. Defense, mana usage, and life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 608 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Tequila");
Description.SetDefault("Critical strike chance, defense, and knockback boosted during daytime, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 523 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Tequila Sunrise");
Description.SetDefault("Critical strike chance, defense, and knockback boosted during daytime, life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 555 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
@@ -7,6 +7,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Trippy");
Description.SetDefault("You see the world for what it truly is... and you also have a 50% increase to all damage");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 683 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Vodka");
Description.SetDefault("Damage and critical stike chance boosted, defense and life regen reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 540 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Whiskey");
Description.SetDefault("Damage, critical strike chance, and knockback boosted, defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 740 B

After

Width:  |  Height:  |  Size: 573 B

+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Alcohol
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("White Wine");
Description.SetDefault("Magic damage boosted, life regen and defense reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 562 B

+70 -130
View File
@@ -1,9 +1,7 @@
using CalamityMod.Balancing;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.NPCs;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs
@@ -16,7 +14,7 @@ namespace CalamityMod.Buffs
{
if (type == BuffID.Archery)
{
player.arrowDamage *= 0.955f;
player.arrowDamage *= 0.875f;
}
else if (type == BuffID.Ironskin)
{
@@ -26,11 +24,6 @@ namespace CalamityMod.Buffs
{
player.GetDamage<MagicDamageClass>() -= 0.1f;
}
else if (type == BuffID.Clairvoyance)
{
player.GetDamage<MagicDamageClass>() -= 0.02f;
player.GetCritChance<MagicDamageClass>() -= 2;
}
else if (type == BuffID.Panic)
{
player.moveSpeed -= 0.6f;
@@ -38,11 +31,6 @@ namespace CalamityMod.Buffs
else if (type == BuffID.SugarRush)
{
player.moveSpeed -= 0.1f;
player.pickSpeed += 0.1f;
}
else if (type == BuffID.Mining)
{
player.pickSpeed += 0.1f;
}
else if (type == BuffID.Swiftness)
{
@@ -51,19 +39,14 @@ namespace CalamityMod.Buffs
else if (type == BuffID.WellFed)
{
player.moveSpeed -= 0.15f;
player.GetAttackSpeed<MeleeDamageClass>() -= 0.05f;
}
else if (type == BuffID.WellFed2)
{
player.moveSpeed -= 0.225f;
player.pickSpeed += 0.025f;
player.GetAttackSpeed<MeleeDamageClass>() -= 0.075f;
}
else if (type == BuffID.WellFed3)
{
player.moveSpeed -= 0.3f;
player.pickSpeed += 0.05f;
player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f;
}
else if (type == BuffID.Shine)
{
@@ -73,24 +56,16 @@ namespace CalamityMod.Buffs
{
player.endurance -= 0.1f;
}
// Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely.
else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense)
else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3)
{
int orbsToGrant = player.beetleOrbs < 0 ? 0 : player.beetleOrbs;
if (orbsToGrant > 3)
orbsToGrant = 3;
player.endurance += BalancingConstants.BeetleShellDRPerBeetle * orbsToGrant;
float nebulaDamage = 0.075f * player.nebulaLevelDamage; // 15% to 45% changed to 7.5% to 22.5%
player.GetDamage<GenericDamageClass>() -= nebulaDamage;
}
// Solar Flare DR is a full compensation, as the vanilla multiplicative DR is removed entirely.
else if (type >= BuffID.SolarShield1 && type <= BuffID.SolarShield3)
else if (type == BuffID.Warmth)
{
player.endurance += BalancingConstants.SolarFlareShieldDR;
}
else if (type == BuffID.Rabies)
{
player.GetDamage<GenericDamageClass>() -= 0.2f;
player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
player.buffImmune[BuffID.Frozen] = true;
player.buffImmune[BuffID.Chilled] = true;
}
}
@@ -123,142 +98,107 @@ namespace CalamityMod.Buffs
}
}
public override void ModifyBuffText(int type, ref string buffName, ref string tip, ref int rare)
public override void ModifyBuffTip(int type, ref string tip, ref int rare)
{
// Vanilla buffs (sorted alphabetically)
// Vanilla buffs
switch (type)
{
case BuffID.Archery:
tip = tip.Replace("10", "5");
break;
case BuffID.BeetleEndurance1:
tip = tip.Replace("15", "10");
break;
case BuffID.BeetleEndurance2:
tip = tip.Replace("30", "20");
break;
case BuffID.BeetleEndurance3:
tip = tip.Replace("45", "30");
break;
case BuffID.BeetleMight1:
tip = CalamityUtils.GetText("Vanilla.BuffDescription.BeetleMight").Format(10, 5);
break;
case BuffID.BeetleMight2:
tip = CalamityUtils.GetText("Vanilla.BuffDescription.BeetleMight").Format(20, 10);
break;
case BuffID.BeetleMight3:
tip = CalamityUtils.GetText("Vanilla.BuffDescription.BeetleMight").Format(30, 15);
break;
case BuffID.ChaosState:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.ChaosState");
break;
case BuffID.IceBarrier:
tip = tip.Replace("25", "15");
break;
case BuffID.Ironskin:
tip = tip.Replace("8", CalamityUtils.GetScalingDefense(-1).ToString());
break;
case BuffID.LeafCrystal:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.LeafCrystal");
tip = "Increase defense by " + CalamityUtils.GetScalingDefense(-1);
break;
case BuffID.MagicPower:
tip = tip.Replace("20", "10");
tip = "10% increased magic damage";
break;
case BuffID.Mining:
tip = tip.Replace("25", "15");
break;
case BuffID.MonsterBanner: //Vanilla's wording is unclear and nondescript
var tooltipLines = tip.Split("\n");
var result = "";
foreach (var tooltip in tooltipLines)
{
if (tooltip == tooltipLines[0])
result += CalamityUtils.GetText("Vanilla.BuffDescription.Banner");
else
result += "\n" + tooltip;
}
tip = result;
break;
case BuffID.NebulaUpDmg1:
tip = tip.Replace("15", "7.5");
break;
case BuffID.NebulaUpDmg2:
tip = tip.Replace("30", "15");
break;
case BuffID.NebulaUpDmg3:
tip = tip.Replace("45", "22.5");
break;
case BuffID.SugarRush:
tip = tip.Replace("20", "10");
case BuffID.Archery:
tip = "20% increased arrow speed and 5% increased arrow damage";
break;
case BuffID.Swiftness:
tip = tip.Replace("25", "15");
tip = "15% increased movement speed";
break;
case BuffID.Warmth:
tip += "\n" + CalamityUtils.GetTextValue("Vanilla.BuffDescription.WarmthExtra");
case BuffID.SugarRush:
tip = "10% increased movement speed and 20% increased mining speed";
break;
case BuffID.WeaponImbueConfetti:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueConfetti");
case BuffID.LeafCrystal:
tip = "Emits powerful life pulses at nearby enemies";
break;
case BuffID.WeaponImbueCursedFlames:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueCursedFlames");
case BuffID.NebulaUpDmg1:
tip = "7.5% increased damage";
break;
case BuffID.WeaponImbueFire:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueFire");
case BuffID.NebulaUpDmg2:
tip = "15% increased damage";
break;
case BuffID.WeaponImbueGold:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueGold");
case BuffID.NebulaUpDmg3:
tip = "22.5% increased damage";
break;
case BuffID.WeaponImbueIchor:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueIchor");
/*case BuffID.BeetleMight1:
tip = "Melee damage increased by 10%";
break;
case BuffID.WeaponImbueNanites:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueNanites");
case BuffID.BeetleMight2:
tip = "Melee damage increased by 20%";
break;
case BuffID.WeaponImbuePoison:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbuePoison");
case BuffID.BeetleMight3:
tip = "Melee damage increased by 30%";
break;*/
case BuffID.BeetleEndurance1:
tip = "Damage taken reduced by 10%";
break;
case BuffID.BeetleEndurance2:
tip = "Damage taken reduced by 20%";
break;
case BuffID.BeetleEndurance3:
tip = "Damage taken reduced by 30%";
break;
case BuffID.WeaponImbueVenom:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueVenom");
case BuffID.WeaponImbueCursedFlames:
case BuffID.WeaponImbueFire:
case BuffID.WeaponImbueGold:
case BuffID.WeaponImbueIchor:
case BuffID.WeaponImbueNanites:
case BuffID.WeaponImbuePoison:
tip = tip.Insert(tip.IndexOf("Melee") + 5, ", Whip, and Rogue");
break;
case BuffID.WeaponImbueConfetti:
tip = "All attacks cause confetti to appear";
break;
case BuffID.IceBarrier:
tip = "Damage taken is reduced by 15%";
break;
case BuffID.ChaosState:
tip = "Rod of Discord teleports are disabled";
break;
case BuffID.Warmth:
tip += ". Grants immunity to Chilled, Frozen and Glacial State";
break;
case BuffID.WellFed:
tip = Language.GetTextValue("BuffDescription.WellFed");
tip = "Minor improvements to all stats";
break;
case BuffID.WellFed2:
tip = Language.GetTextValue("BuffDescription.WellFed2");
tip = "Medium improvements to all stats";
break;
case BuffID.WellFed3:
tip = Language.GetTextValue("BuffDescription.WellFed3");
tip = "Major improvements to all stats";
break;
}
}
+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.Cooldowns
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Withered");
Description.SetDefault("Holding withered weapons causes you to suffer but makes your weapons strong");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
+2 -29
View File
@@ -1,7 +1,4 @@
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -11,6 +8,8 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Infection");
Description.SetDefault("Your flesh is melting off");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
@@ -29,31 +28,5 @@ namespace CalamityMod.Buffs.DamageOverTime
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
if (Main.rand.NextBool(4))
{
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.08f, 0f, 20);
GeneralParticleHandler.SpawnParticle(pulse);
Particle orb = new GenericBloom(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, 0.055f, 8);
GeneralParticleHandler.SpawnParticle(orb);
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
if (Main.rand.NextBool(5))
{
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
Vector2 npcSize2 = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.1f + (0.0000007f * npc.width * npc.height), 0f, 20);
GeneralParticleHandler.SpawnParticle(pulse);
Particle orb = new GenericBloom(npcSize2, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.Coral, 0.065f + (0.0000007f * npc.width * npc.height), 8);
GeneralParticleHandler.SpawnParticle(orb);
}
}
}
}
+3 -1
View File
@@ -1,4 +1,4 @@
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +8,8 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Banishing Fire");
Description.SetDefault("You shall not be forgiven for your sins");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

After

Width:  |  Height:  |  Size: 567 B

-69
View File
@@ -1,69 +0,0 @@
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class BrainRot : ModBuff
{
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().brainRot = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().brainRot < npc.buffTime[buffIndex])
npc.Calamity().brainRot = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player player = drawInfo.drawPlayer;
var modPlayer = player.Calamity();
if (Main.rand.NextBool())
{
int dustType = Main.rand.NextBool() ? 184 : 18;
Dust dust = Dust.NewDustPerfect(player.Center + new Vector2(Main.rand.NextFloat(-5f, 5f), -16 + Main.rand.NextFloat(-5f, 5f)), dustType);
dust.scale = (dustType == 18 ? 0.6f : 1.2f);
dust.velocity = new Vector2(2, 2).RotatedByRandom(360) * Main.rand.NextFloat(0.3f, 0.7f) + player.velocity;
dust.noGravity = true;
dust.alpha = 35;
}
if (Main.rand.NextBool(4))
{
Dust dust = Dust.NewDustPerfect(modPlayer.RandomDebuffVisualSpot, 18);
dust.noGravity = true;
dust.velocity = Vector2.Zero;
dust.alpha = 90;
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
if (Main.rand.NextBool())
{
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
int dustType = Main.rand.NextBool() ? 184 : 18;
Dust dust = Dust.NewDustPerfect(npcSize, dustType);
dust.scale = (dustType == 18 ? 0.6f : 1.2f);
dust.noGravity = true;
dust.velocity = Vector2.Zero;
dust.alpha = Main.rand.Next(35, 90);
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

+2 -40
View File
@@ -1,7 +1,4 @@
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -11,6 +8,8 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brimstone Flames");
Description.SetDefault("Rapid health loss");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
@@ -29,42 +28,5 @@ namespace CalamityMod.Buffs.DamageOverTime
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
{
Player Player = drawInfo.drawPlayer;
Vector3 brimstoneDustLight = new Vector3(0.255f, 0.079f, 0.082f);
Lighting.AddLight(Player.Center, brimstoneDustLight * 2);
if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
{
Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, Main.rand.NextBool(3) ? 114 : ModContent.DustType<BrimstoneFlame>(), new Vector2(0, Main.rand.NextFloat(-3f, -5f)) + Player.velocity, 0, default, hasDebuffResistance ? 1.1f : 1.6f);
dust.noGravity = true;
for (int i = 0; i < 3; i++)
{
Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool() ? 90 : ModContent.DustType<BrimstoneFlame>(), new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + Player.velocity, 0, default, hasDebuffResistance ? 0.4f : 1.4f);
dust2.noGravity = true;
}
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
if (Main.rand.NextBool(3))
{
Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, Main.rand.NextBool(3) ? 114 : ModContent.DustType<BrimstoneFlame>());
dust.noGravity = true;
dust.velocity = new Vector2(0, Main.rand.NextFloat(-3f, -5f)) + npc.velocity;
dust.scale = 1.6f;
for (int i = 0; i < 3; i++)
{
Dust dust2 = Dust.NewDustDirect(npc.position + new Vector2(Main.rand.NextFloat(-10f, 10f), npc.height / 2), npc.width, npc.height, Main.rand.NextBool() ? 90 : ModContent.DustType<BrimstoneFlame>());
dust2.noGravity = true;
dust2.velocity = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + npc.velocity;
dust2.scale = 1.4f;
}
Lighting.AddLight(npc.position, 0.05f, 0.01f, 0.01f);
}
}
}
}
+3 -45
View File
@@ -1,7 +1,4 @@
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -11,6 +8,8 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Burning Blood");
Description.SetDefault("Your blood is on fire");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
@@ -29,46 +28,5 @@ namespace CalamityMod.Buffs.DamageOverTime
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
if (Main.rand.NextBool(11))
{
int bloodLifetime = Main.rand.Next(22, 36);
float bloodScale = Main.rand.NextFloat(0.6f, 0.8f);
Color bloodColor = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat());
bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f));
if (Main.rand.NextBool(15))
bloodScale *= 1.3f;
float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 1.5f);
Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier;
bloodVelocity.Y -= 5f;
BloodParticle blood = new BloodParticle(Player.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
GeneralParticleHandler.SpawnParticle(blood);
}
for (int i = 0; i < 2; i++)
{
float rot = MathHelper.ToRadians(i * 280);
Vector2 offset = new Vector2(0.1f, 0).RotatedBy(rot * Main.rand.NextFloat(0.08f, 0.05f));
Dust dust2 = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot + offset, 5);
dust2.scale = Main.rand.NextFloat(0.6f, 0.7f);
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
if (Main.rand.NextBool(3))
{
int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, Main.rand.NextBool(8) ? 296 : 5, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.25f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 1.3f;
Main.dust[dust].velocity.Y -= 0.5f;
}
Lighting.AddLight(npc.Center, 0.08f, 0f, 0f);
}
}
}
Loaded 100 of 8642 files, more files were not shown because too many files have changed in this diff. Show more