Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into 1.4.4
This commit is contained in:
commit
8a9169f6e4
22 files changed
+199
-214
No files matched your search
@@ -230,6 +230,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int spiritOriginConvertedCrit = 0;
|
||||
public int RustyMedallionCooldown = 0;
|
||||
public float SulphWaterPoisoningLevel;
|
||||
public float holyInfernoFadeIntensity;
|
||||
public NPC unstableSelectedTarget;
|
||||
public int zapActivity = 0;
|
||||
public bool ragePulse = false;
|
||||
@@ -2230,6 +2231,7 @@ namespace CalamityMod.CalPlayer
|
||||
hideOfDeusTimer = 0;
|
||||
RustyMedallionCooldown = 0;
|
||||
SulphWaterPoisoningLevel = 0f;
|
||||
holyInfernoFadeIntensity = 0f;
|
||||
spiritOriginConvertedCrit = 0;
|
||||
rage = 0f;
|
||||
adrenaline = 0f;
|
||||
|
||||
@@ -936,17 +936,24 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (!Main.rand.NextBool(3))
|
||||
continue;
|
||||
|
||||
Dust holyCinder = Dust.NewDustDirect(Player.position, Player.width, Player.head, (int)CalamityDusts.ProfanedFire);
|
||||
|
||||
Dust holyCinder = Dust.NewDustDirect(Player.position, Player.width, Player.height, (int)CalamityDusts.ProfanedFire);
|
||||
holyCinder.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
|
||||
holyCinder.velocity.Y -= Main.rand.NextFloat(1f, 3f);
|
||||
holyCinder.scale = Main.rand.NextFloat(1.15f, 1.45f);
|
||||
holyCinder.noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
ProvidenceBurnEffectDrawer.Update();
|
||||
|
||||
if (hInferno && holyInfernoFadeIntensity < 1f)
|
||||
{
|
||||
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity + 0.015f, 0f, 1f);
|
||||
}
|
||||
else if (!hInferno && holyInfernoFadeIntensity > 0f)
|
||||
{
|
||||
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity - 0.01f, 0f, 1f);
|
||||
}
|
||||
// Transformer immunity to Electrified
|
||||
if (transformer)
|
||||
Player.buffImmune[BuffID.Electrified] = true;
|
||||
|
||||
@@ -305,9 +305,6 @@ namespace CalamityMod
|
||||
Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky();
|
||||
|
||||
Filters.Scene["CalamityMod:Providence"] = new Filter(new ProvScreenShaderData("FilterMiniTower").UseColor(0.45f, 0.4f, 0.2f).UseOpacity(0.5f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:Providence"] = new ProvSky();
|
||||
|
||||
Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky();
|
||||
|
||||
|
||||
@@ -179,12 +179,13 @@ namespace CalamityMod.Effects
|
||||
#endregion
|
||||
|
||||
//
|
||||
// All below shaders were added by Amber
|
||||
// Authorship goes to Toasty
|
||||
// All below shaders were added or created by Amber
|
||||
// Authorship for the PrimitiveClearShader goes to Toasty
|
||||
//
|
||||
|
||||
#region Amber's Shaders
|
||||
internal static Effect PrimitiveClearShader;
|
||||
internal static Effect HolyInfernoShader;
|
||||
#endregion
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
@@ -390,6 +391,10 @@ namespace CalamityMod.Effects
|
||||
#region Loading Amber's Shaders
|
||||
PrimitiveClearShader = LoadShader("PrimitiveClearShader");
|
||||
RegisterScreenShader(PrimitiveClearShader, "AutoloadPass", "PrimitiveClearShader");
|
||||
|
||||
HolyInfernoShader = LoadShader("HolyInfernoShader");
|
||||
RegisterMiscShader(HolyInfernoShader, "InfernoPass", "HolyInfernoShader");
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
sampler diagonalNoise : register(s1);
|
||||
sampler upwardNoise : register(s2);
|
||||
sampler upwardPerlinTex : register(s3);
|
||||
|
||||
float colorMult;
|
||||
float time;
|
||||
float radius;
|
||||
float maxOpacity;
|
||||
float burnIntensity;
|
||||
|
||||
float2 screenPosition;
|
||||
float2 screenSize;
|
||||
float2 anchorPoint;
|
||||
float2 playerPosition;
|
||||
|
||||
float InverseLerp(float a, float b, float t)
|
||||
{
|
||||
return saturate((t - a) / (b - a));
|
||||
}
|
||||
|
||||
float3 firePalette(float noise)
|
||||
{
|
||||
// Temperature range (in Kelvin).
|
||||
float temperature = 1500. + 1500. * noise;
|
||||
|
||||
float3 orange = float3(0.81, 0.45, 0.23) * colorMult;
|
||||
float3 golden = float3(1., 0.75, 0.29) * colorMult;
|
||||
float3 lightYellow = float3(1., 1., 0.95) * colorMult;
|
||||
float3 fireColor;
|
||||
if (noise < 0.5)
|
||||
fireColor = lerp(orange, golden, noise * 2.);
|
||||
else
|
||||
fireColor = lerp(golden, lightYellow, (noise - 0.5) * 2.);
|
||||
|
||||
fireColor = pow(fireColor, float3(5, 5, 5)) * (exp(1.43876719683e5 / (temperature * fireColor)) - 1.);
|
||||
|
||||
// Exposure level. Set to "50." For "70," change the "5" to a "7," etc.
|
||||
return 1. - exp(-1.3e8 / fireColor);
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 uv : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float2 worldUV = screenPosition + screenSize * uv;
|
||||
float2 provUV = anchorPoint / screenSize;
|
||||
float worldDistance = distance(worldUV, anchorPoint);
|
||||
float adjustedTime = time * 0.1;
|
||||
|
||||
// Pixelate the uvs
|
||||
float2 pixelatedUV = worldUV / screenSize;
|
||||
pixelatedUV.x -= worldUV.x % (1 / screenSize.x);
|
||||
pixelatedUV.y -= worldUV.y % (1 / (screenSize.y / 2) * 2);
|
||||
|
||||
// Sample the noise textures
|
||||
float noiseMesh1 = tex2D(upwardNoise, frac(pixelatedUV * 0.58 + float2(0, time * 0.25))).g;
|
||||
float noiseMesh2 = tex2D(upwardPerlinTex, frac(pixelatedUV * 1.57 + float2(0, time * 0.35))).g;
|
||||
float noiseMesh3 = tex2D(diagonalNoise, frac(pixelatedUV * 1.46 + float2(adjustedTime * 0.56, adjustedTime * 1.2))).g;
|
||||
float noiseMesh4 = tex2D(diagonalNoise, frac(pixelatedUV * 1.57 + float2(adjustedTime * -0.56, adjustedTime * 1.2))).g;
|
||||
float textureMesh = noiseMesh1 * 0.125 + noiseMesh2 * 0.2 + noiseMesh3 * 0.35 + noiseMesh4 * 0.35;
|
||||
|
||||
// Get the distance to the pixel from the player.
|
||||
float distToPlayer = distance(playerPosition, worldUV);
|
||||
// And get the correct opacity based on it.
|
||||
float opacity = burnIntensity;
|
||||
// Fade in quickly as the player approaches the pixels
|
||||
opacity += InverseLerp(800, 500, distToPlayer);
|
||||
|
||||
// Define the border and mix the inferno for a smooth transition
|
||||
bool border = worldDistance < radius && opacity > 0;
|
||||
float colorMult = 1;
|
||||
if (border)
|
||||
colorMult = InverseLerp(radius * 0.94, radius, worldDistance);
|
||||
opacity = clamp(opacity, 0, maxOpacity);
|
||||
// If the color multi has not been changed (not border pixel) and opacity is 0 OR it's within
|
||||
if (colorMult == 1 && (opacity == 0 || worldDistance < radius))
|
||||
return sampleColor;
|
||||
|
||||
return float4(firePalette(textureMesh), 1) * colorMult * opacity;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass InfernoPass
|
||||
{
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 285 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 325 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 327 KiB |
@@ -35,7 +35,7 @@ namespace CalamityMod.Graphics.Drawers
|
||||
On_Main.DrawNPCs += DrawNPCDrawers;
|
||||
On_Main.DrawProjectiles += DrawProjectileDrawers;
|
||||
On_Main.DrawPlayers_AfterProjectiles += DrawPlayerDrawers;
|
||||
On_Main.DoDraw_WallsTilesNPCs += DrawBeforeTileDrawers;
|
||||
On_Main.DrawBackgroundBlackFill += DrawBeforeTileDrawers;
|
||||
On_Main.DrawInfernoRings += DrawAfterEverythingDrawers;
|
||||
|
||||
var drawerType = typeof(BaseDrawer);
|
||||
@@ -64,7 +64,7 @@ namespace CalamityMod.Graphics.Drawers
|
||||
On_Main.DrawNPCs -= DrawNPCDrawers;
|
||||
On_Main.DrawProjectiles -= DrawProjectileDrawers;
|
||||
On_Main.DrawPlayers_AfterProjectiles -= DrawPlayerDrawers;
|
||||
On_Main.DoDraw_WallsTilesNPCs -= DrawBeforeTileDrawers;
|
||||
On_Main.DrawBackgroundBlackFill -= DrawBeforeTileDrawers;
|
||||
On_Main.DrawInfernoRings -= DrawAfterEverythingDrawers;
|
||||
|
||||
foreach (var drawer in Drawers)
|
||||
@@ -143,7 +143,7 @@ namespace CalamityMod.Graphics.Drawers
|
||||
Main.spriteBatch.End();
|
||||
}
|
||||
|
||||
private void DrawBeforeTileDrawers(On_Main.orig_DoDraw_WallsTilesNPCs orig, Main self)
|
||||
private void DrawBeforeTileDrawers(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
|
||||
{
|
||||
var drawers = Drawers.Where(drawer => drawer.ShouldDraw && drawer.Layer is DrawerLayer.BeforeTiles);
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
using Rectangle = Microsoft.Xna.Framework.Rectangle;
|
||||
|
||||
namespace CalamityMod.Graphics.Drawers
|
||||
{
|
||||
public class HolyInfernoDrawer : BaseDrawer
|
||||
{
|
||||
#region Fields/Properties
|
||||
|
||||
public override DrawerLayer Layer => DrawerLayer.BeforeTiles;
|
||||
|
||||
public Providence Provi => (Main.npc[CalamityGlobalNPC.holyBoss].ModNPC as Providence);
|
||||
|
||||
//Should only draw if not in the main menu, provi is active and the boolean for drawing the border is true.
|
||||
public override bool ShouldDraw => !Main.gameMenu && CalamityGlobalNPC.holyBoss != -1 &&
|
||||
Main.npc[CalamityGlobalNPC.holyBoss].active && (Main.npc[CalamityGlobalNPC.holyBoss].ModNPC as Providence).shouldDrawInfernoBorder;
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public override void DrawToTarget(SpriteBatch spriteBatch)
|
||||
{
|
||||
var npc = Main.npc[CalamityGlobalNPC.holyBoss];
|
||||
var provi = npc.ModNPC as Providence;
|
||||
var borderStartEnd = provi.borderStartEnd;
|
||||
if (borderStartEnd.Item1 > 0f && npc.HasValidTarget)
|
||||
{
|
||||
var target = Main.player[Main.myPlayer];
|
||||
var holyInfernoIntensity = target.Calamity().holyInfernoFadeIntensity;
|
||||
|
||||
//Begin drawing the inferno
|
||||
var blackTile = TextureAssets.MagicPixel;
|
||||
var diagonalNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
|
||||
var upwardPerlinNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Perlin");
|
||||
var upwardNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoise");
|
||||
|
||||
var shader = GameShaders.Misc["CalamityMod:HolyInfernoShader"].Shader;
|
||||
shader.Parameters["colorMult"].SetValue(7.35f); //I want you to know it took considerable restraint to deliberately misspell colour.
|
||||
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
|
||||
shader.Parameters["radius"].SetValue(borderStartEnd.Item2);
|
||||
shader.Parameters["anchorPoint"].SetValue(npc.Center);
|
||||
shader.Parameters["screenPosition"].SetValue(Main.screenPosition);
|
||||
shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2());
|
||||
shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity);
|
||||
shader.Parameters["playerPosition"].SetValue(target.Center);
|
||||
shader.Parameters["maxOpacity"].SetValue(1f);
|
||||
|
||||
spriteBatch.GraphicsDevice.Textures[1] = diagonalNoise.Value;
|
||||
spriteBatch.GraphicsDevice.Textures[2] = upwardNoise.Value;
|
||||
spriteBatch.GraphicsDevice.Textures[3] = upwardPerlinNoise.Value;
|
||||
|
||||
//Manual end begin for the sampler state
|
||||
spriteBatch.End();
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, shader, Main.GameViewMatrix.TransformationMatrix);
|
||||
Rectangle rekt = new(Main.screenWidth / 2, Main.screenHeight / 2, Main.screenWidth, Main.screenHeight);
|
||||
spriteBatch.Draw(blackTile.Value, rekt, null, default, 0f, blackTile.Value.Size() * 0.5f, 0, 0f);
|
||||
//Inferno drawing complete
|
||||
spriteBatch.ExitShaderRegion();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -297,7 +297,7 @@ namespace CalamityMod.ILEditing
|
||||
self.velocity = Collision.AdvancedTileCollision(TileID.Sets.ForAdvancedCollision.ForSandshark, cPosition, self.velocity, cWidth, cHeight, fall, fall, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (self.active && self.Calamity().ShouldFallThroughPlatforms)
|
||||
fall = true;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.DemonScythe, Do(AutoReuse, DamageExact(33)) },
|
||||
{ ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar
|
||||
{ ItemID.ElectrosphereLauncher, Do(DamageRatio(1.1f)) },
|
||||
{ ItemID.ElfMelter, Do(DamageExact(62), ShootSpeedDelta(+5f)) },
|
||||
{ ItemID.ElfMelter, Do(DamageExact(55), ShootSpeedDelta(+5f)) },
|
||||
{ ItemID.EmeraldStaff, Do(DamageExact(27)) },
|
||||
{ ItemID.EmpressBlade, Do(AutoReuse, DamageExact(60), UseExact(20)) }, // Terraprisma
|
||||
{ ItemID.EnchantedBoomerang, Do(DamageExact(24)) },
|
||||
@@ -107,7 +107,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.Flairon, Do(DamageExact(73)) },
|
||||
{ ItemID.Flamarang, Do(DamageExact(43)) },
|
||||
{ ItemID.Flamelash, Do(DamageRatio(1.25f)) },
|
||||
{ ItemID.Flamethrower, Do(ShootSpeedDelta(+3f)) },
|
||||
{ ItemID.Flamethrower, Do(DamageExact(24), ShootSpeedDelta(+3f)) },
|
||||
{ ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f)) }, // Uses ratios due to remix seed
|
||||
{ ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(30), DamageExact(70), ShootSpeedExact(14)) },
|
||||
{ ItemID.FlyingKnife, Do(DamageExact(70)) },
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 3;
|
||||
Item.damage = 4;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.width = 30;
|
||||
Item.height = 44;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useTime = 22;
|
||||
Item.useAnimation = 22;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 2.2f;
|
||||
|
||||
@@ -13,10 +13,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
Item.width = 82;
|
||||
Item.height = 82;
|
||||
Item.damage = 16;
|
||||
Item.damage = 12;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.useAnimation = 24;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTime = Item.useAnimation = 24;
|
||||
Item.knockBack = 3.5f;
|
||||
@@ -29,6 +28,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
|
||||
public override float StealthDamageMultiplier => 0.65f;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
public float Knockback = 2f;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 8;
|
||||
Item.damage = 10;
|
||||
Item.mana = 10;
|
||||
Item.width = Item.height = 44;
|
||||
Item.useTime = Item.useAnimation = 32;
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
public class ProvScreenShaderData : ScreenShaderData
|
||||
{
|
||||
private int ProvIndex;
|
||||
|
||||
public ProvScreenShaderData(string passName)
|
||||
: base(passName)
|
||||
{
|
||||
}
|
||||
|
||||
private void UpdatePIndex()
|
||||
{
|
||||
int ProvType = ModContent.NPCType<Providence>();
|
||||
if (ProvIndex >= 0 && Main.npc[ProvIndex].active && Main.npc[ProvIndex].type == ProvType)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ProvIndex = -1;
|
||||
for (int i = 0; i < Main.npc.Length; i++)
|
||||
{
|
||||
if (Main.npc[i].active && Main.npc[i].type == ProvType)
|
||||
{
|
||||
ProvIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (ProvIndex == -1)
|
||||
{
|
||||
UpdatePIndex();
|
||||
if (ProvIndex == -1)
|
||||
Filters.Scene["CalamityMod:Providence"].Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Apply()
|
||||
{
|
||||
UpdatePIndex();
|
||||
if (ProvIndex != -1)
|
||||
{
|
||||
UseTargetPosition(Main.npc[ProvIndex].Center);
|
||||
}
|
||||
base.Apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
public class ProvSky : CustomSky
|
||||
{
|
||||
private bool isActive = false;
|
||||
private float intensity = 0f;
|
||||
private int ProvIndex = -1;
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (ProvIndex == -1)
|
||||
{
|
||||
UpdatePIndex();
|
||||
if (ProvIndex == -1)
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
if (isActive && intensity < 1f)
|
||||
{
|
||||
intensity += 0.01f;
|
||||
}
|
||||
else if (!isActive && intensity > 0f)
|
||||
{
|
||||
intensity -= 0.01f;
|
||||
}
|
||||
}
|
||||
|
||||
private float GetIntensity()
|
||||
{
|
||||
if (UpdatePIndex())
|
||||
{
|
||||
float x = 0f;
|
||||
if (ProvIndex != -1)
|
||||
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[ProvIndex].Center);
|
||||
|
||||
float spawnAnimationTimer = 180f;
|
||||
float intensityScalar = 0.25f;
|
||||
if (Main.npc[ProvIndex].Calamity().newAI[3] < spawnAnimationTimer)
|
||||
intensityScalar = MathHelper.Lerp(0f, intensityScalar, Main.npc[ProvIndex].Calamity().newAI[3] / spawnAnimationTimer);
|
||||
|
||||
return (Main.player[Main.myPlayer].HasBuff(ModContent.BuffType<HolyInferno>()) ? 0.75f : (1f - Utils.SmoothStep(3000f, 6000f, x)) * intensityScalar);
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override Color OnTileColor(Color inColor)
|
||||
{
|
||||
float intensity = GetIntensity();
|
||||
return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity));
|
||||
}
|
||||
|
||||
private bool UpdatePIndex()
|
||||
{
|
||||
int ProvType = ModContent.NPCType<Providence>();
|
||||
if (ProvIndex >= 0 && Main.npc[ProvIndex].active && Main.npc[ProvIndex].type == ProvType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
ProvIndex = -1;
|
||||
for (int i = 0; i < Main.npc.Length; i++)
|
||||
{
|
||||
if (Main.npc[i].active && Main.npc[i].type == ProvType)
|
||||
{
|
||||
ProvIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ProvIndex != -1;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (maxDepth >= 0 && minDepth < 0)
|
||||
{
|
||||
float intensity = GetIntensity();
|
||||
Color color = Main.zenithWorld ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Main.dayTime ? new Color(255, 200, 100) : new Color(100, 150, 255);
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color * intensity);
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetCloudAlpha()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override void Activate(Vector2 position, params object[] args)
|
||||
{
|
||||
isActive = true;
|
||||
}
|
||||
|
||||
public override void Deactivate(params object[] args)
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public override bool IsActive()
|
||||
{
|
||||
return isActive || intensity > 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,11 +37,9 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.UI;
|
||||
using Filters = Terraria.Graphics.Effects.Filters;
|
||||
|
||||
namespace CalamityMod.NPCs.Providence
|
||||
@@ -89,10 +87,12 @@ namespace CalamityMod.NPCs.Providence
|
||||
private int phaseChange = 0;
|
||||
private int frameUsed = 0;
|
||||
private int healTimer = 0;
|
||||
internal bool challenge = Main.expertMode/* && Main.netMode == NetmodeID.SinglePlayer*/; //Used to determine if Profaned Soul Crystal should drop, couldn't figure out mp mems always dropping it so challenge is singleplayer only.
|
||||
internal bool challenge = Main.expertMode; //Used to determine if Profaned Soul Crystal should drop, couldn't figure out mp mems always dropping it so challenge is singleplayer only.
|
||||
internal bool hasTakenDaytimeDamage = false;
|
||||
public bool shouldDrawInfernoBorder = true; //This is only here for other mods to disable it if they don't want it drawing.
|
||||
public bool Dying = false;
|
||||
public int DeathAnimationTimer;
|
||||
public Tuple<float, float> borderStartEnd = new (0f, 0f);
|
||||
|
||||
//Sounds
|
||||
public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/Providence/ProvidenceSpawn") { Volume = 1.2f };
|
||||
@@ -190,6 +190,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
writer.Write(SoundWarningLevel);
|
||||
writer.Write(Dying);
|
||||
writer.Write(DeathAnimationTimer);
|
||||
writer.Write(borderStartEnd.Item1);
|
||||
writer.Write(borderStartEnd.Item2);
|
||||
writer.Write(shouldDrawInfernoBorder);
|
||||
for (int i = 0; i < 4; i++)
|
||||
writer.Write(NPC.Calamity().newAI[i]);
|
||||
}
|
||||
@@ -215,6 +218,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
SoundWarningLevel = reader.ReadSingle();
|
||||
Dying = reader.ReadBoolean();
|
||||
DeathAnimationTimer = reader.ReadInt32();
|
||||
borderStartEnd = new (reader.ReadSingle(), reader.ReadSingle());
|
||||
shouldDrawInfernoBorder = reader.ReadBoolean();
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
NPC.Calamity().newAI[i] = reader.ReadSingle();
|
||||
|
||||
@@ -1826,6 +1832,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
if (CalamityGlobalNPC.holyBossAttacker != -1 && Main.npc[CalamityGlobalNPC.holyBossAttacker].active)
|
||||
guardianAlive = true;
|
||||
|
||||
|
||||
if (CalamityGlobalNPC.holyBossDefender != -1 && Main.npc[CalamityGlobalNPC.holyBossDefender].active)
|
||||
guardianAlive = true;
|
||||
|
||||
@@ -1847,6 +1854,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
|
||||
float drawFireDistanceStart = maxDistance - 800f;
|
||||
borderStartEnd = new (drawFireDistanceStart, maxDistance);
|
||||
return Utils.GetLerpValue(drawFireDistanceStart, maxDistance, distanceToTarget, true);
|
||||
}
|
||||
|
||||
@@ -2341,7 +2349,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition;
|
||||
Main.spriteBatch.Draw(heatTex, shieldDrawPos, null, Color.White, 0, heatTex.Size() / 2f, shieldScale * scaleMult * 0.5f, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert
|
||||
{ ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(400)) },
|
||||
{ ProjectileID.Flamarang, Do(ExtraUpdatesExact(2)) },
|
||||
{ ProjectileID.Flames, Do(IDStaticIFrames(5)) }, // Flamethrower AND Elf Melter flames
|
||||
{ ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1)) },
|
||||
{ ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor
|
||||
{ ProjectileID.FlowerPow, Do(ExtraUpdatesExact(1)) },
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
if (!MinionBuffMode) // "Break" the minion after every 3 hits if in charging
|
||||
{
|
||||
HitCounter++;
|
||||
if (HitCounter >= 3)
|
||||
if (HitCounter >= 4)
|
||||
{
|
||||
for (int i = 0; i <= 5; i++)
|
||||
{
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Systems
|
||||
{
|
||||
public class ProvBackgroundScene : ModSceneEffect
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<Providence>());
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Providence", isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user