diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 3307e577d6..a7ead5fe5e 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -364,7 +364,7 @@ namespace CalamityMod "Ceaseless Void", (Func)(() => CalamityWorld.downedSentinel1), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Dungeon", "[c/4B0082:The rift in time and space has moved away from your reach.]"); @@ -376,7 +376,7 @@ namespace CalamityMod calamity, "Storm Weaver", (Func)(() => CalamityWorld.downedSentinel2), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in Space", "[c/EE82EE:Storm Weaver hid itself once again within the stormfront.]", @@ -391,7 +391,7 @@ namespace CalamityMod "Signus", (Func)(() => CalamityWorld.downedSentinel3), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Underworld", "[c/BA55D3:The Devourer's assassin has finished its easy task.]"); diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 2da359038d..5becb74b6c 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -93,7 +93,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); } } } diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index 1bd101d748..2d681fc606 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { int bandageDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 50 : 100; - DropHelper.DropItemCondition(npc, ItemID.AdhesiveBandage, Main.hardMode, bandageDropRate, 1, 1); + DropHelper.DropItemChance(npc, ItemID.AdhesiveBandage, bandageDropRate, 1, 1); } } } diff --git a/Projectiles/Rogue/CelestialReaperProjectile.cs b/Projectiles/Rogue/CelestialReaperProjectile.cs index 1866d0657d..39b9736c8f 100644 --- a/Projectiles/Rogue/CelestialReaperProjectile.cs +++ b/Projectiles/Rogue/CelestialReaperProjectile.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -52,12 +53,22 @@ namespace CalamityMod.Projectiles.Rogue } } } - public override bool? CanHitNPC(NPC target) => HomingCooldown == 0 && !target.townNPC - && target.type != NPCID.DD2EterniaCrystal && !target.immortal && !target.dontTakeDamage; + + public override bool CanDamage() + { + return HomingCooldown == 0; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { HomingCooldown = 25; projectile.velocity *= -0.75f; //bounce off of enemy + + //prevent dummy exploits + if (target.type == NPCID.TargetDummy || target.type == ModContent.NPCType()) + { + projectile.Kill(); + } } public override void Kill(int timeLeft) { diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 6cc5ea1259..3854420a48 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -59,10 +59,6 @@ namespace CalamityMod.Projectiles.Summon (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } - float num633 = 700f; - float num634 = 1300f; - float num635 = 2600f; - float num636 = 600f; bool flag64 = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) @@ -100,6 +96,10 @@ namespace CalamityMod.Projectiles.Summon } } } + float num633 = 700f; + float num634 = 1300f; + float num635 = 2600f; + float num636 = 600f; Vector2 vector46 = projectile.position; bool flag25 = false; if (player.HasMinionAttackTargetNPC) diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index c4a14aeeea..1a16aec682 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Summon } float num396 = projectile.position.X; float num397 = projectile.position.Y; - float num398 = 700f; + float minDistance = 7000f; bool flag11 = false; if (player.HasMinionAttackTargetNPC) { @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon float num539 = npc.position.X + (float)(npc.width / 2); float num540 = npc.position.Y + (float)(npc.height / 2); float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if (num541 < minDistance) { num396 = num539; num397 = num540; @@ -122,9 +122,9 @@ namespace CalamityMod.Projectiles.Summon float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401); - if (num402 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num399].position, Main.npc[num399].width, Main.npc[num399].height)) + if (num402 < minDistance) { - num398 = num402; + minDistance = num402; num396 = num400; num397 = num401; flag11 = true;