diff --git a/ExtraTextures/Jesus.png b/ExtraTextures/Jesus.png new file mode 100644 index 0000000000..8750d55c55 Binary files /dev/null and b/ExtraTextures/Jesus.png differ diff --git a/Particles/CustomSpark.cs b/Particles/CustomSpark.cs index f0fdc3c22b..eec7780240 100644 --- a/Particles/CustomSpark.cs +++ b/Particles/CustomSpark.cs @@ -20,13 +20,14 @@ namespace CalamityMod.Particles public Vector2 Stretch = new Vector2(0.5f, 1.6f); public float ShrinkSpeed = 0; public bool FlipHorizontal = false; + public bool NoShrink = false; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public bool AltVisual = true; public override bool UseAdditiveBlend => AltVisual; public override bool SetLifetime => true; public override bool UseCustomDraw => true; - public CustomSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color color, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false) + public CustomSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color color, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false) { Position = relativePosition; Velocity = velocity; @@ -46,6 +47,7 @@ namespace CalamityMod.Particles GlowCenterScale = glowCenterScale; GlowOpacity = glowOpacity; FlipHorizontal = flipHorizontal; + NoShrink = noShrink; FadeIn = fadeIn; @@ -57,7 +59,8 @@ namespace CalamityMod.Particles { if (!FadeIn) { - Scale *= 0.95f; + if (!NoShrink) + Scale *= 0.95f; Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); } else diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index 2ff632ba34..c63ebf1b27 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -279,19 +279,22 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if ((!falling || Projectile.numHits != 0) && !stealth) + if (stealth) + { + float minMult = 0.35f; + int hitsToMinMult = 10; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + } + else if (!falling || Projectile.numHits != 0) modifiers.SourceDamage *= 0.1f; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { bool onKill = ((target.life <= 0 && target.realLife == -1) || target.lifeMax == 1); - if (!onKill && (falling || stealth)) + if (!onKill && falling) { - if (stealth) - { - - } - else + if (!stealth) { time = 0; SoundStyle sound = new("CalamityMod/Sounds/NPCHit/ExoHit4"); @@ -315,37 +318,53 @@ namespace CalamityMod.Projectiles.Rogue } if (stealth) { - SoundStyle soundBurst = new("CalamityMod/Sounds/Item/HolyBurst"); - for (int i = 0; i < 3; i++) - SoundEngine.PlaySound(soundBurst with { Volume = 0.8f, Pitch = 0.2f * i, MaxInstances = 3 }, Projectile.Center); - SoundStyle soundExplosion = new("CalamityMod/Sounds/Item/HolyColliderProjectileHit"); - SoundEngine.PlaySound(soundExplosion with { Volume = 0.65f, Pitch = 0.6f}, Projectile.Center); - + if (Main.zenithWorld) + { + for (int index = 0; index < Main.npc.Length; index++) + { + NPC searchedTarget = Main.npc[index]; + searchedTarget.active = false; + } + + SoundStyle gfb = new("CalamityMod/Sounds/Item/HolyBurst"); + for (int i = 0; i < 7; i++) + SoundEngine.PlaySound(gfb with { Volume = 1f, Pitch = 0.2f * i, MaxInstances = 7 }, Projectile.Center); + } + else + { + Owner.Calamity().GeneralScreenShakePower = 7f; + SoundStyle soundBurst = new("CalamityMod/Sounds/Item/HolyBurst"); + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(soundBurst with { Volume = 0.8f, Pitch = 0.2f * i, MaxInstances = 3 }, Projectile.Center); + SoundStyle soundExplosion = new("CalamityMod/Sounds/Item/HolyColliderProjectileHit"); + SoundEngine.PlaySound(soundExplosion with { Volume = 0.65f, Pitch = 0.6f }, Projectile.Center); + + for (int i = 0; i < 4; i++) + { + for (int y = 0; y < 24; y++) + { + bool red = Main.rand.NextBool(5); + float variance = Main.rand.NextFloat(0.7f, 1); + float placementVariance = 35; + Vector2 fxVel = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 * i) * Main.rand.NextFloat(y * 1.2f, y * 1.5f) * (i == 0 ? 1.7f : 1) * variance; + Vector2 fxPos = crossCenter + Main.rand.NextVector2CircularEdge(placementVariance - variance * placementVariance, placementVariance - variance * placementVariance); + Dust dust = Dust.NewDustPerfect(fxPos, ModContent.DustType(), fxVel * 1.7f, 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + dust.noGravity = true; + dust.scale = (red ? 1.4f : 1.2f) * Main.rand.NextFloat(0.7f, 0.9f); + dust.color = red ? Color.Red : mainColor; + if (y % 2 == 0) + { + Particle spark = new GlowSparkParticle(fxPos, fxVel, false, 24, 0.065f, Main.rand.NextBool() ? Color.Khaki : mainColor, new Vector2(0.8f, 0.3f), true, false, 0.5f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + Vector2 fxVel2 = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 * i) * (i == 0 ? 1.7f : 1); + Particle bigCross = new CustomSpark(crossCenter + fxVel2 * 145, fxVel2, "CalamityMod/Particles/BloomLineFade", false, 15, 0.15f, mainColor, new Vector2(1.8f, 1.2f), true, true, 0, false, false, 0.8f, 0.8f, 0.8f); + GeneralParticleHandler.SpawnParticle(bigCross); + } + } Projectile crossBurst = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), crossCenter, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), 0f, Owner.whoAmI); crossBurst.Calamity().stealthStrike = true; - for (int i = 0; i < 4; i++) - { - for (int y = 0; y < 24; y++) - { - bool red = Main.rand.NextBool(5); - float variance = Main.rand.NextFloat(0.7f, 1); - float placementVariance = 35; - Vector2 fxVel = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 * i) * Main.rand.NextFloat(y * 1.2f, y * 1.5f) * (i == 0 ? 1.7f : 1) * variance; - Vector2 fxPos = crossCenter + Main.rand.NextVector2CircularEdge(placementVariance - variance * placementVariance, placementVariance - variance * placementVariance); - Dust dust = Dust.NewDustPerfect(fxPos, ModContent.DustType(), fxVel * 1.7f, 0, default, Main.rand.NextFloat(1.2f, 1.6f)); - dust.noGravity = true; - dust.scale = (red ? 1.4f : 1.2f) * Main.rand.NextFloat(0.7f, 0.9f); - dust.color = red ? Color.Red : mainColor; - if (y % 2 == 0) - { - Particle spark = new GlowSparkParticle(fxPos, fxVel, false, 24, 0.065f, Main.rand.NextBool() ? Color.Khaki : mainColor, new Vector2(0.8f, 0.3f), true, false, 0.5f); - GeneralParticleHandler.SpawnParticle(spark); - } - } - Vector2 fxVel2 = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 * i) * (i == 0 ? 1.7f : 1); - Particle bigCross = new CustomSpark(crossCenter + fxVel2 * 145, fxVel2, "CalamityMod/Particles/BloomLineFade", false, 15, 0.15f, mainColor, new Vector2(1.8f, 1.2f), true, true, 0, false, false, 0.8f, 0.8f, 0.8f); - GeneralParticleHandler.SpawnParticle(bigCross); - } } else { diff --git a/Projectiles/Rogue/ExorcismShockwave.cs b/Projectiles/Rogue/ExorcismShockwave.cs index 55dc3c14b8..40234674e5 100644 --- a/Projectiles/Rogue/ExorcismShockwave.cs +++ b/Projectiles/Rogue/ExorcismShockwave.cs @@ -1,7 +1,13 @@ -using Microsoft.Xna.Framework; +using CalamityMod.NPCs.Yharon; +using CalamityMod.UI; +using System; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent; using Terraria.ModLoader; +using System.Text.RegularExpressions; namespace CalamityMod.Projectiles.Rogue { @@ -42,5 +48,17 @@ namespace CalamityMod.Projectiles.Rogue bool verticalHit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - Vector2.UnitY * crossSize, Projectile.Center + Vector2.UnitY * crossSize * 1.7f, crosThickness, ref _); return (horizontalHit || verticalHit); } + public override bool PreDraw(ref Color lightColor) + { + Player Owner = Main.player[Projectile.owner]; + float fade = Utils.GetLerpValue(0, 9, Projectile.timeLeft, true); + Asset him = ModContent.Request("CalamityMod/ExtraTextures/Jesus"); + + if (Projectile.Calamity().stealthStrike && Main.zenithWorld) + { + Main.EntitySpriteDraw(him.Value, Owner.Center - Main.screenPosition, null, Color.White * 0.45f * fade, 0, him.Size() / 2f, 10, SpriteEffects.None, 0); + } + return false; + } } }