1 - Finished Miracle Blight visuals. Players just produce dust because shadering players is absurdly hard.
2 - Made Ares immune to Miracle Blight to sidestep visual issue where he vanishes.
This commit is contained in:
1 parent
7c342c87d4
commit
0a7405dd0f
46 files changed
+73
-32
No files matched your search
+11
-11
@@ -6358,6 +6358,17 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Anomaly's Nanogun Kill Sound
|
||||
public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer && Player.ActiveItem().type == ModContent.ItemType<TheAnomalysNanogun>())
|
||||
{
|
||||
if (Main.rand.NextBool(20))
|
||||
SoundEngine.PlaySound(IjiDeathSound, Player.Center);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Nurse Modifications
|
||||
public override bool ModifyNurseHeal(NPC nurse, ref int health, ref bool removeDebuffs, ref string chatText)
|
||||
{
|
||||
@@ -6908,16 +6919,5 @@ namespace CalamityMod.CalPlayer
|
||||
CombatText.NewText(location, messageColor, Language.GetTextValue(text));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Kill
|
||||
public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer && Player.ActiveItem().type == ModContent.ItemType<TheAnomalysNanogun>())
|
||||
{
|
||||
if (Main.rand.NextBool(20))
|
||||
SoundEngine.PlaySound(IjiDeathSound, Player.Center);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,6 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -396,6 +394,18 @@ namespace CalamityMod.CalPlayer
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.miracleBlight)
|
||||
{
|
||||
// Violent dust fountain
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Vector2 dustCorner = Player.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-15f, -12f));
|
||||
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, (int)CalamityDusts.MiracleBlight, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
drawInfo.DustCache.Add(d);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.pFlames)
|
||||
{
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace CalamityMod.Dusts
|
||||
namespace CalamityMod.Dusts
|
||||
{
|
||||
public enum CalamityDusts : int
|
||||
{
|
||||
@@ -16,5 +16,6 @@ namespace CalamityMod.Dusts
|
||||
PurpleCosmilite = 173,
|
||||
// This is what God Slayer Slugs use, at least. I'm not sure about other Cosmilite stuff, didn't bother to check.
|
||||
BlueCosmilite = 180,
|
||||
MiracleBlight = 163,
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+14
-11
@@ -29,29 +29,32 @@ float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0
|
||||
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
|
||||
|
||||
// Temporal drift to make the sprite slide through the noise texture
|
||||
float2 drift = float2(5 * sin(8.33 * uTime), 40 * uTime);
|
||||
float2 drift = float2(5 * sin(8.33 * uTime), 220 * uTime);
|
||||
|
||||
float2 noiseMapTexCoords = framedCoords * uSourceRect.zw + drift;
|
||||
|
||||
float4 noiseColor = tex2D(uImage1, noiseMapTexCoords / uImageSize1);
|
||||
return noiseColor;
|
||||
|
||||
/*
|
||||
float noiseRedErasureThreshold = fadeThreshold + 0.08;
|
||||
// Define thresholds for total pixel erasure and glowing lines.
|
||||
//
|
||||
// Rapidly flickering sinewave produced by Desmos, loosely based on the Weierstrass function
|
||||
// (infinitely sharp vague sinewave, periodic, continuous everywhere but differentiable nowhere)
|
||||
// https://en.wikipedia.org/wiki/Weierstrass_function
|
||||
// float fullErasureThreshold = uOpacity + (0.02 * cos(7 * uTime)) + (0.02 * cos(31 * uTime)) + (0.01 * sin(167 * uTime));
|
||||
float fullErasureThreshold = uOpacity;
|
||||
float glowThreshold = fullErasureThreshold - 0.1;
|
||||
|
||||
// If the noise over the slightly higher threshold, completely erase this pixel.
|
||||
if (perlin.r > noiseRedErasureThreshold)
|
||||
// If the noise over the erasure threshold, completely erase this pixel.
|
||||
if (noiseColor.r > fullErasureThreshold)
|
||||
{
|
||||
color.rgba = 0;
|
||||
}
|
||||
// Otherwise, if the noise is over the original threshold, replace this pixel with glowing energy lines.
|
||||
else if (perlin.r > fadeThreshold)
|
||||
// Otherwise, if it's over the slightly lower threshold, replace it with a bright color.
|
||||
else if (noiseColor.r > glowThreshold)
|
||||
{
|
||||
color = float4(125.0 / 255, 1, 0, 1);
|
||||
}
|
||||
// Otherwise do nothing.
|
||||
|
||||
return color;
|
||||
*/
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5388,6 +5388,28 @@ namespace CalamityMod.NPCs
|
||||
Lighting.AddLight(npc.position, 0.1f, 0f, 0.135f);
|
||||
}
|
||||
|
||||
if (miracleBlight > 0)
|
||||
{
|
||||
void spawnMiracleBlightDust()
|
||||
{
|
||||
Vector2 dustCorner = npc.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-15f, -12f));
|
||||
Dust d = Dust.NewDustDirect(dustCorner, npc.width + 4, npc.height + 4, (int)CalamityDusts.MiracleBlight, dustVel.X, dustVel.Y);
|
||||
d.noGravity = true;
|
||||
}
|
||||
|
||||
// Miracle Blight spawned dust scales with the NPC's size
|
||||
float blightDustFactor = 0.0005f;
|
||||
float dustToCreate = blightDustFactor * npc.width * npc.height;
|
||||
if (dustToCreate > 5f)
|
||||
dustToCreate = 5f;
|
||||
for (int i = 0; i < (int)dustToCreate; ++i)
|
||||
spawnMiracleBlightDust();
|
||||
|
||||
if (dustToCreate < 1f && Main.rand.NextFloat() < dustToCreate)
|
||||
spawnMiracleBlightDust();
|
||||
}
|
||||
|
||||
if (astralInfection > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 3)
|
||||
@@ -5833,8 +5855,8 @@ namespace CalamityMod.NPCs
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix);
|
||||
|
||||
MiscShaderData msd = GameShaders.Misc["CalamityMod:MiracleBlight"];
|
||||
msd.UseImage1("Images/Misc/Perlin"); // provided by vanilla Terraria
|
||||
msd.UseOpacity(0.25f);
|
||||
msd.SetShaderTexture(Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons"), 1);
|
||||
msd.UseOpacity(0.48f);
|
||||
DrawData dd = new()
|
||||
{
|
||||
texture = TextureAssets.Npc[npc.type].Value,
|
||||
|
||||
+10
-5
@@ -13,6 +13,7 @@ using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.NPCs.Crags;
|
||||
using CalamityMod.NPCs.Cryogen;
|
||||
using CalamityMod.NPCs.DevourerofGods;
|
||||
using CalamityMod.NPCs.ExoMechs.Ares;
|
||||
using CalamityMod.NPCs.ExoMechs.Thanatos;
|
||||
using CalamityMod.NPCs.Leviathan;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
@@ -186,6 +187,15 @@ namespace CalamityMod
|
||||
|
||||
{ ModContent.NPCType<Yharon>(), new Tuple<bool, int[]>(false, new int[] { BuffID.OnFire }) },
|
||||
|
||||
{ ModContent.NPCType<ThanatosHead>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<ThanatosBody1>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<ThanatosBody2>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<ThanatosTail>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
|
||||
// 20FEB2023: Ozzatron: made Ares immune to Miracle Blight, because otherwise he vanishes when affected by it
|
||||
// The "correct" way to fix this involves a colossal amount of work and will be handled at a later date
|
||||
{ ModContent.NPCType<AresBody>(), new Tuple<bool, int[]>(false, new int[] { ModContent.BuffType<MiracleBlight>() }) },
|
||||
|
||||
{ ModContent.NPCType<SupremeCalamitas>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<SupremeCatastrophe>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<SupremeCataclysm>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
@@ -196,11 +206,6 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<SepulcherBodyEnergyBall>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<SepulcherTail>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
|
||||
{ ModContent.NPCType<ThanatosHead>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<ThanatosBody1>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<ThanatosBody2>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<ThanatosTail>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
|
||||
{ ModContent.NPCType<AdultEidolonWyrmHead>(), new Tuple<bool, int[]>(false, CalamityMod.abyssEnemyImmunities) },
|
||||
{ ModContent.NPCType<AdultEidolonWyrmBody>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
{ ModContent.NPCType<AdultEidolonWyrmBodyAlt>(), new Tuple<bool, int[]>(true, Array.Empty<int>()) },
|
||||
|
||||
Reference in new issue
Block a user