From 20346d00676ccbe59d58559ebffa2e8a65dfc146 Mon Sep 17 00:00:00 2001 From: Xyk Date: Tue, 27 Aug 2024 23:18:53 -0700 Subject: [PATCH] Ontological Despoiler P2 Still needs sounds and localization stuff --- Items/Weapons/Ranged/OntologicalDespoiler.cs | 19 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 2 +- Particles/CustomSpark.cs | 7 +- Particles/VoidBeam.png | Bin 0 -> 3032 bytes Particles/VoidBeamGlow.png | Bin 0 -> 2965 bytes Particles/VoidSparkParticle.cs | 8 +- ...lBurst.cs => OntoligicalDespoilerBurst.cs} | 14 +- .../Ranged/OntologicalDespoilerBeam.cs | 232 ++++--------- .../Ranged/OntologicalDespoilerGrenade.cs | 310 +++++++++--------- .../Ranged/OntologicalDespoilerHoldout.cs | 138 +++++--- .../Ranged/OntologicalDespoilerHoldout2.png | Bin 0 -> 6218 bytes .../Ranged/OntologicalDespoilerShot.cs | 13 +- 12 files changed, 325 insertions(+), 418 deletions(-) create mode 100644 Particles/VoidBeam.png create mode 100644 Particles/VoidBeamGlow.png rename Projectiles/Ranged/{NullBurst.cs => OntoligicalDespoilerBurst.cs} (78%) create mode 100644 Projectiles/Ranged/OntologicalDespoilerHoldout2.png diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 5bd8aeef47..bee870c2ab 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -1,5 +1,4 @@ using System.Linq; -using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; @@ -15,13 +14,17 @@ namespace CalamityMod.Items.Weapons.Ranged [LegacyName("MolecularManipulator")] public class OntologicalDespoiler : ModItem, ILocalizedModType { - public static readonly SoundStyle ChargeLV1 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1") { Volume = 0.6f }; - public static readonly SoundStyle ChargeLV2 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2") { Volume = 0.6f }; - public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeStart") { Volume = 0.6f }; - public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLoop") { Volume = 0.6f }; + public static readonly SoundStyle ChargeLV1 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1"); + public static readonly SoundStyle ChargeLV2 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2"); + public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeStart"); + public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLoop"); internal static readonly int ChargeLoopSoundFrames = 151; - public static readonly SoundStyle SmallShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserSmallShot") { PitchVariance = 0.3f }; - public static readonly SoundStyle BigShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserBigShot") { PitchVariance = 0.3f }; + public static readonly SoundStyle SmallShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserSmallShot"); + public static readonly SoundStyle BigShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserBigShot"); + public static readonly SoundStyle SmallImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1"); + public static readonly SoundStyle LargeImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2"); + + public bool shotType = true; // true = positive shot, false = negative shot public new string LocalizationCategory => "Items.Weapons.Ranged"; @@ -35,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 88; Item.height = 34; - Item.damage = 772; + Item.damage = 426; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = 8; Item.noMelee = true; diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index df3cbdd213..4fe9d24541 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -245,8 +245,8 @@ WildfireBloomFlare.DisplayName: Wildfire Flare WulfrumScrapBullet.DisplayName: High Speed Scrap HellbornProj.DisplayName: Hell-born Gunblast HellbornShell.DisplayName: Hell's Shell -NullBurst.DisplayName: Null Burst NullFlash.DisplayName: Null Flash OntologicalDespoilerBeam.DisplayName: Ontological Despoiler Beam OntologicalDespoilerGrenade.DisplayName: Ontological Despoiler Grenade OntologicalDespoilerShot.DisplayName: Ontological Despoiler Shot +OntoligicalDespoilerBurst.DisplayName: Ontoligical Despoiler Burst diff --git a/Particles/CustomSpark.cs b/Particles/CustomSpark.cs index 6b2b72ef92..6c219f7485 100644 --- a/Particles/CustomSpark.cs +++ b/Particles/CustomSpark.cs @@ -16,13 +16,14 @@ namespace CalamityMod.Particles public string NewTexture; public float ExtraRotation; public Vector2 Stretch = new Vector2(0.5f, 1.6f); + public float ShrinkSpeed = 0; 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) + 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) { Position = relativePosition; Velocity = velocity; @@ -35,6 +36,7 @@ namespace CalamityMod.Particles FadeInScale = scale; Lifetime = lifetime; Color = InitialColor = color; + ShrinkSpeed = shrinkSpeed; AltVisual = useAddativeBlend; GlowCenter = glowCenter; @@ -70,6 +72,9 @@ namespace CalamityMod.Particles Velocity.Y += 0.25f; } Rotation = Velocity.ToRotation() + MathHelper.PiOver2 + ExtraRotation; + + Stretch.X *= (1 - 0.2f * ShrinkSpeed); + Stretch.Y *= (1 + 0.2f * ShrinkSpeed); } public override void CustomDraw(SpriteBatch spriteBatch) diff --git a/Particles/VoidBeam.png b/Particles/VoidBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..dcbbd1848b2fc9eb288c411797e1f6a2f02f4d94 GIT binary patch literal 3032 zcmV;}3n%o6P)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9ETgVfL z1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$XejWfQDiI(Fdt@un?|lo#M+5oIi_w{w zo%_#%{(V=tO#a9gB!7-$M?^BX5>d|Vn*3S!?g~$*UQipUPL&zMmg;!4Do9IA%up=Rh? z=qPj=x&RGBx1dpI68aT-2O}^EromdU5o`ssU{5#*j)WJ%$?!5bA1;Eoz?EiTr=n?cd`V|I)p<|3Oju?MT93~aB0<#&j8`F+Cg&D?-VWzQItUA^l>xvD zRIYI4MQ`g1<+DyrL=EogS06Xii({| zv`U^zjmmKqDIK93(F5q|^fLNk`gQs{RV`IdRle#b)i%{Ds;|}NsClUI)k@Ub)kf6b zsWa4l)YH_rsduU0(?DsMX@qO!YV6TCtMPOW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ykw%TE-Wv6xh`g1Pmxy9nxe7w ze(PI{6^cd0H#WFzsN0CzDA+i-Y3`<~O&?2mB^OJrODjs>Z{}{k_?699m0x|@lC)*8 z%%N=0R?Jr6*6Z8cw;d=~F3&F?+a9vLa|dHb$&Qyhm+ZVyVOLSNi?B>BD~Ee(8aT1AWbo&CM;EEoH56tE6@EV8X%6-*|u1-NtOIZ>P7H z9s-9XhaP{M`0e$>L5F*fu#U8SXZT%h2eqT56Y5;vIn|ZYCGC#u9zGg)w718lr{jCe z@An_mJyvsE<#^c%!il02pHAkVoIaIx>gnm^(__6$dheWxJ#(!uyl?Pq(Ao3ne9xWf z_v}A;-u3*k3(gmgUSwVDy5w-FbHIL};|Kd6ItCpEJBJ*Hx-UCj?irppeBz4xmD5+f zub#UWaP88_{E^}7QP*$YNVp-r$-DXJR{E{yw{vdK+*xxMeYfPE(!GlNn)e%iH2tw% z>L5Kn>ODH}V8MesW8ASPKV|>)e!S=*`C-L`&P4Mg+egPHeJ3wJUif(YN!F8@r^P=j z|6Kdbc>FRj6+1QlT=e|YubW?}zu5oM?q%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01FZT01FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R16005y$L_t(oh3(c$ii1!PK+%(c z+bTEW2UjMFE=0E_i5Ur*gr*^%m+)#*lPWmFd&0%tM8p}IrU7l+f}$uqW43Jr!!Uqx z9KpJ-$H^5=$-`a^`Ufz>ehgNY true; public override bool UseCustomDraw => true; public override bool UseAdditiveBlend => false; public override string Texture => "CalamityMod/Particles/LargeSpark"; - public VoidSparkParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color) + public VoidSparkParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, float shrinkSpeed = 1) { Position = relativePosition; Velocity = velocity; @@ -26,6 +27,7 @@ namespace CalamityMod.Particles Scale = scale; Lifetime = lifetime; Color = InitialColor = color; + ShrinkSpeed = shrinkSpeed; } public override void Update() @@ -33,8 +35,8 @@ namespace CalamityMod.Particles Scale *= 0.9f; Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); Velocity *= 0.95f; - Ylength *= 1.25f; - Xlength *= 0.7f; + Ylength *= (1 + (0.25f * ShrinkSpeed)); + Xlength *= (1 - (0.3f * ShrinkSpeed)); if (Velocity.Length() < 12f && AffectedByGravity) { diff --git a/Projectiles/Ranged/NullBurst.cs b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs similarity index 78% rename from Projectiles/Ranged/NullBurst.cs rename to Projectiles/Ranged/OntoligicalDespoilerBurst.cs index dc0851ec5d..61eb931736 100644 --- a/Projectiles/Ranged/NullBurst.cs +++ b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs @@ -1,16 +1,10 @@ -using CalamityMod.CalPlayer; -using CalamityMod.NPCs; -using CalamityMod.NPCs.NormalNPCs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class NullBurst : ModProjectile, ILocalizedModType + public class OntoligicalDespoilerBurst : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -35,10 +29,10 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.9f); + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.damage < 1) Projectile.damage = 1; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.ai[2] == 0 ? 150 : 300, targetHitbox); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 300, targetHitbox); } } diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 519e37fdb7..80cf6ec23c 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Particles; @@ -20,212 +21,99 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public ref float time => ref Projectile.ai[0]; - public Color baseColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); - public int sineDir = 1; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 25; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - } + public Color baseColor = Color.White; + public bool fading = false; public override void SetDefaults() { - Projectile.width = 28; - Projectile.height = 28; + Projectile.width = 45; + Projectile.height = 45; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.timeLeft = 400; + Projectile.timeLeft = 1200; Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 4; + Projectile.extraUpdates = 80; Projectile.tileCollide = false; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; } public override void AI() { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (time == 0) + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + bool inRange = targetDist < 1400; + + Projectile.rotation = Projectile.velocity.ToRotation(); + if (time <= 5) + Projectile.scale = 0.1f; + else if (Projectile.scale < 1 && !fading) + Projectile.scale += 0.07f; + else if (fading) { - Projectile.scale = Projectile.ai[1] == 5 ? 2.2f : 1.5f; - sineDir = Main.rand.NextBool() ? 1 : -1; + Projectile.velocity *= 0.992f; + Projectile.scale *= 0.992f; } - float rate = (Main.GlobalTimeWrappedHourly * 5); - List eColors = new List() - { - Color.Turquoise, - Color.Orchid - }; - int colorIndex = (int)(rate / 2 % eColors.Count); - Color currentColor = eColors[colorIndex]; - Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; - if (!Main.zenithWorld) - baseColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); - - if (Projectile.ai[1] == 5 && !Main.zenithWorld) - baseColor = Color.White; - - if (time == 5) + if (time > 11) { - for (int i = 0; i < 4; i++) + if (Main.rand.NextBool(4) && !fading) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 4).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.2f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), ModContent.DustType(), Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(2.3f, 5.8f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.15f, 1.35f); + dust.scale = Main.rand.NextFloat(1.3f, 2.15f); dust.color = baseColor; } - } - if (time > 20) - { - if (Projectile.ai[1] == 5) + if (Main.rand.NextBool(12) && !fading) { - // Spawn in a helix-style pattern - float sine = (float)Math.Sin(Projectile.timeLeft * 0.575f / MathHelper.Pi); - - Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 16f; - float scale = Main.rand.NextFloat(0.8f, 1.1f); - if (Main.rand.NextBool(2)) + Particle beam = new CustomSpark(Projectile.Center - Projectile.velocity * 8, Projectile.velocity * Main.rand.NextFloat(0.5f, 4f), "CalamityMod/Particles/DrainLine", false, 80, 4.5f * Projectile.scale, Color.Black, new Vector2(0.4f, 3f), false, false, 0, false, false, 0); + GeneralParticleHandler.SpawnParticle(beam); + } + if (time % (fading ? 2 : 1) == 0) + { + for (int i = 0; i < 2; i++) { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset * sineDir, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); - dust2.noGravity = true; - dust2.scale = scale; - dust2.color = baseColor; - } - if (Main.rand.NextBool(2)) - { - Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset * sineDir, /*Projectile.ai[1] == 5 ? ModContent.DustType() : */ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); - dust3.noGravity = true; - dust3.scale = scale; - dust3.color = baseColor; - } - } - else if (Main.rand.NextBool(13)) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.05f, 1.65f); - dust.color = baseColor; - } - } - if (time > 13 && time < 34 && Projectile.ai[2] > 0) - { - Projectile.Center += Projectile.velocity.RotatedBy((Projectile.ai[2] == 1 ? MathHelper.PiOver2 : -MathHelper.PiOver2)) * 0.2f; - } - - if (Projectile.ai[1] == 5) - { - NPC targetedNPC = Projectile.Center.ClosestNPCAt(700); - if (targetedNPC != null && time > 30 && Projectile.numHits < 1 && Vector2.Distance(targetedNPC.Center, Projectile.Center) < 700) - { - Vector2 position = targetedNPC.Center; - Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX); - if (Projectile.velocity.Length() < 8 - (Utils.GetLerpValue(150, 0, Projectile.timeLeft, true) * 2)) - Projectile.velocity += moveToMouse * (0.42f + Utils.GetLerpValue(300, 150, Projectile.timeLeft, true)); - else - Projectile.velocity *= 0.9f; - } - } - else - { - if (Projectile.timeLeft < 100) - { - Projectile.velocity *= 0.96f; - Projectile.scale *= 0.98f; - } - Projectile.timeLeft--; - if (Projectile.timeLeft <= 1) - { - for (int i = 0; i < 4; i++) - { - Particle orb2 = new LineParticle(Projectile.Center, (Projectile.velocity * 5).RotatedByRandom(0.05f) * Main.rand.NextFloat(0.1f, 1f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), baseColor); - GeneralParticleHandler.SpawnParticle(orb2); + bool glow = i == 0; + Particle beam = new CustomSpark(Projectile.Center - Projectile.velocity * 8, -Projectile.velocity * 0.1f, glow ? "CalamityMod/Particles/VoidBeamGlow" : "CalamityMod/Particles/VoidBeam", false, 23, 2.3f * Projectile.scale, glow ? baseColor : Color.Black, Vector2.One, glow ? true : false, false, 0, false, false, 0.5f); + GeneralParticleHandler.SpawnParticle(beam); } } } - time++; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.ai[1] == 5) + for (int i = 0; i < 30; i++) { - for (int i = 0; i < 8; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.2f, 1f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.15f, 1.45f); - dust.color = baseColor; - } - Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.3f, 0.65f, 13); - GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloomRingLayered", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.4f, 0.75f, 13, false); + float dustPower = Main.rand.NextFloat(0.2f, 1f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Projectile.velocity * 15 * (dustPower * dustPower)).RotatedByRandom(1f - dustPower * dustPower) * Main.rand.NextFloat(0.9f, 1f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(2.15f, 3.45f) * dustPower; + dust.color = baseColor; + Dust dust3 = Dust.NewDustPerfect(Projectile.Center, 278, (Projectile.velocity * 25 * (dustPower * dustPower)).RotatedByRandom(1f - dustPower * dustPower) * Main.rand.NextFloat(0.9f, 1f)); + dust3.noGravity = true; + dust3.scale = Main.rand.NextFloat(1.35f, 1.75f) * dustPower; + dust3.color = baseColor; + Particle orb2 = new AltLineParticle(Projectile.Center, (Projectile.velocity * 15 * (dustPower * dustPower)).RotatedByRandom(1f - dustPower * dustPower) * Main.rand.NextFloat(0.9f, 1f), false, Main.rand.Next(30, 38 + 1), Main.rand.NextFloat(2.6f, 3.3f) * dustPower, Color.Black); GeneralParticleHandler.SpawnParticle(orb2); - Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.4f, 0.25f, 16, false); + } + Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.5f, 1.35f, 18); + GeneralParticleHandler.SpawnParticle(orb); + for (int i = 0; i < 6; i++) + { + Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.05f - i * 0.1f, 0.4f, 25 - i * 2, false); GeneralParticleHandler.SpawnParticle(orb3); } - else - { - for (int i = 0; i < 3; i++) - { - Particle orb2 = new LineParticle(Projectile.Center, (Projectile.velocity * 2).RotatedByRandom(0.1f) * Main.rand.NextFloat(0.1f, 1f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), baseColor); - GeneralParticleHandler.SpawnParticle(orb2); - } - } - SoundStyle fire = new("CalamityMod/Sounds/Item/NullHit"); - SoundEngine.PlaySound(fire with { Volume = (Projectile.ai[1] == 5 ? 1 : 0.7f), Pitch = Main.rand.NextFloat(0, 0.1f) * (Projectile.ai[1] == 5 ? 3 : 1) }, Projectile.Center); - if (Main.zenithWorld) - { - #region NPC Nullification - int nullBuff = Main.rand.Next(8); - switch (nullBuff) - { - case 0: - if (target.type != ModContent.NPCType()) - target.damage += 10; - break; - case 1: - target.damage -= 10; - break; - case 2: - target.knockBackResist = 0f; - break; - case 3: - target.knockBackResist = 1f; - break; - case 4: - target.defense += 5; - break; - case 5: - target.defense -= 5; - break; - case 6: - target.scale *= 2f; - break; - case 7: - target.scale *= 0.5f; - break; - default: - break; - } - #endregion - } - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.97f); - if (Projectile.damage < 1) - Projectile.damage = 1; + + fading = true; + Projectile.velocity *= 0.5f; + Projectile.scale = 1.3f; + + SoundStyle fire = new("CalamityMod/Sounds/Item/TheHiveNuke"); + SoundEngine.PlaySound(fire with { Volume = 1, Pitch = Main.rand.NextFloat(0, 0.1f) }, Projectile.Center); + SoundStyle fire2 = new("CalamityMod/Sounds/Item/MeldExplosion"); + SoundEngine.PlaySound(fire2 with { Volume = 1, Pitch = Main.rand.NextFloat(-0.5f, -0.6f) }, Projectile.Center); } + public override bool? CanDamage() => Projectile.numHits < 1 ? null : false; public override bool PreDraw(ref Color lightColor) { - if (time < 18) - return false; - - Asset tex = ModContent.Request("CalamityMod/Particles/DrainLineBloom"); - Asset tex2 = ModContent.Request("CalamityMod/Particles/DrainLine"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], baseColor with { A = 0 } * 0.35f, 1, tex.Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Projectile.ai[1] == 5 ? Color.Black : Color.Lerp(baseColor, Color.White, 0.5f), 1, tex2.Value, true, true); return false; } } diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index 6ebcd696fa..ff3cac8802 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; -using CalamityMod.CalPlayer; using CalamityMod.Dusts; -using CalamityMod.NPCs; -using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Particles; +using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -21,7 +19,12 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/Ranged/OntologicalDespoilerGrenade"; public ref float time => ref Projectile.ai[0]; public Color baseColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); - public int sineDir = 1; + public bool explode = true; + + public Color color1 = Color.DarkMagenta; + public Color color2 = Color.DarkOrchid; + public Color color3 = Color.Purple; + public Color color4 = Color.BlueViolet; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 25; @@ -29,203 +32,190 @@ namespace CalamityMod.Projectiles.Ranged } public override void SetDefaults() { - Projectile.width = 28; - Projectile.height = 28; + Projectile.width = 40; + Projectile.height = 40; Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 400; + Projectile.penetrate = 1; + Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 4; + Projectile.extraUpdates = 2; Projectile.tileCollide = false; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; } public override void AI() { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (time == 0) + Projectile.rotation = Projectile.velocity.ToRotation(); + + Projectile.frameCounter++; + if (Projectile.frameCounter > 12) { - Projectile.scale = Projectile.ai[1] == 5 ? 2.2f : 1.5f; - sineDir = Main.rand.NextBool() ? 1 : -1; + Projectile.frame++; + Projectile.frameCounter = 0; } - float rate = (Main.GlobalTimeWrappedHourly * 5); + if (Projectile.frame > 5) + { + Projectile.frame = 0; + } + + if (time < 60) + Projectile.velocity *= 0.979f; + + float rate = (Main.GlobalTimeWrappedHourly * 15); List eColors = new List() { - Color.Turquoise, - Color.Orchid + color1, + color2, + color3, + color4 }; int colorIndex = (int)(rate / 2 % eColors.Count); Color currentColor = eColors[colorIndex]; Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; - if (!Main.zenithWorld) - baseColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + baseColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); - if (Projectile.ai[1] == 5 && !Main.zenithWorld) - baseColor = Color.White; - - if (time == 5) - { - for (int i = 0; i < 4; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 4).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.2f, 1f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.15f, 1.35f); - dust.color = baseColor; - } - } if (time > 20) { - if (Projectile.ai[1] == 5) - { - // Spawn in a helix-style pattern - float sine = (float)Math.Sin(Projectile.timeLeft * 0.575f / MathHelper.Pi); + // Spawn in a helix-style pattern + float sine = (float)Math.Sin(Projectile.timeLeft * 0.575f / MathHelper.Pi); - Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 16f; - float scale = Main.rand.NextFloat(0.8f, 1.1f); - if (Main.rand.NextBool(2)) - { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset * sineDir, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); - dust2.noGravity = true; - dust2.scale = scale; - dust2.color = baseColor; - } - if (Main.rand.NextBool(2)) - { - Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset * sineDir, /*Projectile.ai[1] == 5 ? ModContent.DustType() : */ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); - dust3.noGravity = true; - dust3.scale = scale; - dust3.color = baseColor; - } - } - else if (Main.rand.NextBool(13)) + Projectile.scale = MathHelper.Clamp(1 + sine, 0.7f, 1.3f); + + Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 12f; + float scale = Main.rand.NextFloat(1.3f, 1.4f); + if (Main.rand.NextBool(3)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + offset, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + dust2.noGravity = true; + dust2.scale = scale; + dust2.color = baseColor; + } + if (Main.rand.NextBool(3)) + { + Dust dust3 = Dust.NewDustPerfect(Projectile.Center - offset, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f)); + dust3.noGravity = true; + dust3.scale = scale; + dust3.color = baseColor; + } + } + + if (Projectile.timeLeft == 1) + explode = false; + + NPC targetedNPC = Projectile.Center.ClosestNPCAt(1200); + if (targetedNPC != null && time > 60 && Projectile.numHits < 1 && Vector2.Distance(targetedNPC.Center, Projectile.Center) < 1200) + { + Vector2 position = targetedNPC.Center; + Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX); + if (Projectile.velocity.Length() < 6 - (Utils.GetLerpValue(350, 0, Projectile.timeLeft, true))) + Projectile.velocity += moveToMouse * (0.02f + Utils.GetLerpValue(550, 250, Projectile.timeLeft, true)); + else + Projectile.velocity *= 0.9f; + explode = true; + } + time++; + } + public override void OnKill(int timeLeft) + { + Player Owner = Main.player[Projectile.owner]; + + if (explode) + { + Owner.Calamity().GeneralScreenShakePower = 8.5f; + + for (int i = 0; i < 40; i++) + { + Color useColor = Main.rand.Next(4) switch + { + 0 => color1, + 1 => color2, + 2 => color3, + _ => color4, + }; + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Projectile.velocity * 6).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.05f, 1.65f); - dust.color = baseColor; - } - } - if (time > 13 && time < 34 && Projectile.ai[2] > 0) - { - Projectile.Center += Projectile.velocity.RotatedBy((Projectile.ai[2] == 1 ? MathHelper.PiOver2 : -MathHelper.PiOver2)) * 0.2f; - } + dust.scale = Main.rand.NextFloat(1.85f, 2.45f); + dust.color = useColor; - if (Projectile.ai[1] == 5) - { - NPC targetedNPC = Projectile.Center.ClosestNPCAt(700); - if (targetedNPC != null && time > 30 && Projectile.numHits < 1 && Vector2.Distance(targetedNPC.Center, Projectile.Center) < 700) - { - Vector2 position = targetedNPC.Center; - Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX); - if (Projectile.velocity.Length() < 8 - (Utils.GetLerpValue(150, 0, Projectile.timeLeft, true) * 2)) - Projectile.velocity += moveToMouse * (0.42f + Utils.GetLerpValue(300, 150, Projectile.timeLeft, true)); - else - Projectile.velocity *= 0.9f; - } - } - else - { - if (Projectile.timeLeft < 100) - { - Projectile.velocity *= 0.96f; - Projectile.scale *= 0.98f; - } - Projectile.timeLeft--; - if (Projectile.timeLeft <= 1) - { - for (int i = 0; i < 4; i++) + if (i % 2 == 0) { - Particle orb2 = new LineParticle(Projectile.Center, (Projectile.velocity * 5).RotatedByRandom(0.05f) * Main.rand.NextFloat(0.1f, 1f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), baseColor); + Particle orb2 = new CustomSpark(Projectile.Center, new Vector2(0, -40).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f), "CalamityMod/Particles/Sparkle", false, 40, Main.rand.NextFloat(1.4f, 2.4f), useColor, new Vector2(0.4f, 1.1f)); GeneralParticleHandler.SpawnParticle(orb2); } } - } - - time++; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Projectile.ai[1] == 5) - { - for (int i = 0; i < 8; i++) + for (int i = 0; i < 3; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 5 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.2f, 1f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1.15f, 1.45f); - dust.color = baseColor; + Color useColor = Main.rand.Next(4) switch + { + 0 => color1, + 1 => color2, + 2 => color3, + _ => color4, + }; + Particle orb4 = new CustomPulse(Projectile.Center, Vector2.Zero, useColor, "CalamityMod/Particles/SoftRoundExplosion", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 0.4f - i * 0.03f, 13); + GeneralParticleHandler.SpawnParticle(orb4); } - Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.3f, 0.65f, 13); + Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, baseColor, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.15f, 2.5f, 38); GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloomRingLayered", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.4f, 0.75f, 13, false); - GeneralParticleHandler.SpawnParticle(orb2); - Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.4f, 0.25f, 16, false); + int parts = 8; + float rot = Main.rand.NextFloat(-9, 9); + for (int i = 0; i < parts; i++) + { + Color useColor = Main.rand.Next(4) switch + { + 0 => color1, + 1 => color2, + 2 => color3, + _ => color4, + }; + Particle orb2 = new CustomSpark(Projectile.Center, new Vector2(0, -15 * (i % 2 == 0 ? 1.8f : 1f)).RotatedBy(i * (MathHelper.ToRadians(360f) / parts)).RotatedBy(rot), "CalamityMod/Particles/VerticalSmear", false, 19, 3, useColor, new Vector2(0.2f, 1)); + GeneralParticleHandler.SpawnParticle(orb2); + } + Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 1.2f, 39, false); GeneralParticleHandler.SpawnParticle(orb3); + + SoundStyle fire = new("CalamityMod/Sounds/Item/EarthMeteor"); + SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = Main.rand.NextFloat(0, 0.1f) * -3 }, Projectile.Center); + + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 2f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); } else { - for (int i = 0; i < 3; i++) + for (int i = 0; i < 20; i++) { - Particle orb2 = new LineParticle(Projectile.Center, (Projectile.velocity * 2).RotatedByRandom(0.1f) * Main.rand.NextFloat(0.1f, 1f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), baseColor); - GeneralParticleHandler.SpawnParticle(orb2); + Color useColor = Main.rand.Next(4) switch + { + 0 => color1, + 1 => color2, + 2 => color3, + _ => color4, + }; + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Projectile.velocity * 3).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.85f, 2.45f); + dust.color = useColor; } } - SoundStyle fire = new("CalamityMod/Sounds/Item/NullHit"); - SoundEngine.PlaySound(fire with { Volume = (Projectile.ai[1] == 5 ? 1 : 0.7f), Pitch = Main.rand.NextFloat(0, 0.1f) * (Projectile.ai[1] == 5 ? 3 : 1) }, Projectile.Center); - if (Main.zenithWorld) - { - #region NPC Nullification - int nullBuff = Main.rand.Next(8); - switch (nullBuff) - { - case 0: - if (target.type != ModContent.NPCType()) - target.damage += 10; - break; - case 1: - target.damage -= 10; - break; - case 2: - target.knockBackResist = 0f; - break; - case 3: - target.knockBackResist = 1f; - break; - case 4: - target.defense += 5; - break; - case 5: - target.defense -= 5; - break; - case 6: - target.scale *= 2f; - break; - case 7: - target.scale *= 0.5f; - break; - default: - break; - } - #endregion - } - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.97f); - if (Projectile.damage < 1) - Projectile.damage = 1; } public override bool PreDraw(ref Color lightColor) { - if (time < 18) + if (time < 2) return false; - Asset tex = ModContent.Request("CalamityMod/Particles/DrainLineBloom"); - Asset tex2 = ModContent.Request("CalamityMod/Particles/DrainLine"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], baseColor with { A = 0 } * 0.35f, 1, tex.Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Projectile.ai[1] == 5 ? Color.Black : Color.Lerp(baseColor, Color.White, 0.5f), 1, tex2.Value, true, true); + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation; + + Asset tex = ModContent.Request("CalamityMod/Particles/DrainLineBloom2"); + Asset tex2 = ModContent.Request("CalamityMod/Particles/DrainLine2"); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], baseColor with { A = 0 } * 0.8f, 1, tex.Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Black, 1, tex2.Value, true, true); + + Asset tex3 = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerGrenade"); + Rectangle frame = tex3.Frame(1, 6, 0, Projectile.frame); + Vector2 rotationPoint = frame.Size() * 0.5f; + for (int i = 0; i < 4; i++) + Main.EntitySpriteDraw(tex3.Value, drawPosition + Main.rand.NextVector2Circular(7, 7), frame, baseColor with { A = 0 }, drawRotation, rotationPoint, 1, SpriteEffects.None); + Main.EntitySpriteDraw(tex3.Value, drawPosition, frame, baseColor, drawRotation, rotationPoint, 1, SpriteEffects.None); + return false; } } diff --git a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs index a4d5da785b..3d61418ff6 100644 --- a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs +++ b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Reflection.Metadata; using CalamityMod.Dusts; -using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; @@ -11,8 +9,6 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Utilities; using Terraria; using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -43,12 +39,14 @@ namespace CalamityMod.Projectiles.Ranged public Color color4 = Color.BlueViolet; public bool hasBegunFiring = false; - public bool Positive => Projectile.ai[2] == 0; + public bool Positive => (Projectile.ai[2] == 0 || Projectile.ai[2] == 10); public ref float ShootRecoilTimer => ref Projectile.ai[1]; // Dual functions for rapid fire shooting cooldown and recoil public int AftershotCooldownFrames = 8; public int Charge1Frames = 156; - public int Charge2Frames = 308; + public int Charge2Frames = 312; + public bool hasReachedLV1 = false; + public bool hasReachedLV2 = false; public int fireFrameCounter = 0; public int fireFrame = 0; @@ -57,7 +55,11 @@ namespace CalamityMod.Projectiles.Ranged public bool showFlash = false; public Vector2 flashPos; public float flashRot; + + // Distortion effect visuals public Vector2 voidPlacement; + public int inverseTimer = 14; + public bool drawInverse = false; public bool ChargeLV1 => CurrentChargingFrames >= Charge1Frames; public bool ChargeLV2 => CurrentChargingFrames >= Charge2Frames; public override void SetStaticDefaults() @@ -88,11 +90,12 @@ namespace CalamityMod.Projectiles.Ranged Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; baseColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); - if (!Positive) + if ((!Positive && Projectile.ai[2] < 10) || Projectile.ai[2] == 15) // Color is white when Negative baseColor = Color.White; + #region Frame control Projectile.frameCounter++; - if (Projectile.frameCounter > 1) + if (Projectile.frameCounter > (Projectile.ai[2] >= 10 ? 2 : 1)) { Projectile.frame++; Projectile.frameCounter = 0; @@ -103,7 +106,7 @@ namespace CalamityMod.Projectiles.Ranged } fireFrameCounter++; - if (fireFrameCounter > 1) + if (fireFrameCounter > (Projectile.ai[2] >= 10 ? 2 : 1)) { fireFrame++; fireFrameCounter = 0; @@ -122,13 +125,27 @@ namespace CalamityMod.Projectiles.Ranged if (flashFrame > 6) showFlash = false; } + #endregion + if (Time % 2 == 0) voidPlacement = Main.rand.NextVector2Circular(10.5f, 10.5f); - if (Projectile.ai[2] >= 10) // Changing Mode + + if (inverseTimer <= 9) { - Owner.Calamity().despoilerNerf = false; - Projectile.frame = 6; - fireFrame = 6; + drawInverse = true; + if (inverseTimer == 0) + { + drawInverse = false; + inverseTimer = Main.rand.Next(20, 40 + 1); + } + } + if (ChargeLV2) + inverseTimer--; + + // Changing Mode + if (Projectile.ai[2] >= 10) + { + Owner.Calamity().despoilerNerf = false; // Remove charge speed penalty if you swap ShotsLoaded = 0; if (Time == 0) { @@ -141,20 +158,27 @@ namespace CalamityMod.Projectiles.Ranged 2 => color3, _ => color4, }; - Dust dust = Dust.NewDustPerfect(Owner.Center, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f)); + Dust dust = Dust.NewDustPerfect(Owner.Center, !Positive ? ModContent.DustType() : ModContent.DustType(), new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.9f, 1.25f); - dust.color = Projectile.ai[2] == 15 ? Color.White : useColor; + dust.color = Projectile.ai[2] == 15 ? baseColor : useColor; } - Projectile.timeLeft = AftershotCooldownFrames * 2; - OffsetLengthFromArm = 25f; + Projectile.timeLeft = (int)(AftershotCooldownFrames * 3.5f); + OffsetLengthFromArm = 45f; + } + if (Main.rand.NextBool() && Time > 1) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition - (Projectile.velocity * 60).RotatedBy(0.15f * Projectile.direction), Projectile.ai[2] == 15 ? ModContent.DustType() : ModContent.DustType(), (Projectile.velocity * 14).RotatedBy(MathHelper.ToRadians(-135f) * Projectile.direction).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.6f, 1f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 0.9f) * Utils.GetLerpValue(-10, 20, Projectile.timeLeft); + dust.color = baseColor; } } // Fire if the owner stops channeling or otherwise cannot use the weapon. if (Owner.CantUseHoldout() || Projectile.ai[2] >= 10) { - if (Projectile.ai[2] < 10) + if (Projectile.ai[2] < 10 && ChargeLV1) // Give charge speed nerf if you use any form of charge Owner.Calamity().despoilerNerf = true; hasBegunFiring = true; KeepRefreshingLifetime = false; @@ -169,24 +193,26 @@ namespace CalamityMod.Projectiles.Ranged ChargeSound?.Stop(); + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; + int charge2DamagePos = Projectile.damage * 3; // Most of the damage comes from the explosion + int charge2DamageNeg = Projectile.damage * 30; + if (Positive) { - + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 2.5f, ModContent.ProjectileType(), charge2DamagePos, Projectile.knockBack, Projectile.owner); } else { - + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 0.6f, ModContent.ProjectileType(), charge2DamageNeg, Projectile.knockBack * 3, Projectile.owner); + Owner.Calamity().GeneralScreenShakePower = 10.5f; } SoundEngine.PlaySound(OntologicalDespoiler.BigShot, Projectile.position); - Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; - int charge2Damage = Projectile.damage * 20; - float charge2KB = Projectile.knockBack * 3f; - //Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), charge2Damage, charge2KB, Projectile.owner); - Owner.Calamity().GeneralScreenShakePower = 9.5f; + // Setting stats for the flash visual effect so it doesn't stick to the gun flashPos = GunTipPosition + Projectile.velocity * 90; flashRot = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); showFlash = true; + for (int i = 0; i < 20; i++) { Color useColor = Main.rand.Next(4) switch @@ -215,10 +241,10 @@ namespace CalamityMod.Projectiles.Ranged else if (ShotsLoaded > 0) { // While bullets are remaining, refresh the lifespan; it will not refresh again after bullets run out - Projectile.timeLeft = AftershotCooldownFrames; + Projectile.timeLeft = (ChargeLV1 ? AftershotCooldownFrames : (int)(AftershotCooldownFrames * 1.5f)); // Retract recoil & shoot faster if charged - ShootRecoilTimer -= ChargeLV1 ? 2.5f : 2f; + ShootRecoilTimer -= ChargeLV1 ? 3f : 2f; if (ShootRecoilTimer <= 0f) { @@ -238,7 +264,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 2; i++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.8f, 1f), ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack, Projectile.owner, 0, 0, 5); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec.RotatedByRandom(0.45f) * Main.rand.NextFloat(0.8f, 1f), ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack, Projectile.owner, 0, 0, 5); } } @@ -266,7 +292,7 @@ namespace CalamityMod.Projectiles.Ranged if (ShotsLoaded < MaxLoadableShots && CurrentChargingFrames % FramesPerLoad == 0) ShotsLoaded++; - CurrentChargingFrames += 2 * (Owner.Calamity().despoilerNerf ? 0.5f : 1); + CurrentChargingFrames += ((ChargeLV1 && !Positive) ? 1 : 2) * (Owner.Calamity().despoilerNerf ? 0.5f : 1); // Charges slower if nerfed, charge LV2 for Negative is slower // Sounds if (ChargeLV1) @@ -292,17 +318,16 @@ namespace CalamityMod.Projectiles.Ranged float particleScale = MathHelper.Clamp(CurrentChargingFrames, 0f, Charge2Frames); for (int i = 0; i < (ChargeLV2 ? 3 : ChargeLV1 ? 2 : 1); i++) { - //SparkParticle spark2 = new SparkParticle((GunTipPosition - Projectile.velocity * 4) + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * Main.rand.NextFloat(16.1f, 30.8f), false, Main.rand.Next(2, 7), Main.rand.NextFloat(particleScale / 350f, particleScale / 270f), baseColor); - //GeneralParticleHandler.SpawnParticle(spark2); Vector2 dustVel = -Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1.1f, 15.8f); Vector2 addedPlace = Positive ? Vector2.Zero : dustVel * 3; - Dust dust = Dust.NewDustPerfect(GunTipPosition + (Positive ? Vector2.Zero : (dustVel * 15 * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true))), !Positive ? ModContent.DustType() : ChargeLV1 ? Main.rand.NextBool((int)(50 * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true) + 1)) ? ModContent.DustType() : ModContent.DustType() : ModContent.DustType(), dustVel - addedPlace * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true)); + bool dustChance = Main.rand.NextBool((int)(30 * Utils.GetLerpValue(Charge2Frames, Charge1Frames, CurrentChargingFrames, true) + 1)); + int dustType = !Positive ? ModContent.DustType() : ChargeLV1 ? (dustChance ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(); + + Dust dust = Dust.NewDustPerfect(GunTipPosition + (Positive ? Vector2.Zero : (dustVel * 15 * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true))), dustType, dustVel - addedPlace * Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.5f, 1.25f) * Utils.GetLerpValue(0, Charge1Frames, CurrentChargingFrames, true); dust.color = baseColor; } - //Particle orb2 = new GenericBloom(GunTipPosition, Projectile.velocity, Color.Black * 0.5f, (particleScale / 350f) * Main.rand.NextFloat(0.9f, 1.1f), 2, false, false); - //GeneralParticleHandler.SpawnParticle(orb2); Particle orb = new GenericBloom(GunTipPosition, Projectile.velocity, Positive ? Color.Lerp(Color.White, Color.Black, Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true)) : Color.Black * Utils.GetLerpValue(0, Charge1Frames, CurrentChargingFrames, true), (particleScale / 400f) * Main.rand.NextFloat(0.9f, 1.1f), 2, false, false); GeneralParticleHandler.SpawnParticle(orb); @@ -314,18 +339,19 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 3; i++) { - Particle orb = new CustomSpark(GunTipPosition, Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1.1f, 15.8f), "CalamityMod/Particles/PearlParticleGlow", false, 3, Main.rand.NextFloat(1.8f, 1.9f), Color.Black, new Vector2(0.3f, 1.3f), false, false); + Particle orb = new CustomSpark(GunTipPosition, Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1.1f, 15.8f), "CalamityMod/Particles/PearlParticleGlow", false, 3, Main.rand.NextFloat(2.3f, 2.6f), Color.Black, new Vector2(0.3f, 1.35f), false, false); GeneralParticleHandler.SpawnParticle(orb); + bool color = Main.rand.NextBool(4); Vector2 dustVel = -Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1.1f, 15.8f); Dust dust = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), dustVel); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.5f, 1.25f) * Utils.GetLerpValue(0, Charge1Frames, CurrentChargingFrames, true); - dust.color = baseColor; + dust.scale = Main.rand.NextFloat(0.5f, 1.25f) * (color ? 1.8f : 1); + dust.color = color ? Color.Black : baseColor; } } // Full charge dusts - if (CurrentChargingFrames == Charge1Frames) + if (ChargeLV1 && !hasReachedLV1) { for (int i = 0; i < 16; i++) { @@ -342,8 +368,11 @@ namespace CalamityMod.Projectiles.Ranged chargefull.noGravity = true; chargefull.color = Positive ? useColor : baseColor; } + Particle orb2 = new CustomPulse(GunTipPosition, Vector2.Zero, Positive ? baseColor : Color.Black, "CalamityMod/Particles/SmallBloomRingLayered", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.65f, 0.85f, 11, Positive); + GeneralParticleHandler.SpawnParticle(orb2); + hasReachedLV1 = true; } - if (CurrentChargingFrames == Charge2Frames) + if (ChargeLV2 && !hasReachedLV2) { for (int i = 0; i < 25; i++) { @@ -360,9 +389,12 @@ namespace CalamityMod.Projectiles.Ranged chargefull.noGravity = true; chargefull.color = Positive ? useColor : baseColor; } + Particle orb2 = new CustomPulse(GunTipPosition, Vector2.Zero, Positive ? baseColor : Color.Black, "CalamityMod/Particles/SmallBloomRingLayered", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.85f, 1.05f, 11, Positive); + GeneralParticleHandler.SpawnParticle(orb2); + hasReachedLV2 = true; } } - if (!hasBegunFiring) + if (!hasBegunFiring && Projectile.ai[2] < 10) // Prevents firing animation from playing when not firing or swapping types { Projectile.frame = 6; fireFrame = 6; @@ -386,11 +418,17 @@ namespace CalamityMod.Projectiles.Ranged return false; Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerHoldout").Value; + Texture2D textureAlt = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerHoldout2").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 rotationPoint = frame.Size() * 0.5f; SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + if (!Owner.CantUseHoldout()) + { + float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, Charge2Frames); + drawPosition += Main.rand.NextVector2Circular(rumble / 120f, rumble / 120f); + } Texture2D fireTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerFlame").Value; Texture2D fireTexture2 = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerFlame2").Value; @@ -401,9 +439,9 @@ namespace CalamityMod.Projectiles.Ranged Rectangle frame3 = fireTexture.Frame(1, 6, 0, flashFrame); Vector2 rotationPoint3 = frame3.Size() * 0.5f; + // Glow Orb Texture2D rechargeTexture = ModContent.Request("CalamityMod/Particles/FlameExplosion").Value; Texture2D rechargeTexture2 = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; - // Glow Orb float randSize = Main.rand.NextFloat(0.9f, 1.1f); if (!hasBegunFiring) { @@ -411,11 +449,6 @@ namespace CalamityMod.Projectiles.Ranged Main.EntitySpriteDraw(rechargeTexture, GunTipPosition - Main.screenPosition, null, baseColor with { A = 0 }, Projectile.rotation + Main.rand.NextFloat(-30, 30), rechargeTexture.Size() * 0.5f, 0.028f * Utils.GetLerpValue(0, Charge2Frames, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0); Main.EntitySpriteDraw(rechargeTexture2, GunTipPosition - Main.screenPosition, null, Positive ? Color.Lerp(Color.White, Color.Black, Utils.GetLerpValue(Charge1Frames, Charge2Frames, CurrentChargingFrames, true)) : Color.Black, Projectile.rotation + Main.rand.NextFloat(-30, 30), rechargeTexture2.Size() * 0.5f, 0.58f * Utils.GetLerpValue(0, Charge2Frames, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0); } - if (!Owner.CantUseHoldout()) - { - float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, Charge2Frames); - drawPosition += Main.rand.NextVector2Circular(rumble / 120f, rumble / 120f); - } if (ChargeLV1 && !Positive && !hasBegunFiring) { @@ -427,16 +460,13 @@ namespace CalamityMod.Projectiles.Ranged } } Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + if (drawInverse && !Positive) + Main.EntitySpriteDraw(textureAlt, drawPosition, frame, Color.White * Utils.GetLerpValue(0, 5, inverseTimer, true), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); if (Projectile.frame < 6) { - if (Positive && false) - Main.EntitySpriteDraw(fireTexture, drawPosition, frame2, baseColor with { A = 0 }, drawRotation, rotationPoint2, Projectile.scale * Owner.gravDir, flipSprite); - else - { - for (int i = 0; i< 4; i++) - Main.EntitySpriteDraw(fireTexture, drawPosition + Main.rand.NextVector2Circular(4.5f, 4.5f), frame2, baseColor with { A = 0 } * 0.3f, drawRotation, rotationPoint2, Projectile.scale * Owner.gravDir, flipSprite); - Main.EntitySpriteDraw(Positive ? fireTexture : fireTexture2, drawPosition, frame2, Positive ? baseColor with { A = 0 } : baseColor, drawRotation, rotationPoint2, Projectile.scale * Owner.gravDir, flipSprite); - } + for (int i = 0; i< 4; i++) + Main.EntitySpriteDraw(fireTexture, drawPosition + Main.rand.NextVector2Circular(4.5f, 4.5f), frame2, baseColor with { A = 0 } * 0.3f, drawRotation, rotationPoint2, Projectile.scale * Owner.gravDir, flipSprite); + Main.EntitySpriteDraw(Positive ? fireTexture : fireTexture2, drawPosition, frame2, Positive ? baseColor with { A = 0 } : baseColor, drawRotation, rotationPoint2, Projectile.scale * Owner.gravDir, flipSprite); } if (showFlash) { diff --git a/Projectiles/Ranged/OntologicalDespoilerHoldout2.png b/Projectiles/Ranged/OntologicalDespoilerHoldout2.png new file mode 100644 index 0000000000000000000000000000000000000000..e3d15bebc0ef725caa35a45d8cd6fcaee1d44d44 GIT binary patch literal 6218 zcmaiXWmpvN+x8F(!b+Evz)A~CDUH-3CEc*J2udvi(y;UrA_xjdw}J`?NXL>Y-4Y^5 zcXz$x@BjXP$MfYmo)2@(J#*c2&o$?D-sg2rl(wca2{8jP001PaDhOThYzzQ6oHq!- z(b5kiA@GE6FRvjF0OhZs7uFB}AQpS7sHp9(tE|APs-!3?Bq1uwFAN7KszhbH_0rdy zppEQr6l>IeO&*;z;OL->t3uMKk^tuwA|h97i3eb!2z?YnC!z3$F!wAvPcfk!79EbG zQ@)N*j~H=7Q8T_(ef)|3cZ1J%Z`yB`<3Pu(#{OUS+W}*BK>S50r1g<85&CA1G4-pK@#p6~vUZxr}x(s1-M^N!vmh?hFYS_w-YBlXdjDTt6wfBCa_-hX#MGG;PC%%P<_HTWEP^UMSvLa7d2(LVE(^6cpH(>;l zln~v8k60hQtup&Yg@L3hM97_Fy*nXmyUL%aeH%4-LNV~x7`K3pK`!t%z|Bj+O62$W z?!a~cv{M=Hv^QojH6`P`KjbRFsOHhtH(K_fI9p|ea1EtS-^RNOQ`~#3fRY^EnjGT_ z9#sqe*A|KzfNT~ISDqV#?`9=58$unAgJ7kjMptFuN(%X8#r2-RGn?XGs3_`|N3iYe zJ#j*KaJLoyG>)zyX(pOyhqy5aBi3@BteCBEdoa`iB#PD9Iu4X)G`@s)1c?f&SQA_}&Wc*=a-r*f0= zxAR$Qqg4`$zL`-IC@BePKT3lBV4(^BllwNuFh?}6ScgzM?M@#0lLg+8jmu)=rivx{9HyecYt5hYdf=hBdX2ibJUitfMzbB2 zi>`?yH%ja`oYRTsKIgX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zZhZE|a3{PRV6^Xyr4L`P(i>BT!et^q#QulfhIAX`gJ9iFk+DhAWv6SW5a25F{kLARO~@V0=T3GK|yTY3eJ9 zin`V_%)t1eGpG=#n_yHyQ5|kb_4fYUo!{}Me;zI*ZtyaKApz~2AwAFy=qg5wh84~@ z78QEPQK)6w8$3W%&PKn@Jhf40cor5`1yXaQ`hR-4!jA_V#$e~@qJurN-?%Shrt}x? zv(wI(jKQ7in$O-RoLpT6T0O?B+?Od*`x{ee_4D;bS1#l~hiBB0{cCAnteO~LbDy!< zTnT+7-9Nb4KjEayAT#(|o|-i_n+KodSY8olSS>hU2BTi7_gnMc`KM3Sj6(jA8p3&U hp}+qz|44LCko8#8>s?+Ba_~nCP*u`Id{(du`F{$dvv&Xh literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/OntologicalDespoilerShot.cs b/Projectiles/Ranged/OntologicalDespoilerShot.cs index a15be72b96..a47a680dc2 100644 --- a/Projectiles/Ranged/OntologicalDespoilerShot.cs +++ b/Projectiles/Ranged/OntologicalDespoilerShot.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using CalamityMod.CalPlayer; using CalamityMod.Dusts; -using CalamityMod.NPCs; -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,7 +10,6 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using static CalamityMod.Projectiles.Rogue.FinalDawnFlame; namespace CalamityMod.Projectiles.Ranged { @@ -23,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged public ref float time => ref Projectile.ai[0]; public Color baseColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); public int sineDir = 1; - public int zagRate = 55; public Color color1 = Color.DarkMagenta; public Color color2 = Color.DarkOrchid; @@ -69,7 +65,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.scale = 1f; sineDir = Main.rand.NextBool() ? 1 : -1; Projectile.frame = Main.rand.Next(0, 6 + 1); - zagRate = Main.rand.Next(55, 70 + 1); if (!Positive) Projectile.penetrate = 1; } @@ -182,19 +177,19 @@ namespace CalamityMod.Projectiles.Ranged } else { - for (int i = 0; i < 3; i++) + for (int i = 0; i < MathHelper.Clamp((int)(3 - Projectile.numHits * 0.3f), 1, 3); i++) { Particle orb2 = new LineParticle(Projectile.Center, (Projectile.velocity * 4).RotatedByRandom(0.15f) * Main.rand.NextFloat(0.1f, 1f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), baseColor); GeneralParticleHandler.SpawnParticle(orb2); } } - SoundStyle fire = new("CalamityMod/Sounds/Item/NullHit"); + SoundStyle fire = OntologicalDespoiler.SmallImpact; SoundEngine.PlaySound(fire with { Volume = (!Positive ? 1 : 0.7f), Pitch = Main.rand.NextFloat(0, 0.1f) * (!Positive ? 3 : 1) }, Projectile.Center); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.9f); + Projectile.damage = (int)(Projectile.damage * 0.92f); if (Projectile.damage < 1) Projectile.damage = 1; }