diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2c327ced18..9ad6d1e98f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3780,6 +3780,13 @@ namespace CalamityMod.CalPlayer if (player.wingTimeMax < 50000) player.wingTimeMax = 50000; } + + // Do not apply reduced aggro if there are any bosses alive and it's singleplayer + if (CalamityPlayer.areThereAnyDamnBosses && Main.netMode == NetmodeID.SinglePlayer) + { + if (player.aggro < 0) + player.aggro = 0; + } } #endregion diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 3cfde01c12..c90201c60e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -228,6 +228,8 @@ namespace CalamityMod.NPCs.DevourerofGods { if (!halfLife) { + Teleport(player); + string key = "Mods.CalamityMod.EdgyBossText11"; Color messageColor = Color.Cyan; if (Main.netMode == NetmodeID.SinglePlayer) diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index a5186f8300..3aa58a4535 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -42,7 +42,6 @@ namespace CalamityMod.NPCs.OldDuke npc.DeathSound = SoundID.NPCDeath11; npc.noGravity = true; npc.noTileCollide = true; - npc.behindTiles = true; } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 66217e8871..e1281d6ecc 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -229,7 +229,6 @@ namespace CalamityMod.NPCs.Ravager if (npc.localAI[1] >= 600f) { npc.localAI[1] = 0f; - npc.TargetClosest(true); if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { float velocity = CalamityWorld.bossRushActive ? 10f : 7f; @@ -548,7 +547,7 @@ namespace CalamityMod.NPCs.Ravager } else { - npc.TargetClosest(true); + npc.TargetClosest(true); // Fall through if (!player.dead && expertMode) diff --git a/World/Planets/MudPlanet.cs b/World/Planets/MudPlanet.cs index 0fb1bbd85b..b065338a43 100644 --- a/World/Planets/MudPlanet.cs +++ b/World/Planets/MudPlanet.cs @@ -1,8 +1,10 @@ +using CalamityMod.Items.Potions; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Generation; using Terraria.ID; +using Terraria.ModLoader; using Terraria.World.Generation; namespace CalamityMod.World.Planets @@ -47,7 +49,7 @@ namespace CalamityMod.World.Planets { int x = _random.Next(origin.X - radius + 3, origin.X + radius - 2); int y = _random.Next(origin.Y - radius + 3, origin.Y + radius - 2); - WorldGen.TileRunner(x, y, (double)_random.NextFloat(5f, 9f), _random.Next(5, 15), TileID.Stone); + WorldGen.TileRunner(x, y, _random.NextFloat(5f, 9f), _random.Next(5, 15), TileID.Stone); } //Place grass, remove wall and occasionally smooth @@ -102,11 +104,11 @@ namespace CalamityMod.World.Planets new Modifiers.Conditions(new CustomConditions.RandomChance(7)), new Actions.SetLiquid(2, 255) })); - bool placedSpawner = false; - while (!placedSpawner) + bool placedChest = false; + while (!placedChest) { - int testX = origin.X + _random.Next(-(int)radius, (int)radius); - int testY = origin.Y + _random.Next(-(int)radius, (int)radius); + int testX = origin.X + _random.Next(-radius, radius); + int testY = origin.Y + _random.Next(-radius, radius); if (WorldGen.EmptyTileCheck(testX - 1, testX + 1, testY - 1, testY + 1) && _tiles[testX, testY].wall == WallID.HiveUnsafe) { for (int floorX = testX - 1; floorX <= testX + 1; floorX++) @@ -115,9 +117,10 @@ namespace CalamityMod.World.Planets _tiles[floorX, testY + 2].type = TileID.Hive; WorldGen.SquareTileFrame(floorX, testY + 2); } - bool placed = WorldGen.PlaceTile(testX, testY + 1, TileID.Larva, true, false); - if (placed) - placedSpawner = true; + //Place chest + int chestID = WorldGen.PlaceChest(testX, testY + 1, 21, false, 29); + FillHoneyChest(chestID); + placedChest = true; } } } @@ -270,5 +273,90 @@ namespace CalamityMod.World.Planets } } - } + + //--------------------- + //HONEY CHEST STUFF + //--------------------- + + private int[] FocusLootHoney = new int[] + { + ItemID.NaturesGift, + ItemID.Bezoar, + ItemID.SharpeningStation + }; + + private int[] PotionLootHoney = new int[] + { + ItemID.LifeforcePotion, + ItemID.RegenerationPotion, + ItemID.ManaRegenerationPotion, + ItemID.HeartreachPotion, + ModContent.ItemType(), + ModContent.ItemType() + }; + + private int[] BarLootHoney = new int[] + { + WorldGen.SilverTierOre == TileID.Silver ? ItemID.SilverBar : ItemID.TungstenBar, + WorldGen.GoldTierOre == TileID.Gold ? ItemID.GoldBar : ItemID.PlatinumBar + }; + + private void FillHoneyChest(int id) + { + Chest chest = Main.chest[id]; + int index = 0; + + //Focus loot + chest.item[index++].SetDefaults(_random.Next(FocusLootHoney)); + + //Bars + if (_random.Next(3) <= 1) + { + chest.item[index].SetDefaults(_random.Next(BarLootHoney)); + chest.item[index].SetDefaults(_random.Next(7, 15)); + } + else + { + chest.item[index].SetDefaults(ItemID.GoldCoin); + chest.item[index++].stack = _random.Next(3, 5); // 3 or 4 gold coins + } + + //Potion loot + if (_random.Next(2) == 0) + { + chest.item[index].SetDefaults(_random.Next(PotionLootHoney)); + chest.item[index++].stack = _random.Next(1, 4); + } + else //Healing potion + { + chest.item[index].SetDefaults(ItemID.BottledHoney); + chest.item[index++].stack = _random.Next(3, 7); + } + + //Weaponry + if (_random.Next(2) == 0) + { + chest.item[index].SetDefaults(ItemID.Stinger); + chest.item[index++].stack = _random.Next(4, 6); + } + else + { + chest.item[index].SetDefaults(ItemID.JungleSpores); + chest.item[index++].stack = _random.Next(3, 5); + } + + //Recall potion + if (_random.Next(2) == 0) + { + chest.item[index].SetDefaults(ItemID.RecallPotion); + chest.item[index++].stack = _random.Next(1, 4); + } + else //glowsticks + { + chest.item[index].SetDefaults(ItemID.YellowTorch); + chest.item[index++].stack = _random.Next(18, 36); + } + + } + } }