From 442dea5966fe16cbab0309d8e417f67523cff78f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 17 May 2024 18:05:45 -0400 Subject: [PATCH 1/2] Exorcism stars have predictive aim --- Projectiles/Rogue/ExorcismProj.cs | 25 ++++++++++++++----------- Projectiles/Rogue/ExorcismStar.cs | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index ff5246efc9..79b74887d0 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -73,6 +73,20 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + // Stars + if (Projectile.Calamity().stealthStrike) + { + for (int i = 0; i < 6; i++) + { + Vector2 pos = new Vector2(Projectile.Center.X + (float)Projectile.width * 0.5f + (float)Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 starVelocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 30f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, starVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack * 0.5f, Projectile.owner, Main.rand.NextFloat(-3f, 3f), 0f); + } + } + } + public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; @@ -97,17 +111,6 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[p].rotation = Projectile.rotation; if (Projectile.Calamity().stealthStrike) Main.projectile[p].Calamity().stealthStrike = true; - // Stars - if (Projectile.Calamity().stealthStrike) - { - for (int i = 0; i < 6; i++) - { - Vector2 pos = new Vector2(Projectile.Center.X + (float)Projectile.width * 0.5f + (float)Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - float speedX = (Projectile.Center.X - pos.X) / 20f; - float speedY = (Projectile.Center.Y - pos.Y) / 20f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos.X, pos.Y, speedX, speedY, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack * 0.5f, Projectile.owner, Main.rand.NextFloat(-3f, 3f), 0f); - } - } } } } diff --git a/Projectiles/Rogue/ExorcismStar.cs b/Projectiles/Rogue/ExorcismStar.cs index 1205f4d2c5..9c31376c1d 100644 --- a/Projectiles/Rogue/ExorcismStar.cs +++ b/Projectiles/Rogue/ExorcismStar.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 2; Projectile.DamageType = RogueDamageClass.Instance; } From c3ac6c2c59851a6a9a79cda21edc3b840a4afd87 Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sat, 18 May 2024 07:08:21 +0900 Subject: [PATCH 2/2] Difficulties are now actually sorted (#40) --- Systems/DifficultyModeSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/DifficultyModeSystem.cs b/Systems/DifficultyModeSystem.cs index 514d003dd5..afbfc41794 100644 --- a/Systems/DifficultyModeSystem.cs +++ b/Systems/DifficultyModeSystem.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Systems public static void CalculateDifficultyData() { MostAlternateDifficulties = 1; - Difficulties.OrderBy(d => d.DifficultyScale); + Difficulties = Difficulties.OrderBy(d => d.DifficultyScale).ToList(); //Difficulties are arranged in "tiers". This is done so that multiple mods can add their own alternate difficulties sharing a tier with the base ones DifficultyTiers = new List();