Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
738d39521d | ||
|
|
9b467fca0f |
No files matched your search
@@ -1 +1 @@
|
||||
patreon: CalamityMod
|
||||
patreon: Fabsol
|
||||
@@ -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
|
||||
@@ -1,9 +1,11 @@
|
||||
# manually added cronscript
|
||||
cronpull.sh
|
||||
|
||||
# Ignore Visual Studio solution files.
|
||||
# Calamity uses a project file but not a solution file.
|
||||
## 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
|
||||
*.slnx
|
||||
@@ -1,20 +1,22 @@
|
||||
using System;
|
||||
using CalamityMod.Skies;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class AstralDesertSurfaceBGStyle : ModSurfaceBackgroundStyle
|
||||
{
|
||||
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)
|
||||
@@ -31,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 = Main.instance.screenOff;
|
||||
float scAdj = Main.instance.scAdj;
|
||||
Color COSBMAplha = Main.ColorOfSurfaceBackgroundsModified;
|
||||
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)SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax);
|
||||
var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
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(SkyTextureRefs.AstralDesertSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
bgScale = 1.31f;
|
||||
bgParallax = 0.43;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
{
|
||||
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(SkyTextureRefs.AstralDesertSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Value.Width, SkyTextureRefs.AstralDesertSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 18 KiB |
@@ -1,21 +1,18 @@
|
||||
using System;
|
||||
using CalamityMod.Skies;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class AstralSnowSurfaceBGStyle : ModSurfaceBackgroundStyle
|
||||
{
|
||||
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)
|
||||
@@ -32,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 = Main.instance.screenOff;
|
||||
float scAdj = Main.instance.scAdj;
|
||||
Color COSBMAplha = Main.ColorOfSurfaceBackgroundsModified;
|
||||
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)SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax);
|
||||
var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
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(SkyTextureRefs.AstralSnowSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
bgScale = 1.31f;
|
||||
bgParallax = 0.43;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
{
|
||||
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(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
bgScale = 1.34f;
|
||||
bgParallax = 0.49;
|
||||
bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
|
||||
bgScale *= bgGlobalScaleMultiplier;
|
||||
bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
{
|
||||
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(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 13 KiB |
@@ -1,156 +1,37 @@
|
||||
using System;
|
||||
using CalamityMod.Skies;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
//this is just a blank background, so each custom background will draw over it
|
||||
public class AstralSurfaceBGStyle : ModSurfaceBackgroundStyle
|
||||
{
|
||||
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)
|
||||
{
|
||||
fades[i] += transitionSpeed;
|
||||
if (fades[i] > 1f)
|
||||
{
|
||||
fades[i] = 1f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fades[i] -= transitionSpeed;
|
||||
if (fades[i] < 0f)
|
||||
{
|
||||
fades[i] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 = Main.instance.screenOff;
|
||||
float scAdj = Main.instance.scAdj;
|
||||
Color COSBMAplha = Main.ColorOfSurfaceBackgroundsModified;
|
||||
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)SkyTextureRefs.AstralSurfaceMiddle.Value.Width * bgScale); //The Width of the bg texture scaled to the correct size
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax);
|
||||
var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); //The starting position of the background layer
|
||||
if (Main.gameMenu)
|
||||
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(SkyTextureRefs.AstralSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
//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)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
{
|
||||
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(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
//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)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale);
|
||||
SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax);
|
||||
bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
|
||||
if (Main.gameMenu)
|
||||
{
|
||||
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(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
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:)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 18 KiB |
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 1020 B |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,46 +1,13 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class AstralUndergroundBGStyle : ModUndergroundBackgroundStyle
|
||||
{
|
||||
private int AUBG0;
|
||||
private int AUBG1;
|
||||
private int AUBG2;
|
||||
private int AUBG3;
|
||||
|
||||
private int AUBG4_0;
|
||||
private int AUBG4_1;
|
||||
private int AUBG4_2;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (Main.dedServ)
|
||||
return;
|
||||
|
||||
AUBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG0");
|
||||
AUBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG1");
|
||||
AUBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG2");
|
||||
AUBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG3");
|
||||
|
||||
AUBG4_0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG4_0");
|
||||
AUBG4_1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG4_1");
|
||||
AUBG4_2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG4_2");
|
||||
}
|
||||
|
||||
public override void FillTextureArray(int[] textureSlots)
|
||||
{
|
||||
textureSlots[0] = AUBG0;
|
||||
textureSlots[1] = AUBG1;
|
||||
textureSlots[2] = AUBG2;
|
||||
textureSlots[3] = AUBG3;
|
||||
textureSlots[4] = Main.hellBackStyle switch
|
||||
{
|
||||
0 => AUBG4_0,
|
||||
1 => AUBG4_1,
|
||||
_ => AUBG4_2
|
||||
};
|
||||
for (int i = 0; i <= 3; i++)
|
||||
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG" + i.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,33 +1,13 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class SunkenSeaBGStyle : ModUndergroundBackgroundStyle
|
||||
{
|
||||
private int SSBG0;
|
||||
private int SSBG1;
|
||||
private int SSBG2;
|
||||
private int SSBG3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (Main.dedServ)
|
||||
return;
|
||||
|
||||
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG0");
|
||||
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG1");
|
||||
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG2");
|
||||
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG3");
|
||||
}
|
||||
|
||||
public override void FillTextureArray(int[] textureSlots)
|
||||
{
|
||||
textureSlots[0] = SSBG0;
|
||||
textureSlots[1] = SSBG1;
|
||||
textureSlots[2] = SSBG2;
|
||||
textureSlots[3] = SSBG3;
|
||||
|
||||
for (int i = 0; i <= 3; i++)
|
||||
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG" + i.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,385 +0,0 @@
|
||||
using CalamityMod.Graphics;
|
||||
using CalamityMod.Systems.Graphic;
|
||||
using CalamityMod.Utilities.Daybreak.Buffers;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class SunkenSeaBurrowsBG : ModSystem
|
||||
{
|
||||
private static RenderTargetLease WaterDistortionTarget;
|
||||
|
||||
private static bool CurrentlyRendering { get; set; }
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
if (Main.dedServ)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralDrawLayerSystem.OnPrepareDraw += DrawToTarget;
|
||||
On_Main.DrawBackgroundBlackFill += On_Main_DrawBackgroundBlackFill;
|
||||
|
||||
Main.QueueMainThreadAction(() => WaterDistortionTarget = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice));
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
GeneralDrawLayerSystem.OnPrepareDraw -= DrawToTarget;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This code runs because there is a system in vanilla that causes backgrounds to not draw if lighting is too low.
|
||||
/// That would be fine, the problem arises because sloped tiles still block light the same way normal tiles do.
|
||||
/// Which means that the background will occasionally be blocked by slopes as though said slopes were full squares.
|
||||
/// This is a hacky method that sets the light level of every sloped tile *AT LEAST* high enough to render the background while in the Burrows.
|
||||
///
|
||||
/// ENNWAY's note:
|
||||
/// if this doesn't get fixed in 1.4.5 i am throwing really big rocks at unsuspecting re logic employees
|
||||
/// </summary>
|
||||
public override void PreUpdatePlayers()
|
||||
{
|
||||
if (!Main.dedServ && Main.LocalPlayer.InModBiome<BiomeManagers.GleamingBurrowsBiome>())
|
||||
{
|
||||
int drawLimitX = Main.screenWidth / 16;
|
||||
int drawLimitY = Main.screenHeight / 16;
|
||||
Point drawPoint = (Main.screenPosition / 16).ToPoint();
|
||||
for (int i = 0; i < drawLimitX; i++)
|
||||
{
|
||||
for (int j = 0; j < drawLimitY; j++)
|
||||
{
|
||||
Point pos = drawPoint + new Point(i, j);
|
||||
if (!Main.tile[pos.X, pos.Y].HasTile &&
|
||||
Main.tile[pos.X, pos.Y].WallType == WallID.None)
|
||||
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>())))
|
||||
{
|
||||
int drawLimitX = Main.screenWidth / 16;
|
||||
int drawLimitY = Main.screenHeight / 16;
|
||||
Point drawPoint = (Main.screenPosition / 16).ToPoint();
|
||||
for (int i = 0; i < drawLimitX; i++)
|
||||
{
|
||||
for (int j = 0; j < drawLimitY; j++)
|
||||
{
|
||||
Point pos = drawPoint + new Point(i, j);
|
||||
if (!Main.tile[pos.X, pos.Y].HasTile &&
|
||||
Main.tile[pos.X, pos.Y].WallType == WallID.None &&
|
||||
Main.tile[pos.X, pos.Y].LiquidAmount == 0)
|
||||
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>())))
|
||||
{
|
||||
int drawLimitX = Main.screenWidth / 16;
|
||||
int drawLimitY = Main.screenHeight / 16;
|
||||
Point drawPoint = (Main.screenPosition / 16).ToPoint();
|
||||
for (int i = 0; i < drawLimitX; i++)
|
||||
{
|
||||
for (int j = 0; j < drawLimitY; j++)
|
||||
{
|
||||
Point pos = drawPoint + new Point(i, j);
|
||||
if (!Main.tile[pos.X, pos.Y].HasTile &&
|
||||
Main.tile[pos.X, pos.Y].WallType == WallID.None)
|
||||
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>())))
|
||||
{
|
||||
int drawLimitX = Main.screenWidth / 16;
|
||||
int drawLimitY = Main.screenHeight / 16;
|
||||
Point drawPoint = (Main.screenPosition / 16).ToPoint();
|
||||
for (int i = 0; i < drawLimitX; i++)
|
||||
{
|
||||
for (int j = 0; j < drawLimitY; j++)
|
||||
{
|
||||
Point pos = drawPoint + new Point(i, j);
|
||||
if (!Main.tile[pos.X, pos.Y].HasTile &&
|
||||
Main.tile[pos.X, pos.Y].WallType == WallID.None)
|
||||
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.BasaltGullyBiome>())))
|
||||
{
|
||||
int drawLimitX = Main.screenWidth / 16;
|
||||
int drawLimitY = Main.screenHeight / 16;
|
||||
Point drawPoint = (Main.screenPosition / 16).ToPoint();
|
||||
for (int i = 0; i < drawLimitX; i++)
|
||||
{
|
||||
for (int j = 0; j < drawLimitY; j++)
|
||||
{
|
||||
Point pos = drawPoint + new Point(i, j);
|
||||
if (pos.Y >= Main.maxTilesY - 450)
|
||||
{
|
||||
if (!Main.tile[pos.X, pos.Y].HasTile &&
|
||||
Main.tile[pos.X, pos.Y].WallType == WallID.None)
|
||||
Lighting.AddLight(pos.X, pos.Y, TorchID.Red, 0.6f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawToTarget()
|
||||
{
|
||||
if (Main.gameMenu)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentlyRendering = true;
|
||||
|
||||
using (WaterDistortionTarget.Scope(clearColor: Color.Transparent))
|
||||
{
|
||||
// 13MAY2025: fryzahh: Note that when other Sunken Sea backgrounds are implemented they should use this same system.
|
||||
// Leaving this here for other programmers, in case I don't get to doing this myself.
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
|
||||
|
||||
DrawShoresBG();
|
||||
DrawBurrowsBG();
|
||||
|
||||
Main.spriteBatch.End();
|
||||
}
|
||||
|
||||
CurrentlyRendering = false;
|
||||
}
|
||||
|
||||
private void On_Main_DrawBackgroundBlackFill(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
|
||||
{
|
||||
if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f)
|
||||
{
|
||||
orig(self);
|
||||
return;
|
||||
}
|
||||
|
||||
orig(self);
|
||||
|
||||
// This won't render if the Wave Quality setting isn't turned off unfortunately, so don't bother running any of the shader
|
||||
// rendering code if that setting is on.
|
||||
if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion)
|
||||
{
|
||||
DrawShoresBG();
|
||||
DrawBurrowsBG();
|
||||
}
|
||||
else
|
||||
{
|
||||
MiscShaderData distortionShader = GameShaders.Misc["CalamityMod:BasicTextureDistortion"];
|
||||
Asset<Texture2D> distortionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Swirls");
|
||||
|
||||
// Apply a distortion shader to the Sunken Sea backgrounds to give them an underwater ripple-like effect.
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, distortionShader.Shader, CalamityUtils.BackgroundMatrix);
|
||||
|
||||
float distortionXSpeed = -0.012f;
|
||||
float distortionYSpeed = 0.02f;
|
||||
float noiseScale = 0.075f;
|
||||
float noiseStrength = 0.035f;
|
||||
|
||||
distortionShader.Shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
|
||||
distortionShader.Shader.Parameters["noiseScale"].SetValue(noiseScale);
|
||||
distortionShader.Shader.Parameters["distortionStrength"].SetValue(noiseStrength);
|
||||
distortionShader.Shader.Parameters["timeOffset"].SetValue(new Vector2(distortionXSpeed, distortionYSpeed));
|
||||
Main.graphics.GraphicsDevice.Textures[1] = distortionTexture.Value;
|
||||
Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
|
||||
|
||||
Main.spriteBatch.Draw(WaterDistortionTarget.Target, new Rectangle(16, 16, Main.screenWidth, Main.screenHeight), Color.White);
|
||||
}
|
||||
}
|
||||
|
||||
public static float Transparency;
|
||||
public static float TransitionSpeed => 0.02f;
|
||||
|
||||
private static void DrawShoresBG()
|
||||
{
|
||||
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()))
|
||||
{
|
||||
Transparency += 1f;
|
||||
|
||||
if (Transparency > 1f)
|
||||
Transparency = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has.
|
||||
Transparency -= 1f;
|
||||
|
||||
if (Transparency < 0f)
|
||||
Transparency = 0f;
|
||||
}
|
||||
|
||||
// Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active).
|
||||
// Also do not run any of the background drawing if you have the vanilla background config option turned off.
|
||||
if (Transparency > 0f && Main.BackgroundEnabled)
|
||||
{
|
||||
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
|
||||
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
|
||||
float Scale = 1.5f;
|
||||
float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f;
|
||||
|
||||
for (int Layers = 4; Layers >= 0; Layers--)
|
||||
{
|
||||
// Get each background texture.
|
||||
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SunkenSeaShoresBG" + Layers).Value;
|
||||
|
||||
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
|
||||
float num2 = (Layers * 2 + 3f);
|
||||
Vector2 vector3 = new Vector2(1f / num2);
|
||||
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
|
||||
Vector2 zero = Vector2.Zero;
|
||||
|
||||
switch (Layers)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
zero.Y += 200f;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
zero.Y += 0f;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
zero.Y += 0f;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
zero.Y += 0f;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
zero.Y += 0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vector2 *= Scale;
|
||||
|
||||
zero.Y -= num;
|
||||
float LoopWidth = Scale * rectangle.Width;
|
||||
float LoopHeight = Scale * rectangle.Height;
|
||||
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
|
||||
for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
|
||||
{
|
||||
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
|
||||
{
|
||||
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
|
||||
|
||||
var frame = rectangle;
|
||||
var color = Color.White * Transparency;
|
||||
|
||||
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void DrawBurrowsBG()
|
||||
{
|
||||
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.GleamingBurrowsBiome>()))
|
||||
{
|
||||
Transparency += 1f;
|
||||
|
||||
if (Transparency > 1f)
|
||||
Transparency = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has.
|
||||
Transparency -= 1f;
|
||||
|
||||
if (Transparency < 0f)
|
||||
Transparency = 0f;
|
||||
}
|
||||
|
||||
// Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active).
|
||||
// Also do not run any of the background drawing if you have the vanilla background config option turned off.
|
||||
if (Transparency > 0f && Main.BackgroundEnabled)
|
||||
{
|
||||
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
|
||||
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
|
||||
float Scale = 1.5f;
|
||||
float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f;
|
||||
|
||||
for (int Layers = 4; Layers >= 0; Layers--)
|
||||
{
|
||||
// Get each background texture.
|
||||
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SunkenSeaBurrowsBG" + Layers).Value;
|
||||
|
||||
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
|
||||
float num2 = (Layers * 2 + 3f);
|
||||
Vector2 vector3 = new Vector2(1f / num2);
|
||||
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
|
||||
Vector2 zero = Vector2.Zero;
|
||||
|
||||
switch (Layers)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
zero.Y += 800f;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
zero.Y += 200f;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
zero.Y += 450f;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
zero.Y += 45f;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
zero.Y += 45f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vector2 *= Scale;
|
||||
|
||||
zero.Y -= num;
|
||||
float LoopWidth = Scale * rectangle.Width;
|
||||
float LoopHeight = Scale * rectangle.Height;
|
||||
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
|
||||
for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
|
||||
{
|
||||
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
|
||||
{
|
||||
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
|
||||
|
||||
var frame = rectangle;
|
||||
var color = Color.White * Transparency;
|
||||
|
||||
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
@@ -1,460 +1,426 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
using CalamityMod.NPCs.NormalNPCs.HorribleHog;
|
||||
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.Systems.Collections;
|
||||
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
|
||||
{
|
||||
public sealed class BalancingChangesManager : ModSystem
|
||||
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
|
||||
public static class BalancingChangesManager
|
||||
{
|
||||
internal static List<IBalancingRule[]> UniversalBalancingChanges = null;
|
||||
internal static List<NPCBalancingChange> NPCSpecificBalancingChanges = null;
|
||||
|
||||
// Balancing changes in this method are sorted based on place in progression, NPC name (from A-Z), and strength of resistance in ascending order, in that level of priority.
|
||||
// For ease of change, changes that are not exclusive to one specific weapon are not bundled into one line if they share the same resistance factor.
|
||||
// To give an example of this, Thanatos having a 50% resist to Chicken Cannon and Rancor should be two distinct lines with a 0.5x factor instead of hamfisting them all into
|
||||
// one single resist that may have to be split later.
|
||||
public override void SetStaticDefaults()
|
||||
// To give an example of this, Thanatos having a 50% resist to Chicken Cannon and Prismatic Breaker should be two distinct lines with a 0.5x factor instead of hamfisting them all
|
||||
// into one single resist that may have to be split later.
|
||||
internal static void Load()
|
||||
{
|
||||
// Dirty shorthand for true melee resists, because they're super common and other class resists aren't.
|
||||
// If you add/change a true melee resist here, be sure to add/change the resist in CalamityGlobalNPC ModifyHitByItem as well.
|
||||
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>());
|
||||
|
||||
// bool MonkStaffT3Filter(Projectile p) =>
|
||||
// p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3);
|
||||
|
||||
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;
|
||||
|
||||
bool AotCThrowCombo(Projectile p) =>
|
||||
p.type == ProjectileType<ArkoftheCosmosSwungBlade>() && (p.ai[0] == 2 || p.ai[0] == 3);
|
||||
|
||||
bool HiveBeeFilter(Projectile p) =>
|
||||
p.type == ProjectileType<BasicPlagueBee>() && Main.player[p.owner].HeldItem.type == ItemType<TheHive>();
|
||||
UniversalBalancingChanges = new List<IBalancingRule[]>()
|
||||
{
|
||||
// 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 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>();
|
||||
|
||||
// ENEMIES
|
||||
#region Horrible Hog
|
||||
// Take 300% damage from Finch Staff.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<HorribleHog>(), Do(new ProjectileResistBalancingRule(3f, ProjectileID.BabyBird))));
|
||||
#endregion
|
||||
#region Desert Scourge
|
||||
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DesertScourgeIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
#endregion Desert Scourge
|
||||
|
||||
// BOSSES
|
||||
#region Crabulon
|
||||
// 20% resist to true melee.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
|
||||
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), new TrueMeleeResistBalancingRule(0.5f)));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Eater of Worlds
|
||||
// 55% resist to Lemon 'nade
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<LemonNadeProjectile>()))));
|
||||
#region Brain of Cthulhu / Creepers
|
||||
|
||||
// 50% resist to Demon Scythe.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
// 40% resist to Sky Glaze.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<StickyFeather>()))));
|
||||
|
||||
// 25% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f))));
|
||||
#endregion
|
||||
|
||||
#region Brain of Cthulhu: Creepers
|
||||
// 50% resist to Demon Scythe.
|
||||
// 50% resist to Demon Scythes.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
|
||||
|
||||
// 25% resist to true melee.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.75f))));
|
||||
#endregion
|
||||
#endregion Brain of Cthulhu / Creepers
|
||||
|
||||
#region Eater of Worlds
|
||||
|
||||
// 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>()))));
|
||||
|
||||
// 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(CalamityNPCTypeSets.Perforators, Do(ResistTrueMelee(0.5f))));
|
||||
#endregion
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
#region Wall of Flesh
|
||||
// 50% resist to Staff of Necrosteocytes.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(new List<int> { NPCID.WallofFlesh, NPCID.WallofFleshEye }, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<SmallSkeletonMinion>()))));
|
||||
#endregion
|
||||
// 50% resist to Dormant Brimseekers.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
|
||||
|
||||
#region Aquatic Scourge
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(ResistTrueMelee(0.5f))));
|
||||
// 40% resist to Cryophobia
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
|
||||
|
||||
// 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(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
|
||||
|
||||
// 50% resist to Dormant Brimseeker.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
|
||||
|
||||
// 50% resist to Mounted Scanner.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<MountedScannerLaser>()))));
|
||||
|
||||
// 40% resist to Cryophobia.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
|
||||
|
||||
// 30% resist to Meowthrower.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
|
||||
|
||||
// 25% resist to Snowstorm Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, 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(CalamityNPCTypeSets.Destroyer, 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(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
|
||||
// 50% resist to Dormant Brimseekers.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
|
||||
|
||||
// 50% resist to Dormant Brimseeker.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
|
||||
// 40% resist to Cryophobia
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
|
||||
|
||||
// 45% resist to Mounted Scanner.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<MountedScannerLaser>()))));
|
||||
// 15% resist to Snowstorm Staff
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<Snowflake>()))));
|
||||
|
||||
// 30% resist to Meowthrower.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
|
||||
|
||||
// 25% resist to Avalanche's Ice Bombs and shards.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<IceBombFriendly>(), ProjectileType<FrostShardFriendly>()))));
|
||||
|
||||
// 25% resist to Snowstorm Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
|
||||
#endregion
|
||||
|
||||
#region Astrum Aureus
|
||||
// 25% resist to true melee.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), ResistTrueMelee(0.75f)));
|
||||
|
||||
// 25% resist to The Ballista's greatarrows.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<BallistaGreatArrow>()))));
|
||||
|
||||
// 15% resist to Dryad's Tears.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<DryadsTearMain>(), ProjectileType<DryadsTearBurst>()))));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Duke Fishron
|
||||
// 20% vulnerability to The Hive's bees.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileSpecificRequirementBalancingRule(1.2f, HiveBeeFilter))));
|
||||
|
||||
// 25% vulnerability to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.25f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
#endregion
|
||||
|
||||
#region Empress of Light
|
||||
// 25% resist to Abyss Blade's blade.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<AbyssBladeProjectile>()))));
|
||||
|
||||
// 20% resist to Plague Tainted SMG's drones.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<PlagueTaintedDrone>()))));
|
||||
#endregion
|
||||
#endregion The Destroyer
|
||||
|
||||
#region Ravager
|
||||
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, 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(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
|
||||
#endregion Ravager
|
||||
|
||||
// 35% resist to Flying Dragon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
|
||||
#region Duke Fishron
|
||||
|
||||
// 20% resist to Aurora Blazer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<AuroraFire>()))));
|
||||
// 35% vulnerability to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
|
||||
// 20% resist to The Hive.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<HiveNuke>(), ProjectileType<HiveMissile>()))));
|
||||
#endregion
|
||||
#endregion Duke Fishron
|
||||
|
||||
#region Lunatic Cultist
|
||||
// 50% resist to Aegis Blade's explosions.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
|
||||
#region Cultist
|
||||
|
||||
// 35% resist to Subduction Slicer's flame pillars.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SubductionFlameburst>()))));
|
||||
// 25% resist to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
|
||||
// 20% resist to Art Attack.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ArtAttackStrike>()))));
|
||||
// 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 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(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<PlaguenadeBee>(), ProjectileType<PlaguenadeProj>()))));
|
||||
|
||||
// 70% resist to Stardust Dragon Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
|
||||
// 75% resist to Plaguenades.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<PlaguenadeBee>(), ProjectileType<PlaguenadeProj>()))));
|
||||
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(ResistTrueMelee(0.5f))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
// 50% resist to Atlantis (Atlantis gaming!).
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AtlantisSpear>()))));
|
||||
// 25% resist to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
|
||||
// 50% resist to Charged Blaster Cannon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.ChargedBlasterLaser))));
|
||||
|
||||
// 45% resist to Duststorm in a Bottle.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<DuststormCloud>(), ProjectileType<DuststormCloudExplosion>(), ProjectileType<DuststormInABottleProj>()))));
|
||||
|
||||
// 35% resist to Aerial Bane.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
|
||||
|
||||
// 30% resist to Aurora Blazer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
|
||||
|
||||
// 30% resist to Flak Kraken.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<FlakKrakenProjectile>()))));
|
||||
|
||||
// 25% resist to Solar Eruption.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SolarWhipSword, ProjectileID.SolarWhipSwordExplosion))));
|
||||
|
||||
// 20% resist to Ballistic Poison Bomb's clouds.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BallisticPoisonCloud>()))));
|
||||
|
||||
// 20% resist to Cluster Rocket fragments.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII))));
|
||||
#endregion
|
||||
#endregion Astrum Deus
|
||||
|
||||
#region Moon Lord
|
||||
// 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
|
||||
// 35% resist to Vanishing Point. This thing desperately needs a rework.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.65f, ProjectileType<SpatialSpear>(), ProjectileType<SpatialSpear2>(), ProjectileType<SpatialSpear3>(), ProjectileType<SpatialSpear4>())));
|
||||
// 80% resist to Hell's Sun.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.2f, ProjectileType<HellsSunProj>())));
|
||||
#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)));
|
||||
|
||||
// 50% resist to Galactus Blade.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<GalacticaComet>())));
|
||||
|
||||
// 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(CalamityNPCTypeSets.StormWeaver, Do(ResistTrueMelee(0.5f))));
|
||||
|
||||
// 50% resist to Last Prism.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser))));
|
||||
// 50% resist to true melee
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
// 50% resist to Legion of Celestia.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<CelestialAxeMinion>()))));
|
||||
// 50% resist to Dazzling Stabbers.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DazzlingStabber>()))));
|
||||
|
||||
// 50% resist to Tactician's Trump Card's explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
|
||||
// 50% resist to Elemental Axes.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ElementalAxeMinion>()))));
|
||||
|
||||
// 40% resist to Devil's Sunrise's slashes.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<DevilsSunriseProj>()))));
|
||||
// 50% resist to Pristine Fury.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineFire>()))));
|
||||
|
||||
// 35% resist to Event Horizon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<EventHorizonStar>(), ProjectileType<EventHorizonBlackhole>()))));
|
||||
// 50% resist to Tactician's Trump Card explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
|
||||
|
||||
// 35% resist to King of Constellations, Tenryu.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<BlackDragonHead>(), ProjectileType<BlackDragonBody>(), ProjectileType<BlackDragonTail>(), ProjectileType<WhiteDragonHead>(), ProjectileType<WhiteDragonBody>(), ProjectileType<WhiteDragonTail>()))));
|
||||
// 25% resist to Molten Amputator blobs.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<MoltenBlobThrown>()))));
|
||||
|
||||
// 20% resist to Dazzling Stabber Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<DazzlingStabber>()))));
|
||||
#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 Old Duke
|
||||
|
||||
#region The Devourer of Gods
|
||||
// 65% resist to Wave Pounder.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<WavePounderBoom>()))));
|
||||
|
||||
// 60% resist to Corinth Prime's grenades.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<CorinthPrimeAirburst>()))));
|
||||
|
||||
// 50% resist to Stratus Sphere
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<StratusBlackHole>()))));
|
||||
|
||||
// 35% resist to Sulphuric Acid Cannon's explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SulphuricAcidCannonExplosion>()))));
|
||||
|
||||
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, 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 Exo Mechs: Ares
|
||||
// 35% resist to Devil's Devastation's slash.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<DevilsDevastationHoldout>()))));
|
||||
#region Ares
|
||||
|
||||
// 30% resist to Dynamic Pursuer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
// 25% resist to Aetherflux Cannon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PhasedGodRay>()))));
|
||||
// 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))));
|
||||
|
||||
// 20% resist to the Spin Throw part of the Ark of the Cosmos' combo.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, 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(CalamityNPCTypeSets.Ares, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
|
||||
|
||||
// 20% resist to Rancor.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<RancorLaserbeam>()))));
|
||||
// 20% resist to Eclipse's Fall.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>(), ProjectileType<EclipsesFallMain>()))));
|
||||
|
||||
// 20% resist to Yharim's Crystal.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<YharimsCrystalBeam>()))));
|
||||
// 15% resist to Enforcer projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<EssenceFlame2>()))));
|
||||
|
||||
// 20% resist to Zenith.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal))));
|
||||
#endregion
|
||||
//55% resist to Dynamic Pursuer
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
|
||||
|
||||
#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.
|
||||
// Commented out since they currently have no resists.
|
||||
// int[] exoTwins = new int[] { NPCType<Artemis>(), NPCType<Apollo>() };
|
||||
#endregion
|
||||
#endregion Ares
|
||||
|
||||
#region Artemis and Apollo
|
||||
|
||||
int[] exoTwins = new int[] { NPCType<Artemis>(), NPCType<Apollo>() };
|
||||
|
||||
// 10% resist to Eclipse's Fall stealth strike.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<EclipsesSmol>()))));
|
||||
|
||||
// 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>()))));
|
||||
|
||||
#region Exo Mechs: Thanatos
|
||||
// 65% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(ResistTrueMelee(0.35f))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new TrueMeleeResistBalancingRule(0.35f))));
|
||||
|
||||
// 65% resist to The Final Dawn's lunge.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<FinalDawnThrow2>()))));
|
||||
|
||||
// 65% resist to Stellar Torus Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<StellarTorusBeam>()))));
|
||||
|
||||
// 60% resist to Dynamic Pursuer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
|
||||
// 65% resist to Enforcer projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<EssenceFlame2>()))));
|
||||
|
||||
// 50% resist to Chicken Cannon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
|
||||
|
||||
// 50% resist to Rancor.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, 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 Vehemence's skulls.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>()))));
|
||||
// 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 Yharim's Crystal.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<YharimsCrystalBeam>()))));
|
||||
// 50% resist to Vehemence skulls.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>(), ProjectileType<PrismaticBeam>()))));
|
||||
|
||||
// 45% resist to Wrathwing's stealth strike fireballs.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<WrathwingCinder>()))));
|
||||
// 40% resist to Rancor.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<RancorLaserbeam>()))));
|
||||
|
||||
// 40% resist to Eclipse's Fall
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<EclipsesFall_Javelin>()))));
|
||||
// 50% resist to Wrathwing stealth strike.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<WrathwingCinder>()))));
|
||||
|
||||
// 40% resist to Omicron's beam.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<OmicronBeam>()))));
|
||||
// 40% resist to Yharim's Crystal.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<YharimsCrystalBeam>()))));
|
||||
|
||||
// 35% resist to Prismatic Breaker's deathray.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<PrismaticRay>()))));
|
||||
// 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 Dragon Scales and The Wand's tornadoes.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<InfernadoFriendly>(), ProjectileType<DragonScalesInfernado>()))));
|
||||
// 30% resist to Eclipse Fall.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<EclipsesFallMain>()))));
|
||||
|
||||
// 25% resist to the Spin Throw part of the Ark of the Cosmos' combo.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo))));
|
||||
// 30% resist to Sirius.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<SiriusExplosion>()))));
|
||||
|
||||
// 25% resist to Dragon Rage projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
|
||||
|
||||
// 25% resist to Gael's Greatsword's big skulls.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, 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 Zenith.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal))));
|
||||
// 25% resist to Luminite Bullets.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.MoonlordBullet))));
|
||||
|
||||
// 20% resist to Ariane's aura (Lilies of Finality).
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<LiliesOfFinalityAoE>()))));
|
||||
|
||||
// 20% resist to Mirror of Kalandra's Paradoxica minion.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<Paradoxica>()))));
|
||||
// 20% resist to Eradicator beams.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NebulaShot>()))));
|
||||
|
||||
// 20% resist to Voltaic Climax / Void Vortex hitscan beams.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ClimaxBeam>()))));
|
||||
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(CalamityNPCTypeSets.Thanatos, 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 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(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<SpiritCongregation>()))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<SpiritCongregation>()))));
|
||||
|
||||
// 15% resist to Ultima's rays.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<UltimaRay>()))));
|
||||
#endregion
|
||||
// 15% resist to Plasma Nades
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<PlasmaGrenadeProjectile>(), ProjectileType<PlasmaGrenadeSmallExplosion>()))));
|
||||
|
||||
#region Supreme Calamitas: Brimstone Hearts
|
||||
// 34% resist to Celestus' mini scythes.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<BrimstoneHeart>(), new ProjectileResistBalancingRule(0.66f, ProjectileType<CelestusMiniScythe>())));
|
||||
#endregion Thanatos
|
||||
|
||||
// 30% resist to Supernova.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<BrimstoneHeart>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<SupernovaBoom>(), ProjectileType<SupernovaStealthBoom>())));
|
||||
#region Supreme Calamitas / Brimstone Heart
|
||||
|
||||
// 30% resist to Surge Driver's alt click comets.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<BrimstoneHeart>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<PrismComet>())));
|
||||
|
||||
// 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
|
||||
// 80% resist to Chicken Cannon.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.2f, ProjectileType<ChickenExplosion>())));
|
||||
#region Supreme Calamitas / Soul Seekers
|
||||
|
||||
// 40% resist to Subsuming Vortex.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<ExoVortex>(), ProjectileType<ExoVortex2>(), ProjectileType<EnormousConsumingVortex>())));
|
||||
// 85% resist to Chicken Cannon.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.15f, ProjectileType<ChickenExplosion>())));
|
||||
|
||||
// 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>())));
|
||||
#endregion
|
||||
|
||||
// 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 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).
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(1.15f, ProjectileType<TheAtomSplitterProjectile>(), ProjectileType<TheAtomSplitterDuplicate>())));
|
||||
|
||||
#endregion Supreme Calamitas / Soul Seekers
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
internal static void Unload()
|
||||
{
|
||||
UniversalBalancingChanges = null;
|
||||
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)
|
||||
{
|
||||
// Apply NPC-specific balancing rules.
|
||||
NPCHitContext hitContext = NPCHitContext.ConstructFromProjectile(proj);
|
||||
|
||||
// Apply universal balancing rules.
|
||||
foreach (IBalancingRule[] balancingRules in UniversalBalancingChanges)
|
||||
{
|
||||
foreach (IBalancingRule balancingRule in balancingRules)
|
||||
{
|
||||
if (balancingRule.AppliesTo(npc, hitContext))
|
||||
balancingRule.ApplyBalancingChange(npc, ref damage);
|
||||
}
|
||||
}
|
||||
|
||||
// As well as rules specific to NPCs.
|
||||
foreach (NPCBalancingChange balanceChange in NPCSpecificBalancingChanges)
|
||||
{
|
||||
if (npc.type != balanceChange.NPCType)
|
||||
@@ -462,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
{
|
||||
public static class BalancingConstants
|
||||
{
|
||||
#region Movement
|
||||
// When the relevant config is enabled: Multiplies the player's movement speed by 1.5x at all times
|
||||
internal static readonly float DefaultMoveSpeedBoost = 1.5f;
|
||||
// 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;
|
||||
|
||||
// When the relevant config is enabled: Increases the player's base jump speed by 13.97% (allows you to jump 7 blocks)
|
||||
internal static readonly float ConfigBoostedBaseJumpSpeed = 5.71f; // vanilla = 5.01f
|
||||
// When the relevant config is enabled: Increases the player's base jump height by 10%
|
||||
internal static readonly float ConfigBoostedBaseJumpHeight = 5.51f; // vanilla = 5.01f
|
||||
|
||||
// When the relevant config is enabled: Allows the player to hold the Down button (S by default) to fast fall.
|
||||
// This is the multiplier for the player's gravity (downwards acceleration) while holding Down.
|
||||
@@ -17,41 +16,11 @@
|
||||
// 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
|
||||
//doze 23apr2025 - Undid nerf, it's now the same as frog leg. If it's a problem, maybe retier it?
|
||||
internal static readonly float AmphibianBootsJumpSpeedBoost = 1.6f;
|
||||
|
||||
// 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.25f; // 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 UniversalSashDashCooldown = 30;
|
||||
internal const int UniversalShieldSlamCooldown = 30;
|
||||
internal const int UniversalShieldBonkCooldown = 30;
|
||||
internal const int OnShieldBonkCooldown = 30;
|
||||
@@ -62,26 +31,52 @@
|
||||
internal const int SolarFlareIFrames = 12;
|
||||
internal const float SolarFlareBaseDamage = 400f;
|
||||
|
||||
/// <summary>
|
||||
/// How long the dodge cooldown is at maximum damage
|
||||
/// </summary>
|
||||
internal static readonly int DodgeCooldownMax = 5400; // 90 seconds
|
||||
/// <summary>
|
||||
/// How much the dodge cooldown is reduced when at minimum damage
|
||||
/// </summary>
|
||||
internal static float DodgeCooldownDamageMult => 0.33f; // 30 seconds
|
||||
/// <summary>
|
||||
/// How much the dodge cooldown is reduced per stacked dodge. Each stack applies multiplicatively.
|
||||
/// </summary>
|
||||
internal static float DodgeCooldownMultPerStack => 0.85f; // -15% per stack, multiplicatively
|
||||
#endregion
|
||||
// Dodge cooldowns (in frames)
|
||||
// TODO -- Some of these could be moved to the respective item files
|
||||
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,153 +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 (Maximum HP healed per instance of lifesteal)
|
||||
internal static readonly int LifeStealCap = 100;
|
||||
|
||||
// Base life steal caps from vanilla (aka, how much life steal the player is allowed before it goes on cooldown)
|
||||
internal static readonly float LifeStealCap_Classic = 80f;
|
||||
internal static readonly float LifeStealCap_Expert = 70f;
|
||||
|
||||
// The base life steal cooldowns from vanilla
|
||||
internal static readonly float LifeStealRecoveryRate_Classic = 0.6f;
|
||||
internal static readonly float LifeStealRecoveryRate_Expert = 0.5f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Classic from 0.6 to 0.15 (36 HP/s to 9 HP/s)
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.45f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Expert from 0.5 to 0.1 (30 HP/s to 6 HP/s)
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.4f;
|
||||
#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
|
||||
|
||||
#region Pierce Resistance
|
||||
// Both of the below variables only apply when an NPC has universal pierce resistance enabled via attribute.
|
||||
// Projectiles may be marked as exempt from this pierce resistance by using an attribute.
|
||||
|
||||
/// <summary> Constant variable used to determine the percentage a projectile's damage is reduced by pierce resist on each hit. </summary>
|
||||
public const float PierceResistHarshness = 0.12f;
|
||||
/// <summary> Constant variable used to determine the maximum percentage a projectile's damage can be reduced by pierce resist. </summary>
|
||||
public const float PierceResistCap = 0.8f;
|
||||
#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
|
||||
|
||||
#region Multiplayer Boss Health Scaling Overrides
|
||||
// These values are used to replace the vanilla 1.35f and 1.9166666666666666f for the 2-player and 3-player cases, respectively.
|
||||
// Editing them via reflection or otherwise will apply to newly spawned bosses during gameplay.
|
||||
public static float ExpertHealthScalingOverride_2Players = 1.75f;
|
||||
public static float ExpertHealthScalingOverride_3Players = 2.25f;
|
||||
#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.
|
||||
}
|
||||
|
||||
@@ -1,42 +1,31 @@
|
||||
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
|
||||
@@ -48,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
|
||||
@@ -60,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
|
||||
@@ -87,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
|
||||
@@ -115,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;
|
||||
@@ -143,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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CalamityMod.Balancing
|
||||
{
|
||||
public enum DamageSourceType
|
||||
{
|
||||
FriendlyProjectile,
|
||||
TrueMeleeSwing,
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace CalamityMod.Balancing
|
||||
namespace CalamityMod.Balancing
|
||||
{
|
||||
public struct NPCBalancingChange
|
||||
{
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -12,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();
|
||||
@@ -38,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
|
||||
public override ModWaterStyle WaterStyle => SulphuricDepthsWater.Instance;
|
||||
public override int BiomeTorchItemType => ModContent.ItemType<CausticTorch>();
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
//temporarily use sulphur for now
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricDepthsWater");
|
||||
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";
|
||||
@@ -60,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -21,23 +18,21 @@ namespace CalamityMod.BiomeManagers
|
||||
}
|
||||
}
|
||||
|
||||
public override ModWaterStyle WaterStyle => UpperAbyssWater.Instance;
|
||||
public override int BiomeTorchItemType => ModContent.ItemType<KelpTorch>();
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/UpperAbyssWater");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -17,32 +14,25 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
if (CalamityPlayer.areThereAnyDamnBosses)
|
||||
return Main.curMusic;
|
||||
|
||||
int? musicSlot = CalamityClientConfig.Instance.AbyssLayer3Alt ?
|
||||
CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer3Alt") :
|
||||
CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer3");
|
||||
|
||||
return musicSlot ?? MusicID.Hell;
|
||||
return CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer3") ?? MusicID.Hell;
|
||||
}
|
||||
}
|
||||
|
||||
public override ModWaterStyle WaterStyle => MiddleAbyssWater.Instance;
|
||||
public override int BiomeTorchItemType => ModContent.ItemType<ThermalTorch>();
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/MiddleAbyssWater");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -21,23 +18,21 @@ namespace CalamityMod.BiomeManagers
|
||||
}
|
||||
}
|
||||
|
||||
public override ModWaterStyle WaterStyle => VoidWater.Instance;
|
||||
public override int BiomeTorchItemType => ModContent.ItemType<VoidTorch>();
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/VoidWater");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
//using CalamityMod.Systems;
|
||||
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
@@ -10,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)
|
||||
{
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Events;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class AstralInfectionBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => AstralWater.Instance;
|
||||
|
||||
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,33 +0,0 @@
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria.ID;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class BasaltGullyBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// Placeholder until we get a dedicated Basalt Gully background
|
||||
public override string BackgroundPath => "Terraria/Images/MapBG3";
|
||||
public override string MapBackground => "Terraria/Images/MapBG3";
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
bool MoreThanShores = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaShoresTiles;
|
||||
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
|
||||
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
|
||||
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
|
||||
bool MoreThanUnderground = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.UndergroundTiles;
|
||||
|
||||
return BiomeTileCounterSystem.SunkenSeaBasaltTiles > 2500 && (MoreThanShores || MoreThanReefs || MoreThanPolyp || MoreThanBurrows);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +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";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
}
|
||||
}
|
||||
@@ -1,12 +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";
|
||||
public override string BackgroundPath => "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,12 +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";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,14 +8,19 @@ 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 > 500 && player.ZoneUnderworldHeight;
|
||||
return BiomeTileCounterSystem.BrimstoneCragTiles > 100 && player.ZoneUnderworldHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class ClamDenBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// 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";
|
||||
|
||||
// todo make this condition different than the normal burrows
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
|
||||
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
|
||||
|
||||
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 1000 && MoreThanReefs && MoreThanPolyp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class GleamingBurrowsBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// 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 bool IsBiomeActive(Player player)
|
||||
{
|
||||
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
|
||||
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
|
||||
|
||||
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 3000 && MoreThanReefs && MoreThanPolyp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class PolypForestBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// 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 bool IsBiomeActive(Player player)
|
||||
{
|
||||
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
|
||||
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
|
||||
|
||||
return BiomeTileCounterSystem.SunkenSeaPolypTiles > 200 && MoreThanReefs && MoreThanBurrows;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class RadiantReefsBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// 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 bool IsBiomeActive(Player player)
|
||||
{
|
||||
bool MoreThanShores = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaShoresTiles;
|
||||
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
|
||||
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
|
||||
bool MoreThanBasalt = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBasaltTiles;
|
||||
|
||||
return ((BiomeTileCounterSystem.SunkenSeaReefsTiles > 2000) && MoreThanBasalt && MoreThanBurrows && MoreThanPolyp && MoreThanShores);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System.Security.Policy;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -14,9 +13,8 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class SulphurousSeaBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => Main.zenithWorld ? PissWater.Instance : SulphuricWater.Instance;
|
||||
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,55 +39,43 @@ 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();
|
||||
return BiomeTileCounterSystem.SulphurTiles >= 300 || IsInBiomePosition(point) && !player.Calamity().ZoneAbyss;
|
||||
}
|
||||
|
||||
public static bool IsInBiomePosition(Point tilePos)
|
||||
{
|
||||
bool sulphurPosX = false;
|
||||
|
||||
if (Abyss.AtLeftSideOfWorld)
|
||||
{
|
||||
if (tilePos.X < 435)
|
||||
if (point.X < 435)
|
||||
{
|
||||
sulphurPosX = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tilePos.X > Main.maxTilesX - 435)
|
||||
if (point.X > Main.maxTilesX - 435)
|
||||
{
|
||||
sulphurPosX = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.remixWorld)
|
||||
return tilePos.Y > SulphurousSea.YStart && tilePos.Y < Main.UnderworldLayer && sulphurPosX && !WeakReferenceSupport.InAnySubworld();
|
||||
|
||||
return tilePos.Y < (Main.rockLayer - Main.maxTilesY / 13) && sulphurPosX && !WeakReferenceSupport.InAnySubworld();
|
||||
|
||||
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";
|
||||
|
||||
@@ -1,71 +1,29 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using System;
|
||||
using Mono.Cecil.Cil;
|
||||
using MonoMod.Cil;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
//this is just a global sunken sea biome to check if you are in any of the existing biomes
|
||||
public class SunkenSeaBiome : ModBiome
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater");
|
||||
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
|
||||
public override void Load()
|
||||
{
|
||||
//apply the drawblack edits here since all sunken sea biomes will have custom backgrounds
|
||||
IL_Main.DrawBlack += ChangeBlackThreshold;
|
||||
On_Main.DrawBlack += ForceDrawBlack;
|
||||
}
|
||||
|
||||
private void ForceDrawBlack(On_Main.orig_DrawBlack orig, Main self, bool force)
|
||||
{
|
||||
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.SunkenSeaBiome>()) && Main.BackgroundEnabled)
|
||||
{
|
||||
orig(self, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
orig(self, force);
|
||||
}
|
||||
}
|
||||
|
||||
private float NewThreshold(float orig)
|
||||
{
|
||||
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.SunkenSeaBiome>()) && Main.BackgroundEnabled)
|
||||
{
|
||||
return 0.1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
return orig;
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeBlackThreshold(ILContext il)
|
||||
{
|
||||
if (Main.BackgroundEnabled)
|
||||
{
|
||||
var c = new ILCursor(il);
|
||||
c.TryGotoNext(n => n.MatchLdloc(6), n => n.MatchStloc(13)); //beginning of the loop, local 11 is a looping variable
|
||||
c.Index++; //this is kinda goofy since I dont think you could actually ever write c# to compile to the resulting IL from emitting here.
|
||||
c.Emit(OpCodes.Ldloc, 3); //pass the original value so we can set that instead if we dont want to change the threshold
|
||||
c.EmitDelegate<Func<float, float>>(NewThreshold); //check if were in the biome to set, else set the original value
|
||||
c.Emit(OpCodes.Stloc, 3); //num2 in vanilla, controls minimum threshold to turn a tile black
|
||||
}
|
||||
}
|
||||
|
||||
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.SunkenSeaBurrowsTiles > 200 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 200 ||
|
||||
BiomeTileCounterSystem.SunkenSeaReefsTiles > 200 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 200;
|
||||
return BiomeTileCounterSystem.SunkenSeaTiles > 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Waters;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class TimelessShoresBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// 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 bool IsBiomeActive(Player player)
|
||||
{
|
||||
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
|
||||
bool MoreThanBasalt = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.SunkenSeaBasaltTiles;
|
||||
bool MoreThanUnderground = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.UndergroundTiles;
|
||||
|
||||
return (BiomeTileCounterSystem.SunkenSeaShoresTiles > 1200) && MoreThanReefs && MoreThanBasalt && MoreThanUnderground;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 437 B |
@@ -1,4 +1,4 @@
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -8,10 +8,11 @@ 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;
|
||||
// The nurse can remove all alcohol debuffs individually, thus removing this by proxy.
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 446 B |
@@ -1,29 +0,0 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class BaconOilBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 3
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().baconOil = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -1,21 +1,19 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class BloodyMaryBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 871 B After Width: | Height: | Size: 582 B |
@@ -1,21 +1,19 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class CaribbeanRumBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 567 B |
@@ -1,21 +1,19 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class CinnamonRollBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 832 B After Width: | Height: | Size: 517 B |
@@ -1,21 +1,19 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class EverclearBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 2
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 819 B After Width: | Height: | Size: 633 B |
@@ -1,32 +1,24 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class EvergreenGinBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.evergreenGin = true;
|
||||
cplayer.SicknessDebuffMultiplier += EvergreenGin.DebuffBoost;
|
||||
cplayer.WaterDebuffMultiplier += EvergreenGin.DebuffBoost;
|
||||
cplayer.ElectricDebuffMultiplier -= EvergreenGin.DebuffLoss;
|
||||
cplayer.HeatDebuffMultiplier -= EvergreenGin.DebuffLoss;
|
||||
player.Calamity().evergreenGin = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 524 B |
@@ -0,0 +1,24 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
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;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().fabsolVodka = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 500 B |
@@ -1,30 +1,24 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class FireballBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.fireball = true;
|
||||
cplayer.HeatDebuffMultiplier += Fireball.DebuffBoost;
|
||||
cplayer.SicknessDebuffMultiplier -= Fireball.DebuffLoss;
|
||||
player.Calamity().fireball = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 561 B |
@@ -1,28 +1,24 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class GrapeBeerBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Grape Beer");
|
||||
Description.SetDefault("Defense reduced");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.grapeBeer = true;
|
||||
player.Calamity().grapeBeer = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 555 B |
@@ -1,29 +0,0 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class ManhattanBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.ColdDebuffMultiplier += Manhattan.DebuffBoost;
|
||||
cplayer.WaterDebuffMultiplier -= Manhattan.DebuffLoss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 815 B |
@@ -1,34 +1,24 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MargaritaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.margarita = true;
|
||||
cplayer.HeatDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.SicknessDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.ColdDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.WaterDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.ElectricDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.TypelessDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
player.Calamity().margarita = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 594 B |
@@ -1,21 +1,19 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MoonshineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 591 B |
@@ -1,21 +1,19 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MoscowMuleBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
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;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 604 B |
@@ -1,26 +0,0 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class OldFashionedBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().oldFashioned = true;
|
||||
}
|
||||
}
|
||||
}
|
||||