From 62a4190da6ed753fd78e9cd8d0d80d917fde8179 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 29 May 2021 11:22:48 -0500 Subject: [PATCH] 1 - Ceaseless Dust. 2 - Fixed some Ceaseless Void issues. --- Dusts/CeaselessDust.cs | 31 ++++++++++++++++++++++++++++++ Dusts/CeaselessDust.png | Bin 0 -> 204 bytes NPCs/Abyss/EidolonWyrmHeadHuge.cs | 8 +------- NPCs/CalamityAI.cs | 8 ++++++-- NPCs/CeaselessVoid/DarkEnergy.cs | 4 ++-- 5 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 Dusts/CeaselessDust.cs create mode 100644 Dusts/CeaselessDust.png diff --git a/Dusts/CeaselessDust.cs b/Dusts/CeaselessDust.cs new file mode 100644 index 0000000000..2bbc4267e8 --- /dev/null +++ b/Dusts/CeaselessDust.cs @@ -0,0 +1,31 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Dusts +{ + public class CeaselessDust : ModDust + { + public override void OnSpawn(Dust dust) + { + dust.noGravity = true; + } + + public override bool Update(Dust dust) + { + float scale = dust.scale; + Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), scale * 0.4f, scale * 0.1f, scale); + + dust.velocity *= 0.95f; + dust.scale -= 0.01f; + + return false; + } + + public override Color? GetAlpha(Dust dust, Color lightColor) + { + int newColor = (int)(250f * dust.scale); + return new Color(newColor, newColor, newColor, 0); + } + } +} diff --git a/Dusts/CeaselessDust.png b/Dusts/CeaselessDust.png new file mode 100644 index 0000000000000000000000000000000000000000..de9e295d655c310a785314714518d047d4d53cce GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^AhsL_8;}$&?Kc2YlRaG=LoEE0Qxt>@gjV)3Ixplu zyz#%n*=UJ10Z%-_IgB;a7pmSc4Sv+$oH^rUfpBLS$7hkRcRVy^oZxqlQJb8<$o_wQ z!I_*tCpzrYIJ8 0f) - { npc.spriteDirection = 1; - } if (Main.player[npc.target].dead) { @@ -242,9 +238,7 @@ namespace CalamityMod.NPCs.Abyss npc.alpha -= 42; if (npc.alpha < 0) - { npc.alpha = 0; - } if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType())) { @@ -264,7 +258,7 @@ namespace CalamityMod.NPCs.Abyss if (!detectsPlayer) { num192 += 800; - if (Math.Abs(npc.Center.X - num191) < 400f) //500 + if (Math.Abs(npc.Center.X - num191) < 400f) { if (npc.velocity.X > 0f) { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 70daaf62ea..a5e1e302e5 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4167,7 +4167,7 @@ namespace CalamityMod.NPCs if (Main.rand.NextBool(var)) { dustOffset = dustOffset.RotatedBy(angleIncrement); - int dust = Dust.NewDust(vector, 1, 1, (int)CalamityDusts.PurpleCosmolite); + int dust = Dust.NewDust(vector, 1, 1, ModContent.DustType()); Main.dust[dust].position = vector + dustOffset; Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; @@ -4213,7 +4213,11 @@ namespace CalamityMod.NPCs npc.HealEffect(-damageAmt, true); if (npc.life <= 0) - npc.StrikeNPCNoInteraction(9999, 0f, 0); + { + npc.life = 0; + npc.HitEffect(); + npc.checkDead(); + } npc.netUpdate = true; } diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 4c937cdac4..94ccb55925 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.CeaselessVoid // Distance from Ceaseless Void double maxDistance = malice ? 1200D : death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; double rateOfChangeIncrease = (maxDistance / minMaxDistance) - 1D; - double rateOfChange = (npc.ai[1] * 0.5f) + 1D + tileEnrageMult + rateOfChangeIncrease; + double rateOfChange = (npc.ai[1] * 0.5f) + 2D + (tileEnrageMult - 1f) + rateOfChangeIncrease; if (npc.Calamity().newAI[0] == 0f) { distance += rateOfChange; @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.CeaselessVoid // Rotation velocity float minRotationVelocity = 0.5f + tileEnrageMult - 1f; - float rotationVelocityIncrease = malice ? 0.4f : death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0f; + float rotationVelocityIncrease = death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0f; rotationVelocityIncrease += rotationVelocityIncrease * (npc.ai[1] * 0.5f); // Rotate around Ceaseless Void