From ff223e0674b0321e886c8b327ddbb698de03412c Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 9 Sep 2021 15:55:21 -0500 Subject: [PATCH] 1 - Draedon's Heart is now the Exo Mech expert accessory, removed the the recipe and Rev+ accessory affects. 2 - Daedalus armor, Catastrophe Claymore, Crystal Blade, Consecrated Water and Fulguration Halberd require less crystal shards to craft. 3 - Revivify Potion blood orb recipe requirement increased. 4 - Exo Mech treasure bag. 5 - Reduced Fabstaff and Helium Flash recipe requirements. 6 - Weak Reference Support for exo mechs adjusted. 7 - Exo mech minimap icons. 8 - Exo mech loot drop code. 9 - Artemis targets the same player as Apollo if Apollo is alive. --- CalPlayer/CalamityPlayerMiscEffects.cs | 10 -- Items/Accessories/DraedonsHeart.cs | 42 ++------ Items/Armor/DaedalusBreastplate.cs | 2 +- Items/Armor/DaedalusHat.cs | 2 +- Items/Armor/DaedalusHeadgear.cs | 2 +- Items/Armor/DaedalusHelm.cs | 2 +- Items/Armor/DaedalusHelmet.cs | 2 +- Items/Armor/DaedalusLeggings.cs | 2 +- Items/Armor/DaedalusVisor.cs | 2 +- Items/Potions/RevivifyPotion.cs | 2 +- Items/TreasureBags/DraedonTreasureBag.cs | 68 +++++++++++++ Items/TreasureBags/DraedonTreasureBag.png | Bin 0 -> 943 bytes Items/Weapons/Magic/Fabstaff.cs | 5 +- Items/Weapons/Magic/HeliumFlash.cs | 4 +- Items/Weapons/Melee/CatastropheClaymore.cs | 2 +- Items/Weapons/Melee/CrystalBlade.cs | 4 +- Items/Weapons/Melee/FulgurationHalberd.cs | 4 +- Items/Weapons/Rogue/ConsecratedWater.cs | 2 +- ModSupport/WeakReferenceSupport.cs | 15 ++- NPCs/ExoMechs/Apollo/Apollo.cs | 56 +++++++---- NPCs/ExoMechs/Apollo/ApolloHead.png | Bin 0 -> 477 bytes NPCs/ExoMechs/Apollo/ApolloPhase2Head.png | Bin 0 -> 476 bytes NPCs/ExoMechs/Ares/AresBody.cs | 53 ++++++++--- NPCs/ExoMechs/Ares/AresBody_Head_Boss.png | Bin 0 -> 482 bytes NPCs/ExoMechs/Artemis/Artemis.cs | 90 ++++++++---------- NPCs/ExoMechs/Artemis/ArtemisHead.png | Bin 0 -> 474 bytes NPCs/ExoMechs/Artemis/ArtemisPhase2Head.png | Bin 0 -> 478 bytes NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 36 ++++++- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 36 ++++++- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 63 ++++++++---- NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png | Bin 0 -> 414 bytes NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png | Bin 0 -> 435 bytes NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png | Bin 0 -> 411 bytes NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 36 ++++++- .../Thanatos/ThanatosVulnerableBody.png | Bin 0 -> 391 bytes .../Thanatos/ThanatosVulnerableHead.png | Bin 0 -> 406 bytes .../Thanatos/ThanatosVulnerableTail.png | Bin 0 -> 390 bytes 37 files changed, 363 insertions(+), 179 deletions(-) create mode 100644 Items/TreasureBags/DraedonTreasureBag.cs create mode 100644 Items/TreasureBags/DraedonTreasureBag.png create mode 100644 NPCs/ExoMechs/Apollo/ApolloHead.png create mode 100644 NPCs/ExoMechs/Apollo/ApolloPhase2Head.png create mode 100644 NPCs/ExoMechs/Ares/AresBody_Head_Boss.png create mode 100644 NPCs/ExoMechs/Artemis/ArtemisHead.png create mode 100644 NPCs/ExoMechs/Artemis/ArtemisPhase2Head.png create mode 100644 NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png create mode 100644 NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png create mode 100644 NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png create mode 100644 NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png create mode 100644 NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png create mode 100644 NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 0ebb0d5dd3..2577bc8695 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -271,15 +271,6 @@ namespace CalamityMod.CalPlayer { float rageGen = 0f; - // Draedon's Heart provides constant rage generation that scales with missing health. - if (modPlayer.draedonsHeart) - { - float percentMissingHealth = 1f - player.statLife / player.statLifeMax2; - float rageGainLerp = MathHelper.Lerp(DraedonsHeart.MinRagePerSecond, DraedonsHeart.MaxRagePerSecond, percentMissingHealth); - float dhRageGen = modPlayer.rageMax * rageGainLerp / 60f; - if (rageGen < dhRageGen) - rageGen = dhRageGen; - } // Shattered Community provides constant rage generation (stronger than Heart of Darkness). if (modPlayer.shatteredCommunity) { @@ -3883,7 +3874,6 @@ namespace CalamityMod.CalPlayer // Draedon's Heart bonus if (modPlayer.draedonsHeart) { - player.allDamage += 0.05f; if (player.StandingStill() && player.itemAnimation == 0) player.statDefense += (int)(player.statDefense * 0.75); } diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 6bbbbc8cbf..935819aa37 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -1,30 +1,17 @@ using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; -using Terraria.DataStructures; using Terraria.ID; +using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { public class DraedonsHeart : ModItem { - // The percentage of a full Rage bar that is gained every second with Draedon's Heart equipped. - public const float MinRagePerSecond = 0.015f; - public const float MaxRagePerSecond = 0.045f; // 3x rage generation at 0% health, aka +200% rage generation - public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon's Heart"); - Tooltip.SetDefault("Boosts your damage by 5% and max movement speed and acceleration by 5%\n" + - "You generate rage over time and rage does not fade away out of combat\n" + - "Passive rage generation increases drastically as health decreases\n" + - "Converts certain debuffs into buffs and extends their durations\n" + - "Debuffs affected: Darkness, Blackout, Confused, Slow, Weak, Broken Armor,\n" + - "Armor Crunch, War Cleave, Chilled, Ichor and Obstructed\n" + - "Receiving a hit causes you to only lose half of your max adrenaline rather than all of it\n" + - "Reduces the amount of defense stat damage you take by 50%\n" + + Tooltip.SetDefault("Reduces the amount of defense damage you take by 50%\n" + "Standing still regenerates your life quickly, reduces your damage by 50% and boosts your defense by 75%\n" + "Nanomachines, son"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 7)); @@ -34,32 +21,17 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.expert = true; + item.rare = ItemRarityID.Red; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.Calamity().customRarity = CalamityRarity.Violet; + } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.laudanum = true; - modPlayer.stressPills = true; - modPlayer.heartOfDarkness = true; modPlayer.draedonsHeart = true; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.Nanites, 250); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } } } diff --git a/Items/Armor/DaedalusBreastplate.cs b/Items/Armor/DaedalusBreastplate.cs index d67e7dd65a..c7131d0a81 100644 --- a/Items/Armor/DaedalusBreastplate.cs +++ b/Items/Armor/DaedalusBreastplate.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ItemID.CrystalShard, 12); + recipe.AddIngredient(ItemID.CrystalShard, 6); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/DaedalusHat.cs b/Items/Armor/DaedalusHat.cs index 3926fc4d55..fa7df4c6cd 100644 --- a/Items/Armor/DaedalusHat.cs +++ b/Items/Armor/DaedalusHat.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.CrystalShard, 6); + recipe.AddIngredient(ItemID.CrystalShard, 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index e6aeacb2c8..61edef9fdc 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.CrystalShard, 6); + recipe.AddIngredient(ItemID.CrystalShard, 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/DaedalusHelm.cs b/Items/Armor/DaedalusHelm.cs index e912674001..a3316974d9 100644 --- a/Items/Armor/DaedalusHelm.cs +++ b/Items/Armor/DaedalusHelm.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.CrystalShard, 6); + recipe.AddIngredient(ItemID.CrystalShard, 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/DaedalusHelmet.cs b/Items/Armor/DaedalusHelmet.cs index 9b93ce9254..d206e65f9d 100644 --- a/Items/Armor/DaedalusHelmet.cs +++ b/Items/Armor/DaedalusHelmet.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.CrystalShard, 6); + recipe.AddIngredient(ItemID.CrystalShard, 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/DaedalusLeggings.cs b/Items/Armor/DaedalusLeggings.cs index cb590f5eb6..3ea12d0015 100644 --- a/Items/Armor/DaedalusLeggings.cs +++ b/Items/Armor/DaedalusLeggings.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.CrystalShard, 8); + recipe.AddIngredient(ItemID.CrystalShard, 4); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/DaedalusVisor.cs b/Items/Armor/DaedalusVisor.cs index be2a064568..72809634d1 100644 --- a/Items/Armor/DaedalusVisor.cs +++ b/Items/Armor/DaedalusVisor.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.CrystalShard, 6); + recipe.AddIngredient(ItemID.CrystalShard, 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Potions/RevivifyPotion.cs b/Items/Potions/RevivifyPotion.cs index c8adee338e..3a3d844998 100644 --- a/Items/Potions/RevivifyPotion.cs +++ b/Items/Potions/RevivifyPotion.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Potions recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.HolyWater, 5); - recipe.AddIngredient(ModContent.ItemType(), 50); + recipe.AddIngredient(ModContent.ItemType(), 100); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this, 5); recipe.AddRecipe(); diff --git a/Items/TreasureBags/DraedonTreasureBag.cs b/Items/TreasureBags/DraedonTreasureBag.cs new file mode 100644 index 0000000000..2d427947ab --- /dev/null +++ b/Items/TreasureBags/DraedonTreasureBag.cs @@ -0,0 +1,68 @@ +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.ExoMechs.Apollo; +using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Artemis; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.World; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.TreasureBags +{ + public class DraedonTreasureBag : ModItem + { + public override int BossBagNPC => ModContent.NPCType(); + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + + public override void SetDefaults() + { + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + item.rare = ItemRarityID.Cyan; + item.expert = true; + } + + public override bool CanRightClick() => true; + + public override void PostUpdate() => CalamityUtils.ForceItemIntoWorld(item); + + public override void OpenBossBag(Player player) + { + player.TryGettingDevArmor(); + + // Weapons + float w = DropHelper.BagWeaponDropRateFloat; + DropHelper.DropEntireWeightedSet(player, + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); + + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); + + // Vanity + // DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + } + } +} diff --git a/Items/TreasureBags/DraedonTreasureBag.png b/Items/TreasureBags/DraedonTreasureBag.png new file mode 100644 index 0000000000000000000000000000000000000000..ece5dd54e57a29187a33b65686b05732e8d049b1 GIT binary patch literal 943 zcmV;g15o^lP)Px&X-PyuR9J=GnM+6&VHC%I6E`rg-t3`X)66o;2*eW1o0u(nQ4t|T1nz>O2wF(A zsa>@wq=HIZM2i-Zi)dl*AS=o?l?ahRJ~H38msg93Vp@zR@Aoz1+^a&&{cq-;@0^+W z_?X6o8r&M{NDo$IbxI-u}+kA8!V{OI#<-*i$cBzhS%L)QN4~ zwi$qZRh0l7_-grU)2s|cZmj?yu=Ne#PF|#EAR`zw0Fshs0UjpqLnAD5A}zJ7D^ysm z*rxdvfRWoF;NNG+O*{AO2jFG%y}y@?_IsANQCwPK0_;C@SaH-{I1l_wUf1%1e8s+U z`l)T)+8se9{?^UA6JA%=1$`x!40x8fFFeoYnQ+R0eiS+NYrQ);t+=bLru3J*%*(UHjp8+B0E7qoZ2S4Hs)GPD zJ!n+Mr3+uO`Ve{XjO;AP^m2FeQBv}G>t8=>MD)M+&aSK>fSfbch8?Gt# zNcgjDygxe&fbQCJQ<|VIe`*?#h{UDVp$8ZzD9Tz^2*9g``YBCdNkNffceJ%k=pT(( zJFCPaK3Pf4>lxCelXM#wr34bC#?7B;20(Lbjq;XQp0_)$3#O*e1z@1%wXNTcs7SB% zj0JfHBm!}pmCXRi3|c#mUtKvSz;Ku4oL%-?32te=4?t09BQRd$!J?H`z?k2Sv`#oF zImH0@@qHA4p}wxMqviK5aVN)2)A}B+zqN(1b}YkB)f$%C7CF_p$c?ZZo#a{KG5-S= z@aF&!`PO5*Hx-rdu)2`+@jDLhDmvkKmH5QnG<#k;0K=ccP8pfDdx3|E{{gE_DW>9V RjXVGV002ovPDHLkV1mcb!d3tP literal 0 HcmV?d00001 diff --git a/Items/Weapons/Magic/Fabstaff.cs b/Items/Weapons/Magic/Fabstaff.cs index f581260826..7a3808bd52 100644 --- a/Items/Weapons/Magic/Fabstaff.cs +++ b/Items/Weapons/Magic/Fabstaff.cs @@ -48,8 +48,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 100); - recipe.AddIngredient(ModContent.ItemType(), 50); + recipe.AddIngredient(ItemID.RainbowRod); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index 7dcf2abc09..6430560952 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -99,8 +99,8 @@ namespace CalamityMod.Items.Weapons.Magic r.AddIngredient(ModContent.ItemType()); r.AddIngredient(ModContent.ItemType()); r.AddIngredient(ModContent.ItemType(), 4); - r.AddIngredient(ItemID.FragmentSolar, 80); - r.AddIngredient(ItemID.FragmentNebula, 20); + r.AddIngredient(ItemID.FragmentSolar, 20); + r.AddIngredient(ItemID.FragmentNebula, 5); r.AddRecipe(); } } diff --git a/Items/Weapons/Melee/CatastropheClaymore.cs b/Items/Weapons/Melee/CatastropheClaymore.cs index bfe0389fa9..8ee40e71eb 100644 --- a/Items/Weapons/Melee/CatastropheClaymore.cs +++ b/Items/Weapons/Melee/CatastropheClaymore.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.HallowedBar, 10); - recipe.AddIngredient(ItemID.CrystalShard, 15); + recipe.AddIngredient(ItemID.CrystalShard, 7); recipe.AddIngredient(ItemID.SoulofNight, 5); recipe.AddRecipeGroup("CursedFlameIchor", 5); recipe.AddIngredient(ItemID.SoulofMight, 3); diff --git a/Items/Weapons/Melee/CrystalBlade.cs b/Items/Weapons/Melee/CrystalBlade.cs index e44d25d89f..1f769f5039 100644 --- a/Items/Weapons/Melee/CrystalBlade.cs +++ b/Items/Weapons/Melee/CrystalBlade.cs @@ -35,14 +35,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 15); + recipe.AddIngredient(ItemID.CrystalShard, 10); recipe.AddIngredient(ItemID.CobaltSword); recipe.AddIngredient(ItemID.PixieDust, 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 15); + recipe.AddIngredient(ItemID.CrystalShard, 10); recipe.AddIngredient(ItemID.PalladiumSword); recipe.AddIngredient(ItemID.PixieDust, 10); recipe.AddTile(TileID.MythrilAnvil); diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index be3b231ab3..df4e313394 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -79,13 +79,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 20); + recipe.AddIngredient(ItemID.CrystalShard, 10); recipe.AddIngredient(ItemID.AdamantiteBar, 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 20); + recipe.AddIngredient(ItemID.CrystalShard, 10); recipe.AddIngredient(ItemID.TitaniumBar, 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Rogue/ConsecratedWater.cs b/Items/Weapons/Rogue/ConsecratedWater.cs index c00482d590..5041f37f0c 100644 --- a/Items/Weapons/Rogue/ConsecratedWater.cs +++ b/Items/Weapons/Rogue/ConsecratedWater.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.HolyWater, 100); recipe.AddRecipeGroup("AnyAdamantiteBar", 5); - recipe.AddIngredient(ItemID.CrystalShard, 20); + recipe.AddIngredient(ItemID.CrystalShard, 10); recipe.AddIngredient(ItemID.SoulofLight, 7); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 71efd22101..791f79bd8e 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -578,20 +578,19 @@ namespace CalamityMod } // Exo Mechs - // Loot requires edits // Collection requires edits // Instructions require edits // Despawn requires edits - /*{ + { BossDifficulty.TryGetValue("ExoMechs", out float order); List bosses = new List() { NPCType(), NPCType(), NPCType(), NPCType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HotlineFishingHook, ItemID.BottomlessBucket, ItemID.SuperAbsorbantSponge, ItemID.FishingPotion, ItemID.SonarPotion, ItemID.CratePotion, ItemID.GreaterHealingPotion }; - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; - string instructions = "By using a high-tech computer thing that somebody as stupid as you shouldn't be able to use, but whatever"; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + //List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + string instructions = "By using a high-tech computer thing"; string despawn = CalamityUtils.ColorMessage("An imperfection after all...what a shame.", new Color(0x7F, 0xFF, 0xD4)); - string bossLogTex = "CalamityMod/NPCs/ExoMechs/ExoMechs_BossChecklist"; - AddBoss(bossChecklist, calamity, "ExoMechs", order, bosses, DownedExoMechs, null, loot, collection, instructions, despawn, bossLogTex); - }*/ + //string bossLogTex = "CalamityMod/NPCs/ExoMechs/ExoMechs_BossChecklist"; + //AddBoss(bossChecklist, calamity, "ExoMechs", order, bosses, DownedExoMechs, null, loot, collection, instructions, despawn, bossLogTex); + } // Supreme Calamitas { diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 6a0d3a9185..59e0d7ea3d 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1,5 +1,6 @@ using CalamityMod.Events; using CalamityMod.Items.Potions; +using CalamityMod.Items.TreasureBags; using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; @@ -15,9 +16,23 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.ExoMechs.Apollo { - //[AutoloadBossHead] public class Apollo : ModNPC { + public static int phase1IconIndex; + public static int phase2IconIndex; + + internal static void LoadHeadIcons() + { + string phase1IconPath = "CalamityMod/NPCs/ExoMechs/Apollo/ApolloHead"; + string phase2IconPath = "CalamityMod/NPCs/ExoMechs/Apollo/ApolloPhase2Head"; + + CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); + + CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); + phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + } + public enum Phase { Normal = 0, @@ -95,7 +110,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo aiType = -1; npc.Opacity = 0f; npc.knockBackResist = 0f; - npc.value = Item.buyPrice(10, 0, 0, 0); + npc.value = Item.buyPrice(3, 33, 0, 0); npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; @@ -103,9 +118,18 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo npc.netAlways = true; npc.boss = true; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; + bossBag = ModContent.ItemType(); } - public override void SendExtraAI(BinaryWriter writer) + public override void BossHeadSlot(ref int index) + { + if (npc.life / (float)npc.lifeMax < 0.6f) + index = phase2IconIndex; + else + index = phase1IconIndex; + } + + public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); @@ -688,23 +712,25 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo return false; } + public override bool SpecialNPCLoot() + { + int closestSegmentID = DropHelper.FindClosestWormSegment(npc, + ModContent.NPCType(), + ModContent.NPCType()); + npc.position = Main.npc[closestSegmentID].position; + return false; + } + public override void BossLoot(ref string name, ref int potionType) { potionType = ModContent.ItemType(); } - // Needs edits public override void NPCLoot() { - /*DropHelper.DropItem(npc, ModContent.ItemType(), 80, 100); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1, 50, 108); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 15, 27); - DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 21, 32); - // Check if the other exo mechs are alive bool otherExoMechsAlive = false; if (CalamityGlobalNPC.draedonExoMechWorm != -1) @@ -718,12 +744,8 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo otherExoMechsAlive = true; } - // Mark Exo Mechs as dead if (!otherExoMechsAlive) - { - CalamityWorld.downedExoMechs = true; - CalamityNetcode.SyncWorld(); - }*/ + AresBody.DropExoMechLoot(npc); } // Needs edits diff --git a/NPCs/ExoMechs/Apollo/ApolloHead.png b/NPCs/ExoMechs/Apollo/ApolloHead.png new file mode 100644 index 0000000000000000000000000000000000000000..80f3142a48dcdc6f077ed944a74c07376399453d GIT binary patch literal 477 zcmeAS@N?(olHy`uVBq!ia0vp^T0pG8!3-pW+obq`6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(Kj{u(#S0HU*?XdsZjITeRZ8*M8PC-$Bf@VNux~i}A!ryNH|Nk$p=}vp7 zYnrY1=zpTIg}vWlo3DFu23oQ=u9NLq6t}_4a zF0CDGTpV6oVmV!%w)b*~?C9+apK*hu@#b@uHUpl}Edee4jw0(mXmRMU{7mGUv~ST4 z7q7R~Jxx!qDIVGJK7Y}fuvtO{XA+lvvDf-wkreXkgr?}@!aa}Wx^nMW#6FaeW0Pp_ x(p=n|w6f++Q0)0-Jz~GM7p#9*<9q(IxT&!h=L65|OTbWI@O1TaS?83{1OU5u&6)rJ literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Apollo/ApolloPhase2Head.png b/NPCs/ExoMechs/Apollo/ApolloPhase2Head.png new file mode 100644 index 0000000000000000000000000000000000000000..e3e366d018ba104175f146d3cb439745961c68c0 GIT binary patch literal 476 zcmeAS@N?(olHy`uVBq!ia0vp^T0pG8!3-pW+obq`6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O)#zyO~RS0F8?pcoLDUR=|?Vee663;VQ(x~AEBeur%q{&q94cFO>_%)r2R7=#&*=dVZs3cmGpaSXBWUpgtetl5BvHFotQU6&2B zP2SWmd>W;A;T!wxp9iYWSZ-q2KIhr2UlS`-*-wRf+!L<+AAde{ZIAle8a08pUyVeW zXByt9_ES(w+7>s{D+AsPhuibVu;MumVdol}n+4Y@UIkvvu zz*T%dS@Hevd!N=db6NVkCR@L4mYOEtD(); } public override void SendExtraAI(BinaryWriter writer) @@ -689,18 +694,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares potionType = ModContent.ItemType(); } - // Needs edits public override void NPCLoot() { - /*DropHelper.DropItem(npc, ModContent.ItemType(), 80, 100); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1, 50, 108); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 15, 27); - DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 21, 32); - // Check if the other exo mechs are alive bool otherExoMechsAlive = false; if (CalamityGlobalNPC.draedonExoMechWorm != -1) @@ -716,10 +713,38 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Mark Exo Mechs as dead if (!otherExoMechsAlive) + DropExoMechLoot(npc); + } + + public static void DropExoMechLoot(NPC npc) + { + DropHelper.DropBags(npc); + + // DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedExoMechs); + + // All other drops are contained in the bag, so they only drop directly on Normal + if (!Main.expertMode) { - CalamityWorld.downedExoMechs = true; - CalamityNetcode.SyncWorld(); - }*/ + // Weapons + float w = DropHelper.NormalWeaponDropRateFloat; + DropHelper.DropEntireWeightedSet(npc, + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); + + // Vanity + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + } + + CalamityWorld.downedExoMechs = true; + CalamityNetcode.SyncWorld(); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Ares/AresBody_Head_Boss.png b/NPCs/ExoMechs/Ares/AresBody_Head_Boss.png new file mode 100644 index 0000000000000000000000000000000000000000..b99699f7ff29171f8f092c47563b686b28dd3555 GIT binary patch literal 482 zcmeAS@N?(olHy`uVBq!ia0vp^Ny9W4#xB}^b$aI%P2V)C+*NBG8uX7xlCKlIpE65sH>J@+5ruqN>hh-l! zqkJoV{V$l9Fi}oHan_P`2hUveQ&Ml%GT-72G?C%W)zms5C0-Kb7yKV9V0h;6EDorI zv%n*=n1O-sFbFdq&tH)ObR@Hl3r&=hWSeNHEVY8|r^&(u-Sx*JxF?72kUC=detD-x%g&d#TQyh~Wq!J6 zDJzuh<;!_snUf#WipSeUJ5$Y9GJuS;hd>tcq@a`8reZ32hPWEkIaI*B{;hhzm zG6i}%(ijqy#r?OXvj`m7KQY-bPI1ldlT|KRf0>Ujwc=elF{r5}E+< CoXtxB literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index eb0c3adeb2..1a93f54644 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -15,9 +15,23 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.ExoMechs.Artemis { - //[AutoloadBossHead] public class Artemis : ModNPC { + public static int phase1IconIndex; + public static int phase2IconIndex; + + internal static void LoadHeadIcons() + { + string phase1IconPath = "CalamityMod/NPCs/ExoMechs/Artemis/ArtemisHead"; + string phase2IconPath = "CalamityMod/NPCs/ExoMechs/Artemis/ArtemisPhase2Head"; + + CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); + + CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); + phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + } + public enum Phase { Normal = 0, @@ -120,7 +134,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis aiType = -1; npc.Opacity = 0f; npc.knockBackResist = 0f; - npc.value = Item.buyPrice(10, 0, 0, 0); npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; @@ -130,7 +143,15 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } - public override void SendExtraAI(BinaryWriter writer) + public override void BossHeadSlot(ref int index) + { + if (npc.life / (float)npc.lifeMax < 0.6f) + index = phase2IconIndex; + else + index = phase1IconIndex; + } + + public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); @@ -166,6 +187,17 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis bool revenge = CalamityWorld.revenge || malice; bool expertMode = Main.expertMode || malice; + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + npc.TargetClosest(); + + // Target variable + Player player = Main.player[npc.target]; + // Check if the other exo mechs are alive int otherExoMechsAlive = 0; bool exoWormAlive = false; @@ -182,6 +214,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis { if (Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].active) { + // Set target to Apollo's target if Apollo is alive + player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].target]; + // Link the HP of both twins if (npc.life > Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].life) npc.life = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].life; @@ -226,17 +261,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // If Artemis and Apollo don't go berserk bool otherMechIsBerserk = exoWormLifeRatio < 0.4f || exoPrimeLifeRatio < 0.4f; - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - - // Target variable - Player player = Main.player[npc.target]; - // Spawn Apollo if it doesn't exist after the first 10 frames have passed if (npc.ai[0] < 10f) { @@ -1003,43 +1027,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis return false; } - public override void BossLoot(ref string name, ref int potionType) - { - potionType = ModContent.ItemType(); - } - - // Needs edits - public override void NPCLoot() - { - /*DropHelper.DropItem(npc, ModContent.ItemType(), 80, 100); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); - - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1, 50, 108); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 15, 27); - DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 21, 32); - - // Check if the other exo mechs are alive - bool otherExoMechsAlive = false; - if (CalamityGlobalNPC.draedonExoMechWorm != -1) - { - if (Main.npc[CalamityGlobalNPC.draedonExoMechWorm].active) - otherExoMechsAlive = true; - } - if (CalamityGlobalNPC.draedonExoMechPrime != -1) - { - if (Main.npc[CalamityGlobalNPC.draedonExoMechPrime].active) - otherExoMechsAlive = true; - } - - // Mark Exo Mechs as dead - if (!otherExoMechsAlive) - { - CalamityWorld.downedExoMechs = true; - CalamityNetcode.SyncWorld(); - }*/ - } + public override bool PreNPCLoot() => false; // Needs edits public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Artemis/ArtemisHead.png b/NPCs/ExoMechs/Artemis/ArtemisHead.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed3965858bc76fc24c22fa3ddeb1a93dd2bd5f7 GIT binary patch literal 474 zcmeAS@N?(olHy`uVBq!ia0vp^T0pG8!3-pW+obq`6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(Kj{u(#S0HU*?eK9|^VgrxjvrVjr=WN}hV!tkgt3MFd|kPZD~v9EJ^%Bx zUqEE~*KWz;n(i6>Z3UTWZ%cU+`{yZX7})xSdt?>>4f#~LTNg-4lmz(&|Hlp(&I;?j z0;=IG@Q5sCVBk9l!i+m6X1@gre)n{746*QEdf{SGivkbp1&4zI*R?{9{QrNssB_&~ z|D*S&dlX3+U8?J@e4erA^Bk$TD|MjjGb*HnQf)}P-I6CElm8P*^LXT!=%~pm*!cFIXXZ}`57J1FIQq3*7G+u!V0ZJ08r(~CRs+|oZs{56hMRIEN|s>9sl-EQe6 u@5*ie`_$F^XBxI&a_$uS{`2|%S6V^DbLNELo&;bJFnGH9xvXH}yiC^?S+;$Pte$J1>$K|ou_kP5 z&ALNkMIz5?zcYPSRt@?f6`CBvC^*q_!q%;qwy%~bIPN%aKR2J|-MZW$)}_ldTPphs zBlV`Ib{5Wao}pIB`y%wZXwfQ%nCr!>IxO1-9*3(Q6DX>iT74ykLviWruVugW?!4D@ uJoj^sR-ny~x!+gzKhQt_EVuM_9m8}EuebV-yJUf0XYh3Ob6Mw<&;$S%9nd!b literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index e21075a414..78fcbb996f 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -14,8 +14,23 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.ExoMechs.Thanatos { - public class ThanatosBody1 : ModNPC + public class ThanatosBody1 : ModNPC { + public static int normalIconIndex; + public static int vulnerableIconIndex; + + internal static void LoadHeadIcons() + { + string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalBody"; + string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody"; + + CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); + + CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); + vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + } + // Whether the body is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); @@ -55,6 +70,19 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } + public override void BossHeadSlot(ref int index) + { + if (vulnerable) + index = vulnerableIconIndex; + else + index = normalIconIndex; + } + + public override void BossHeadRotation(ref float rotation) + { + rotation = npc.rotation; + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); @@ -401,9 +429,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos SmokeDrawer.Update(); + Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); - float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + float num191 = player.position.X + (player.width / 2); + float num192 = player.position.Y + (player.height / 2); num191 = (int)(num191 / 16f) * 16; num192 = (int)(num192 / 16f) * 16; vector18.X = (int)(vector18.X / 16f) * 16; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index b22afe9608..1c49259062 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -14,8 +14,23 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.ExoMechs.Thanatos { - public class ThanatosBody2 : ModNPC + public class ThanatosBody2 : ModNPC { + public static int normalIconIndex; + public static int vulnerableIconIndex; + + internal static void LoadHeadIcons() + { + string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalBody"; + string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody"; + + CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); + + CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); + vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + } + // Whether the body is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); @@ -55,6 +70,19 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } + public override void BossHeadSlot(ref int index) + { + if (vulnerable) + index = vulnerableIconIndex; + else + index = normalIconIndex; + } + + public override void BossHeadRotation(ref float rotation) + { + rotation = npc.rotation; + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); @@ -401,9 +429,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos SmokeDrawer.Update(); + Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); - float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + float num191 = player.position.X + (player.width / 2); + float num192 = player.position.Y + (player.height / 2); num191 = (int)(num191 / 16f) * 16; num192 = (int)(num192 / 16f) * 16; vector18.X = (int)(vector18.X / 16f) * 16; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index bd6ac6b0eb..6d0dccb86f 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1,5 +1,6 @@ using CalamityMod.Events; using CalamityMod.Items.Potions; +using CalamityMod.Items.TreasureBags; using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Ares; @@ -16,9 +17,23 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.ExoMechs.Thanatos { - //[AutoloadBossHead] public class ThanatosHead : ModNPC { + public static int normalIconIndex; + public static int vulnerableIconIndex; + + internal static void LoadHeadIcons() + { + string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalHead"; + string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead"; + + CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); + + CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); + vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + } + public enum Phase { Charge = 0, @@ -110,7 +125,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos aiType = -1; npc.Opacity = 0f; npc.knockBackResist = 0f; - npc.value = Item.buyPrice(10, 0, 0, 0); + npc.value = Item.buyPrice(3, 33, 0, 0); npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; @@ -120,9 +135,23 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.boss = true; npc.chaseable = false; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; + bossBag = ModContent.ItemType(); } - public override void SendExtraAI(BinaryWriter writer) + public override void BossHeadSlot(ref int index) + { + if (vulnerable) + index = vulnerableIconIndex; + else + index = normalIconIndex; + } + + public override void BossHeadRotation(ref float rotation) + { + rotation = npc.rotation; + } + + public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); @@ -150,7 +179,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.Calamity().newAI[i] = reader.ReadSingle(); } - public override void AI() + public override void AI() { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -895,17 +924,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos potionType = ModContent.ItemType(); } + public override bool SpecialNPCLoot() + { + int closestSegmentID = DropHelper.FindClosestWormSegment(npc, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType()); + npc.position = Main.npc[closestSegmentID].position; + return false; + } + public override void NPCLoot() { - /*DropHelper.DropItem(npc, ModContent.ItemType(), 80, 100); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItem(npc, ModContent.ItemType()); + // DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1, 50, 108); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 15, 27); - DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 21, 32); - // Check if the other exo mechs are alive bool otherExoMechsAlive = false; if (CalamityGlobalNPC.draedonExoMechTwinGreen != -1) @@ -919,12 +952,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos otherExoMechsAlive = true; } - // Mark Exo Mechs as dead if (!otherExoMechsAlive) - { - CalamityWorld.downedExoMechs = true; - CalamityNetcode.SyncWorld(); - }*/ + AresBody.DropExoMechLoot(npc); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png new file mode 100644 index 0000000000000000000000000000000000000000..9c496d1e777f637ac404f61b4e441d1d14ad3af3 GIT binary patch literal 414 zcmeAS@N?(olHy`uVBq!ia0vp^azL!Y!3-o<@>fLzDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheW&u7Su0T2wsE{3~v1eQbHv`e!)QXsDR`6%P@i@jo(MRYC2583E*&%Tmfd+5{WU3{zGA9OjY{i}PY5KG+kDNig- z{xhC-UZD7VTkl3Ish&jL$Eqvm8}gp`@=xZ7(wF?hQAxvXfLzDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheW&u7Su0Yz@!ag7}T~0x9V#35I--=)V3qEbrY}XFU{BY<0|NqNAWZF%A zDH9oP7rD+-uei9T8>nURlPlYSlu${KUocP&DqwiDf4>k=mb1VkvY3H^?=T269?xHq z0u+4V>Eak-;om#yHeZVZk4yBb)vjV6|JRqvvYGx?@=4OLP1Y2*%saVunuTeX>z8ZE zFCK>lIvLDX+bj^pl*7Qh;+F0agWd$Gkmo;(vm&pBPA%X$%1U5y|=s`8fR$6${h8uR7q*g z+;RgRi>@gJGi0t$Wxsq_fNcuTLXj9fvnv8$x(XRHxUZk$e`{#p^s`1_v&wVj8M(3j z?T3Wc?$tXMvUSR7g&;1j>oYpTd#(ik)6Y9>?e^(l_?3glKQgy?$mK?d?p6T$nZeW5 K&t;ucLK6T2ezBtf literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png new file mode 100644 index 0000000000000000000000000000000000000000..45a93ddc59554214898974dde25f468c770a2eaf GIT binary patch literal 411 zcmeAS@N?(olHy`uVBq!ia0vp^azL!Y!3-o<@>fLzDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheW&u7Su0XoDrhC?sb;cI0>K4kv?|KU@CXOwTn zum1&^AMSXj?)tP%6R3r4&DCHaB~%jR7yKU`Fg)77UkE76S>O>_%)r2R7=#&*=dVZs z3SRJZaSXBWpE}7~s6~OtrP*=Hf`;$=-&_#Zm=nqIZJBf2^!Y5iR;_rkU#s+Mx=)JF z@$I{Aap-%4C}Fjvf3+5y=iN()-m>n!!NlTa9T~R;7|f1YvOL?c?fRnH>(lofj7eGh zT}d&b`?AhE#x+9rHy_C4F+T5ej(sTM+@&a3`Zm-y>HXIOHS?4VUs-LjKW5lR(O~sVfPK_HwI5vKbLh*2~7Y?4y!r< literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 89bfba078c..f590452b41 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -13,8 +13,23 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.ExoMechs.Thanatos { - public class ThanatosTail : ModNPC + public class ThanatosTail : ModNPC { + public static int normalIconIndex; + public static int vulnerableIconIndex; + + internal static void LoadHeadIcons() + { + string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalTail"; + string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail"; + + CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); + + CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); + vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + } + // Whether the tail is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); @@ -54,6 +69,19 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } + public override void BossHeadSlot(ref int index) + { + if (vulnerable) + index = vulnerableIconIndex; + else + index = normalIconIndex; + } + + public override void BossHeadRotation(ref float rotation) + { + rotation = npc.rotation; + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); @@ -400,9 +428,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos SmokeDrawer.Update(); + Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); - float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + float num191 = player.position.X + (player.width / 2); + float num192 = player.position.Y + (player.height / 2); num191 = (int)(num191 / 16f) * 16; num192 = (int)(num192 / 16f) * 16; vector18.X = (int)(vector18.X / 16f) * 16; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png new file mode 100644 index 0000000000000000000000000000000000000000..c45262044ce422e86147310cda4fae56d1fbb57f GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^azL!Y!3-o<@>fLzDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe>H$6>u0T2(0eJb$Wu=nV3J3Bumb)Xu4 zPtFP;#aj~O7YtMY2Mo3^l-ht2oCO|{#S9F5he4R}c>anMpx^~h7sn6_|EZIs#hMj( zSSvjaT=~0xdkxR%970VtUTr)rMhSt1~e3uVc zv@PyFw(Rmu?qIe6m#LqgP5qSoRwy&}e}d2f&6U?yc@-ZqFH8{PkX-s#h|T=Ru6ukh Vg&BjHPlE!D!PC{xWt~$(698rZoqGTP literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png new file mode 100644 index 0000000000000000000000000000000000000000..f6394a48ae7712aa80c79c2b6124669ff83be752 GIT binary patch literal 406 zcmeAS@N?(olHy`uVBq!ia0vp^azL!Y!3-o<@>fLzDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe>H$6>u0Yz@!ag7}T~0yKPf5L9JM6ff-LL-z|NsC0RN(pl|A*q5ZlIdU zHha5(6mLn8UocP#4j61-D7674I14-?iy0XB4uLSEsD@VqQ1HH|i(`m|fA6G=LahoM ztd0j4{rdlYZ*IidTF>)7T{?b-!3_p3qb6rnxk1bCmZ>z8frTE3UcU zU^)AMC&2V`@Y?ssd4l>44FH(&lZvg6*D m`m*`^49|(*zs4Ycod4o_(aOi}rc;4lW$<+Mb6Mw<&;$Ts8>rL( literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png new file mode 100644 index 0000000000000000000000000000000000000000..be37ce6997b9fb18a7e41b8d1f8485cd0071ecce GIT binary patch literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^azL!Y!3-o<@>fLzDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe>H$6>u0XoDrhC?sb;cIFwHK$L;Js6?p#oU-19`2cVjd zS8oUbDc+JGzu^B!fWh{KQX5c$v%n*=n1O-sFbFdq&tH)O6g=5SndZ;{?Xms}AWKEaI?dwznbtjqUp+weMU4s*H$s!^K$s2-dWar&aR;g786+G^;_G(p=>w^T{RhH8q)vZ;k z?r~nA7}oTDgT`j&e8aXw!XLIi@LId_XnawF;{Gt3gF7b__cSe>XQ2DBww~eIAIXm^ Tmz|#q^csVwtDnm{r-UW|m_wRv literal 0 HcmV?d00001