diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 7687384043..de827a438f 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1105,7 +1105,7 @@ namespace CalamityMod.CalPlayer } } - if (gladiatorSword && !target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill) + if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill) { target.Calamity().gladiatorOnKill = false; Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType(), 0, 0f); diff --git a/CalamityLists.cs b/CalamityLists.cs index 63b1953366..6974ddc7bd 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -789,7 +789,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 0308111778..0f49246ebc 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -185,6 +185,7 @@ namespace CalamityMod.Items { ItemID.RainbowRod, Do(DamageExact(35), ManaExact(15)) }, { ItemID.Rally, Do(AutoReuse, DamageExact(18)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, + { ItemID.RavenStaff, Do(AutoReuse, UseExact(20), DamageExact(36)) }, { ItemID.Razorpine, Do(DamageExact(40)) }, { ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.RedPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, @@ -479,7 +480,6 @@ namespace CalamityMod.Items { ItemID.QueenSpiderStaff, Do(UseExact(25)) }, { ItemID.RainbowCrystalStaff, Do(UseExact(15)) }, { ItemID.RainbowWhip, autoReuse }, // Kaleidoscope - { ItemID.RavenStaff, Do(AutoReuse, UseExact(20)) }, { ItemID.SanguineStaff, Do(AutoReuse, UseExact(25)) }, { ItemID.ScytheWhip, autoReuse }, // Dark Harvest { ItemID.SlimeStaff, Do(AutoReuse, UseExact(30)) }, diff --git a/Items/Placeables/DraedonStructures/SecurityChest.cs b/Items/Placeables/DraedonStructures/SecurityChest.cs index e0a2f3a6a1..188c8816b4 100644 --- a/Items/Placeables/DraedonStructures/SecurityChest.cs +++ b/Items/Placeables/DraedonStructures/SecurityChest.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.DraedonStructures public override void SetDefaults() { Item.width = 32; - Item.height = 26; + Item.height = 28; Item.maxStack = 9999; Item.useTurn = true; Item.autoReuse = true; diff --git a/Items/Placeables/DraedonStructures/SecurityChest.png b/Items/Placeables/DraedonStructures/SecurityChest.png index 43a639bd2f..bd2a587549 100644 Binary files a/Items/Placeables/DraedonStructures/SecurityChest.png and b/Items/Placeables/DraedonStructures/SecurityChest.png differ diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index 50d42f7e54..39862cc24f 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -30,14 +30,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 43; Item.height = 24; Item.DamageType = DamageClass.Magic; - Item.damage = 50; + Item.damage = 43; Item.knockBack = 1f; Item.useTime = 2; Item.useAnimation = 2; Item.noUseGraphic = true; Item.autoReuse = false; Item.channel = true; - Item.mana = 6; + Item.mana = 4; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = FireSound; diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index c0087adfb4..fd7d2b965d 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 70; + Item.damage = 82; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.width = 28; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic if (Main.zenithWorld) { bool devourer = DownedBossSystem.downedDoG; - float damageMult = 1f + (devourer ? (418f / 70f - 1f) : 0f); + float damageMult = 1f + (devourer ? (430f / 82f - 1f) : 0f); damage *= damageMult; } } diff --git a/Items/Weapons/Magic/Lazhar.cs b/Items/Weapons/Magic/Lazhar.cs index c7de8e024e..50b80c1261 100644 --- a/Items/Weapons/Magic/Lazhar.cs +++ b/Items/Weapons/Magic/Lazhar.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 80; + Item.damage = 76; Item.DamageType = DamageClass.Magic; Item.mana = 4; Item.width = 42; diff --git a/Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs b/Items/Weapons/Magic/NebulousCataclysm.cs similarity index 91% rename from Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs rename to Items/Weapons/Magic/NebulousCataclysm.cs index f0e3b2863c..499c9b7599 100644 --- a/Items/Weapons/Magic/GrandStaffoftheNebulaMage.cs +++ b/Items/Weapons/Magic/NebulousCataclysm.cs @@ -9,7 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class GrandStaffoftheNebulaMage : ModItem, ILocalizedModType + [LegacyName("GrandStaffoftheNebulaMage")] + public class NebulousCataclysm : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() @@ -30,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3f; } diff --git a/Items/Weapons/Magic/GrandStaffoftheNebulaMage.png b/Items/Weapons/Magic/NebulousCataclysm.png similarity index 100% rename from Items/Weapons/Magic/GrandStaffoftheNebulaMage.png rename to Items/Weapons/Magic/NebulousCataclysm.png diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 3675381dcd..ba1a0f1a9b 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.damage = 175; + Item.damage = 182; Item.knockBack = 4f; - Item.useAnimation = Item.useTime = 21; + Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/DefiledGreatsword.cs b/Items/Weapons/Melee/DefiledGreatsword.cs index eb3eff5fb9..1f82c57040 100644 --- a/Items/Weapons/Melee/DefiledGreatsword.cs +++ b/Items/Weapons/Melee/DefiledGreatsword.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 102; - Item.damage = 112; + Item.damage = 124; Item.DamageType = DamageClass.Melee; Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 6be6c9ba33..0930ec074c 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 800; - public static int PhoenixAttunement_BaseDamage = 1050; + public static int PhoenixAttunement_BaseDamage = 1200; public static int PhoenixAttunement_LocalIFrames = 30; //Remember its got one extra update public static float PhoenixAttunement_BoltDamageReduction = 0.5f; public static float PhoenixAttunement_BoltThrowDamageMultiplier = 1f; diff --git a/Items/Weapons/Melee/TenebreusTides.cs b/Items/Weapons/Melee/TenebreusTides.cs index e6e93840bc..f982321710 100644 --- a/Items/Weapons/Melee/TenebreusTides.cs +++ b/Items/Weapons/Melee/TenebreusTides.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.damage = 80; + Item.damage = 120; Item.knockBack = 4.5f; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 14; diff --git a/Items/Weapons/Melee/TyphonsGreed.cs b/Items/Weapons/Melee/TyphonsGreed.cs index c4daab56c8..bbcc1bc36e 100644 --- a/Items/Weapons/Melee/TyphonsGreed.cs +++ b/Items/Weapons/Melee/TyphonsGreed.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - Item.damage = 84; + Item.damage = 102; Item.DamageType = DamageClass.Melee; Item.width = 16; Item.height = 16; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 319b6f7d26..8eab53f68b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -368,11 +368,6 @@ GloriousEnd: { ''' } -GrandStaffoftheNebulaMage: { - DisplayName: Grand Staff of the Nebula Mage - Tooltip: "'The true power of the Nebula Mage rests in your hands...'" -} - GruesomeEminence: { DisplayName: Gruesome Eminence Tooltip: @@ -530,6 +525,11 @@ NanoPurge: { Tooltip: Fires a barrage of nano lasers } +NebulousCataclysm: { + DisplayName: Nebulous Cataclysm + Tooltip: "'The true power of the Nebula Mage rests in your hands...'" +} + NightsRay: { DisplayName: Night's Ray Tooltip: diff --git a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs index a347de39cb..bb9cb49e4d 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs @@ -52,8 +52,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 etherealLanceDistance = new Vector2(0f, -450f); Vector2 sunDanceDistance = new Vector2(-80f, -500f); - float acceleration = death ? 0.7f : 0.6f; - float velocity = death ? 18f : 15f; + float acceleration = death ? 0.55f : 0.48f; + float velocity = death ? 14f : 12f; float movementDistanceGateValue = 40f; float despawnDistanceGateValue = 6400f; @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 36f : 45f) + 30f * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 36f : 72f) + 30f * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 60f + extraPhaseTime) { npc.ai[0] = 1f; @@ -533,7 +533,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 24f : 30f) + 20f * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 24f : 48f) + 20f * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 100f + extraPhaseTime) { npc.ai[0] = 1f; @@ -604,7 +604,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 36f : 45f) + 30f * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 36f : 72f) + 30f * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 72f + extraPhaseTime) { npc.ai[0] = 1f; @@ -654,7 +654,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = 110f + 30f * lessTimeSpentPerPhaseMultiplier; // 112.5 is too little + extraPhaseTime = (dayTimeEnrage ? 110f : 150f) + 30f * lessTimeSpentPerPhaseMultiplier; // 112.5 is too little if (npc.ai[1] >= totalSunDancePhaseTime + extraPhaseTime) { npc.ai[0] = 1f; @@ -784,7 +784,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 24f : 30f) + 20f * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 24f : 48f) + 20f * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= lanceWallPhaseTime + extraPhaseTime) { npc.ai[0] = 1f; @@ -887,7 +887,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 48f : 60f) * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 48f : 96f) * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 150f + extraPhaseTime) { npc.ai[0] = 1f; @@ -1021,7 +1021,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 24f : 30f) * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 24f : 48f) * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 100f + extraPhaseTime) { npc.ai[0] = 1f; @@ -1085,7 +1085,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? 36f : 45f) + 30f * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? 36f : 72f) + 30f * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 120f + extraPhaseTime) { npc.ai[0] = 1f; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index c7748164a9..801f094d1c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -188,6 +188,10 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.FlyingImp) return ImpMinionAI.DoImpMinionAI(projectile); + // Raven Staff's minion changes. + if (projectile.type == ProjectileID.Raven) + return RavenMinionAI.DoRavenMinionAI(projectile); + // // SENTRY AI CHANGES: // @@ -2772,6 +2776,17 @@ namespace CalamityMod.Projectiles public override bool PreDraw(Projectile projectile, ref Color lightColor) { + #region Vanilla Summons Drawing Changes + + // + // MINION AI CHANGES: + // + + if (projectile.type == ProjectileID.Raven) + return RavenMinionAI.DoRavenMinionDrawing(projectile, ref lightColor); + + #endregion + // Chlorophyte Crystal AI rework. if (projectile.type == ProjectileID.CrystalLeaf) return ChlorophyteCrystalAI.DoChlorophyteCrystalDrawing(projectile); diff --git a/Projectiles/Magic/AtlantisSpear.cs b/Projectiles/Magic/AtlantisSpear.cs index 85467eec9e..732589d7ca 100644 --- a/Projectiles/Magic/AtlantisSpear.cs +++ b/Projectiles/Magic/AtlantisSpear.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.extraUpdates = (Main.zenithWorld && devourer) ? 1 : 0; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = (Main.zenithWorld && devourer) ? 2 : 12; + Projectile.idStaticNPCHitCooldown = (Main.zenithWorld && devourer) ? 2 : 6; } public override void AI() diff --git a/Projectiles/Magic/LazharSolarBeam.cs b/Projectiles/Magic/LazharSolarBeam.cs index d1c5508d3f..34f5798633 100644 --- a/Projectiles/Magic/LazharSolarBeam.cs +++ b/Projectiles/Magic/LazharSolarBeam.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(BuffID.Daybreak, 180); if (Projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].DamageType = DamageClass.Magic; } diff --git a/Projectiles/Magic/GrandStaffoftheNebulaMage_Held.cs b/Projectiles/Magic/NebulousCataclysm_Held.cs similarity index 98% rename from Projectiles/Magic/GrandStaffoftheNebulaMage_Held.cs rename to Projectiles/Magic/NebulousCataclysm_Held.cs index a52e529c81..a953411c23 100644 --- a/Projectiles/Magic/GrandStaffoftheNebulaMage_Held.cs +++ b/Projectiles/Magic/NebulousCataclysm_Held.cs @@ -10,9 +10,9 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class GrandStaffoftheNebulaMage_Held : ModProjectile + public class NebulousCataclysm_Held : ModProjectile { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); private const int TotalXFrames = 2; private const int TotalYFrames = 8; private const int FrameTimer = 6; diff --git a/Projectiles/Magic/GrandStaffoftheNebulaMage_Held.png b/Projectiles/Magic/NebulousCataclysm_Held.png similarity index 100% rename from Projectiles/Magic/GrandStaffoftheNebulaMage_Held.png rename to Projectiles/Magic/NebulousCataclysm_Held.png diff --git a/Projectiles/Melee/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs index 049fb51bd1..cfd9547d08 100644 --- a/Projectiles/Melee/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -23,13 +23,13 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; - Projectile.penetrate = 3; + Projectile.penetrate = 5; Projectile.ignoreWater = true; AIType = ProjectileID.DeathSickle; Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; - Projectile.timeLeft = 180 * Projectile.MaxUpdates; + Projectile.timeLeft = 210 * Projectile.MaxUpdates; } public override void AI() @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.OnFire, 180); + target.AddBuff(BuffID.OnFire3, 180); } } } diff --git a/Projectiles/Melee/DepthOrb.cs b/Projectiles/Melee/DepthOrb.cs index 79dbe135c0..1ab9b9ca49 100644 --- a/Projectiles/Melee/DepthOrb.cs +++ b/Projectiles/Melee/DepthOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -20,7 +20,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.Melee; Projectile.ignoreWater = true; Projectile.penetrate = 1; - Projectile.timeLeft = 30; + Projectile.extraUpdates = 1; + Projectile.timeLeft = 75; } public override void AI() @@ -34,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft > 25) + if (Projectile.timeLeft > 70) return false; Texture2D tex = ModContent.Request(Texture).Value; diff --git a/Projectiles/Melee/HyperBlade.cs b/Projectiles/Melee/HyperBlade.cs index 5698eadd5e..448ba1ffa1 100644 --- a/Projectiles/Melee/HyperBlade.cs +++ b/Projectiles/Melee/HyperBlade.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,14 +29,14 @@ namespace CalamityMod.Projectiles.Melee Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; - Projectile.timeLeft = 120 * Projectile.MaxUpdates; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; } public override void AI() { Lighting.AddLight(Projectile.Center, 0f, 0.5f, 0f); - CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 10f, 10f); + CalamityUtils.HomeInOnNPC(Projectile, true, 350f, 15f, 10f); } public override Color? GetAlpha(Color lightColor) @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.CursedInferno, 180); } } } diff --git a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs index efd00ad02a..9d240acb20 100644 --- a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs +++ b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override Action EffectBeforeReelback => (proj) => { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 2.4f, Projectile.velocity.Y * 2.4f, - ModContent.ProjectileType(), (int)(Projectile.damage * 0.65), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); + ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f); }; public override void ExtraBehavior() { diff --git a/Projectiles/Melee/SunlightBlade.cs b/Projectiles/Melee/SunlightBlade.cs index c15eaaf153..e416eef8b9 100644 --- a/Projectiles/Melee/SunlightBlade.cs +++ b/Projectiles/Melee/SunlightBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,13 +23,13 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; + Projectile.penetrate = 6; Projectile.ignoreWater = true; AIType = ProjectileID.DeathSickle; Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates; - Projectile.timeLeft = 90 * Projectile.MaxUpdates; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; } public override void AI() diff --git a/Projectiles/Melee/TenebreusTidesWaterProjectile.cs b/Projectiles/Melee/TenebreusTidesWaterProjectile.cs index 32924bb95c..ea37d33a7c 100644 --- a/Projectiles/Melee/TenebreusTidesWaterProjectile.cs +++ b/Projectiles/Melee/TenebreusTidesWaterProjectile.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.aiStyle = ProjAIStyleID.Beam; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = -1; + Projectile.penetrate = 5; Projectile.timeLeft = 300; Projectile.ignoreWater = true; Projectile.usesIDStaticNPCImmunity = true; @@ -93,14 +93,14 @@ namespace CalamityMod.Projectiles.Melee // Spawns a storm of water projectiles on-hit. public void SwordSpam(Vector2 targetPos) { - int projAmt = 3; + int projAmt = 2; var source = Projectile.GetSource_FromThis(); for (int i = 0; i < projAmt; ++i) { int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); if (Projectile.owner == Main.myPlayer) { - CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(25f, 35f), type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); + CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(25f, 35f), type, (int)(Projectile.damage * 0.4f), Projectile.knockBack * 0.5f, Projectile.owner); } } } diff --git a/Projectiles/Melee/TenebreusTidesWaterSpear.cs b/Projectiles/Melee/TenebreusTidesWaterSpear.cs index fe24abe9fe..05a3840fc4 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSpear.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSpear.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Projectiles/Magic/UndinesRetributionSpear"; - private int penetrationAmt = 4; + private int penetrationAmt = 2; private bool dontDraw = false; private int drawInt = 0; @@ -29,8 +29,9 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = penetrationAmt; Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Melee; + Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 5; + Projectile.localNPCHitCooldown = 5 * Projectile.MaxUpdates; Projectile.tileCollide = false; Projectile.ignoreWater = true; } diff --git a/Projectiles/Melee/TenebreusTidesWaterSword.cs b/Projectiles/Melee/TenebreusTidesWaterSword.cs index 6a6d36fccf..f4b305e391 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSword.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSword.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Melee public class TenebreusTidesWaterSword : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - private int penetrationAmt = 4; + private int penetrationAmt = 2; private bool dontDraw = false; private int drawInt = 0; @@ -22,8 +22,9 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = penetrationAmt; Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Melee; + Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 5; + Projectile.localNPCHitCooldown = 5 * Projectile.MaxUpdates; Projectile.tileCollide = false; Projectile.ignoreWater = true; } diff --git a/Projectiles/Melee/TyphonsGreedBubble.cs b/Projectiles/Melee/TyphonsGreedBubble.cs index 66b29cf5a4..036c41542d 100644 --- a/Projectiles/Melee/TyphonsGreedBubble.cs +++ b/Projectiles/Melee/TyphonsGreedBubble.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -40,6 +40,12 @@ namespace CalamityMod.Projectiles.Melee { Projectile.frame = 0; } + + if (Projectile.timeLeft < 210) // making it not home right away so the projectiles get closer to the character first, to make it look more natural and overall better. + { + CalamityUtils.HomeInOnNPC(Projectile, true, 450f, 20f, 20f); + } + float inertia = 50f * Projectile.ai[1]; //100 float speed = 10f * Projectile.ai[1]; //5 float num954 = 40f; diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index d31601b141..4d35054de9 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee float num3 = -0.7853982f; Vector2 value = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 value2 = Vector2.Zero; + if (player.dead) { Projectile.Kill(); diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 5d63fee825..34e4b40d44 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -186,7 +186,6 @@ namespace CalamityMod.Projectiles.Summon public void AdvancedAI(NPC potentialTarget, Player owner, MiniOffenseAIState aiState) { - bool buffedAi = owner.HasBuff(); Vector2 targetDestination = potentialTarget.Center - Projectile.Center; @@ -384,7 +383,7 @@ namespace CalamityMod.Projectiles.Summon BaseAI(potentialTarget); break; default: - if (potentialTarget != null) + if (potentialTarget != null && !ForcedVanity) AdvancedAI(potentialTarget, owner, newAIState); else BaseAI(null); diff --git a/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs b/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs index 77e3c39a6c..5783b083e6 100644 --- a/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs @@ -10,10 +10,16 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides { public static class HornetMinionAI { + // Shorter range when the minion has no target yet: 40 tiles + private const float MinEnemyDistanceDetection = 640f; + + // Longer range when a target is already acquired: 75 tiles private const float MaxEnemyDistanceDetection = 1200f; + + private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; } + private const int FireRate = 40; private const float ProjectileVelocity = 20f; - private static float EnemyDistanceDetection { get => (Target is null) ? Main.screenWidth / 2f : MaxEnemyDistanceDetection; } private static NPC Target { get; set; } public static bool DoHornetMinionAI(Projectile proj) diff --git a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs index 06b56493be..e2669c6555 100644 --- a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs @@ -7,10 +7,16 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides { public static class ImpMinionAI { + // Shorter range when the minion has no target yet: 40 tiles + private const float MinEnemyDistanceDetection = 640f; + + // Longer range when a target is already acquired: 75 tiles private const float MaxEnemyDistanceDetection = 1200f; + + private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; } + private const int FireRate = 75; private const float ProjectileVelocity = 20f; - private static float EnemyDistanceDetection { get => (Target is null) ? Main.screenWidth / 2f : MaxEnemyDistanceDetection; } private static NPC Target { get; set; } public static bool DoImpMinionAI(Projectile proj) diff --git a/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs b/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs new file mode 100644 index 0000000000..8aa29d19d9 --- /dev/null +++ b/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs @@ -0,0 +1,151 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; + +namespace CalamityMod.Projectiles.VanillaProjectileOverrides +{ + public static class RavenMinionAI + { + // Shorter range when the minion has no target yet: 60 tiles + // This is half of the width of a 1920x1080 screen. + private const float MinEnemyDistanceDetection = 960f; + + // Longer range when a target is already acquired: 150 tiles + private const float MaxEnemyDistanceDetection = 2400f; + + // The detection distance dynamically updates. + // If the minion hasn't detected a target, the minion will check within screen more or less. + // When the minion has detected a target, the minion will follow it as long as we set it to. + private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; } + + private const float DashSpeed = 35f; + private static SoundStyle CrowNoises = new("CalamityMod/Sounds/Custom/Crow", 3); + private static NPC Target { get; set; } + + public static bool DoRavenMinionAI(Projectile proj) + { + Player owner = Main.player[proj.owner]; + Target = owner.Center.MinionHoming(EnemyDistanceDetection, owner); + + CheckMinionExistence(proj, owner); + DoAnimation(proj); + + proj.localNPCHitCooldown = 10; + proj.friendly = true; + proj.tileCollide = false; + proj.ignoreWater = true; + proj.usesLocalNPCImmunity = true; + proj.usesIDStaticNPCImmunity = false; + proj.rotation = MathHelper.ToRadians(proj.velocity.X); + proj.MinionAntiClump(0.5f); + + if (Target is not null) + { + Vector2 dashDirection = proj.SafeDirectionTo(Target.Center); + + // If the minion is not withing dashing range, go towards it. + // When the minion's inside the range, it'll just move forward + // until it hits the outside bounds of the range, changing it's directions back. + // Hence giving the effect of a dash. + if (!proj.WithinRange(Target.Center, 240f)) + { + float inertia = 5f; + proj.velocity = (proj.velocity * inertia + dashDirection * DashSpeed) / (inertia + 1f); + SyncVariables(proj); + } + + // But if there was the case where the minion was already inside the range, + // if the velocity's not around the dash speed, make it dash. + else if (proj.velocity.Length() < DashSpeed - 15f) + { + proj.velocity = dashDirection * (DashSpeed - 10f); + SyncVariables(proj); + } + } + else + { + // The minion will hover around the owner. + if (!proj.WithinRange(owner.Center, 320f)) + { + proj.velocity = (proj.velocity + proj.SafeDirectionTo(owner.Center)) * 0.9f; + SyncVariables(proj); + } + + // The minion will teleport on the owner if they get far enough. + if (!proj.WithinRange(owner.Center, MaxEnemyDistanceDetection)) + { + proj.Center = owner.Center; + SyncVariables(proj); + } + + // So the minion doens't still weirdly still, move it. + if (proj.velocity == Vector2.Zero) + proj.velocity = Main.rand.NextVector2Circular(5f, 5f); + } + + if (!Main.dedServ) + { + if (Main.rand.NextBool(6000)) + SoundEngine.PlaySound(CrowNoises, proj.Center); + } + + return false; + } + + public static bool DoRavenMinionDrawing(Projectile proj, ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[proj.type].Value; + Vector2 drawPosition = proj.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[proj.type], 0, proj.frame); + Vector2 origin = frame.Size() * 0.5f; + SpriteEffects effects = MathF.Sign(-proj.velocity.X) == 1f ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + + ProjectileID.Sets.TrailingMode[proj.type] = 2; + ProjectileID.Sets.TrailCacheLength[proj.type] = 5; + + if (Target is not null) + CalamityUtils.DrawAfterimagesCentered(proj, 0, Color.MediumPurple with { A = 50 }); + + Main.EntitySpriteDraw(texture, drawPosition, frame, proj.GetAlpha(lightColor), proj.rotation, origin, proj.scale, effects); + + return false; + } + + #region AI Methods + + private static void CheckMinionExistence(Projectile proj, Player owner) + { + owner.AddBuff(BuffID.Ravens, 2); + if (proj.type != ProjectileID.Raven) + return; + + if (owner.dead) + owner.raven = false; + if (owner.raven) + proj.timeLeft = 2; + } + + private static void DoAnimation(Projectile proj) + { + proj.frameCounter++; + if (proj.frameCounter >= 5) + { + proj.frame = (proj.frame + 1) % Main.projFrames[proj.type]; + proj.frameCounter = 0; + } + } + + private static void SyncVariables(Projectile proj) + { + proj.netUpdate = true; + if (proj.netSpam >= 10) + proj.netSpam = 9; + } + + #endregion + } +} diff --git a/Sounds/Custom/Crow1.ogg b/Sounds/Custom/Crow1.ogg new file mode 100644 index 0000000000..50f84365a4 Binary files /dev/null and b/Sounds/Custom/Crow1.ogg differ diff --git a/Sounds/Custom/Crow2.ogg b/Sounds/Custom/Crow2.ogg new file mode 100644 index 0000000000..75e2da8109 Binary files /dev/null and b/Sounds/Custom/Crow2.ogg differ diff --git a/Sounds/Custom/Crow3.ogg b/Sounds/Custom/Crow3.ogg new file mode 100644 index 0000000000..7372561b5c Binary files /dev/null and b/Sounds/Custom/Crow3.ogg differ diff --git a/Tiles/DraedonStructures/SecurityChestTile.png b/Tiles/DraedonStructures/SecurityChestTile.png index 0d0daefcb2..0c7da764d4 100644 Binary files a/Tiles/DraedonStructures/SecurityChestTile.png and b/Tiles/DraedonStructures/SecurityChestTile.png differ