From 3023f204c2999ce0894702b3bfdbdf256b998960 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 10:17:25 -0400 Subject: [PATCH 1/7] fixes to plague bed and hydrothermic headgear --- CalamityMod.cs | 281 +----------------- Items/Armor/AtaxiaHeadgear.cs | 6 - .../FurniturePlaguedPlate/PlaguedPlateBed.cs | 1 + 3 files changed, 2 insertions(+), 286 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 3d8f56e4d6..b1fb7a6edd 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -64,23 +64,6 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; using CalamityMod.Skies; -using CalamityMod.Tiles.Abyss; -using CalamityMod.Tiles.Furniture; -using CalamityMod.Tiles.Furniture.CraftingStations; -using CalamityMod.Tiles.FurnitureAbyss; -using CalamityMod.Tiles.FurnitureAncient; -using CalamityMod.Tiles.FurnitureAshen; -using CalamityMod.Tiles.FurnitureBotanic; -using CalamityMod.Tiles.FurnitureCosmilite; -using CalamityMod.Tiles.FurnitureEutrophic; -using CalamityMod.Tiles.FurnitureOccult; -using CalamityMod.Tiles.FurniturePlaguedPlate; -using CalamityMod.Tiles.FurnitureProfaned; -using CalamityMod.Tiles.FurnitureSilva; -using CalamityMod.Tiles.FurnitureStatigel; -using CalamityMod.Tiles.FurnitureStratus; -using CalamityMod.Tiles.FurnitureVoid; -using CalamityMod.Tiles.SunkenSea; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -181,10 +164,6 @@ namespace CalamityMod public static List trapProjectileList; public static List scopedWeaponList; public static List trueMeleeBoostExceptionList; - public static List tableList; - public static List chairList; - public static List lightList; - public static List doorList; public static List boomerangList; public static List javelinList; public static List daggerList; @@ -390,10 +369,6 @@ namespace CalamityMod trapProjectileList = null; scopedWeaponList = null; trueMeleeBoostExceptionList = null; - tableList = null; - chairList = null; - lightList = null; - doorList = null; boomerangList = null; javelinList = null; daggerList = null; @@ -2321,7 +2296,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -2357,260 +2332,6 @@ namespace CalamityMod ItemID.SuperHealingPotion }; - tableList = new List() - { - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType() - }; - - chairList = new List() - { - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType() - }; - - lightList = new List() - { - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType() - }; - - doorList = new List() - { - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType() - }; - zombieList = new List() { NPCID.Zombie, diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/AtaxiaHeadgear.cs index fe500812c5..413f44b1bb 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/AtaxiaHeadgear.cs @@ -37,12 +37,6 @@ namespace CalamityMod.Items.Armor player.Calamity().hydrothermalSmoke = true; } - public override void DrawHair(ref bool drawHair, ref bool drawAltHair) - { - drawHair = true; - drawAltHair = true; - } - public override void UpdateArmorSet(Player player) { player.setBonus = "5% increased ranged damage\n" + diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs index 5ee2bebec7..b82ca24cdb 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate disableSmartCursor = true; adjTiles = new int[] { TileID.Beds }; bed = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } public override bool CreateDust(int i, int j, ref int type) From 3e92876ebf3dc426a9794c11f3d4095d5fa32b2a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 10:18:20 -0400 Subject: [PATCH 2/7] using directive mem --- CalamityMod.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CalamityMod.cs b/CalamityMod.cs index 29ae049c8e..488dadadaa 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -15,6 +15,7 @@ using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Tools; From 789111f85f5c2e88ec33b048c939fabdae3b5bc5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 10:22:42 -0400 Subject: [PATCH 3/7] gamma heart fixes --- Items/Weapons/Summon/GammaHeart.cs | 2 +- ModSupport/WeakReferenceSupport.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/GammaHeart.cs b/Items/Weapons/Summon/GammaHeart.cs index f7ff3df028..193359e6db 100644 --- a/Items/Weapons/Summon/GammaHeart.cs +++ b/Items/Weapons/Summon/GammaHeart.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Gamma Heart"); - Tooltip.SetDefault("Summons a frigid entity with a head\n" + + Tooltip.SetDefault("Summons radioactive heads that are bound by your body\n" + "If the entity already exists, using this item again will cause it to gain more heads"); } diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 9e64f16e48..3fad913aec 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -850,6 +850,7 @@ namespace CalamityMod sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType(), 1f); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); From 23400f7e7f7d3950788ed067393029e42196d92c Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 11:37:35 -0400 Subject: [PATCH 4/7] wtf is wrong with ambrosial ampoule --- CalPlayer/CalamityPlayerMiscEffects.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 25cb050dce..8d02e8f11e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -505,8 +505,7 @@ namespace CalamityMod.CalPlayer bool immunityToHotAndCold = hasMoltenSet || player.magmaStone || player.frostArmor || modPlayer.fBulwark || modPlayer.fBarrier || modPlayer.frostFlare || modPlayer.rampartOfDeities || modPlayer.cryogenSoul || modPlayer.snowman || modPlayer.blazingCore || modPlayer.permafrostsConcoction || modPlayer.profanedCrystalBuffs || modPlayer.coldDivinity; - bool immunityToCold = player.HasBuff(BuffID.Campfire) || Main.campfire || player.resistCold || modPlayer.eskimoSet || player.buffImmune[BuffID.Frozen] || - player.HasBuff(BuffID.Inferno) || immunityToHotAndCold || modPlayer.externalColdImmunity; + bool immunityToCold = player.HasBuff(BuffID.Campfire) || Main.campfire || player.resistCold || modPlayer.eskimoSet || player.buffImmune[BuffID.Frozen] || modPlayer.aAmpoule || player.HasBuff(BuffID.Inferno) || immunityToHotAndCold || modPlayer.externalColdImmunity; bool immunityToHot = player.lavaImmune || player.lavaRose || player.lavaMax > 0 || immunityToHotAndCold || modPlayer.externalHeatImmunity; From dc280b1294dca20cdcf230b24057fdd1d5f6f232 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 15:10:13 -0400 Subject: [PATCH 5/7] fixes to summons and flat dmg --- CalPlayer/CalamityPlayer.cs | 4 ++-- Items/Armor/AtaxiaHelmet.cs | 2 +- Items/Armor/AuricTeslaSpaceHelmet.cs | 4 ++-- Items/Armor/DaedalusHeadgear.cs | 2 +- Items/Armor/PlagueReaperMask.cs | 2 +- Items/Armor/ReaverHelmet.cs | 2 +- Items/Armor/SilvaHelmet.cs | 2 +- Projectiles/Summon/DaedalusCrystal.cs | 2 +- Projectiles/Summon/SilvaCrystal.cs | 11 ++++------- 9 files changed, 14 insertions(+), 17 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 77652391c9..57fa2dc778 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2395,7 +2395,7 @@ namespace CalamityMod.CalPlayer double deltaAngle = spread / 8f; double offsetAngle; int i; - int damage = 800; + int damage = 800 * player.RangedDamage(); if (player.whoAmI == Main.myPlayer) { for (i = 0; i < 8; i++) @@ -2514,7 +2514,7 @@ namespace CalamityMod.CalPlayer } gaelRageCooldown = 60 * GaelsGreatsword.SkullsplosionCooldownSeconds; float rageRatio = (float)stress / stressMax; - int damage = (int)(rageRatio * GaelsGreatsword.MaxRageBoost * GaelsGreatsword.BaseDamage); + int damage = (int)(rageRatio * GaelsGreatsword.MaxRageBoost * GaelsGreatsword.BaseDamage * player.MeleeDamage()); float skullCount = 5f; float skullSpeed = 5f; if (CalamityWorld.downedYharon) diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index 0607f409d1..e91deb96a3 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(190f * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(190f * player.MinionDamage()), 0f, Main.myPlayer, 38f, 0f); } } player.minionDamage += 0.4f; diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 188f38b4ae..296e19fd3a 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(3000f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(3000f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f); } if (player.FindBuffIndex(ModContent.BuffType()) == -1) { @@ -105,7 +105,7 @@ namespace CalamityMod.Items.Armor { maxMinionScale = 10; } - int damage = (int)(35 * (((player.allDamage + player.minionDamage - 1f) * 5 / 3) + ((player.allDamage + player.minionDamage - 1f) * 0.46f * (maxMinionScale - 1)))); + int damage = (int)(35 * ((player.MinionDamage() * 5 / 3) + (player.MinionDamage() * 0.46f * (maxMinionScale - 1)))); Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index 3f32855caf..644fd96189 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(95f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(95f * player.MinionDamage()), 0f, Main.myPlayer, 50f, 0f); } } player.minionDamage += 0.2f; diff --git a/Items/Armor/PlagueReaperMask.cs b/Items/Armor/PlagueReaperMask.cs index 032e91db71..fa54b7ef09 100644 --- a/Items/Armor/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaperMask.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Items.Armor num18 = (float)num17 / num18; num15 *= num18; num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), 40,4f, player.whoAmI, 0f, 0f); + int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), 40 * player.RangedDamage(),4f, player.whoAmI, 0f, 0f); Main.projectile[num19].Calamity().rogue = false; Main.projectile[num19].ai[1] = player.position.Y; } diff --git a/Items/Armor/ReaverHelmet.cs b/Items/Armor/ReaverHelmet.cs index f51c131c78..4030bf53d2 100644 --- a/Items/Armor/ReaverHelmet.cs +++ b/Items/Armor/ReaverHelmet.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(80f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(80f * player.MinionDamage()), 0f, Main.myPlayer, 50f, 0f); } } player.minionDamage += 0.16f; diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 9ad57c7179..57f5e2eccf 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1500f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1500f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f); } } player.minionDamage += 0.75f; diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index d3053e17ad..eaf0cd193d 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num512 = 0; num512 < 200; num512++) + for (int num512 = 0; num512 < Main.maxNPCs; num512++) { if (Main.npc[num512].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 5da5e5f66d..697cbdc758 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Summon } projectile.position.X = player.Center.X - (float)(projectile.width / 2); projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; - if (Main.player[projectile.owner].gravDir == -1f) + if (player.gravDir == -1f) { projectile.position.Y = projectile.position.Y + 120f; projectile.rotation = 3.14f; @@ -211,13 +211,10 @@ namespace CalamityMod.Projectiles.Summon float scaleFactor5 = (float)Math.Cos((double)(6.28318548f * (projectile.localAI[0] / 60f))) + 3f + 3f; for (float num286 = 0f; num286 < 4f; num286 += 1f) { - SpriteBatch arg_F907_0 = Main.spriteBatch; - Texture2D arg_F907_1 = texture2D34; - Vector2 arg_F8CE_0 = vector59; - Vector2 arg_F8BE_0 = Vector2.UnitY; - double arg_F8BE_1 = (double)(num286 * 1.57079637f); + SpriteBatch spritebatch = Main.spriteBatch; + double arg_F8BE_1 = (double)(num286 * MathHelper.PiOver2); Vector2 center = default; - arg_F907_0.Draw(arg_F907_1, arg_F8CE_0 + arg_F8BE_0.RotatedBy(arg_F8BE_1, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); + spritebatch.Draw(texture2D34, vector59 + Vector2.UnitY.RotatedBy(arg_F8BE_1, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); } return false; } From a0526da1e7f4d7a8833f181429bd75cd78267099 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 17:21:44 -0400 Subject: [PATCH 6/7] casts are dumb --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Armor/PlagueReaperMask.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 57fa2dc778..9fea2e3fc4 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2395,7 +2395,7 @@ namespace CalamityMod.CalPlayer double deltaAngle = spread / 8f; double offsetAngle; int i; - int damage = 800 * player.RangedDamage(); + int damage = (int)(800 * player.RangedDamage()); if (player.whoAmI == Main.myPlayer) { for (i = 0; i < 8; i++) diff --git a/Items/Armor/PlagueReaperMask.cs b/Items/Armor/PlagueReaperMask.cs index fa54b7ef09..ce96870613 100644 --- a/Items/Armor/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaperMask.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Items.Armor num18 = (float)num17 / num18; num15 *= num18; num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), 40 * player.RangedDamage(),4f, player.whoAmI, 0f, 0f); + int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(40 * player.RangedDamage()),4f, player.whoAmI, 0f, 0f); Main.projectile[num19].Calamity().rogue = false; Main.projectile[num19].ai[1] = player.position.Y; } From a1e70ed7fe3ca03674ce5810d4add8bc5750f422 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Apr 2020 18:45:49 -0400 Subject: [PATCH 7/7] various changes and weapon balancing vigil and res butterfly rework-ish nerfs to vile feeder and snap clam buff to corroded caustibow ethereal subjugator and herring staff tooltip clarification --- Items/Weapons/Ranged/CorrodedCaustibow.cs | 4 +-- Items/Weapons/Rogue/SnapClam.cs | 4 +-- Items/Weapons/Summon/BlightedEyeStaff.cs | 5 +-- Items/Weapons/Summon/EtherealSubjugator.cs | 3 +- Items/Weapons/Summon/HerringStaff.cs | 3 +- Items/Weapons/Summon/ResurrectionButterfly.cs | 2 +- ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 4 +++ Projectiles/Hybrid/ScourgeoftheCosmosMini.cs | 6 ++-- Projectiles/Rogue/SnapClamStealth.cs | 2 +- Projectiles/Summon/BrimstoneFireSummon.cs | 11 ++++-- Projectiles/Summon/BrimstoneLaserSummon.cs | 7 +++- Projectiles/Summon/Calamitamini.cs | 2 +- Projectiles/Summon/Cataclymini.cs | 4 +-- Projectiles/Summon/Catastromini.cs | 7 +++- Projectiles/Summon/CinderBlossom.cs | 2 +- Projectiles/Summon/PinkButterfly.cs | 10 +++--- Projectiles/Summon/PurpleButterfly.cs | 6 ++-- Projectiles/Summon/SakuraBullet.cs | 34 +++++++++++++++---- Projectiles/Summon/VileFeederProjectile.cs | 21 ++++++------ Projectiles/Summon/VileFeederSummon.cs | 12 +++---- 21 files changed, 98 insertions(+), 53 deletions(-) diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index b96d176882..4a3fd3eec9 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.width = 30; item.height = 38; item.crit += 20; - item.useTime = 60; - item.useAnimation = 60; + item.useTime = 45; + item.useAnimation = 45; item.useStyle = 5; item.noMelee = true; item.knockBack = 6f; diff --git a/Items/Weapons/Rogue/SnapClam.cs b/Items/Weapons/Rogue/SnapClam.cs index 534801f4d9..546241c887 100644 --- a/Items/Weapons/Rogue/SnapClam.cs +++ b/Items/Weapons/Rogue/SnapClam.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 26; item.height = 16; - item.damage = 15; + item.damage = 14; item.thrown = true; item.noMelee = true; item.noUseGraphic = true; @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { int spread = 3; - for (int i = 0; i < 7; i++) + for (int i = 0; i < 5; i++) { Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Summon/BlightedEyeStaff.cs b/Items/Weapons/Summon/BlightedEyeStaff.cs index 5e1b0ce5e0..c1ad10dbd9 100644 --- a/Items/Weapons/Summon/BlightedEyeStaff.cs +++ b/Items/Weapons/Summon/BlightedEyeStaff.cs @@ -12,12 +12,13 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Entropy's Vigil"); - Tooltip.SetDefault("Summons Calamitas and her brothers to protect you"); + Tooltip.SetDefault("Summons Calamitas and her brothers to protect you\n" + + "One minion trio takes two minion slots"); } public override void SetDefaults() { - item.damage = 27; + item.damage = 35; item.mana = 10; item.width = 62; item.height = 62; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index c1a2ab167b..bc0779b2f9 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Ethereal Subjugator"); - Tooltip.SetDefault("Summons a phantom to protect you"); + Tooltip.SetDefault("Summons a phantom to protect you\n" + + "Each phantom takes only half of a minion slot"); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 561102e055..c5b620cd32 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Herring Staff"); - Tooltip.SetDefault("Summons a herring to fight for you"); + Tooltip.SetDefault("Summons a herring to fight for you\n" + + "Each herring takes only half of a minion slot"); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index c8447a8c82..0a2520e6fc 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 25; + item.damage = 38; item.mana = 10; item.width = 46; item.height = 46; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 3fad913aec..a084a6fa83 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -836,7 +836,7 @@ namespace CalamityMod sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType(), ProjectileType()}, new List() {1f-0.6666666f, 0.3333333f, 0.3333333f}); + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType(), ProjectileType()}, new List() {1-(1f/3f), 2f/3f, 2f/3f}); //Entropy's Vigil is a bruh moment sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index dfdb2442cd..a507492d2a 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3445,6 +3445,8 @@ namespace CalamityMod.NPCs } else if (projectile.type == ModContent.ProjectileType()) { + if (projectile.penetrate == -1) + projectile.penetrate = 5; damage = (int)(damage * 0.1); } } @@ -3460,6 +3462,8 @@ namespace CalamityMod.NPCs } else if (projectile.type == ModContent.ProjectileType()) { + if (projectile.penetrate == -1) + projectile.penetrate = 5; damage = (int)(damage * 0.1); } } diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs b/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs index 28b2ffb3e8..468eae73a4 100644 --- a/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs @@ -62,11 +62,11 @@ namespace CalamityMod.Projectiles.Hybrid float num370 = projectile.velocity.X / 3f * (float)num369; float num371 = projectile.velocity.Y / 3f * (float)num369; int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[num372].position.X = projectile.Center.X - num370; - Main.dust[num372].position.Y = projectile.Center.Y - num371; Dust dust = Main.dust[num372]; + dust.position.X = projectile.Center.X - num370; + dust.position.Y = projectile.Center.Y - num371; dust.velocity *= 0f; - Main.dust[num372].scale = 0.5f; + dust.scale = 0.5f; } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f; float num373 = projectile.position.X; diff --git a/Projectiles/Rogue/SnapClamStealth.cs b/Projectiles/Rogue/SnapClamStealth.cs index 99282c6e36..56aeec3e7b 100644 --- a/Projectiles/Rogue/SnapClamStealth.cs +++ b/Projectiles/Rogue/SnapClamStealth.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue if (openClam) { onEnemy = true; - CalamityUtils.ModifyHitNPCSticky(projectile, 7, false); + CalamityUtils.ModifyHitNPCSticky(projectile, 5, false); } } diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 56cfa6c715..879d9568ff 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -21,7 +22,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ignoreWater = true; projectile.minion = true; projectile.minionSlots = 0f; - projectile.penetrate = 1; + projectile.penetrate = -1; projectile.extraUpdates = 3; projectile.timeLeft = 50; } @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon num296 = 0.75f; } projectile.ai[0] += 1f; - int num297 = 235; + int num297 = (int)CalamityDusts.Brimstone; if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) @@ -77,6 +78,12 @@ namespace CalamityMod.Projectiles.Summon } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 9; + target.AddBuff(ModContent.BuffType(), 120); + } + + public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index ede47f0b00..4b0623567a 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 32; + projectile.width = 2; projectile.height = 2; projectile.aiStyle = 1; aiType = ProjectileID.DeathLaser; @@ -43,6 +43,11 @@ namespace CalamityMod.Projectiles.Summon target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override Color? GetAlpha(Color lightColor) { return new Color(250, 50, 50, projectile.alpha); diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index 3e84416676..8ee9315bf7 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0.5f; + projectile.minionSlots = 1f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index ec460fd744..b8372875eb 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0.25f; + projectile.minionSlots = 0.5f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; @@ -237,7 +237,7 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.ai[1] > 0f) { - projectile.ai[1] += (float)Main.rand.Next(1, 80); + projectile.ai[1] += (float)Main.rand.Next(1, 30); } if (projectile.ai[1] > 90f) { diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index e9bf6d1068..86a4b27f9e 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0.25f; + projectile.minionSlots = 0.5f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; @@ -292,5 +292,10 @@ namespace CalamityMod.Projectiles.Summon Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); return false; } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 8; + } } } diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index 797a94632f..27ed84cc9b 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.owner == Main.myPlayer) { - NPC potentialTarget = projectile.Center.MinionHoming(600f, player); + NPC potentialTarget = projectile.Center.MinionHoming(700f, player); if (potentialTarget != null) { if (projectile.ai[1]++ % 35f == 34f && diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 973cab56c2..284e186e20 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0.5f; + projectile.minionSlots = 1f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; @@ -207,8 +207,8 @@ namespace CalamityMod.Projectiles.Summon } if (num651 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); projectile.netUpdate = true; } if (num651 > 70f) @@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[1] += (float)Main.rand.Next(1, 3); // Reset timer - if (projectile.ai[1] > 60f) + if (projectile.ai[1] > 70f) { projectile.ai[1] = 0f; projectile.netUpdate = true; @@ -258,7 +258,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, projectileType, projectile.damage / 2, projectile.knockBack * 0.5f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, projectileType, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); } projectile.netUpdate = true; } diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index 1a25ae4129..14474f0c28 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0.5f; + projectile.minionSlots = 1f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; @@ -283,9 +283,9 @@ namespace CalamityMod.Projectiles.Summon public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (target.type == NPCID.DukeFishron) - damage = (int)((double)damage * 2.0); + damage = (int)(damage * 2.0); else if (target.type == NPCID.CultistBoss) - damage = (int)((double)damage * 0.6); + damage = (int)(damage * 0.75); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 5881b6aa51..9f1c30b3e3 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; float num472 = projectile.Center.X; @@ -37,12 +38,13 @@ namespace CalamityMod.Projectiles.Summon float num474 = 400f; bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) + if (player.HasMinionAttackTargetNPC) { - if (Main.npc[num475].CanBeChasedBy(projectile, false) || Main.npc[num475].type == NPCID.DukeFishron) + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); if (num478 < num474) { @@ -53,6 +55,26 @@ namespace CalamityMod.Projectiles.Summon } } } + else + { + for (int num475 = 0; num475 < Main.maxNPCs; num475++) + { + NPC npc = Main.npc[num475]; + if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + } if (flag17) { @@ -77,9 +99,9 @@ namespace CalamityMod.Projectiles.Summon public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (target.type == NPCID.DukeFishron) - damage = (int)((double)damage * 2.0); + damage = (int)(damage * 2.0); else if (target.type == NPCID.CultistBoss) - damage = (int)((double)damage * 0.6); + damage = (int)(damage * 0.75); } public override void Kill(int timeLeft) diff --git a/Projectiles/Summon/VileFeederProjectile.cs b/Projectiles/Summon/VileFeederProjectile.cs index 7ddcdf7d14..e029db0834 100644 --- a/Projectiles/Summon/VileFeederProjectile.cs +++ b/Projectiles/Summon/VileFeederProjectile.cs @@ -52,19 +52,17 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - int num3; - for (int num369 = 0; num369 < 1; num369 = num3 + 1) + for (int num369 = 0; num369 < 1; num369++) { int dustType = 7; float num370 = projectile.velocity.X / 3f * (float)num369; float num371 = projectile.velocity.Y / 3f * (float)num369; int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); - Main.dust[num372].position.X = projectile.Center.X - num370; - Main.dust[num372].position.Y = projectile.Center.Y - num371; Dust dust = Main.dust[num372]; + dust.position.X = projectile.Center.X - num370; + dust.position.Y = projectile.Center.Y - num371; dust.velocity *= 0f; - Main.dust[num372].scale = 0.5f; - num3 = num369; + dust.scale = 0.5f; } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - MathHelper.PiOver2; float num373 = projectile.position.X; @@ -83,7 +81,7 @@ namespace CalamityMod.Projectiles.Summon float num377 = npc.position.X + (float)(npc.width / 2); float num378 = npc.position.Y + (float)(npc.height / 2); float num379 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num377) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num378); - if (num379 < 800f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if (num379 < 640f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num375 = num379; num373 = num377; @@ -96,12 +94,13 @@ namespace CalamityMod.Projectiles.Summon { for (int num376 = 0; num376 < Main.maxNPCs; num376++) { - if (Main.npc[num376].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num376]; + if (npc.CanBeChasedBy(projectile, false)) { - float num377 = Main.npc[num376].position.X + (float)(Main.npc[num376].width / 2); - float num378 = Main.npc[num376].position.Y + (float)(Main.npc[num376].height / 2); + float num377 = npc.position.X + (float)(npc.width / 2); + float num378 = npc.position.Y + (float)(npc.height / 2); float num379 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num377) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num378); - if (num379 < 800f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height)) + if (num379 < 640f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num375 = num379; num373 = num377; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 769e4d10b6..33c56c7099 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - DisplayName.SetDefault("Eater of Souls"); + DisplayName.SetDefault("Baby Eater"); Main.projFrames[projectile.type] = 4; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Summon } Vector2 vector46 = projectile.position; - float num633 = 800f; //50 block detection range + float num633 = 640f; //40 block detection range bool targetFound = false; if (player.HasMinionAttackTargetNPC) { @@ -322,20 +322,20 @@ namespace CalamityMod.Projectiles.Summon if (projectile.owner == Main.myPlayer) { if (eaterCooldown > 0) - eaterCooldown -= Main.rand.Next(1,4); + eaterCooldown -= Main.rand.Next(1,3); if (eaterCooldown <= 0) { - int projNumber = Main.rand.Next(1,4); + int projNumber = Main.rand.Next(1,3); for (int index2 = 0; index2 < projNumber; index2++) { float xVector = (float)Main.rand.Next(-35, 36) * 0.02f; float yVector = (float)Main.rand.Next(-35, 36) * 0.02f; xVector *= 10f; yVector *= 10f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), (int)(VileFeeder.BaseDamage * player.MinionDamage() * 1.5f), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), (int)(VileFeeder.BaseDamage * player.MinionDamage() * 1.25f), projectile.knockBack, projectile.owner, 0f, 0f); } - eaterCooldown = 70; + eaterCooldown = 80; } } }