diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index bcc84724a1..cbd3774a58 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -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()) + { + 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()) - { - if (Main.rand.NextBool(20)) - SoundEngine.PlaySound(IjiDeathSound, Player.Center); - } - } - #endregion } } diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 24ba6bf188..e6abe872eb 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -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) diff --git a/Dusts/CalamityDusts.cs b/Dusts/CalamityDusts.cs index 8a296ee119..f894ef9f72 100644 --- a/Dusts/CalamityDusts.cs +++ b/Dusts/CalamityDusts.cs @@ -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, } } diff --git a/Effects/ArtAttackTrail.xnb b/Effects/ArtAttackTrail.xnb index 0bc53068e7..8c6d6b95d4 100644 Binary files a/Effects/ArtAttackTrail.xnb and b/Effects/ArtAttackTrail.xnb differ diff --git a/Effects/ArtemisLaserShader.xnb b/Effects/ArtemisLaserShader.xnb index 740a25a812..5440f33bfb 100644 Binary files a/Effects/ArtemisLaserShader.xnb and b/Effects/ArtemisLaserShader.xnb differ diff --git a/Effects/BasicPrimitiveShader.xnb b/Effects/BasicPrimitiveShader.xnb index 5a85a13260..9a1ba5ab5f 100644 Binary files a/Effects/BasicPrimitiveShader.xnb and b/Effects/BasicPrimitiveShader.xnb differ diff --git a/Effects/BasicTint.xnb b/Effects/BasicTint.xnb index 92969ef2f1..4b02bc2bdc 100644 Binary files a/Effects/BasicTint.xnb and b/Effects/BasicTint.xnb differ diff --git a/Effects/BlueStaticShader.xnb b/Effects/BlueStaticShader.xnb index 1d49a89e34..edaedf5ae1 100644 Binary files a/Effects/BlueStaticShader.xnb and b/Effects/BlueStaticShader.xnb differ diff --git a/Effects/BordernadoFire.xnb b/Effects/BordernadoFire.xnb index 8910c137df..121eeed7fe 100644 Binary files a/Effects/BordernadoFire.xnb and b/Effects/BordernadoFire.xnb differ diff --git a/Effects/CircularAoETelegraph.xnb b/Effects/CircularAoETelegraph.xnb index e7b1924dac..5dac18b1ff 100644 Binary files a/Effects/CircularAoETelegraph.xnb and b/Effects/CircularAoETelegraph.xnb differ diff --git a/Effects/CircularBarShader.xnb b/Effects/CircularBarShader.xnb index 712d4292cb..80fe279aab 100644 Binary files a/Effects/CircularBarShader.xnb and b/Effects/CircularBarShader.xnb differ diff --git a/Effects/CircularBarSpriteShader.xnb b/Effects/CircularBarSpriteShader.xnb index d82be3766f..9c110332bb 100644 Binary files a/Effects/CircularBarSpriteShader.xnb and b/Effects/CircularBarSpriteShader.xnb differ diff --git a/Effects/DoGDisintegration.xnb b/Effects/DoGDisintegration.xnb index d0370fbdcc..bbc4f237f3 100644 Binary files a/Effects/DoGDisintegration.xnb and b/Effects/DoGDisintegration.xnb differ diff --git a/Effects/ExoVortexShader.xnb b/Effects/ExoVortexShader.xnb index 2d14556214..9c2cdf2d16 100644 Binary files a/Effects/ExoVortexShader.xnb and b/Effects/ExoVortexShader.xnb differ diff --git a/Effects/ExobladePierceShader.xnb b/Effects/ExobladePierceShader.xnb index 3d8234611a..5fa9893e5a 100644 Binary files a/Effects/ExobladePierceShader.xnb and b/Effects/ExobladePierceShader.xnb differ diff --git a/Effects/ExobladeSlashShader.xnb b/Effects/ExobladeSlashShader.xnb index 24ee05c801..5a61b1bcb9 100644 Binary files a/Effects/ExobladeSlashShader.xnb and b/Effects/ExobladeSlashShader.xnb differ diff --git a/Effects/FadedUVMapStreak.xnb b/Effects/FadedUVMapStreak.xnb index 402aea742d..8c734f97ee 100644 Binary files a/Effects/FadedUVMapStreak.xnb and b/Effects/FadedUVMapStreak.xnb differ diff --git a/Effects/FadingSolidTrail.xnb b/Effects/FadingSolidTrail.xnb index 09b049d8a4..c57e61edc4 100644 Binary files a/Effects/FadingSolidTrail.xnb and b/Effects/FadingSolidTrail.xnb differ diff --git a/Effects/Flame.xnb b/Effects/Flame.xnb index 853fd480d5..6c73b5e2b0 100644 Binary files a/Effects/Flame.xnb and b/Effects/Flame.xnb differ diff --git a/Effects/FluidShaders.xnb b/Effects/FluidShaders.xnb index 9e747b71c0..a9321a426e 100644 Binary files a/Effects/FluidShaders.xnb and b/Effects/FluidShaders.xnb differ diff --git a/Effects/HeavenlyGaleLightningShader.xnb b/Effects/HeavenlyGaleLightningShader.xnb index b2d8463d24..6d5783ec44 100644 Binary files a/Effects/HeavenlyGaleLightningShader.xnb and b/Effects/HeavenlyGaleLightningShader.xnb differ diff --git a/Effects/HeavenlyGaleTrailShader.xnb b/Effects/HeavenlyGaleTrailShader.xnb index 6f2aa4e1a0..fcf28f8d71 100644 Binary files a/Effects/HeavenlyGaleTrailShader.xnb and b/Effects/HeavenlyGaleTrailShader.xnb differ diff --git a/Effects/ImpFlameTrail.xnb b/Effects/ImpFlameTrail.xnb index 52f3ced8d3..9eb4fe0468 100644 Binary files a/Effects/ImpFlameTrail.xnb and b/Effects/ImpFlameTrail.xnb differ diff --git a/Effects/IntersectionClipShader.xnb b/Effects/IntersectionClipShader.xnb index 476552eb84..f201a6bb61 100644 Binary files a/Effects/IntersectionClipShader.xnb and b/Effects/IntersectionClipShader.xnb differ diff --git a/Effects/LocalLinearTransformationShader.xnb b/Effects/LocalLinearTransformationShader.xnb index 2db834fa6f..184f41f1f3 100644 Binary files a/Effects/LocalLinearTransformationShader.xnb and b/Effects/LocalLinearTransformationShader.xnb differ diff --git a/Effects/MiracleBlight.fx b/Effects/MiracleBlight.fx index a06a30d5d9..86cd3a861b 100644 --- a/Effects/MiracleBlight.fx +++ b/Effects/MiracleBlight.fx @@ -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 diff --git a/Effects/MiracleBlight.xnb b/Effects/MiracleBlight.xnb index 5c9bc50858..4d65ec53c6 100644 Binary files a/Effects/MiracleBlight.xnb and b/Effects/MiracleBlight.xnb differ diff --git a/Effects/PhaseslayerRipShader.xnb b/Effects/PhaseslayerRipShader.xnb index 9548bf8b01..44fa03af03 100644 Binary files a/Effects/PhaseslayerRipShader.xnb and b/Effects/PhaseslayerRipShader.xnb differ diff --git a/Effects/PixelatedSightLine.xnb b/Effects/PixelatedSightLine.xnb index 495482fd95..de93208781 100644 Binary files a/Effects/PixelatedSightLine.xnb and b/Effects/PixelatedSightLine.xnb differ diff --git a/Effects/PrimTextureOverlayShader.xnb b/Effects/PrimTextureOverlayShader.xnb index 3841478d15..7f4004da66 100644 Binary files a/Effects/PrimTextureOverlayShader.xnb and b/Effects/PrimTextureOverlayShader.xnb differ diff --git a/Effects/PrismCrystalStreak.xnb b/Effects/PrismCrystalStreak.xnb index d4e2eaf3ab..10e8411c26 100644 Binary files a/Effects/PrismCrystalStreak.xnb and b/Effects/PrismCrystalStreak.xnb differ diff --git a/Effects/RancorMagicCircle.xnb b/Effects/RancorMagicCircle.xnb index b6dd176c8c..565184684a 100644 Binary files a/Effects/RancorMagicCircle.xnb and b/Effects/RancorMagicCircle.xnb differ diff --git a/Effects/RotateSprite.xnb b/Effects/RotateSprite.xnb index bb01095749..fd51404d21 100644 Binary files a/Effects/RotateSprite.xnb and b/Effects/RotateSprite.xnb differ diff --git a/Effects/RoverDriveShield.xnb b/Effects/RoverDriveShield.xnb index 3c2aff89b2..ad0acba4f7 100644 Binary files a/Effects/RoverDriveShield.xnb and b/Effects/RoverDriveShield.xnb differ diff --git a/Effects/SCalMouseShader.xnb b/Effects/SCalMouseShader.xnb index e7a580d7ff..026df479da 100644 Binary files a/Effects/SCalMouseShader.xnb and b/Effects/SCalMouseShader.xnb differ diff --git a/Effects/ScarletDevilStreak.xnb b/Effects/ScarletDevilStreak.xnb index e889ca263e..e360f61523 100644 Binary files a/Effects/ScarletDevilStreak.xnb and b/Effects/ScarletDevilStreak.xnb differ diff --git a/Effects/SideStreakTrail.xnb b/Effects/SideStreakTrail.xnb index 127abd9dda..4720c1c32b 100644 Binary files a/Effects/SideStreakTrail.xnb and b/Effects/SideStreakTrail.xnb differ diff --git a/Effects/SpreadTelegraph.xnb b/Effects/SpreadTelegraph.xnb index 119de6115b..77a06cba8c 100644 Binary files a/Effects/SpreadTelegraph.xnb and b/Effects/SpreadTelegraph.xnb differ diff --git a/Effects/SupremeShieldShader.xnb b/Effects/SupremeShieldShader.xnb index 33573596b1..9a60c6f376 100644 Binary files a/Effects/SupremeShieldShader.xnb and b/Effects/SupremeShieldShader.xnb differ diff --git a/Effects/SwingSprite.xnb b/Effects/SwingSprite.xnb index 2b25c17768..3fc80cb765 100644 Binary files a/Effects/SwingSprite.xnb and b/Effects/SwingSprite.xnb differ diff --git a/Effects/TeleportDisplacementShader.xnb b/Effects/TeleportDisplacementShader.xnb index fa5052b480..666d95c5ab 100644 Binary files a/Effects/TeleportDisplacementShader.xnb and b/Effects/TeleportDisplacementShader.xnb differ diff --git a/Effects/TentacleShader.xnb b/Effects/TentacleShader.xnb index bdd381797e..5ebc09bdfe 100644 Binary files a/Effects/TentacleShader.xnb and b/Effects/TentacleShader.xnb differ diff --git a/Effects/WulfrumScaffoldSelection.xnb b/Effects/WulfrumScaffoldSelection.xnb index 01ea0622eb..ebf94fcb96 100644 Binary files a/Effects/WulfrumScaffoldSelection.xnb and b/Effects/WulfrumScaffoldSelection.xnb differ diff --git a/Effects/WulfrumTilePing.xnb b/Effects/WulfrumTilePing.xnb index a1533af383..2dd6d79468 100644 Binary files a/Effects/WulfrumTilePing.xnb and b/Effects/WulfrumTilePing.xnb differ diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f2c26331f0..47481bbb68 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -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("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons"), 1); + msd.UseOpacity(0.48f); DrawData dd = new() { texture = TextureAssets.Npc[npc.type].Value, diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index fa4c8d05e9..4b44480451 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -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(), new Tuple(false, new int[] { BuffID.OnFire }) }, + { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, + { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, + { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, + { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, + + // 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(), new Tuple(false, new int[] { ModContent.BuffType() }) }, + { ModContent.NPCType(), new Tuple(false, CalamityMod.cragEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.cragEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.cragEnemyImmunities) }, @@ -196,11 +206,6 @@ namespace CalamityMod { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, - { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, - { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, - { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, - { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, - { ModContent.NPCType(), new Tuple(false, CalamityMod.abyssEnemyImmunities) }, { ModContent.NPCType(), new Tuple(true, Array.Empty()) }, { ModContent.NPCType(), new Tuple(true, Array.Empty()) },