From a4ce4e29071f5db2418f9707a9d0a8b6611878b0 Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 14 May 2025 00:34:50 -0700 Subject: [PATCH 1/3] Adjusted flash rounds Second hits are weaker and also it flashes a bit less --- Particles/CustomPulse.cs | 8 +++++--- Projectiles/Ranged/FlashRoundProj.cs | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Particles/CustomPulse.cs b/Particles/CustomPulse.cs index cebbf59dee..31fd7a91dc 100644 --- a/Particles/CustomPulse.cs +++ b/Particles/CustomPulse.cs @@ -23,8 +23,9 @@ namespace CalamityMod.Particles private bool FadeOut; private Vector2 Squish; private Color BaseColor; + private float MakeLight; - public CustomPulse(Vector2 position, Vector2 velocity, Color color, string texture, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true, float baseOpacity = 1f, bool fade = true) + public CustomPulse(Vector2 position, Vector2 velocity, Color color, string texture, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true, float baseOpacity = 1f, bool fade = true, float makeLight = 1) { Position = position; Velocity = velocity; @@ -39,6 +40,7 @@ namespace CalamityMod.Particles Squish = squish; Rotation = rotation; UseAltVisual = UseAdditiveBlend; + MakeLight = makeLight; } public override void Update() @@ -49,7 +51,8 @@ namespace CalamityMod.Particles opacity = (FadeOut ? (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2) : 1f) * BaseOpacity; Color = BaseColor * opacity; - Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); + if (MakeLight > 0) + Lighting.AddLight(Position, (Color.R / 255f) * MakeLight, (Color.G / 255f) * MakeLight, (Color.B / 255f) * MakeLight); Velocity *= 0.95f; } @@ -64,7 +67,6 @@ namespace CalamityMod.Particles { Texture2D joke = ModContent.Request("CalamityMod/Particles/MammothParticle").Value; scaleMult = (MathHelper.Lerp(tex.Size().X / joke.Size().X, tex.Size().Y / joke.Size().Y, 0.5f)); - Main.NewText(scaleMult); tex = joke; UseAltVisual = true; } diff --git a/Projectiles/Ranged/FlashRoundProj.cs b/Projectiles/Ranged/FlashRoundProj.cs index 1ba053ff56..097af310b5 100644 --- a/Projectiles/Ranged/FlashRoundProj.cs +++ b/Projectiles/Ranged/FlashRoundProj.cs @@ -109,12 +109,11 @@ namespace CalamityMod.Projectiles.Ranged dust.scale = Main.rand.NextFloat(0.75f, 1.1f); dust.noGravity = true; } - //SoundEngine.PlaySound(SoundID.Shatter with { Volume = 0.4f, Pitch = 0.1f + 0.1f * bounces }, Projectile.Center); SoundEngine.PlaySound(SoundID.Item50 with { Volume = 0.3f, Pitch = -0.2f + 0.4f * bounces, MaxInstances = 15 }, Projectile.Center); } for (int i = 0; i < 2; i++) { - Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f * (i), 0.45f * (i), 9, true); + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f * (i), 0.45f * (i), 9, true, makeLight: 0); GeneralParticleHandler.SpawnParticle(blastRing); } float rot = Main.rand.NextFloat(-5, 5); @@ -126,6 +125,7 @@ namespace CalamityMod.Projectiles.Ranged dust.fadeIn = 1.5f; dust.noGravity = true; dust.color = Color.White; + dust.noLightEmittence = true; } // Doesn't actually do damage, just an aoe for confustion infliction and knockback Projectile flash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 5, 0f, Projectile.owner); @@ -166,6 +166,11 @@ namespace CalamityMod.Projectiles.Ranged bounces--; return false; } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float damageMult = (Projectile.numHits == 0 ? 1 : 0.3f); + modifiers.SourceDamage *= damageMult; + } public override void OnKill(int timeLeft) { } From f6c1c465c9854ebda33df3b91f453bbecd224a40 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Wed, 14 May 2025 01:56:36 -0700 Subject: [PATCH 2/3] Fixed the super bright glowmasks (thank you fry) --- Items/Weapons/Melee/BurningRevelation.cs | 2 +- Utilities/DrawingUtils.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Melee/BurningRevelation.cs b/Items/Weapons/Melee/BurningRevelation.cs index b4523d58ba..c0bdd8753b 100644 --- a/Items/Weapons/Melee/BurningRevelation.cs +++ b/Items/Weapons/Melee/BurningRevelation.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 40; - Item.height = 38; + Item.height = 48; Item.DamageType = DamageClass.MeleeNoSpeed; Item.damage = 300; Item.knockBack = 7.5f; diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index 9ed32533e5..c2a8e3b61f 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -412,9 +412,8 @@ namespace CalamityMod { Vector2 origin = new Vector2(glowmaskTexture.Width / 2f, glowmaskTexture.Height / 2f); - Color color = new Color(250, 250, 250, item.alpha); - if (item.type == ModContent.ItemType()) - color = Color.White; + Color color = Color.White * MathHelper.Lerp(0f, 1f, item.alpha / 255f); + color = Color.White; spriteBatch.Draw(glowmaskTexture, item.Center - Main.screenPosition, null, color, rotation, origin, 1f, SpriteEffects.None, 0f); } From 057a0cb187b688532aaa6a6b072d51c3149c69af Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Wed, 14 May 2025 02:06:18 -0700 Subject: [PATCH 3/3] Removed pointless line --- Utilities/DrawingUtils.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index c2a8e3b61f..701c1717b4 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -412,8 +412,7 @@ namespace CalamityMod { Vector2 origin = new Vector2(glowmaskTexture.Width / 2f, glowmaskTexture.Height / 2f); - Color color = Color.White * MathHelper.Lerp(0f, 1f, item.alpha / 255f); - color = Color.White; + Color color = Color.White; spriteBatch.Draw(glowmaskTexture, item.Center - Main.screenPosition, null, color, rotation, origin, 1f, SpriteEffects.None, 0f); }