diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 6959b59d8b..8701e6d028 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -118,8 +118,8 @@ namespace CalamityMod.Balancing #endregion #region Wall of Flesh - // 45% resist to Corro/Crimslime Staff. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.WallofFleshEye, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType(), ProjectileType())))); + // 40% resist to Corro/Crimslime Staff. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.WallofFleshEye, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType())))); #endregion #region Aquatic Scourge @@ -201,6 +201,9 @@ namespace CalamityMod.Balancing #endregion #region Empress of Light + // 25% resist to Abyss Blade's blade. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + // 20% resist to Plague Tainted SMG's drones. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); #endregion @@ -235,16 +238,13 @@ namespace CalamityMod.Balancing // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f)))); - // 25% resist to Resurrection Butterfly. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + // 20% resist to Resurrection Butterfly. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); #endregion #region Moon Lord // 20% resist to Mercurial Tides (True Biome Blade). NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); - - // 15% resist to Pestilent Defiler. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType(), ProjectileType())))); #endregion #region Profaned Guardians diff --git a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs index c385db4eec..92cab6a912 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,8 @@ namespace CalamityMod.Buffs.StatBuffs CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.abyssalDivingSuitPrevious) { - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; modPlayer.abyssalDivingSuitPower = true; modPlayer.depthCharm = true; modPlayer.jellyfishNecklace = true; diff --git a/Buffs/StatBuffs/PolarisBuff.cs b/Buffs/StatBuffs/PolarisBuff.cs deleted file mode 100644 index 9ffe439cb5..0000000000 --- a/Buffs/StatBuffs/PolarisBuff.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatBuffs -{ - public class PolarisBuff : ModBuff - { - public override void SetStaticDefaults() - { - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().polarisBoost = true; - } - } -} diff --git a/Buffs/StatBuffs/PolarisBuff.png b/Buffs/StatBuffs/PolarisBuff.png deleted file mode 100644 index fcad4dcc2e..0000000000 Binary files a/Buffs/StatBuffs/PolarisBuff.png and /dev/null differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d05a267f4d..e1f0f73072 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -203,7 +203,6 @@ namespace CalamityMod.CalPlayer public int brimLoreInfernoTimer = 0; public int tarraLifeAuraTimer = 0; public int bloodflareHeartTimer = 300; - public int polarisBoostCounter = 0; public int dragonRageHits = 0; public int dragonRageCooldown = 0; public float modStealth = 1f; @@ -967,9 +966,6 @@ namespace CalamityMod.CalPlayer public bool yellowCandle = false; public bool trippy = false; public bool amidiasBlessing = false; - public bool polarisBoost = false; - public bool polarisBoostTwo = false; - public bool polarisBoostThree = false; public bool bloodfinBoost = false; public int bloodfinTimer = 30; public bool hallowedRegen = false; @@ -1971,9 +1967,6 @@ namespace CalamityMod.CalPlayer AbsorberRegen = false; cFreeze = false; tRegen = false; - polarisBoost = false; - polarisBoostTwo = false; - polarisBoostThree = false; bloodfinBoost = false; divineBless = false; @@ -2291,7 +2284,6 @@ namespace CalamityMod.CalPlayer hideOfDeusMeleeBoostTimer = 0; externalAbyssLight = 0; externalColdImmunity = externalHeatImmunity = false; - polarisBoostCounter = 0; dragonRageHits = 0; dragonRageCooldown = 0; spectralVeilImmunity = 0; @@ -2460,9 +2452,6 @@ namespace CalamityMod.CalPlayer yellowCandle = false; trippy = false; amidiasBlessing = false; - polarisBoost = false; - polarisBoostTwo = false; - polarisBoostThree = false; bloodfinBoost = false; bloodfinTimer = 0; healCounter = 300; @@ -4016,7 +4005,7 @@ namespace CalamityMod.CalPlayer } // Handle AI edge-cases. These are like overlapping projectiles and the projectile not spawning at all - if (item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) Main.projectile[p].ai[1] = 1f; //MUST BE 1 OTHERWISE CLONES GENERATE STEALTH AAAAAAAAAAA if (item.type == ModContent.ItemType()) Main.projectile[p].ai[0] = -1f; diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index bffea92b00..142c8ddd3f 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -190,10 +190,14 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(chanceForBiomeCrate)) { if (ZoneCalamity) - itemDrop = ModContent.ItemType(); + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); else itemDrop = Main.hardMode ? ItemID.LavaCrateHard : ItemID.LavaCrate; } + if ((Main.rand.NextBool(chanceForRareItems) && enchantedPearl && fishingStation && Player.cratePotion) && ZoneCalamity) + { + itemDrop = ModContent.ItemType(); + } } } @@ -234,7 +238,7 @@ namespace CalamityMod.CalPlayer } if (ZoneSunkenSea) { - switch (Main.rand.Next(2)) + switch (Main.rand.Next(3)) { case 0: rareItemList.Add(ModContent.ItemType()); @@ -242,6 +246,9 @@ namespace CalamityMod.CalPlayer case 1: rareItemList.Add(ModContent.ItemType()); break; + case 2: + rareItemList.Add(ModContent.ItemType()); + break; } } if (Player.ZoneSnow && Player.ZoneRockLayerHeight && (Player.ZoneCorrupt || Player.ZoneCrimson || Player.ZoneHallow)) @@ -267,9 +274,9 @@ namespace CalamityMod.CalPlayer { List biomeCrateList = new List(); - biomeCrateList.AddWithCondition(ModContent.ItemType(), ZoneAstral); - biomeCrateList.AddWithCondition(ModContent.ItemType(), ZoneSunkenSea); - biomeCrateList.AddWithCondition(ModContent.ItemType(), canSulphurFish); + biomeCrateList.AddWithCondition(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(), ZoneAstral); + biomeCrateList.AddWithCondition(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(), ZoneSunkenSea); + biomeCrateList.AddWithCondition(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(), canSulphurFish); biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.CorruptFishingCrateHard : ItemID.CorruptFishingCrate, Player.ZoneCorrupt); biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.CrimsonFishingCrateHard : ItemID.CrimsonFishingCrate, Player.ZoneCrimson); biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.HallowedFishingCrateHard : ItemID.HallowedFishingCrate, Player.ZoneHallow); @@ -309,15 +316,15 @@ namespace CalamityMod.CalPlayer { if (ZoneAstral) { - itemDrop = ModContent.ItemType(); + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); } if (ZoneSunkenSea) { - itemDrop = ModContent.ItemType(); + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); } if (canSulphurFish) { - itemDrop = ModContent.ItemType(); + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); } } return; @@ -484,14 +491,17 @@ namespace CalamityMod.CalPlayer { List legendaryCatches = new List() { - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; legendaryCatches.AddWithCondition(ModContent.ItemType(), DownedBossSystem.downedDesertScourge); legendaryCatches.AddWithCondition(ModContent.ItemType(), Main.hardMode); itemDrop = legendaryCatches[Main.rand.Next(legendaryCatches.Count)]; } - else if (attempt.uncommon || attempt.rare || attempt.veryrare) + else if (attempt.veryrare) + { + itemDrop = ModContent.ItemType(); + } + else if (attempt.uncommon || attempt.rare) { itemDrop = ModContent.ItemType(); } @@ -546,27 +556,26 @@ namespace CalamityMod.CalPlayer { if (attempt.crate) { - itemDrop = ModContent.ItemType(); + itemDrop = Main.hardMode? ModContent.ItemType() : ModContent.ItemType(); } else if (attempt.legendary) { - List legendaryCatches = new List() - { - ModContent.ItemType(), - ModContent.ItemType() - }; - itemDrop = legendaryCatches[Main.rand.Next(legendaryCatches.Count)]; + itemDrop = ModContent.ItemType(); } // Increased chance of Dragoon Drizzlefish in Prehardmode else if (attempt.veryrare && !Main.hardMode) { itemDrop = ModContent.ItemType(); } + else if (attempt.veryrare) + { + itemDrop = ModContent.ItemType(); + } else if ((attempt.rare || attempt.veryrare) && DownedBossSystem.downedProvidence && Main.rand.Next(3) >= 2) { itemDrop = ModContent.ItemType(); } - else if (attempt.uncommon || attempt.rare || attempt.veryrare) + else if (attempt.uncommon || attempt.rare) { List uncommonCatches = new List() { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 2e574f5687..2b4424f45b 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2264,29 +2264,6 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); Projectile.NewProjectile(source, Player.Center.X + Main.rand.Next(-40, 40), Player.Center.Y - Main.rand.Next(20, 60), Player.velocity.X * 0.3f, Player.velocity.Y * 0.3f, ProjectileID.BrainOfConfusion, 0, 0f, Player.whoAmI); } - - if (polarisBoost) - { - polarisBoostCounter -= 10; - if (polarisBoostCounter < 0) - polarisBoostCounter = 0; - - if (polarisBoostCounter >= 20) - { - polarisBoostTwo = false; - polarisBoostThree = true; - } - else if (polarisBoostCounter >= 10) - { - polarisBoostTwo = true; - polarisBoostThree = false; - } - else - { - polarisBoostThree = false; - polarisBoostTwo = false; - } - } } if (Player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index c7ec23ee84..69d1f4ff1d 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -666,12 +666,6 @@ namespace CalamityMod.CalPlayer } } - if (polarisBoost) - { - Player.lifeRegen += 1; - Player.lifeRegenTime += 1; - } - if (evolutionLifeRegenCounter > 0) { Player.lifeRegenTime += 2; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9337f9509d..9296ab6106 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1844,25 +1844,6 @@ namespace CalamityMod.CalPlayer Player.GetCritChance() -= (int)((1f - Player.stealth) * 5f); // Change 20 to 15 } - // Polaris fish stuff - if (!polarisBoost || Player.ActiveItem().type != ModContent.ItemType()) - { - polarisBoost = false; - if (Player.FindBuffIndex(ModContent.BuffType()) > -1) - Player.ClearBuff(ModContent.BuffType()); - - polarisBoostCounter = 0; - polarisBoostTwo = false; - polarisBoostThree = false; - } - if (polarisBoostCounter >= 20) - { - polarisBoostTwo = false; - polarisBoostThree = true; - } - else if (polarisBoostCounter >= 10) - polarisBoostTwo = true; - // Haste buff if (hasteLevel > 0) { @@ -2499,7 +2480,7 @@ namespace CalamityMod.CalPlayer if (decayEffigy) { Player.buffImmune[ModContent.BuffType()] = true; - if (!ZoneAbyss) + if (!ZoneAbyss && Player.IsUnderwater()) { Player.gills = true; } @@ -2778,9 +2759,6 @@ namespace CalamityMod.CalPlayer } } - if (CalamityLists.scopedWeaponList.Contains(Player.ActiveItem().type)) - Player.scope = true; - if (CalamityLists.highTestFishList.Contains(Player.ActiveItem().type)) Player.accFishingLine = true; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 69b9abc839..eedf8b69e8 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -128,10 +128,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.OnFire3, 180); break; - case ItemID.Muramasa: - target.AddBuff(BuffType(), 30); - break; - case ItemID.IceSickle: case ItemID.Frostbrand: target.AddBuff(BuffID.Frostburn2, 300); @@ -555,10 +551,6 @@ namespace CalamityMod.CalPlayer } } } - if (proj.type == ProjectileType()) - { - polarisBoostCounter += 1; - } } } #endregion diff --git a/CalamityLists.cs b/CalamityLists.cs index 527bb1da38..ed977d0ed9 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1588,17 +1588,7 @@ namespace CalamityMod NPCType() }; - // TODO -- override HoldItem => Player.scope = true; on these items - scopedWeaponList = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType() - }; - + // TODO -- override HoldItem => Player.accFishingLine = true; on these items, just like the scope fix... highTestFishList = new List() { ItemID.GoldenFishingRod, @@ -2098,7 +2088,7 @@ namespace CalamityMod { ProjectileID.Arkhalis, ProjectileID.ChargedBlasterLaser, - ProjectileID.ClingerStaff, + ProjectileID.ClingerStaff, ProjectileID.FinalFractal, ProjectileID.FlyingKnife, ProjectileID.LastPrismLaser, diff --git a/CalamityMod.cs b/CalamityMod.cs index e74cd3ca63..69ce0d1bc4 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -131,6 +131,7 @@ namespace CalamityMod // Please keep this in alphabetical order so it's easy to read internal Mod ancientsAwakened = null; internal Mod bossChecklist = null; + internal Mod coloredDamageTypes = null; internal Mod crouchMod = null; internal Mod dialogueTweak = null; internal Mod fargos = null; @@ -161,6 +162,8 @@ namespace CalamityMod ModLoader.TryGetMod("AAMod", out ancientsAwakened); bossChecklist = null; ModLoader.TryGetMod("BossChecklist", out bossChecklist); + coloredDamageTypes = null; + ModLoader.TryGetMod("ColoredDamageTypes", out coloredDamageTypes); crouchMod = null; ModLoader.TryGetMod("CrouchMod", out crouchMod); dialogueTweak = null; @@ -383,7 +386,6 @@ namespace CalamityMod return Color.Lerp(player.hairColor, new Color(186, 85, 211), stealthInterpolant); })); - PopupGUIManager.LoadGUIs(); InvasionProgressUIManager.LoadGUIs(); } #endregion @@ -395,6 +397,7 @@ namespace CalamityMod ancientsAwakened = null; bossChecklist = null; + coloredDamageTypes = null; crouchMod = null; dialogueTweak = null; fargos = null; diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index 28504bc654..53822657c1 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -23,9 +23,6 @@ namespace CalamityMod.Cooldowns registry = new Cooldown[defaultSize]; nameToNetID = new Dictionary(defaultSize); - // TODO -- CooldownHandlers should be ILoadable in 1.4 - RegisterModCooldowns(CalamityMod.Instance); - #region Unused manual registration left here as backup // Vanilla cooldowns represented by the interface //var potionSickness = Register(PotionSickness.ID); @@ -63,26 +60,29 @@ namespace CalamityMod.Cooldowns #endregion } - public static void RegisterModCooldowns(Mod mod) + public static void RegisterModCooldowns() { Type baseHandlerType = typeof(CooldownHandler); - foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) + foreach (Mod mod in ModLoader.Mods) { - if (type.IsSubclassOf(baseHandlerType) && !type.IsAbstract && type != baseHandlerType) + foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) { - //Get the static property ID of the handler - string handlerID = (string)type.GetProperty("ID").GetValue(null); + if (type.IsSubclassOf(baseHandlerType) && !type.IsAbstract && type != baseHandlerType) + { + //Get the static property ID of the handler + string handlerID = (string)type.GetProperty("ID").GetValue(null); - //If for whatever reason the ID is not set, create an ID from the mod and handler name - if (handlerID == null) - handlerID = mod.Name + "_" + type.Name; + //If for whatever reason the ID is not set, create an ID from the mod and handler name + if (handlerID == null) + handlerID = mod.Name + "_" + type.Name; - //Use reflection to call the method. You can't use the type as the generic type argument of register here - MethodInfo methodInfo = typeof(CooldownRegistry).GetMethod("Register", BindingFlags.Public | BindingFlags.Static); - Type[] genericArguments = new Type[] { type }; + //Use reflection to call the method. You can't use the type as the generic type argument of register here + MethodInfo methodInfo = typeof(CooldownRegistry).GetMethod("Register", BindingFlags.Public | BindingFlags.Static); + Type[] genericArguments = new Type[] { type }; - MethodInfo genericRegister = methodInfo.MakeGenericMethod(genericArguments); - genericRegister.Invoke(null, new object[] { handlerID }); + MethodInfo genericRegister = methodInfo.MakeGenericMethod(genericArguments); + genericRegister.Invoke(null, new object[] { handlerID }); + } } } } diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index c9648e5931..394125c02f 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -8,6 +8,8 @@ using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Items.Armor.GemTech; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.Accessories; +using CalamityMod.CalPlayer; namespace CalamityMod.DataStructures { @@ -207,12 +209,17 @@ namespace CalamityMod.DataStructures public void PlayerOnHitEffects(int hitDamage) { // Don't do anything if the player is not wearing the Gem Tech set. - if (!Owner.Calamity().GemTechSet) + var cgp = Owner.Calamity(); + if (!cgp.GemTechSet) return; bool gemWasLost = false; int gemDamage = 0; - if (hitDamage >= GemTechHeadgear.GemBreakDamageLowerBound) + bool largeEnoughRegularHit = hitDamage >= GemTechHeadgear.GemBreakDamageLowerBound; + // 09FEB2024: Ozzatron: chalice of the blood god no longer protects you when using gem tech armor. + // It is now slightly anti-synergetic, in that taking tiny hits when you're already bleeding will make you keep losing gems. + bool largeEnoughChaliceHit = cgp.chaliceOfTheBloodGod && hitDamage == ChaliceOfTheBloodGod.MinAllowedDamage && cgp.chaliceBleedoutBuffer >= GemTechHeadgear.GemBreakDamageLowerBound; + if (largeEnoughRegularHit || largeEnoughChaliceHit) { // Destroy the rogue gem. if (GemIsActive(GemTechArmorGemType.Rogue) && GemThatShouldBeLost == GemTechArmorGemType.Rogue) diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index bc9a9983b9..958a5c23bf 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Items.Accessories player.npcTypeNoAggro[NPCID.PinkJellyfish] = true; player.npcTypeNoAggro[NPCID.Crab] = true; player.npcTypeNoAggro[NPCID.Squid] = true; - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; } } } diff --git a/Items/Accessories/ChaliceOfTheBloodGod.cs b/Items/Accessories/ChaliceOfTheBloodGod.cs index 2303243d48..59dae0932e 100644 --- a/Items/Accessories/ChaliceOfTheBloodGod.cs +++ b/Items/Accessories/ChaliceOfTheBloodGod.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Items.Accessories // If this reduces the player's health to zero, make sure they actually die. if (player.statLife <= 0) { - player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ChaliceOfTheBloodGod" + Main.rand.Next(1, 4 + 1)).Format(player.name)), modPlayer.chaliceBleedoutBuffer, 0, false); + player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ChaliceOfTheBloodGod" + Main.rand.Next(1, 18 + 1)).Format(player.name)), modPlayer.chaliceBleedoutBuffer, 0, false); } } diff --git a/Items/Armor/Sulphurous/SulphurousHelmet.cs b/Items/Armor/Sulphurous/SulphurousHelmet.cs index ce99062974..6e78118aa0 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -42,7 +42,8 @@ namespace CalamityMod.Items.Armor.Sulphurous { player.GetDamage() += 0.04f; player.GetCritChance() += 2; - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; } public override void AddRecipes() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 1186d1d5f6..e70e089022 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -511,14 +511,14 @@ namespace CalamityMod.Items } } } - if (modPlayer.harpyWingBoost && modPlayer.harpyRing) + if (modPlayer.harpyWingBoost && (modPlayer.harpyRing || modPlayer.angelTreads)) { if (Main.rand.NextBool(5) && !item.channel) { if (player.whoAmI == Main.myPlayer) { float spreadX = velocity.X + Main.rand.NextFloat(-0.75f, 0.75f); - float spreadY = velocity.X + Main.rand.NextFloat(-0.75f, 0.75f); + float spreadY = velocity.Y + Main.rand.NextFloat(-0.75f, 0.75f); int feather = Projectile.NewProjectile(source, position, new Vector2(spreadX, spreadY) * 1.25f, ModContent.ProjectileType(), (int)(damage * 0.3), 2f, player.whoAmI); if (feather.WithinBounds(Main.maxProjectiles)) { @@ -935,6 +935,10 @@ namespace CalamityMod.Items if (!string.IsNullOrEmpty(managedArmorSetName)) return managedArmorSetName; + if (head.type == ItemID.WizardHat && (body.type == ItemID.AmethystRobe || body.type == ItemID.TopazRobe || body.type == ItemID.SapphireRobe || body.type == ItemID.EmeraldRobe || body.type == ItemID.RubyRobe || body.type == ItemID.DiamondRobe || body.type == ItemID.AmberRobe)) + return "WizardHat"; + if (head.type == ItemID.MagicHat && (body.type == ItemID.AmethystRobe || body.type == ItemID.TopazRobe || body.type == ItemID.SapphireRobe || body.type == ItemID.EmeraldRobe || body.type == ItemID.RubyRobe || body.type == ItemID.DiamondRobe || body.type == ItemID.AmberRobe)) + return "MagicHat"; if (head.type == ItemID.CrystalNinjaHelmet && body.type == ItemID.CrystalNinjaChestplate && legs.type == ItemID.CrystalNinjaLeggings) return "CrystalAssassin"; if (head.type == ItemID.SquireGreatHelm && body.type == ItemID.SquirePlating && legs.type == ItemID.SquireGreaves) @@ -964,6 +968,16 @@ namespace CalamityMod.Items VanillaArmorChangeManager.CreateTooltipManuallyAsNecessary(player); VanillaArmorChangeManager.ApplyPotentialEffectsTo(player); + if (set == "WizardHat") + { + player.GetCritChance() -= 6; + player.setBonus = CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.Wizard"); + } + if (set == "MagicHat") + { + player.statManaMax2 -= 20; + player.setBonus = CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.MagicHat"); + } if (set == "CrystalAssassin") { player.setBonus = CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.CrystalAssassin"); @@ -1034,8 +1048,35 @@ namespace CalamityMod.Items switch (item.type) { case ItemID.MagicHat: - player.GetDamage() -= 0.01f; - player.GetCritChance() -= 1; + player.GetDamage() -= 0.06f; + break; + + case ItemID.AmethystRobe: + player.manaCost += 0.01f; // 5% to 4% + break; + + case ItemID.TopazRobe: + player.statManaMax2 -= 20; + player.manaCost += 0.02f ; // 7% to 5% + break; + + case ItemID.SapphireRobe: + player.manaCost += 0.03f; // 9% to 6% + break; + + case ItemID.EmeraldRobe: + player.statManaMax2 -= 20; + player.manaCost += 0.04f; // 11% to 7% + break; + + case ItemID.RubyRobe: + case ItemID.AmberRobe: + player.manaCost += 0.05f; // 13% to 8% + break; + + case ItemID.DiamondRobe: + player.statManaMax2 -= 20; + player.manaCost += 0.06f; // 15% to 9% break; case ItemID.Gi: @@ -1256,7 +1297,8 @@ namespace CalamityMod.Items } else if (item.type == ItemID.FinWings) // Boosted water abilities, faster fall in water { - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; player.ignoreWater = true; player.noFallDmg = true; if (!player.mount.Active) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index b5f994316e..e2275e3809 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -464,7 +464,6 @@ namespace CalamityMod.Items // Stylish Scissors, all Phaseblades, and all Phasesabers ignore 100% of defense if (item.type == ItemID.StylistKilLaKillScissorsIWish || (item.type >= ItemID.BluePhasesaber && item.type <= ItemID.YellowPhasesaber) || item.type == ItemID.OrangePhasesaber) EditTooltipByName("Knockback", (line) => line.Text += "\nIgnores 100% of enemy defense"); - // Phaseblades are done separately to ensure it appears under the Material line if (item.type >= ItemID.BluePhaseblade && item.type <= ItemID.YellowPhaseblade || item.type == ItemID.OrangePhaseblade) EditTooltipByName("Material", (line) => line.Text += "\nIgnores 100% of enemy defense"); @@ -472,15 +471,10 @@ namespace CalamityMod.Items // Bone Sword, Breaker Blade, and Mandible Blade ignore 50% of defense if (item.type == ItemID.BoneSword || item.type == ItemID.BreakerBlade) EditTooltipByName("Knockback", (line) => line.Text += "\nIgnores 50% of enemy defense"); - // Mandible Blade is done separately to ensure it appears under the Material line if (item.type == ItemID.AntlionClaw) EditTooltipByName("Material", (line) => line.Text += "\nIgnores 50% of enemy defense"); - // Muramasa inflicts Nightwither - if (item.type == ItemID.Muramasa) - EditTooltipByName("Material", (line) => line.Text += "\nInflicts Nightwither on hit"); - // Death Sickle inflict Whispering Death if (item.type == ItemID.DeathSickle) EditTooltipByNum(0, (line) => line.Text += "\nInflicts Whispering Death on hit"); @@ -670,7 +664,30 @@ namespace CalamityMod.Items // Magic Hat nerf if (item.type == ItemID.MagicHat) - EditTooltipByNum(0, (line) => line.Text = "5% increased magic damage and critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = "6% increased magic critical strike chance"); + + // Gem Robe nerfs + if (item.type == ItemID.AmethystRobe) + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("5%", "4%")); + if (item.type == ItemID.TopazRobe) + { + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", "20")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("7%", "5%")); + } + if (item.type == ItemID.SapphireRobe) + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9%", "6%")); + if (item.type == ItemID.EmeraldRobe) + { + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("60", "40")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("11%", "7%")); + } + if (item.type == ItemID.RubyRobe || item.type == ItemID.AmberRobe) + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("13%", "8%")); + if (item.type == ItemID.DiamondRobe) + { + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("80", "60")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("15%", "9%")); + } // Worm Scarf only gives 10% DR instead of 17% if (item.type == ItemID.WormScarf) @@ -696,10 +713,9 @@ namespace CalamityMod.Items if (item.type == ItemID.MechanicalGlove) { - string extraLine = "\n12% increased melee speed, does not stack with downgrades"; - EditTooltipByNum(1, (line) => line.Text = "12% increased melee damage" + extraLine); - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "12% increased melee speed, does not stack with downgrades")); - EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage"); + string extraLine = "\n10% increased true melee damage"; + string extraLine2 = "\n12% increased melee speed, does not stack with downgrades" + extraLine; + EditTooltipByNum(1, (line) => line.Text = "12% increased melee damage" + extraLine2); } if (item.type == ItemID.FireGauntlet) @@ -800,9 +816,9 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "2%")); } if (item.type == ItemID.JungleShirt || item.type == ItemID.AncientCobaltBreastplate) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "4%")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "5%")); if (item.type == ItemID.JunglePants || item.type == ItemID.AncientCobaltLeggings) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "2%")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "3%")); // Shadow if (item.type == ItemID.ShadowHelmet || item.type == ItemID.AncientShadowHelmet || item.type == ItemID.ShadowScalemail || item.type == ItemID.AncientShadowScalemail || item.type == ItemID.ShadowGreaves || item.type == ItemID.AncientShadowGreaves) @@ -812,7 +828,7 @@ namespace CalamityMod.Items if (item.type == ItemID.CrimsonHelmet || item.type == ItemID.CrimsonScalemail || item.type == ItemID.CrimsonGreaves) { EditTooltipByNum(0, (line) => { - string newTooltip = line.Text.Replace("2%", "5%"); + string newTooltip = line.Text.Replace("3%", "5%"); newTooltip += "\n+0.5 HP/s life regen"; line.Text = newTooltip; }); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 90ed5dd866..42095eda9f 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Items { ItemID.CandyCornRifle, Do(PointBlank, DamageExact(66)) }, { ItemID.Cascade, Do(AutoReuse, DamageExact(30)) }, { ItemID.ChainGuillotines, Do(DamageExact(100)) }, + { ItemID.ChainGun, Do(PointBlank, DamageExact(35)) }, { ItemID.ChainKnife, Do(AutoReuse, DamageRatio(1.34f)) }, // Uses ratios due to remix seed // Charged Blaster Cannon is now an earlier Last Prism-like, so it will probably need careful balance attention. // { ItemID.ChargedBlasterCannon, Do(DamageRatio(1.33f)) }, @@ -133,7 +134,7 @@ namespace CalamityMod.Items { ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) }, { ItemID.IceRod, Do(UseExact(6), DamageExact(30), ShootSpeedExact(20)) }, { ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, - { ItemID.IchorArrow, Do(DamageExact(14)) }, + { ItemID.IchorArrow, Do(DamageExact(11)) }, { ItemID.ImpStaff, Do(AutoReuse, UseExact(30), DamageExact(25)) }, { ItemID.InfernoFork, Do(DamageRatio(1.2f)) }, { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, @@ -155,12 +156,14 @@ namespace CalamityMod.Items { ItemID.MedusaHead, Do(ManaExact(6), DamageRatio(1.2f)) }, { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)/*, DamageRatio(1.33f) */) }, { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, + { ItemID.MiniNukeI, Do(DamageExact(90)) }, + { ItemID.MiniNukeII, Do(DamageExact(90)) }, { ItemID.Minishark, Do(PointBlank, DamageExact(4)) }, { ItemID.MoltenFury, Do(PointBlank, UseExact(29), AutoReuse) }, { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageRatio(2f)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury - { ItemID.Muramasa, Do(CritDelta(+10)) }, + { ItemID.Muramasa, Do(CritDelta(+20)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, { ItemID.Musket, Do(PointBlank, DamageExact(22)) }, { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(95), ShootSpeedRatio(1.25f)) }, @@ -204,8 +207,6 @@ namespace CalamityMod.Items { ItemID.RedPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, { ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's throw and valkyrie's yoyo are the same weapon - { ItemID.RocketIII, Do(DamageRatio(0.75f)) }, - { ItemID.RocketIV, Do(DamageRatio(0.75f)) }, { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, { ItemID.SDMG, Do(PointBlank, DamageExact(80)) }, @@ -434,7 +435,6 @@ namespace CalamityMod.Items #region CATEGORY 5: Point Blank support { ItemID.Blowpipe, pointBlank }, { ItemID.BorealWoodBow, pointBlank }, - { ItemID.ChainGun, pointBlank }, { ItemID.ChlorophyteShotbow, pointBlank }, { ItemID.CopperBow, pointBlank }, { ItemID.DartPistol, pointBlank }, diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index 010b11a2cd..d7da76bafb 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches Item.ResearchUnlockCount = 5; ItemID.Sets.IsFishingCrate[Type] = true; ItemID.Sets.IsFishingCrateHardmode[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Fishing/AstralCatches/MonolithCrate.cs b/Items/Fishing/AstralCatches/MonolithCrate.cs new file mode 100644 index 0000000000..060d03675b --- /dev/null +++ b/Items/Fishing/AstralCatches/MonolithCrate.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Critters; +using CalamityMod.Tiles.Astral; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Fishing.AstralCatches +{ + public class MonolithCrate : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Fishing"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 5; + ItemID.Sets.IsFishingCrate[Type] = true; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.maxStack = 9999; + Item.consumable = true; + Item.rare = ItemRarityID.Green; + Item.value = Item.sellPrice(gold: 1); + Item.createTile = ModContent.TileType(); + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + } + + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.Crates; + } + + public override bool CanRightClick() => true; + public override void ModifyItemLoot(ItemLoot itemLoot) + { + // Materials + itemLoot.Add(ItemID.FallenStar, 1, 5, 10); + itemLoot.Add(ItemID.Meteorite, 5, 10, 20); + itemLoot.Add(ItemID.MeteoriteBar, 10, 1, 3); + + // Pet + itemLoot.Add(ModContent.ItemType(), 10); + + // Bait + itemLoot.Add(ModContent.ItemType(), 5, 1, 3); + itemLoot.Add(ItemID.EnchantedNightcrawler, 5, 1, 3); + itemLoot.Add(ModContent.ItemType(), 5, 1, 3); + + itemLoot.Add(ItemID.Firefly, 3, 1, 3); + + // Potions + itemLoot.AddCratePotionRules(false); + + // Money + itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); + itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + } + } +} diff --git a/Items/Fishing/AstralCatches/MonolithCrate.png b/Items/Fishing/AstralCatches/MonolithCrate.png new file mode 100644 index 0000000000..a361991305 Binary files /dev/null and b/Items/Fishing/AstralCatches/MonolithCrate.png differ diff --git a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs index 572e31a6c4..81452c16a8 100644 --- a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { Item.ResearchUnlockCount = 5; ItemID.Sets.IsFishingCrate[Type] = true; + ItemID.Sets.IsFishingCrateHardmode[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs b/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs new file mode 100644 index 0000000000..55ff0e63e7 --- /dev/null +++ b/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs @@ -0,0 +1,64 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Crags; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Fishing.BrimstoneCragCatches +{ + public class SlagCrate : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Fishing"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 5; + ItemID.Sets.IsFishingCrate[Type] = true; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.maxStack = 9999; + Item.consumable = true; + Item.rare = ItemRarityID.Green; + Item.value = Item.sellPrice(gold: 1); + Item.createTile = ModContent.TileType(); + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + } + + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.Crates; + } + + public override bool CanRightClick() => true; + public override void ModifyItemLoot(ItemLoot itemLoot) + { + // Materials + itemLoot.Add(ItemID.Obsidian, 1, 2, 5); + itemLoot.Add(ItemID.Hellstone, 4, 2, 5); + itemLoot.Add(ItemID.HellstoneBar, 10, 1, 3); + itemLoot.Add(ModContent.ItemType(), 1, 1, 4); + + // Weapons (none) + + // Bait + itemLoot.Add(ItemID.MasterBait, 10, 1, 2); + itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); + itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); + + // Potions + itemLoot.Add(ItemID.InfernoPotion, 10, 1, 3); + itemLoot.AddCratePotionRules(false); + + // Money + itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); + itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + } + } +} diff --git a/Items/Fishing/BrimstoneCragCatches/SlagCrate.png b/Items/Fishing/BrimstoneCragCatches/SlagCrate.png new file mode 100644 index 0000000000..b69cdfa6ba Binary files /dev/null and b/Items/Fishing/BrimstoneCragCatches/SlagCrate.png differ diff --git a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs new file mode 100644 index 0000000000..d268fe1979 --- /dev/null +++ b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs @@ -0,0 +1,122 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Pets; +using CalamityMod.Items.Placeables; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Tools.ClimateChange; +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.Items.Placeables.Ores; +using CalamityMod.Tiles.Abyss; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.GameContent.ItemDropRules; + +namespace CalamityMod.Items.Fishing.SulphurCatches +{ + public class HydrothermalCrate : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Fishing"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 5; + ItemID.Sets.IsFishingCrate[Type] = true; + ItemID.Sets.IsFishingCrateHardmode[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.maxStack = 9999; + Item.consumable = true; + Item.rare = ItemRarityID.Green; + Item.value = Item.sellPrice(gold: 1); + Item.createTile = ModContent.TileType(); + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + } + + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.Crates; + } + + public override bool CanRightClick() => true; + public override void ModifyItemLoot(ItemLoot itemLoot) + { + // The contents of this crate depend massively on progression, so it uses a large number of LeadingConditionRules. + var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode); + var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitasClone); + var scoriaAvailable = itemLoot.DefineConditionalDropSet(() => NPC.downedGolemBoss); + var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain); + var tier2AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourgeAcidRain); + var tier3AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke); + + // Materials + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + + tier1AcidRain.Add(ModContent.ItemType(), 10, 1, 3); + tier2AcidRain.Add(ModContent.ItemType(), 10, 1, 3); + tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); + tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); + tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); + scoriaAvailable.Add(ModContent.ItemType(), 5, 16, 28); + scoriaAvailable.Add(ModContent.ItemType(), new Fraction(15, 100), 4, 7); + tier3AcidRain.Add(ModContent.ItemType(), 10, 1, 5); + + // Pre-HM Abyss Weapons + tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + )); + + // Post-AS Acid Rain Weapons (and Nuclear Rod) + tier2AcidRain.Add(new OneFromOptionsDropRule(10, 1, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + )); + + // Pre-HM Abyss Equipment (and Torrential Tear) + tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + )); + + // Bait + itemLoot.Add(ItemID.MasterBait, 10, 1, 2); + itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); + itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); + + // Potions + itemLoot.Add(ModContent.ItemType(), 10, 1, 3); + itemLoot.AddCratePotionRules(); + + // Money + itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); + itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + } + } +} diff --git a/Items/Fishing/SulphurCatches/HydrothermalCrate.png b/Items/Fishing/SulphurCatches/HydrothermalCrate.png new file mode 100644 index 0000000000..9597cd29af Binary files /dev/null and b/Items/Fishing/SulphurCatches/HydrothermalCrate.png differ diff --git a/Items/Fishing/SulphurCatches/SulphurousCrate.cs b/Items/Fishing/SulphurCatches/SulphurousCrate.cs index 9d938e65e4..8c663bd6c9 100644 --- a/Items/Fishing/SulphurCatches/SulphurousCrate.cs +++ b/Items/Fishing/SulphurCatches/SulphurousCrate.cs @@ -9,7 +9,6 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -53,13 +52,8 @@ namespace CalamityMod.Items.Fishing.SulphurCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - // The contents of this crate depend massively on progression, so it uses a large number of LeadingConditionRules. var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode); - var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitasClone); - var scoriaAvailable = itemLoot.DefineConditionalDropSet(() => NPC.downedGolemBoss); var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain); - var tier2AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourgeAcidRain); - var tier3AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke); // Materials itemLoot.Add(ModContent.ItemType(), 1, 5, 10); @@ -68,13 +62,6 @@ namespace CalamityMod.Items.Fishing.SulphurCatches itemLoot.Add(ModContent.ItemType(), 1, 5, 10); tier1AcidRain.Add(ModContent.ItemType(), 10, 1, 3); - tier2AcidRain.Add(ModContent.ItemType(), 10, 1, 3); - tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); - tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); - tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); - scoriaAvailable.Add(ModContent.ItemType(), 5, 16, 28); - scoriaAvailable.Add(ModContent.ItemType(), new Fraction(15, 100), 4, 7); - tier3AcidRain.Add(ModContent.ItemType(), 10, 1, 5); // Pre-HM Abyss Weapons tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1, @@ -85,17 +72,6 @@ namespace CalamityMod.Items.Fishing.SulphurCatches ModContent.ItemType() )); - // Post-AS Acid Rain Weapons (and Nuclear Rod) - tier2AcidRain.Add(new OneFromOptionsDropRule(10, 1, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - )); - // Pre-HM Abyss Equipment (and Torrential Tear) tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1, ModContent.ItemType(), @@ -112,7 +88,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches // Potions itemLoot.Add(ModContent.ItemType(), 10, 1, 3); - itemLoot.AddCratePotionRules(); + itemLoot.AddCratePotionRules(false); // Money itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs new file mode 100644 index 0000000000..3b4c80f0f8 --- /dev/null +++ b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs @@ -0,0 +1,71 @@ +using CalamityMod.Items.Critters; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Summon; +using Terraria; +using Terraria.GameContent.ItemDropRules; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Fishing.SunkenSeaCatches +{ + [LegacyName("SunkenCrate")] + public class EutrophicCrate : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Fishing"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 5; + ItemID.Sets.IsFishingCrate[Type] = true; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.maxStack = 9999; + Item.consumable = true; + Item.rare = ItemRarityID.Green; + Item.value = Item.sellPrice(gold: 1); + Item.createTile = ModContent.TileType(); + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + } + + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.Crates; + } + + public override bool CanRightClick() => true; + public override void ModifyItemLoot(ItemLoot itemLoot) + { + var postDesertScourge = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge); + + // Materials + itemLoot.Add(ModContent.ItemType(), 1, 10, 30); + itemLoot.Add(ModContent.ItemType(), 1, 10, 30); + postDesertScourge.Add(ModContent.ItemType(), 1, 5, 10); + postDesertScourge.Add(ModContent.ItemType(), 5, 2, 5); + + // Bait + itemLoot.Add(ItemID.MasterBait, 10, 1, 2); + itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); + itemLoot.Add(ModContent.ItemType(), 5, 1, 3); + itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); + + // Potions + itemLoot.AddCratePotionRules(false); + + // Money + itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); + itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + } + } +} diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.png b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.png new file mode 100644 index 0000000000..cdf1b87ab6 Binary files /dev/null and b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.png differ diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs similarity index 85% rename from Items/Fishing/SunkenSeaCatches/SunkenCrate.cs rename to Items/Fishing/SunkenSeaCatches/PrismCrate.cs index c1a1504501..ecf064395c 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Critters; +using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Weapons.Magic; @@ -12,13 +13,15 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.SunkenSeaCatches { - public class SunkenCrate : ModItem, ILocalizedModType + public class PrismCrate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; ItemID.Sets.IsFishingCrate[Type] = true; + ItemID.Sets.IsFishingCrateHardmode[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -29,7 +32,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches Item.consumable = true; Item.rare = ItemRarityID.Green; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); + Item.createTile = ModContent.TileType(); Item.useTurn = true; Item.autoReuse = true; Item.useAnimation = 15; @@ -37,10 +40,10 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches Item.useStyle = ItemUseStyleID.Swing; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.Crates; - } + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.Crates; + } public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) diff --git a/Items/Fishing/SunkenSeaCatches/PrismCrate.png b/Items/Fishing/SunkenSeaCatches/PrismCrate.png new file mode 100644 index 0000000000..cb1cfc1fbc Binary files /dev/null and b/Items/Fishing/SunkenSeaCatches/PrismCrate.png differ diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.png b/Items/Fishing/SunkenSeaCatches/SunkenCrate.png deleted file mode 100644 index 134f920a56..0000000000 Binary files a/Items/Fishing/SunkenSeaCatches/SunkenCrate.png and /dev/null differ diff --git a/Items/Materials/DemonicBoneAsh.png b/Items/Materials/DemonicBoneAsh.png index c00a297f79..82628c60a7 100644 Binary files a/Items/Materials/DemonicBoneAsh.png and b/Items/Materials/DemonicBoneAsh.png differ diff --git a/Items/Potions/FlaskOfCrumbling.png b/Items/Potions/FlaskOfCrumbling.png index fa9e4979a0..30eaf70e4b 100644 Binary files a/Items/Potions/FlaskOfCrumbling.png and b/Items/Potions/FlaskOfCrumbling.png differ diff --git a/Items/TreasureBags/YharonBag.cs b/Items/TreasureBags/YharonBag.cs index 028f5762ed..e56cc657c5 100644 --- a/Items/TreasureBags/YharonBag.cs +++ b/Items/TreasureBags/YharonBag.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), })); itemLoot.Add(ModContent.ItemType(), 10); diff --git a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs index 6a109faa4b..c8314dbaac 100644 --- a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs @@ -17,6 +17,13 @@ namespace CalamityMod.Items.VanillaArmorChanges public const float ArmorPieceDamage = 0.05f; public const int ArmorPieceLifeRegen = 1; + // Set bonus clarification + public override void UpdateSetBonusText(ref string setBonusText) + { + Player player = Main.LocalPlayer; + setBonusText = $"{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + } + private void ApplyAnyPieceEffect(Player player) { // Remove the vanilla +3% damage and add the new damage value at the same time @@ -31,7 +38,5 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyBodyPieceEffect(Player player) => ApplyAnyPieceEffect(player); public override void ApplyLegPieceEffect(Player player) => ApplyAnyPieceEffect(player); - - // No changes to the set bonus } } diff --git a/Items/VanillaArmorChanges/JungleArmorSetChange.cs b/Items/VanillaArmorChanges/JungleArmorSetChange.cs index 171a139954..984f95c349 100644 --- a/Items/VanillaArmorChanges/JungleArmorSetChange.cs +++ b/Items/VanillaArmorChanges/JungleArmorSetChange.cs @@ -32,10 +32,10 @@ namespace CalamityMod.Items.VanillaArmorChanges player.GetCritChance() -= 4; } - public override void ApplyBodyPieceEffect(Player player) => player.GetDamage() -= 0.02f; + public override void ApplyBodyPieceEffect(Player player) => player.GetDamage() -= 0.01f; - public override void ApplyLegPieceEffect(Player player) => player.GetCritChance() -= 4; + public override void ApplyLegPieceEffect(Player player) => player.GetCritChance() -= 3; - public override void ApplyArmorSetBonus(Player player) => player.manaCost *= 1.0714f; // Reduces to -10% mana cost + public override void ApplyArmorSetBonus(Player player) => player.manaCost += 0.06f; // Reduces to -10% mana cost } } diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index ef4864bad7..a0ef23a3cb 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(ItemID.HolyWater, 10). AddIngredient(ItemID.SoulofLight, 30). diff --git a/Items/Weapons/Magic/ShadecrystalTome.cs b/Items/Weapons/Magic/ShadecrystalBarrage.cs similarity index 94% rename from Items/Weapons/Magic/ShadecrystalTome.cs rename to Items/Weapons/Magic/ShadecrystalBarrage.cs index 2a61153982..bc1eee8d5b 100644 --- a/Items/Weapons/Magic/ShadecrystalTome.cs +++ b/Items/Weapons/Magic/ShadecrystalBarrage.cs @@ -8,7 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class ShadecrystalTome : ModItem, ILocalizedModType + [LegacyName("ShadecrystalTome")] + public class ShadecrystalBarrage : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() diff --git a/Items/Weapons/Magic/ShadecrystalTome.png b/Items/Weapons/Magic/ShadecrystalBarrage.png similarity index 100% rename from Items/Weapons/Magic/ShadecrystalTome.png rename to Items/Weapons/Magic/ShadecrystalBarrage.png diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index de00ad02d8..cc36f427d9 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 66; Item.height = 68; - Item.damage = 90; + Item.damage = 120; Item.DamageType = DamageClass.Magic; Item.mana = 10; Item.useTime = 23; @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic } for (int index = 0; index < 3; ++index) { - Projectile.NewProjectile(source, position, velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * 1.5f, ModContent.ProjectileType(), (int)(damage * 1.10), knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * 1.5f, ModContent.ProjectileType(), (int)(damage * 1.35), knockback, player.whoAmI); } Projectile.NewProjectile(source, position, velocity * 0.66f, type, damage, knockback, player.whoAmI, 1f); return false; diff --git a/Items/Weapons/Magic/VeeringWind.cs b/Items/Weapons/Magic/VeeringWind.cs index 0c7a597d8a..46f11b85da 100644 --- a/Items/Weapons/Magic/VeeringWind.cs +++ b/Items/Weapons/Magic/VeeringWind.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 32; - Item.damage = 15; + Item.damage = 19; Item.DamageType = DamageClass.Magic; - Item.mana = 20; + Item.mana = 14; Item.useTime = Item.useAnimation = 36; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -47,6 +47,12 @@ namespace CalamityMod.Items.Weapons.Magic public override float UseSpeedMultiplier(Player player) => player.altFunctionUse == 2 ? 0.5f : 1f; + public override void ModifyManaCost(Player player, ref float reduce, ref float mult) + { + if (player.altFunctionUse == 2) + mult *= 2f; + } + public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { if (player.altFunctionUse == 2) @@ -59,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int totalProjectiles = 24; + int totalProjectiles = 12; for (int i = 0; i < totalProjectiles; i++) { Vector2 waveVelocity = ((MathHelper.TwoPi * i / (float)totalProjectiles) + velocity.ToRotation()).ToRotationVector2() * velocity.Length(); diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index fc38d3a9f0..50e6f61e11 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -13,47 +14,27 @@ namespace CalamityMod.Items.Weapons.Melee public class AbyssBlade : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public static readonly SoundStyle SpinSound = new("CalamityMod/Sounds/Item/SpinningWoosh") { Volume = 0.65f }; public override void SetDefaults() { Item.width = 74; Item.height = 74; - Item.damage = 130; + Item.damage = 140; + Item.knockBack = 7.5f; + Item.useTime = 65; + Item.useAnimation = 65; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 3f; + + Item.noMelee = true; + Item.noUseGraphic = true; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 18; - Item.useTime = 18; - Item.useTurn = true; - Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 8f; - Item.UseSound = SoundID.Item1; + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = null; Item.autoReuse = true; + Item.value = CalamityGlobalItem.Rarity7BuyPrice; Item.rare = ItemRarityID.Lime; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 9f; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.75), knockback, player.whoAmI); - return false; - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.NextBool(3)) - { - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); - } - } - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 300); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - target.AddBuff(ModContent.BuffType(), 300); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index f865455fe6..193d102ea4 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -259,18 +259,21 @@ namespace CalamityMod.Items.Weapons.Melee public override bool CanUseItem(Player player) { - return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && + bool isRightClicking = player.altFunctionUse != ItemAlternativeFunctionID.None; + return !isRightClicking && !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && (n.type == ProjectileType() || n.type == ProjectileType() || n.type == ProjectileType())); } + // 03FEB2024: Ozzatron: added so the Iban Blades don't break Overhaul compatibility. Weapons are functionally unchanged. + public override bool AltFunctionUse(Player player) => true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (mainAttunement == null) + if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; - int powerLungeCounter = 0; //Unused here ComboResetTimer = 1f; return mainAttunement.Shoot(player, source, ref position, ref velocity.X, ref velocity.Y, ref type, ref damage, ref knockback, ref Combo, ref CanLunge, ref powerLungeCounter); diff --git a/Items/Weapons/Melee/ChronomancersScythe.cs b/Items/Weapons/Melee/ChronomancersScythe.cs index ab7d51386d..9ec1f7c1aa 100644 --- a/Items/Weapons/Melee/ChronomancersScythe.cs +++ b/Items/Weapons/Melee/ChronomancersScythe.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.damage = 153; + Item.damage = 159; Item.knockBack = 4f; Item.useAnimation = 25; Item.useTime = 5; diff --git a/Items/Weapons/Melee/DepthCrusher.cs b/Items/Weapons/Melee/DepthCrusher.cs index 0f3c7e6c2d..e874a94843 100644 --- a/Items/Weapons/Melee/DepthCrusher.cs +++ b/Items/Weapons/Melee/DepthCrusher.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -10,64 +11,27 @@ namespace CalamityMod.Items.Weapons.Melee public class DepthCrusher : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - private const int HammerPower = 70; - - public override void SetStaticDefaults() - { - - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; - } public override void SetDefaults() { Item.width = 56; Item.height = 50; - Item.damage = 36; - Item.knockBack = 5.25f; - Item.useTime = 17; - Item.useAnimation = 22; - Item.hammer = HammerPower; + Item.damage = 35; + Item.knockBack = 7.25f; + Item.useTime = 65; + Item.useAnimation = 65; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 3f; + Item.noMelee = true; + Item.noUseGraphic = true; Item.DamageType = DamageClass.Melee; - Item.useTurn = true; - Item.useStyle = ItemUseStyleID.Swing; - Item.UseSound = SoundID.Item1; + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = null; Item.autoReuse = true; + Item.value = CalamityGlobalItem.Rarity2BuyPrice; Item.rare = ItemRarityID.Green; } - - public override bool AltFunctionUse(Player player) => true; - - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - Item.hammer = 0; - } - else - { - Item.hammer = HammerPower; - } - return base.CanUseItem(player); - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.NextBool(3)) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); - } - } - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - target.AddBuff(ModContent.BuffType(), 180); - } } } diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index dc049aaad3..f2a0223988 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -182,10 +182,14 @@ namespace CalamityMod.Items.Weapons.Melee #endregion + // 03FEB2024: Ozzatron: added so the Iban Blades don't break Overhaul compatibility. Weapons are functionally unchanged. + public override bool AltFunctionUse(Player player) => true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (mainAttunement == null) + if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; + return true; } @@ -245,7 +249,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool CanUseItem(Player player) { - return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && + bool isRightClicking = player.altFunctionUse != ItemAlternativeFunctionID.None; + return !isRightClicking && !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && (n.type == ProjectileType() || n.type == ProjectileType() || n.type == ProjectileType() || diff --git a/Items/Weapons/Melee/LifefruitScythe.cs b/Items/Weapons/Melee/LifehuntScythe.cs similarity index 95% rename from Items/Weapons/Melee/LifefruitScythe.cs rename to Items/Weapons/Melee/LifehuntScythe.cs index 108359dce6..300739e648 100644 --- a/Items/Weapons/Melee/LifefruitScythe.cs +++ b/Items/Weapons/Melee/LifehuntScythe.cs @@ -8,7 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class LifefruitScythe : ModItem, ILocalizedModType + [LegacyName("LifefruitScythe")] + public class LifehuntScythe : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() diff --git a/Items/Weapons/Melee/LifefruitScythe.png b/Items/Weapons/Melee/LifehuntScythe.png similarity index 100% rename from Items/Weapons/Melee/LifefruitScythe.png rename to Items/Weapons/Melee/LifehuntScythe.png diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 0cbe50cc9b..cc038d5078 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 24f; Item.rare = ModContent.RarityType(); - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 14)); } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/NeptunesBounty.cs b/Items/Weapons/Melee/NeptunesBounty.cs index 32691fc059..3cc637ec0c 100644 --- a/Items/Weapons/Melee/NeptunesBounty.cs +++ b/Items/Weapons/Melee/NeptunesBounty.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -13,44 +14,28 @@ namespace CalamityMod.Items.Weapons.Melee public class NeptunesBounty : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public static readonly SoundStyle SpinSound = new("CalamityMod/Sounds/Item/SpinningWoosh") { Volume = 0.65f }; public override void SetDefaults() { Item.width = 122; Item.height = 122; - Item.damage = 270; - Item.DamageType = DamageClass.Melee; - Item.useAnimation = 22; - Item.useTime = 22; - Item.useTurn = true; - Item.useStyle = ItemUseStyleID.Swing; + Item.damage = 444; Item.knockBack = 9f; - Item.UseSound = SoundID.Item1; + Item.useTime = 65; + Item.useAnimation = 65; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 3f; + + Item.noMelee = true; + Item.noUseGraphic = true; + Item.DamageType = DamageClass.Melee; + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = null; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; Item.value = CalamityGlobalItem.Rarity13BuyPrice; Item.rare = ModContent.RarityType(); } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.NextBool(3)) - { - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); - } - } - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 300); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - target.AddBuff(ModContent.BuffType(), 300); - } - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index 7ec9968d89..de85a9bbd0 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -326,15 +326,24 @@ namespace CalamityMod.Items.Weapons.Melee public override bool CanUseItem(Player player) { - return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && + bool isRightClicking = player.altFunctionUse != ItemAlternativeFunctionID.None; + return !isRightClicking && !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && (n.type == ProjectileType() || n.type == ProjectileType() || n.type == ProjectileType() || n.type == ProjectileType())); } - //No need for any wacky zany hijinx in the shoot method for once??? damn - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) => mainAttunement == null ? false : true; + // 03FEB2024: Ozzatron: added so the Iban Blades don't break Overhaul compatibility. Weapons are functionally unchanged. + public override bool AltFunctionUse(Player player) => true; + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) + return false; + + return true; + } internal static ChargingEnergyParticleSet BiomeEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.White, Color.White, 0.04f, 20f); internal static void UpdateAllParticleSets() diff --git a/Items/Weapons/Melee/Oracle.cs b/Items/Weapons/Melee/TheOracle.cs similarity index 95% rename from Items/Weapons/Melee/Oracle.cs rename to Items/Weapons/Melee/TheOracle.cs index 5b7b60affa..7ce21506d7 100644 --- a/Items/Weapons/Melee/Oracle.cs +++ b/Items/Weapons/Melee/TheOracle.cs @@ -10,7 +10,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class Oracle : ModItem, ILocalizedModType + [LegacyName("Oracle")] + public class TheOracle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public const int YoyoBaseDamage = 170; diff --git a/Items/Weapons/Melee/Oracle.png b/Items/Weapons/Melee/TheOracle.png similarity index 100% rename from Items/Weapons/Melee/Oracle.png rename to Items/Weapons/Melee/TheOracle.png diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 3ffdcb90cf..1531ecbd30 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -18,6 +18,8 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Melee { + // TODO -- CANNOT RENAME this and True Biome Blade to "TrueBiomeBlade" and "BiomeBlade" internally without corrupting existing items + // (Comment copied from an equivalent one on OmegaBiomeBlade from June 2022) public class TrueBiomeBlade : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; @@ -289,7 +291,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool CanUseItem(Player player) { - return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && + bool isRightClicking = player.altFunctionUse != ItemAlternativeFunctionID.None; + return !isRightClicking && !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && (n.type == ProjectileType() || n.type == ProjectileType() || n.type == ProjectileType() || @@ -298,9 +301,12 @@ namespace CalamityMod.Items.Weapons.Melee n.type == ProjectileType())); } + // 03FEB2024: Ozzatron: added so the Iban Blades don't break Overhaul compatibility. Weapons are functionally unchanged. + public override bool AltFunctionUse(Player player) => true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (mainAttunement == null) + if (mainAttunement == null || player.altFunctionUse != ItemAlternativeFunctionID.None) return false; ComboResetTimer = 1f; diff --git a/Items/Weapons/Ranged/AntiMaterielRifle.cs b/Items/Weapons/Ranged/AntiMaterielRifle.cs index 7ed1fd2a5b..3a1552f5c9 100644 --- a/Items/Weapons/Ranged/AntiMaterielRifle.cs +++ b/Items/Weapons/Ranged/AntiMaterielRifle.cs @@ -37,6 +37,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-30, 0); + public override void HoldItem(Player player) => player.scope = true; + // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; diff --git a/Items/Weapons/Ranged/AstralRepeater.cs b/Items/Weapons/Ranged/AstralBow.cs similarity index 94% rename from Items/Weapons/Ranged/AstralRepeater.cs rename to Items/Weapons/Ranged/AstralBow.cs index c4086e4451..103f7b416a 100644 --- a/Items/Weapons/Ranged/AstralRepeater.cs +++ b/Items/Weapons/Ranged/AstralBow.cs @@ -5,7 +5,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class AstralRepeater : ModItem, ILocalizedModType + [LegacyName("AstralRepeater")] + public class AstralBow : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() diff --git a/Items/Weapons/Ranged/AstralRepeater.png b/Items/Weapons/Ranged/AstralBow.png similarity index 100% rename from Items/Weapons/Ranged/AstralRepeater.png rename to Items/Weapons/Ranged/AstralBow.png diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index dc1e3458cf..ab3719fc2c 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -59,6 +59,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + public override void HoldItem(Player player) => player.scope = true; + public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 50; public override void AddRecipes() diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs similarity index 96% rename from Items/Weapons/Ranged/BladedgeGreatbow.cs rename to Items/Weapons/Ranged/BladedgeRailbow.cs index e3bf021532..6b41933608 100644 --- a/Items/Weapons/Ranged/BladedgeGreatbow.cs +++ b/Items/Weapons/Ranged/BladedgeRailbow.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class BladedgeGreatbow : ModItem, ILocalizedModType + [LegacyName("BladedgeGreatbow")] + public class BladedgeRailbow : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.png b/Items/Weapons/Ranged/BladedgeRailbow.png similarity index 100% rename from Items/Weapons/Ranged/BladedgeGreatbow.png rename to Items/Weapons/Ranged/BladedgeRailbow.png diff --git a/Items/Weapons/Ranged/BlissfulBombardier.cs b/Items/Weapons/Ranged/BlissfulBombardier.cs index 1d92a9b50e..80dc17f37e 100644 --- a/Items/Weapons/Ranged/BlissfulBombardier.cs +++ b/Items/Weapons/Ranged/BlissfulBombardier.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 76; Item.height = 30; - Item.damage = 84; + Item.damage = 93; Item.DamageType = DamageClass.Ranged; Item.useTime = 15; Item.useAnimation = 15; diff --git a/Items/Weapons/Ranged/CosmicBolter.cs b/Items/Weapons/Ranged/CosmicBolter.cs index e31233e9fc..7782be14e7 100644 --- a/Items/Weapons/Ranged/CosmicBolter.cs +++ b/Items/Weapons/Ranged/CosmicBolter.cs @@ -1,8 +1,9 @@ -using Terraria.DataStructures; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +14,8 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.width = 40; - Item.height = 76; + Item.width = 50; + Item.height = 112; Item.damage = 48; Item.DamageType = DamageClass.Ranged; Item.useTime = 20; @@ -32,6 +33,11 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Ranged/CosmicBolterGlow").Value); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Ranged/CosmicBolter.png b/Items/Weapons/Ranged/CosmicBolter.png index 87db9b0226..c56363cc87 100644 Binary files a/Items/Weapons/Ranged/CosmicBolter.png and b/Items/Weapons/Ranged/CosmicBolter.png differ diff --git a/Items/Weapons/Ranged/CosmicBolterGlow.png b/Items/Weapons/Ranged/CosmicBolterGlow.png new file mode 100644 index 0000000000..37d467276c Binary files /dev/null and b/Items/Weapons/Ranged/CosmicBolterGlow.png differ diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 14df69eb5d..d3695d38cc 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -47,6 +47,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-15, 0); + public override void HoldItem(Player player) => player.scope = true; + public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 50; public override void AddRecipes() diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index 9655a752fd..c1ef8cab1a 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 120; Item.DamageType = DamageClass.Ranged; Item.useTime = 2; - Item.useAnimation = 18; - Item.reuseDelay = 6; + Item.useAnimation = 12; + Item.reuseDelay = 12; Item.useLimitPerAnimation = 9; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -73,11 +73,11 @@ namespace CalamityMod.Items.Weapons.Ranged { rotation -= 2; } - if (rotation >= 15) + if (rotation >= 11) { limit = false; } - else if (rotation <= -15) + else if (rotation <= -11) { limit = true; } @@ -100,11 +100,11 @@ namespace CalamityMod.Items.Weapons.Ranged { rotation -= 2; } - if (rotation >= 15) + if (rotation >= 11) { limit = false; } - else if (rotation <= -15) + else if (rotation <= -11) { limit = true; } diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index b915a4de94..093f7dee8a 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 84; Item.height = 30; - Item.damage = 357; + Item.damage = 279; Item.DamageType = DamageClass.Ranged; Item.useTime = 15; Item.useAnimation = 15; diff --git a/Items/Weapons/Ranged/MolecularManipulator.cs b/Items/Weapons/Ranged/MolecularManipulator.cs index da99ccfd72..cfa47b02e5 100644 --- a/Items/Weapons/Ranged/MolecularManipulator.cs +++ b/Items/Weapons/Ranged/MolecularManipulator.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddIngredient(2). AddIngredient(). AddTile(TileID.LunarCraftingStation). diff --git a/Items/Weapons/Ranged/NullificationRifle.cs b/Items/Weapons/Ranged/NullificationPistol.cs similarity index 93% rename from Items/Weapons/Ranged/NullificationRifle.cs rename to Items/Weapons/Ranged/NullificationPistol.cs index 2062ddf122..f3ff399c3f 100644 --- a/Items/Weapons/Ranged/NullificationRifle.cs +++ b/Items/Weapons/Ranged/NullificationPistol.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class NullificationRifle : ModItem, ILocalizedModType + [LegacyName("NullificationRifle")] + public class NullificationPistol : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() diff --git a/Items/Weapons/Ranged/NullificationRifle.png b/Items/Weapons/Ranged/NullificationPistol.png similarity index 100% rename from Items/Weapons/Ranged/NullificationRifle.png rename to Items/Weapons/Ranged/NullificationPistol.png diff --git a/Items/Weapons/Ranged/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index 1b75a3f9be..47191b0199 100644 --- a/Items/Weapons/Ranged/PlagueTaintedSMG.cs +++ b/Items/Weapons/Ranged/PlagueTaintedSMG.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 98; Item.height = 50; - Item.damage = 76; + Item.damage = 78; Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Ranged/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs index 8cfdfc4fab..243e8b607e 100644 --- a/Items/Weapons/Ranged/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -6,55 +6,154 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Sounds; +using System; +using Terraria.Audio; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Projectiles.Boss; +using static Humanizer.In; +using System.Collections.Generic; namespace CalamityMod.Items.Weapons.Ranged { public class PolarisParrotfish : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public int SetUseTime = 6; + public int SetUseAnimation = 6; + public int ShotNumber = 0; + public bool Happy = false; + + public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/PolarisShot") { Volume = 0.6f }; + public static readonly SoundStyle Squeak = new("CalamityMod/Sounds/Custom/CuteSqueak") { Volume = 0.75f }; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; //so it doesn't look weird af when holding it + Item.staff[Item.type] = true; //so it doesn't look weird af when holding it } public override void SetDefaults() { Item.width = 38; Item.height = 34; - Item.damage = 72; + Item.damage = 35; Item.DamageType = DamageClass.Ranged; - Item.useTime = 21; - Item.useAnimation = 21; + + Item.useTime = SetUseTime; + Item.useAnimation = SetUseAnimation; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 2.25f; + Item.knockBack = 0.5f; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; - Item.UseSound = CommonCalamitySounds.LaserCannonSound; //pew pew + Item.UseSound = null; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 15f; + Item.shootSpeed = 10f; } - + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 2; // Max of 2 shots on screen at once, get closer to fire faster + public override bool AltFunctionUse(Player player) => Main.zenithWorld ? true : false; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.polarisBoostThree) //Homes in and explodes + if (Main.zenithWorld && player.altFunctionUse == 2) { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 2f); - return false; - } - else if (modPlayer.polarisBoostTwo) //Splits on enemy or tile hits - { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)(damage * 1.25), knockback, player.whoAmI, 0f, 1f); - return false; - } - return true; - } + //GFB stuff + if (Happy && Main.rand.NextBool(50)) // If you pet her too much, you will regret it + { + Happy = false; + player.itemTime = 200; + player.itemAnimation = 200; + player.Calamity().GeneralScreenShakePower = 26f; + player.AddBuff(BuffID.Obstructed, 600); + Main.NewText("Too much love...", 255, 0, 0); + SoundEngine.PlaySound(Squeak with { Pitch = -1f }, player.Center); + SoundStyle roar = new("CalamityMod/Sounds/Custom/CeaselessVoidDeathBuild"); + SoundEngine.PlaySound(roar with { Pitch = 0.5f }, player.Center); + int theFuckening = ModContent.ProjectileType(); + int projDamage = 500; + int totalProjectiles = 50; + float radians = MathHelper.TwoPi / totalProjectiles; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 projVelocity = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center + projVelocity * 2000, -projVelocity * 4, theFuckening, projDamage, 0f, Main.myPlayer); + } + } + else // Pet Polaris + { + SoundEngine.PlaySound(Squeak, player.Center); + CombatText.NewText(player.Hitbox, Color.Violet, "^-^"); + Happy = true; + switch (Main.rand.Next(1, 5 + 1)) + { + case 5: + Main.NewText("You give Polaris belly rubs", 72, 209, 204); + break; + case 4: + Main.NewText("You give Polaris a small treat", 72, 209, 204); + break; + case 3: + Main.NewText("You tell Polaris she's a good girl", 72, 209, 204); + break; + case 2: + Main.NewText("You let Polaris cuddle your arm", 72, 209, 204); + break; + default: + Main.NewText("You pet Polaris", 72, 209, 204); + break; + } - public override Vector2? HoldoutOrigin() //so it looks normal when holding - { - return new Vector2(10, 10); + for (int i = 0; i <= 6; i++) + { + Vector2 hVelocity = new Vector2(0, -4).RotateRandom(0.45); + hVelocity.X *= 0.66f; + hVelocity *= Main.rand.NextFloat(1f, 2f); + + int heart = Gore.NewGore(player.GetSource_FromThis(), player.Center + velocity * 4, hVelocity, 331, Main.rand.NextFloat(0.2f, 1.3f)); + Main.gore[heart].sticky = false; + Main.gore[heart].velocity *= 0.4f; + Main.gore[heart].velocity.Y -= 0.85f; + } + } + } + else + { + if (Happy) // If she's happy, fire much faster + { + Item.useTime = (int)(SetUseTime * 0.5f); + Item.useAnimation = (int)(SetUseAnimation * 0.5f); + } + else // Otherwise reset usetime + { + Item.useTime = SetUseTime; + Item.useAnimation = SetUseAnimation; + } + + if (Main.zenithWorld) // 1% chance to get tired when firing a projectile + { + if (Happy && Main.rand.NextBool(100)) + { + CombatText.NewText(player.Hitbox, Color.Violet, ">~<"); + Happy = false; + SoundEngine.PlaySound(Squeak with { Pitch = -0.6f }, player.Center); + } + else + SoundEngine.PlaySound(Shot, player.Center); + } + else + SoundEngine.PlaySound(Shot, player.Center); + + Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, ShotNumber); + + if (ShotNumber >= 2) // Cycle the shot color + ShotNumber = 0; + else + ShotNumber++; + } + return false; } } } diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index a893592043..9fb0a416c5 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -20,11 +20,11 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 56; Item.height = 24; - Item.damage = 24; + Item.damage = 30; Item.DamageType = DamageClass.Ranged; Item.useTime = 4; - Item.useAnimation = 32; - Item.reuseDelay = 12; + Item.useAnimation = 24; + Item.reuseDelay = 20; Item.useLimitPerAnimation = 8; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -63,8 +63,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = velocity.X + Main.rand.Next(-30, 31) * 0.05f; float SpeedY = velocity.Y + Main.rand.Next(-30, 31) * 0.05f; - int shredderBoltDamage = (int)(0.85f * damage); - int shot = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), shredderBoltDamage, knockback, player.whoAmI, 0f, 0f); + int shot = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); Main.projectile[shot].timeLeft = 180; } return false; diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 3306097044..3deeaacc0c 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -36,6 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-25, 0); + public override void HoldItem(Player player) => player.scope = true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)(damage * 0.5), knockback, player.whoAmI); diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index 81535fa2fb..06ed3272c5 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + + public override void HoldItem(Player player) => player.scope = true; public override bool CanConsumeAmmo(Item ammo, Player player) { diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 06fce23617..81b6545f39 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -41,6 +41,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-28, 0); + public override void HoldItem(Player player) => player.scope = true; + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/TyrannysEnd.png b/Items/Weapons/Ranged/TyrannysEnd.png index df8a87b0f9..35335871e6 100644 Binary files a/Items/Weapons/Ranged/TyrannysEnd.png and b/Items/Weapons/Ranged/TyrannysEnd.png differ diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs index ac3c124b33..65e1c912d1 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.PulseBow). AddIngredient(ItemID.LaserRifle). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(15). AddIngredient(8). AddIngredient(8). diff --git a/Items/Weapons/Rogue/EnchantedAxe.png b/Items/Weapons/Rogue/EnchantedAxe.png index cdae20aa68..3bab8e0e63 100644 Binary files a/Items/Weapons/Rogue/EnchantedAxe.png and b/Items/Weapons/Rogue/EnchantedAxe.png differ diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index 1cebff0908..d2e2ef35d1 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -1,7 +1,7 @@ -using Terraria.DataStructures; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 28; Item.height = 58; - Item.damage = 55; + Item.damage = 52; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = Item.useAnimation = 14; @@ -63,8 +63,6 @@ namespace CalamityMod.Items.Weapons.Rogue return 2f; } - public override float StealthDamageMultiplier => 1.3f; - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { if (player.altFunctionUse == 2 && !player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/FinalDawn.cs b/Items/Weapons/Rogue/TheFinalDawn.cs similarity index 95% rename from Items/Weapons/Rogue/FinalDawn.cs rename to Items/Weapons/Rogue/TheFinalDawn.cs index 177f682dac..be43677bc5 100644 --- a/Items/Weapons/Rogue/FinalDawn.cs +++ b/Items/Weapons/Rogue/TheFinalDawn.cs @@ -8,7 +8,8 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Rogue { - public class FinalDawn : RogueWeapon + [LegacyName("FinalDawn")] + public class TheFinalDawn : RogueWeapon { public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/FinalDawnSlash"); public override void SetDefaults() diff --git a/Items/Weapons/Rogue/FinalDawn.png b/Items/Weapons/Rogue/TheFinalDawn.png similarity index 100% rename from Items/Weapons/Rogue/FinalDawn.png rename to Items/Weapons/Rogue/TheFinalDawn.png diff --git a/Items/Weapons/Summon/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index 6c040b6f23..9c0441788b 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -1,7 +1,8 @@ -using Terraria.DataStructures; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 2f; Item.value = CalamityGlobalItem.Rarity2BuyPrice; Item.rare = ItemRarityID.Green; - Item.UseSound = SoundID.NPCDeath34; + Item.UseSound = Stormlion.DeathSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index e8c09e9d2e..af0d65961b 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -792,11 +792,6 @@ PhantomicShield: { ''' } -PolarisBuff: { - DisplayName: Polaris Boost - Description: The Northern Star empowers your life regeneration -} - ProfanedCrystalBuff: { DisplayName: Devotion Description: You are an emissary of the profaned goddess now! diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 0d7071c6da..17620a6973 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1091,7 +1091,7 @@ MoonstoneCrown: { ''' 15% increased rogue projectile velocity Stealth strikes summon lunar flares on enemy hits - Rogue projectiles very occasionally summon moon sigils behind them + Rogue projectiles summon homing moon sigils as they travel ''' } @@ -1454,7 +1454,8 @@ SandCloak: { Tooltip: ''' 5% increased movement speed - Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +1 HP/s life regen + Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which damages and knocks back enemies + While inside the veil, you are given +6 defense and +1 HP/s life regen This effect has a 30 second cooldown before it can be used again ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index 93ca02be64..ddb2070713 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -26,8 +26,9 @@ BloodfireBullet: { DisplayName: Bloodfire Bullet Tooltip: ''' - Accelerates your life regeneration on hit - Deals bonus damage based on your current life regeneration + Accelerates your natural life regen on hit + Deals bonus damage based on your current life regen and natural life regen + This damage caps at 25 ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 6bcd067703..e968210980 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -278,10 +278,10 @@ GemTechHeadgear: { GeneralGemInfo: ''' A gem is lost when you take more than {0} damage in a single hit. - The type of gem lost is the same as the class of the previous when you used + The type of gem lost is the same as the class of the most recently used weapon If said gem has already been lost, the base gem is lost instead When a gem is lost, it breaks off and homes towards the nearest enemy or boss, if one is present, dealing a base of {1} damage - Gems have a {2} second delay before they appear again" + Gems have a {2} second delay before they appear again ''' RedGemInfo: "[i:Ruby] The red gem grants {0} maximum stealth, increased rogue stats, and makes stealth only consumable by rogue weapons" YellowGemInfo: "[i:Topaz] The yellow gem provides increased melee stats and makes melee attacks release shards on hit with a cooldown. This cooldown is shorter for true melee attacks" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 13a8b24a11..8e96193a93 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -24,6 +24,11 @@ AstrophageItem: { Tooltip: Summons an astrophage to follow you around } +MonolithCrate: { + DisplayName: Monolith Crate + Tooltip: "{$CommonItemTooltip.RightClickToOpen}" +} + ProcyonidPrawn: { DisplayName: Procyonid Prawn Tooltip: "" @@ -110,12 +115,22 @@ Shadowfish: { Tooltip: Darkness spreads } +SlagCrate: { + DisplayName: Slag Crate + Tooltip: "{$CommonItemTooltip.RightClickToOpen}" +} + Slurpfish: { DisplayName: Slurpfish QuestDescription: Y'know, it'd be an absolute calamity if I sent you to the ancient ruins in the depths of hell to catch a fish. And I plan to do just that. Now scram! The fish isn't going to catch itself. } // Sunken Sea Catches +EutrophicCrate: { + DisplayName: Eutrophic Crate + Tooltip: "{$CommonItemTooltip.RightClickToOpen}" +} + EutrophicSandfish: { DisplayName: Eutrophic Sandfish QuestDescription: You ever get to see what would happen if a lizard that lived in the desert scurried too deep underground? I did, and they sure are cool! But it's way too slippery for me to get my hands on it now. You go and get it so I can keep it as a pet! @@ -126,6 +141,11 @@ GreenwaveLoach: { Tooltip: An endangered fish that is highly prized in the market } +PrismCrate: { + DisplayName: Prism Crate + Tooltip: "{$CommonItemTooltip.RightClickToOpen}" +} + PrismaticGuppy: { DisplayName: Prismatic Guppy Tooltip: Throwing these in an aquarium would be insanity @@ -165,11 +185,6 @@ SparklingEmpress: { ''' } -SunkenCrate: { - DisplayName: Sunken Crate - Tooltip: "{$CommonItemTooltip.RightClickToOpen}" -} - SunkenSailfish: { DisplayName: Sunken Sailfish Tooltip: Zooming at 60 miles per hour @@ -220,6 +235,11 @@ Gorecodile: { Tooltip: Press to extract blood orbs } +HydrothermalCrate: { + DisplayName: Hydrothermal Crate + Tooltip: "{$CommonItemTooltip.RightClickToOpen}" +} + Spadefish: { DisplayName: Spadefish Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 70605d8067..46d41b7d83 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -675,7 +675,7 @@ Serpentine: { ''' } -ShadecrystalTome: { +ShadecrystalBarrage: { DisplayName: Shadecrystal Barrage Tooltip: Summons rapid fire shadecrystals, can shoot two crystals at once } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 84b22f4560..6fec01ad4f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -12,8 +12,8 @@ AbyssBlade: { DisplayName: Abyss Blade Tooltip: ''' - Fires short-range tridents - Hitting enemies will inflict the crush depth debuff + Tosses a spinning abyssal sword that slices through enemies and releases water energy upon hitting a tile + The sword will fly towards enemies after a ricochet, dealing 2x damage ''' } @@ -321,8 +321,8 @@ DepthCrusher: { DisplayName: Depth Crusher Tooltip: ''' - Hitting enemies will inflict the Riptide debuff - Press to use without hammering down walls + Tosses a heavy abyssal crusher that releases water energy upon hitting a tile + The crusher will ricochet off of tiles and enemies ''' } @@ -697,7 +697,7 @@ Lacerator: { TooltipGFB: May be a viable weapon against DoG... } -LifefruitScythe: { +LifehuntScythe: { DisplayName: Lifehunt Scythe Tooltip: Heals you on hit and shoots an energy scythe } @@ -794,8 +794,8 @@ NeptunesBounty: { DisplayName: Neptune's Bounty Tooltip: ''' - Fires a trident that rains additional tridents as it travels - Hitting enemies will inflict the crush depth debuff + Tosses a spinning abyssal sword which constantly sprays water energy + Once the blade begins falling, it will redirect itself towards enemies with increased velocity and 2x damage ''' } @@ -843,17 +843,6 @@ Omniblade: { Tooltip: An ancient blade forged by the legendary Omnir } -Oracle: { - DisplayName: The Oracle - Tooltip: - ''' - Emits an aura of red lightning which charges up when hitting enemies - Fires auric orbs when supercharged - An exceptionally agile yoyo - 'Gaze into the past, the present, the future... and the circumstances of your inevitable demise' - ''' -} - Orderbringer: { DisplayName: Orderbringer Tooltip: @@ -1265,6 +1254,17 @@ TheObliterator: { ''' } +TheOracle: { + DisplayName: The Oracle + Tooltip: + ''' + Emits an aura of red lightning which charges up when hitting enemies + Fires auric orbs when supercharged + An exceptionally agile yoyo + 'Gaze into the past, the present, the future... and the circumstances of your inevitable demise' + ''' +} + TitanArm: { DisplayName: Titan Arm Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 2a3815daaf..8fc6f3ed00 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -87,7 +87,7 @@ AstralBlaster: { Tooltip: Converts musket balls into homing astral rounds } -AstralRepeater: { +AstralBow: { DisplayName: Astral Bow Tooltip: Fires a burst of three arrows } @@ -135,7 +135,7 @@ BarracudaGun: { Tooltip: Fires two barracudas that latch onto enemies and shred them } -BladedgeGreatbow: { +BladedgeRailbow: { DisplayName: Bladedge Railbow Tooltip: Fires a spread of 4 arrows and 2 leaves at once } @@ -795,7 +795,7 @@ Norfleet: { Tooltip: Fire everything! } -NullificationRifle: { +NullificationPistol: { DisplayName: Nullification Pistol Tooltip: ''' @@ -911,12 +911,20 @@ PlanetaryAnnihilation: { PolarisParrotfish: { DisplayName: Polaris Parrotfish - Tooltip: + Tooltip: "[GFB]" + TooltipNormal: ''' - Projectile hits grant buffs to the weapon - Buffs are removed on hit + Rapidly fires an array of colorful star shots that bounce off tiles + However, only two shots can exist at once 'It carries the mark of the Northern Star' ''' + TooltipGFB: + ''' + Rapidly fires an array of colorful star shots that bounce off tiles + However, only two shots can exist at once + Right click to give the little girl some attention + 'She is a happy girl' + ''' } PridefulHuntersPlanarRipper: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 6438ff65c1..4b5ae39bdb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -415,18 +415,6 @@ FeatherKnife: { ''' } -FinalDawn: { - DisplayName: The Final Dawn - Tooltip: - ''' - Attack enemies with a giant scythe swing to replenish stealth - Press up and attack to throw the scythe - Stealth strikes perform a horizontal swing that leaves a lingering fire aura - Stealth strikes performed while pressing up fling yourself at the enemy and slice through them, causing homing fireballs to emerge - 'We shall ride into the sunrise once more' - ''' -} - FishboneBoomerang: { DisplayName: Fishbone Boomerang Tooltip: @@ -1220,6 +1208,18 @@ TheAtomSplitter: { ''' } +TheFinalDawn: { + DisplayName: The Final Dawn + Tooltip: + ''' + Attack enemies with a giant scythe swing to replenish stealth + Press up and attack to throw the scythe + Stealth strikes perform a horizontal swing that leaves a lingering fire aura + Stealth strikes performed while pressing up fling yourself at the enemy and slice through them, causing homing fireballs to emerge + 'We shall ride into the sunrise once more' + ''' +} + TheOldReaper: { DisplayName: The Old Reaper Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index d91c560b7c..55716472e8 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -310,3 +310,9 @@ WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YateveoBloomProj.DisplayName: Yateveo Bloom YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard +DepthCrusherProjectile.DisplayName: Depth Crusher +DepthCrusherSplitProjectile.DisplayName: Depth Crusher Jet +AbyssBladeProjectile.DisplayName: Abyss Blade +AbyssBladeSplitProjectile.DisplayName: Abyss Blade Jet +NeptunesBountyProjectile.DisplayName: Neptune's Bounty +NeptunesBountySplitProjectile.DisplayName: Neptune's Bounty Jet diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 80f1e22303..e056b1579c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -152,7 +152,7 @@ PlanarRipperExplosion.DisplayName: Planar Explosion PlanetaryAnnihilationProj.DisplayName: Planetary Ball PlasmaBlast.DisplayName: Plasma Blast PlasmaExplosion.DisplayName: Plasma Explosion -PolarStar.DisplayName: Polar Star +PolarStar.DisplayName: Star Shot PrecisionBolt.DisplayName: Precision Bolt PressurizedBubbleStream.DisplayName: Pressurized Bubble Stream PrismaticEnergyBlast.DisplayName: Energy Blast diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index a2420dcded..5d0b309674 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -243,6 +243,7 @@ SiriusMinion.DisplayName: Sirius SkeletalDragonChild.DisplayName: Skeletal Child SkeletalDragonMother.DisplayName: Skeletal Mother SlimePuppet.DisplayName: Slime Puppet +StormjawSpark.DisplayName: Spark CannonLaserbeam.DisplayName: Exothermal Deathray ExoskeletonGaussNukeCannon.DisplayName: Gauss Nuke ExoskeletonLaserCannon.DisplayName: Laser Cannon diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 3e3504c607..3aa909314c 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -29,6 +29,12 @@ SetBonus: { } Copper: Increases all damage by 2 + Crimson: + ''' + Greatly increased natural life regen + Life regen is further increased the longer you avoid taking damage + Standing still also greatly amplifies life regen + ''' Eskimo: ''' Multiplies all cold-based debuff damage by 1.25 @@ -111,6 +117,8 @@ SetBonus: { Increases all knockback by 33%, this counts for the above boost Current bonus: {0}% critical strike chance from {1} knockback ''' + MagicHat: Increases maximum mana by 40 + Wizard: 4% increased magic critical strike chance CrystalAssassin: ''' Allows the ability to dash diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 344095e943..73190bd021 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -1982,17 +1982,11 @@ namespace CalamityMod return null; case "LoadParticleInstances": - if (args.Length != 2 || !(args[1] is Mod)) - return new ArgumentNullException("ERROR: Must specify a Mod instance to load particles from."); - - GeneralParticleHandler.LoadModParticleInstances(args[1] as Mod); + CalamityMod.Instance.Logger.Warn("This mod call is deprecated. Calamity automatically registers particles."); return null; case "RegisterModCooldowns": - if (args.Length != 2 || !(args[1] is Mod)) - return new ArgumentNullException("ERROR: Must specify a Mod instance to register cooldowns from."); - - CooldownRegistry.RegisterModCooldowns(args[1] as Mod); + CalamityMod.Instance.Logger.Warn("This mod call is deprecated. Calamity automatically registers cooldowns."); return null; case "GetSummonerNerfDisabledByItem": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 1327f31e92..2847e5187a 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Buffs.Summon; +using CalamityMod.Cooldowns; using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Items.Armor.Vanity; @@ -55,9 +56,11 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; using CalamityMod.NPCs.Yharon; +using CalamityMod.Particles; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Summon.Umbrella; +using CalamityMod.UI; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -139,7 +142,7 @@ namespace CalamityMod /// 17.0 = Lunatic Cultist
/// 18.0 = Moon Lord /// - private static readonly Dictionary BossChecklistProgressionValues = new Dictionary + private static readonly Dictionary BossChecklistProgressionValues = new() { { "DesertScourge", 1.6f }, { "GiantClam", 1.61f }, @@ -188,6 +191,14 @@ namespace CalamityMod FargosSupport(); DialogueTweakSupport(); SummonersAssociationSupport(); + ColoredDamageTypesSupport(); + // done here to assure that all other mods have already loaded so that Calamity can automatically grab any of these types they may have + if (!Main.dedServ) + { + GeneralParticleHandler.LoadModParticleInstances(); + CooldownRegistry.RegisterModCooldowns(); + PopupGUIManager.LoadGUIs(); + } } #region WikiThis @@ -1195,5 +1206,43 @@ namespace CalamityMod }); } #endregion + + #region Colored Damage Types + // These are vanilla Terraria's colors for tooltips and damage + private static Color DefaultTooltipColor = Color.White; + private static Color DefaultDamageColor = new(255, 160, 80); + private static Color DefaultCritColor = new(255, 100, 30); + + // These are Colored Damage Types' colors for the Melee class + private static Color MeleeTooltipColor = new(254, 121, 2); + private static Color MeleeDamageColor = new(254, 121, 2); + private static Color MeleeCritColor = new(253, 62, 3); + + private static Color RogueTooltipColor = new(206, 132, 227); + private static Color RogueDamageColor = new(206, 132, 227); + private static Color RogueCritColor = new(194, 38, 212); + private static Color StealthTooltipColor = RogueTooltipColor; + private static Color StealthDamageColor = new(185, 105, 250); + private static Color StealthCritColor = new(144, 33, 235); + + public static void ColoredDamageTypesSupport() + { + Mod coloredDamageTypes = GetInstance().coloredDamageTypes; + if (coloredDamageTypes is null) + return; + + // Anything that directly uses AverageDamageClass uses the default vanilla colors. + coloredDamageTypes.Call("AddDamageType", AverageDamageClass.Instance, DefaultTooltipColor, DefaultDamageColor, DefaultCritColor); + + // True melee uses the same colorations as regular Melee. + coloredDamageTypes.Call("AddDamageType", TrueMeleeDamageClass.Instance, MeleeTooltipColor, MeleeDamageColor, MeleeCritColor); + coloredDamageTypes.Call("AddDamageType", TrueMeleeNoSpeedDamageClass.Instance, MeleeTooltipColor, MeleeDamageColor, MeleeCritColor); + + // Rogue has its own lavender color. Stealth strikes are hued towards violet so they stick out more. + // They would be hued towards magenta, but that would make them collide with Nebula-colored Magic in Colored Damage Types config. + coloredDamageTypes.Call("AddDamageType", RogueDamageClass.Instance, RogueTooltipColor, RogueDamageColor, RogueCritColor); + coloredDamageTypes.Call("AddDamageType", StealthDamageClass.Instance, StealthTooltipColor, StealthDamageColor, StealthCritColor); + } + #endregion } } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index becbd3b27c..66894c8f17 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -772,7 +772,7 @@ namespace CalamityMod.NPCs ItemID.LaserMachinegun, ItemID.ElectrosphereLauncher, ItemID.InfluxWaver, - ModContent.ItemType() + ModContent.ItemType() }; npcLoot.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, saucerItems)); diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 6a2fc01125..acd80e3091 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +11,9 @@ namespace CalamityMod.NPCs.NormalNPCs { public class Stormlion : ModNPC { + public static readonly SoundStyle IdleSound = new("CalamityMod/Sounds/Custom/StormlionIdle"); + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/StormlionHit"); + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/StormlionDeath"); public override void SetStaticDefaults() { Main.npcFrameCount[NPC.type] = 6; @@ -26,8 +30,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.knockBackResist = 0.2f; AnimationType = NPCID.WalkingAntlion; NPC.value = Item.buyPrice(0, 0, 2, 0); - NPC.HitSound = SoundID.NPCHit31; - NPC.DeathSound = SoundID.NPCDeath34; + NPC.HitSound = HitSound; + NPC.DeathSound = DeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; @@ -45,6 +49,14 @@ namespace CalamityMod.NPCs.NormalNPCs }); } + public override void AI() + { + if (Main.rand.NextBool(800)) + { + SoundEngine.PlaySound(IdleSound, NPC.Center); + } + } + public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index dec418c0c4..0d2ee83cd8 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.TargetClosest(true); } NPC.noTileCollide = false; - bool canAttack = hasBeenHit; + bool canAttack = hasBeenHit || Main.zenithWorld; NPC.TargetClosest(false); if (Main.player[NPC.target].wet && !Main.player[NPC.target].dead && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height) && @@ -129,6 +129,8 @@ namespace CalamityMod.NPCs.SulphurousSea if (canAttack) { NPC.TargetClosest(true); + if (Main.zenithWorld) + NPC.noTileCollide = true; NPC.velocity.X = NPC.velocity.X + (float)NPC.direction * (CalamityWorld.death ? 0.6f : CalamityWorld.revenge ? 0.45f : 0.3f); NPC.velocity.Y = NPC.velocity.Y + (float)NPC.directionY * (CalamityWorld.death ? 0.2f : CalamityWorld.revenge ? 0.15f : 0.1f); float velocityX = CalamityWorld.death ? 20f : CalamityWorld.revenge ? 15f : 10f; @@ -286,7 +288,7 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.netUpdate = true; } } - NPC.velocity.Y = NPC.velocity.Y + 0.55f; + NPC.velocity.Y = NPC.velocity.Y + (Main.zenithWorld ? 0.5f : 0.55f); // Lets them jump up walls infinitely in GFB if (NPC.velocity.Y > 10f) { NPC.velocity.Y = 10f; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index ad2d2f192f..b00bbbe122 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2929,7 +2929,7 @@ namespace CalamityMod.NPCs.Yharon ModContent.ItemType(), ModContent.ItemType(), // Yharon Kindle Staff ModContent.ItemType(), // Infernal Spear - ModContent.ItemType(), + ModContent.ItemType(), }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); normalOnly.Add(ModContent.ItemType(), 10); diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 6c340cebe1..85bfb1c6c4 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -26,23 +26,26 @@ namespace CalamityMod.Particles private static List batchedNonPremultipliedParticles; private static List batchedAdditiveBlendParticles; - public static void LoadModParticleInstances(Mod mod) + public static void LoadModParticleInstances() { Type baseParticleType = typeof(Particle); - foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) + foreach (Mod mod in ModLoader.Mods) { - if (type.IsSubclassOf(baseParticleType) && !type.IsAbstract && type != baseParticleType) + foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) { - int ID = particleTypes.Count; //Get the ID of the particle - particleTypes[type] = ID; + if (type.IsSubclassOf(baseParticleType) && !type.IsAbstract && type != baseParticleType) + { + int ID = particleTypes.Count; //Get the ID of the particle + particleTypes[type] = ID; - Particle instance = (Particle)FormatterServices.GetUninitializedObject(type); - particleInstances.Add(instance); + Particle instance = (Particle)FormatterServices.GetUninitializedObject(type); + particleInstances.Add(instance); - string texturePath = type.Namespace.Replace('.', '/') + "/" + type.Name; - if (instance.Texture != "") - texturePath = instance.Texture; - particleTextures[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; + string texturePath = type.Namespace.Replace('.', '/') + "/" + type.Name; + if (instance.Texture != "") + texturePath = instance.Texture; + particleTextures[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; + } } } } @@ -58,8 +61,6 @@ namespace CalamityMod.Particles batchedAlphaBlendParticles = new List(); batchedNonPremultipliedParticles = new List(); batchedAdditiveBlendParticles = new List(); - - LoadModParticleInstances(CalamityMod.Instance); } internal static void Unload() diff --git a/Particles/PointParticle.cs b/Particles/PointParticle.cs new file mode 100644 index 0000000000..5fa4a399de --- /dev/null +++ b/Particles/PointParticle.cs @@ -0,0 +1,53 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class PointParticle : Particle + { + public Color InitialColor; + public bool AffectedByGravity; + public bool UseAltVisual = true; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + public override bool UseAdditiveBlend => UseAltVisual; + + public override string Texture => "CalamityMod/Particles/PointParticle"; + + public PointParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, bool AddativeBlend = true) + { + Position = relativePosition; + Velocity = velocity; + AffectedByGravity = affectedByGravity; + Scale = scale; + Lifetime = lifetime; + Color = InitialColor = color; + UseAltVisual = AddativeBlend; + } + + public override void Update() + { + Scale *= 0.95f; + Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + Velocity *= 0.95f; + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + Rotation = Velocity.ToRotation() + MathHelper.PiOver2; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Vector2 scale = new Vector2(0.5f, 1.6f) * Scale; + Texture2D texture = ModContent.Request(Texture).Value; + + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.45f, 1f), 0, 0f); + } + } +} diff --git a/Particles/PointParticle.png b/Particles/PointParticle.png new file mode 100644 index 0000000000..6769438ea2 Binary files /dev/null and b/Particles/PointParticle.png differ diff --git a/Particles/WaterFlavored.png b/Particles/WaterFlavored.png new file mode 100644 index 0000000000..6059e0e6e3 Binary files /dev/null and b/Particles/WaterFlavored.png differ diff --git a/Particles/WaterFlavoredParticle.cs b/Particles/WaterFlavoredParticle.cs new file mode 100644 index 0000000000..9923ea9156 --- /dev/null +++ b/Particles/WaterFlavoredParticle.cs @@ -0,0 +1,51 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class WaterFlavoredParticle : Particle + { + public Color InitialColor; + public bool AffectedByGravity; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + public override bool UseAdditiveBlend => false; + + public override string Texture => "CalamityMod/Particles/WaterFlavored"; + + public WaterFlavoredParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color) + { + Position = relativePosition; + Velocity = velocity; + AffectedByGravity = affectedByGravity; + Scale = scale; + Lifetime = lifetime; + Color = InitialColor = color; + } + + public override void Update() + { + Scale *= 0.93f; + Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + Velocity *= 0.95f; + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + Rotation = Velocity.ToRotation() + MathHelper.PiOver2; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Vector2 scale = new Vector2(0.65f, 1f) * Scale; + Texture2D texture = ModContent.Request(Texture).Value; + + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.45f, 1f), 0, 0f); + } + } +} diff --git a/Projectiles/Magic/Asteroid.cs b/Projectiles/Magic/Asteroid.cs index 18011bb5ab..151ec686f5 100644 --- a/Projectiles/Magic/Asteroid.cs +++ b/Projectiles/Magic/Asteroid.cs @@ -112,11 +112,6 @@ namespace CalamityMod.Projectiles.Magic } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 2; - } - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); diff --git a/Projectiles/Magic/VeeringWindAirWave.cs b/Projectiles/Magic/VeeringWindAirWave.cs index c247a336ef..6708b7ebee 100644 --- a/Projectiles/Magic/VeeringWindAirWave.cs +++ b/Projectiles/Magic/VeeringWindAirWave.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = Projectile.height = 48; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; + Projectile.penetrate = 2; Projectile.extraUpdates = 1; Projectile.timeLeft = 45; Projectile.DamageType = DamageClass.Magic; @@ -37,6 +37,14 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 0.3f); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.5); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override bool PreDraw(ref Color lightColor) // Photoviscerator ball drawcode, slightly edited. { Texture2D lightTexture = ModContent.Request(Texture).Value; diff --git a/Projectiles/Magic/VeeringWindFrostWave.cs b/Projectiles/Magic/VeeringWindFrostWave.cs index 63232c64ff..5ca64bda1c 100644 --- a/Projectiles/Magic/VeeringWindFrostWave.cs +++ b/Projectiles/Magic/VeeringWindFrostWave.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = Projectile.height = 48; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; + Projectile.penetrate = 2; Projectile.timeLeft = 90; Projectile.DamageType = DamageClass.Magic; Projectile.usesIDStaticNPCImmunity = true; @@ -37,6 +37,14 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, Color.Blue.ToVector3() * 0.6f); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.5); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override bool PreDraw(ref Color lightColor) // Photoviscerator ball drawcode, slightly edited. { Texture2D lightTexture = ModContent.Request(Texture).Value; diff --git a/Projectiles/Melee/AbyssBladeProjectile.cs b/Projectiles/Melee/AbyssBladeProjectile.cs new file mode 100644 index 0000000000..a70c106524 --- /dev/null +++ b/Projectiles/Melee/AbyssBladeProjectile.cs @@ -0,0 +1,249 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Ranged; +using Humanizer; +using Microsoft.CodeAnalysis; +using Microsoft.Xna.Framework; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Projectiles.Melee +{ + public class AbyssBladeProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Items/Weapons/Melee/AbyssBlade"; + + public int Time = 0; + public int ChargeupTime = 25; + public int Lifetime = 300; + public int startDamage; + public bool setDamage = false; + public int dustType1 = 104; + public int dustType2 = 29; + public bool spinMode = true; + public Vector2 NPCDestination = new Vector2 (0, 0); + public float OverallProgress => 1 - Projectile.timeLeft / (float)Lifetime; + public float ThrowProgress => 1 - Projectile.timeLeft / (float)(Lifetime); + public float ChargeProgress => 1 - (Projectile.timeLeft - Lifetime) / (float)(ChargeupTime); + + public Player Owner => Main.player[Projectile.owner]; + public SlotId SpinSoundSlot; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 80; + Projectile.height = 80; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = Lifetime + ChargeupTime; + Projectile.DamageType = DamageClass.Melee; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + + public override bool ShouldUpdatePosition() + { + return ChargeProgress >= 1; + } + + public override bool? CanDamage() + { + //We don't want the anticipation to deal damage. + if (ChargeProgress < 1) + return false; + + return base.CanDamage(); + } + + //Swing animation keys + public CurveSegment pullback = new CurveSegment(EasingType.PolyOut, 0f, 0f, MathHelper.PiOver4 * -1.2f, 2); + public CurveSegment throwout = new CurveSegment(EasingType.PolyOut, 0.7f, MathHelper.PiOver4 * -1.2f, MathHelper.PiOver4 * 1.2f + MathHelper.PiOver2, 3); + internal float ArmAnticipationMovement() => PiecewiseAnimation(ChargeProgress, new CurveSegment[] { pullback, throwout }); + + public override void AI() + { + if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound) && SpinSound.IsPlaying) + SpinSound.Position = Projectile.Center; + + float playerDist = Vector2.Distance(Owner.Center, Projectile.Center); + + Time++; + Projectile.spriteDirection = Projectile.direction; + Vector3 Light = new Vector3(0.070f, 0.070f, 0.250f); + Lighting.AddLight(Projectile.Center, Light * 3); + + //Anticipation animation. Make the player look like theyre holding the depth crusher + if (ChargeProgress < 1) + { + Owner.ChangeDir(MathF.Sign(Main.MouseWorld.X - Owner.Center.X)); + + float armRotation = ArmAnticipationMovement() * Owner.direction; + + Owner.heldProj = Projectile.whoAmI; + Projectile.spriteDirection = Owner.direction; + Projectile.direction = Owner.direction; + + Projectile.Center = Owner.MountedCenter + Vector2.UnitY.RotatedBy(armRotation * Owner.gravDir) * -55f * Owner.gravDir; + Projectile.rotation = (-MathHelper.PiOver4 * Projectile.direction + armRotation) * Owner.gravDir; + + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, MathHelper.Pi + armRotation); + + return; + } + + //Play the throw sound when the throw ACTUALLY BEGINS. + //Additionally, make the projectile collide and set its speed and velocity + if (Projectile.timeLeft == Lifetime) + { + Projectile.netUpdate = true; + SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); + Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f; + Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 20; + startDamage = Projectile.damage; + Projectile.spriteDirection = Projectile.direction; + SpinSoundSlot = SoundEngine.PlaySound(AbyssBlade.SpinSound, Projectile.Center); + Time = 0; + } + + if (Projectile.velocity.X > 0) + Projectile.direction = 1; + else + Projectile.direction = -1; + + if (spinMode) + { + Projectile.rotation += (0.9f * (MathF.Abs(Projectile.velocity.Y) * 0.03f + 0.85f)) * Projectile.direction; + Projectile.spriteDirection = Projectile.direction; + + if (Projectile.velocity.Y < 25) + Projectile.velocity.Y += 0.42f; + + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.975f; + + Vector2 particlePosition = Projectile.Center + new Vector2(13.5f * Projectile.direction, 0) + Projectile.velocity * 0.5f; + if (Time % 3 == 0) + { + Particle Smear = new CircularSmearVFX(particlePosition, Color.DeepSkyBlue * Main.rand.NextFloat(0.78f, 0.85f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(0.8f, 0.9f)); + GeneralParticleHandler.SpawnParticle(Smear); + } + for (int i = 0; i < 2; i++) + { + Vector2 dustPos = Projectile.Center + (i * MathHelper.Pi + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 40f; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2, (i * MathHelper.Pi + Projectile.rotation * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * 3f); + dust.noGravity = true; + dust.scale = 1.8f; + } + + if (Collision.SolidCollision(Projectile.Center, 10, 10) && Time >= 2) + { + Projectile.extraUpdates = 2; + Projectile.rotation = 0; + spinMode = false; + SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/CeramicImpact", 2) { Volume = 0.65f, PitchVariance = 0.3f}, Projectile.Center); + for (int i = 0; i < 3; i++) + { + GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.DodgerBlue, Color.MediumBlue, Main.rand.NextFloat(2.5f, 2.9f) - i * 0.55f, 14, Main.rand.NextFloat(-0.01f, 0.01f), 2.5f); + GeneralParticleHandler.SpawnParticle(sparker); + } + Projectile.penetrate = 1; + Projectile.damage = (int)(startDamage * 2); // Launched blade deals 200% damage + Time = 0; + + bool foundTarget = false; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false)) + NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f; + + if (NPCDestination == new Vector2(0, 0)) + foundTarget = false; + else + foundTarget = true; + } + + if (!foundTarget) + { + Projectile.velocity = (-Projectile.velocity).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25; + } + else + { + Projectile.velocity = (NPCDestination - Projectile.Center).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25; + } + + for (int i = 0; i < 6; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, ((Projectile.velocity).SafeNormalize(Vector2.UnitX * Projectile.direction) * 5).RotatedByRandom(0.75f) * Main.rand.NextFloat(1.4f, 2.2f), ModContent.ProjectileType(), (int)(startDamage * 0.3), Projectile.knockBack / 4, Projectile.owner); + } + } + } + else + { + SpinSound?.Stop(); + + Projectile.rotation = (Projectile.velocity.ToRotation() + MathHelper.PiOver4 * (Projectile.direction == 1 ? 1 : 3)); + + if (Time > 9) + { + for (int i = 0; i < 6; i++) + { + Vector2 dustPos = Projectile.Center - Projectile.velocity * 3 + Main.rand.NextVector2Circular(15, 15); + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType2 : dustType1); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.3f, 1.6f); + dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.7f); + } + } + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 180); + SoundStyle HitSound = new("CalamityMod/Sounds/Custom/AbyssGravelMine2") { Volume = 0.7f, PitchVariance = 0.3f }; + if (!spinMode) + { + SoundEngine.PlaySound(HitSound, Projectile.Center); + for (int i = 0; i < 30; i++) + { + Vector2 dustPos = Projectile.Center; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.1f, 1.8f); + dust.velocity = new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.7f); + } + } + } + + public override void OnKill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound)) + SpinSound?.Stop(); + + for (int i = 0; i < 40; i++) + { + float dustMulti = Main.rand.NextFloat(0.3f, 1.5f); + Vector2 dustPos = Projectile.Center; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.6f, 2.5f) - dustMulti; + dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f) * dustMulti; + } + } + } +} diff --git a/Projectiles/Melee/AbyssBladeSplitProjectile.cs b/Projectiles/Melee/AbyssBladeSplitProjectile.cs new file mode 100644 index 0000000000..bd533f5fbe --- /dev/null +++ b/Projectiles/Melee/AbyssBladeSplitProjectile.cs @@ -0,0 +1,77 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.SupremeCalamitas; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class AbyssBladeSplitProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public int Time = 0; + public int randTimer; + public int dustType1 = 104; + public int dustType2 = 29; + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.tileCollide = false; + Projectile.penetrate = 1; + Projectile.timeLeft = 240; + Projectile.ignoreWater = true; + } + + public override void AI() + { + Time++; + if (Time == 1) + { + randTimer = Main.rand.Next(240, 301); + Projectile.timeLeft = randTimer; + } + if (Time > 20 && Time < (randTimer - 70)) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 350f, MathHelper.Clamp(1f + Time * 0.075f, 1, 10), 20f); + } + else if (Time >= (randTimer - 70)) + { + if (Projectile.velocity.Y < 10) + Projectile.velocity.Y += 0.4f; + Projectile.velocity.X *= 0.97f; + } + if (Time % 2 == 0) + { + Color smokeColor = Color.MediumBlue; + Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), smokeColor, 30, Main.rand.NextFloat(0.45f, 0.6f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + for (int i = 0; i < 3; i++) + { + Vector2 dustPos = Projectile.Center; + int dustType = Main.rand.NextBool(3) ? dustType1 : dustType2; + Dust dust = Dust.NewDustPerfect(dustPos, dustType); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.95f, 1.7f); + dust.velocity = new Vector2(0.5f, 0.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.1f); + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + + SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.35f }, Projectile.Center); + } + } +} diff --git a/Projectiles/Melee/DepthCrusherProjectile.cs b/Projectiles/Melee/DepthCrusherProjectile.cs new file mode 100644 index 0000000000..0d407cb828 --- /dev/null +++ b/Projectiles/Melee/DepthCrusherProjectile.cs @@ -0,0 +1,206 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Ranged; +using Humanizer; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Projectiles.Melee +{ + public class DepthCrusherProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Items/Weapons/Melee/DepthCrusher"; + + public int ChargeupTime = 25; + public int Lifetime = 255; + public int startDamage; + public bool setDamage = false; + public int dustType1 = 104; + public int dustType2 = 96; + public float OverallProgress => 1 - Projectile.timeLeft / (float)Lifetime; + public float ThrowProgress => 1 - Projectile.timeLeft / (float)(Lifetime); + public float ChargeProgress => 1 - (Projectile.timeLeft - Lifetime) / (float)(ChargeupTime); + + public Player Owner => Main.player[Projectile.owner]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 50; + Projectile.height = 50; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = Lifetime + ChargeupTime; + Projectile.DamageType = DamageClass.Melee; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; + } + + public override bool ShouldUpdatePosition() + { + return ChargeProgress >= 1; + } + + public override bool? CanDamage() + { + //We don't want the anticipation to deal damage. + if (ChargeProgress < 1) + return false; + + return base.CanDamage(); + } + + //Swing animation keys + public CurveSegment pullback = new CurveSegment(EasingType.PolyOut, 0f, 0f, MathHelper.PiOver4 * -1.2f, 2); + public CurveSegment throwout = new CurveSegment(EasingType.PolyOut, 0.7f, MathHelper.PiOver4 * -1.2f, MathHelper.PiOver4 * 1.2f + MathHelper.PiOver2, 3); + internal float ArmAnticipationMovement() => PiecewiseAnimation(ChargeProgress, new CurveSegment[] { pullback, throwout }); + + public override void AI() + { + Projectile.spriteDirection = Projectile.direction; + Vector3 Light = new Vector3(0.050f, 0.050f, 0.250f); + Lighting.AddLight(Projectile.Center, Light * 2); + + //Anticipation animation. Make the player look like theyre holding the depth crusher + if (ChargeProgress < 1) + { + Owner.ChangeDir(MathF.Sign(Main.MouseWorld.X - Owner.Center.X)); + + float armRotation = ArmAnticipationMovement() * Owner.direction; + + Owner.heldProj = Projectile.whoAmI; + + Projectile.Center = Owner.MountedCenter + Vector2.UnitY.RotatedBy(armRotation * Owner.gravDir) * -45f * Owner.gravDir; + Projectile.rotation = (-MathHelper.PiOver4 * Projectile.direction + armRotation) * Owner.gravDir; + + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, MathHelper.Pi + armRotation); + + return; + } + + //Play the throw sound when the throw ACTUALLY BEGINS. + //Additionally, make the projectile collide and set its speed and velocity + if (Projectile.timeLeft == Lifetime) + { + Projectile.netUpdate = true; + SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); + Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f; + Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 15; + startDamage = Projectile.damage; + Projectile.spriteDirection = Projectile.direction; + } + + Projectile.rotation += (0.4f * (MathF.Abs(Projectile.velocity.Y) * 0.2f + 0.6f)) * Projectile.direction; + if (Projectile.velocity.Y < 20) + Projectile.velocity.Y += Projectile.numHits >= 3 ? 0.7f : 0.4f; + if (Projectile.numHits >= 3) + { + Projectile.penetrate = -1; + if (!setDamage) + { + Projectile.damage = (int)(Projectile.damage * 0.2f); + setDamage = true; + } + } + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.975f; + + if (Collision.SolidCollision(Projectile.Center, 15, 15)) + { + Projectile.tileCollide = true; + } + else + Projectile.tileCollide = false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.timeLeft = 240; + if (!setDamage) + { + if (Projectile.velocity.Y > 0) + Projectile.velocity.Y = -9; + else + Projectile.velocity.Y = -7; + } + + for (int i = 0; i < 15; i++) + { + Vector2 dustPos = Projectile.Center; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.5f, 1.1f); + dust.velocity = new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.5f); + } + } + + public override void OnKill(int timeLeft) + { + for (int i = 0; i < 40; i++) + { + float dustMulti = Main.rand.NextFloat(0.3f, 1.5f); + Vector2 dustPos = Projectile.Center; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.6f, 2.5f) - dustMulti; + dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f) * dustMulti; + } + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + SoundStyle HitSound = new("CalamityMod/Sounds/Custom/AbyssGravelMine2") { Volume = 0.6f, PitchVariance = 0.3f }; + + Projectile.timeLeft = 240; + if (Projectile.numHits < 3) + { + Projectile.numHits++; + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0, -5).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), startDamage / 4, Projectile.knockBack / 4, Projectile.owner); + + if (Projectile.velocity.X != oldVelocity.X) + { + Projectile.velocity.X = -oldVelocity.X * 0.8f; + } + if (Projectile.velocity.Y != oldVelocity.Y) + { + Projectile.velocity.Y = -oldVelocity.Y * 0.8f; + } + SoundEngine.PlaySound(HitSound with { Pitch = 0.15f }, Projectile.Center); + for (int i = 0; i < 25; i++) + { + float dustMulti = Main.rand.NextFloat(0.3f, 1.5f); + Vector2 dustPos = Projectile.Center; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.6f, 2.5f) - dustMulti; + dust.velocity = new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f) * dustMulti; + } + } + else + { + SoundEngine.PlaySound(HitSound, Projectile.Center); + for (int i = 0; i < 3; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0, -5).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), startDamage / 4, Projectile.knockBack / 4, Projectile.owner); + } + Projectile.Kill(); + } + + return false; + } + } +} diff --git a/Projectiles/Melee/DepthCrusherSplitProjectile.cs b/Projectiles/Melee/DepthCrusherSplitProjectile.cs new file mode 100644 index 0000000000..5c2b6ef338 --- /dev/null +++ b/Projectiles/Melee/DepthCrusherSplitProjectile.cs @@ -0,0 +1,77 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.SupremeCalamitas; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class DepthCrusherSplitProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public int Time = 0; + public int randTimer; + public int dustType1 = 104; + public int dustType2 = 96; + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.tileCollide = false; + Projectile.penetrate = 1; + Projectile.timeLeft = 240; + Projectile.ignoreWater = true; + } + + public override void AI() + { + Time++; + if (Time == 1) + { + randTimer = Main.rand.Next(200, 261); + Projectile.timeLeft = randTimer; + } + if (Time > 20 && Time < (randTimer - 70)) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 280f, MathHelper.Clamp(1f + Time * 0.06f, 1, 10), 20f); + } + else if (Time >= (randTimer - 70)) + { + if (Projectile.velocity.Y < 10) + Projectile.velocity.Y += 0.4f; + Projectile.velocity.X *= 0.97f; + } + if (Time % 2 == 0) + { + Color smokeColor = Color.MediumBlue; + Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), smokeColor, 30, Main.rand.NextFloat(0.35f, 0.5f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + for (int i = 0; i < 3; i++) + { + Vector2 dustPos = Projectile.Center; + int dustType = Main.rand.NextBool(3) ? dustType1 : dustType2; + Dust dust = Dust.NewDustPerfect(dustPos, dustType); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 1.5f); + dust.velocity = new Vector2(0.5f, 0.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.1f); + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 180); + + SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.35f }, Projectile.Center); + } + } +} diff --git a/Projectiles/Melee/NeptuneOrb.cs b/Projectiles/Melee/NeptuneOrb.cs deleted file mode 100644 index bd0cb4164d..0000000000 --- a/Projectiles/Melee/NeptuneOrb.cs +++ /dev/null @@ -1,96 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; - -namespace CalamityMod.Projectiles.Melee -{ - public class NeptuneOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/Melee/DepthOrb"; - - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 20; - Projectile.aiStyle = ProjAIStyleID.Beam; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; - Projectile.ignoreWater = true; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0f, 0f, 1f); - if (Projectile.timeLeft % 20 == 19 && Projectile.owner == Main.myPlayer) - { - int splitDamage = Projectile.damage / 2; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 15f, ModContent.ProjectileType(), splitDamage, Projectile.knockBack, Projectile.owner, 0f, 0f); - } - int waterDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 0.4f); - Main.dust[waterDust].noGravity = true; - Main.dust[waterDust].velocity *= 0.5f; - Main.dust[waterDust].velocity += Projectile.velocity * 0.1f; - } - - public override bool PreDraw(ref Color lightColor) - { - if (Projectile.timeLeft > 295) - return false; - - Texture2D tex = ModContent.Request(Texture).Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(50, 50, 255, Projectile.alpha); - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item10, Projectile.position); - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 64; - Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - for (int dustIndex = 0; dustIndex <= 30; dustIndex++) - { - float rando1 = (float)Main.rand.Next(-10, 11); - float rando2 = (float)Main.rand.Next(-10, 11); - float rando3 = (float)Main.rand.Next(3, 9); - float randoAdjuster = (float)Math.Sqrt((double)(rando1 * rando1 + rando2 * rando2)); - randoAdjuster = rando3 / randoAdjuster; - rando1 *= randoAdjuster; - rando2 *= randoAdjuster; - int killWatery = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 1.2f); - Dust dust = Main.dust[killWatery]; - dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rando1; - dust.velocity.Y = rando2; - } - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - } -} diff --git a/Projectiles/Melee/NeptunesBountyProjectile.cs b/Projectiles/Melee/NeptunesBountyProjectile.cs new file mode 100644 index 0000000000..bb0d6caeb4 --- /dev/null +++ b/Projectiles/Melee/NeptunesBountyProjectile.cs @@ -0,0 +1,309 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using ReLogic.Utilities; +using static CalamityMod.CalamityUtils; +using CalamityMod.Buffs.StatBuffs; + +namespace CalamityMod.Projectiles.Melee +{ + public class NeptunesBountyProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Items/Weapons/Melee/NeptunesBounty"; + + public int Time = 0; + public int ChargeupTime = 25; + public int Lifetime = 300; + public int startDamage; + public bool setDamage = false; + public int dustType1 = 103; + public int dustType2 = 172; + public bool spinMode = false; // Initial spinning + public bool spinMode2 = false; // After falling happens spin effect + public Vector2 NPCDestination = new Vector2(0, 0); + public float OverallProgress => 1 - Projectile.timeLeft / (float)Lifetime; + public float ThrowProgress => 1 - Projectile.timeLeft / (float)(Lifetime); + public float ChargeProgress => 1 - (Projectile.timeLeft - Lifetime) / (float)(ChargeupTime); + + public Player Owner => Main.player[Projectile.owner]; + public SlotId SpinSoundSlot; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 135; + Projectile.height = 135; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = Lifetime + ChargeupTime; + Projectile.DamageType = DamageClass.Melee; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override bool ShouldUpdatePosition() + { + return ChargeProgress >= 1; + } + + public override bool? CanDamage() + { + //We don't want the anticipation to deal damage. + if (ChargeProgress < 1) + return false; + + return base.CanDamage(); + } + + //Swing animation keys + public CurveSegment pullback = new CurveSegment(EasingType.PolyOut, 0f, 0f, MathHelper.PiOver4 * -1.2f, 2); + public CurveSegment throwout = new CurveSegment(EasingType.PolyOut, 0.7f, MathHelper.PiOver4 * -1.2f, MathHelper.PiOver4 * 1.2f + MathHelper.PiOver2, 3); + internal float ArmAnticipationMovement() => PiecewiseAnimation(ChargeProgress, new CurveSegment[] { pullback, throwout }); + + public override void AI() + { + if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound) && SpinSound.IsPlaying) + SpinSound.Position = Projectile.Center; + + float playerDist = Vector2.Distance(Owner.Center, Projectile.Center); + + Time++; + Projectile.spriteDirection = Projectile.direction; + Vector3 Light = spinMode2 ? new Vector3(0.200f, 0.200f, 0.255f) : new Vector3(0.070f, 0.070f, 0.250f); + Lighting.AddLight(Projectile.Center, Light * 4); + + //Anticipation animation. Make the player look like theyre holding the depth crusher + if (ChargeProgress < 1) + { + Owner.ChangeDir(MathF.Sign(Main.MouseWorld.X - Owner.Center.X)); + + float armRotation = ArmAnticipationMovement() * Owner.direction; + + Owner.heldProj = Projectile.whoAmI; + Projectile.spriteDirection = Owner.direction; + Projectile.direction = Owner.direction; + + Projectile.Center = Owner.MountedCenter + Vector2.UnitY.RotatedBy(armRotation * Owner.gravDir) * -90f * Owner.gravDir + new Vector2(Owner.direction == 1 ? 10 : 3, 0); + Projectile.rotation = (-MathHelper.PiOver4 * Projectile.direction + armRotation) * Owner.gravDir; + + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, MathHelper.Pi + armRotation); + + return; + } + + //Play the throw sound when the throw ACTUALLY BEGINS. + //Additionally, make the projectile collide and set its speed and velocity + if (Projectile.timeLeft == Lifetime) + { + Projectile.netUpdate = true; + SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); + Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f; + Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 28; + startDamage = Projectile.damage; + Projectile.spriteDirection = Projectile.direction; + SpinSoundSlot = SoundEngine.PlaySound(NeptunesBounty.SpinSound, Projectile.Center); + Time = 0; + spinMode = true; + } + + if (Projectile.velocity.X > 0) + Projectile.direction = 1; + else + Projectile.direction = -1; + + if (Time >= 75 && !spinMode2 && Projectile.velocity.Y >= 22) + { + Projectile.extraUpdates = 3; + + SoundEngine.PlaySound(new("CalamityMod/Sounds/Item/VividClarityBeamAppear") { Volume = 0.65f, PitchVariance = 0.3f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.15f }, Projectile.Center); + + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.01f, 0.9f, 22); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DodgerBlue, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.01f, 0.83f, 15); + GeneralParticleHandler.SpawnParticle(pulse2); + + Projectile.damage = (int)(startDamage * 2); // Deals 200% damage after launching + Time = 0; + + bool foundTarget = false; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false)) + NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f; + + if (NPCDestination == new Vector2(0, 0)) + foundTarget = false; + else + foundTarget = true; + } + + if (!foundTarget) + { + Projectile.velocity = (-Projectile.velocity).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25; + } + else + { + Projectile.velocity = (NPCDestination - Projectile.Center).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25; + } + + SpinSound?.Stop(); + + spinMode2 = true; + } + + if (spinMode) + { + if (!spinMode2) + { + if (Projectile.velocity.Y < 22) + Projectile.velocity.Y += 0.42f; + + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.975f; + + Vector2 particlePosition = Projectile.Center + new Vector2(13.5f * Projectile.direction, 0) + Projectile.velocity * 0.5f; + if (Time % 3 == 0) + { + Particle Smear = new CircularSmearVFX(particlePosition, Color.DeepSkyBlue * Main.rand.NextFloat(0.78f, 0.85f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(1.2f, 1.3f)); + GeneralParticleHandler.SpawnParticle(Smear); + } + + if (playerDist < 1400f) + { + for (int i = 0; i < 2; i++) + { + Vector2 linePos = Projectile.Center + (i * MathHelper.Pi + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 75f; + SparkleParticle spark = new SparkleParticle(linePos, (i * MathHelper.Pi + Projectile.rotation * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * Main.rand.NextFloat(5f, 12f), Color.DodgerBlue * 0.35f, Color.DarkBlue * 0.75f, Main.rand.NextFloat(0.15f, 0.4f), Main.rand.Next(7, 16), Main.rand.NextFloat(-8, 8), 0.2f, false); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + if (Time % 7 == 0) + { + Vector2 velDirection = new Vector2(80, 80).RotatedByRandom(100); + Vector2 location = Projectile.Center + velDirection; + Vector2 velocity; + bool foundTarget = false; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false)) + NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f; + + if (NPCDestination == new Vector2(0, 0)) + foundTarget = false; + else + foundTarget = true; + } + + if (!foundTarget) + { + velocity = velDirection.SafeNormalize(Vector2.UnitX * Projectile.direction) * 25; + } + else + { + velocity = (NPCDestination - location).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25; + } + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), location, velocity, ModContent.ProjectileType(), startDamage / 6, Projectile.knockBack / 4, Projectile.owner); + } + + } + else + { + if (Time == 1) + SpinSoundSlot = SoundEngine.PlaySound(NeptunesBounty.SpinSound with { Pitch = 0.2f }, Projectile.Center); + + Vector2 particlePosition2 = Projectile.Center + new Vector2(13.5f * Projectile.direction, 0) + Projectile.velocity * 0.5f; + if (Time % 2 == 0) + { + Particle Smear2 = new CircularSmearVFX(particlePosition2, Color.Aqua * Main.rand.NextFloat(0.78f, 0.85f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(1.2f, 1.3f)); + GeneralParticleHandler.SpawnParticle(Smear2); + } + + if (playerDist < 1400f) + { + for (int i = 0; i < 2; i++) + { + Vector2 linePos = Projectile.Center + (i * MathHelper.Pi + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 75f; + SparkleParticle spark = new SparkleParticle(linePos, (i * MathHelper.Pi + Projectile.rotation * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * Main.rand.NextFloat(5f, 12f), Color.Aqua * 0.35f, Color.DodgerBlue * 0.75f, Main.rand.NextFloat(0.15f, 0.4f), Main.rand.Next(7, 16), Main.rand.NextFloat(-8, 8), 0.2f, false); + GeneralParticleHandler.SpawnParticle(spark); + } + } + } + + Projectile.spriteDirection = Projectile.direction; + + Projectile.rotation += (0.9f * (MathF.Abs(Projectile.velocity.Y) * 0.03f + 0.85f)) * Projectile.direction; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + + SoundStyle HitSound = new("CalamityMod/Sounds/Item/SarosDiskThrow", 3) { Volume = 0.55f, Pitch = -0.8f }; + if (spinMode2) + { + for (int i = 0; i < 4; i++) + { + AltSparkParticle spark = new AltSparkParticle(target.Center, (Projectile.velocity * 0.1f) * (i + 1), false, 15, 4f - i * 0.35f, Color.Aqua * 0.25f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i < 4; i++) + { + AltSparkParticle spark = new AltSparkParticle(target.Center, (-Projectile.velocity * 0.15f) * (i + 1), false, 15, 4f - i * 0.6f, Color.Aqua * 0.25f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i <= 20; i++) + { + Dust dust = Dust.NewDustPerfect(target.Center + Main.rand.NextVector2Circular(9, 9), Main.rand.NextBool() ? 307 : 180, Projectile.velocity * Main.rand.NextFloat(0.1f, 1.2f), 0, default, Main.rand.NextFloat(0.9f, 1.45f)); + dust.noGravity = true; + Dust dust2 = Dust.NewDustPerfect(target.Center + Main.rand.NextVector2Circular(9, 9), Main.rand.NextBool() ? 307 : 180, -Projectile.velocity * Main.rand.NextFloat(0.1f, 1.2f), 0, default, Main.rand.NextFloat(0.9f, 1.45f)); + dust2.noGravity = true; + } + SoundEngine.PlaySound(HitSound, Projectile.Center); + SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.65f, Pitch = -0.5f }, Projectile.Center); + } + } + + public override void OnKill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound)) + SpinSound?.Stop(); + + for (int i = 0; i < 40; i++) + { + float dustMulti = Main.rand.NextFloat(0.3f, 1.5f); + Vector2 dustPos = Projectile.Center; + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.6f, 2.5f) - dustMulti; + dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f) * dustMulti; + } + } + public override bool PreDraw(ref Color lightColor) + { + if (spinMode2) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Aqua * 0.6f, 1); + } + return true; + } + } +} diff --git a/Projectiles/Melee/NeptunesBountySplitProjectile.cs b/Projectiles/Melee/NeptunesBountySplitProjectile.cs new file mode 100644 index 0000000000..03020aafaa --- /dev/null +++ b/Projectiles/Melee/NeptunesBountySplitProjectile.cs @@ -0,0 +1,84 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.SupremeCalamitas; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class NeptunesBountySplitProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public int Time = 0; + public int randTimer; + public int dustType1 = 80; + public int dustType2 = 172; + public int spreadDust = 0; + public Color WaterColor = Main.rand.NextBool() ? Color.DodgerBlue : Color.DeepSkyBlue; + public Player Owner => Main.player[Projectile.owner]; + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 20; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 110; + Projectile.ignoreWater = true; + Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + float playerDist = Vector2.Distance(Owner.Center, Projectile.Center); + + Time++; + Projectile.velocity *= 0.988f; + + if (Projectile.timeLeft % 2 == 0 && Time > 3f && playerDist < 1400f) + { + Color smokeColor = Color.RoyalBlue; + Particle smoke = new HeavySmokeParticle(Projectile.Center - Projectile.velocity, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), smokeColor * 0.65f, 15, Main.rand.NextFloat(0.4f, 0.55f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(3 + spreadDust, 3 + spreadDust), Main.rand.NextBool(3) ? dustType1 : dustType2, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.65f), 0, default, Main.rand.NextFloat(0.4f, 1.2f) + Time * 0.009f); + dust.noGravity = true; + if (dust.type == dustType1) + dust.alpha = 180; + + if (Projectile.timeLeft == 20) + { + WaterFlavoredParticle spark = new WaterFlavoredParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 25, 0.85f + Time * 0.013f, WaterColor * 0.35f); + GeneralParticleHandler.SpawnParticle(spark); + } + else if (Projectile.timeLeft > 20) + { + WaterFlavoredParticle spark = new WaterFlavoredParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 2, 0.85f + Time * 0.013f, WaterColor * 0.35f); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Projectile.timeLeft < 20) + { + Time -= 5; + spreadDust += 2; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 240); + + SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.35f }, Projectile.Center); + } + } +} diff --git a/Projectiles/Melee/TumbleweedRolling.cs b/Projectiles/Melee/TumbleweedRolling.cs index 95bfd673e6..8e6dd8d86c 100644 --- a/Projectiles/Melee/TumbleweedRolling.cs +++ b/Projectiles/Melee/TumbleweedRolling.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = 8; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 5; } public override void AI() @@ -40,12 +42,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation += Projectile.velocity.X * 0.05f; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - // TODO -- Make this use proper i-frame variables. - target.immune[Projectile.owner] = 5; - } - public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.NPCDeath15, Projectile.position); diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 7c0b87a262..963834d4f0 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { public class OracleYoyo : ModProjectile { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public int AuraFrame; // projectile.localAI[1] is the Aura Charge of the red lightning aura @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { // The aura's direct damage scales with its charge and with melee stats. float chargeRatio = AuraCharge / MaxCharge; - int auraDamage = Oracle.AuraBaseDamage + (int)(chargeRatio * (Oracle.AuraMaxDamage - Oracle.AuraBaseDamage)); + int auraDamage = TheOracle.AuraBaseDamage + (int)(chargeRatio * (TheOracle.AuraMaxDamage - TheOracle.AuraBaseDamage)); DealAuraDamage(auraRadius, auraDamage); } } diff --git a/Projectiles/Ranged/BlissfulBombardierDustProjectile.cs b/Projectiles/Ranged/BlissfulBombardierDustProjectile.cs index bb7d5149be..16e6962c88 100644 --- a/Projectiles/Ranged/BlissfulBombardierDustProjectile.cs +++ b/Projectiles/Ranged/BlissfulBombardierDustProjectile.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 15; } public override void AI() @@ -56,8 +58,7 @@ namespace CalamityMod.Projectiles.Typeless projTimer = 0f; Projectile.Kill(); } - projTimer *= 0.7f; - Projectile.ai[0] += 4f; + Projectile.ai[0] += (2f + Projectile.ai[1]); // Explosions spawned on hit last shorter int timerCounter = 0; while ((float)timerCounter < projTimer) { @@ -81,15 +82,8 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 0; - target.AddBuff(ModContent.BuffType(), 120); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 120); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); } } diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index add4f4388f..4c0882189a 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -69,15 +69,15 @@ namespace CalamityMod.Projectiles.Ranged // Adds 2 frames to lifeRegenTime on every hit. This increased value is used for the damage calculation. owner.lifeRegenTime += 2; - // Deals (1.00 + (0.05 * current lifeRegen))% of current lifeRegenTime as flat bonus damage on hit. + // Deals (1.00 + (0.1 * current lifeRegen))% of current lifeRegenTime as flat bonus damage on hit. // For example, at 0 life regen, you get 1% of lifeRegenTime as bonus damage. // At 10 life regen, you get 2%. At 20 life regen, you get 3%. // Negative life regen does not decrease damage. int regenForCalc = owner.lifeRegen > 0 ? owner.lifeRegen : 0; - float regenDamageRatio = 0.01f + 0.0005f * regenForCalc; + float regenDamageRatio = (1f + 0.1f * regenForCalc) / 100f; - // For the sake of bonus damage, life regen time caps at 3600, aka 60 seconds. This is its natural cap in vanilla. - int regenTimeForCalc = (int)MathHelper.Clamp(owner.lifeRegenTime, 0f, 3600f); + // For the sake of bonus damage, life regen time caps at 3600, aka 60 seconds. This is its natural cap in vanilla. This then gets divided by 2 for computing final damage. + int regenTimeForCalc = (int)MathHelper.Clamp(owner.lifeRegenTime, 0f, 3600f) / 2; int finalDamageBoost = (int)(regenDamageRatio * regenTimeForCalc); // Damage boost has a cap of 25 to prevent it from getting too crazy. diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 9bff684f73..2ab62a4fcd 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -62,13 +62,13 @@ namespace CalamityMod.Projectiles.Ranged public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item62, Projectile.position); - int projectiles = Main.rand.Next(2, 5); + int projectiles = Main.rand.Next(2, 3 + 1); if (Projectile.owner == Main.myPlayer) { for (int k = 0; k < projectiles; k++) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, (float)Main.rand.Next(-10, 11) * 2f, (float)Main.rand.Next(-10, 11) * 2f, ModContent.ProjectileType(), - (int)((double)Projectile.damage * 0.85), (float)(int)((double)Projectile.knockBack * 0.5), Main.myPlayer, 0f, 0f); + (int)((double)Projectile.damage * 0.45), (float)(int)((double)Projectile.knockBack * 0.5), Main.myPlayer, 0f, 0f); } } } diff --git a/Projectiles/Ranged/ChargedBlast2.cs b/Projectiles/Ranged/ChargedBlast2.cs index 4ba6bf958b..4b0db92cfa 100644 --- a/Projectiles/Ranged/ChargedBlast2.cs +++ b/Projectiles/Ranged/ChargedBlast2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 2; Projectile.alpha = 255; Projectile.timeLeft = 200; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() @@ -84,10 +86,5 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 160, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 3; - } } } diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index c80e073847..08a52f5909 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -234,8 +234,6 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.immune[Projectile.owner] = 0; - target.AddBuff(ModContent.BuffType(), 240); if (Projectile.ai[0] != 0f && Projectile.owner == Main.myPlayer) //if empowered diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index a9a12d7939..1106f966d8 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner, 0f, 0f); } - flarePowderTimer = 12; + flarePowderTimer = 6; } if (Math.Abs(Projectile.velocity.X) >= 8f || Math.Abs(Projectile.velocity.Y) >= 8f) @@ -86,11 +86,13 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.33), Projectile.knockBack, Projectile.owner, 0f, 2f); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 300); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.33), Projectile.knockBack, Projectile.owner, 0f, 2f); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 7de53d1c2e..13448a4b9a 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -5,197 +5,165 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; using Terraria.Audio; +using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using System.IO; +using Terraria.DataStructures; +using static CalamityMod.Items.Weapons.Ranged.PolarisParrotfish; +using static Terraria.ModLoader.ModContent; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Boss; namespace CalamityMod.Projectiles.Ranged { public class PolarStar : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/LaserProj"; + public override string Texture => "CalamityMod/Projectiles/Ranged/PolarStar"; - private int dust1 = 86; - private int dust2 = 91; + public ref float Time => ref Projectile.ai[0]; + private static float HitboxSize = 30f; + + public int dustTypeWhite = 91; + public int tileBounces = 0; + public float DustScaleMultiplier = 1; // Rocket type dust has to be smaller to look good with the others + public bool DoSlowdown = true; // On hit projectiles exist for a few extra frames to prevent projectile spam from far away + public Vector2 StartVelocity; + public Color EffectsColor; + public int DustEffectsID; public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = 18; // Projectile size is higher than normal because hitting constantly is important for this weapon + Projectile.height = 26; Projectile.friendly = true; - Projectile.alpha = 255; - Projectile.penetrate = 1; - Projectile.extraUpdates = 1; - Projectile.timeLeft = 300; + Projectile.penetrate = -1; // Only hits once, "pierces" so that it can last a bit after hitting + Projectile.extraUpdates = 2; + Projectile.timeLeft = 50; Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - //Looking pretty at boost two or three - if (Projectile.ai[1] == 2f || Projectile.ai[1] == 1f) + Time++; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (Time == 1) // Start of the shot visuals and other things that happen when it spawns { - Vector2 value7 = new Vector2(5f, 10f); - Lighting.AddLight(Projectile.Center, 0.25f, 0f, 0.25f); - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] == 48f) + StartVelocity = Projectile.velocity; + switch (Projectile.ai[1]) { - Projectile.localAI[0] = 0f; + case 2: // Orange shot + DustEffectsID = ModContent.DustType(); + EffectsColor = Color.Coral; + DustScaleMultiplier = 1; + break; + case 1: // Blue shot + DustEffectsID = ModContent.DustType(); + EffectsColor = Color.Turquoise; + DustScaleMultiplier = 1; + break; + default: // Pink shot + DustEffectsID = 223; + EffectsColor = Color.Violet; + DustScaleMultiplier = 0.4f; + break; } - else + + for (int i = 0; i <= 10; i++) { - for (int d = 0; d < 2; d++) - { - int dustType = d == 0 ? dust1 : dust2; - Vector2 dustVel = Vector2.UnitX * -12f; - dustVel = -Vector2.UnitY.RotatedBy((double)(Projectile.localAI[0] * 0.1308997f + (float)d * MathHelper.Pi), default) * value7; - int typeDust = Dust.NewDust(Projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1f); - Main.dust[typeDust].scale = dustType == dust1 ? 1.5f : 1f; - Main.dust[typeDust].noGravity = true; - Main.dust[typeDust].position = Projectile.Center + dustVel; - Main.dust[typeDust].velocity = Projectile.velocity; - int extraDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 0.8f); - Main.dust[extraDust].noGravity = true; - Main.dust[extraDust].velocity *= 0f; - } + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? dustTypeWhite : DustEffectsID, Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.3f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.85f, 1.4f) * DustScaleMultiplier; + } + for (int i = 0; i <= 2; i++) + { + SquishyLightParticle energy = new(Projectile.Center, Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.4f), Main.rand.NextFloat(0.2f, 0.6f), EffectsColor, Main.rand.Next(40, 50 + 1), 0.25f, 2f); + GeneralParticleHandler.SpawnParticle(energy); } } - if (Projectile.ai[1] == 2f) //Boost three + + if (Time % 3 == 0) { - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(15, 15), Main.rand.NextBool(5) ? dustTypeWhite : DustEffectsID); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.5f, 1.2f) * DustScaleMultiplier; + dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.01f, 0.045f); } - else if (Projectile.ai[1] == 1f) //Boost two + + if (Projectile.timeLeft % 2 == 0 && Time > 4 && DoSlowdown) // Particle trail { - if (Projectile.alpha > 0) - { - Projectile.alpha -= 25; - } - if (Projectile.alpha < 0) - { - Projectile.alpha = 0; - } - float boostLevel = 30f; - float inc = 1f; - if (Projectile.ai[1] == 1f) - { - Projectile.localAI[0] += inc; - if (Projectile.localAI[0] > boostLevel) - { - Projectile.localAI[0] = boostLevel; - } - } - else - { - Projectile.localAI[0] -= inc; - if (Projectile.localAI[0] <= 0f) - { - Projectile.Kill(); - } - } + PointParticle spark = new PointParticle(Projectile.Center - Projectile.velocity * 1f, -Projectile.velocity * 0.01f, false, 7, 2f, EffectsColor * 0.6f); + GeneralParticleHandler.SpawnParticle(spark); } - else //No boosts + + if (Projectile.timeLeft <= 2 && DoSlowdown) { - if (Projectile.alpha > 0) - { - Projectile.alpha -= 25; - } - if (Projectile.alpha < 0) - { - Projectile.alpha = 0; - } - float boostLevel = 40f; - float inc = 1.5f; - if (Projectile.ai[1] == 0f) - { - Projectile.localAI[0] += inc; - if (Projectile.localAI[0] > boostLevel) - { - Projectile.localAI[0] = boostLevel; - } - } - else - { - Projectile.localAI[0] -= inc; - if (Projectile.localAI[0] <= 0f) - { - Projectile.Kill(); - } - } + Projectile.timeLeft = Main.zenithWorld ? 3 : 7; // Adds extra projectile time on hit so that you can only fire faster if you're quite close + Projectile.velocity = Vector2.Zero; + DoSlowdown = false; } + + if (!DoSlowdown) + { + Projectile.extraUpdates = 0; + Projectile.alpha = 255; + } + + Lighting.AddLight(Projectile.Center, EffectsColor.ToVector3() * 1f); } - - public override Color? GetAlpha(Color lightColor) => new Color(255, 255, 255, Projectile.alpha); - - public override bool PreDraw(ref Color lightColor) => Projectile.DrawBeam(40f, 1.5f, lightColor); - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Player player = Main.player[Projectile.owner]; - if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false)) + if (DoSlowdown) { - player.AddBuff(ModContent.BuffType(), 480); + Projectile.timeLeft = Main.zenithWorld ? 3 : 7; // Adds extra projectile time on hit so that you can only fire faster if you're quite close + Projectile.velocity = Vector2.Zero; + DoSlowdown = false; } } - public override bool OnTileCollide(Vector2 oldVelocity) { - Collision.HitTiles(Projectile.position + Projectile.velocity, Projectile.velocity, Projectile.width, Projectile.height); - SoundEngine.PlaySound(SoundID.Dig, Projectile.position); - return true; - } + Time = 2; + if (tileBounces >= 2) + Projectile.Kill(); + else + tileBounces++; + + for (int i = 0; i <= 5; i++) + { + SquishyLightParticle energy = new(Projectile.Center, Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(0.08f, 0.15f), Main.rand.NextFloat(0.4f, 0.7f), EffectsColor, Main.rand.Next(40, 50 + 1), 0.25f, 2f); + GeneralParticleHandler.SpawnParticle(energy); + } + if (Projectile.velocity.X != oldVelocity.X) + { + Projectile.velocity.X = -oldVelocity.X; + } + if (Projectile.velocity.Y != oldVelocity.Y) + { + Projectile.velocity.Y = -oldVelocity.Y; + } + return false; + } public override void OnKill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Item62 with { Volume = SoundID.Item62.Volume * 0.5f}, Projectile.position); - if (Projectile.ai[1] == 1f) //Boost two + int points = 5; + float radians = MathHelper.TwoPi / points; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); + Vector2 addedPlacement = StartVelocity * Main.rand.NextFloat(0.1f, 1.5f); + for (int k = 0; k < points; k++) { - int projectiles = Main.rand.Next(2, 5); - if (Projectile.owner == Main.myPlayer) - { - for (int k = 0; k < projectiles; k++) - { - int split = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, (float)Main.rand.Next(-10, 11) * 2f, (float)Main.rand.Next(-10, 11) * 2f, ModContent.ProjectileType(), - (int)((double)Projectile.damage * 0.85), (float)(int)((double)Projectile.knockBack * 0.5), Main.myPlayer, 0f, 0f); - } - } - } - if (Projectile.ai[1] == 2f) //Boost three - { - Projectile.ExpandHitboxBy(150); - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 2; - Projectile.Damage(); - - int dustAmt = 36; - for (int d = 0; d < dustAmt; d++) // 108 dusts - { - Vector2 source = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.3f; - source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; - Vector2 dustVel = source - Projectile.Center; - - int i = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.3f, dustVel.Y * 0.3f, 100, default, 2f); - Main.dust[i].noGravity = true; - - int j = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.2f, dustVel.Y * 0.2f, 100, default, 2f); - Main.dust[j].noGravity = true; - - int k = Dust.NewDust(source + dustVel, 0, 0, Main.rand.NextBool() ? dust1 : dust2, dustVel.X * 0.1f, dustVel.Y * 0.1f, 100, default, 2f); - Main.dust[k].noGravity = true; - } - - bool random = Main.rand.NextBool(); - float angleStart = Main.rand.NextFloat(0f, MathHelper.TwoPi); - for (float angle = 0f; angle < MathHelper.TwoPi; angle += 0.05f) // 125 dusts - { - random = !random; - Vector2 velocity = angle.ToRotationVector2() * (2f + (float)(Math.Sin(angleStart + angle * 3f) + 1) * 2.5f) * Main.rand.NextFloat(0.95f, 1.05f); - Dust d = Dust.NewDustPerfect(Projectile.Center, random ? dust1 : dust2, velocity); - d.noGravity = true; - d.customData = 0.025f; - d.scale = 2f; - } + Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f); + PointParticle spark = new PointParticle((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, false, 13, 1.2f, EffectsColor); + GeneralParticleHandler.SpawnParticle(spark); } } + public override bool? CanDamage() => Projectile.numHits > 1 ? false : null; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, HitboxSize, targetHitbox); } } diff --git a/Projectiles/Ranged/PolarStar.png b/Projectiles/Ranged/PolarStar.png new file mode 100644 index 0000000000..a914c11d29 Binary files /dev/null and b/Projectiles/Ranged/PolarStar.png differ diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index db2e6c3e55..8535f59f7b 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 107, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Main.rand.Next(-35, 36) * 0.2f, Main.rand.Next(-35, 36) * 0.2f, ModContent.ProjectileType(), - (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Main.myPlayer); + (int)(Projectile.damage * 0.66), Projectile.knockBack * 0.5f, Main.myPlayer); } } } diff --git a/Projectiles/Ranged/SicknessRound2.cs b/Projectiles/Ranged/SicknessRound2.cs index a37f5e7ca3..a99357db02 100644 --- a/Projectiles/Ranged/SicknessRound2.cs +++ b/Projectiles/Ranged/SicknessRound2.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.timeLeft = 180; + Projectile.tileCollide = false; Projectile.light = 0.15f; Projectile.extraUpdates = 1; AIType = ProjectileID.WoodenArrowFriendly; @@ -62,11 +63,5 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(ModContent.BuffType(), 120); } - - public override void OnKill(int timeLeft) - { - if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - } } } diff --git a/Projectiles/Rogue/BileExplosion.cs b/Projectiles/Rogue/BileExplosion.cs index 58379bb5ff..64ef6fa4a2 100644 --- a/Projectiles/Rogue/BileExplosion.cs +++ b/Projectiles/Rogue/BileExplosion.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.timeLeft = 60; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 9; } public override void AI() @@ -42,17 +44,8 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Projectile.ai[0] != 1f) - target.immune[Projectile.owner] = 9; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 480); - target.AddBuff(ModContent.BuffType(), 480); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 480); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 480); } } diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index 45d14a7759..ba2176c086 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.localNPCHitCooldown = 12; AIType = ProjectileID.ThrowingKnife; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 7; } public override void AI() @@ -57,15 +59,8 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 7; - target.AddBuff(ModContent.BuffType(), 180); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Rogue/EnchantedAxe2.cs b/Projectiles/Rogue/EnchantedAxe2.cs index 1a8fa6263d..b06c478dfc 100644 --- a/Projectiles/Rogue/EnchantedAxe2.cs +++ b/Projectiles/Rogue/EnchantedAxe2.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, new Color(255, 255, 255, 128), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, new Color(192, 192, 255, 128), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Rogue/FinalDawnFireSlash.cs b/Projectiles/Rogue/FinalDawnFireSlash.cs index fc47069d5e..ac68257a3f 100644 --- a/Projectiles/Rogue/FinalDawnFireSlash.cs +++ b/Projectiles/Rogue/FinalDawnFireSlash.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[1] == 5) { Projectile.friendly = true; - SoundEngine.PlaySound(FinalDawn.UseSound, Projectile.Center); + SoundEngine.PlaySound(TheFinalDawn.UseSound, Projectile.Center); } } if (Projectile.ai[1] >= 11) diff --git a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs index d35540007c..879e1529a2 100644 --- a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs +++ b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[1] == 3) { Projectile.friendly = true; - SoundEngine.PlaySound(FinalDawn.UseSound, Projectile.position); + SoundEngine.PlaySound(TheFinalDawn.UseSound, Projectile.position); if (Projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Rogue/FinalDawnThrow.cs b/Projectiles/Rogue/FinalDawnThrow.cs index 6337ef2894..d46217d3f6 100644 --- a/Projectiles/Rogue/FinalDawnThrow.cs +++ b/Projectiles/Rogue/FinalDawnThrow.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.localAI[0] == 0) { - SoundEngine.PlaySound(FinalDawn.UseSound, Projectile.Center); + SoundEngine.PlaySound(TheFinalDawn.UseSound, Projectile.Center); Projectile.localAI[0] = 1; } diff --git a/Projectiles/Rogue/FinalDawnThrow2.cs b/Projectiles/Rogue/FinalDawnThrow2.cs index cfd96f4688..8b07ff43dc 100644 --- a/Projectiles/Rogue/FinalDawnThrow2.cs +++ b/Projectiles/Rogue/FinalDawnThrow2.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.localAI[0] == 0) { - SoundEngine.PlaySound(FinalDawn.UseSound, Projectile.position); + SoundEngine.PlaySound(TheFinalDawn.UseSound, Projectile.position); Projectile.localAI[0] = 1; } diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index 6a15281be3..7f362c0e37 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -86,7 +86,6 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Frostburn2, 180); target.AddBuff(ModContent.BuffType(), 30); - target.immune[Projectile.owner] = 0; Projectile.ai[0] = 1f; Projectile.ai[1] = target.whoAmI; Projectile.velocity = target.Center - Projectile.Center; diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index d955ef43a1..d9c623fe59 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -95,7 +95,6 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Frostburn2, 180); target.AddBuff(ModContent.BuffType(), 30); - target.immune[Projectile.owner] = 0; Projectile.ai[0] = 1f; Projectile.ai[1] = target.whoAmI; Projectile.velocity = target.Center - Projectile.Center; diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index 4b2421657b..28643a1c1a 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -62,6 +63,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + target.AddBuff(ModContent.BuffType(), 120); if (Projectile.penetrate <= 1) { Projectile.position = Projectile.Center; diff --git a/Projectiles/Rogue/MalachiteProj.cs b/Projectiles/Rogue/MalachiteProj.cs index d1d092ed6e..27489aa9f0 100644 --- a/Projectiles/Rogue/MalachiteProj.cs +++ b/Projectiles/Rogue/MalachiteProj.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -58,6 +59,8 @@ namespace CalamityMod.Projectiles.Rogue public override Color? GetAlpha(Color lightColor) => new Color(Main.DiscoR, 203, 103, Projectile.alpha); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnKill(int timeLeft) { Projectile.position = Projectile.Center; diff --git a/Projectiles/Rogue/MalachiteStealth.cs b/Projectiles/Rogue/MalachiteStealth.cs index 871fb68e9a..19bdc426f4 100644 --- a/Projectiles/Rogue/MalachiteStealth.cs +++ b/Projectiles/Rogue/MalachiteStealth.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public class MalachiteStealth : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - private const int lifeSpan = 300; + private const int lifeSpan = 240; public override string Texture => "CalamityMod/Items/Weapons/Rogue/Malachite"; public override void SetStaticDefaults() @@ -31,6 +32,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = false; Projectile.timeLeft = lifeSpan; Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 60; } public override void AI() @@ -102,22 +105,25 @@ namespace CalamityMod.Projectiles.Rogue green = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f); Main.dust[green].velocity *= 2f; } - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; Projectile.Damage(); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.immune[Projectile.owner] = 0; + target.AddBuff(ModContent.BuffType(), 240); Projectile.extraUpdates = 0; - Projectile.ai[0] = 1f; - Projectile.ai[1] = target.whoAmI; - Projectile.velocity = target.Center - Projectile.Center; - Projectile.velocity *= 0.75f; - Projectile.netUpdate = true; + if (Projectile.ai[0] == 0f) + { + Projectile.ai[0] = 1f; + Projectile.ai[1] = target.whoAmI; + Projectile.velocity = target.Center - Projectile.Center; + Projectile.velocity *= 0.75f; + Projectile.netUpdate = true; + } + if (Projectile.localAI[0] < 3f) + Projectile.localAI[0] += 1f; - const int maxKunai = 3; + const int maxKunai = 6; int kunaiFound = 0; int oldestKunai = -1; int oldestKunaiTimeLeft = lifeSpan; @@ -141,6 +147,6 @@ namespace CalamityMod.Projectiles.Rogue } } - public override bool? CanDamage() => Projectile.ai[0] != 1f ? null : false; + public override bool? CanDamage() => (Projectile.localAI[0] < 3f || Projectile.ai[0] == 2f) ? null : false; } } diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index 9d155ed035..d01f46f8df 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 600; AIType = ProjectileID.WoodenBoomerang; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 6; } public override void AI() @@ -55,11 +57,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 6; - target.AddBuff(BuffID.Venom, 120); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Venom, 120); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 120); } diff --git a/Projectiles/Rogue/SkyfinNuke.cs b/Projectiles/Rogue/SkyfinNuke.cs index c9f3e337de..b46e45f893 100644 --- a/Projectiles/Rogue/SkyfinNuke.cs +++ b/Projectiles/Rogue/SkyfinNuke.cs @@ -86,6 +86,7 @@ namespace CalamityMod.Projectiles.Rogue { int explode = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), Projectile.knockBack * 0.4f, Projectile.owner, 1f); Main.projectile[explode].usesLocalNPCImmunity = true; + Main.projectile[explode].usesIDStaticNPCImmunity = false; Main.projectile[explode].localNPCHitCooldown = 30; } } diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 2f8b3a1654..acc8c24996 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -281,17 +281,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.rand.Next(1,4); i++) { Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); - int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - if (spark.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark].DamageType = DamageClass.Summon; - Main.projectile[spark].originalDamage = Projectile.originalDamage; - Main.projectile[spark].timeLeft = 120; - Main.projectile[spark].penetrate = 3; - Main.projectile[spark].usesIDStaticNPCImmunity = true; - Main.projectile[spark].idStaticNPCHitCooldown = 10; - Main.projectile[spark].usesLocalNPCImmunity = false; - } + int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } sparkCounter = 0; } diff --git a/Projectiles/Summon/StormjawSpark.cs b/Projectiles/Summon/StormjawSpark.cs new file mode 100644 index 0000000000..4dbaafe918 --- /dev/null +++ b/Projectiles/Summon/StormjawSpark.cs @@ -0,0 +1,90 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class StormjawSpark : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + //literally had to make another projectile cuz whips exist + public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true; + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 12; + Projectile.friendly = true; + Projectile.penetrate = 3; + Projectile.timeLeft = 60; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + Projectile.DamageType = DamageClass.Summon; + } + + public override void AI() + { + if (Projectile.velocity.X != Projectile.velocity.X) + { + Projectile.velocity.X = Projectile.velocity.X * -0.1f; + } + if (Projectile.velocity.X != Projectile.velocity.X) + { + Projectile.velocity.X = Projectile.velocity.X * -0.5f; + } + if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) + { + Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; + } + Projectile.ai[0] += 1f; + if (Projectile.ai[0] > 5f) + { + Projectile.ai[0] = 5f; + if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) + { + Projectile.velocity.X = Projectile.velocity.X * 0.97f; + if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) + { + Projectile.velocity.X = 0f; + Projectile.netUpdate = true; + } + } + Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; + } + Projectile.rotation += Projectile.velocity.X * 0.1f; + int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f); + Dust expr_8976_cp_0 = Main.dust[sparky]; + expr_8976_cp_0.position.X -= 2f; + Dust expr_8994_cp_0 = Main.dust[sparky]; + expr_8994_cp_0.position.Y += 2f; + Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f; + Main.dust[sparky].noGravity = true; + Dust expr_89E7_cp_0 = Main.dust[sparky]; + expr_89E7_cp_0.velocity.Y -= 2f; + if (Main.rand.NextBool()) + { + int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f); + Dust expr_8A4E_cp_0 = Main.dust[sparkier]; + expr_8A4E_cp_0.position.X -= 2f; + Dust expr_8A6C_cp_0 = Main.dust[sparkier]; + expr_8A6C_cp_0.position.Y += 2f; + Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + Main.dust[sparkier].noGravity = true; + Main.dust[sparkier].velocity *= 0.1f; + } + if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) + { + Projectile.velocity.X = Projectile.velocity.X * 0.8f; + } + Projectile.rotation = -Projectile.velocity.X * 0.05f; + if (Projectile.velocity.Y > 16f) + { + Projectile.velocity.Y = 16f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + } +} diff --git a/Projectiles/Typeless/DragonDust.cs b/Projectiles/Typeless/DragonDust.cs index 11c1c056ad..4fb3eccb9a 100644 --- a/Projectiles/Typeless/DragonDust.cs +++ b/Projectiles/Typeless/DragonDust.cs @@ -18,6 +18,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 3; } public override void AI() @@ -80,11 +82,7 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 0; - target.AddBuff(ModContent.BuffType(), 120); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Typeless/GemTechArmorGem.cs b/Projectiles/Typeless/GemTechArmorGem.cs index 31fbc3ece8..f3640b8652 100644 --- a/Projectiles/Typeless/GemTechArmorGem.cs +++ b/Projectiles/Typeless/GemTechArmorGem.cs @@ -181,7 +181,6 @@ namespace CalamityMod.Projectiles.Typeless public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - Projectile.damage = 0; Projectile.velocity = Vector2.Zero; Projectile.timeLeft = ProjectileID.Sets.TrailCacheLength[Projectile.type]; Projectile.netUpdate = true; diff --git a/Sounds/Custom/CeramicImpact1.ogg b/Sounds/Custom/CeramicImpact1.ogg new file mode 100644 index 0000000000..ae987d8567 Binary files /dev/null and b/Sounds/Custom/CeramicImpact1.ogg differ diff --git a/Sounds/Custom/CeramicImpact2.ogg b/Sounds/Custom/CeramicImpact2.ogg new file mode 100644 index 0000000000..6b18fdf64c Binary files /dev/null and b/Sounds/Custom/CeramicImpact2.ogg differ diff --git a/Sounds/Custom/CuteSqueak.ogg b/Sounds/Custom/CuteSqueak.ogg new file mode 100644 index 0000000000..9c28804f2c Binary files /dev/null and b/Sounds/Custom/CuteSqueak.ogg differ diff --git a/Sounds/Custom/StormlionIdle.ogg b/Sounds/Custom/StormlionIdle.ogg new file mode 100644 index 0000000000..b8fc5bfb3f Binary files /dev/null and b/Sounds/Custom/StormlionIdle.ogg differ diff --git a/Sounds/Item/PolarisShot.ogg b/Sounds/Item/PolarisShot.ogg new file mode 100644 index 0000000000..dcee6b57e2 Binary files /dev/null and b/Sounds/Item/PolarisShot.ogg differ diff --git a/Sounds/Item/SpinningWoosh.ogg b/Sounds/Item/SpinningWoosh.ogg new file mode 100644 index 0000000000..95da93e645 Binary files /dev/null and b/Sounds/Item/SpinningWoosh.ogg differ diff --git a/Sounds/NPCHit/StormlionHit.ogg b/Sounds/NPCHit/StormlionHit.ogg new file mode 100644 index 0000000000..c9afa9d613 Binary files /dev/null and b/Sounds/NPCHit/StormlionHit.ogg differ diff --git a/Sounds/NPCKilled/StormlionDeath.ogg b/Sounds/NPCKilled/StormlionDeath.ogg new file mode 100644 index 0000000000..b0fba67652 Binary files /dev/null and b/Sounds/NPCKilled/StormlionDeath.ogg differ diff --git a/Tiles/Abyss/HydrothermalCrateTile.cs b/Tiles/Abyss/HydrothermalCrateTile.cs new file mode 100644 index 0000000000..adcc4b8153 --- /dev/null +++ b/Tiles/Abyss/HydrothermalCrateTile.cs @@ -0,0 +1,42 @@ +using CalamityMod.Items.Fishing.SulphurCatches; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss +{ + public class HydrothermalCrateTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolidTop[Type] = true; + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileTable[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + AddMapEntry(new Color(150, 109, 26), CalamityUtils.GetItemName()); + DustType = 127; + } + + public override bool CreateDust(int i, int j, ref int type) + { + if (Main.rand.NextBool()) + type = 44; + else + type = 127; + + return true; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/Abyss/HydrothermalCrateTile.png b/Tiles/Abyss/HydrothermalCrateTile.png new file mode 100644 index 0000000000..3cadf65ba9 Binary files /dev/null and b/Tiles/Abyss/HydrothermalCrateTile.png differ diff --git a/Tiles/Astral/MonolithCrateTile.cs b/Tiles/Astral/MonolithCrateTile.cs new file mode 100644 index 0000000000..0041748d77 --- /dev/null +++ b/Tiles/Astral/MonolithCrateTile.cs @@ -0,0 +1,46 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Fishing.AstralCatches; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Astral +{ + public class MonolithCrateTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolidTop[Type] = true; + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileTable[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + AddMapEntry(new Color(110, 45, 117), CalamityUtils.GetItemName()); + DustType = ModContent.DustType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + if (Main.rand.NextBool()) + { + type = ModContent.DustType(); + } + else + { + type = ModContent.DustType(); + } + return true; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/Astral/MonolithCrateTile.png b/Tiles/Astral/MonolithCrateTile.png new file mode 100644 index 0000000000..a01c24e2fa Binary files /dev/null and b/Tiles/Astral/MonolithCrateTile.png differ diff --git a/Tiles/Crags/SlagCrateTile.cs b/Tiles/Crags/SlagCrateTile.cs new file mode 100644 index 0000000000..91d81f3e22 --- /dev/null +++ b/Tiles/Crags/SlagCrateTile.cs @@ -0,0 +1,32 @@ +using CalamityMod.Items.Fishing.BrimstoneCragCatches; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Crags +{ + public class SlagCrateTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolidTop[Type] = true; + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileTable[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + AddMapEntry(new Color(189, 152, 43), CalamityUtils.GetItemName()); + DustType = 60; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/Crags/SlagCrateTile.png b/Tiles/Crags/SlagCrateTile.png new file mode 100644 index 0000000000..4236282747 Binary files /dev/null and b/Tiles/Crags/SlagCrateTile.png differ diff --git a/Tiles/Furniture/Fountains/AbyssFountainTile.cs b/Tiles/Furniture/Fountains/AbyssFountainTile.cs index 253fbee3ea..9c3464b1fd 100644 --- a/Tiles/Furniture/Fountains/AbyssFountainTile.cs +++ b/Tiles/Furniture/Fountains/AbyssFountainTile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/VoidWater").Slot; } diff --git a/Tiles/Furniture/Fountains/AstralFountainTile.cs b/Tiles/Furniture/Fountains/AstralFountainTile.cs index d06c0e44ae..44c0823d18 100644 --- a/Tiles/Furniture/Fountains/AstralFountainTile.cs +++ b/Tiles/Furniture/Fountains/AstralFountainTile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/AstralWater").Slot; } diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs index 9c0da14f6d..35f96bd6c4 100644 --- a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs +++ b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { string waterColor = Main.zenithWorld ? "CalamityMod/PissWater" : "CalamityMod/SulphuricWater"; - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find(waterColor).Slot; } diff --git a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs index 8ff20df623..01867f0992 100644 --- a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs +++ b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; } diff --git a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs index 6dde836456..29797481d3 100644 --- a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea public override void NearbyEffects(int i, int j, bool closer) { - Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; + if (!Main.dedServ) + Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/SunkenSea/SunkenCrateTile.cs b/Tiles/SunkenSea/EutrophicCrateTile.cs similarity index 87% rename from Tiles/SunkenSea/SunkenCrateTile.cs rename to Tiles/SunkenSea/EutrophicCrateTile.cs index f58da7bf9b..380baf60d4 100644 --- a/Tiles/SunkenSea/SunkenCrateTile.cs +++ b/Tiles/SunkenSea/EutrophicCrateTile.cs @@ -1,14 +1,13 @@ using CalamityMod.Items.Fishing.SunkenSeaCatches; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; -using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.SunkenSea { - public class SunkenCrateTile : ModTile + [LegacyName("SunkenCrateTile")] + public class EutrophicCrateTile : ModTile { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Tiles.SunkenSea TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(Type); - AddMapEntry(new Color(106, 218, 230), CalamityUtils.GetItemName()); + AddMapEntry(new Color(106, 218, 230), CalamityUtils.GetItemName()); DustType = 253; } diff --git a/Tiles/SunkenSea/EutrophicCrateTile.png b/Tiles/SunkenSea/EutrophicCrateTile.png new file mode 100644 index 0000000000..e1565ea85d Binary files /dev/null and b/Tiles/SunkenSea/EutrophicCrateTile.png differ diff --git a/Tiles/SunkenSea/FanCoral.cs b/Tiles/SunkenSea/FanCoral.cs index 9b79218502..9159a92307 100644 --- a/Tiles/SunkenSea/FanCoral.cs +++ b/Tiles/SunkenSea/FanCoral.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Tiles.SunkenSea public override void NearbyEffects(int i, int j, bool closer) { - Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; + if (!Main.dedServ) + Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/SunkenSea/PrismCrateTile.cs b/Tiles/SunkenSea/PrismCrateTile.cs new file mode 100644 index 0000000000..6895b56eaa --- /dev/null +++ b/Tiles/SunkenSea/PrismCrateTile.cs @@ -0,0 +1,32 @@ +using CalamityMod.Items.Fishing.SunkenSeaCatches; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class PrismCrateTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolidTop[Type] = true; + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileTable[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + AddMapEntry(new Color(145, 240, 255), CalamityUtils.GetItemName()); + DustType = 253; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/PrismCrateTile.png b/Tiles/SunkenSea/PrismCrateTile.png new file mode 100644 index 0000000000..509f060b9a Binary files /dev/null and b/Tiles/SunkenSea/PrismCrateTile.png differ diff --git a/Tiles/SunkenSea/SunkenCrateTile.png b/Tiles/SunkenSea/SunkenCrateTile.png deleted file mode 100644 index 7bff36134e..0000000000 Binary files a/Tiles/SunkenSea/SunkenCrateTile.png and /dev/null differ diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 3f76bf1485..edaed042ea 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -186,14 +186,14 @@ namespace CalamityMod.UI.CalamitasEnchants "CalamityMod/UI/CalamitasEnchantments/CurseIcon_Resentful", null, player => player.Calamity().farProximityRewardEnchant = true, - item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.IsTrueMelee() && item.type != ModContent.ItemType()), + item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.IsTrueMelee() && item.type != ModContent.ItemType()), new Enchantment(CalamityUtils.GetText("UI.Bloodthirsty.DisplayName"), CalamityUtils.GetText("UI.Bloodthirsty.Description"), 500, "CalamityMod/UI/CalamitasEnchantments/CurseIcon_Bloodthirsty", null, player => player.Calamity().closeProximityRewardEnchant = true, - item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.IsTrueMelee() && item.type != ModContent.ItemType()), + item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.IsTrueMelee() && item.type != ModContent.ItemType()), new Enchantment(CalamityUtils.GetText("UI.Ephemeral.DisplayName"), CalamityUtils.GetText("UI.Ephemeral.Description"), 600, diff --git a/UI/PopupGUIManager.cs b/UI/PopupGUIManager.cs index 61c72bbf6e..40b47cb197 100644 --- a/UI/PopupGUIManager.cs +++ b/UI/PopupGUIManager.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; using System.Linq; using Terraria; +using Terraria.ModLoader; +using Terraria.ModLoader.Core; namespace CalamityMod.UI { @@ -58,13 +60,16 @@ namespace CalamityMod.UI public static void LoadGUIs() { // Look through every type in the mod, and check if it's derived from PopupGUI. If it is, create a copy and save it in the static list. - foreach (Type type in typeof(CalamityMod).Assembly.GetTypes()) + foreach (Mod mod in ModLoader.Mods) { - // Don't load abstract classes since they cannot have instances. - if (type.IsAbstract) - continue; - if (type.IsSubclassOf(typeof(PopupGUI))) - gUIs.Add(Activator.CreateInstance(type) as PopupGUI); + foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) + { + // Don't load abstract classes since they cannot have instances. + if (type.IsAbstract) + continue; + if (type.IsSubclassOf(typeof(PopupGUI))) + gUIs.Add(Activator.CreateInstance(type) as PopupGUI); + } } } public static void UnloadGUIs() => gUIs.Clear(); diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 20826944cc..9b4d5f6e0f 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -810,6 +810,8 @@ namespace CalamityMod var edits = new Dictionary, Action>(128) { { Vanilla(ItemID.EnchantedBoomerang), Disable }, // Calamity adds its own recipe + { Vanilla(ItemID.MiniNukeI), Disable }, + { Vanilla(ItemID.MiniNukeII), Disable }, // Make various things cheaper (sorted by progression) { Vanilla(ItemID.Leather), ChangeIngredientStack(ItemID.RottenChunk, 2) }, @@ -825,6 +827,7 @@ namespace CalamityMod { Vanilla(ItemID.TrueExcalibur), ChangeIngredientStack(ItemID.ChlorophyteBar, 12) }, // Tier lock various items to a higher tier (sorted by progression) + { Vanilla(ItemID.Trimarang), AddIngredient(ModContent.ItemType(), 5) }, { Vanilla(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { r => r.HasResult(ItemID.HorseshoeBundle) && !r.HasIngredient(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { Vanilla(ItemID.NightsEdge), AddIngredient(ModContent.ItemType(), 5) }, @@ -1948,6 +1951,22 @@ namespace CalamityMod r.AddIngredient(ItemID.SoulofSight); r.Register(); r.DisableDecraft(); + + // Tiershift Mini Nuke 1s to post Moon Lord. + r = Recipe.Create(ItemID.MiniNukeI, 333); + r.AddIngredient(ItemID.RocketIII, 333); + r.AddIngredient(ItemID.LunarBar); + r.AddTile(TileID.LunarCraftingStation); + r.Register(); + r.DisableDecraft(); + + // Tiershift Mini Nuke 2s to post Moon Lord. + r = Recipe.Create(ItemID.MiniNukeII, 333); + r.AddIngredient(ItemID.RocketIV, 333); + r.AddIngredient(ItemID.LunarBar); + r.AddTile(TileID.LunarCraftingStation); + r.Register(); + r.DisableDecraft(); } #endregion diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 5ce9c2e0bf..8b48a9cf0a 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -286,7 +286,8 @@ namespace CalamityMod /// Adds all the common potions for fishing crates, alongside scaling mana and regen potions /// /// The ILoot interface for the loot table. - public static void AddCratePotionRules(this ILoot loot) + /// Whether or not the crate is considered a hardmode crate. + public static void AddCratePotionRules(this ILoot loot, bool hardMode = true) { loot.Add(ItemID.ObsidianSkinPotion, 10, 1, 3); loot.Add(ItemID.SwiftnessPotion, 10, 1, 3); @@ -311,14 +312,23 @@ namespace CalamityMod var lcrRegularPotion = new LeadingConditionRule(If(() => NPC.downedBoss3)); // Actually chain all the LCRs together - lcrSupremePotion.Add(supremePots); - lcrSupremePotion.OnFailedConditions(lcrSuperPotion); - lcrSuperPotion.Add(superPots); - lcrSuperPotion.OnFailedConditions(lcrGreaterPotion); - lcrGreaterPotion.Add(greaterPots); - lcrGreaterPotion.OnFailedConditions(lcrRegularPotion); + // Greater potions upwards are only chained if the crate is marked as Hardmode + if (hardMode) + { + lcrSupremePotion.Add(supremePots); + lcrSupremePotion.OnFailedConditions(lcrSuperPotion); + lcrSuperPotion.Add(superPots); + lcrSuperPotion.OnFailedConditions(lcrGreaterPotion); + lcrGreaterPotion.Add(greaterPots); + lcrGreaterPotion.OnFailedConditions(lcrRegularPotion); + } lcrRegularPotion.Add(regularPots); lcrRegularPotion.OnFailedConditions(lesserPots); + // Add the chain starting from regular potions if marked as a Pre-Hardmode crate + if (!hardMode) + { + loot.Add(lcrRegularPotion); + } } #endregion diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index 4b614ad800..81a5c9e29e 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -61,7 +61,7 @@ namespace CalamityMod PlantCheckAgainst[TileID.JunglePlants2] = new int[1] { TileID.JungleGrass }; PlantCheckAgainst[TileID.HallowedPlants] = new int[1] { TileID.HallowedGrass }; PlantCheckAgainst[TileID.HallowedPlants2] = new int[1] { TileID.HallowedGrass }; - PlantCheckAgainst[TileID.CrimsonPlants] = new int[1] { TileID.CrimsonPlants }; + PlantCheckAgainst[TileID.CrimsonPlants] = new int[1] { TileID.CrimsonGrass }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() };