diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 2e098fedb4..3bc64026d3 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -68,6 +68,9 @@ namespace CalamityMod.Balancing // 25% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f)))); + + // 40% resist to Lemon 'nade + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.60f, ProjectileType())))); #endregion #region Brain of Cthulhu: Creepers @@ -195,9 +198,6 @@ namespace CalamityMod.Balancing // 75% resist to Plaguenades. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); - // 70% resist to Stardust Dragon Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); - // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(ResistTrueMelee(0.5f)))); @@ -206,7 +206,13 @@ namespace CalamityMod.Balancing // 50% resist to Charged Blaster Cannon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.ChargedBlasterLaser)))); - + + //45% resist to Duststorm in a Bottle + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType(), ProjectileType(), ProjectileType())))); + + // 40% resist to Stardust Dragon Staff. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); + // 35% resist to Aerial Bane. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); diff --git a/Buffs/Alcohol/BaconOilBuff.cs b/Buffs/Alcohol/BaconOilBuff.cs index 964aa03e37..c2903d95b5 100644 --- a/Buffs/Alcohol/BaconOilBuff.cs +++ b/Buffs/Alcohol/BaconOilBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.DataStructures; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,7 +19,7 @@ namespace CalamityMod.Buffs.Alcohol Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/Trippy.png b/Buffs/Alcohol/Trippy.png index 7efc1b9c5d..de9e29e023 100644 Binary files a/Buffs/Alcohol/Trippy.png and b/Buffs/Alcohol/Trippy.png differ diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 816051bcf7..a5a4cd48d5 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -140,14 +140,16 @@ namespace CalamityMod.Buffs { // Globally remove summon tag debuff stacking, unless allowed in the SummonTag // Other mods need to add to this list because otherwise we can't tell which IsATag buff is actually for whips - if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0) + var tag1 = CalamityBuffSets.SummonTagDebuff[type]; + if (tag1 is not null && !tag1.AllowsWhipStacking && buffIndex > 0) { for (int i = buffIndex; i >= 0; i--) { if (npc.buffTime[i] > 0) { int buffID = npc.buffType[i]; - if (CalamityBuffSets.SummonTagDebuff.TryGetValue(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type) + var tag2 = CalamityBuffSets.SummonTagDebuff[buffID]; + if (tag2 is not null && !tag2.AllowsWhipStacking && buffID != type) { npc.DelBuff(i); break; diff --git a/Buffs/DamageOverTime/AstralInfectionDebuff.cs b/Buffs/DamageOverTime/AstralInfectionDebuff.cs index f2245d91aa..6374e43865 100644 --- a/Buffs/DamageOverTime/AstralInfectionDebuff.cs +++ b/Buffs/DamageOverTime/AstralInfectionDebuff.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/AuricRebuke.cs b/Buffs/DamageOverTime/AuricRebuke.cs index 939e1c5fdf..f06fd01e68 100644 --- a/Buffs/DamageOverTime/AuricRebuke.cs +++ b/Buffs/DamageOverTime/AuricRebuke.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Bane.cs b/Buffs/DamageOverTime/Bane.cs index c429af3dda..be6e0a4104 100644 --- a/Buffs/DamageOverTime/Bane.cs +++ b/Buffs/DamageOverTime/Bane.cs @@ -7,6 +7,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -25,7 +26,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { diff --git a/Buffs/DamageOverTime/BanishingFire.cs b/Buffs/DamageOverTime/BanishingFire.cs index 23daa2a06f..5a9a8730ac 100644 --- a/Buffs/DamageOverTime/BanishingFire.cs +++ b/Buffs/DamageOverTime/BanishingFire.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -24,7 +25,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/BrainRot.cs b/Buffs/DamageOverTime/BrainRot.cs index c1f9a49ae2..85e4c1ff09 100644 --- a/Buffs/DamageOverTime/BrainRot.cs +++ b/Buffs/DamageOverTime/BrainRot.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index b05c42232b..ecfaa64e0c 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/BurningBlood.cs b/Buffs/DamageOverTime/BurningBlood.cs index 5f8e036feb..7988b34e5a 100644 --- a/Buffs/DamageOverTime/BurningBlood.cs +++ b/Buffs/DamageOverTime/BurningBlood.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/CrushDepth.cs b/Buffs/DamageOverTime/CrushDepth.cs index 63c9fa2ebc..b2eea3b897 100644 --- a/Buffs/DamageOverTime/CrushDepth.cs +++ b/Buffs/DamageOverTime/CrushDepth.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Daybroken.cs b/Buffs/DamageOverTime/Daybroken.cs index 947f6c2611..bde8625d72 100644 --- a/Buffs/DamageOverTime/Daybroken.cs +++ b/Buffs/DamageOverTime/Daybroken.cs @@ -4,6 +4,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = DebuffData.Daybroken; + CalamityBuffSets.DebuffDataset[Type] = DebuffData.Daybroken; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/DemonicFlames.cs b/Buffs/DamageOverTime/DemonicFlames.cs index 8e8fd369a5..2bdfd02258 100644 --- a/Buffs/DamageOverTime/DemonicFlames.cs +++ b/Buffs/DamageOverTime/DemonicFlames.cs @@ -7,6 +7,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -29,7 +30,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Dragonfire.cs b/Buffs/DamageOverTime/Dragonfire.cs index bc3ff034b3..614e450322 100644 --- a/Buffs/DamageOverTime/Dragonfire.cs +++ b/Buffs/DamageOverTime/Dragonfire.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/ElementalMix.cs b/Buffs/DamageOverTime/ElementalMix.cs index d057dcd645..ee76ef1642 100644 --- a/Buffs/DamageOverTime/ElementalMix.cs +++ b/Buffs/DamageOverTime/ElementalMix.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/GodSlayerInferno.cs b/Buffs/DamageOverTime/GodSlayerInferno.cs index f7d799fafa..21a6d3c7cf 100644 --- a/Buffs/DamageOverTime/GodSlayerInferno.cs +++ b/Buffs/DamageOverTime/GodSlayerInferno.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/HadopelagicPressure.cs b/Buffs/DamageOverTime/HadopelagicPressure.cs index 6cc7804326..f014b8789e 100644 --- a/Buffs/DamageOverTime/HadopelagicPressure.cs +++ b/Buffs/DamageOverTime/HadopelagicPressure.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -70,7 +71,7 @@ namespace CalamityMod.Buffs.DamageOverTime Particle smoke = new HeavySmokeParticle(npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f) + (0.00000013f * npc.width * npc.height), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); GeneralParticleHandler.SpawnParticle(smoke); } - Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 360, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f); + Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 390, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f); water.noGravity = true; water.velocity *= 0.75f; water.velocity.X = water.velocity.X * 0.75f; diff --git a/Buffs/DamageOverTime/HeavyBleeding.cs b/Buffs/DamageOverTime/HeavyBleeding.cs index 49782c6cb6..2b545a3988 100644 --- a/Buffs/DamageOverTime/HeavyBleeding.cs +++ b/Buffs/DamageOverTime/HeavyBleeding.cs @@ -6,6 +6,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs index 84a60b5e22..1a90bca57d 100644 --- a/Buffs/DamageOverTime/HolyFlames.cs +++ b/Buffs/DamageOverTime/HolyFlames.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/HolyInferno.cs b/Buffs/DamageOverTime/HolyInferno.cs index eaf25ad6a1..77882f2a00 100644 --- a/Buffs/DamageOverTime/HolyInferno.cs +++ b/Buffs/DamageOverTime/HolyInferno.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Laceration.cs b/Buffs/DamageOverTime/Laceration.cs index 8e50c0422d..021829ed16 100644 --- a/Buffs/DamageOverTime/Laceration.cs +++ b/Buffs/DamageOverTime/Laceration.cs @@ -6,6 +6,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/MiracleBlight.cs b/Buffs/DamageOverTime/MiracleBlight.cs index 448b4616a7..eccb776377 100644 --- a/Buffs/DamageOverTime/MiracleBlight.cs +++ b/Buffs/DamageOverTime/MiracleBlight.cs @@ -13,6 +13,7 @@ using Terraria.DataStructures; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -55,7 +56,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index dbdbef4d02..9578921853 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Plague.cs b/Buffs/DamageOverTime/Plague.cs index 45875dc587..7c3b9a3e77 100644 --- a/Buffs/DamageOverTime/Plague.cs +++ b/Buffs/DamageOverTime/Plague.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/RiptideDebuff.cs b/Buffs/DamageOverTime/RiptideDebuff.cs index e68629fae6..74b3d510fc 100644 --- a/Buffs/DamageOverTime/RiptideDebuff.cs +++ b/Buffs/DamageOverTime/RiptideDebuff.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs index 5065122406..ba20aefe40 100644 --- a/Buffs/DamageOverTime/SagePoison.cs +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -58,7 +59,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(NPC npc, ref int buffIndex) { diff --git a/Buffs/DamageOverTime/SearingLava.cs b/Buffs/DamageOverTime/SearingLava.cs index 708af57feb..bdc5182787 100644 --- a/Buffs/DamageOverTime/SearingLava.cs +++ b/Buffs/DamageOverTime/SearingLava.cs @@ -2,6 +2,7 @@ using CalamityMod.DataStructures; using Terraria; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -33,7 +34,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Shadowflame.cs b/Buffs/DamageOverTime/Shadowflame.cs index 3b89427e23..f7ef42d959 100644 --- a/Buffs/DamageOverTime/Shadowflame.cs +++ b/Buffs/DamageOverTime/Shadowflame.cs @@ -5,6 +5,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -18,7 +19,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = DebuffData.Shadowflame; + CalamityBuffSets.DebuffDataset[Type] = DebuffData.Shadowflame; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/ShellfishClaps.cs b/Buffs/DamageOverTime/ShellfishClaps.cs index 45797d83fe..11edc8040c 100644 --- a/Buffs/DamageOverTime/ShellfishClaps.cs +++ b/Buffs/DamageOverTime/ShellfishClaps.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -51,7 +52,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; BuffID.Sets.IsATagBuff[Type] = true; } diff --git a/Buffs/DamageOverTime/SnapClamDebuff.cs b/Buffs/DamageOverTime/SnapClamDebuff.cs index acf115c563..8f9f59d4aa 100644 --- a/Buffs/DamageOverTime/SnapClamDebuff.cs +++ b/Buffs/DamageOverTime/SnapClamDebuff.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -34,7 +35,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(NPC npc, ref int buffIndex) diff --git a/Buffs/DamageOverTime/StaticDischarge.cs b/Buffs/DamageOverTime/StaticDischarge.cs index 5b88e5a0c0..457d88f93c 100644 --- a/Buffs/DamageOverTime/StaticDischarge.cs +++ b/Buffs/DamageOverTime/StaticDischarge.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index 614e9f0c56..73e3144904 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; // Acid Venom immunity is granted automatically if you are immune to Sulphuric Poisoning. BuffID.Sets.GrantImmunityWith[BuffID.Venom].Add(Type); diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index e7eb641700..2145aba8db 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -28,7 +29,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true; diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index 87e8b8d1b7..47068b9b71 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -23,7 +24,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/VermillionFlux.cs b/Buffs/DamageOverTime/VermillionFlux.cs index 8e4f03ccc0..71384ef591 100644 --- a/Buffs/DamageOverTime/VermillionFlux.cs +++ b/Buffs/DamageOverTime/VermillionFlux.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Voidfrost.cs b/Buffs/DamageOverTime/Voidfrost.cs index 37280063fa..44b85decd2 100644 --- a/Buffs/DamageOverTime/Voidfrost.cs +++ b/Buffs/DamageOverTime/Voidfrost.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index d1275f89ae..2ce9745729 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -31,7 +32,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true; diff --git a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs index 75bf7fdde9..9a0fd3a13b 100644 --- a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs +++ b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs @@ -1,6 +1,7 @@ using CalamityMod.DataStructures; using Terraria; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { @@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) => player.Calamity().weakBrimstoneFlames = true; diff --git a/Buffs/DamageOverTime/WindChilled.cs b/Buffs/DamageOverTime/WindChilled.cs index 33f970a97f..4b5197bc2b 100644 --- a/Buffs/DamageOverTime/WindChilled.cs +++ b/Buffs/DamageOverTime/WindChilled.cs @@ -1,14 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Particles; -using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Typeless; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -31,12 +26,12 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public static void WindChilledNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { var cnpc = npc.Calamity(); - + int baseDoTValue = (int)(cnpc.windChilledMult * npc.Calamity().ActiveColdDebuffMultiplier.ApplyTo(debuffData.EnemyLostRegen)); cnpc.ApplyDPSDebuff(baseDoTValue, Math.Max((int)(baseDoTValue * debuffData.MultiplierDamageTickSize), debuffData.MinimumDamageTickSize) / 2, ref npc.lifeRegen, ref damage); } @@ -94,7 +89,7 @@ namespace CalamityMod.Buffs.DamageOverTime bool start = !Main.rand.NextBool(4); Vector2 particleVel = Vector2.UnitY * Main.rand.NextFloat(-1.25f, 1.25f) * Math.Max(hightMult, widthMult) * (Main.rand.NextBool(5) ? 1.5f : 1) + npc.velocity * 0.85f; Vector2 particlePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult + 8, 3 * widthMult + 8) * Math.Max(hightMult, widthMult); - Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, + Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: -particleVel.ToRotation(), shrinkSpeed: 0.1f, sineRate: Main.rand.NextFloat(0.25f, 0.55f), sineIntensity: (int)(Main.rand.Next(12, 19 + 1) * Math.Max(hightMult, widthMult))); GeneralParticleHandler.SpawnParticle(mist, true, Main.rand.NextBool() ? Enums.GeneralDrawLayer.AfterNPCs : Enums.GeneralDrawLayer.BeforeNPCs); } diff --git a/Buffs/Pets/BeldumBuff.cs b/Buffs/Pets/BeldumBuff.cs new file mode 100644 index 0000000000..7ee2658caa --- /dev/null +++ b/Buffs/Pets/BeldumBuff.cs @@ -0,0 +1,27 @@ +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class BeldumBuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().beldum = true; + bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + } + } + } +} diff --git a/Buffs/Pets/BeldumBuff.png b/Buffs/Pets/BeldumBuff.png new file mode 100644 index 0000000000..610a378258 Binary files /dev/null and b/Buffs/Pets/BeldumBuff.png differ diff --git a/Buffs/Placeables/BlueCandleBuff.png b/Buffs/Placeables/BlueCandleBuff.png index a73721ff8f..c8ba5aa330 100644 Binary files a/Buffs/Placeables/BlueCandleBuff.png and b/Buffs/Placeables/BlueCandleBuff.png differ diff --git a/Buffs/Placeables/CorruptionEffigyBuff.png b/Buffs/Placeables/CorruptionEffigyBuff.png index 557440806c..c4e47d8cc1 100644 Binary files a/Buffs/Placeables/CorruptionEffigyBuff.png and b/Buffs/Placeables/CorruptionEffigyBuff.png differ diff --git a/Buffs/Placeables/PinkCandleBuff.png b/Buffs/Placeables/PinkCandleBuff.png index c299a08857..a5eb745a86 100644 Binary files a/Buffs/Placeables/PinkCandleBuff.png and b/Buffs/Placeables/PinkCandleBuff.png differ diff --git a/Buffs/Placeables/PurpleCandleBuff.png b/Buffs/Placeables/PurpleCandleBuff.png index 3ff18f000a..64959e5df2 100644 Binary files a/Buffs/Placeables/PurpleCandleBuff.png and b/Buffs/Placeables/PurpleCandleBuff.png differ diff --git a/Buffs/Placeables/YellowCandleBuff.png b/Buffs/Placeables/YellowCandleBuff.png index 2ac39e16dd..cf263248cb 100644 Binary files a/Buffs/Placeables/YellowCandleBuff.png and b/Buffs/Placeables/YellowCandleBuff.png differ diff --git a/Buffs/StatBuffs/SmashedEvil.cs b/Buffs/StatBuffs/SmashedEvil.cs index 9991a19dad..57f5c2ac60 100644 --- a/Buffs/StatBuffs/SmashedEvil.cs +++ b/Buffs/StatBuffs/SmashedEvil.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories; using Terraria; using Terraria.Localization; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatBuffs { @@ -47,7 +48,7 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/StatDebuffs/AbsorberAffliction.cs b/Buffs/StatDebuffs/AbsorberAffliction.cs index 55df57f042..5d8251900e 100644 --- a/Buffs/StatDebuffs/AbsorberAffliction.cs +++ b/Buffs/StatDebuffs/AbsorberAffliction.cs @@ -4,6 +4,7 @@ using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatDebuffs { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(NPC npc, ref int buffIndex) diff --git a/Buffs/StatDebuffs/Crumbling.cs b/Buffs/StatDebuffs/Crumbling.cs index 2539449caf..48ce39f04c 100644 --- a/Buffs/StatDebuffs/Crumbling.cs +++ b/Buffs/StatDebuffs/Crumbling.cs @@ -6,8 +6,6 @@ namespace CalamityMod.Buffs.StatDebuffs { public class Crumbling : ModBuff { - public static int DefenseReduction = 10; - public static float MultiplicativeDamageReductionPlayer = 0.7f; // 8% DR reduction public static float MultiplicativeDamageReductionEnemy = 0.92f; @@ -24,10 +22,5 @@ namespace CalamityMod.Buffs.StatDebuffs { npc.Calamity().crumble = true; } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().crumble = true; - } } } diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 512476ef2d..7cafbbd2d4 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -4,6 +4,7 @@ using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatDebuffs { @@ -15,7 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } // Purely to make it get electric color in tooltips public static DebuffData debuffData = new DebuffData() diff --git a/Buffs/StatDebuffs/Irradiated.cs b/Buffs/StatDebuffs/Irradiated.cs index 21166569fe..ce9a20f3f4 100644 --- a/Buffs/StatDebuffs/Irradiated.cs +++ b/Buffs/StatDebuffs/Irradiated.cs @@ -4,6 +4,7 @@ using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatDebuffs { @@ -53,7 +54,7 @@ namespace CalamityMod.Buffs.StatDebuffs Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/StatDebuffs/WhisperingDeath.cs b/Buffs/StatDebuffs/WhisperingDeath.cs index 04f29017ff..a7d62109e7 100644 --- a/Buffs/StatDebuffs/WhisperingDeath.cs +++ b/Buffs/StatDebuffs/WhisperingDeath.cs @@ -2,11 +2,15 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatDebuffs { public class WhisperingDeath : ModBuff { + public static float PlayerDamageReduction = 0.2f; + public static float EnemyDamageReduction = 0.1f; + // Whispering Death does not deal DoT, but is classified as a sickness debuff. public static DebuffData debuffData = new DebuffData() { @@ -18,7 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; - BuffDatasets.DebuffDataset[Type] = debuffData; + CalamityBuffSets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Summon/RareSandElemental.cs b/Buffs/Summon/OasisElementalBuff.cs similarity index 68% rename from Buffs/Summon/RareSandElemental.cs rename to Buffs/Summon/OasisElementalBuff.cs index 2748620ff6..962ce3dadb 100644 --- a/Buffs/Summon/RareSandElemental.cs +++ b/Buffs/Summon/OasisElementalBuff.cs @@ -1,12 +1,12 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class RareSandElemental : BaseSummonBuff + public class OasisElementalBuff : BaseSummonBuff { protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.rareSandEleBuff; + protected override ref bool MinionBool => ref BuffModdedOwner.oasisEleBuff; } } diff --git a/Buffs/Summon/RareSandElemental.png b/Buffs/Summon/OasisElementalBuff.png similarity index 100% rename from Buffs/Summon/RareSandElemental.png rename to Buffs/Summon/OasisElementalBuff.png diff --git a/Buffs/UHFMurasamaCooldown.png b/Buffs/UHFMurasamaCooldown.png deleted file mode 100644 index 7640c31cfa..0000000000 Binary files a/Buffs/UHFMurasamaCooldown.png and /dev/null differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3aa9e5fb77..27246a7527 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -36,6 +36,7 @@ using CalamityMod.Items.Armor.TitanHeart; using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Dyes; +using CalamityMod.Items.Fishing; using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; @@ -433,6 +434,7 @@ namespace CalamityMod.CalPlayer public int murasamaHitCooldown = 0; public int giantShellPostHit = 0; public int tortShellPostHit = 0; + public int sharkGunDamageScaling = 0; public int MiniSwarmerCooldown = 0; public float SulphWaterPoisoningLevel; public float holyInfernoFadeIntensity; @@ -599,6 +601,7 @@ namespace CalamityMod.CalPlayer public bool lordePet = false; public bool frostyBat = false; public bool toastyBat = false; + public bool beldum = false; public bool starSwallowerPetFroge = false; #endregion @@ -778,8 +781,6 @@ namespace CalamityMod.CalPlayer #endregion #region Permanent Buff - /// If true, the player has spawned in Punch Card through its one-time chat easter egg. - public bool spawnedPunchCard = false; /// If true, the player has consumed Celestial Onion. public bool extraAccessoryML = false; /// If true, the player has consumed Comet Shard. @@ -1101,8 +1102,8 @@ namespace CalamityMod.CalPlayer public float summonProjCooldown; public bool sandElemental = false; public bool sandElementalVanity = false; - public bool rareSandElemental = false; - public bool rareSandElementalVanity = false; + public bool oasisElemental = false; + public bool oasisElementalVanity = false; public bool cloudElemental = false; public bool cloudElementalVanity = false; public bool brimElemental = false; @@ -1394,7 +1395,6 @@ namespace CalamityMod.CalPlayer public bool staticDischarge = false; public bool miracleBlight = false; public bool armorCrunch = false; - public bool crumble = false; public bool irradiated = false; public bool bane = false; public bool brimstoneFlames = false; @@ -1594,7 +1594,7 @@ namespace CalamityMod.CalPlayer /// Elemental in a Bottle. public bool sandEleBuff = false; /// Rare Elemental in a Bottle. - public bool rareSandEleBuff = false; + public bool oasisEleBuff = false; /// Eye of the Storm. public bool cloudEleBuff = false; /// Rose Stone. @@ -1869,7 +1869,6 @@ namespace CalamityMod.CalPlayer #region Saving And Loading public override void Initialize() { - spawnedPunchCard = false; extraAccessoryML = false; eCore = false; mFruit = false; @@ -1921,7 +1920,6 @@ namespace CalamityMod.CalPlayer public override void SaveData(TagCompound tag) { var boost = new List(); - boost.AddWithCondition("spawnedPunchCard", spawnedPunchCard); boost.AddWithCondition("extraAccessoryML", extraAccessoryML); boost.AddWithCondition("etherealCore", eCore); boost.AddWithCondition("miracleFruit", mFruit); @@ -2011,7 +2009,6 @@ namespace CalamityMod.CalPlayer public override void LoadData(TagCompound tag) { var boost = tag.GetList("boost"); - spawnedPunchCard = boost.Contains("spawnedPunchCard"); extraAccessoryML = boost.Contains("extraAccessoryML"); eCore = boost.Contains("etherealCore"); mFruit = boost.Contains("miracleFruit"); @@ -2319,6 +2316,7 @@ namespace CalamityMod.CalPlayer lordePet = false; frostyBat = false; toastyBat = false; + beldum = false; starSwallowerPetFroge = false; onyxExcavator = false; @@ -2701,7 +2699,6 @@ namespace CalamityMod.CalPlayer staticDischarge = false; miracleBlight = false; armorCrunch = false; - crumble = false; irradiated = false; bane = false; brimstoneFlames = false; @@ -2864,7 +2861,7 @@ namespace CalamityMod.CalPlayer cEnergy = false; pSoulGuardians = false; sandEleBuff = false; - rareSandEleBuff = false; + oasisEleBuff = false; cloudEleBuff = false; brimEleBuff = false; waterEleBuff = false; @@ -2881,8 +2878,8 @@ namespace CalamityMod.CalPlayer MutatedTruffleBool = false; sandElemental = false; sandElementalVanity = false; - rareSandElemental = false; - rareSandElementalVanity = false; + oasisElemental = false; + oasisElementalVanity = false; cloudElemental = false; cloudElementalVanity = false; brimElemental = false; @@ -3190,7 +3187,6 @@ namespace CalamityMod.CalPlayer staticDischarge = false; miracleBlight = false; armorCrunch = false; - crumble = false; irradiated = false; bane = false; brimstoneFlames = false; @@ -5112,7 +5108,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; ++l) { int buffID = Player.buffType[l]; - if ((BuffDatasets.DebuffDataset[buffID] != null && BuffDatasets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy) + if ((CalamityBuffSets.DebuffDataset[buffID] != null && CalamityBuffSets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy) { Player.buffTime[l]++; } @@ -6408,6 +6404,9 @@ namespace CalamityMod.CalPlayer if (it.type == ItemType()) playerUsingWeapon = false; + if (it.type == ItemType()) + playerUsingWeapon = false; + // Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle. // "Clockwork" weapons can chain-fire multiple stealth strikes (really only 2 max) until you run out of stealth. bool animationCheck = it.useAnimation == it.useTime diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index 3b4064ccb5..d5dc58b3ad 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -330,7 +330,7 @@ namespace CalamityMod.CalPlayer // Lower chance of Spadefish in Hardmode if (underground) // Underground { - int chance = Main.hardMode ? 10 : 2; + int chance = Main.hardMode ? 10 : 4; if (attempt.veryrare && Main.rand.NextBool(chance)) { itemDrop = ModContent.ItemType(); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 7b29d85003..ed3d0c1c42 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -502,7 +502,7 @@ namespace CalamityMod.CalPlayer for (int index = 0; index < target.buffType.Length; index++) { int type = target.buffType[index]; - var debuffData = BuffDatasets.DebuffDataset[type]; + var debuffData = CalamityBuffSets.DebuffDataset[type]; if (debuffData != null) numOfDebuffs++; } @@ -727,70 +727,10 @@ namespace CalamityMod.CalPlayer if (npc.Calamity().antlionCloudDebuffTimer > 0) modifiers.SourceDamage *= AntlionSkewer.CloudDamageDebuffMult; - // Enemies deal less contact damage while sick, due to being weakened. - if (npc.poisoned) - { - float damageReductionFromPoison = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); - if (npc.Calamity().VulnerableToSickness.HasValue) - { - if (npc.Calamity().VulnerableToSickness.Value) - damageReductionFromPoison *= 2f; - else - damageReductionFromPoison /= 2f; - } - damageReductionFromPoison = 1f - damageReductionFromPoison; - - modifiers.SourceDamage *= damageReductionFromPoison; - } - - if (npc.venom) - { - float damageReductionFromVenom = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); - if (npc.Calamity().VulnerableToSickness.HasValue) - { - if (npc.Calamity().VulnerableToSickness.Value) - damageReductionFromVenom *= 2f; - else - damageReductionFromVenom /= 2f; - } - damageReductionFromVenom = 1f - damageReductionFromVenom; - - modifiers.SourceDamage *= damageReductionFromVenom; - } - - if (npc.Calamity().astralInfection) - { - float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); - if (npc.Calamity().VulnerableToSickness.HasValue) - { - if (npc.Calamity().VulnerableToSickness.Value) - damageReductionFromAstralInfection *= 2f; - else - damageReductionFromAstralInfection /= 2f; - } - damageReductionFromAstralInfection = 1f - damageReductionFromAstralInfection; - - modifiers.SourceDamage *= damageReductionFromAstralInfection; - } - - if (npc.Calamity().plague) - { - float damageReductionFromPlague = (float)((npc.Calamity().irradiated? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); - if (npc.Calamity().VulnerableToSickness.HasValue) - { - if (npc.Calamity().VulnerableToSickness.Value) - damageReductionFromPlague *= 2f; - else - damageReductionFromPlague /= 2f; - } - damageReductionFromPlague = 1f - damageReductionFromPlague; - - modifiers.SourceDamage *= damageReductionFromPlague; - } - + // Whispering Death makes enemies deal less damage if (npc.Calamity().whisperingDeath) { - float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f); + float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * WhisperingDeath.EnemyDamageReduction); if (npc.Calamity().VulnerableToSickness.HasValue) { if (npc.Calamity().VulnerableToSickness.Value) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 002fa8447a..77bfe9b3c8 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -198,18 +198,18 @@ namespace CalamityMod.CalPlayer int buff = Player.buffType[l]; if (buff <= 0) continue; - var data = BuffDatasets.DebuffDataset[buff]; + var data = CalamityBuffSets.DebuffDataset[buff]; if (data?.AlcoholLevel > 0) alcoholPoisonLevel += data.AlcoholLevel; } if (dripPlayer.ivDripEquipped && dripPlayer.currentAlcohol != AlcoholType.None) { - int ivBuffID = BuffDatasets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol); + int ivBuffID = CalamityBuffSets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol); if (ivBuffID != -1) { - var ivData = BuffDatasets.DebuffDataset[ivBuffID]; + var ivData = CalamityBuffSets.DebuffDataset[ivBuffID]; if (ivData?.AlcoholLevel > 0) alcoholPoisonLevel += ivData.AlcoholLevel; } @@ -338,7 +338,7 @@ namespace CalamityMod.CalPlayer } // Permafrost's Concoction increases life regen while afflicted with a fire debuff - if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l] is not null && BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0)) + if (permafrostsConcoction && Player.buffType.Any(l => CalamityBuffSets.DebuffDataset[l] is not null && CalamityBuffSets.DebuffDataset[l].HeatDebuffScaling > 0)) Player.lifeRegen += 6; if (grandDadHealTimer == 0 && grandDadHealPool >= 7) @@ -588,7 +588,7 @@ namespace CalamityMod.CalPlayer if (community) { int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier); - bool lesserEffect = Player.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].AlcoholLevel > 0); + bool lesserEffect = Player.buffType.Any(i => CalamityBuffSets.DebuffDataset[i] is not null && CalamityBuffSets.DebuffDataset[i].AlcoholLevel > 0); if (Player.lifeRegen < 0) Player.lifeRegen += lesserEffect ? 1 : regenBoost; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index f32126b81f..1f005b6c9d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -908,6 +908,11 @@ namespace CalamityMod.CalPlayer int scoriaOreID = ModContent.TileType(); int abyssKelpID = ModContent.TileType(); + // Auric Ore causes an Auric Rejection unless you are wearing Auric Armor or have God Mode + // Auric Rejection causes an electrical explosion that yeets the player a considerable distance + // CIT 17AUG2024: Despite providing full invulnerability, Silva armor revive intentionally does not prevent Auric rejection's yeeting. + // 25FEB2025 Ozzatron: Added external bool to control Auric Rejection immunity from the ore. + bool rejectionImmunity = auricSet || seraphTracers || Player.creativeGodMode || externalAuricRejectionImmunity; int auricRejectionDamage = 300; float auricRejectionKB = Player.noKnockback ? 20f : 40f; @@ -944,11 +949,6 @@ namespace CalamityMod.CalPlayer Player.AddBuff(BuffID.Burning, 2); } - // Auric Ore causes an Auric Rejection unless you are wearing Auric Armor or have God Mode - // Auric Rejection causes an electrical explosion that yeets the player a considerable distance - // CIT 17AUG2024: Despite providing full invulnerability, Silva armor revive intentionally does not prevent Auric rejection's yeeting. - // 25FEB2025 Ozzatron: Added external bool to control Auric Rejection immunity from the ore. - bool rejectionImmunity = auricSet || seraphTracers || Player.creativeGodMode || externalAuricRejectionImmunity; bool oreRejection = (tile.TileType == auricOreID) && !rejectionImmunity; // Repulsers always perform this effect because they are player-placed tiles made for this exact purpose @@ -975,6 +975,19 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center); } } + + if (Player.sitting.TryGetSittingBlock(Player, out Tile AuricToiletTile) && !rejectionImmunity) + { + if (AuricToiletTile.TileType == ModContent.TileType()) + { + Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").ToNetworkText(Player.name)), auricRejectionDamage, 0); + Player.AddBuff(ModContent.BuffType(), 120); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center); + Player.sitting.SitUp(Player, false); + Vector2 yeetVec = new Vector2(Player.direction, -1.5f); + Player.velocity += yeetVec * auricRejectionKB; + } + } } private void HandleBlazingMouseEffects() { @@ -1708,6 +1721,7 @@ namespace CalamityMod.CalPlayer fishStockOldPower.Item2, fishStockOldPower.Item3, fishStockOldPower.Item4); + fishStockPower = newFishStockPower; } // Stats Player.GetDamage() += 0.15f * fishStockPower; @@ -2381,7 +2395,7 @@ namespace CalamityMod.CalPlayer if (bloomStoneTotalHeal > 0) { - float healRateDiv = (Player.statLife >= Player.statLifeMax ? 5 : // 5 times as slow if at max hp already (overheal prevention) + float healRateDiv = (Player.statLife >= Player.statLifeMax ? 2 : // 2 times as slow if at max hp already (overheal prevention) bloomStoneBuffedHealRateTimer > 0 ? Utils.Remap(bloomStoneBuffedHealRateTimer, 90, 0, 0.5f, 1f, true) // 2 times faster if pollen buffed, scales back down to regular speed as the buff fades : 1); // Regular speed bloomStoneHealRate = 1 / healRateDiv; @@ -3837,7 +3851,7 @@ namespace CalamityMod.CalPlayer Player.lifeMagnet = true; if (whisperingDeath && !laudanum) - Player.GetDamage() -= 0.2f; + Player.GetDamage() -= WhisperingDeath.PlayerDamageReduction; if (armorCrunch && !laudanum) { @@ -4450,7 +4464,7 @@ namespace CalamityMod.CalPlayer else if (hasBuff == ModContent.BuffType()) { Player.lifeRegenCount += 5; - Player.GetDamage() += 0.2f; + Player.GetDamage() += WhisperingDeath.PlayerDamageReduction; } switch (hasBuff) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 2861e37bc3..a0102e7693 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -456,6 +456,15 @@ namespace CalamityMod.CalPlayer GungeonMusicSystem.GUN(); } + // Used by Megalodon, Seadragon & Voidragon, allows bullets to track their damage scaling + if (cgp.sharkBullets) + { + if (proj.numHits == 0) + { + sharkGunDamageScaling++; + } + } + if (cgp.fireBullet) { target.AddBuff(BuffID.OnFire3, 60); @@ -1289,7 +1298,7 @@ namespace CalamityMod.CalPlayer //Nanotech has the same heal as Electrician's glove Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, electricianGlove ? 2f : 3f); - if (proj.CountsAsClass() && Player.HeldItem.CountsAsClass()) + if (proj.CountsAsClass()) { if (manaOverloader) { diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index 2a70fe931f..69e430fd75 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -9,88 +9,6 @@ using Terraria.ModLoader; namespace CalamityMod.DataStructures { - [ReinitializeDuringResizeArrays] - public static class BuffDatasets - { - private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level }; - public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData") - .Description("Stores DebuffData for a particular debuff") - .RegisterCustomSet(null, - BuffID.OnFire, DebuffData.OnFire, - BuffID.OnFire3, DebuffData.Hellfire, - BuffID.CursedInferno, DebuffData.CursedInferno, - BuffID.ShadowFlame, DebuffData.Shadowflame, - BuffID.Daybreak, DebuffData.Daybroken, - BuffID.Burning, DebuffData.Burning, - BuffID.Frostburn, DebuffData.Frostburn, - BuffID.Frostburn2, DebuffData.Frostbite, - BuffID.Poisoned, DebuffData.Poisoned, - BuffID.Venom, DebuffData.AcidVenom, - BuffID.Electrified, DebuffData.Electrified, - BuffID.Oiled, DebuffData.Oiled, - - BuffID.Tipsy, Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - ModContent.BuffType(), Alch(1), - - ModContent.BuffType(), Alch(2), - ModContent.BuffType(), Alch(3) - ); - public static int GetBuffIDFromAlcoholType(AlcoholType type) - { - return type switch - { - AlcoholType.BaconOil => ModContent.BuffType(), - AlcoholType.BloodyMary => ModContent.BuffType(), - AlcoholType.CaribbeanRum => ModContent.BuffType(), - AlcoholType.CinnamonRoll => ModContent.BuffType(), - AlcoholType.Everclear => ModContent.BuffType(), - AlcoholType.EvergreenGin => ModContent.BuffType(), - AlcoholType.Fireball => ModContent.BuffType(), - AlcoholType.GrapeBeer => ModContent.BuffType(), - AlcoholType.Manhattan => ModContent.BuffType(), - AlcoholType.Margarita => ModContent.BuffType(), - AlcoholType.Moonshine => ModContent.BuffType(), - AlcoholType.MoscowMule => ModContent.BuffType(), - AlcoholType.OldFashioned => ModContent.BuffType(), - AlcoholType.PurpleHaze => ModContent.BuffType(), - AlcoholType.RedWine => ModContent.BuffType(), - AlcoholType.Rum => ModContent.BuffType(), - AlcoholType.Screwdriver => ModContent.BuffType(), - AlcoholType.StarBeamRye => ModContent.BuffType(), - AlcoholType.Tequila => ModContent.BuffType(), - AlcoholType.TequilaSunrise => ModContent.BuffType(), - AlcoholType.Vodka => ModContent.BuffType(), - AlcoholType.Whiskey => ModContent.BuffType(), - AlcoholType.WhiteWine => ModContent.BuffType(), - - // Vanilla treats both Ale and Sake as the "Tipsy" buff - AlcoholType.Ale => BuffID.Tipsy, - AlcoholType.Sake => BuffID.Tipsy, - - _ => -1 - }; - } - } public class DebuffData { /// diff --git a/Effects/AbyssalFireShader.fx b/Effects/AbyssalFireShader.fx new file mode 100644 index 0000000000..6a4a7a5e01 --- /dev/null +++ b/Effects/AbyssalFireShader.fx @@ -0,0 +1,79 @@ +sampler noiseTexture : register(s1); +sampler noiseTexture2 : register(s2); + +float time; +float glowPower; +float overallColorStrength; +float2 noiseScale; +float2 edgeFadeoutThreshold; +float3 innerColor; +float3 outerColor; +float3 overallColor; +float3 tipColor; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float3 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float3 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput) 0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +float InverseLerp(float from, float to, float x) +{ + return saturate((x - from) / (to - from)); +} + +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + + // Fade out at the horizontal and vertical ends of the streak. + float horizonatalDistanceFromCenter = distance(0.5, coords.y); + float opacity = smoothstep(0.5, 0.5 - edgeFadeoutThreshold, horizonatalDistanceFromCenter); + + // Calculate the main nosie color and distortion. + float4 noiseDistortion = tex2D(noiseTexture, coords * float2(4, 2) + float2(time * -0.72, time * 0.51)); + float4 noiseColor = tex2D(noiseTexture, coords * noiseScale + float2(time * -2.42 - noiseDistortion.r * 0.8, time * -1.33 + noiseDistortion.r * 0.8)); + + // Calculate how much a pixel should glow from the center outwards. + float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower); + + // Render as white near the tip of the flame jet, then ease into the inner and outer colors of the jet. + float3 flameBodyColor = lerp(tipColor, lerp(outerColor, innerColor, opacity), InverseLerp(0, 0.092, coords.x)); + float3 finalFlameColor = lerp(flameBodyColor, overallColor, overallColorStrength); + + float4 returnColor = (color * float4(finalFlameColor, 1) + noiseColor * glow) * opacity; + return returnColor; +} + +technique Technique1 +{ + pass LaserPass + { + VertexShader = compile vs_3_0 VertexShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); + } +} diff --git a/Effects/AbyssalFireShader.xnb b/Effects/AbyssalFireShader.xnb new file mode 100644 index 0000000000..9ebdc9a6d2 Binary files /dev/null and b/Effects/AbyssalFireShader.xnb differ diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 0e06aeef01..18993d5e2d 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -254,6 +254,9 @@ namespace CalamityMod.Effects // The distorted circular effect seen emanating from the distortion rift during DoG's fight. internal static Asset DoGRiftAuraShader; + + // The shader effect used for Voidragon's Abyssal Fire laser projectile. + internal static Asset AbyssalFireShader; #endregion #region Big E's Shaders @@ -513,6 +516,9 @@ namespace CalamityMod.Effects DoGRiftAuraShader = LoadShader("DoGRiftAuraShader"); RegisterMiscShader(DoGRiftAuraShader, "DoGRiftAuraPass", "DoGRiftAura"); + + AbyssalFireShader = LoadShader("AbyssalFireShader"); + RegisterMiscShader(AbyssalFireShader, "LaserPass", "AbyssalFire"); #endregion #region Loading Big E's Shaders diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index ffab2d16b6..ce412a01e9 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -186,7 +186,13 @@ namespace CalamityMod.Events new Boss(NPCID.QueenBee, permittedNPCs: new int[] { NPCID.Bee, NPCID.BeeSmall, NPCID.LittleHornetHoney, NPCID.HornetHoney, NPCID.BigHornetHoney }), - new Boss(NPCID.Deerclops), + new Boss(NPCID.Deerclops, spawnContext: type => + { + Player plr = Main.player[ClosestPlayerToWorldCenter]; + int deer = NPC.NewNPC(Source, (int)plr.Center.X, (int)(plr.Center.Y - 400f), type, 1); + Main.npc[deer].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(deer); + } ), new Boss(NPCID.SkeletronHead, TimeChangeContext.Night, type => { @@ -700,7 +706,8 @@ namespace CalamityMod.Events // Killing any split Deus head ends the fight instantly. You don't need to kill both. else if (npc.type == ModContent.NPCType() && npc.Calamity().newAI[0] != 0f) { - BossRushStage++; + if (BossRushStage <= Bosses.FindIndex(boss => boss.EntityID == ModContent.NPCType())) + BossRushStage++; CalamityUtils.KillAllHostileProjectiles(); HostileProjectileKillCounter = 3; } diff --git a/Gores/MegalodonCasing.png b/Gores/MegalodonCasing.png new file mode 100644 index 0000000000..642d500372 Binary files /dev/null and b/Gores/MegalodonCasing.png differ diff --git a/Gores/MegalodonMag.png b/Gores/MegalodonMag.png new file mode 100644 index 0000000000..c5e53a621d Binary files /dev/null and b/Gores/MegalodonMag.png differ diff --git a/Gores/SeadragonCasing.png b/Gores/SeadragonCasing.png new file mode 100644 index 0000000000..7faaa79ce6 Binary files /dev/null and b/Gores/SeadragonCasing.png differ diff --git a/Gores/SeadragonMag.png b/Gores/SeadragonMag.png new file mode 100644 index 0000000000..681b0094dd Binary files /dev/null and b/Gores/SeadragonMag.png differ diff --git a/Gores/VoidragonCasing.png b/Gores/VoidragonCasing.png new file mode 100644 index 0000000000..ba46e75c91 Binary files /dev/null and b/Gores/VoidragonCasing.png differ diff --git a/Gores/VoidragonMag.png b/Gores/VoidragonMag.png new file mode 100644 index 0000000000..76f97f7169 Binary files /dev/null and b/Gores/VoidragonMag.png differ diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 324678faa4..086b566167 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -850,5 +850,39 @@ namespace CalamityMod.ILEditing }); } #endregion + + #region Remove Vanilla Whip Tag Crits + // Code written by Habble + /// + /// IL edits both vanilla whip crit tags' crit bool set calls to ensure they're never assigned a new value + /// + /// + private static void PreventVanillaWhipTagCrits(ILContext context) + { + ILCursor cursor = new(context); + #region Morning Star + // Go to the unique instructions nearest to the Morning Star tag's crit roll and then stand before the crit bool set call + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc(59)) || !cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(30))) + { + LogFailure("Removing vanilla whip tag crits", "Could not locate the crit bool set call under Morning Star tag"); + return; + } + // Put the previous value of the crit bool on the stack to then return that instead of the supplied value by "consuming" them as parameters, so as to not overwrite it + // This is more ideal than modifying label conditions because it is likelier for the latter to change over time + cursor.Emit(OpCodes.Ldloc, 30); + cursor.EmitDelegate((int input, bool originalValue) => originalValue.ToInt()); + #endregion Morning Star + #region Kaleidoscope + // Similar deal for Kaleidoscope as well + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc(30)) || !cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(30))) + { + LogFailure("Removing vanilla whip tag crits", "Could not locate the crit bool set call under Kaleidoscope tag"); + return; + } + cursor.Emit(OpCodes.Ldloc, 30); + cursor.EmitDelegate((int input, bool originalValue) => originalValue.ToInt()); + #endregion Kaleidoscope + } + #endregion } } diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index a4463dddb6..4000c108ed 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -104,6 +104,7 @@ namespace CalamityMod.ILEditing // Damage and health balance On_Main.DamageVar_float_int_float += AdjustDamageVariance; IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling; + IL_Projectile.Damage += PreventVanillaWhipTagCrits; IL_Projectile.Damage += VanillaBossResistChanges; IL_Projectile.AI_026 += PygmyAggroOnClosestPointInHitbox; IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; diff --git a/Items/Accessories/DaawnlightSpiritOrigin.cs b/Items/Accessories/DaawnlightSpiritOrigin.cs index 45154ca3ab..1e6b2dbbc3 100644 --- a/Items/Accessories/DaawnlightSpiritOrigin.cs +++ b/Items/Accessories/DaawnlightSpiritOrigin.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(15). AddIngredient(15). AddIngredient(ItemID.LunarBar, 10). - AddIngredient(4). + AddIngredient(ItemID.FragmentVortex, 5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/EtherealExtorter.cs b/Items/Accessories/EtherealExtorter.cs index 50d9ae909a..0a3073ee10 100644 --- a/Items/Accessories/EtherealExtorter.cs +++ b/Items/Accessories/EtherealExtorter.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int soulDamage => 15; + public static int soulDamage => 20; public override void SetDefaults() { Item.width = 28; diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 948499ad65..3f22fbf8c0 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Accessories public override bool CanEquipAccessory(Player player, int slot, bool modded) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.brimElemental || modPlayer.sandElemental || modPlayer.rareSandElemental || modPlayer.cloudElemental || modPlayer.waterElemental) + if (modPlayer.brimElemental || modPlayer.sandElemental || modPlayer.oasisElemental || modPlayer.cloudElemental || modPlayer.waterElemental) { return false; } @@ -177,7 +177,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index 911e8cafbe..6616b0030f 100644 --- a/Items/Accessories/MoonstoneCrown.cs +++ b/Items/Accessories/MoonstoneCrown.cs @@ -56,7 +56,8 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(ItemID.LunarBar, 5). - AddIngredient(5). + AddIngredient(ItemID.FragmentNebula, 5). + AddIngredient(2). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index c327cbdd88..b6472598ad 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -39,6 +40,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(). AddIngredient(). + AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). AddTile(). Register(); diff --git a/Items/Accessories/RareElementalinaBottle.cs b/Items/Accessories/OasisElementalinaBottle.cs similarity index 80% rename from Items/Accessories/RareElementalinaBottle.cs rename to Items/Accessories/OasisElementalinaBottle.cs index 6dafdf72e7..f3315de701 100644 --- a/Items/Accessories/RareElementalinaBottle.cs +++ b/Items/Accessories/OasisElementalinaBottle.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -8,8 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - [LegacyName("WifeinaBottlewithBoobs")] // Yes, that was the actual name. - public class RareElementalinaBottle : ModItem, ILocalizedModType + [LegacyName("WifeinaBottlewithBoobs", "RareElementalinaBottle")] // Yes, that was the actual name. + public class OasisElementalinaBottle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; @@ -38,12 +39,12 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.rareSandElemental = true; + modPlayer.oasisElemental = true; if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { @@ -59,12 +60,12 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.rareSandElementalVanity = true; + modPlayer.oasisElementalVanity = true; if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/RareElementalinaBottle.png b/Items/Accessories/OasisElementalinaBottle.png similarity index 100% rename from Items/Accessories/RareElementalinaBottle.png rename to Items/Accessories/OasisElementalinaBottle.png diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index c9c1807c50..59558577fa 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -36,7 +36,11 @@ namespace CalamityMod.Items.Accessories public const int maxMinionRequirement = 10; public const int maxPscAnimTime = 120; - public static SummonTag SummonTag = new() { MultiplicativeTagDamage = 0.2f, TagModifyHitEffects = ApplyTagModifyHit, AutoDrawTooltip = false }; + public static SummonTag SummonTag = new() { + MultiplicativeTagDamage = 0.2f, + TagModifyHitEffects = ApplyTagModifyHit, + AutoDrawTooltip = false + }; public static void ApplyTagModifyHit(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance) { @@ -221,7 +225,7 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - SummonTag.TagItem = Item.type; + SummonTag.TagItem = Type; SummonTag.TagTexture = TextureAssets.Item[Type]; Item.width = 50; Item.height = 50; diff --git a/Items/Accessories/ProtolithBangle.cs b/Items/Accessories/ProtolithBangle.cs index b80f6f8225..ccb02720ab 100644 --- a/Items/Accessories/ProtolithBangle.cs +++ b/Items/Accessories/ProtolithBangle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; public static int cooldown = 420; - public static int damage = 60; + public static int damage = 30; public override void SetDefaults() { Item.width = 34; diff --git a/Items/Accessories/QuiverofNihility.cs b/Items/Accessories/QuiverofNihility.cs index 9efd1466f7..57ce750d51 100644 --- a/Items/Accessories/QuiverofNihility.cs +++ b/Items/Accessories/QuiverofNihility.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddRecipeGroup("AnyQuiver"). - AddIngredient(5). + AddIngredient(ItemID.FragmentVortex, 5). AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 4d4836af00..981577f498 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -39,11 +39,11 @@ namespace CalamityMod.Items.Accessories modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit modPlayer.amalgam = true; player.brainOfConfusionItem = Item; - modPlayer.HeatDebuffMultiplier += 3f; - modPlayer.ColdDebuffMultiplier += 3f; - modPlayer.SicknessDebuffMultiplier += 3f; - modPlayer.WaterDebuffMultiplier += 3f; - modPlayer.ElectricDebuffMultiplier += 3f; + modPlayer.HeatDebuffMultiplier += 2f; + modPlayer.ColdDebuffMultiplier += 2f; + modPlayer.SicknessDebuffMultiplier += 2f; + modPlayer.WaterDebuffMultiplier += 2f; + modPlayer.ElectricDebuffMultiplier += 2f; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusBreastplate.cs b/Items/Armor/Daedalus/DaedalusBreastplate.cs index fd2394ccd7..1b29e447df 100644 --- a/Items/Armor/Daedalus/DaedalusBreastplate.cs +++ b/Items/Armor/Daedalus/DaedalusBreastplate.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(15). - AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index b93e9b2d92..188e83ea26 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -58,7 +58,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadMelee.cs b/Items/Armor/Daedalus/DaedalusHeadMelee.cs index 09107dbbf4..e5e8e4b668 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMelee.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMelee.cs @@ -58,7 +58,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index b52bf0a10a..0eadffe839 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -56,7 +56,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRogue.cs b/Items/Armor/Daedalus/DaedalusHeadRogue.cs index 495458d722..2007d1a7df 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRogue.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRogue.cs @@ -62,7 +62,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusHeadSummon.cs b/Items/Armor/Daedalus/DaedalusHeadSummon.cs index ec516460a0..2b2026327c 100644 --- a/Items/Armor/Daedalus/DaedalusHeadSummon.cs +++ b/Items/Armor/Daedalus/DaedalusHeadSummon.cs @@ -75,7 +75,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Daedalus/DaedalusLeggings.cs b/Items/Armor/Daedalus/DaedalusLeggings.cs index 0d45fae2e7..34b19ad388 100644 --- a/Items/Armor/Daedalus/DaedalusLeggings.cs +++ b/Items/Armor/Daedalus/DaedalusLeggings.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Armor.Daedalus { CreateRecipe(). AddIngredient(10). - AddIngredient(2). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index b4e1b3c222..6f36d82ac4 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Armor public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), RogueVelocityBoost.ToPercent()); // Set Bonus - public static float SetBonusRogueStealth = 0.4f; + public static float SetBonusRogueStealth = 1.05f; public static int TagDuration = CalamityUtils.SecondsToFrames(10); public static int StormManaCost = 60; public static int StormCooldown = 45; @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Armor { //These tag damage fields determine the damage of the spawned eater. The resulting number from each is added together //So, 0.5 multiplicative and 10 flat would make the damage be 50% of the spawning hit's damage, plus 10 more. - //If you want entirely flt, set multiplicative to 0. If you want entirely multiplicative, set flat to 0. + //If you want entirely flat, set multiplicative to 0. If you want entirely multiplicative, set flat to 0. MultiplicativeTagDamage = 0.25f, FlatTagDamage = 5, AllowsWhipStacking = true, @@ -57,7 +57,6 @@ namespace CalamityMod.Items.Armor if (!Main.dedServ) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; summonTag.TagItem = Type; - CalamityBuffSets.SummonTagDebuff.Add(ModContent.BuffType(),summonTag); } public override void SetDefaults() diff --git a/Items/Armor/GemTech/GemTechBodyArmor.cs b/Items/Armor/GemTech/GemTechBodyArmor.cs index 4e5af57b08..0470808230 100644 --- a/Items/Armor/GemTech/GemTechBodyArmor.cs +++ b/Items/Armor/GemTech/GemTechBodyArmor.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GemTech @@ -25,7 +26,11 @@ namespace CalamityMod.Items.Armor.GemTech { CreateRecipe() .AddIngredient(16) - .AddIngredient(5) + .AddIngredient(ItemID.FragmentSolar, 5) + .AddIngredient(ItemID.FragmentVortex, 5) + .AddIngredient(ItemID.FragmentNebula, 5) + .AddIngredient(ItemID.FragmentStardust, 5) + .AddIngredient(5) .AddIngredient(2) .AddTile() .Register(); diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index cc96471327..af3aecac6d 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -4,6 +4,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -150,7 +151,11 @@ namespace CalamityMod.Items.Armor.GemTech { CreateRecipe(). AddIngredient(10). - AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 5). + AddIngredient(ItemID.FragmentVortex, 5). + AddIngredient(ItemID.FragmentNebula, 5). + AddIngredient(ItemID.FragmentStardust, 5). + AddIngredient(5). AddIngredient(2). AddTile(). SortBeforeFirstRecipesOf(ModContent.ItemType()). diff --git a/Items/Armor/GemTech/GemTechSchynbaulds.cs b/Items/Armor/GemTech/GemTechSchynbaulds.cs index 84ba7d24ea..178c1cade7 100644 --- a/Items/Armor/GemTech/GemTechSchynbaulds.cs +++ b/Items/Armor/GemTech/GemTechSchynbaulds.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GemTech @@ -26,7 +27,11 @@ namespace CalamityMod.Items.Armor.GemTech { CreateRecipe(). AddIngredient(12). - AddIngredient(4). + AddIngredient(ItemID.FragmentSolar, 4). + AddIngredient(ItemID.FragmentVortex, 4). + AddIngredient(ItemID.FragmentNebula, 4). + AddIngredient(ItemID.FragmentStardust, 4). + AddIngredient(4). AddIngredient(2). AddTile(). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index 6e4f64d76f..b35d5bc00d 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(15). - AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index 1eb312a365..c6961124b2 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -62,7 +62,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs index dad4af3e81..eafe23a27c 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs @@ -60,7 +60,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs index 4aaa9d6e2c..e772532f66 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs @@ -58,7 +58,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs index c64bfd93f5..c906206ff5 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs @@ -62,7 +62,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs index a13dce4e57..86ad6eba9f 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs @@ -76,7 +76,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs index 2dcac69f9c..f896863d03 100644 --- a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs +++ b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(10). - AddIngredient(2). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs index 4eb7dc362e..83f1874634 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 28; + Item.defense = 20; Item.rare = ModContent.RarityType(); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index 7e881b56ac..beb164e68f 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 19; + Item.defense = 15; Item.rare = ModContent.RarityType(); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs index 60637a499a..d0d6e96c73 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 22; + Item.defense = 15; Item.rare = ModContent.RarityType(); } diff --git a/Items/Armor/Reaver/ReaverCuisses.cs b/Items/Armor/Reaver/ReaverCuisses.cs index f44835ab63..991ad6b50e 100644 --- a/Items/Armor/Reaver/ReaverCuisses.cs +++ b/Items/Armor/Reaver/ReaverCuisses.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Armor.Reaver { CreateRecipe(). AddIngredient(10). - AddIngredient(2). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 26598da235..307e36a692 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -75,7 +75,6 @@ namespace CalamityMod.Items.Armor.Reaver { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Reaver/ReaverHeadMobility.cs b/Items/Armor/Reaver/ReaverHeadMobility.cs index ec0e3a7efd..613eb37fb2 100644 --- a/Items/Armor/Reaver/ReaverHeadMobility.cs +++ b/Items/Armor/Reaver/ReaverHeadMobility.cs @@ -59,7 +59,6 @@ namespace CalamityMod.Items.Armor.Reaver { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index 8d84aede61..6ab102d56c 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -62,7 +62,6 @@ namespace CalamityMod.Items.Armor.Reaver { CreateRecipe(). AddIngredient(7). - AddIngredient(). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 90cba4743e..60d307b21b 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Items.Armor.Reaver { CreateRecipe(). AddIngredient(15). - AddIngredient(3). AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); diff --git a/Items/Armor/Victide/VictideBreastplate.cs b/Items/Armor/Victide/VictideBreastplate.cs index 9c7c4f70b3..e8b69229de 100644 --- a/Items/Armor/Victide/VictideBreastplate.cs +++ b/Items/Armor/Victide/VictideBreastplate.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Victide public new string LocalizationCategory => "Items.Armor.PreHardmode"; public string BulkTexture => "CalamityMod/Items/Armor/Victide/VictideBreastplate_Bulk"; - public static int RegenBoost = 2; + public static int RegenBoost = 1; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond()); diff --git a/Items/Armor/Victide/VictideHeadBarrier.cs b/Items/Armor/Victide/VictideHeadBarrier.cs index 4049099c85..46a72067b4 100644 --- a/Items/Armor/Victide/VictideHeadBarrier.cs +++ b/Items/Armor/Victide/VictideHeadBarrier.cs @@ -16,15 +16,15 @@ namespace CalamityMod.Items.Armor.Victide { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static int RegenBoost = 2; - public static float RunAccelerationMult = 1.75f; + public static int RegenBoost = 1; + public static float RunAccelerationMult = 1.25f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), RunAccelerationMult.Round()); // Set Bonus public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8); - public static int BarrierDefenseBoost = 6; + public static int BarrierDefenseBoost = 4; public static float BarrierDamageAbsorptionPercent = 0.1f; - public static int BarrierFramesPerHeal = 15; + public static int BarrierFramesPerHeal = 30; public static int BarrierDamage = 50; public static float BarrierExplosionKB = 8f; diff --git a/Items/Armor/Victide/VictideHeadBurrow.cs b/Items/Armor/Victide/VictideHeadBurrow.cs index 5618cd3570..62b3d6234e 100644 --- a/Items/Armor/Victide/VictideHeadBurrow.cs +++ b/Items/Armor/Victide/VictideHeadBurrow.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Items.Armor.Victide public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedAccelerationBoost.ToPercent()); // Set Bonus - public static float BaseBurrowSpeed = 9f; // 46 mph - public static float SubmergedBurrowSpeed = 12f; // 61 mph + public static float BaseBurrowSpeed = 8f; // 41 mph + public static float SubmergedBurrowSpeed = 10f; // 51 mph public static float BaseAcceleration = 0.4f; // For reference, base player running acceleration is 0.08 - public static int BurrowDuration = CalamityUtils.SecondsToFrames(7); + public static int BurrowDuration = CalamityUtils.SecondsToFrames(5); public static int BurrowCooldown = CalamityUtils.SecondsToFrames(30); public override void SetDefaults() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d7a05de04f..17967c5c79 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1097,6 +1097,11 @@ namespace CalamityMod.Items { player.Calamity().critDamage += 0.15f; } + if (item.type == ItemID.ReconScope) + { + player.GetDamage() += 0.05f; //Total 15% damage + player.GetCritChance() -= 5; //Total 5% crit + } if (item.type == ItemID.SniperScope) { player.GetDamage() -= 0.1f; //Total 0% damage @@ -1191,6 +1196,7 @@ namespace CalamityMod.Items if (item.type == ItemID.GravityGlobe) { + player.noFallDmg = true; player.GetJumpState().Enable(); if (player.Calamity().justChangedGravity) { @@ -1429,8 +1435,7 @@ namespace CalamityMod.Items #region PostUpdate public override void PostUpdate(Item item) { - if (CalamityItemSets.ItemForcedInsideWorld[item.type]) - CalamityUtils.ForceItemIntoWorld(item); + CalamityUtils.ForceItemIntoWorld(item); } #endregion diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index f72f465add..c2083f071c 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Items int standardTooltipCount = 0; for (int i = 0; i < tooltips.Count; i++) { - if (tooltips[i].Name.StartsWith("Tooltip")) + if (tooltips[i]?.Name?.StartsWith("Tooltip") == true) { if (firstTooltipIndex == -1) firstTooltipIndex = i; @@ -542,12 +542,8 @@ namespace CalamityMod.Items string MultTagTooltip(float mult) => (CalamityUtils.GetText($"Common.SummonTagDamageMult").Format((mult + 1).ToString("0.##"))); string CritTagTooltip(float crit) => (CalamityUtils.GetText($"Common.SummonTagCrit").Format((crit * 100).ToString("0.#"))); - Dictionary TagByItem = new(); - foreach (SummonTag tag1 in CalamityBuffSets.SummonTagDebuff.Values) - { - if (tag1.TagItem > -1) TagByItem.Add(tag1.TagItem, tag1); - } - if (TagByItem.TryGetValue(item.type, out SummonTag tag)) + var tag = CalamityBuffSets.SummonTagDebuff.FirstOrDefault(x => x is not null && x.TagItem == item.type && x.AutoDrawTooltip, null); + if (tag is not null) { if (!tag.AutoDrawTooltip) return; var modPlayer = Main.LocalPlayer.Calamity(); @@ -751,7 +747,7 @@ namespace CalamityMod.Items } #endregion - // Whip tag is dynamically generated for all whips based on the SummonTagDebuffDict, so we'll remove the vanilla tag tootlips. + // Whip tag is dynamically generated for all whips based on the SummonTagDebuff dictionary, so we'll remove the vanilla tag tootlips. #region Whip Tag removal // Additive tag changes if (item.type == ItemID.BlandWhip) @@ -836,7 +832,11 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = EditedTooltip("RifleScope2")); } if (item.type == ItemID.ReconScope) + { EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("ReconScope1")); + EditTooltipByNum(1, (line) => line.Text += AddedTooltip("ReconScope2")); + } if (item.type == ItemID.SniperScope) { EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SniperScope")); @@ -1090,7 +1090,7 @@ namespace CalamityMod.Items if (item.type == ItemID.HiveFive) AddYoyoStats(24f, 320f, 20f); if (item.type == ItemID.JungleYoyo) - AddYoyoStats(20f, 288f, 17f); + AddYoyoStats(24f, 320f, 20f); if (item.type == ItemID.Kraken) AddYoyoStats(-1f, 480f, 54f); if (item.type == ItemID.Rally) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 6b32dc8db6..9ed8e64673 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -41,19 +41,18 @@ namespace CalamityMod.Items currentTweaks = new SortedDictionary { #region CATEGORY 1: Weapon Balancing - { ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, // VANILLA: 49 DMG, 25 UT, 5 VEL + { ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(66), UseExact(7), ShootSpeedExact(18f)) }, // VANILLA: 49 DMG, 25 UT, 5 VEL { ItemID.AdamantiteRepeater, Do(UseExact(14)) }, // VANILLA: 18 UT - { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, // VANILLA: 61 DMG, 21 UT - { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, // VANILLA: 28 UT/UA, 0 RUD + { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(72), UseExact(7)) }, // VANILLA: 61 DMG, 21 UT + { ItemID.AmberStaff, Do(UseTimeExact(18), UseAnimationExact(36), ReuseDelayExact(15)) }, // VANILLA: 28 UT/UA, 0 RUD { ItemID.AmethystStaff, Do(ManaExact(2)) }, // VANILLA: 5 MANA - { ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, // VANILLA: 70 DMG, 20 UT + { ItemID.Anchor, Do(DamageExact(107)) }, // VANILLA: 70 DMG { ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade. VANILLA: 18 UT { ItemID.AquaScepter, Do(DamageRatio(0.9f)) }, // VANILLA: 27 DMG. Uses ratios due to remix seed { ItemID.Bananarang, Do(DamageExact(60)) }, // VANILLA: 45 DMG { ItemID.BatScepter, Do(DamageExact(50)) }, // VANILLA: 45 DMG { ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, // VANILLA: 52 DMG, 20 UT, 6.5 KB { ItemID.BeeGun, Do(DamageExact(11)) }, // VANILLA: 9 DMG - { ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, // VANILLA: 30 DMG { ItemID.Beenade, Do(UseTimeExact(22), ShootSpeedExact(10f)) }, // VANILLA: 15 UT, 6 VEL { ItemID.BeesKnees, Do(DamageExact(21), UseExact(35)) }, // VANILLA: 23 DMG, 23 UT { ItemID.Bladetongue, Do(UseTurn, DamageExact(120), UseExact(22)) }, // VANILLA: 55 DMG, 28 UT @@ -63,22 +62,22 @@ namespace CalamityMod.Items { ItemID.BluePhaseblade, phaseblade }, { ItemID.BluePhasesaber, phasesaber }, { ItemID.BoneSword, Do(UseTurn, DamageExact(25)) }, // VANILLA: 19 DMG - { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, // VANILLA: 29 DMG, 18 MANA, 3.5 VEL + { ItemID.BookofSkulls, Do(ShootSpeedExact(5.5f)) }, // VANILLA: 3.5 VEL { ItemID.Boomstick, Do(DamageExact(11)) }, // VANILLA: 14 DMG - { ItemID.BreakerBlade, Do(UseTurn, DamageExact(140)) }, // VANILLA: 70 DMG - { ItemID.CandyCornRifle, Do(DamageExact(66)) }, // VANILLA: 44 DMG + { ItemID.BreakerBlade, Do(UseTurn, DamageExact(160)) }, // VANILLA: 70 DMG + { ItemID.CandyCornRifle, Do(DamageExact(80)) }, // VANILLA: 44 DMG { ItemID.Cascade, Do(DamageExact(31)) }, // VANILLA: 27 DMG - { ItemID.ChainGuillotines, Do(DamageExact(100)) }, // VANILLA: 59 DMG + { ItemID.ChainGuillotines, Do(DamageExact(75)) }, // VANILLA: 59 DMG { ItemID.ChainGun, Do(DamageExact(35)) }, // VANILLA: 31 DMG { ItemID.ChainKnife, Do(DamageRatio(1.34f)) }, // VANILLA: 12 DMG. Uses ratios due to remix seed { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, // VANILLA: 95 DMG, 26 UT, 8 VEL - { ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(95)) }, // VANILLA: 49 DMG + { ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(80)) }, // VANILLA: 49 DMG { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, // VANILLA: 57 DMG, 16 UT { ItemID.ChristmasTreeSword, Do(UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, // VANILLA: 86 DMG, 23 UT - { ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) }, // VANILLA: 17 DMG - { ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, // VANILLA: 44 DMG, 28 UT, 4.3 VEL - { ItemID.CobaltRepeater, Do(UseExact(18)) }, // VANILLA: 23 UT - { ItemID.CobaltSword, Do(DamageExact(60), UseExact(9)) }, // VANILLA: 40 DMG, 19 UT + { ItemID.ClockworkAssaultRifle, Do(DamageExact(24)) }, // VANILLA: 17 DMG + { ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(60), UseExact(9), ShootSpeedExact(12f)) }, // VANILLA: 44 DMG, 28 UT, 4.3 VEL + { ItemID.CobaltRepeater, Do(UseExact(17)) }, // VANILLA: 23 UT + { ItemID.CobaltSword, Do(DamageExact(69), UseExact(9)) }, // VANILLA: 40 DMG, 19 UT { ItemID.Code2, Do(DamageExact(43)) }, // VANILLA: 54 DMG { ItemID.CoinGun, Do(UseExact(12)) }, // VANILLA: 8 UT { ItemID.CorruptYoyo, Do(DamageExact(20)) }, // Malaise. VANILLA: 16 DMG @@ -89,11 +88,9 @@ namespace CalamityMod.Items { ItemID.CrystalVileShard, Do(DamageExact(35)) }, // VANILLA: 25 DMG { ItemID.CursedArrow, Do(DamageExact(14)) }, // VANILLA: 17 DMG { ItemID.CursedDart, Do(DamageExact(25)) }, // VANILLA: 9 DMG - { ItemID.Cutlass, Do(DamageExact(90), UseExact(14)) }, // VANILLA: 53 DMG, 16 UT + { ItemID.Cutlass, Do(DamageExact(90), UseExact(11)) }, // VANILLA: 53 DMG, 16 UT { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, // VANILLA: 38 DMG { ItemID.DaoofPow, Do(DamageExact(85)) }, // Displays as 170 damage. VANILLA: 50 DMG (displays as 100) - { ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) }, // VANILLA: 34 DMG - { ItemID.DartRifle, Do(DamageExact(58)) }, // VANILLA: 52 DMG { ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) }, // VANILLA: 150 DMG, 16 UT { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane. VANILLA: 39 DMG. Compensation for removing aerial multiplier { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon. VANILLA: 180 DMG @@ -105,20 +102,20 @@ namespace CalamityMod.Items { ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, // VANILLA: 8.5 VEL { ItemID.EmeraldStaff, Do(DamageExact(27)) }, // VANILLA: 19 DMG { ItemID.EmpressBlade, Do(DamageExact(68)) }, // Terraprisma. VANILLA: 90 DMG - { ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, // VANILLA: 17 DMG - { ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, // VANILLA: 23 DMG, 9.5 VEL + { ItemID.EnchantedBoomerang, Do(DamageExact(21)) }, // VANILLA: 17 DMG + { ItemID.EnchantedSword, Do(UseMeleeSpeed) }, { ItemID.EndlessMusketPouch, Do(DamageExact(8)) }, // VANILLA: 7 DMG. Gives it the same damage as Tungsten Bullet { ItemID.Excalibur, Do(TrueMelee, DamageExact(170)) }, // VANILLA: 72 DMG { ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow. VANILLA: 50 DMG { ItemID.FalconBlade, Do(UseTurn, UseExact(13)) }, // VANILLA: 20 UT { ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration. VANILLA: 25 DMG, 30 UT - { ItemID.Flamarang, Do(DamageExact(37)) }, // VANILLA: 49 DMG + { ItemID.Flamarang, Do(DamageExact(40)) }, // VANILLA: 49 DMG { ItemID.Flamelash, Do(DamageExact(36)) }, // VANILLA: 32 DMG { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, // VANILLA: 35 DMG, 7 VEL { ItemID.FlowerofFire, Do(DamageRatio(0.78f)) }, // VANILLA: 48 DMG. Uses ratios due to remix seed { ItemID.FlowerPow, Do(DamageExact(80)) }, // Displays as 160 damage. VANILLA: 65 DMG (displays as 130) { ItemID.FlyingKnife, Do(DamageExact(53)) }, // VANILLA: 40 DMG - { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, // VANILLA: 49 DMG + { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(110)) }, // VANILLA: 49 DMG { ItemID.Gatligator, Do(UseExact(6)) }, // VANILLA: 7 UT { ItemID.GoldShortsword, Do(TrueMelee, DamageExact(17)) }, // VANILLA: 12 DMG { ItemID.GolemFist, Do(DamageExact(150)) }, // VANILLA: 90 DMG @@ -143,7 +140,7 @@ namespace CalamityMod.Items { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, // VANILLA: 100 DMG, 20 UT { ItemID.IronShortsword, Do(TrueMelee, DamageExact(10)) }, // VANILLA: 8 DMG { ItemID.Keybrand, Do(UseTurn) }, - { ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // VANILLA: 40 DMG. Uses ratios due to remix seed + { ItemID.KOCannon, Do(DamageRatio(3f)) }, // VANILLA: 40 DMG. Uses ratios due to remix seed { ItemID.Kraken, Do(DamageExact(65)) }, // VANILLA: 95 DMG { ItemID.LaserMachinegun, Do(DamageExact(49)) }, // VANILLA: 60 DMG { ItemID.LaserRifle, Do(DamageExact(46)) }, // VANILLA: 29 DMG @@ -156,7 +153,7 @@ namespace CalamityMod.Items { ItemID.MagicMissile, Do(DamageExact(23), UseAnimationExact(20), UseTimeExact(10)) }, // VANILLA: 35 DMG, 22 UT/UA { ItemID.Marrow, Do(DamageExact(60)) }, // VANILLA: 53 DMG { ItemID.MedusaHead, Do(DamageExact(75)) }, // VANILLA: 40 DMG - { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, // VANILLA: 200 DMG + { ItemID.Meowmere, Do(UseMeleeSpeed) }, { ItemID.MiniNukeI, Do(DamageExact(90)) }, // VANILLA: 75 DMG { ItemID.MiniNukeII, Do(DamageExact(90)) }, { ItemID.Minishark, Do(DamageExact(4)) }, // VANILLA: 6 DMG @@ -166,7 +163,6 @@ namespace CalamityMod.Items { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury. VANILLA: 140 DMG { ItemID.MoonlordBullet, Do(DamageExact(17)) }, // Luminite Bullet. VANILLA: 20 DMG { ItemID.MoonlordTurretStaff, Do(DamageExact(50)) }, // Lunar Portal Staff. VANILLA: 100 DMG - { ItemID.Muramasa, Do(CritDelta(+10)) }, // VANILLA: 4% CRIT { ItemID.MushroomSpear, Do(TrueMelee, DamageExact(100), UseExact(32)) }, // VANILLA: 60 DMG, 40 UT { ItemID.Musket, Do(DamageExact(22)) }, // VANILLA: 31 DMG { ItemID.MythrilHalberd, Do(TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, // VANILLA: 45 DMG, 26 UT, 4.5 VEL @@ -179,11 +175,11 @@ namespace CalamityMod.Items { ItemID.OrangePhaseblade, phaseblade }, { ItemID.OrangePhasesaber, phasesaber }, { ItemID.OrichalcumHalberd, Do(TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, // VANILLA: 46 DMG, 4.5 VEL - { ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, // VANILLA: 40 DMG + { ItemID.OrichalcumRepeater, Do(DamageExact(50)) }, // VANILLA: 40 DMG { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, // VANILLA: 59 DMG { ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, // VANILLA: 90 DMG, 14 VEL { ItemID.PalladiumPike, Do(TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, // VANILLA: 44 DMG, 4.4 VEL - { ItemID.PalladiumRepeater, Do(DamageExact(45)) }, // VANILLA: 37 DMG + { ItemID.PalladiumRepeater, Do(DamageExact(48)) }, // VANILLA: 37 DMG { ItemID.PalladiumSword, Do(DamageExact(150)) }, // VANILLA: 49 DMG { ItemID.PearlwoodBow, Do(DamageExact(32)) }, // VANILLA: 12 DMG { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, // VANILLA: 30 DMG @@ -232,14 +228,13 @@ namespace CalamityMod.Items { ItemID.SpiritFlame, Do(UseExact(20), ShootSpeedExact(2f)) }, // VANILLA: 22 UT, 3 VEL { ItemID.StaffofEarth, Do(DamageExact(150)) }, // VANILLA: 125 DMG { ItemID.StarCannon, Do(UseExact(18)) }, // VANILLA: 12 UT - { ItemID.StardustDragonStaff, Do(DamageExact(20)) }, // VANILLA: 40 DMG + { ItemID.StardustDragonStaff, Do(DamageExact(24)) }, // VANILLA: 40 DMG { ItemID.StormTigerStaff, Do(DamageExact(49)) }, // Desert Tiger Staff. VANILLA: 41 DMG { ItemID.StylistKilLaKillScissorsIWish, Do(UseTurn, DamageExact(21)) }, // Stylish Scissors. VANILLA: 14 DMG { ItemID.Stynger, Do(DamageExact(75)) }, // VANILLA: 45 DMG - { ItemID.SuperStarCannon, Do(DamageExact(55)) }, // VANILLA: 60 DMG - { ItemID.Swordfish, Do(TrueMelee, DamageExact(24)) }, // VANILLA: 19 DMG + { ItemID.Swordfish, Do(TrueMelee, DamageExact(21)) }, // VANILLA: 19 DMG { ItemID.TacticalShotgun, Do(DamageExact(34)) }, // VANILLA: 29 DMG - { ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, DamageExact(70), UseExact(12)) }, // Classy Cane. VANILLA: 16 DMG, 15 UT + { ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, DamageExact(80), UseExact(10)) }, // Classy Cane. VANILLA: 16 DMG, 15 UT { ItemID.TendonBow, Do(DamageExact(17)) }, // VANILLA: 19 DMG { ItemID.TerraBlade, Do(DamageExact(95)) }, // VANILLA: 85 DMG { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // VANILLA: 17 DMG @@ -249,15 +244,14 @@ namespace CalamityMod.Items { ItemID.TheRottedFork, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 17 DMG { ItemID.TheUndertaker, Do(DamageExact(15)) }, // VANILLA: 19 DMG { ItemID.ThunderSpear, Do(UseMeleeSpeed) }, // Storm Spear - { ItemID.ThunderStaff, Do(DamageExact(18)) }, // Thunder Zapper. VANILLA: 20 DMG + { ItemID.ThunderStaff, Do(DamageExact(15)) }, // Thunder Zapper. VANILLA: 20 DMG { ItemID.TitaniumRepeater, Do(DamageExact(52)) }, // VANILLA: 43 DMG - { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, // VANILLA: 61 DMG + { ItemID.TitaniumSword, Do(UseTurn, DamageExact(185)) }, // VANILLA: 61 DMG { ItemID.TitaniumTrident, Do(TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, // VANILLA: 48 DMG, 5 VEL { ItemID.TopazStaff, Do(ManaExact(2)) }, // VANILLA: 5 MANA { ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33)) }, // VANILLA: 52 DMG, 45 UT { ItemID.Toxikarp, Do(UseExact(9)) }, // VANILLA: 10 UT { ItemID.Trident, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 14 DMG - { ItemID.Trimarang, Do(DamageExact(24)) }, // VANILLA: 21 DMG { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, // VANILLA: 72 DMG { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, // VANILLA: 70 DMG { ItemID.Tsunami, Do(DamageExact(45)) }, // VANILLA: 53 DMG @@ -388,6 +382,7 @@ namespace CalamityMod.Items #region CATEGORY 4: True Melee support { ItemID.Arkhalis, trueMeleeNoSpeed }, { ItemID.CopperShortsword, trueMelee }, + { ItemID.DarkLance, trueMelee }, { ItemID.Gladius, trueMelee }, { ItemID.HallowJoustingLance, trueMelee }, { ItemID.JoustingLance, trueMelee }, @@ -404,6 +399,7 @@ namespace CalamityMod.Items #endregion #region CATEGORY 5: UseTurn + { ItemID.BeeKeeper, Do(UseTurn) }, { ItemID.BladeofGrass, Do(UseTurn) }, { ItemID.BloodButcherer, Do(UseTurn) }, { ItemID.BorealWoodSword, Do(UseTurn) }, diff --git a/Items/Fishing/Spadefish.cs b/Items/Fishing/Spadefish.cs index a7c0df913e..a2172c962b 100644 --- a/Items/Fishing/Spadefish.cs +++ b/Items/Fishing/Spadefish.cs @@ -1,28 +1,409 @@ -using Terraria.ID; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using Microsoft.CodeAnalysis; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.Achievements; +using Terraria.Graphics.Renderers; +using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.IO; namespace CalamityMod.Items.Fishing { - public class Spadefish : ModItem, ILocalizedModType + public class Spadefish : RogueWeapon, ILocalizedModType { + public static float SpinsToThrow => 3; + + public static float SpinDamageMult => 0.33f; + + public static float SpinAccel => 1.0175f; + + public static float SpinThrowVelocityMult => 1.5f; + + public override float StealthDamageMultiplier => 2f; + + public static int PickPower => 50; public new string LocalizationCategory => "Items.Fishing"; public override void SetDefaults() { Item.width = 46; Item.height = 44; - Item.damage = 15; + Item.damage = 30; Item.knockBack = 2f; - Item.useTime = 7; - Item.useAnimation = 20; - Item.pick = 34; - - Item.DamageType = DamageClass.Melee; - Item.useTurn = true; + Item.useTime = 40; + Item.useAnimation = 40; + Item.shootSpeed = 12; + Item.DamageType = RogueDamageClass.Instance; Item.useStyle = ItemUseStyleID.Swing; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item1; Item.autoReuse = true; + Item.shoot = ModContent.ProjectileType(); + Item.noMelee = true; + Item.noUseGraphic = true; + Item.pick = PickPower; + + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + if (player.Calamity().StealthStrikeAvailable()) + { + type = ModContent.ProjectileType(); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); //This proj sets StealthStrike on its own setdefaults + + player.Calamity().ConsumeStealthByAttacking(); //Due to the holdout, we manually consume stealth here and on spam. + return false; + } + player.Calamity().rogueStealth = 0; + return true; + } + + + #region Toggleable Mining + + public bool CanMine = false; + public override void ModifyTooltips(List tooltips) + { + tooltips.FindAndReplace("[TOGGLE]", CanMine ? this.GetLocalizedValue("TextWhileEnabled") : this.GetLocalizedValue("TextWhileDisabled")); + } + public override bool CanRightClick() => Main.keyState.PressingShift(); + public override void RightClick(Player player) + { + CanMine = !CanMine; + Item.NetStateChanged(); + } + public override bool ConsumeItem(Player player) => false; + public override void SaveData(TagCompound tag) + { + tag.Add("CanMine", CanMine); + } + + public override void LoadData(TagCompound tag) + { + CanMine = tag.GetBool("CanMine"); + } + + public override void NetSend(BinaryWriter writer) + { + writer.Write(CanMine); + } + + public override void NetReceive(BinaryReader reader) + { + CanMine = reader.ReadBoolean(); + } + Asset texture; + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + if (CanMine) + { + var tex = CalamityUtils.GetTextureEfficient(ref texture, "Terraria/Images/Extra_48").Value; + var dotFrame = tex.Frame(8, 39, 4, 23); + spriteBatch.Draw(tex, position + new Vector2(16, 16) * Main.inventoryScale, dotFrame, Color.White, 0, dotFrame.Size() * 0.5f, Main.inventoryScale, SpriteEffects.None, 0); + } + } + #endregion + } + + public class SpadefishThrown : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Items/Fishing/Spadefish"; + public override void SetDefaults() + { + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.penetrate = 3; + Projectile.width = 16; + Projectile.height = 16; + Projectile.friendly = true; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + Projectile.timeLeft = 480; + Projectile.MaxUpdates = 2; + Projectile.ignoreWater = true; + } + bool frameOne = true; + public override void AI() + { + if (frameOne) + { + Projectile.velocity /= Projectile.MaxUpdates; + frameOne = false; + } + if (Projectile.ai[0] <= 1 && Projectile.timeLeft < 450) + Projectile.velocity.Y += 0.08f; + if (Projectile.ai[0] == 0) + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + else if (Projectile.ai[0] == 1) + Projectile.rotation += Projectile.velocity.X * 0.15f; + + if (Projectile.timeLeft < 60) + { + Projectile.Opacity = Projectile.timeLeft / 60f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + + if (Projectile.ai[0] == 1) + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + Projectile.velocity = Vector2.Zero; + Projectile.Center += oldVelocity; + Projectile.ai[0] = 2; + SoundEngine.PlaySound(SoundID.Dig, Projectile.Center); + Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + if (Main.myPlayer == Projectile.owner && Main.LocalPlayer.HeldItem.ModItem is Spadefish s && s.CanMine) + for (var j = -1; j < 2; j++) + for (var k = -1; k < 2; k++) + Dig(Spadefish.PickPower, Projectile.Center.ToTileCoordinates() + new Point(j, k)); + return false; + } + + public static void Dig(int pickPower, Point point) + { + var tile = Main.tile[point]; + var x = tile.X(); + var y = tile.Y(); + + if (!tile.HasTile || Main.tileAxe[tile.TileType] || Main.tileHammer[tile.TileType]) + return; + + int hitIndex = Main.LocalPlayer.hitTile.HitObject(x, y, 1); + + if (tile.TileType == TileID.MysticSnakeRope) + return; + + int pickDmg = Main.LocalPlayer.GetPickaxeDamage(x, y, pickPower, hitIndex, tile); + + + if (!WorldGen.CanKillTile(x, y)) + pickDmg = 0; + + if (Main.getGoodWorld) + pickDmg *= 2; + + if (Main.LocalPlayer.DoesPickTargetTransformOnKill(Main.LocalPlayer.hitTile, pickDmg, x, y, pickPower, hitIndex, tile)) + pickDmg = 0; + + if (Main.LocalPlayer.hitTile.AddDamage(hitIndex, pickDmg) >= 100) + { + AchievementsHelper.CurrentlyMining = true; + Main.LocalPlayer.ClearMiningCacheAt(x, y, 1); + if (Main.netMode == NetmodeID.MultiplayerClient && Main.tileContainer[tile.TileType]) + { + if (tile.TileType == TileID.DisplayDoll || tile.TileType == TileID.HatRack) + NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 20, x, y); + else + { + WorldGen.KillTile(x, y, fail: true); + NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, x, y, 1f); + } + if (tile.TileType == TileID.Containers) + { + NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 1, x, y); + } + if (tile.TileType == TileID.Containers2) + { + NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 5, x, y); + } + if (tile.TileType == TileID.Dressers) + { + NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 3, x, y); + } + } + else + { + bool flag = tile.HasTile; + WorldGen.KillTile(x, y); + if (!Main.dedServ && flag && !tile.HasTile) + { + AchievementsHelper.HandleMining(); + } + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, x, y); + } + } + AchievementsHelper.CurrentlyMining = false; + } + else + { + WorldGen.KillTile(x, y, fail: true); + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, x, y, 1f); + NetMessage.SendData(MessageID.SyncTilePicking, -1, -1, null, Main.myPlayer, x, y, pickDmg); + } + } + if (pickDmg != 0) + { + Main.LocalPlayer.hitTile.Prune(); + } + } + + + + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + SoundEngine.PlaySound(SoundID.Item178 with { Pitch = -0.5f + 0.25f * Projectile.numHits + (Projectile.Calamity().stealthStrike ? 1f : 0f) }, Projectile.Center); + + Projectile.velocity.X = -Projectile.velocity.X.DirectionalSign(); + Projectile.velocity.Y = -2f; + Projectile.ai[0] = 1; + Projectile.damage /= 2; + Projectile.netUpdate = true; + } + + public override bool PreDraw(ref Color lightColor) + { + var tex = TextureAssets.Projectile[Type]; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, lightColor * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, 0); + return false; + } + } + + public class SpadefishHoldout : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Items/Fishing/Spadefish"; + + ref float spin => ref Projectile.ai[0]; + ref float startingDir => ref Projectile.ai[1]; + + float throwSpeed = 12; //changing this does nothing, as this is set in the code. This is just a fallback value if something breaks. + + bool reset = false; + + float oldSpin = 0; + int digDir = 0; + + float spinSin => MathF.Sin(spin); + public override void SetDefaults() + { + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.width = 64; + Projectile.height = 64; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.Calamity().stealthStrike = true; + Projectile.tileCollide = false; + } + + public override void Load() + { + On_LegacyPlayerRenderer.DrawPlayer += spinThePlayer; + } + + private void spinThePlayer(On_LegacyPlayerRenderer.orig_DrawPlayer orig, LegacyPlayerRenderer self, Terraria.Graphics.Camera camera, Player drawPlayer, Vector2 position, float rotation, Vector2 rotationOrigin, float shadow, float scale) + { + var t = ModContent.ProjectileType(); + if (drawPlayer.ownedProjectileCounts[t] <= 0) + { + orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, scale); + return; + } + + var Spade = Main.projectile.FirstOrDefault(p => p.active && p.owner == drawPlayer.whoAmI && p.type == t)?.ModProjectile(); + + if (Spade is null || Spade.startingDir == 0) + { + orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, scale); + return; + } + + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + using (lease.Scope(clearColor: Color.Transparent)) + { + orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, scale); + + bool flip = (Spade.spinSin * Spade.startingDir) < 0; + var tex = TextureAssets.Projectile[Type]; + Main.EntitySpriteDraw(tex.Value, drawPlayer.Center + new Vector2(40, 0) - Main.screenPosition, null, Lighting.GetColor(Spade.Projectile.Center.ToTileCoordinates()), Spade.Projectile.rotation - (flip ? MathHelper.PiOver2 : 0), tex.Size() * 0.5f, new Vector2(Spade.Projectile.scale, Spade.Projectile.scale), flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + float width = Spade.spinSin * Spade.startingDir * drawPlayer.direction; + + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.identity); + Main.spriteBatch.Draw(lease.Target, position - Main.screenPosition, null, Color.White, 0, position - Main.screenPosition, new Vector2(MathF.Abs(width), 1), width < 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + Main.spriteBatch.End(); + } + } + + public override void AI() + { + var player = Main.player[Projectile.owner]; + if (startingDir == 0) + { + startingDir = Projectile.velocity.X.DirectionalSign(); + throwSpeed = Projectile.velocity.Length(); + Projectile.velocity = Vector2.Zero; + } + player.direction = 1; + player.SetDummyItemTime((int)(player.HeldItem.useTime * player.GetWeaponAttackSpeed(player.HeldItem))); + Projectile.Center = player.Center + new Vector2(48 * spinSin, 0 * MathF.Cos(spin)) * startingDir; + Projectile.rotation = Projectile.DirectionFrom(player.Center).ToRotation() + MathHelper.PiOver4; + if (spin == 0) + { + spin = MathHelper.TwoPi; + } + spin *= Spadefish.SpinAccel; + + int res = reset ? -1 : 1; + if (res != spinSin.DirectionalSign()) + { + Projectile.ResetLocalNPCHitImmunity(); + reset = !reset; + } + + if (Projectile.timeLeft % 5 == 0 && Main.myPlayer == Projectile.owner && Main.LocalPlayer.HeldItem.ModItem is Spadefish s && s.CanMine) + for (var j = -1; j < 2; j++) + for (var k = -1; k < 2; k++) + SpadefishThrown.Dig(Spadefish.PickPower, Projectile.Center.ToTileCoordinates() + new Point(j, k)); + + if (spin > MathHelper.TwoPi * (1 + Spadefish.SpinsToThrow)) + { + player.direction = (int)startingDir; + if (Main.myPlayer == Projectile.owner) + { + var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), player.Center, player.Calamity().mouseRotationFromPlayer.ToRotationVector2() * throwSpeed * Spadefish.SpinThrowVelocityMult, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, player.whoAmI); + p.Calamity().stealthStrike = true; + } + Projectile.Kill(); + } + } + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + SoundEngine.PlaySound(SoundID.Item178 with { pitch = (spin-MathHelper.TwoPi) / (MathHelper.TwoPi * Spadefish.SpinsToThrow) - 0.5f }, Projectile.Center); + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SourceDamage *= Spadefish.SpinDamageMult; } } } diff --git a/Items/Fishing/Spadefish.png b/Items/Fishing/Spadefish.png index 27b3e76ffd..87e8d5a6fb 100644 Binary files a/Items/Fishing/Spadefish.png and b/Items/Fishing/Spadefish.png differ diff --git a/Items/Materials/GalacticaSingularity.cs b/Items/Materials/GalacticaSingularity.cs deleted file mode 100644 index f1bdcb44f6..0000000000 --- a/Items/Materials/GalacticaSingularity.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class GalacticaSingularity : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 24)); - ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Type] = true; - ItemID.Sets.SortingPriorityMaterials[Type] = 99; // Luminite - } - - public override void SetDefaults() - { - Item.width = 28; - Item.height = 28; - Item.maxStack = Item.CommonMaxStack; - Item.value = Item.sellPrice(silver: 80); - Item.rare = ItemRarityID.Red; - } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.FragmentSolar). - AddIngredient(ItemID.FragmentVortex). - AddIngredient(ItemID.FragmentNebula). - AddIngredient(ItemID.FragmentStardust). - AddTile(TileID.LunarCraftingStation). - Register(); - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float brightness = (float)Main.rand.Next(90, 111) * 0.01f; - brightness *= Main.essScale; - Lighting.AddLight((int)((Item.position.X + (float)(Item.width / 2)) / 16f), (int)((Item.position.Y + (float)(Item.height / 2)) / 16f), 1f * brightness, 0.3f * brightness, 0.3f * brightness); - } - } -} diff --git a/Items/Materials/GalacticaSingularity.png b/Items/Materials/GalacticaSingularity.png deleted file mode 100644 index cdf70f5cf0..0000000000 Binary files a/Items/Materials/GalacticaSingularity.png and /dev/null differ diff --git a/Items/Materials/MiracleMatter.cs b/Items/Materials/MiracleMatter.cs index 39a7fa9695..46ba4a1278 100644 --- a/Items/Materials/MiracleMatter.cs +++ b/Items/Materials/MiracleMatter.cs @@ -88,7 +88,11 @@ namespace CalamityMod.Items.Materials AddIngredient(5). AddIngredient(). AddIngredient(). - AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 3). + AddIngredient(ItemID.FragmentVortex, 3). + AddIngredient(ItemID.FragmentNebula, 3). + AddIngredient(ItemID.FragmentStardust, 3). + AddIngredient(3). AddIngredient(). AddTile(). Register(); diff --git a/Items/Pets/IronBall.cs b/Items/Pets/IronBall.cs new file mode 100644 index 0000000000..d30b185c3d --- /dev/null +++ b/Items/Pets/IronBall.cs @@ -0,0 +1,30 @@ +using CalamityMod.Buffs.Pets; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Pets +{ + public class IronBall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Pets"; + public override void SetDefaults() + { + Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); + Item.UseSound = SoundID.NPCHit4; + Item.value = Item.sellPrice(gold: 2); + Item.rare = ItemRarityID.Orange; + Item.Calamity().donorItem = true; + } + + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(Item.buffType, 15, true); + } + } + } +} diff --git a/Items/Pets/IronBall.png b/Items/Pets/IronBall.png new file mode 100644 index 0000000000..5987ebb2e1 Binary files /dev/null and b/Items/Pets/IronBall.png differ diff --git a/Items/Placeables/Furniture/CorruptionEffigy.png b/Items/Placeables/Furniture/CorruptionEffigy.png index 8885e6ffce..d7ba8c6e67 100644 Binary files a/Items/Placeables/Furniture/CorruptionEffigy.png and b/Items/Placeables/Furniture/CorruptionEffigy.png differ diff --git a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs index 55da90cc1e..5da9b8e3af 100644 --- a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs +++ b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs @@ -29,7 +29,11 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations AddRecipeGroup("HardmodeAnvil"). AddIngredient(10). AddIngredient(ItemID.LunarBar, 10). - AddIngredient(12). + AddIngredient(ItemID.FragmentSolar, 12). + AddIngredient(ItemID.FragmentVortex, 12). + AddIngredient(ItemID.FragmentNebula, 12). + AddIngredient(ItemID.FragmentStardust, 12). + AddIngredient(12). AddIngredient(20). AddTile(TileID.LunarCraftingStation). Register(); diff --git a/Items/Placeables/Furniture/GluttonyBlender.cs b/Items/Placeables/Furniture/GluttonyBlender.cs index 86a53a4691..f4355809c8 100644 --- a/Items/Placeables/Furniture/GluttonyBlender.cs +++ b/Items/Placeables/Furniture/GluttonyBlender.cs @@ -10,7 +10,6 @@ namespace CalamityMod.Items.Placeables.Furniture public class GluttonyBlender : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; - public const int OneInXChanceForGoodSlop = 5; public override void SetDefaults() { @@ -40,7 +39,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { - Item.DefaultToFood(32, 30, BuffID.WellFed3, CalamityUtils.MinutesToFrames(60)); + Item.DefaultToFood(32, 30, BuffID.WellFed3, CalamityUtils.MinutesToFrames(30)); Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Orange; } diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index cfaef17681..e9d47d8eef 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings { public new string LocalizationCategory => "Items.Placeables"; public const int DropInt = 100; + public static bool holdShift = true; + public static bool showingFormerDevs = true; public override void SetDefaults() { @@ -22,34 +24,42 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings public override void ModifyTooltips(List tooltips) { - if (!Main.keyState.PressingShift()) - return; - - string tooltip = ""; - - int namesPerLine = 5; - for (int i = 0; i < devList.Count; i++) + if (Main.keyState.PressingShift()) { - tooltip += devList[i]; + if (!holdShift) + { + holdShift = true; + showingFormerDevs = !showingFormerDevs; + } - if (i == devList.Count - 1) - break; + string tooltip = "--------\n"; + int namesPerLine = 7; + IList listToPullFrom = showingFormerDevs ? formerDevList : currentDevList; - if (i % namesPerLine == 0) - tooltip += "\n"; + for (int i = 1; i <= listToPullFrom.Count; i++) + { + tooltip += listToPullFrom[i - 1]; - else - tooltip += ", "; + if (i == listToPullFrom.Count) + break; + + if (i % namesPerLine == 0) + tooltip += "\n"; + else + tooltip += ", "; + } + + TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2"); + if (line != null) + line.Text = tooltip; } - - TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2"); - if (line != null) - line.Text = tooltip; + else + holdShift = false; } - public static IList devList = new List() + public static IList currentDevList = new List() { - "Altixal", + "Altixal", "apotofkoolaid", "ArchonSystem", "Atalya", @@ -69,6 +79,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Fluffy", "fryzahh", "Gpscorpion", + "Hugekraken", "jasper", "LordMetarex", "Moonburn", @@ -85,8 +96,11 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "TYESKI", "Xyk", "YuH", - // Former devs - "Afzofa", + }; + + public static IList formerDevList = new List() + { + "Afzofa", "AdipemDragon", "Akeeli", "Aleksh", @@ -130,7 +144,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Grox the Great", "Heart Plus Up!", "Hectique", - "Hugekraken", "Huggles", "Ian-1KV", "IbanPlay", diff --git a/Items/Placeables/Furniture/ResilientCandle.png b/Items/Placeables/Furniture/ResilientCandle.png index 29c5480f8c..dad1b54c54 100644 Binary files a/Items/Placeables/Furniture/ResilientCandle.png and b/Items/Placeables/Furniture/ResilientCandle.png differ diff --git a/Items/Placeables/Furniture/SpitefulCandle.png b/Items/Placeables/Furniture/SpitefulCandle.png index 48403fea34..c078643850 100644 Binary files a/Items/Placeables/Furniture/SpitefulCandle.png and b/Items/Placeables/Furniture/SpitefulCandle.png differ diff --git a/Items/Placeables/Furniture/VigorousCandle.png b/Items/Placeables/Furniture/VigorousCandle.png index ca1f8a3523..d347366a31 100644 Binary files a/Items/Placeables/Furniture/VigorousCandle.png and b/Items/Placeables/Furniture/VigorousCandle.png differ diff --git a/Items/Placeables/Furniture/WeightlessCandle.png b/Items/Placeables/Furniture/WeightlessCandle.png index bf005cfb95..02faad55a9 100644 Binary files a/Items/Placeables/Furniture/WeightlessCandle.png and b/Items/Placeables/Furniture/WeightlessCandle.png differ diff --git a/Items/Placeables/GreedPot.cs b/Items/Placeables/GreedPot.cs index 0ad723196e..582e5f67ed 100644 --- a/Items/Placeables/GreedPot.cs +++ b/Items/Placeables/GreedPot.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Tiles; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Tiles; namespace CalamityMod.Items.Placeables { @@ -12,7 +9,11 @@ namespace CalamityMod.Items.Placeables { public new string LocalizationCategory => "Items.Placeables"; - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); - + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Pink; + Item.value = Item.buyPrice(gold: 5); + } } } diff --git a/Items/Placeables/Pylons/CragsPylon.cs b/Items/Placeables/Pylons/CragsPylon.cs index 3b63072df8..43631e2f86 100644 --- a/Items/Placeables/Pylons/CragsPylon.cs +++ b/Items/Placeables/Pylons/CragsPylon.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Pylons; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Pylons; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,5 +16,15 @@ namespace CalamityMod.Items.Placeables.Pylons Item.value = Item.sellPrice(gold: 2); Item.rare = ItemRarityID.Blue; } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(10). + AddIngredient(ItemID.Hellstone, 15). + AddTile(TileID.Anvils). + Register(); + } } } diff --git a/Items/Potions/Alcohol/OddMushroom.png b/Items/Potions/Alcohol/OddMushroom.png index 947d323e19..2d8288fb9f 100644 Binary files a/Items/Potions/Alcohol/OddMushroom.png and b/Items/Potions/Alcohol/OddMushroom.png differ diff --git a/Items/Potions/BottledPanacea.cs b/Items/Potions/BottledPanacea.cs index 347e59c2f1..b61d284f6d 100644 --- a/Items/Potions/BottledPanacea.cs +++ b/Items/Potions/BottledPanacea.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.Items.Potions { @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Potions for (int i = Player.MaxBuffs - 1; i >= 0; i--) { int buffType = player.buffType[i]; - if (BuffDatasets.DebuffDataset[buffType] is not null && (BuffDatasets.DebuffDataset[buffType].SicknessDebuffScaling > 0 || BuffDatasets.DebuffDataset[buffType].ElectricDebuffScaling > 0)) + if (CalamityBuffSets.DebuffDataset[buffType] is not null && (CalamityBuffSets.DebuffDataset[buffType].SicknessDebuffScaling > 0 || CalamityBuffSets.DebuffDataset[buffType].ElectricDebuffScaling > 0)) player.DelBuff(i); } diff --git a/Items/Potions/TheElixir.cs b/Items/Potions/TheElixir.cs index 9a18138074..eae462625c 100644 --- a/Items/Potions/TheElixir.cs +++ b/Items/Potions/TheElixir.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Packets; using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; @@ -42,69 +43,69 @@ namespace CalamityMod.Items.Potions public override bool? UseItem(Player player) { - if (player.whoAmI == Main.myPlayer) + if (Main.rand.NextBool(4)) { - if (Main.rand.NextBool(4)) - { - int roll = Main.rand.Next(3); - Vector2? location = roll switch - { - 1 => CalamityPlayer.GetAbyssVoidTeleportPosition(player), - 2 => CalamityPlayer.GetTempleTeleportPosition(player), - _ => CalamityPlayer.GetDungeonArchivesTeleportPosition(player) - }; + int locationIndex = Main.rand.Next(3); + if (Main.dedServ) + TheElixirTeleportSyncPacket.Send(player, locationIndex); - if (!location.HasValue) - return false; - - player.AddBuff(BuffID.ChaosState, 300, false); - player.AddBuff(BuffID.Cursed, 300, false); - CalamityPlayer.ModTeleport(player, location.Value, false, TeleportationStyleID.RecallPotion); - } - //If it doesn't fail, just act like a Potion of Return - else - player.DoPotionOfReturnTeleportationAndSetTheComebackPoint(); - - //Dust and Teleport sounds happen regardless of if it fails or not - Rectangle rect = player.getRect(); - int dustAmt = rect.Width * rect.Height / 5; - for (int k = 0; k < dustAmt; k++) + Vector2? location = locationIndex switch { - Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.TeleportationPotion); - dust.scale = Main.rand.NextFloat(0.2f, 0.7f); - if (k < 10) - dust.scale += 0.25f; - if (k < 5) - dust.scale += 0.25f; - } - for (int k = 0; k < 70; k++) - { - Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.DungeonSpirit); - dust.noGravity = true; - for (int i = 0; i < 5; i++) - { - if (Main.rand.NextBool(3)) - dust.velocity *= 0.75f; - } - if (Main.rand.NextBool(3)) - { - dust.velocity *= 2f; - dust.scale *= 1.2f; - } - if (Main.rand.NextBool(3)) - { - dust.velocity *= 2f; - dust.scale *= 1.2f; - } - if (Main.rand.NextBool()) - { - dust.fadeIn = Main.rand.NextFloat(0.75f, 1f); - dust.scale = Main.rand.NextFloat(0.25f, 0.75f); - } - dust.scale *= 0.8f; - } - SoundEngine.PlaySound(SoundID.Item6, player.Center); + 1 => CalamityPlayer.GetAbyssVoidTeleportPosition(player), + 2 => CalamityPlayer.GetTempleTeleportPosition(player), + _ => CalamityPlayer.GetDungeonArchivesTeleportPosition(player) + }; + + if (!location.HasValue) + return false; + + player.AddBuff(BuffID.ChaosState, 300, false); + player.AddBuff(BuffID.Cursed, 300, false); + CalamityPlayer.ModTeleport(player, location.Value, false, TeleportationStyleID.RecallPotion); } + //If it doesn't fail, just act like a Potion of Return + else + player.DoPotionOfReturnTeleportationAndSetTheComebackPoint(); + + //Dust and Teleport sounds happen regardless of if it fails or not + Rectangle rect = player.getRect(); + int dustAmt = rect.Width * rect.Height / 5; + for (int k = 0; k < dustAmt; k++) + { + Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.TeleportationPotion); + dust.scale = Main.rand.NextFloat(0.2f, 0.7f); + if (k < 10) + dust.scale += 0.25f; + if (k < 5) + dust.scale += 0.25f; + } + for (int k = 0; k < 70; k++) + { + Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.DungeonSpirit); + dust.noGravity = true; + for (int i = 0; i < 5; i++) + { + if (Main.rand.NextBool(3)) + dust.velocity *= 0.75f; + } + if (Main.rand.NextBool(3)) + { + dust.velocity *= 2f; + dust.scale *= 1.2f; + } + if (Main.rand.NextBool(3)) + { + dust.velocity *= 2f; + dust.scale *= 1.2f; + } + if (Main.rand.NextBool()) + { + dust.fadeIn = Main.rand.NextFloat(0.75f, 1f); + dust.scale = Main.rand.NextFloat(0.25f, 0.75f); + } + dust.scale *= 0.8f; + } + SoundEngine.PlaySound(SoundID.Item6, player.Center); return true; } } diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index 2c7bbb1321..341e60f662 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -60,7 +60,11 @@ namespace CalamityMod.Items.SummonItems // sequence breaking recipe CreateRecipe(). AddIngredient(ItemID.LunarBar, 40). - AddIngredient(10). + AddIngredient(ItemID.FragmentSolar, 10). + AddIngredient(ItemID.FragmentVortex, 10). + AddIngredient(ItemID.FragmentNebula, 10). + AddIngredient(ItemID.FragmentStardust, 10). + AddIngredient(10). AddIngredient(40). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index 73deccfbe7..c586a680e5 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Tools public static float DamageBoost = 0.15f; public static int DefenseBoost = 15; - public static int GraxBoostDuration = CalamityUtils.SecondsToFrames(10); + public static int GraxBoostDuration = CalamityUtils.SecondsToFrames(15); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseBoost, GraxBoostDuration.FramesToSeconds()); public override void SetStaticDefaults() { diff --git a/Items/Tools/InfernaCutter.cs b/Items/Tools/InfernaCutter.cs index 44429ca5dd..dd8eaa1695 100644 --- a/Items/Tools/InfernaCutter.cs +++ b/Items/Tools/InfernaCutter.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -14,14 +16,14 @@ namespace CalamityMod.Items.Tools { Item.width = 80; Item.height = 66; - Item.damage = 110; + Item.damage = 55; Item.crit = 10; Item.knockBack = 7f; Item.useTime = 8; Item.useAnimation = 12; Item.axe = 135 / 5; Item.tileBoost += 1; - + Item.shoot = ProjectileID.Spark; // Dummy argument to ensure it doesn't get set to true melee Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; @@ -31,6 +33,8 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) => false; + public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) { hitbox = CalamityUtils.FixSwingHitbox(54, 54); @@ -112,7 +116,7 @@ namespace CalamityMod.Items.Tools sparkXSpawn *= (float)player.direction; sparkYSpawn *= player.gravDir; var source = player.GetSource_ItemUse(Item); - int damage = (int)player.GetTotalDamage().ApplyTo(Item.damage * 0.2f); + int damage = (int)player.GetTotalDamage().ApplyTo(Item.damage * 0.5f); int spark = Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + sparkXSpawn, (float)(hitbox.Y + hitbox.Height / 2) + sparkYSpawn, (float)player.direction * sparkXVel, sparkYVel * player.gravDir, ProjectileID.Spark, damage, 0f, player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) Main.projectile[spark].DamageType = DamageClass.Melee; @@ -129,9 +133,10 @@ namespace CalamityMod.Items.Tools if (hit.Crit) { var source = player.GetSource_ItemUse(Item); - int boom = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, Item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (boom.WithinBounds(Main.maxProjectiles)) - Main.projectile[boom].DamageType = DamageClass.Melee; + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), 0, Item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int onHitDamage = player.CalcIntDamage(Item.damage * 0.5f); + Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); + blast.DamageType = Item.DamageType; } target.AddBuff(BuffID.OnFire3, 300); } diff --git a/Items/Tools/TheGift.cs b/Items/Tools/TheGift.cs index f0a6018f58..1fd6f97a7f 100644 --- a/Items/Tools/TheGift.cs +++ b/Items/Tools/TheGift.cs @@ -17,7 +17,8 @@ namespace CalamityMod.Items.Tools public static readonly SoundStyle BadBuzzer = new SoundStyle("CalamityMod/Sounds/Custom/BadGiftBuzzer") with { Volume = 0.85f }; public override void SetDefaults() { - Item.width = Item.height = 20; + Item.width = 30; + Item.height = 20; Item.maxStack = Item.CommonMaxStack; Item.useTime = Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Tools/TinkerersVoucher.cs b/Items/Tools/TinkerersVoucher.cs index 27802ea587..24954690d3 100644 --- a/Items/Tools/TinkerersVoucher.cs +++ b/Items/Tools/TinkerersVoucher.cs @@ -345,8 +345,8 @@ namespace CalamityMod.Items.Tools { PrefixID.Brisk, PrefixID.Fleeting, - PrefixID.Hasty, - PrefixID.Quick + PrefixID.Hasty2, + PrefixID.Quick2 }; public override void SetDefaults() diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index f8b8d68e67..04dfc8834c 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -22,10 +22,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 42; Item.height = 28; - Item.damage = 28; + Item.damage = 18; Item.DamageType = DamageClass.Magic; - Item.mana = 9; - Item.useAnimation = Item.useTime = 45; + Item.mana = 12; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index a84120af62..3215eaa9db 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -16,13 +16,13 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 46; - Item.damage = 77; + Item.damage = 120; Item.knockBack = 3.5f; Item.noMelee = true; Item.DamageType = DamageClass.Magic; - Item.mana = 32; + Item.mana = 45; - Item.useAnimation = Item.useTime = 32; + Item.useAnimation = Item.useTime = 45; Item.useStyle = ItemUseStyleID.Shoot; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index a2182c7753..58678eb19e 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -20,8 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 130; Item.DamageType = DamageClass.Magic; Item.mana = 14; - Item.useTime = 5; - Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; @@ -40,21 +39,6 @@ namespace CalamityMod.Items.Weapons.Magic public override bool AltFunctionUse(Player player) => true; - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - Item.useTime = 20; - Item.useAnimation = 20; - } - else - { - Item.useTime = 5; - Item.useAnimation = 10; - } - return base.CanUseItem(player); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse == 2) @@ -64,19 +48,9 @@ namespace CalamityMod.Items.Weapons.Magic } else { - int note = Main.rand.Next(2); - if (note == 0) - { - damage = (int)(damage * 1.5f); - type = ModContent.ProjectileType(); - } - else - { - velocity.X *= 1.5f; - velocity.Y *= 1.5f; - type = ModContent.ProjectileType(); - } - Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + Vector2 offset = velocity.SafeNormalize(Vector2.UnitX) * 8f; + Projectile.NewProjectile(source, position + offset.RotatedBy(MathHelper.PiOver2), velocity, type, (int)(damage * 1.5f), knockback, player.whoAmI); + Projectile.NewProjectile(source, position + offset.RotatedBy(-MathHelper.PiOver2), velocity * 1.5f, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index b89d9b77dd..4250819277 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Magic } realPlayerPos += new Vector2(mouseXDist, mouseYDist); - int numProjectiles = 5; + int numProjectiles = 6; for (int i = 0; i < numProjectiles; i++) { realPlayerPos.X += (float)Main.rand.Next(-100, 101); diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index c9e4ba0293..aa0592be55 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 112; Item.height = 112; Item.DamageType = DamageClass.Magic; - Item.damage = 2700; + Item.damage = 3000; Item.knockBack = 9.5f; Item.mana = 120; Item.useAnimation = Item.useTime = AftershotCooldownFrames; diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index d84b25394f..fe5f1c9c71 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(). AddIngredient(10). - AddIngredient(5). + AddIngredient(ItemID.FragmentNebula, 5). AddTile(). Register(); } diff --git a/Items/Weapons/Magic/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 79819761d0..1569a747dc 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(ItemID.AquaScepter). AddIngredient(ItemID.LunarBar, 5). - AddIngredient(5). + AddIngredient(ItemID.FragmentNebula, 5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Magic/VeeringWind.cs b/Items/Weapons/Magic/VeeringWind.cs index 2e2ead9c56..a6623ab6c7 100644 --- a/Items/Weapons/Magic/VeeringWind.cs +++ b/Items/Weapons/Magic/VeeringWind.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 32; - Item.damage = 19; + Item.damage = 16; Item.DamageType = DamageClass.Magic; Item.mana = 14; Item.useAnimation = Item.useTime = 36; diff --git a/Items/Weapons/Magic/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index b87c86ae84..c98dcc9c6a 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using CalamityMod.Systems.Collections; using CalamityMod.Rarities; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; @@ -24,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 70; Item.height = 68; - Item.damage = 2800; + Item.damage = 1150; Item.DamageType = DamageClass.Magic; Item.mana = 90; Item.useAnimation = Item.useTime = 65; diff --git a/Items/Weapons/Melee/BallOFugu.cs b/Items/Weapons/Melee/BallOFugu.cs index 0cfb8bacb4..e06c27c50e 100644 --- a/Items/Weapons/Melee/BallOFugu.cs +++ b/Items/Weapons/Melee/BallOFugu.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 30; Item.height = 10; - Item.damage = 28; + Item.damage = 25; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/BurntSienna.cs b/Items/Weapons/Melee/BurntSienna.cs index d290ff5246..886968018d 100644 --- a/Items/Weapons/Melee/BurntSienna.cs +++ b/Items/Weapons/Melee/BurntSienna.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 54; Item.damage = 32; Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 21; + Item.useAnimation = Item.useTime = 24; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 5.5f; diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index 543e1be971..b1b62226f8 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 90; Item.height = 90; - Item.damage = 200; + Item.damage = 350; Item.DamageType = DamageClass.Melee; Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index dd45adfed8..71bccf18c8 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -14,19 +14,19 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; // Weapon attribute constants - public static readonly int BaseDamage = 690; - public static readonly float GiantSkullDamageMultiplier = 1.7f; - + public static int BaseDamage => 850; + public static float GiantSkullDamageMultiplier => 2.0f; + // Weapon projectile attribute constants - public static readonly int SearchDistance = 1450; - public static readonly int ImmunityFrames = 10; + public static int SearchDistance => 1450; + public static int ImmunityFrames => 10; // Skull ring attribute constants - public static readonly float SkullsplosionDamageMultiplier = 1.5f; + public static float SkullsplosionDamageMultiplier => 1.5f; internal static string SkullsplosionEntitySourceContext => "GaelsGreatswordRageSkullsplosion"; // Rage gain attribute constant - public static readonly float RagePerSecond = 0.025f; // 2.5% rage per second + public static float RagePerSecond => 0.025f; // 2.5% rage per second //NOTE: GetWeaponDamage is in the CalamityPlayer file public override void SetDefaults() diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index 9fbcb94c5e..623a1e3b37 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -132,7 +132,10 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.StarWrath). AddIngredient(10). - AddIngredient(5). + AddIngredient(ItemID.FragmentSolar, 5). + AddIngredient(ItemID.FragmentVortex, 5). + AddIngredient(ItemID.FragmentNebula, 5). + AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/GalaxySmasher.cs b/Items/Weapons/Melee/GalaxySmasher.cs index 34f08880f9..c2ffc4558f 100644 --- a/Items/Weapons/Melee/GalaxySmasher.cs +++ b/Items/Weapons/Melee/GalaxySmasher.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 86; Item.height = 72; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 1180; + Item.damage = 1100; Item.knockBack = 14f; Item.useTime = Item.useAnimation = 48; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs index 2cd125a2a6..34d63e2784 100644 --- a/Items/Weapons/Melee/GreatswordofJudgement.cs +++ b/Items/Weapons/Melee/GreatswordofJudgement.cs @@ -165,7 +165,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.LunarBar, 7). AddIngredient(). - AddIngredient(5). + AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/IllustriousKnives.cs b/Items/Weapons/Melee/IllustriousKnives.cs index 2c7b01de10..fe800a7be0 100644 --- a/Items/Weapons/Melee/IllustriousKnives.cs +++ b/Items/Weapons/Melee/IllustriousKnives.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 44; Item.height = 62; - Item.damage = 400; + Item.damage = 525; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Ozzathoth.cs b/Items/Weapons/Melee/Ozzathoth.cs index 5259795122..5fb5c259ef 100644 --- a/Items/Weapons/Melee/Ozzathoth.cs +++ b/Items/Weapons/Melee/Ozzathoth.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 40; Item.height = 54; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 90; + Item.damage = 145; Item.knockBack = 6f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/Pandemic.cs b/Items/Weapons/Melee/Pandemic.cs index f6e8d04a94..e5c60d9495 100644 --- a/Items/Weapons/Melee/Pandemic.cs +++ b/Items/Weapons/Melee/Pandemic.cs @@ -11,9 +11,13 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; - public static float Reach = 480f; - public static float Speed = 40f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed); + //Changing these first 3 values requires restarting the game or hijacking some function to do the yoyo's SetStaticDefaults again. + public static float Lifetime => 15; + public static float Reach => 480f; + public static float Speed => 24f; + public static float DamageMultiplier(int count) => 1 + count * 0.2f; + public static float SizeMultiplier(int count) => 0.5f + DamageMultiplier(count) * 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed, Lifetime); public override void SetStaticDefaults() { @@ -27,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 32; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 100; + Item.damage = 125; Item.knockBack = 2.5f; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index 4e9bb39a95..cc2950afc7 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 62; Item.height = 62; - Item.damage = 350; + Item.damage = 400; Item.DamageType = DamageClass.Melee; Item.useTime = 10; Item.useAnimation = 40; diff --git a/Items/Weapons/Melee/SolsticeClaymore.cs b/Items/Weapons/Melee/SolsticeClaymore.cs index 33deea51ab..8435cf73c5 100644 --- a/Items/Weapons/Melee/SolsticeClaymore.cs +++ b/Items/Weapons/Melee/SolsticeClaymore.cs @@ -78,7 +78,8 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.BeamSword). AddIngredient(20). AddIngredient(ItemID.LunarBar, 5). - AddIngredient(5). + AddIngredient(ItemID.FragmentSolar, 5). + AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/StellarContempt.cs b/Items/Weapons/Melee/StellarContempt.cs index 68fb83607c..6ff57decaf 100644 --- a/Items/Weapons/Melee/StellarContempt.cs +++ b/Items/Weapons/Melee/StellarContempt.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 74; Item.height = 74; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 650; + Item.damage = 525; Item.knockBack = 28f; - Item.useTime = 45; - Item.useAnimation = 45; + Item.useTime = Item.useAnimation = 48; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; @@ -44,7 +43,8 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(). AddIngredient(ItemID.LunarBar, 5). - AddIngredient(5). + AddIngredient(ItemID.FragmentSolar, 5). + AddIngredient(2). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/Swordsplosion.cs b/Items/Weapons/Melee/Swordsplosion.cs index be38aa1993..5e101a6f57 100644 --- a/Items/Weapons/Melee/Swordsplosion.cs +++ b/Items/Weapons/Melee/Swordsplosion.cs @@ -100,6 +100,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). + AddIngredient(ItemID.LunarBar, 5). AddIngredient(10). AddIngredient(15). AddTile(TileID.MythrilAnvil). diff --git a/Items/Weapons/Melee/TeardropCleaver.cs b/Items/Weapons/Melee/TeardropCleaver.cs index 391a4455f5..e91262ae77 100644 --- a/Items/Weapons/Melee/TeardropCleaver.cs +++ b/Items/Weapons/Melee/TeardropCleaver.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Weapons.Melee } public override void SetDefaults() { - Item.width = 56; - Item.height = 66; + Item.width = 54; + Item.height = 76; Item.damage = 38; Item.DamageType = DamageClass.Melee; Item.useAnimation = 24; diff --git a/Items/Weapons/Melee/TeardropCleaver.png b/Items/Weapons/Melee/TeardropCleaver.png index b6942f2283..b277bae8e8 100644 Binary files a/Items/Weapons/Melee/TeardropCleaver.png and b/Items/Weapons/Melee/TeardropCleaver.png differ diff --git a/Items/Weapons/Melee/TheLastMourning.cs b/Items/Weapons/Melee/TheLastMourning.cs index a194ee6eec..740a392bdf 100644 --- a/Items/Weapons/Melee/TheLastMourning.cs +++ b/Items/Weapons/Melee/TheLastMourning.cs @@ -24,10 +24,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 94; Item.height = 94; Item.DamageType = DamageClass.Melee; - Item.damage = 550; + Item.damage = 600; Item.knockBack = 8.5f; - Item.useAnimation = 20; - Item.useTime = 20; + Item.useAnimation = Item.useTime = 20; Item.autoReuse = true; Item.useTurn = true; diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 0c2e4da7b6..6e33876710 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 42; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 475; + Item.damage = 400; Item.knockBack = 7.5f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs index 9edfa0d77f..1c3b293927 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs @@ -2,6 +2,8 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -20,10 +22,10 @@ namespace CalamityMod.Items.Weapons.Melee Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; - Item.useAnimation = Item.useTime = 40; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 14f; - Item.UseSound = SoundID.Item1; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/SwingMid") with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }; Item.DamageType = DamageClass.MeleeNoSpeed; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 25f; diff --git a/Items/Weapons/Ranged/Archerfish.cs b/Items/Weapons/Ranged/Archerfish.cs index c6ac232654..492cb34a2b 100644 --- a/Items/Weapons/Ranged/Archerfish.cs +++ b/Items/Weapons/Ranged/Archerfish.cs @@ -6,8 +6,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; +using Terraria.Localization; namespace CalamityMod.Items.Weapons.Ranged { @@ -71,7 +71,6 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent; } } diff --git a/Items/Weapons/Ranged/HalibutCannon.cs b/Items/Weapons/Ranged/HalibutCannon.cs index c97d932eaf..2518bb25db 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 118; Item.height = 56; - Item.damage = 50; + Item.damage = 100; Item.DamageType = DamageClass.Ranged; Item.useTime = 10; Item.useAnimation = 20; diff --git a/Items/Weapons/Ranged/Karasawa.cs b/Items/Weapons/Ranged/Karasawa.cs index a8ed967b01..2efc46e683 100644 --- a/Items/Weapons/Ranged/Karasawa.cs +++ b/Items/Weapons/Ranged/Karasawa.cs @@ -70,7 +70,6 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(25). AddIngredient(8). AddIngredient(20). - AddIngredient(5). AddTile(). Register(); } diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index b7c92aff99..68425305fb 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Localization; namespace CalamityMod.Items.Weapons.Ranged { @@ -23,57 +24,41 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.width = 72; - Item.height = 32; - Item.damage = 29; + Item.width = 102; + Item.height = 43; + Item.damage = 58; Item.DamageType = DamageClass.Ranged; - Item.useTime = 6; - Item.useAnimation = 6; + Item.useTime = 4; + Item.useAnimation = 4; + Item.channel = true; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.5f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.UseSound = SoundID.Item11; + Item.UseSound = null; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; + Item.noUseGraphic = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 2f; Item.useAmmo = AmmoID.Bullet; } - - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Reposition to the gun's tip + add some inaccuracy - Vector2 newPos = position + new Vector2(64f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); - Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(3f)); - - // Fire either the bullet or the water jet, depending on cadence. - int projectileToFire = fireWater ? Item.shoot : type; - Projectile.NewProjectile(source, newPos, newVel, projectileToFire, damage, knockback, player.whoAmI); - - // Always fires a close range water blast. - // It goes in the same direction as the main shot but has a minor velocity variation to be less monotonous. - int waterRingDamage = (int)(damage * 0.5f); - float boostedKB = knockback + 7f; // Stronger guaranteed KB than Archerfish for mid-late Hardmode - Projectile.NewProjectile(source, newPos, newVel * Main.rand.NextFloat(0.5f, 0.6f), ModContent.ProjectileType(), waterRingDamage, boostedKB, player.whoAmI); - - // Swap between firing bullets and water jets each shot. - fireWater = !fireWater; + Projectile holdout = Projectile.NewProjectileDirect(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI); + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } - - // Does not consume ammo when firing water jets. - public override bool CanConsumeAmmo(Item ammo, Player player) => !fireWater; - public override void AddRecipes() { CreateRecipe(). AddIngredient(ItemID.Megashark). AddIngredient(). - AddIngredient(10). - AddIngredient(10). + AddIngredient(15). + AddIngredient(10). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/Megalodon.png b/Items/Weapons/Ranged/Megalodon.png index 85bd1f10b9..6d3e45d1aa 100644 Binary files a/Items/Weapons/Ranged/Megalodon.png and b/Items/Weapons/Ranged/Megalodon.png differ diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 5fe01567c1..d89be2d736 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -10,6 +10,7 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged @@ -30,74 +31,35 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 90; Item.height = 38; - Item.damage = 60; + Item.damage = 154; Item.DamageType = DamageClass.Ranged; - Item.useTime = 5; - Item.useAnimation = 5; + Item.useTime = 3; + Item.useAnimation = 3; + Item.channel = true; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.5f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); - Item.UseSound = SoundID.Item11; + Item.UseSound = null; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; + Item.noUseGraphic = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 2f; Item.useAmmo = AmmoID.Bullet; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - + public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Reposition to the gun's tip + add some inaccuracy - Vector2 newPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); - Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f)); - - // Fire either the bullet or the water jet, depending on cadence. - bool fireWater = shotCounter % 2 == 0; - int projectileToFire = fireWater ? Item.shoot : type; - Projectile.NewProjectile(source, newPos, newVel, projectileToFire, damage, knockback, player.whoAmI); - - // Always fires a close range water blast. - // It goes in the same direction as the main shot but has a minor velocity variation to be less monotonous. - int waterRingDamage = (int)(damage * 0.5f); - float boostedKB = knockback + 7f; // Same KB bonus as Megalodon. The muzzle blast will annihilate nearby enemies and send their gibs flying. - Projectile.NewProjectile(source, newPos, newVel * Main.rand.NextFloat(0.45f, 0.65f), ModContent.ProjectileType(), waterRingDamage, boostedKB, player.whoAmI); - - // Check cadence position to determine which bonus projectile to add, if any. - bool fireRocket = shotCounter == 9; - bool muzzleBlast = shotCounter == 17; - - // Rockets have their own more chaotic spread than bullets. - if (fireRocket) - { - int rocketDamage = damage * 3; - Projectile.NewProjectile(source, newPos, newVel * 1.2f, ModContent.ProjectileType(), rocketDamage, knockback, player.whoAmI); - SoundEngine.PlaySound(SoundID.Item109, player.Center); - } - - // Muzzle blasts are always directly in line with the gun's muzzle. - if (muzzleBlast) - { - int muzzleBlastDamage = damage * 12; // "This might be too much but it's every 18th shot..." Narrator: 25x was in fact too much. - float muzzleBlastKB = knockback + 12f; - Projectile.NewProjectile(source, newPos, velocity, ModContent.ProjectileType(), muzzleBlastDamage, muzzleBlastKB, player.whoAmI); - - // Play additional sound for muzzle blasts - SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode, position); - } - - // Increment and then reset the shot counter so the pattern loops indefinitely. The muzzle blast replaces the first bullet in the repeating pattern. - ++shotCounter; - if (shotCounter > 17) - shotCounter = 2; + Projectile holdout = Projectile.NewProjectileDirect(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI); + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } - // Does not consume ammo when firing water jets. - public override bool CanConsumeAmmo(Item ammo, Player player) => shotCounter % 2 == 1; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/SlagMagnum.cs b/Items/Weapons/Ranged/SlagMagnum.cs index 6c3656b312..d2114fab15 100644 --- a/Items/Weapons/Ranged/SlagMagnum.cs +++ b/Items/Weapons/Ranged/SlagMagnum.cs @@ -14,10 +14,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 58; Item.height = 24; - Item.damage = 24; + Item.damage = 36; Item.DamageType = DamageClass.Ranged; - Item.useTime = 15; - Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; @@ -30,10 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/Starfleet.cs b/Items/Weapons/Ranged/Starfleet.cs index 973c243ce8..bb4e8b030a 100644 --- a/Items/Weapons/Ranged/Starfleet.cs +++ b/Items/Weapons/Ranged/Starfleet.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.SuperStarCannon). AddIngredient(4). AddIngredient(ItemID.FallenStar, 15). - AddIngredient(3). + AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Ranged/TheMaelstrom.cs b/Items/Weapons/Ranged/TheMaelstrom.cs index b44fe7e7ed..158da9bba6 100644 --- a/Items/Weapons/Ranged/TheMaelstrom.cs +++ b/Items/Weapons/Ranged/TheMaelstrom.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 20; Item.height = 12; - Item.damage = 530; + Item.damage = 550; Item.useTime = 45; Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Ranged/Voidragon.cs b/Items/Weapons/Ranged/Voidragon.cs index 186d8660f2..80e48cbab7 100644 --- a/Items/Weapons/Ranged/Voidragon.cs +++ b/Items/Weapons/Ranged/Voidragon.cs @@ -13,13 +13,13 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - [LegacyName("Megafleet")] + // Long live Megafleet. You will be missed. Maybe one day we can revive you. + [LegacyName("Megafleet")] public class Voidragon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - private int shotType = 1; - - public static int AmmoSavedPercent = 50; + public int sharkGunDamageScaling = 0; + public static int AmmoSavedPercent = 66; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); public override void SetStaticDefaults() { @@ -30,52 +30,41 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 96; Item.height = 38; - Item.damage = 240; + Item.damage = 1400; Item.DamageType = DamageClass.Ranged; - Item.useTime = 5; - Item.useAnimation = 5; + Item.useTime = 3; + Item.useAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; - Item.UseSound = SoundID.Item11; + Item.UseSound = null; Item.autoReuse = true; - Item.shoot = ProjectileID.PurificationPowder; + Item.noUseGraphic = true; + Item.channel = true; Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Bullet; + Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float SpeedX = velocity.X + (float)Main.rand.Next(-5, 6) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-5, 6) * 0.05f; - - if (shotType > 2) - shotType = 1; - - if (shotType == 1) - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - else - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - - shotType++; - - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI, (Main.rand.Next(-160, 160) * 0.001f), (Main.rand.Next(-160, 160) * 0.001f)); - + Projectile holdout = Projectile.NewProjectileDirect(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI); + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent && shotType % 2 == 1; - public override void AddRecipes() { CreateRecipe(). AddIngredient(). + AddIngredient(). AddIngredient(5). AddTile(). Register(); diff --git a/Items/Weapons/Rogue/CobaltKunai.cs b/Items/Weapons/Rogue/CobaltKunai.cs index 68c8965605..036b76098e 100644 --- a/Items/Weapons/Rogue/CobaltKunai.cs +++ b/Items/Weapons/Rogue/CobaltKunai.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 14; Item.height = 38; - Item.damage = 56; + Item.damage = 49; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = Item.useTime = 10; + Item.useAnimation = Item.useTime = 12; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 2.5f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/DimensionTearingDisk.cs b/Items/Weapons/Rogue/DimensionTearingDisk.cs index 762b079e8d..1545a49316 100644 --- a/Items/Weapons/Rogue/DimensionTearingDisk.cs +++ b/Items/Weapons/Rogue/DimensionTearingDisk.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 62; Item.height = 58; Item.DamageType = RogueDamageClass.Instance; - Item.useTime = Item.useAnimation = 24; + Item.useTime = Item.useAnimation = 27; Item.knockBack = 7f; - Item.damage = 980; + Item.damage = 725; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = Speed; } + public override float StealthDamageMultiplier => 1.3f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index 9ed040335a..772267450b 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 20; Item.height = 24; - Item.damage = 100; + Item.damage = 85; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 28; diff --git a/Items/Weapons/Rogue/DynamicPursuer.cs b/Items/Weapons/Rogue/DynamicPursuer.cs index e625e2d5b1..cceb7bbd87 100644 --- a/Items/Weapons/Rogue/DynamicPursuer.cs +++ b/Items/Weapons/Rogue/DynamicPursuer.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 34; - Item.damage = 2850; + Item.damage = 2000; Item.DamageType = RogueDamageClass.Instance; Item.useTime = 42; Item.useAnimation = 42; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 17f; } - public static float StealthDmgMult = 0.3f; //So I can edit it directly via DragonLens instead of having to do math with CalTestHelpers + public static float StealthDmgMult = 0.25f; //So I can edit it directly via DragonLens instead of having to do math with CalTestHelpers public override float StealthDamageMultiplier => StealthDmgMult; public override float StealthVelocityMultiplier => 0.8f; diff --git a/Items/Weapons/Rogue/ElephantKiller.cs b/Items/Weapons/Rogue/ElephantKiller.cs index 615a7b1f52..efb7d64b46 100644 --- a/Items/Weapons/Rogue/ElephantKiller.cs +++ b/Items/Weapons/Rogue/ElephantKiller.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 46; Item.height = 58; - Item.damage = 110; + Item.damage = 120; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 38; diff --git a/Items/Weapons/Rogue/FeatherKnife.cs b/Items/Weapons/Rogue/FeatherKnife.cs index e67b1ec4cc..cbdba9dccb 100644 --- a/Items/Weapons/Rogue/FeatherKnife.cs +++ b/Items/Weapons/Rogue/FeatherKnife.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; - Item.damage = 25; - Item.useAnimation = Item.useTime = 20; + Item.damage = 22; + Item.useAnimation = Item.useTime = 30; Item.knockBack = 2f; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Swing; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; } - public override float StealthDamageMultiplier => 0.7f; + public override float StealthDamageMultiplier => 0.6f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/Glaive.cs b/Items/Weapons/Rogue/Glaive.cs index 2f6b9a5492..d4ed994172 100644 --- a/Items/Weapons/Rogue/Glaive.cs +++ b/Items/Weapons/Rogue/Glaive.cs @@ -13,14 +13,14 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 34; Item.height = 32; - Item.damage = 22; + Item.damage = 19; Item.DamageType = RogueDamageClass.Instance; Item.crit = 6; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 15; - Item.useAnimation = 15; + Item.useTime = 22; + Item.useAnimation = 22; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3; Item.value = Item.buyPrice(gold: 10); // Sold by Bandit @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Rogue } public override float StealthVelocityMultiplier => 1.3f; - public override float StealthDamageMultiplier => 0.6f; + public override float StealthDamageMultiplier => 0.4f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { var p = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, -1f); diff --git a/Items/Weapons/Rogue/IceStar.cs b/Items/Weapons/Rogue/IceStar.cs index 0beafe26c6..8a6c367c30 100644 --- a/Items/Weapons/Rogue/IceStar.cs +++ b/Items/Weapons/Rogue/IceStar.cs @@ -12,13 +12,13 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = Item.height = 66; - Item.damage = 45; - Item.crit = 7; + Item.damage = 35; + Item.crit = 3; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 12; + Item.useAnimation = 17; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 12; + Item.useTime = 17; Item.knockBack = 2.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index fdbb110ebd..7a08a73b3c 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 12; Item.DamageType = RogueDamageClass.Instance; Item.crit = 16; - Item.knockBack = 12; + Item.knockBack = 9; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; diff --git a/Items/Weapons/Rogue/Lionfish.cs b/Items/Weapons/Rogue/Lionfish.cs index 73a34dda76..bf62e3515b 100644 --- a/Items/Weapons/Rogue/Lionfish.cs +++ b/Items/Weapons/Rogue/Lionfish.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 40; Item.height = 40; - Item.damage = 45; + Item.damage = 33; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 26; diff --git a/Items/Weapons/Rogue/MythrilKnife.cs b/Items/Weapons/Rogue/MythrilKnife.cs index b7be65a638..2b52df3964 100644 --- a/Items/Weapons/Rogue/MythrilKnife.cs +++ b/Items/Weapons/Rogue/MythrilKnife.cs @@ -12,12 +12,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 12; Item.height = 40; - Item.damage = 80; + Item.damage = 66; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 10; + Item.useTime = Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 10; Item.knockBack = 1.75f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/PalladiumJavelin.cs b/Items/Weapons/Rogue/PalladiumJavelin.cs index d05f728ce9..bb276e95a3 100644 --- a/Items/Weapons/Rogue/PalladiumJavelin.cs +++ b/Items/Weapons/Rogue/PalladiumJavelin.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 54; Item.height = 54; - Item.damage = 118; + Item.damage = 81; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 24; @@ -27,11 +27,12 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.8f; + public override float StealthDamageMultiplier => 0.9f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int javelin = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + float aiVal = player.Calamity().StealthStrikeAvailable() ? -12f : 0f; + int javelin = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, ai1: aiVal); if (javelin.WithinBounds(Main.maxProjectiles)) Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 74846f81a0..ea40818dcf 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -12,11 +12,17 @@ namespace CalamityMod.Items.Weapons.Rogue { public class SealedSingularity : RogueWeapon { + /// + /// Falloff per target hit simultaneously by the aura. Resets every hit interval + /// + public static float FalloffPerTargetHitByAura => 0.5f; + public static float FallofPerTargetHitByBomb => 0.2f; + public override void SetDefaults() { Item.width = 32; Item.height = 32; - Item.damage = 425; + Item.damage = 260; Item.DamageType = RogueDamageClass.Instance; Item.autoReuse = true; Item.noMelee = true; diff --git a/Items/Weapons/Rogue/Seraphim.cs b/Items/Weapons/Rogue/Seraphim.cs index c55b583ae2..2bc2ac984a 100644 --- a/Items/Weapons/Rogue/Seraphim.cs +++ b/Items/Weapons/Rogue/Seraphim.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Weapons.Rogue public class Seraphim : RogueWeapon { public const int SplitDaggerCount = 6; - public const int StealthStrikeLightCount = 7; + public const int StealthStrikeLightCount = 8; public override void SetDefaults() { Item.width = 82; Item.height = 82; - Item.damage = 320; + Item.damage = 280; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 13; diff --git a/Items/Weapons/Summon/AmphibiansGuitar.cs b/Items/Weapons/Summon/AmphibiansGuitar.cs index 3958287ca6..4f7e937905 100644 --- a/Items/Weapons/Summon/AmphibiansGuitar.cs +++ b/Items/Weapons/Summon/AmphibiansGuitar.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.channel = true; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; + Item.Calamity().donorItem = true; Item.useStyle = ItemUseStyleID.HoldUp; } diff --git a/Items/Weapons/Summon/CausticStaff.cs b/Items/Weapons/Summon/CausticStaff.cs index caf15d1a1d..240fbc9c0c 100644 --- a/Items/Weapons/Summon/CausticStaff.cs +++ b/Items/Weapons/Summon/CausticStaff.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class CausticStaff : ModItem, ILocalizedModType + public class CausticStaff : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetStaticDefaults() diff --git a/Items/Weapons/Summon/Cnidarian.cs b/Items/Weapons/Summon/Cnidarian.cs index 56b6601cad..da08793d07 100644 --- a/Items/Weapons/Summon/Cnidarian.cs +++ b/Items/Weapons/Summon/Cnidarian.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { summonTag.TagItem = Type; - CalamityBuffSets.SummonTagDebuff.Add(BuffType(), summonTag); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index 9d5ac24f1d..0bc84b41ec 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -58,8 +58,9 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.SandstoneBrick, 20). - AddIngredient(2). + AddIngredient(ItemID.Amber, 5). + AddIngredient(ItemID.AntlionMandible, 3). + AddIngredient(ItemID.PalmWood, 10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs index 228f493212..ac5c109042 100644 --- a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs +++ b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 50; Item.height = 60; - Item.damage = 40; + Item.damage = 56; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index e71c91306d..433e5068c8 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.Weapons.Summon { ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; summonTag.TagItem = Type; - CalamityBuffSets.SummonTagDebuff.Add(ModContent.BuffType(), summonTag); } public override void SetDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index ff9b00c463..f1da6154e0 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -81,7 +81,7 @@ OldFashionedBuff: { RedWineBuff: { DisplayName: Red Wine Description: Increased vertical speed, reduced flight time - ItemTooltip: Causes Baguette to heal 200 HP, but reduce regeneration by 2 HP/s for 15 seconds + ItemTooltipPlayer: Causes Baguette to heal 200 HP, but reduce regeneration by 2 HP/s for 15 seconds } RumBuff: { @@ -507,6 +507,11 @@ BearBuff: { Description: A guardian angel is following you } +BeldumBuff: { + DisplayName: Iron Ball + Description: Extra shiny! +} + BloodBound: { DisplayName: Blood Bound Description: You must be desperate for company @@ -1184,8 +1189,8 @@ Irradiated: { MarkedforDeath: { DisplayName: Marked for Death - Description: Damage reduction reduced - ItemTooltipEnemy: Damage reduction is 50% less effective + Description: Increased damage taken + ItemTooltipEnemy: Enemies take 1.1x damage } PearlAura: { @@ -1225,7 +1230,7 @@ WhisperingDeath: { DisplayName: Whispering Death Description: Death approaches; attack power and life regen reduced ItemTooltipPlayer: Negates life regen, reduces damage - ItemTooltipEnemy: Reduced contact damage + ItemTooltipEnemy: Reduced damage } WitherDebuff: { @@ -1600,9 +1605,9 @@ PuffWarriorBuff: { Description: It confidently and excitedly protects you } -RareSandElemental: { - DisplayName: Rare Sand Elemental - Description: The Sand Elemental will heal you +OasisElementalBuff: { + DisplayName: Oasis Elemental + Description: The Oasis Elemental will heal you } ResurrectionButterflyBuff: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 917ec6eb1e..98e8cdbd16 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -350,7 +350,7 @@ BloomStone: { Tooltip: ''' Healing Potions are 50% more effective, but provide their healing over time - Grappling hooks retract and pull the player 50% faster, and grow a flower at hookpoints + Grappling hooks retract and pull the player 30 mph faster, and grow a flower at hookpoints Touching a flower makes it burst into pollen which gives a temporary boost to potion healing over time Potion healing slows drastically when at full health 'One of the ancient relics' @@ -820,7 +820,7 @@ FleshTotem: { Tooltip: ''' 5% increased magic critical strike chance - +20 max mana + Increases maximum mana by 20 Summons an effigy above your head that stores mana as you use it, up to 600 mana The effigy occasionally pulses, restoring 25 mana Pulses appear more frequently the more mana is stored @@ -1130,12 +1130,12 @@ ManaPolarizer: { DisplayName: Mana Polarizer Tooltip: ''' - Increases max mana by 40 + Increases maximum mana by 40 Provides life regeneration and magic damage that scales based on how much mana you have Lower mana means more life regeneration, but less magic damage These scale from -2 to +2 HP/s, and 15% to 5% damage The provided regeneration is halved when under Mana Sickness - Magic projectiles steal enemy life while holding a magic weapon + Magic projectiles steal enemy life ''' } @@ -1162,7 +1162,7 @@ MoonstoneCrown: { DisplayName: Moonstone Crown Tooltip: ''' - +40 max mana + Increases maximum mana by 40 Summons a [c/27F5E0:Lunar Sigil] every 2 seconds, up to a maximum of 10 Each [c/27F5E0:Lunar Sigil] increases magic damage by 2% and reduces mana cost by 1% With 5 sigils, increases mana regeneration by +5 MP/s @@ -1467,12 +1467,12 @@ RampartofDeities: { ToggleEffect: ", increases movement speed," } -RareElementalinaBottle: { - DisplayName: Rare Elemental in a Bottle +OasisElementalinaBottle: { + DisplayName: Oasis Elemental in a Bottle Tooltip: ''' - Summons a sand elemental to heal you - ;D + Summons an oasis elemental to assist you + The elemental fires healing orbs that restore 10 health while you are damaged ''' } @@ -1910,7 +1910,7 @@ TheAmalgam: { DisplayName: The Amalgam Tooltip: ''' - All attacks inflict a variety of debuffs, 300% increased elemental debuff damage + All attacks inflict a variety of debuffs, 200% increased elemental debuff damage Most buffs last twice as long, and persist after dying Taking damage confuses nearby enemies and spawns a dank creeper The dank creeper flies above you, exploding into several shaderain clouds diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 7d07b1699f..e7a6ec4fc8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -220,7 +220,7 @@ BloodflareHeadMelee: { } BloodflareHeadRanged: { - DisplayName: Bloodflare Horned Helm + DisplayName: Bloodflare Demon Helm Tooltip: ''' {$CommonItemTooltip.PercentIncreasedRangedDamageCritChance} @@ -422,7 +422,7 @@ GodSlayerChestplate: { Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - Press {0} to [ceffect/dog:Dimensional Drive] towards your cursor for 2 seconds + Press {0} to [ceffect/dog:Dimensional Drive] towards your cursor for 1.25 seconds Enemies you dash through take massive damage During [ceffect/dog:Dimensional Drive] you are immune to damage and most debuffs [ceffect/dog:Dimensional Drive] has a {1} second cooldown diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 98400df192..9d31adda4a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -281,9 +281,14 @@ Spadefish: { DisplayName: Spadefish Tooltip: ''' + Throws a spadefish at enemies + Stealth Strikes cause you to spin the spade before throwing, damaging nearby enemies + [c/aaaaaa:Shift- this item in your inventory to [TOGGLE] breaking tiles] 'How can a fish be used to dig through the ground? Some questions are best left unanswered...' ''' + TextWhileEnabled: disable + TextWhileDisabled: enable } StuffedFish: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson index 4191c43316..442de828f9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson @@ -143,11 +143,6 @@ ExoPrism: { Tooltip: Fractal energies shimmer across its surface } -GalacticaSingularity: { - DisplayName: Galactica Singularity - Tooltip: A shard of the cosmos -} - GrandScale: { DisplayName: Grand Scale Tooltip: Large scale of an apex predator diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index eae8af8c7e..dd1317d330 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -330,8 +330,7 @@ LegendaryShortTooltip: [c/BABABA:Hold Shift to listen closer] ''' -// Add "Can be extractinated" line in 1.4.5 port DisgustingSlop: { DisplayName: Disgusting Slop - Tooltip: "" + Tooltip: Can be extractinated } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index 36ea72fa67..c774e5f087 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -106,6 +106,16 @@ HermitsBoxofOneHundredMedicines: { ''' } +IronBall: { + DisplayName: Iron Ball + Tooltip: + ''' + Summons a living iron ball + the pet to pet it + the pet to have it sit on your shoulder + ''' +} + JoyfulHeart: { DisplayName: Joyful Heart Tooltip: It's oddly warm. Attracts the forbidden one diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 26d86e7fa2..0557e9a06b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -803,7 +803,7 @@ GluttonyBlender: { Tooltip: ''' A strange industrial contraption which appears to process food - Has the potential to turn food into something more useful... maybe + Has the potential to turn food into something more nutritious... maybe ''' } @@ -933,7 +933,7 @@ ThankYouPainting: { ''' Thanks to the entire team, everyone who supported, and those who all play the mod and keep it alive! The confines of this painting is not enough to fit the entire team - Hold Shift to see a list of past and current developers + Hold Shift to see a list of developers and press Shift to switch between current and past developers ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 9c75b44983..45672e252e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -22,7 +22,7 @@ Baguette: { Tooltip: ''' {$CommonItemTooltip.MinorStats} - Goes well with [cbuff:CalamityMod/RedWineBuff] + Goes well with [cbuffplr:CalamityMod/RedWineBuff] [c/FCE391:'je suis Monte'] ''' } @@ -367,7 +367,7 @@ OddMushroom: { Tooltip: ''' Causes you to see many fake, vibrant copies of all nearby entities - [c/FF232C:These visual effects may be nauseating or otherwise bad for some] + [c/FF232C:These visual effects may be nauseating or harmful to those with photosensitivity issues] 'Trippy' ''' } @@ -582,7 +582,11 @@ Mangosteen: { QualitySlop: { DisplayName: Quality Slop - Tooltip: "{$CommonItemTooltip.MajorStats}" + Tooltip: + ''' + {$CommonItemTooltip.MajorStats} + 'You only like it because it's good' + ''' } Salak: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index c730a6f062..c80e1430d7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -51,7 +51,7 @@ AridArtifact: { ''' Summons a sandstorm The sandstorm will happen shortly after the item is used - If used during a sandstorm, the sandstorm will stop some time afterward. + If used during a sandstorm, the sandstorm will stop some time afterward ''' } @@ -339,7 +339,7 @@ RelicOfResilience: { Holding this item creates orbiting rock shards around you and nearby allies After 5 seconds, the relic will retain orbiting rocks even when not holding the item Continuing to hold the item will steadily increase the number of rocks and defenses until reaching max power - While they orbit you, your minimum defense is set to 150 and minimum damage reduction to 10% + While they orbit you, your minimum defense is set to 200 and minimum damage reduction to 10% Taking a hit or pressing while holding this item will pull in the shards, then blast them outward, crippling hit enemies This effect has a 10 second cooldown after taking a hit, but recharges faster if holding the item Holding out the shield heavily reduces the damage of all summons diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 4b3a6a68e5..1e018efe36 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -41,7 +41,7 @@ CountermeasureMitt: { ''' A precision welding glove with laser emitters in each fingertip to focus all emitters into a short range palm blast that always critically strikes - Palm blasts have a cooldown which is significantly shorter if they miss + Palm blasts restore a large amount of mana on hit and have a cooldown which is significantly shorter if they miss [c/1FFBFF:'Most battalions prefer to either spread attacks widely, or focus on a singular target.] [c/1FFBFF:This glove caters to both, though it will never bridge the gap between their strategies.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 00a3c9144b..293c4fe3bb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -696,8 +696,8 @@ RecitationoftheBeast: { DisplayName: Recitation of the Beast Tooltip: ''' - Summons beast scythes around the player in a small circle, - before firing toward the cursor and home in to nearby enemies + Summons beast scythes around the player in a small circle + Beast scythes fire toward the cursor and home in to nearby enemies ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 608f3adea5..c578a7d302 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -88,7 +88,7 @@ ArkoftheCosmos: { ''' to snip out the scissor blades in front of you Hitting an enemy with it will parry them, granting you brief invulnerability - You can also parry projectiles to make them deal 160 less damage for a short period + You can also parry projectiles to make them deal 120 less damage for a short period Parrying will empower the next 16 swings of the sword ''' BlastInfo: Double with charges available to cause a Big Rip in spacetime and consume all charges @@ -111,7 +111,7 @@ ArkoftheElements: { ''' to snip out the scissor blades in front of you Hitting an enemy with it will parry them, granting you brief invulnerability - You can parry projectiles to make them deal 100 less damage for a short period + You can parry projectiles to make them deal 60 less damage for a short period Parrying will empower the next 10 swings of the sword, letting you use both blades at once ''' } @@ -994,8 +994,10 @@ Pandemic: { DisplayName: Pandemic Tooltip: ''' - {$Common.YoyoStatsInfinite} - Fires [cbuff:CalamityMod/Plague] seekers when enemies are near + {$Common.YoyoStats} + Each unique enemy struck that is infected with [cbuff:CalamityMod/Plague] increases the yoyo's size, power, and airtime + Refreshes [cbuff:CalamityMod/Plague] duration if a target is already infected + Counterweights inflict [cbuff:CalamityMod/Plague] and move twice as fast ''' } @@ -1385,7 +1387,11 @@ TheObliterator: { {$Common.YoyoStatsInfinite} [GFB] ''' - TooltipNormal: Occasionally performs a miniature [ceffect/dog:Dimensional Drive] at nearby foes + TooltipNormal: + ''' + Occasionally performs a miniature [ceffect/dog:Dimensional Drive] at nearby foes + Counterweight hits instantly begin another [ceffect/dog:Dimensional Drive] + ''' TooltipGFB: just a slight bit of dust spam on this weapon im afraid } @@ -1416,7 +1422,7 @@ TriactisTruePaladinianMageHammerofMight: { Throws a heavy, gravity-affected hammer that will return to you after striking an enemy Enemy hits release prismatic light flares which orbit around the struck foe Instead of returning, the fourth hit transforms flares into hardlight hammers - These hammers converge and form a universe-collapsing explosion + These hammers converge and form a universe-collapsing explosion that always critically strikes ''' } @@ -1431,7 +1437,7 @@ TrueArkoftheAncients: { ''' to extend the Ark out in front of you Hitting an enemy with it will parry them, granting you brief invulnerability - You can also parry projectiles to make them deal 80 less damage for a short period + You can also parry projectiles to make them deal 30 less damage for a short period Parrying will empower the next 10 swings of the sword, letting it throw stronger projectiles ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 8c7daab7f7..c503fe3dc1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -715,8 +715,10 @@ Megalodon: { DisplayName: Megalodon Tooltip: ''' - Rapidly fires alternating bullets and pressurized water jets - Water jets consume no ammo + Loads a 30 round magazine of bullets and pressurized water jets that are rapidly unleashed + After firing, the gun unleashes a powerful homing rocket before reloading + Rocket damage is based on how many shots hit + {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -1077,9 +1079,10 @@ Seadragon: { DisplayName: Seadragon Tooltip: ''' - Unleashes a deluge of alternating bullets and pressurized water jets - Additionally fires rockets and emits devastating muzzle blasts - Water jets consume no ammo + Loads a 50 round magazine of alternating bullets and pressurized water jets + Water jets summon small fish that swim around you + When all bullets are fired, summoned fish swarm the cursor while you reload + {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -1488,9 +1491,11 @@ Voidragon: { DisplayName: Voidragon Tooltip: ''' - Fires void blasts that explode every other shot - Shoots demon flame tentacles alongside every shot - Void blasts consume no ammo and bullets have a {0}% chance to save ammo + Loads a 50 round magazine of alternating bullets and concentrated void blasts + When all bullets are fired, the gun unleashes an enormous jet of abyssal fire + The power of the abyssal fire scales with the amount of shots hit + {$CommonItemTooltip.PercentChanceToSaveAmmo} + [c/620BB0:'Fade to black'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 6f959058de..57fd63cf5d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1033,7 +1033,7 @@ Seraphim: { ''' Throws an extraordinarily fast dagger which slows down exponentially and dissipates into light Once dissipation has ended, 6 splitting blades that slice nearby targets are released, along with a large laserbeam - Stealth strikes release a volley of 7 lights which explode into smaller laser beams along with the dagger + Stealth strikes release a volley of 8 lights which explode into smaller laser beams along with the dagger ''' } @@ -1258,8 +1258,8 @@ ThrowingBrick: { DisplayName: Throwing Brick Tooltip: ''' - Prove its resistance by throwing it upwards and catching it with your face - Throws a brick that shatters if stealth is full + Stealth strikes cause the brick to shatter + 'Prove its resistance by throwing it upwards and catching it with your face' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 69436949e8..62d41121e6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -143,8 +143,14 @@ CausticStaff: { Tooltip: ''' Summons a mini dragon to fight for you - The dragon inflicts several debilitating debuffs - The debuffs are only applied if you are holding a summon weapon or tool + The dragon attacks faster and inflicts more debuffs the more are summoned + ''' + HoldShiftTooltip: + ''' + Always inflicts [cbuff:OnFire3] + Inflicts [cbuff:CursedInferno] with 2 dragons summoned + Inflicts [cbuff:Venom] with 3 dragons summoned + Inflicts [cbuff:Ichor] and [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index e5222495cb..873189767c 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -63,7 +63,7 @@ CelestialOnionText: You have already consumed a Celestial Onion. Consuming anoth SanguineTangerineText: You have already consumed a Sanguine Tangerine. Eating any more would make your blood too thick to flow. MiracleFruitText: You have already consumed a Miracle Fruit. It would take a miracle to put you back together if you ate another. TaintedCloudberryText: You have already consumed a Tainted Cloudberry. Your body would become dust if you ate more than one. -SacredStrawberryText: You have already consumed a Sacred Strawberry. Any more draconic power and you'd be rejected. +SacredStrawberryText: You have already consumed a Sacred Strawberry. One more drop of draconic power would obliterate you. CometShardText: You have already used a Comet Shard. Your neurons would die if you used another. EtherealCoreText: You have already used an Ethereal Core. Your brain would escape your head if you dared to use it a second time. PhantomHeartText: You have already used a Phantom Heart. The voices are telling you it's a bad idea to use it again. diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson index 1add4e568b..fc30ef1be4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson @@ -2,6 +2,7 @@ Akato.DisplayName: Akato Astrophage.DisplayName: Astrophage BabyGhostBell.DisplayName: Baby Ghost Bell Bear.DisplayName: Bear +Beldum.DisplayName: Beldum BendyPet.DisplayName: Dreamfog Dragon BrimlingPet.DisplayName: Brimling ChibiiDoggo.DisplayName: Chibii Devourer diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index c1aea2de59..ff335e0aaa 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -188,7 +188,6 @@ ScorchedEarthClusterBomb.DisplayName: Cluster Bomb ScorchedEarthRocket.DisplayName: Rocket ScorpioRocket.DisplayName: Nano Missile ScorpioLargeRocket.DisplayName: Nano Nuke -SeaDragonMuzzleBlast.DisplayName: Seadragon Muzzle Blast SeaDragonRocket.DisplayName: Seadragon RPG SeasSearingBubble.DisplayName: Searing Bubble SeasSearingSecondary.DisplayName: Hydroshower @@ -261,12 +260,14 @@ VanquisherArrowMain.DisplayName: Vanquisher Arrow VanquisherArrowProj.DisplayName: Vanquisher Arrow Proj VeriumBoltProj.DisplayName: Verium Bolt VernalBolt.DisplayName: Vernal Bolt -Voidragon.DisplayName: Voidragon Blast -VoidragonTentacle.DisplayName: Voidragon Tentacle WaterSpout.DisplayName: Spout WildfireBloomFire.DisplayName: Wildfire Fire WildfireBloomFlare.DisplayName: Wildfire Flare WulfrumScrapBullet.DisplayName: High Speed Scrap +AbyssalFire.DisplayName: Abyssal Fire +BlahajBlast.DisplayName: Blahaj Blast +MegalodonRocket.DisplayName: Megalodon Rocket +VoidBlast.DisplayName: Void Blast OmniSniperShot.DisplayName: Omni Sniper Shot OmniGrenade.DisplayName: Omni Grenade OmniShotgunShot.DisplayName: Omni Shotgun Shot diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 228285a23b..721c77a267 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -344,3 +344,5 @@ WulfrumKnifeProj.DisplayName: Wulfrum Knife NanoblackLightspeedCarveSlashVisual.DisplayName: Nanoblack Light-speed Carve Visuals LemonNadeHoldout.DisplayName: Lemon 'nade LemonNadeProjectile.DisplayName: Lemon 'nade +SpadefishHoldout.DisplayName: Spinfish +SpadefishThrown.DisplayName: Spadefish diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 92531f5615..bd0c8302a5 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -664,6 +664,7 @@ Abyss: Disposing of Silva's remains SulphurSea2: Irradiating one of the oceans Roxcalibur: I wanna rock AuricLandMines: Setting god killing traps +IronBall: Adding a bit more iron // Hold Shift tooltip default HoldShiftTooltipExtensionIndicator: Hold Shift for more HoldShiftTooltipReplacementIndicator: Hold Shift for details diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index a33ed0ebe9..4ce439ea10 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -14,6 +14,7 @@ AddedTooltip: { // Also used by Sniper Scope EyeoftheGolem: 15% increased critical strike damage RifleScope: The scope effect can be toggled with visibility + ReconScope2: 5% increased ranged critical strike chance ArcaneFlower: 5% increased magic damage HellfireTreads: ''' @@ -173,6 +174,7 @@ EditedTooltip: { MoltenQuiver: Lights wooden arrows ablaze and all arrows inflict Hellfire RifleScope1: Increase view range for guns ( to zoom out) RifleScope2: The scope effect can be toggled with visibility + ReconScope1: 15% increased ranged damage SniperScope: 12% increased ranged critical strike chance Magiluminescence: ''' @@ -294,7 +296,7 @@ ClothierChat: { } CyborgChat: { - MoonLordDefeated1: Always shoot for the moon! It has clearly worked before. + MoonLordDefeated: Always shoot for the moon! It has clearly worked before. MentionPlague: Those big green roaches in the Jungle don't threaten me, but all of the animals it has consumed... Please, do me a favor and protect them. Rain: All these moments will be lost in time. Like tears... in the rain. } diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index a813e9af22..2ccfab5288 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -122,7 +122,8 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); + var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index e43278356b..96cb4275d7 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -876,6 +876,7 @@ namespace CalamityMod.NPCs ActiveSicknessDebuffMultiplier = SicknessDebuffMultiplier; ActiveElectricDebuffMultiplier = ElectricDebuffMultiplier; ActiveWaterDebuffMultiplier = WaterDebuffMultiplier; + ActiveTypelessDebuffMultiplier = TypelessDebuffMultiplier; if (irradiated) { @@ -902,7 +903,7 @@ namespace CalamityMod.NPCs { ActiveWaterDebuffMultiplier += 0.5f; } - if (npc.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].WaterDebuffScaling > 0) || npc.wet || npc.honeyWet || npc.dripping) + if (npc.buffType.Any(i => CalamityBuffSets.DebuffDataset[i] is not null && CalamityBuffSets.DebuffDataset[i].WaterDebuffScaling > 0) || npc.wet || npc.honeyWet || npc.dripping) { windChilledMult = 1.5f; } @@ -954,7 +955,7 @@ namespace CalamityMod.NPCs for (var index = 0; index < npc.buffType.Length; index++) { var type = npc.buffType[index]; - var debuffData = BuffDatasets.DebuffDataset[type]; + var debuffData = CalamityBuffSets.DebuffDataset[type]; if (debuffData == null || debuffData == DebuffData.Oiled) //Oiled is done after continue; debuffData.NPCLifeRegenMethod(npc, type, ref index, ref damage); @@ -1015,7 +1016,7 @@ namespace CalamityMod.NPCs int dmg = 0; if (glaiveShredTimer > 0) { - dmg += 120; // 60 DPS + dmg += 200; // 100 DPS glaiveShredTimer--; } if (blazingStarShredTimer > 0) @@ -2795,7 +2796,7 @@ namespace CalamityMod.NPCs // Apply armor penetration based on Calamity debuffs. The hit system manages the sequencing. // Ozzatron 05JAN2023: fixed doubled armor pen, this time for real - int defenseReduction = (markedForDeath && DR <= 0f ? MarkedforDeath.DefenseReduction : 0) + (wither ? RemsRevenge.WitherDefenseReduction : 0) + miscDefenseLoss; + int defenseReduction = (wither ? RemsRevenge.WitherDefenseReduction : 0) + miscDefenseLoss; modifiers.ArmorPenetration += defenseReduction; // DR applies after vanilla defense. @@ -2871,8 +2872,6 @@ namespace CalamityMod.NPCs private float ApplyDRReduction(NPC npc, float DR) { float calcDR = DR; - if (markedForDeath) - calcDR *= 0.5f; if (absorberAffliction) calcDR *= 0.8f; if (npc.Calamity().armorCrunch) @@ -3666,6 +3665,9 @@ namespace CalamityMod.NPCs public override void ModifyHitByItem(NPC npc, Player player, Item item, ref NPC.HitModifiers modifiers) { CalamityPlayer modPlayer = player.Calamity(); + if (markedForDeath) + modifiers.SourceDamage *= 1.1f; + if (modPlayer.camper && !player.StandingStill()) modifiers.SourceDamage *= 0.5f; @@ -3853,6 +3855,9 @@ namespace CalamityMod.NPCs modifiers.SourceDamage *= 0.33f; } + if (markedForDeath) + modifiers.SourceDamage *= 1.1f; + if (modPlayer.camper && !player.StandingStill()) modifiers.SourceDamage *= 0.5f; @@ -3930,7 +3935,8 @@ namespace CalamityMod.NPCs if (npc.buffTime[i] >= 1) { int type = npc.buffType[i]; - if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out SummonTag tag)) + var tag = CalamityBuffSets.SummonTagDebuff[type]; + if (tag is not null) tag.TagModifyHitEffects(proj, npc, ref modifiers, ref TagDamageMult, ref critChance); } } @@ -3982,7 +3988,8 @@ namespace CalamityMod.NPCs if (npc.buffTime[i] >= 1) { int type = npc.buffType[i]; - if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out SummonTag tag)) + var tag = CalamityBuffSets.SummonTagDebuff[type]; + if (tag is not null) tag.TagOnHit(npc, projectile, hit, damagedone); } } @@ -5146,13 +5153,13 @@ namespace CalamityMod.NPCs ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, somaShredStacks.ToString(), npc.Center - screenPos - new Vector2(drawPosX, drawPosY + additionalYOffset) + Vector2.One * 4f, Color.Gold, 0f, Vector2.Zero, Vector2.One * Main.UIScale * 0.8f); } - // Draw summon tag display. TODO: make it use custom textures provided by SummonTag. int yOffset = 0; for (int i = NPC.maxBuffs - 1; i >= 0; i--) { if (npc.buffTime[i] > 0) { - if (CalamityBuffSets.SummonTagDebuff.TryGetValue(npc.buffType[i], out SummonTag tag)) + var tag = CalamityBuffSets.SummonTagDebuff[npc.buffType[i]]; + if (tag is not null) { // Fetch the item and its frames var tex = TextureAssets.Item[tag.TagItem].Value; diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index aace9a5e10..fc2a6c5711 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -267,11 +267,11 @@ namespace CalamityMod.NPCs // Sand Elemental // Elemental in a Bottle @ 20% Normal, 33.33% Expert+ - // Rare Elemental in a Bottle @ 10% Normal, 16.67% Expert+ + // Oasis Elemental in a Bottle @ 10% Normal, 16.67% Expert+ // Desert Key @ 10% case NPCID.SandElemental: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); npcLoot.Add(ItemID.DungeonDesertKey, 10); break; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 409ca846b9..ebc347aeeb 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1234,7 +1234,7 @@ namespace CalamityMod.NPCs public void BoundNPCSafety(Mod mod, NPC npc) { // Make Bound Town NPCs take no damage - if (CalamityNPCTypeSets.BoundTownNPC[npc.type]) + if (CalamityNPCSets.BoundTownNPC[npc.type]) npc.dontTakeDamageFromHostiles = true; } diff --git a/NPCs/Crags/InfernalCongealment.cs b/NPCs/Crags/InfernalCongealment.cs index 4cfd936e34..74dfb53f73 100644 --- a/NPCs/Crags/InfernalCongealment.cs +++ b/NPCs/Crags/InfernalCongealment.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Crags if (DownedBossSystem.downedProvidence) { NPC.damage = 80; - NPC.defense = 20; + NPC.defense = 40; NPC.lifeMax = 3500; } Banner = NPC.type; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 22cafef865..2d45fb0d1d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -254,7 +254,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 225; // 450 + NPC.damage = 235; // 470 NPC.npcSlots = 5f; NPC.width = 104; NPC.height = 104; @@ -2678,6 +2678,9 @@ namespace CalamityMod.NPCs.DevourerofGods GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), dropRate, dropMin, dropMax), true); GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), dropRate, dropMin, dropMax), true); GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), dropRate, dropMin, dropMax), true); + GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), dropRate, dropMin, dropMax), true); + GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), dropRate, dropMin, dropMax), true); + GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), dropRate, dropMin, dropMax), true); } // Trophy (always directly from boss, never in bag) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 8a7abc4e6c..08c606929d 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -238,7 +238,7 @@ namespace CalamityMod.NPCs.Ravager public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) { var item = Main.player[projectile.owner].HeldItem; - if (item.pick > 0 && projectile.CountsAsClass()) + if (item.pick > 0 && !projectile.CountsAsClass()) { modifiers.FlatBonusDamage += -10000; modifiers.FinalDamage.Flat += item.pick-1; diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index ad80d16cc6..4edcd8d1f8 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.Ravager public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) { var item = Main.player[projectile.owner].HeldItem; - if (item.pick > 0 && projectile.CountsAsClass()) + if (item.pick > 0 && !projectile.CountsAsClass()) { modifiers.FlatBonusDamage += -10000; modifiers.FinalDamage.Flat += item.pick - 1; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index a5fcdec89a..01165da0e4 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -103,10 +103,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas public bool IsAtHp_Acceptance => NPC.life < 2; public bool IsAtBrothers => IsAtHp_BH3 && FinishedBH3; - public bool IsAtSeekers => IsAtHp_BH4 && FinishedBH4; + public bool IsAtSeekers => lifeRatio <= 0.2f; public bool IsAtSep2 => IsAtHp_BH5 && FinishedBH5; - public const int PermafrostAbsoluteZeroDamage = 3725; + public const int PermafrostAbsoluteZeroDamage = 1400; private const float PermafrostPhotonRipperDashVelocity = 6f; private const float PermafrostPhotonRipperMinDistanceFromTarget = 64f; private const float PermafrostPhotonRipperDashAcceleration = 0.3f; @@ -119,20 +119,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas public bool canDespawn = false; public bool despawnProj = false; public bool startText = false; - public bool startBattle = false; //100% - public bool hasSummonedSepulcher1 = false; //100% - public bool startSecondAttack = false; //80% - public bool startThirdAttack = false; //60% - public bool halfLife = false; //40% - public bool startFourthAttack = false; //30% - public bool secondStage = false; //20% - public bool startFifthAttack = false; //10% - public bool gettingTired = false; //8% - public bool hasSummonedSepulcher2 = false; //8% - public bool gettingTired2 = false; //6% - public bool gettingTired3 = false; //4% - public bool gettingTired4 = false; //2% - public bool gettingTired5 = false; //1% + public bool startBattle = false; + public bool hasSummonedSepulcher1 = false; + public bool startSecondAttack = false; + public bool startThirdAttack = false; + public bool halfLife = false; + public bool startFourthAttack = false; + public bool hasSummonedSeekers = false; + public bool startFifthAttack = false; + public bool gettingTired = false; + public bool hasSummonedSepulcher2 = false; + public bool gettingTired2 = false; + public bool gettingTired3 = false; + public bool gettingTired4 = false; + public bool gettingTired5 = false; public bool willCharge = false; public bool canFireSplitingFireball = true; public bool fireFireblastFirst = true; @@ -164,6 +164,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public int preventionPause = 15; // Helps prevent telefragging public int attackPause = 0; public bool respawnBro = true; // Master Mode change + public bool teleport = false; //Used to teleport SCal to the center of the arena at the start of each bullet hell public float shieldOpacity = 1f; public float shieldRotation = 0f; @@ -364,7 +365,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas writer.Write(startFourthAttack); writer.Write(startFifthAttack); writer.Write(halfLife); - writer.Write(secondStage); + writer.Write(hasSummonedSeekers); writer.Write(hasSummonedSepulcher2); writer.Write(gettingTired); writer.Write(gettingTired2); @@ -416,7 +417,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas startFourthAttack = reader.ReadBoolean(); startFifthAttack = reader.ReadBoolean(); halfLife = reader.ReadBoolean(); - secondStage = reader.ReadBoolean(); + hasSummonedSeekers = reader.ReadBoolean(); hasSummonedSepulcher2 = reader.ReadBoolean(); gettingTired = reader.ReadBoolean(); gettingTired2 = reader.ReadBoolean(); @@ -490,9 +491,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Used for Scal's teleport at the start of brothers phase - bool teleport = false; - // permafrost and zenith scal are mutually exclusive bool zenithAI = Main.zenithWorld && !permafrost; @@ -1046,7 +1044,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.damage = 0; NPC.chaseable = false; NPC.dontTakeDamage = true; - + //At the start of the bullet hell, teleport Scal to the center of the arena + if (!teleport) + { + Vector2 goalPos = new Vector2(spawnX + (death ? 1000 : 1250), spawnY + (death ? 1000 : 1250)); // player.Center + new Vector2(0, -175) + Dust.QuickDustLine(NPC.Center, goalPos + new Vector2(0, -20), 500f, permafrost ? Color.Cyan : Color.Red); + NPC.velocity = Vector2.Zero; + NPC.Center = goalPos; + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Red, new Vector2(1f, 1f), 0, 0.1f, 5f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + teleport = true; + } #region BulletHellEndTelegraphBH2 if (bulletHellCounter2 == (SecondBulletHellEndValue - 360)) BulletHellRumbleSlot = SoundEngine.PlaySound(BulletHellSound, player.Center); @@ -1073,6 +1081,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(pulse2); SoundEngine.PlaySound(BulletHellEndSound, NPC.Center); + //Reset the teleport bool for the next bullet hell + teleport = false; } #endregion @@ -1177,7 +1187,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.damage = 0; NPC.chaseable = false; NPC.dontTakeDamage = true; - + //At the start of the bullet hell, teleport Scal to the center of the arena + if (!teleport) + { + Vector2 goalPos = new Vector2(spawnX + (death ? 1000 : 1250), spawnY + (death ? 1000 : 1250)); // player.Center + new Vector2(0, -175) + Dust.QuickDustLine(NPC.Center, goalPos + new Vector2(0, -20), 500f, permafrost ? Color.Cyan : Color.Red); + NPC.velocity = Vector2.Zero; + NPC.Center = goalPos; + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Red, new Vector2(1f, 1f), 0, 0.1f, 5f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + teleport = true; + } #region BulletHellEndTelegraphBH3 if (bulletHellCounter2 == (ThirdBulletHellEndValue - 360)) BulletHellRumbleSlot = SoundEngine.PlaySound(BulletHellSound, player.Center); @@ -1204,6 +1224,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(pulse2); SoundEngine.PlaySound(BulletHellEndSound, NPC.Center); + //Reset the teleport bool for the next bullet hell + teleport = false; } #endregion @@ -1353,6 +1375,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.damage = 0; NPC.chaseable = false; NPC.dontTakeDamage = true; + //At the start of the bullet hell, teleport Scal to the center of the arena + if (!teleport) + { + Vector2 goalPos = new Vector2(spawnX + (death ? 1000 : 1250), spawnY + (death ? 1000 : 1250)); // player.Center + new Vector2(0, -175) + Dust.QuickDustLine(NPC.Center, goalPos + new Vector2(0, -20), 500f, permafrost ? Color.Cyan : Color.Red); + NPC.velocity = Vector2.Zero; + NPC.Center = goalPos; + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Red, new Vector2(1f, 1f), 0, 0.1f, 5f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + teleport = true; + } #region BulletHellEndTelegraphBH4 if (bulletHellCounter2 == (FourthBulletHellEndValue - 360)) @@ -1380,6 +1413,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(pulse2); SoundEngine.PlaySound(BulletHellEndSound, NPC.Center); + //Reset the teleport bool for the next bullet hell + teleport = false; } #endregion @@ -1508,7 +1543,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.damage = 0; NPC.chaseable = false; NPC.dontTakeDamage = true; - + //At the start of the bullet hell, teleport Scal to the center of the arena + if (!teleport) + { + Vector2 goalPos = new Vector2(spawnX + (death ? 1000 : 1250), spawnY + (death ? 1000 : 1250)); // player.Center + new Vector2(0, -175) + Dust.QuickDustLine(NPC.Center, goalPos + new Vector2(0, -20), 500f, permafrost ? Color.Cyan : Color.Red); + NPC.velocity = Vector2.Zero; + NPC.Center = goalPos; + Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Red, new Vector2(1f, 1f), 0, 0.1f, 5f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + teleport = true; + } #region BulletHellEndTelegraphBH5 if (bulletHellCounter2 == (FifthBulletHellEndValue - 360)) BulletHellRumbleSlot = SoundEngine.PlaySound(BulletHellSound, player.Center); @@ -1535,6 +1580,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(pulse2); SoundEngine.PlaySound(BulletHellEndSound, NPC.Center); + //Reset the teleport bool for the next bullet hell + //Technically not needed but I wanted to be safe + teleport = false; } #endregion @@ -2070,7 +2118,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (IsAtSeekers) { - if (!secondStage) + if (!hasSummonedSeekers) { if (!BossRushEvent.BossRushActive) { @@ -2113,7 +2161,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } SoundEngine.PlaySound(SoundID.DD2_DarkMageHealImpact, player.Center); - secondStage = true; + hasSummonedSeekers = true; } } @@ -2134,37 +2182,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas enteredBrothersPhase = true; attackCastDelay = brothersSpawnCastTime; NPC.netUpdate = true; - if (!teleport) - { - Vector2 goalPos = new Vector2(spawnX + (death ? 1000 : 1250), spawnY + (death ? 1000 : 1250)); // player.Center + new Vector2(0, -175) - Dust.QuickDustLine(NPC.Center, goalPos + new Vector2(0, -20), 500f, permafrost ? Color.Cyan : Color.Red); - NPC.velocity = Vector2.Zero; - NPC.Center = goalPos; - Particle pulse = new DirectionalPulseRing(NPC.Center, Vector2.Zero, Color.Red, new Vector2(1f, 1f), 0, 0.1f, 5f, 15); - GeneralParticleHandler.SpawnParticle(pulse); - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == bulletHellblast || - projectile.type == barrage || - projectile.type == wave) - { - if (projectile.timeLeft > 60) - projectile.timeLeft = 60; - } - else if (projectile.type == fireblast || projectile.type == gigablast) - { - projectile.ai[2] = 1f; - - if (projectile.timeLeft > 15) - projectile.timeLeft = 15; - } - } - } - teleport = true; - } } else { @@ -2743,13 +2760,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!canDespawn) { - NPC.velocity *= 0.98f; + NPC.velocity *= 0f; if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) NPC.velocity.X = 0f; if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) NPC.velocity.Y = 0f; } + FrameType = FrameAnimationType.Casting; } #endregion #region LastStage @@ -3458,6 +3476,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCKilled/RavagerDeath2") with { Pitch = -0.2f }, catastropheSpawnPosition); hasSummonedBrothers = true; } + + NPC.velocity *= 0f; + if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) + NPC.velocity.X = 0f; + if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) + NPC.velocity.Y = 0f; + + FrameType = FrameAnimationType.Casting; } public void ConnectAllBrimstoneHearts(List heartIndices) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitasHooded.png b/NPCs/SupremeCalamitas/SupremeCalamitasHooded.png index 0d99e8edfa..eae9fb6ec7 100644 Binary files a/NPCs/SupremeCalamitas/SupremeCalamitasHooded.png and b/NPCs/SupremeCalamitas/SupremeCalamitasHooded.png differ diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index c554318e43..aa96266be8 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -845,6 +845,10 @@ namespace CalamityMod.NPCs.Yharon NPC.spriteDirection = -NPC.direction; } + // Play a roar sound before charging out of bullet hell + if (NPC.ai[2] == -45f) + RoarSoundSlot = SoundEngine.PlaySound(ShortRoarSound, NPC.Center); + NPC.ai[2] += 1f; if (NPC.ai[2] >= phaseSwitchTimer || slowChargeAfterBulletHell) { @@ -1211,6 +1215,10 @@ namespace CalamityMod.NPCs.Yharon NPC.spriteDirection = -NPC.direction; } + // Play a roar sound before charging out of bullet hell + if (NPC.ai[2] == -45f) + RoarSoundSlot = SoundEngine.PlaySound(ShortRoarSound, NPC.Center); + NPC.ai[2] += 1f; if (NPC.ai[2] >= phaseSwitchTimer || slowChargeAfterBulletHell) { diff --git a/Packets/Players/TheElixirTeleportSyncPacket.cs b/Packets/Players/TheElixirTeleportSyncPacket.cs new file mode 100644 index 0000000000..ce86f534a9 --- /dev/null +++ b/Packets/Players/TheElixirTeleportSyncPacket.cs @@ -0,0 +1,47 @@ +using System.IO; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Packets +{ + internal class TheElixirTeleportSyncPacket : CalamityPacket + { + public static TheElixirTeleportSyncPacket Instance { get; private set; } + + public static void Send(Player player, int locationIndex = -1, int toClient = -1, int ignoreClient = -1) + { + if (player is null || locationIndex == -1) + return; + + var packet = Instance.CreateBasePacket(); + packet.WriteWhoAmI(player); + packet.Write(locationIndex); + packet.Send(toClient, ignoreClient); + } + + public override void HandlePacket(BinaryReader packet, int sender) + { + var player = packet.ReadPlayer(); + var locationIndex = packet.ReadInt32(); + + if (player is null) + return; + + Vector2? location = locationIndex switch + { + 1 => CalamityPlayer.GetAbyssVoidTeleportPosition(player), + 2 => CalamityPlayer.GetTempleTeleportPosition(player), + _ => CalamityPlayer.GetDungeonArchivesTeleportPosition(player) + }; + + if (!location.HasValue) + return; + + player.AddBuff(BuffID.ChaosState, 300, false); + player.AddBuff(BuffID.Cursed, 300, false); + CalamityPlayer.ModTeleport(player, location.Value, false, TeleportationStyleID.RecallPotion); + } + } +} diff --git a/Prefixes/ReforgeChange.cs b/Prefixes/ReforgeChange.cs index 45b15fdb4b..4ac43c710e 100644 --- a/Prefixes/ReforgeChange.cs +++ b/Prefixes/ReforgeChange.cs @@ -203,7 +203,7 @@ namespace CalamityMod.Prefixes // MELEE (includes tools and whips) // Melee-ranged hybrid weapons prioritize Legendary if available, otherwise go for Unreal - if ((item.CountsAsClass() || item.CountsAsClass()) && !(item.CountsAsClass() && !supportsLegendary) && !(item.type == ItemType())) + if ((item.CountsAsClass() || item.CountsAsClass() || item.type == ItemType()) && !(item.CountsAsClass() && !supportsLegendary) && !(item.type == ItemType())) { // Terrarian (has its own special "Legendary" for marketing reasons) // Other items that want to use Legendary2 are also compatible diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index c3f0496bcf..1b9965b71d 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -88,6 +88,11 @@ namespace CalamityMod.Projectiles.Boss } } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 360); + } + public override void OnHitPlayer(Player target, Player.HurtInfo info) { if (info.Damage <= 0) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 18a0c13172..aa0bbd5249 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using CalamityMod.Buffs; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; @@ -149,6 +150,11 @@ namespace CalamityMod.Projectiles /// public bool fireBullet = false; /// + /// If true, allows projectiles to track damage scaling.
+ /// Used by Megalodon and Voidragon. + ///
+ public bool sharkBullets = false; + /// /// If true, adds an ice trail to the projectile, and makes it inflict Frostbite.
/// Used by Thermocline Blaster. ///
@@ -384,6 +390,9 @@ namespace CalamityMod.Projectiles grapeBeer = true; } + // Apply some parent information to children + if (parent.Calamity().ParentNPCIndex != -1) + ParentNPCIndex = parent.Calamity().ParentNPCIndex; if (parent.Calamity().IgnoreBoCIllusions) IgnoreBoCIllusions = true; @@ -423,8 +432,14 @@ namespace CalamityMod.Projectiles } } - public override void SendExtraAI(Projectile projectile, BitWriter bitWriter, BinaryWriter binaryWriter) => binaryWriter.Write(ParentNPCIndex); - public override void ReceiveExtraAI(Projectile projectile, BitReader bitReader, BinaryReader binaryReader) => ParentNPCIndex = binaryReader.ReadInt32(); + public override void SendExtraAI(Projectile projectile, BitWriter bitWriter, BinaryWriter binaryWriter) + { + binaryWriter.Write(ParentNPCIndex); + } + public override void ReceiveExtraAI(Projectile projectile, BitReader bitReader, BinaryReader binaryReader) + { + ParentNPCIndex = binaryReader.ReadInt32(); + } #endregion On Spawn #region Set Defaults @@ -467,11 +482,11 @@ namespace CalamityMod.Projectiles HomingTarget = -1; #region Vanilla Summons AI Changes - // - // MINION AI CHANGES: - // + // + // MINION AI CHANGES: + // - // Hornet Staff's minion changes. + // Hornet Staff's minion changes. if (projectile.type == ProjectileID.Hornet) return HornetMinionAI.DoHornetMinionAI(projectile); @@ -499,37 +514,16 @@ namespace CalamityMod.Projectiles if (Main.player[projectile.owner].yoyoGlove && projectile.aiStyle == ProjAIStyleID.Yoyo) { // Store damage on first frame - if (projectile.ai[2] == 0f) - projectile.ai[2] = projectile.damage; + if (projectile.localAI[2] == 0f) + projectile.localAI[2] = projectile.damage; - // Find the first yoyo projectile owned by the corresponding player - // Limited lifespan yoyos are horrendous so it had to be this way - // EDIT: ownedProjectileCounts does not work what the fuck - int MainYoyo = -1; - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile proj = Main.projectile[x]; - if (proj.active && proj.type == projectile.type && proj.owner == projectile.owner) - { - MainYoyo = x; - break; - } - } + var MainYoyo = Main.projectile.First(x => x.active && x.type == projectile.type && x.owner == projectile.owner).whoAmI; // Halve damage if not the main yoyo if (projectile.whoAmI != MainYoyo) - projectile.damage = (int)(projectile.ai[2] * 0.5f); + projectile.damage = (int)(projectile.localAI[2] * 0.5f); else - projectile.damage = (int)projectile.ai[2]; - } - - // This code fixes the wacky close-up burst damage bug which occurs with double yoyos and local iframes. - // Oh my good friends, do not ask me how or why this works, for I do not know! - // That being said, PLEASE DON'T REMOVE THIS, unless you think The Microwave killing Provi in 2 seconds with no effort is okay. - if (projectile.aiStyle == ProjAIStyleID.Yoyo) - { - if (projectile.ai[0] == -1) - projectile.Kill(); + projectile.damage = (int)projectile.localAI[2]; } if (projectile.minion && ExplosiveEnchantCountdown > 0) @@ -2585,7 +2579,7 @@ namespace CalamityMod.Projectiles projectile.velocity *= scaleFactor2; projectile.velocity *= 0.99f; - + if (projectile.ai[0] % (death ? 20f : 30f) == 0f && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector50 = projectile.rotation.ToRotationVector2(); @@ -3566,7 +3560,7 @@ namespace CalamityMod.Projectiles if (owner.HasBuff(BuffID.WellFed2)) { var bIndex = owner.FindBuffIndex(BuffID.WellFed2); - if (owner.buffTime[bIndex] < CalamityUtils.MinutesToFrames(24)) + if (owner.buffTime[bIndex] < CalamityUtils.MinutesToFrames(24)) { owner.buffTime[bIndex] += 300; } @@ -3788,7 +3782,7 @@ namespace CalamityMod.Projectiles return false; } #endregion - + #region AI public override void AI(Projectile projectile) { @@ -3980,10 +3974,6 @@ namespace CalamityMod.Projectiles } #endregion - // Starfury stars never collide with tiles - if (projectile.type == ProjectileID.Starfury) - projectile.tileCollide = false; - // True Night's Edge projectiles instantly start with max velocity if (projectile.type == ProjectileID.TrueNightsEdge) { @@ -4379,7 +4369,9 @@ namespace CalamityMod.Projectiles if (grapeBeerHomingTarget == target.whoAmI) { grapeBeerHomingPower += 0.004f; - } else { + } + else + { grapeBeerHomingPower = 0.015f; } @@ -4622,8 +4614,8 @@ namespace CalamityMod.Projectiles { for (int i = 0; i < 8; i++) { - Particle floweyFromHitGameUndertale = new CustomSpark(player.Center, Utils.DirectionTo(player.Center, player.Calamity().mouseWorld).RotatedByRandom(0.6f) * Main.rand.NextFloat(4f, 11f), - "CalamityMod/Particles/MiniFlower", false, Main.rand.Next(65, 78 + 1), Main.rand.NextFloat(1.8f, 2.8f), + Particle floweyFromHitGameUndertale = new CustomSpark(player.Center, Utils.DirectionTo(player.Center, player.Calamity().mouseWorld).RotatedByRandom(0.6f) * Main.rand.NextFloat(4f, 11f), + "CalamityMod/Particles/MiniFlower", false, Main.rand.Next(65, 78 + 1), Main.rand.NextFloat(1.8f, 2.8f), Color.Lerp(Color.HotPink, Color.Plum, Main.rand.NextFloat(0, 0.65f)), new Vector2(1f, 1f), true, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi)); GeneralParticleHandler.SpawnParticle(floweyFromHitGameUndertale); @@ -4639,15 +4631,15 @@ namespace CalamityMod.Projectiles } public override void GrapplePullSpeed(Projectile projectile, Player player, ref float speed) { + if (player.Calamity().bloomStone) + speed += 6f; float mult = 1f; if (player.Calamity().reaverSpeed) mult += ReaverHeadMobility.SetBonusHookBoost; if (player.Calamity().tungstenArmorHookBoost) mult += TungstenArmorSetChange.HookBoost; - if (player.Calamity().bloomStone) - mult += 0.5f; - speed *= mult; + speed *= mult; if (player.velocity.Length() > 2f) { player.Calamity().hookPullVisuals = 60; @@ -4655,13 +4647,13 @@ namespace CalamityMod.Projectiles } public override void GrappleRetreatSpeed(Projectile projectile, Player player, ref float speed) { + if (player.Calamity().bloomStone) + speed += 6f; float mult = 1f; if (player.Calamity().reaverSpeed) mult += ReaverHeadMobility.SetBonusHookBoost; if (player.Calamity().tungstenArmorHookBoost) mult += TungstenArmorSetChange.HookBoost; - if (player.Calamity().bloomStone) - mult += 0.5f; speed *= mult; } #endregion @@ -4684,7 +4676,7 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier; var dripPlayer = player.GetModPlayer(); - if (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) && buffedByOldFashioned.HasValue) + if (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) && buffedByOldFashioned.HasValue) modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier; if ((modPlayer.rum || dripPlayer.HasAlcohol(AlcoholType.Rum)) && projectile.DamageType.CountsAsClass(DamageClass.Summon)) @@ -4823,20 +4815,29 @@ namespace CalamityMod.Projectiles Main.projectile[soul].tileCollide = false; if (soul.WithinBounds(Main.maxProjectiles)) Main.projectile[soul].DamageType = DamageClass.Generic; - } + Main.projectile[soul].ArmorPenetration = 20; + } extorterBoost = false; } } - + } #endregion #region Modify Hit Player public override void ModifyHitPlayer(Projectile projectile, Player target, ref Player.HurtModifiers modifiers) - { + { modifiers.FinalDamage.Flat -= flatDR; modifiers.FinalDamage *= 1f - multiplicativeDR; + + // Reduce projectile damage if the enemy is inflicted with Whispering Death + if (ParentNPCIndex != -1) + { + NPC npc = Main.npc[(int)ParentNPCIndex]; + if (npc.active && npc.Calamity().whisperingDeath) + modifiers.FinalDamage *= 1f - WhisperingDeath.EnemyDamageReduction; + } } #endregion @@ -4857,7 +4858,7 @@ namespace CalamityMod.Projectiles var player = Main.player[projectile.owner]; float burnRatio = (-player.statMana / 100) * ChaosStone.DamageMultPer100Mana; var dripPlayer = player.GetModPlayer(); - target.Calamity().manaBurn += damageDone * burnRatio * (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) ? OldFashioned.DamageBoostMultiplier : 1) * (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().vodka ? 1+Vodka.DebuffBoost : 1); + target.Calamity().manaBurn += damageDone * burnRatio * (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) ? OldFashioned.DamageBoostMultiplier : 1) * (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().vodka ? 1 + Vodka.DebuffBoost : 1); target.Calamity().playerManaBurnIntensity = -player.statMana / (float)player.statManaMax2; if (Main.netMode != NetmodeID.SinglePlayer) ManaBurnSyncPacket.Send(target); diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 0b25818a53..072e1ddb65 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles { ProjectileID.HiveFive, RebalanceYoyo(24f, 320f, 20f, 0, 15) }, // original: 8s lifetime | 215px range | 13px/f top speed | 0 extra updates - { ProjectileID.JungleYoyo, RebalanceYoyo(20f, 288f, 17f, 0, 20) }, // Amazon + { ProjectileID.JungleYoyo, RebalanceYoyo(24f, 320f, 20f, 0, 20) }, // Amazon // original: INF lifetime | 340px range | 16px/f top speed | 0 extra updates { ProjectileID.Kraken, RebalanceYoyo(-1f, 480f, 54f, 2) }, @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles { ProjectileID.ExplosiveBullet, Do(ExtraUpdatesDelta(+2), IDStaticIFrames(5), SingleHitImmunity) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert { ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150), DefaultIDStaticIFrames) }, - { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, + { ProjectileID.Flamarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor { ProjectileID.FlyingKnife, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, @@ -200,12 +200,11 @@ namespace CalamityMod.Projectiles { ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.SolarFlareDrill, standardDrillTweaks }, { ProjectileID.StardustDrill, standardDrillTweaks }, - { ProjectileID.Starfury, Do(TimeLeftExact(75), DefaultIDStaticIFrames) }, { ProjectileID.StarWrath, Do(NoPiercing) }, { ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) }, { ProjectileID.SwordBeam, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, // Beam Sword projectile { ProjectileID.Terragrim, Do(TrueMeleeNoSpeed, ScaleExact(1.25f), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes - { ProjectileID.ThunderStaffShot, Do(PiercingExact(3), DefaultIDStaticIFrames) }, //Thunder Zapper projectile + { ProjectileID.ThunderStaffShot, Do(PiercingExact(2), DefaultIDStaticIFrames) }, //Thunder Zapper projectile { ProjectileID.TitaniumChainsaw, standardChainsawTweaks }, { ProjectileID.TitaniumDrill, standardDrillTweaks }, { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, @@ -555,6 +554,7 @@ namespace CalamityMod.Projectiles { ProjectileID.Stake, defaultIFrames }, { ProjectileID.StarAnise, defaultIFrames }, { ProjectileID.StarCannonStar, defaultIFrames }, + { ProjectileID.Starfury, defaultIFrames }, { ProjectileID.StardustCellMinion, defaultIFrames }, { ProjectileID.StardustGuardianExplosion, defaultIFrames }, { ProjectileID.StickyBomb, defaultIFrames }, diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs index 22a4bd3c7a..1411585c5f 100644 --- a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs +++ b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public float alteredRotationRot = 0.7f; // Alteration to the holdout rotation so it's not directly to the mouse, changes with the attack cycle public float alteredRotation => Projectile.rotation + (f2r * alteredRotationRot * -Projectile.direction); public Vector2 palmBlastPos => Owner.Center + alteredRotation.ToRotationVector2() * 55 * Projectile.scale; - public int palmManaCost => HeldItem.mana * 30; + public int palmManaCost => HeldItem.mana * 15; public int hitTimer = 0; public override void SetDefaults() { diff --git a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs index b94a6f39b0..5bbc67511d 100644 --- a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs +++ b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs @@ -51,6 +51,18 @@ namespace CalamityMod.Projectiles.DraedonsArsenal time++; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Player player = Main.player[Projectile.owner]; + int manaGained = 250; + player.statMana += manaGained; + if (Main.myPlayer == player.whoAmI) + player.ManaEffect(manaGained); + + if (player.statMana > player.statManaMax2) + player.statMana = player.statManaMax2; + } + public override bool? CanHitNPC(NPC target) => (target == targeted) ? null : false; public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) diff --git a/Projectiles/Environment/MurkySteam.cs b/Projectiles/Environment/MurkySteam.cs index 7a08be9d5c..d98779f782 100644 --- a/Projectiles/Environment/MurkySteam.cs +++ b/Projectiles/Environment/MurkySteam.cs @@ -42,7 +42,9 @@ namespace CalamityMod.Projectiles.Environment public override void OnHitPlayer(Player target, Player.HurtInfo info) { - if (info.Damage <= 0) + // CIT 23MAY2026: Vanilla's logic for granting "Burning immunity" is incredibly stupid because Player.fireWalk actually just prevents running hot tile touch code. + // Thus we must add a manual check for Player.fireWalk here too. + if (info.Damage <= 0 || target.fireWalk) return; target.AddBuff(BuffID.Burning, 180); diff --git a/Projectiles/Environment/ThermalSteam.cs b/Projectiles/Environment/ThermalSteam.cs index 4539d420a9..84c4fdeeb2 100644 --- a/Projectiles/Environment/ThermalSteam.cs +++ b/Projectiles/Environment/ThermalSteam.cs @@ -42,7 +42,9 @@ namespace CalamityMod.Projectiles.Environment public override void OnHitPlayer(Player target, Player.HurtInfo info) { - if (info.Damage <= 0) + // CIT 23MAY2026: Vanilla's logic for granting "Burning immunity" is incredibly stupid because Player.fireWalk actually just prevents running hot tile touch code. + // Thus we must add a manual check for Player.fireWalk here too. + if (info.Damage <= 0 || target.fireWalk) return; target.AddBuff(BuffID.Burning, 180); diff --git a/Projectiles/Magic/AcidGunStream.cs b/Projectiles/Magic/AcidGunStream.cs index 14d510b68c..36e9e66da0 100644 --- a/Projectiles/Magic/AcidGunStream.cs +++ b/Projectiles/Magic/AcidGunStream.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; Projectile.ignoreWater = true; - Projectile.penetrate = 3; + Projectile.penetrate = 2; Projectile.extraUpdates = 2; Projectile.tileCollide = false; Projectile.usesIDStaticNPCImmunity = true; diff --git a/Projectiles/Magic/AerSigil.cs b/Projectiles/Magic/AerSigil.cs index 5af08db9b2..84d5bdc46a 100644 --- a/Projectiles/Magic/AerSigil.cs +++ b/Projectiles/Magic/AerSigil.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 targetDirection = Projectile.Center.DirectionTo(Main.MouseWorld).SafeNormalize(Vector2.UnitX); spawnedProjectile = true; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 48f, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 36f, ModContent.ProjectileType(), Projectile.damage * 3, Projectile.knockBack, Projectile.owner); } if (Projectile.localAI[0] >= 50) diff --git a/Projectiles/Magic/AerSigilMissile.cs b/Projectiles/Magic/AerSigilMissile.cs index a97417bf7b..b75cdb3981 100644 --- a/Projectiles/Magic/AerSigilMissile.cs +++ b/Projectiles/Magic/AerSigilMissile.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = 1; Projectile.alpha = 255; Projectile.timeLeft = 420; - Projectile.usesLocalNPCImmunity = true; + Projectile.MaxUpdates = 2; // Makes trail draw right away for (int i = 0; i < Projectile.oldPos.Length; i++) @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.owner == Main.myPlayer) { - Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 4.25f), Projectile.knockBack * 6, Projectile.owner); + Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack * 6, Projectile.owner); explosion.ai[1] = 600f; explosion.localAI[1] = Main.rand.NextFloat(0.1f, 0.2f); // Interpolate explosion.netUpdate = true; diff --git a/Projectiles/Magic/AquaSigil.cs b/Projectiles/Magic/AquaSigil.cs index 45a03ce786..e1cfeafec8 100644 --- a/Projectiles/Magic/AquaSigil.cs +++ b/Projectiles/Magic/AquaSigil.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 targetDirection = Projectile.Center.DirectionTo(Main.MouseWorld).SafeNormalize(Vector2.UnitX); spawnedProjectile = true; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 29f, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 32f, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner); } if (Projectile.localAI[0] >= 50) diff --git a/Projectiles/Magic/AquaSigilWaterball.cs b/Projectiles/Magic/AquaSigilWaterball.cs index 3b37d92670..12df9f41e4 100644 --- a/Projectiles/Magic/AquaSigilWaterball.cs +++ b/Projectiles/Magic/AquaSigilWaterball.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.owner == Main.myPlayer) { - Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + (new Vector2(-26, 0).RotatedBy(Projectile.rotation - MathHelper.PiOver2)), Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 3.85f), Projectile.knockBack, Projectile.owner); + Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + (new Vector2(-26, 0).RotatedBy(Projectile.rotation - MathHelper.PiOver2)), Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 3.5f), Projectile.knockBack, Projectile.owner); explosion.ai[1] = 260f;                 explosion.localAI[1] = Main.rand.NextFloat(0.1f, 0.2f); // Interpolate                 explosion.netUpdate = true; diff --git a/Projectiles/Magic/IgnisSigil.cs b/Projectiles/Magic/IgnisSigil.cs index c3d022a7f5..e12591bd45 100644 --- a/Projectiles/Magic/IgnisSigil.cs +++ b/Projectiles/Magic/IgnisSigil.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 targetDirection = Projectile.Center.DirectionTo(Main.MouseWorld).SafeNormalize(Vector2.UnitX); spawnedProjectile = true; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 34f, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 50f, ModContent.ProjectileType(), Projectile.damage * 5, Projectile.knockBack, Projectile.owner); } if (Projectile.localAI[0] >= 50) diff --git a/Projectiles/Magic/IgnisSigilFireball.cs b/Projectiles/Magic/IgnisSigilFireball.cs index c3187cd90c..dc23785024 100644 --- a/Projectiles/Magic/IgnisSigilFireball.cs +++ b/Projectiles/Magic/IgnisSigilFireball.cs @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.owner == Main.myPlayer) { - Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + (new Vector2(-26, 0).RotatedBy(Projectile.rotation - MathHelper.PiOver2)), Vector2.Zero, ModContent.ProjectileType(), (int) (Projectile.damage * 3.35f), Projectile.knockBack, Projectile.owner); + Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + (new Vector2(-26, 0).RotatedBy(Projectile.rotation - MathHelper.PiOver2)), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); explosion.ai[1] = 145f; explosion.localAI[1] = Main.rand.NextFloat(0.1f, 0.2f); // Interpolate                 explosion.netUpdate = true; diff --git a/Projectiles/Magic/OrdoSigil.cs b/Projectiles/Magic/OrdoSigil.cs index 27717cd24b..6391564561 100644 --- a/Projectiles/Magic/OrdoSigil.cs +++ b/Projectiles/Magic/OrdoSigil.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 targetDirection = Projectile.Center.DirectionTo(Main.MouseWorld).SafeNormalize(Vector2.UnitX); spawnedProjectile = true; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 18f, ModContent.ProjectileType(), (int) (Projectile.damage * 4.5f), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 18f, ModContent.ProjectileType(), Projectile.damage * 6, Projectile.knockBack, Projectile.owner); } if (Projectile.localAI[0] >= 50) diff --git a/Projectiles/Magic/PerditoSigilShotCreator.cs b/Projectiles/Magic/PerditoSigilShotCreator.cs index e04665bd0c..e4f72837da 100644 --- a/Projectiles/Magic/PerditoSigilShotCreator.cs +++ b/Projectiles/Magic/PerditoSigilShotCreator.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public ref float FiringTimer => ref Projectile.ai[0]; public ref float ShotsFiredCount => ref Projectile.ai[1]; - private const int TotalShots = 13; - private const int DelayBetweenShots = 4; + private const int TotalShots = 18; + private const int DelayBetweenShots = 3; private const float ShotSpeed = 17f; private const float SpawnRadius = 150f; // Radius around the cursor where shots spawn @@ -61,5 +61,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.Kill(); } } + + public override bool? CanDamage() => false; } } diff --git a/Projectiles/Magic/TerraSigil.cs b/Projectiles/Magic/TerraSigil.cs index 578d0d49f9..e9838cd000 100644 --- a/Projectiles/Magic/TerraSigil.cs +++ b/Projectiles/Magic/TerraSigil.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 targetDirection = Projectile.Center.DirectionTo(Main.MouseWorld).SafeNormalize(Vector2.UnitX); spawnedProjectile = true; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 32f, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetDirection * 32f, ModContent.ProjectileType(), Projectile.damage * 3, Projectile.knockBack, Projectile.owner); } if (Projectile.localAI[0] >= 50) diff --git a/Projectiles/Magic/UnstableCastersGauntletHoldout.cs b/Projectiles/Magic/UnstableCastersGauntletHoldout.cs index 5c2a940d07..e54fd5f2bc 100644 --- a/Projectiles/Magic/UnstableCastersGauntletHoldout.cs +++ b/Projectiles/Magic/UnstableCastersGauntletHoldout.cs @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Magic // Spawn needle if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity * 35f).RotatedBy(Main.rand.NextFloat(-0.07f, 0.07f)), ModContent.ProjectileType(), (int) (Projectile.damage * 0.8f), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity * 35f).RotatedBy(Main.rand.NextFloat(-0.07f, 0.07f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); shootingTimer = 0f; } else diff --git a/Projectiles/Magic/VenusianBolt.cs b/Projectiles/Magic/VenusianBolt.cs index 7e270ed227..b8220ff855 100644 --- a/Projectiles/Magic/VenusianBolt.cs +++ b/Projectiles/Magic/VenusianBolt.cs @@ -1,4 +1,5 @@ using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -78,6 +79,11 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(BuffID.Daybreak, 300); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.ApplyScalingForcedCrit(Projectile); + } + public override void OnKill(int timeLeft) { if (explode) diff --git a/Projectiles/Magic/VenusianExplosion.cs b/Projectiles/Magic/VenusianExplosion.cs index 131d9f4eb6..a1f4663222 100644 --- a/Projectiles/Magic/VenusianExplosion.cs +++ b/Projectiles/Magic/VenusianExplosion.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Utilities; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,6 +36,7 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + modifiers.ApplyScalingForcedCrit(Projectile); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.88f); if (Projectile.damage < 1) diff --git a/Projectiles/Magic/WarpSigil.cs b/Projectiles/Magic/WarpSigil.cs index 191ff61d2e..20555dd70f 100644 --- a/Projectiles/Magic/WarpSigil.cs +++ b/Projectiles/Magic/WarpSigil.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.localAI[0] >= 25 && !spawnedProjectile) { // ai[1] and ai[2] will inherit this sigil's position and timeLeft as its own - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.whoAmI, Projectile.timeLeft); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner, 0, Projectile.whoAmI, Projectile.timeLeft); spawnedProjectile = true; } diff --git a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs index ed61618cec..89be812015 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs @@ -147,9 +147,9 @@ namespace CalamityMod.Projectiles.Melee Owner.velocity += Utils.SafeNormalize(Owner.Center - proj.Center, Vector2.Zero) * 2; } - //Reduce the projectile's damage by 160 for a second. - if (proj.Calamity().flatDR < 160) - proj.Calamity().flatDR = 160; + //Reduce the projectile's damage by 120 for a second. + if (proj.Calamity().flatDR < 120) + proj.Calamity().flatDR = 120; if (proj.Calamity().flatDRTimer < 60) proj.Calamity().flatDRTimer = 60; break; diff --git a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs index 65c40923ae..61b280bfe1 100644 --- a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs @@ -146,9 +146,9 @@ namespace CalamityMod.Projectiles.Melee Owner.velocity += Utils.SafeNormalize(Owner.Center - proj.Center, Vector2.Zero) * 2; } - //Reduce the projectile's damage by 100 for a second. - if (proj.Calamity().flatDR < 100) - proj.Calamity().flatDR = 100; + //Reduce the projectile's damage by 60 for a second. + if (proj.Calamity().flatDR < 60) + proj.Calamity().flatDR = 60; if (proj.Calamity().flatDRTimer < 60) proj.Calamity().flatDRTimer = 60; break; diff --git a/Projectiles/Melee/BrokenBiomeBlade_PureClarity.cs b/Projectiles/Melee/BrokenBiomeBlade_PureClarity.cs index 31e478ef7c..20d403c4a6 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_PureClarity.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_PureClarity.cs @@ -1,6 +1,8 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.DataStructures; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -48,6 +50,12 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + if (Owner.HeldItem.ModItem is not BrokenBiomeBlade || (Owner.HeldItem.ModItem as BrokenBiomeBlade).mainAttunement != AttunementSystem.FindOrNull(AttunementID.Default)) + { + Projectile.Kill(); + return; + } + if (CanHit || postSwing) mousePos = Owner.Center - aimPos; else diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index 5af5c7e264..d7708dd214 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Melee public override bool useAttackSpeed => false; public override SoundStyle? UseSound => SoundID.DD2_MonkStaffSwing with {Volume = 1f}; + public ref float CurrentChargeMult => ref Projectile.ai[0]; + bool hasSmashedTile = false; bool playedChargeSound = false; bool firstEnemyHit = true; @@ -52,14 +54,13 @@ namespace CalamityMod.Projectiles.Melee modplayer.swingNum = 0; Projectile.timeLeft = 600; Projectile.scale *= 1.25f; - Projectile.originalDamage = Projectile.damage; } public override void AdditionalAI() { if (inStartup) { - Projectile.damage = (int)(Projectile.originalDamage * (timer / (float)(StartupTime-1))); + CurrentChargeMult = timer / (float)(StartupTime-1); Owner.velocity.X *= 0.97f; } if (inStartup && !Owner.channel && timer > 30) @@ -98,27 +99,27 @@ namespace CalamityMod.Projectiles.Melee { Owner.velocity *= 0.15f; - Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f,Projectile.damage / (float)Projectile.originalDamage); + Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f, CurrentChargeMult); float ringRot = SwingCompletion < 0.5f ? 0 : MathHelper.PiOver2; - GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + Projectile.damage / (float)Projectile.originalDamage), 15)); - GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); - GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); - int radius = (int)(4 * Projectile.damage / (float)Projectile.originalDamage); + GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + CurrentChargeMult), 15)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + CurrentChargeMult), 30)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + CurrentChargeMult), 30)); + int radius = (int)(4 * CurrentChargeMult); Point scanAreaStart = HammerFrontPos.ToTileCoordinates() + new Point(-radius, -radius); Point scanAreaEnd = HammerFrontPos.ToTileCoordinates() + new Point(radius, radius); - Projectile.CreateImpactExplosion((int)(10 * Projectile.damage / (float)Projectile.originalDamage), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves); + Projectile.CreateImpactExplosion((int)(10 * CurrentChargeMult), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves); hasSmashedTile = true; timer = StartupTime + swingTime; angle = adjustedAngle; var pos = Projectile.Center; - Projectile.Size *= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Size *= 2 + CurrentChargeMult; Projectile.Center = HammerFrontPos; Projectile.Damage(); - Projectile.Size /= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Size /= 2 + CurrentChargeMult; Projectile.Center = pos; - if ((Projectile.damage / (float)Projectile.originalDamage) >= 1) + if (CurrentChargeMult >= 1) SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with {VariantsWeights = new ReadOnlySpan(new float[] { 1, 0, 0 })}); SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact); } @@ -137,9 +138,13 @@ namespace CalamityMod.Projectiles.Melee return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * .66f, (swingWidth * 0.33f), SwingCompletion)); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SourceDamage *= CurrentChargeMult; + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (firstEnemyHit && Main.rand.NextFloat() < (Projectile.damage / (float)Projectile.originalDamage)) + if (firstEnemyHit && Main.rand.NextFloat() < CurrentChargeMult) { string text = ""; if (target.life > 0) @@ -157,7 +162,7 @@ namespace CalamityMod.Projectiles.Melee CombatText.NewText(Projectile.Hitbox, Color.Lerp(Color.DarkGray,Color.Gold, intense ? 0.25f: 0.1f), text, intense); firstEnemyHit = false; } - if (!hasSmashedTile && (Projectile.damage / (float)Projectile.originalDamage) >= 1) + if (!hasSmashedTile && CurrentChargeMult >= 1) { for (int i = 0; i < 16; i++) { @@ -180,8 +185,9 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 }); } - target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); - Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); + + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult)); } public override bool PreDraw(ref Color lightColor) @@ -189,7 +195,7 @@ namespace CalamityMod.Projectiles.Melee if (!inCooldown) { var tex = ModContent.Request(Texture + "Glow").Value; - float outlineWidth = (int)(4 * (Projectile.damage / (float)Projectile.originalDamage)) * 0.5f; + float outlineWidth = (int)(4 * CurrentChargeMult) * 0.5f; if (inSwing) { outlineWidth *= 1 - SwingCompletion; diff --git a/Projectiles/Melee/LightspeedDashHitbox.cs b/Projectiles/Melee/LightspeedDashHitbox.cs index fd26bc727a..f7a5b243a0 100644 --- a/Projectiles/Melee/LightspeedDashHitbox.cs +++ b/Projectiles/Melee/LightspeedDashHitbox.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(energyLeak); } - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/Projectiles/Melee/MaceFlails/BallOFuguProj.cs b/Projectiles/Melee/MaceFlails/BallOFuguProj.cs index 75fda7e3a0..623ec31bbe 100644 --- a/Projectiles/Melee/MaceFlails/BallOFuguProj.cs +++ b/Projectiles/Melee/MaceFlails/BallOFuguProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails { Vector2 velocity = Projectile.DirectionFrom(Owner.MountedCenter).SafeNormalize(Vector2.Zero).RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(4.5f, 6.5f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * SpikeDamage), Projectile.knockBack * SpikeKnockback, Projectile.owner); - SpikeTimer = MaxSpikeTime + Main.rand.Next(5); + SpikeTimer = MaxSpikeTime + Main.rand.Next((int)SpikeRate - 3); } base.SpinAI(launchSpeed); } diff --git a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs index e0215e4913..a50d3fac7e 100644 --- a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs +++ b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; using CalamityMod.Particles; @@ -117,6 +118,7 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + target.AddBuff(ModContent.BuffType(), 300); for (int i = 0; i < 3; i++) { float angle = Main.rand.NextFloat(MathHelper.TwoPi); diff --git a/Projectiles/Melee/MendedBiomeBlade_TruePureClarity.cs b/Projectiles/Melee/MendedBiomeBlade_TruePureClarity.cs index 73a23e9dfd..04a227f3c3 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TruePureClarity.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TruePureClarity.cs @@ -1,9 +1,11 @@ -using CalamityMod.Items.Weapons.Melee; +using System; +using CalamityMod.DataStructures; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -60,6 +62,12 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + if (Owner.HeldItem.ModItem is not TrueBiomeBlade || (Owner.HeldItem.ModItem as TrueBiomeBlade).mainAttunement != AttunementSystem.FindOrNull(AttunementID.TrueDefault)) + { + Projectile.Kill(); + return; + } + // If the player stops using the weapon after hitting with it three times, switch to lunge. if (Owner.CantUseHoldout()) { diff --git a/Projectiles/Melee/MourningSkull.cs b/Projectiles/Melee/MourningSkull.cs index a6dd1f7b10..4e2c3c3295 100644 --- a/Projectiles/Melee/MourningSkull.cs +++ b/Projectiles/Melee/MourningSkull.cs @@ -23,7 +23,9 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 26; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 1; + Projectile.penetrate = 5; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = 600; Projectile.alpha = 255; Projectile.tileCollide = false; @@ -59,38 +61,33 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[0] >= 0f && Projectile.ai[0] < 200f) { - int npcTracker = (int)Projectile.ai[0]; - if (Main.npc[npcTracker].active) - { - Vector2 projPos = Projectile.Center; - float npcXDist = Main.npc[npcTracker].position.X - projPos.X; - float npcYDist = Main.npc[npcTracker].position.Y - projPos.Y; - float npcDistance = (float)Math.Sqrt((double)(npcXDist * npcXDist + npcYDist * npcYDist)); - npcDistance = 8f / npcDistance; - npcXDist *= npcDistance; - npcYDist *= npcDistance; - Projectile.velocity.X = (Projectile.velocity.X * 14f + npcXDist) / 15f; - Projectile.velocity.Y = (Projectile.velocity.Y * 14f + npcYDist) / 15f; - } + NPC potentialTarget = null; + if (Main.npc[(int)Projectile.ai[0]].active && Projectile.localNPCImmunity[(int)Projectile.ai[0]] == 0) + potentialTarget = Main.npc[(int)Projectile.ai[0]]; else { - float homingRange = 1000f; - foreach (NPC n in Main.ActiveNPCs) + float range = 1600f; + foreach (NPC target in Main.ActiveNPCs) { - if (n.CanBeChasedBy(Projectile, false)) + if (target.CanBeChasedBy(Projectile) && Projectile.localNPCImmunity[target.whoAmI] == 0) { - float targetX = n.position.X + (float)(n.width / 2); - float targetY = n.position.Y + (float)(n.height / 2); - float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - targetX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - targetY); - if (targetDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) + float distance = Vector2.Distance(target.Center, Projectile.Center); + if (distance < range) { - homingRange = targetDist; - Projectile.ai[0] = (float)n.whoAmI; + range = distance; + potentialTarget = target; } } } } + if (potentialTarget != null) + { + Projectile.alpha = 0; + Vector2 idealVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 18f; + Projectile.velocity = (Projectile.velocity * 14f + idealVelocity) / 15f; + } + if (Projectile.velocity.X < 0f) { Projectile.spriteDirection = -1; @@ -154,7 +151,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Daybreak, 300); - if (Projectile.owner == Main.myPlayer) + if (Projectile.owner == Main.myPlayer && Projectile.numHits == 0) { for (int k = 0; k < 2; k++) { diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index aca73d5124..354b132918 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -28,14 +28,14 @@ namespace CalamityMod.Projectiles.Melee Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.timeLeft = 40; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.timeLeft = 30; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; } public override void AI() { - Projectile.velocity *= 0.97f; + Projectile.velocity *= 0.93f; Projectile.rotation += MathHelper.PiOver4 / 2.4f * Math.Sign(Projectile.velocity.X); int dustCount = Main.rand.Next(4); @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Melee Dust dust = Dust.NewDustPerfect(offset + dustDirection, DustID.DungeonWater, Vector2.Zero, 100, default, 1.4f); dust.noGravity = true; dust.noLight = true; - dust.velocity = dustDirection; + dust.velocity = dustDirection * 0.5f; } } } diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs index 77226c9bd1..4cb93bac62 100644 --- a/Projectiles/Melee/StellarContemptHammer.cs +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -269,7 +269,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.netUpdate = true; int numFlares = EmpoweredHammer + 1; - int flareDamage = (int)(0.1f * Projectile.damage); + int flareDamage = (int)(0.05f * Projectile.damage); float flareKB = 4f; for (int i = 0; i < numFlares; ++i) { diff --git a/Projectiles/Melee/TriactisHammerExplosion.cs b/Projectiles/Melee/TriactisHammerExplosion.cs index 5741b0bd64..d40436a217 100644 --- a/Projectiles/Melee/TriactisHammerExplosion.cs +++ b/Projectiles/Melee/TriactisHammerExplosion.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -84,6 +85,7 @@ namespace CalamityMod.Projectiles.Melee public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + modifiers.ApplyScalingForcedCrit(Projectile); modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); modifiers.SourceDamage *= Utils.Remap(Projectile.numHits, 0, 10, 1f, 0.1f, true); } diff --git a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs index 0f208bdc5b..32fbc7def3 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs @@ -128,9 +128,9 @@ namespace CalamityMod.Projectiles.Melee { GeneralParryEffects(); - //Reduce the projectile's damage by 80 for a second. - if (proj.Calamity().flatDR < 80) - proj.Calamity().flatDR = 80; + //Reduce the projectile's damage by 30 for a second. + if (proj.Calamity().flatDR < 30) + proj.Calamity().flatDR = 30; if (proj.Calamity().flatDRTimer < 60) proj.Calamity().flatDRTimer = 60; diff --git a/Projectiles/Melee/UHFMurasama.png b/Projectiles/Melee/UHFMurasama.png deleted file mode 100644 index 26800e8920..0000000000 Binary files a/Projectiles/Melee/UHFMurasama.png and /dev/null differ diff --git a/Projectiles/Melee/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs index 36866784f2..d17af1ef6e 100644 --- a/Projectiles/Melee/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -28,7 +28,9 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.alpha = 255; - Projectile.penetrate = 1; + Projectile.penetrate = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = 90; Projectile.noEnchantments = true; } @@ -39,7 +41,21 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.alpha = (int)Utils.Remap(Time, 0f, 12f, 255f, 0f); - NPC potentialTarget = Projectile.Center.ClosestNPCAt(256f); + NPC potentialTarget = null; + float range = 256f; + foreach (NPC target in Main.ActiveNPCs) + { + if (target.CanBeChasedBy(Projectile) && Projectile.localNPCImmunity[target.whoAmI] == 0) + { + float distance = Vector2.Distance(target.Center, Projectile.Center); + if (distance < range) + { + range = distance; + potentialTarget = target; + } + } + } + if (potentialTarget != null && Time >= 12f) { Vector2 idealVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 12f; diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 3c7a6de762..8dc9e0ec37 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; @@ -20,12 +21,15 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public class ObliteratorYoyo : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - private static int DashStartup => 60; - private static int DashCooldown => 15; + private static int DashStartup => 90; + private static int DashCooldown => 30; public SlotId GFB; public int GFBCounter = 0; public int time = 0; + public int DashQueue = 0; + int dashTimer = 0; + int timerToStartDash = 0; public override void SetStaticDefaults() { ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; @@ -48,20 +52,30 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.localNPCHitCooldown = 7 * Projectile.MaxUpdates; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(DashQueue); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + DashQueue = reader.ReadInt32(); + } + public override bool PreAI() { if (Projectile.FinalExtraUpdate()) { - if (Projectile.localAI[1] != DashStartup) - Projectile.localAI[1]++; - if (Projectile.localAI[1] > DashStartup + DashCooldown) - Projectile.localAI[1] = 0; + timerToStartDash++; + if (timerToStartDash % DashStartup == DashStartup - 1) + DashQueue++; } - if (Projectile.localAI[1] <= DashStartup) + if (dashTimer <= 0) return true; Projectile.aiStyle = -1; Projectile.timeLeft++; + dashTimer--; return true; } @@ -94,8 +108,10 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (Projectile.FinalExtraUpdate()) { - if (Projectile.localAI[1] == DashStartup) + if (DashQueue > 0 && dashTimer <= 0) { + DashQueue--; + List targets = new List(); float laserRange = 600f; foreach (NPC n in Main.ActiveNPCs) @@ -139,7 +155,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos SparkParticle spark = new SparkParticle(Projectile.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); GeneralParticleHandler.SpawnParticle(spark); } - Projectile.localAI[1]++; + dashTimer = DashCooldown; Projectile.ResetLocalNPCHitImmunity(); } } @@ -158,7 +174,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Vector2 origin = new Vector2(10f, 10f); Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Melee/Yoyos/ObliteratorYoyoGlow").Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, 2f, SpriteEffects.None, 0); - if (Projectile.localAI[1] <= DashStartup) + if (dashTimer <= 0) return; var tex = ModContent.Request("CalamityMod/Particles/Jaws").Value; Main.spriteBatch.SetBlendState(BlendState.Additive); @@ -176,7 +192,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.localAI[1] > DashStartup) + if (dashTimer > 0) { modifiers.SourceDamage *= 6; } @@ -186,7 +202,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (Projectile.localAI[1] > DashStartup) { - Projectile.localAI[1] = 0; + dashTimer = 0; target.AddBuff(ModContent.BuffType(), 180); for (int i = 0; i < 10; i++) { diff --git a/Projectiles/Melee/Yoyos/PandemicYoyo.cs b/Projectiles/Melee/Yoyos/PandemicYoyo.cs index 7c0eba0a05..dc542b50b9 100644 --- a/Projectiles/Melee/Yoyos/PandemicYoyo.cs +++ b/Projectiles/Melee/Yoyos/PandemicYoyo.cs @@ -1,5 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -12,12 +14,13 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public class PandemicYoyo : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public const int MaxUpdates = 2; + + List hitNPCs = []; public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = Pandemic.Lifetime * 2f; ProjectileID.Sets.YoyosMaximumRange[Type] = Pandemic.Reach; - ProjectileID.Sets.YoyosTopSpeed[Type] = Pandemic.Speed / MaxUpdates; + ProjectileID.Sets.YoyosTopSpeed[Type] = Pandemic.Speed / 2f; } public override void SetDefaults() @@ -27,21 +30,36 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.friendly = true; Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.penetrate = -1; - Projectile.MaxUpdates = MaxUpdates; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10 * MaxUpdates; + Projectile.localNPCHitCooldown = 20; + Projectile.MaxUpdates = 2; } public override void AI() { - CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 180f, 5, ModContent.ProjectileType(), 0.75); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); + Projectile.scale = Pandemic.SizeMultiplier(hitNPCs.Count); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SourceDamage *= Pandemic.DamageMultiplier(hitNPCs.Count); + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 240); + if (target.HasBuff(ModContent.BuffType())) + { + target.AddBuff(ModContent.BuffType(), 300); //Pandemic hits refresh Plague to 5 seconds + if (!hitNPCs.Contains(target)) + { + hitNPCs.Add(target); + Projectile.localAI[0] = 0; + + DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, Vector2.One, 0, 0f, 0.5f, 30); + GeneralParticleHandler.SpawnParticle(pulse); + } + } } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Pets/Beldum.cs b/Projectiles/Pets/Beldum.cs new file mode 100644 index 0000000000..14de75451f --- /dev/null +++ b/Projectiles/Pets/Beldum.cs @@ -0,0 +1,173 @@ +using System; +using CalamityMod.Buffs.Pets; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Pets +{ + public class Beldum : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Pets"; + public override void SetStaticDefaults() + { + Main.projPet[Type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) + .WithOffset(-8f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0); + } + + public override void SetDefaults() + { + Projectile.netImportant = true; + Projectile.width = 32; + Projectile.height = 32; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.timeLeft *= 5; + Projectile.tileCollide = false; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + Vector2 beldumcenter = Projectile.Center; + Vector2 vectorbeldum = player.Center - beldumcenter; + float playerdistance = vectorbeldum.Length(); + if (!player.active) + { + Projectile.active = false; + return; + } + + //Delete the projectile if the player doesnt have the buff or is very far away (dunno if this needs to be deleted) + if (!player.HasBuff(ModContent.BuffType()) || playerdistance >= 4000f) + { + Projectile.Kill(); + } + + CalamityPlayer modPlayer = player.Calamity(); + if (player.dead) + { + modPlayer.beldum = false; + } + if (modPlayer.beldum) + { + Projectile.timeLeft = 2; + } + + if (player.InInteractionRange((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16, TileReachCheckSettings.Simple)) + { + if (Projectile.Hitbox.Contains(player.ClampedMouseWorld().ToPoint())) + { + if (player.controlUseItem && player.velocity == Vector2.Zero) + { + Projectile.ai[1] = Projectile.ai[1] == 1 ? 0 : 1; + } + else if (player.controlUseTile) + { + Projectile.ai[1] = Projectile.ai[1] == 2 ? 0 : 2; + } + } + } + + // Normal behaviour + if (Projectile.ai[1] == 0) + { + Projectile.FloatingPetAI(false, 0); + } + // Being pet + else if (Projectile.ai[1] == 1) + { + if (player.velocity != Vector2.Zero || player.HasIFrames()) + { + Projectile.ai[1] = 0; + } + else + { + Projectile.Center = player.Center + new Vector2(40 * player.direction, 0); + Projectile.velocity = Vector2.Zero; + PlayerPetting(); + } + } + // Shoulder + else + { + Projectile.Center = player.Center + new Vector2(0, -20 * player.gravDir) + Vector2.UnitY * player.gfxOffY; + } + + if (Projectile.ai[1] != 2) + { + Projectile.ai[0]++; + if (Projectile.ai[1] == 0) + { + Projectile.spriteDirection = -Projectile.velocity.X.DirectionalSign(); + Projectile.rotation = MathF.Sin(Projectile.ai[0] * 0.05f) * MathHelper.ToRadians(20); + } + else + { + Projectile.spriteDirection = -Projectile.DirectionTo(player.Center).X.DirectionalSign(); + Projectile.rotation = MathF.Sin(Projectile.ai[0] * 0.05f) * MathHelper.ToRadians(5); + } + } + else + { + Projectile.ai[0] = 0; + Projectile.rotation = 0; + Projectile.spriteDirection = -player.direction; + } + + if (Main.rand.NextBool(600) && Projectile.ai[2] == 0) + { + Projectile.ai[2] = 1; + } + + if (Projectile.ai[2] == 1) + { + Projectile.frameCounter++; + if (Projectile.frameCounter > 3) + { + Projectile.frameCounter = 0; + Projectile.frame++; + } + + if (Projectile.frame > 3) + { + Projectile.frame = 0; + Projectile.ai[2] = 0; + } + } + } + + public void PlayerPetting() + { + Player player = Main.player[Projectile.owner]; + int targetDirection = (Projectile.Center.X > player.Center.X) ? 1 : (-1); + player.StopVanityActions(); + player.ChangeDir(targetDirection); + player.gravDir = 1f; + int completion = player.miscCounter % 14 / 7; + Player.CompositeArmStretchAmount stretch = Player.CompositeArmStretchAmount.ThreeQuarters; + if (completion == 1) + { + stretch = Player.CompositeArmStretchAmount.Full; + } + player.SetCompositeArmBack(enabled: true, stretch, player.DirectionTo(Projectile.Center).ToRotation() - MathHelper.PiOver2); + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + SpriteEffects fx = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + if (Main.player[Projectile.owner].gravDir == -1) + fx |= SpriteEffects.FlipVertically; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + Vector2.UnitY * MathF.Cos(Projectile.ai[0] * 0.05f) * (Projectile.ai[1] == 0 ? 10 : 2), tex.Frame(1, 4, 0, Projectile.frame), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(tex.Width / 2, tex.Height / Main.projFrames[Type] / 2), Projectile.scale, fx); + return false; + } + } +} diff --git a/Projectiles/Pets/Beldum.png b/Projectiles/Pets/Beldum.png new file mode 100644 index 0000000000..ff86674959 Binary files /dev/null and b/Projectiles/Pets/Beldum.png differ diff --git a/Projectiles/Ranged/AbyssalFire.cs b/Projectiles/Ranged/AbyssalFire.cs new file mode 100644 index 0000000000..039a95a092 --- /dev/null +++ b/Projectiles/Ranged/AbyssalFire.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Effects; +using CalamityMod.Enums; +using CalamityMod.Graphics.Metaballs; +using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs; +using CalamityMod.Packets.Entities; +using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.WorldBuilding; + +namespace CalamityMod.Projectiles.Ranged +{ + [PierceResistException] + public class AbyssalFire : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + + public Vector2[] ControlPoints; + + public static int MaxLaserControlPoints => 32; + + public static int MaxLaserLength => 3330; + + public static int MaxLaserWidth => 90; + + public Player Owner => Main.player[Projectile.owner]; + + public Projectile VoidragonHoldout => Main.projectile[(int)Projectile.ai[0]]; + + public ref float LaserLength => ref Projectile.ai[1]; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + + public override void SetDefaults() + { + Projectile.width = Projectile.height = MaxLaserWidth; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 2; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + LaserLength = 0.05f; + } + + public override void AI() + { + // If the owner is no longer able to cast the beam, kill it. + if (Owner.CantUseHoldout() || VoidragonHoldout is null) + { + Projectile.Kill(); + return; + } + + // Decide where to position the laserbeam. + Vector2 circlePointDirection = Projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); + Projectile.Center = VoidragonHoldout.ModProjectile().GunTipPosition - ((Projectile.velocity * 12f).RotatedBy(-0.02f * Projectile.direction)); + + int beamTimer = VoidragonHoldout.ModProjectile().beamTimer; + float beamWidthInterpolant = Utils.GetLerpValue(0, 25, beamTimer, true); + + // Set the control points for the primitive drawing. + ControlPoints ??= new Vector2[MaxLaserControlPoints]; + for (int i = 0; i < MaxLaserControlPoints; i++) + ControlPoints[i] = Projectile.Center + Projectile.velocity * i / (ControlPoints.Length - 1f) * MaxLaserLength; + + // Grow and shrink depending on how long left the laser has to remain active. + Projectile.scale = MathHelper.Lerp(0f, 1f, CalamityUtils.ExpOutEasing(beamWidthInterpolant, 2)); + LaserLength = MathHelper.Lerp(LaserLength, 1f, 0.032f); + + // Update aim. + UpdateAim(); + + // Spawn a bunch of particles along the length of the laser. + if (Projectile.scale >= 0.25f) + { + BezierCurve curve = new(ControlPoints); + float tipRatio = 0.042f; + for (int i = 0; i < 10; i++) + { + Vector2 tipSpawnPosition = curve.Evaluate(Main.rand.NextFloat(0f, tipRatio)); + Vector2 bodySpawnPosition = curve.Evaluate(Main.rand.NextFloat(tipRatio, 1f)); + Vector2 fireVelocity = Owner.SafeDirectionTo(Main.MouseWorld).RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(25f, 30f); + + Color fireColorBackground = Color.Lerp(Color.DarkViolet, Color.Black, 0.25f); + + int fireLifetime = Main.rand.Next(45, 60); + float fireScale = Main.rand.NextFloat(1.75f, 2.25f) * Projectile.scale; + float fireOpacity = Main.rand.NextFloat(0.65f, 0.95f); + + HeavySmokeParticle abyssalFlamesBodyBackground = new(bodySpawnPosition, fireVelocity, fireColorBackground, fireLifetime, fireScale, 1f, Main.rand.NextFloat(0.02f, 0.1f) * Main.rand.NextBool().ToDirectionInt(), false); + GeneralParticleHandler.SpawnParticle(abyssalFlamesBodyBackground, true, GeneralDrawLayer.BeforeProjectiles); + + HeavySmokeParticle abyssalFlamesBodyForeground = new(bodySpawnPosition, fireVelocity, Main.rand.NextBool(4) ? Color.White : Color.Purple, fireLifetime, fireScale * 0.6f, 0.8f, Main.rand.NextFloat(0.02f, 0.1f) * Main.rand.NextBool().ToDirectionInt(), true); + GeneralParticleHandler.SpawnParticle(abyssalFlamesBodyForeground, true, GeneralDrawLayer.AfterProjectiles); + + HeavySmokeParticle abyssFlamesTip = new(tipSpawnPosition, fireVelocity, Color.White, fireLifetime, fireScale * 0.52f, 0.3f, Main.rand.NextFloat(0.02f, 0.1f) * Main.rand.NextBool().ToDirectionInt(), true); + GeneralParticleHandler.SpawnParticle(abyssFlamesTip, true, GeneralDrawLayer.AfterProjectiles); + } + + for (int i = 0; i < 3; i++) + { + Vector2 fireVelocity = Owner.SafeDirectionTo(Main.MouseWorld).RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(15f, 20f); + HeavySmokeParticle whiteFlames = new(Projectile.Center - Projectile.velocity * 8f, fireVelocity, Color.White, Main.rand.Next(15, 20), 0.64f, 0.7f, Main.rand.NextFloat(0.02f, 0.1f) * Main.rand.NextBool().ToDirectionInt(), true); + GeneralParticleHandler.SpawnParticle(whiteFlames, true, GeneralDrawLayer.AfterDusts); + } + } + + // Shake the screen slightly. + if (Owner.Calamity().GeneralScreenShakePower < 1.15f) + Owner.Calamity().GeneralScreenShakePower = MathHelper.Lerp(0f, 1.15f, Projectile.scale / 2f); + + // Make the beam cast light along its length. The brightness of the light is reliant on the scale of the beam. + DelegateMethods.v3_1 = Color.DarkViolet.ToVector3() * Projectile.scale * 0.4f; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * MaxLaserLength, Projectile.width * Projectile.scale, DelegateMethods.CastLight); + } + + public void UpdateAim() + { + // Only execute the aiming code for the owner. + if (Main.myPlayer != Projectile.owner) + return; + + Vector2 newAimDirection = VoidragonHoldout.velocity.SafeNormalize(Vector2.UnitY); + + // Sync if the direction is different from the old one. + // Spam caps are ignored due to the frequency of this happening. + if (newAimDirection != Projectile.velocity) + { + Projectile.netUpdate = true; + Projectile.netSpam = 0; + } + + Projectile.velocity = newAimDirection; + } + private float PrimitiveWidthFunction(float completionRatio, Vector2 vertexPos) + { + float width; + float maxBodyWidth = Projectile.scale * MaxLaserWidth * (1 + MathF.Pow(Utils.GetLerpValue(450, 500, VoidragonHoldout.ModProjectile().beamTimer, true), 3.5f) * 4); + float shrinkRatio = 0.018f; + + //if (completionRatio < shrinkRatio) + // width = MathF.Sin(completionRatio / shrinkRatio * MathHelper.PiOver2) * maxBodyWidth + shrinkRatio; + //else + // width = Utils.Remap(completionRatio, shrinkRatio, 1f, maxBodyWidth, 0f); + + return maxBodyWidth * Utils.GetLerpValue(0f, 0.05f, completionRatio, true) * Utils.GetLerpValue(LaserLength, LaserLength - 0.1f, completionRatio, true); + } + + private Color PrimitiveColorFunction(float completionRatio, Vector2 vertexPos) + { + + return Color.White * Projectile.Opacity; + } + + public override bool PreDraw(ref Color lightColor) + { + Asset mainStreakTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); + int beamTimer = VoidragonHoldout.ModProjectile().beamTimer; + float beamWidthInterpolant = Utils.GetLerpValue(500, 460, beamTimer, true); + + if (ControlPoints is null) + return false; + + Main.spriteBatch.End(out var snapshot); + + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + + using (lease.Scope(clearColor: Color.Transparent)) + { + MiscShaderData shader = GameShaders.Misc["CalamityMod:AbyssalFire"]; + shader.Shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Shader.Parameters["glowPower"].SetValue(0.8f); + shader.Shader.Parameters["overallColorStrength"].SetValue(1f - beamWidthInterpolant); + shader.Shader.Parameters["edgeFadeoutThreshold"].SetValue(0.46f); + shader.Shader.Parameters["noiseScale"].SetValue(new Vector2(4f, 0.5f)); + shader.Shader.Parameters["innerColor"].SetValue(Color.DarkViolet.ToVector3()); + shader.Shader.Parameters["outerColor"].SetValue(Color.Black.ToVector3()); + shader.Shader.Parameters["overallColor"].SetValue(Color.White.ToVector3()); + shader.Shader.Parameters["tipColor"].SetValue(Color.White.ToVector3()); + + device.Textures[1] = mainStreakTexture.Value; + + PrimitiveRenderer.RenderTrail(ControlPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, shader: shader, useUnscaledMatrices: true, capStyle: PrimitiveCapStyle.Flat), ControlPoints.Length); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(snapshot); + + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + Projectile.velocity * MaxLaserLength); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Player Owner = Main.player[Projectile.owner]; + target.AddBuff(ModContent.BuffType(), 180); + int bonusDamage = 200 * Owner.Calamity().sharkGunDamageScaling; + if (target.Calamity().demonicFlamesBonusDamage <= bonusDamage) + { + target.Calamity().demonicFlamesBonusDamage = bonusDamage; + target.AddBuff(ModContent.BuffType(), 180); + // Demonic Flames damage must be synced, because OnHitNPC is only run for the client that hit the NPC + if (Main.netMode != NetmodeID.SinglePlayer) + DemonicFlamesSyncPacket.Send(target); + } + } + + public override bool ShouldUpdatePosition() => false; + } +} diff --git a/Projectiles/Ranged/ArcherfishHoldout.cs b/Projectiles/Ranged/ArcherfishHoldout.cs new file mode 100644 index 0000000000..d239529cfa --- /dev/null +++ b/Projectiles/Ranged/ArcherfishHoldout.cs @@ -0,0 +1,149 @@ +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Projectiles.Melee; + +namespace CalamityMod.Projectiles.Ranged +{ + public class ArcherfishHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 24f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -1f; + public override float OffsetYDownwards => 5f; + + public int Time = 0; + public int shotCounter = 0; + public int framesBetweenShots = 0; + public bool PostVolley = false; + + public override void KillHoldoutLogic() + { + //If the player is dead, kill the holdout. + if (Owner.CantUseHoldout() || !PostVolley && HeldItem.type != Owner.HeldItem.type) + Projectile.Kill(); + } + + public override void HoldoutAI() + { + //Set the scaling to 0 as soon as the holdout spawns + if (Time == 1) + { + Owner.Calamity().sharkGunDamageScaling = 0; + } + if (Time >= 10) + { + if (framesBetweenShots == 0 && shotCounter <= 25) + { + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 15; + #region Debug Text Display + //Main.NewText(shotCounter); + //Main.NewText(Owner.Calamity().sharkGunDamageScaling); + #endregion + #region Visuals and Sounds + SoundEngine.PlaySound(SoundID.Item85, Projectile.Center); + #endregion + + //How many frames between firing projectiles, and how far the gun moves backward to give the effect of recoil. Change this number to edit fire rate + framesBetweenShots = 6; + OffsetLengthFromArm -= 3f; + //Here we detect which ammo the bullets will use + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _, !Main.rand.NextBool(4)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + shotCounter++; + //Frame time is much longer due to Archerfish working differently, and handling both the shot and the "reload" on the same step + if (shotCounter == 25) + framesBetweenShots = 100; + } + if (framesBetweenShots > 0) + framesBetweenShots--; + } + if (shotCounter == 25 && framesBetweenShots > 0) + { + //Holdout cannot be killed during the final shot and cooldown + PostVolley = true; + Owner.channel = true; + //If the player hasn't hit any shots, increase the multiplier from 0 to 1 to avoid the final shot doing 0 damage + if (Owner.Calamity().sharkGunDamageScaling == 0) + { + Owner.Calamity().sharkGunDamageScaling++; + } + //Pauses before triggering the final water blast. This allows extra water streams time to hit. Increasing this number reduces the delay, but may also cause the gun to become inconsistent + if (framesBetweenShots == 80) + { + SoundEngine.PlaySound((Main.rand.NextBool(2) ? SoundID.Item85 : SoundID.Item86).WithPitchOffset(-0.5f), Owner.Center); + SoundEngine.PlaySound(SoundID.NPCDeath14.WithPitchOffset(1f), Owner.Center); + //Fires the water jet. Damage is 20% of base, multiplied by how many shots hit. + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 30, ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f) * Owner.Calamity().sharkGunDamageScaling, Projectile.knockBack, Projectile.owner); + } + #region Post Firing Visuals and Sounds + //After the water blast is fired, make the fish "sweat" during the reload + //I don't think this is how science works + if (framesBetweenShots % 6 == 0 && framesBetweenShots <= 80) + { + for (int i = 0; i < 2; ++i) + { + int bloodLifetime = Main.rand.Next(12, 15); + float bloodScale = Main.rand.NextFloat(0.4f, 0.6f); + Color bloodColor = Color.Lerp(Color.LightBlue * 0.7f, Color.LightBlue, Main.rand.NextFloat()); + bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); + + if (Main.rand.NextBool(20)) + bloodScale *= 1.5f; + + float randomSpeedMultiplier = Main.rand.NextFloat(0.8f, 1.5f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier; + bloodVelocity.Y -= 3f; + BloodParticle blood = new BloodParticle(Projectile.Center + (Projectile.velocity * 14f).RotatedBy(-0.8f * Projectile.direction), bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } + //Takes a heavy breath every 25 frames after the final shot is fired + if (framesBetweenShots % 25 == 0 && framesBetweenShots <= 75) + { + for (int i = 0; i < 4; i++) + { + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 4; + Particle smoke = new HeavySmokeParticle(GunTipPosition, shootVelocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.2f, 1.5f), Color.White, Main.rand.Next(20, 40 + 1), Main.rand.NextFloat(0.2f, 0.3f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + SoundEngine.PlaySound(SoundID.Item111 with { Pitch = 0.05f, PitchVariance = 0.25f, MaxInstances = -1 }, Projectile.Center); + OffsetLengthFromArm -= 4.5f; + } + #endregion + + } + if (shotCounter == 25 && framesBetweenShots == 0) + { + if (framesBetweenShots == 0) + { + SoundEngine.PlaySound(SoundID.NPCDeath19, Projectile.Center); + //After firing the water blast, kill the projectile to allow left click to be held down + Projectile.Kill(); + } + } + Time++; + } + public override bool PreDraw(ref Color lightColor) + { + if (Time < 2) + return false; + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + return false; + } + } +} diff --git a/Projectiles/Ranged/BlahajBlast.cs b/Projectiles/Ranged/BlahajBlast.cs new file mode 100644 index 0000000000..95aa8fe572 --- /dev/null +++ b/Projectiles/Ranged/BlahajBlast.cs @@ -0,0 +1,143 @@ +using System.Composition.Hosting.Core; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class BlahajBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public static int Lifetime = 600; + + public override void SetDefaults() + { + Projectile.width = 8; + Projectile.height = 8; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + Projectile.penetrate = 4; + Projectile.alpha = 255; + Projectile.timeLeft = Lifetime; + Projectile.MaxUpdates = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.tileCollide = false; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + if (Main.rand.NextBool(3)) + { + Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); + bubble.timeLeft = 9 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 1f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } + if (Projectile.timeLeft <= Lifetime - 4) + { + if (Projectile.ai[0] == 0) + { + Particle transspark = new SparkParticle(Projectile.Center - Projectile.velocity * 2, -Projectile.velocity * 0.05f, false, 10, 1.1f, Main.rand.NextBool() ? (Main.rand.NextBool() ? Color.DeepSkyBlue : Color.White) : Color.DeepPink); + GeneralParticleHandler.SpawnParticle(transspark); + } + else + { + Particle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 2, -Projectile.velocity * 0.05f, false, 10, 1.1f, Color.Aquamarine); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(8)) + { + MediumMistParticle smoke = new MediumMistParticle(Projectile.Center + Main.rand.NextVector2Circular(25, 25), -Projectile.velocity * 0.05f, Main.rand.NextBool(3) ? Color.SeaGreen : Color.SkyBlue, Color.DarkBlue, 0.5f, 180, 3f); + GeneralParticleHandler.SpawnParticle(smoke); + } + } + if (Projectile.timeLeft <= Lifetime - 8) + { + if (Main.rand.NextBool(2)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(15, 15), ModContent.DustType(), -Projectile.velocity); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.9f, 1.1f); + dust.color = Main.rand.NextBool() ? Color.DarkBlue : Color.DarkBlue * 0.5f; + + Particle trail = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(10, 10), -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, 30, Main.rand.NextFloat(0.4f, 0.6f), Color.RoyalBlue); + GeneralParticleHandler.SpawnParticle(trail); + } + } + } + + public override void OnKill(int timeLeft) + { + // Bubbles + for (int i = 0; i < 10; i++) + { + Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(60f)) * 0.3f, 411); + bubble.timeLeft = 9 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 1f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 60); + //Only spawn rocket on the first hit + if (Projectile.numHits == 0 && Main.myPlayer == Projectile.owner) + { + Player Owner = Main.player[Projectile.owner]; + Projectile fishy = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(150, 150), Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner); + fishy.ai[2] = ((Owner.Calamity().sharkGunDamageScaling + 1) * 0.02f) + 0.1f; + } + OnHitEffects(); + } + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + { + target.AddBuff(ModContent.BuffType(), 60); + //Only spawn rocket on the first hit + if (Projectile.numHits == 0 && Main.myPlayer == Projectile.owner) + { + Player Owner = Main.player[Projectile.owner]; + Projectile fishy = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(150, 150), Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner); + fishy.ai[2] = ((Owner.Calamity().sharkGunDamageScaling + 1) * 0.02f) + 0.1f; + } + OnHitEffects(); + } + } + + private void OnHitEffects() + { + for (int i = 0; i < 4; ++i) + { + int bloodLifetime = Main.rand.Next(22, 25); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.RoyalBlue * 0.7f, Color.DarkBlue, Main.rand.NextFloat()); + bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); + + if (Main.rand.NextBool(20)) + bloodScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + for (int i = 0; i <= 2; i++) + { + LineParticle spark = new LineParticle(Projectile.Center, -Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.18f, 0.44f)) * Main.rand.NextFloat(0.4f, 1.5f), false, 8, 0.9f, Main.rand.NextBool() ? Color.CornflowerBlue : Color.RoyalBlue); + GeneralParticleHandler.SpawnParticle(spark); + LineParticle spark2 = new LineParticle(Projectile.Center, -Projectile.velocity.RotatedBy(Main.rand.NextFloat(-0.18f, -0.44f)) * Main.rand.NextFloat(0.4f, 1.5f), false, 8, 0.9f, Main.rand.NextBool() ? Color.CornflowerBlue : Color.RoyalBlue); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + } +} diff --git a/Projectiles/Ranged/MegalodonHoldout.cs b/Projectiles/Ranged/MegalodonHoldout.cs new file mode 100644 index 0000000000..f6034ee9d6 --- /dev/null +++ b/Projectiles/Ranged/MegalodonHoldout.cs @@ -0,0 +1,172 @@ +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Projectiles.Ranged +{ + public class MegalodonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 24f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -1f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + (Projectile.velocity * 50).RotatedBy(0.13f * Projectile.direction); + + public int Time = 0; + public int shotCounter = 0; + public int framesBetweenShots = 0; + public bool swapType = false; + + public override void KillHoldoutLogic() + { + //If the player is dead, kill the holdout. + if (Owner.CantUseHoldout() || HeldItem.type != AssociatedItemID) + Projectile.Kill(); + } + + public override void HoldoutAI() + { + //Pause to give the effect of reloading + if (Time == 30) + { + Player Owner = Main.player[Projectile.owner]; + SoundEngine.PlaySound(SoundID.Item149, Projectile.Center); + if (Main.netMode != NetmodeID.Server) + { + string goreType = "MegalodonMag"; + Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center + (-Projectile.velocity * 18), Projectile.velocity.RotatedBy(2f * -Owner.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); + } + //Set the scaling to 0 whenever it reloads + Owner.Calamity().sharkGunDamageScaling = 0; + } + if (Time >= 90) + { + if (framesBetweenShots == 0 && shotCounter <= 31) + { + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 19; + #region Debug Text Display + //Main.NewText(shotCounter); + //Main.NewText(Owner.Calamity().sharkGunDamageScaling); + #endregion + #region Visuals and Sounds + SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotTiny"); + SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = 0.4f, PitchVariance = 0.1f, MaxInstances = -1 }, Projectile.Center); + Particle sparker = new CritSpark(GunTipPosition, Vector2.Zero, Color.Gold, Color.LightGoldenrodYellow, 1.7f, 3, 0.5f, 3f); + GeneralParticleHandler.SpawnParticle(sparker); + for (int i = 0; i <= 4; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(3) ? 303 : 244, (shootVelocity * Main.rand.NextFloat(0.2f, 1.1f)).RotatedByRandom(0.4f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 1.4f); + } + #endregion + + //How many frames between firing projectiles, and how far the gun moves backward to give the effect of recoil. Change this number to edit fire rate + framesBetweenShots = 4; + OffsetLengthFromArm -= 3f; + //Here we detect which ammo the bullets will use + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _); + //Alternate between shooting bullets and water streams. We seperate it into two different projectiles due to the bullets needing to use a Global Projectile to track the damage multiplier + if (Main.myPlayer == Projectile.owner) + { + if (!swapType) + { + Projectile scalingShot = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); + CalamityGlobalProjectile cgp = scalingShot.Calamity(); + cgp.sharkBullets = true; + //Only eject casings from the gun if bullets are fired, preventing too many at once + if (Main.netMode != NetmodeID.Server) + { + string goreType = "MegalodonCasing"; + Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center + (-Projectile.velocity * 18), -Projectile.velocity * 4f, Mod.Find(goreType).Type); + } + } + if (swapType) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + swapType = !swapType; + } + shotCounter++; + //Allow a pause before firing the rocket. This allows the final bullet a chance to hit before the rocket is fired. Lowering this number reduces the delay, but may also cause the gun to become inconsistent + if (shotCounter == 30) + framesBetweenShots = 18; + } + if (framesBetweenShots > 0) + framesBetweenShots--; + } + if (shotCounter == 30 && framesBetweenShots == 0) + { + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 30; + //Debug Text + //Main.NewText(Owner.Calamity().sharkGunDamageScaling); + #region Visuals and Sounds + SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotHeavy"); + SoundEngine.PlaySound(fire with { Volume = 0.6f, Pitch = 0.2f }, Projectile.Center); + for (int i = 0; i <= 13; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition, 303, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.2f, 1.1f), 80, default, Main.rand.NextFloat(0.4f, 1.3f)); + dust.noGravity = false; + dust.color = Color.White; + + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, 278, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.8f)); + dust2.noGravity = true; + dust2.scale = Main.rand.NextFloat(0.52f, 0.72f); + dust2.color = Color.Lerp(Color.Orange, Color.Gold, Main.rand.NextFloat(0f, 1f)); + } + for (int i = 0; i < 14; i++) + { + Particle smoke = new HeavySmokeParticle(GunTipPosition, shootVelocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.2f, 1.5f), Color.RoyalBlue, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.3f, 0.6f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + float rotation = Projectile.velocity.ToRotation(); + Particle pulse = new DirectionalPulseRing(GunTipPosition, shootVelocity / 4, Color.Gray, new Vector2(1f, 2.5f), rotation, 0.03f, 0.3f, 20); + GeneralParticleHandler.SpawnParticle(pulse); + //Extra sound and muzzle flash if the scaling is at max + if (Owner.Calamity().sharkGunDamageScaling == 30) + { + SoundStyle fireperfect = new("CalamityMod/Sounds/Item/ShadowboltReflect"); + SoundEngine.PlaySound(fireperfect with { Volume = 0.6f, Pitch = 0f }, GunTipPosition); + GenericSparkle sparker = new GenericSparkle(GunTipPosition, Vector2.Zero, Color.DarkGoldenrod, Color.Gold, Main.rand.NextFloat(1.1f, 1.8f), 10, 2f, 2.68f); + GeneralParticleHandler.SpawnParticle(sparker); + } + #endregion + + //If the player hasn't hit any shots, increase the multiplier from 0 to 1 to avoid the rocket doing 0 damage + if (Owner.Calamity().sharkGunDamageScaling == 0) + { + Owner.Calamity().sharkGunDamageScaling++; + } + //Fire the rocket. Damage is 50% of base, multiplied by how many shots the player hits + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f) * Owner.Calamity().sharkGunDamageScaling, Projectile.knockBack, Projectile.owner); + + //After firing the rocket, reset all variables to allow left click to be held down + Time = 2; + shotCounter = 0; + } + Time++; + } + public override bool PreDraw(ref Color lightColor) + { + if (Time < 2) + return false; + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + return false; + } + } +} diff --git a/Projectiles/Ranged/MegalodonRocket.cs b/Projectiles/Ranged/MegalodonRocket.cs new file mode 100644 index 0000000000..8f1afbfe1a --- /dev/null +++ b/Projectiles/Ranged/MegalodonRocket.cs @@ -0,0 +1,107 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.NPCs.SunkenSea; +using CalamityMod.Tiles.Abyss; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class MegalodonRocket : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public static int Lifetime = 600; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 46; + Projectile.height = 38; + Projectile.aiStyle = ProjAIStyleID.Arrow; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = 1; + Projectile.extraUpdates = 2; + Projectile.timeLeft = 600; + AIType = ProjectileID.Bullet; + } + + public override void AI() + { + //Rotation + Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) * Projectile.direction; + + Lighting.AddLight(Projectile.Center, 0.3f, 0.5f, 0.1f); + if (Projectile.timeLeft <= Lifetime - 6) + { + AltSparkParticle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 15, 1f, Color.Gold * 0.1f); + GeneralParticleHandler.SpawnParticle(spark); + if (Main.rand.NextBool(3)) + { + SparkParticle spark2 = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(15, 15) - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * Main.rand.NextFloat(0.5f, 1.5f), false, Main.rand.Next(9, 12 + 1), 0.4f, Color.OrangeRed); + GeneralParticleHandler.SpawnParticle(spark2); + } + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Torch, Projectile.velocity, 500, default, 0.5f); + dust.scale = Main.rand.NextFloat(0.7f, 1.5f); + dust.velocity = Projectile.velocity * Main.rand.NextFloat(-3, 3); + dust.noGravity = true; + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.Smoke, Projectile.velocity, 500, default, 0.5f); + dust2.scale = Main.rand.NextFloat(0.7f, 1.5f); + dust2.velocity = Projectile.velocity * Main.rand.NextFloat(-3, 3); + dust2.noGravity = true; + } + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); + } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 240); + } + + public override void OnKill(int timeLeft) + { + if (Main.zenithWorld) + { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MegalodonMissileMax") with { Volume = 1.5f }, Projectile.position); + } + else + { + SoundEngine.PlaySound(AbyssGravel.MineSound, Projectile.position); + SoundEngine.PlaySound(GiantClam.SlamSound, Projectile.position); + SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode.WithPitchOffset(0.5f), Projectile.position); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") with { Volume = 0.6f, Pitch = 0.8f }, Projectile.position); + } + + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.Blue, "CalamityMod/Particles/LargeBloom", Vector2.One, 0f, 1f, 0f, 25)); + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", Vector2.One, 0f, 0.5f, 0f, 15)); + + for (int i = 0; i < 8; i++) GeneralParticleHandler.SpawnParticle(new BloodParticle2(Projectile.Center, new Vector2(Main.rand.NextFloat(6, 12), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)), 12, Main.rand.NextFloat(0.3f, 0.4f), Color.DarkGoldenrod * 0.8f)); + Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, Color.RoyalBlue * 0.5f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.1f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.CornflowerBlue, "CalamityMod/Particles/FlameExplosion2", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.07f, 15); + GeneralParticleHandler.SpawnParticle(pulse2); + for (int i = 0; i < 10; i++) + { + Vector2 randVel = new Vector2(15, 15).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.5f); + Particle smoke = new HeavySmokeParticle(Projectile.Center + randVel, randVel, new Color(57, 46, 115) * 0.9f, Main.rand.Next(25, 35 + 1), Main.rand.NextFloat(0.6f, 1.5f), 0.4f); + GeneralParticleHandler.SpawnParticle(smoke); + } + } + } +} diff --git a/Projectiles/Ranged/MegalodonRocket.png b/Projectiles/Ranged/MegalodonRocket.png new file mode 100644 index 0000000000..790f4a2feb Binary files /dev/null and b/Projectiles/Ranged/MegalodonRocket.png differ diff --git a/Projectiles/Ranged/MegalodonShot.cs b/Projectiles/Ranged/MegalodonShot.cs index f6589a5697..12989d8278 100644 --- a/Projectiles/Ranged/MegalodonShot.cs +++ b/Projectiles/Ranged/MegalodonShot.cs @@ -1,7 +1,8 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -11,6 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public static int Lifetime = 600; + public override void SetDefaults() { Projectile.width = 8; @@ -20,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 2; Projectile.alpha = 255; - Projectile.timeLeft = 600; + Projectile.timeLeft = Lifetime; Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; @@ -28,7 +31,6 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - // Bubbles if (Main.rand.NextBool()) { Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); @@ -36,15 +38,25 @@ namespace CalamityMod.Projectiles.Ranged bubble.scale = Main.rand.NextFloat(0.6f, 1f); bubble.type = Main.rand.NextBool(3) ? 412 : 411; } - - // Water trail - for (int i = 0; i < 6; i++) + if (Projectile.timeLeft <= Lifetime - 4) { - Dust water = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Wet, 0f, 0f, 100); - water.noGravity = true; - water.velocity = Projectile.velocity * 0.5f; + Particle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 2, -Projectile.velocity * 0.05f, false, 10, 1f, Color.RoyalBlue * 0.5f); + GeneralParticleHandler.SpawnParticle(spark); + if (Main.rand.NextBool(3)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 45 : 56, -Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.01f, 0.3f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.5f, 0.9f); + } } } + //We use TileCollide and Onhit instead of OnKill due to it having pierce + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(Projectile.Center, Projectile.velocity, Projectile.width, Projectile.height); + OnHitEffects(); + return true; + } public override void OnKill(int timeLeft) { @@ -57,7 +69,55 @@ namespace CalamityMod.Projectiles.Ranged bubble.type = Main.rand.NextBool(3) ? 412 : 411; } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 60); + //Only increase damage of the rocket on the first hit + if (Projectile.numHits == 0) + { + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().sharkGunDamageScaling++; + } + OnHitEffects(); + } + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + { + if (Projectile.numHits == 0) + { + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().sharkGunDamageScaling++; + } + target.AddBuff(ModContent.BuffType(), 60); + OnHitEffects(); + } + } + + private void OnHitEffects() + { + for (int i = 0; i < 4; ++i) + { + int bloodLifetime = Main.rand.Next(22, 25); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.RoyalBlue * 0.7f, Color.DarkBlue, Main.rand.NextFloat()); + bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); + + if (Main.rand.NextBool(20)) + bloodScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + for (int i = 0; i <= 2; i++) + { + LineParticle spark = new LineParticle(Projectile.Center, -Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.18f, 0.44f)) * Main.rand.NextFloat(0.4f, 1.5f), false, 8, 0.9f, Main.rand.NextBool() ? Color.RoyalBlue * 0.7f : Color.MediumBlue); + GeneralParticleHandler.SpawnParticle(spark); + LineParticle spark2 = new LineParticle(Projectile.Center, -Projectile.velocity.RotatedBy(Main.rand.NextFloat(-0.18f, -0.44f)) * Main.rand.NextFloat(0.4f, 1.5f), false, 8, 0.9f, Main.rand.NextBool() ? Color.RoyalBlue * 0.7f : Color.MediumBlue); + GeneralParticleHandler.SpawnParticle(spark2); + } + } } } diff --git a/Projectiles/Ranged/OmniGrenade.cs b/Projectiles/Ranged/OmniGrenade.cs index 3433fc25f1..2873b4aea4 100644 --- a/Projectiles/Ranged/OmniGrenade.cs +++ b/Projectiles/Ranged/OmniGrenade.cs @@ -87,10 +87,14 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) { - modifiers.SourceDamage *= 0f; - if (Main.masterMode) modifiers.SourceDamage.Flat += 240f; - else if (Main.expertMode) modifiers.SourceDamage.Flat += 180f; - else modifiers.SourceDamage.Flat += 120f; + Player Owner = Main.player[Projectile.owner]; + if (target == Owner) + { + modifiers.SourceDamage *= 0f; + if (Main.masterMode) modifiers.SourceDamage.Flat += 240f; + else if (Main.expertMode) modifiers.SourceDamage.Flat += 180f; + else modifiers.SourceDamage.Flat += 120f; + } } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/OmniGunHoldout.cs b/Projectiles/Ranged/OmniGunHoldout.cs index 6a5c6f65a4..c836aabdbc 100644 --- a/Projectiles/Ranged/OmniGunHoldout.cs +++ b/Projectiles/Ranged/OmniGunHoldout.cs @@ -82,7 +82,8 @@ namespace CalamityMod.Projectiles.Ranged OffsetLengthFromArm -= 20f; CurrentRecoilResolveSpeed = 0.14f; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), ModContent.ProjectileType(), (int)(Projectile.damage * 6f), Projectile.knockBack, Projectile.owner); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), ModContent.ProjectileType(), (int)(Projectile.damage * 6f), Projectile.knockBack, Projectile.owner); shotCounter++; framesBetweenShots = 40; } @@ -115,7 +116,8 @@ namespace CalamityMod.Projectiles.Ranged framesBetweenShots = 8; OffsetLengthFromArm -= 3f; CurrentRecoilResolveSpeed = 0.3f; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(4f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(4f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); shotCounter++; if (shotCounter > 10) framesBetweenShots = 30; @@ -155,9 +157,11 @@ namespace CalamityMod.Projectiles.Ranged // Propel the owner backward Owner.velocity += -Projectile.velocity * 7f; - - for (int i = 0; i < 8; i++) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.5f, 1.5f), ModContent.ProjectileType(), (int)(Projectile.damage * 3f), Projectile.knockBack, Projectile.owner); + if (Main.myPlayer == Projectile.owner) + { + for (int i = 0; i < 8; i++) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.5f, 1.5f), ModContent.ProjectileType(), (int)(Projectile.damage * 3f), Projectile.knockBack, Projectile.owner); + } shotCounter++; if (shotCounter > 11) framesBetweenShots = 30; @@ -190,8 +194,8 @@ namespace CalamityMod.Projectiles.Ranged #endregion OffsetLengthFromArm -= 24f; CurrentRecoilResolveSpeed = 0.15f; - - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 9f), Projectile.knockBack, Projectile.owner); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 9f), Projectile.knockBack, Projectile.owner); Time = 0; shotCounter = 0; } diff --git a/Projectiles/Ranged/RicoshotCoin.cs b/Projectiles/Ranged/RicoshotCoin.cs index f8f2a35d1e..d8471f6b5e 100644 --- a/Projectiles/Ranged/RicoshotCoin.cs +++ b/Projectiles/Ranged/RicoshotCoin.cs @@ -34,21 +34,22 @@ namespace CalamityMod.Projectiles.Ranged // Because ricoshots have slight frame delays for dramatic effect, setting this too high will make them miss hilariously. public static float SuperpredictionRatio = 0.1f; - // The first copper coin struck adds +70% damage. Copper coins beyond the first add +20% damage. - // Maximum: 4 copper coins = +130% + // The first copper coin struck adds +125% damage. Copper coins beyond the first add +25% damage. + // Maximum: 4 copper coins = +200% // - // The copper numbers are intentionally significantly lower because Crackshot Colt is pre-boss. - // That, and the mechanic will always be available because they're dirt cheap. Killing a single enemy lets you perform dozens more ricoshots. - public static float CopperBonus = 0.7f; - public static float CopperMulticoinBonus = 0.2f; + // Cost is virtually unaccounted for as even in early game, 4 copper coins is dirt cheap. + // Despite this, the gimmick exclusively used for early game Crackshot Colt needs to not be outperformed by just firing normally. + // Therefore, its bonuses cannot drop much lower than this despite being significantly cheaper. + public static float CopperBonus = 1.25f; + public static float CopperMulticoinBonus = 0.25f; - // The first silver coin struck adds +150% damage. Silver coins beyond the first add +50% damage. - // Maximum: 4 silver coins = +300% + // The first silver coin struck adds +175% damage. Silver coins beyond the first add +50% damage. + // Maximum: 4 silver coins = +325% // // Midas Prime uses coins from the piggy bank, so you will almost always be using gold. // Silver is not much worse than gold, because if you're broke and can't use gold you shouldn't be significantly penalized. // However, spending multiple silver on a multi-ricoshot is not too expensive, so the multicoin bonus is much lower. - public static float SilverBonus = 1.5f; + public static float SilverBonus = 1.75f; public static float SilverMulticoinBonus = 0.5f; // The first gold coin struck adds +200% damage. Gold coins beyond the first add +85% damage. diff --git a/Projectiles/Ranged/SeaDragonMuzzleBlast.cs b/Projectiles/Ranged/SeaDragonMuzzleBlast.cs deleted file mode 100644 index f8279c2f1d..0000000000 --- a/Projectiles/Ranged/SeaDragonMuzzleBlast.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - - -namespace CalamityMod.Projectiles.Ranged -{ - public class SeaDragonMuzzleBlast : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 80; - Projectile.height = 80; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft = 8; - Projectile.MaxUpdates = 4; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - - public override void AI() - { - // Belching smoke and flames copied from Handheld Tank with a few edits (lasts 8 frames, but all happens at once due to extra updates) - for (int i = 0; i < 30; ++i) - { - // Pick a random type of fire (there's a little water mixed in) - int dustID; - switch (Main.rand.Next(6)) - { - case 0: - dustID = 170; - break; - case 1: - case 2: - dustID = 174; - break; - default: - dustID = 33; - break; - } - - // Choose a random speed and angle to belch out the fire - float dustSpeed = Main.rand.NextFloat(3.0f, 13.0f); - float angleRandom = 0.07f; - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - // Pick a size for the fire particle - float scale = Main.rand.NextFloat(0.7f, 1.8f); - - // Actually spawn the fire - int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale); - Main.dust[idx].noGravity = true; - Main.dust[idx].position = Projectile.Center; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.OnFire3, 240); - } - } -} diff --git a/Projectiles/Ranged/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs index 570618b113..40aae90c70 100644 --- a/Projectiles/Ranged/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -1,117 +1,205 @@ using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.NPCs.SunkenSea; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Tiles.Abyss; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using static tModPorter.ProgressUpdate; namespace CalamityMod.Projectiles.Ranged { public class SeaDragonRocket : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; + public ref float time => ref Projectile.ai[0]; + private bool beginStretchAnim = false; + private float progress = -1; + public bool attacking => Projectile.ai[1] == 5; // If the missile is launched at the enemy + public ref float moveSpeed => ref Projectile.ai[2]; // Some speed variation applied to the missiles based on spawn order public override void SetDefaults() { Projectile.width = 18; Projectile.height = 18; Projectile.friendly = true; Projectile.penetrate = 1; - Projectile.timeLeft = 95; + Projectile.timeLeft = 600; + Projectile.extraUpdates = 1; Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.scale = 0.25f; } public override void AI() { - if (Projectile.ai[1] == 0f) - { - for (int i = 0; i < 5; i++) - { - int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, default, 2f); - Main.dust[fire].velocity *= 3f; - if (Main.rand.NextBool()) - { - Main.dust[fire].scale = 0.5f; - Main.dust[fire].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - Projectile.ai[1] = 1f; - } + Lighting.AddLight(Projectile.Center, Color.Cyan.ToVector3() * 0.5f); + Player Owner = Main.player[Projectile.owner]; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (Projectile.owner == Main.myPlayer && Projectile.timeLeft <= 3) + + if (attacking) // Fly at the enemy { - Projectile.tileCollide = false; - Projectile.ai[1] = 0f; - Projectile.alpha = 255; - Projectile.position.X = Projectile.Center.X; - Projectile.position.Y = Projectile.Center.Y; - Projectile.width = 200; - Projectile.height = 200; - Projectile.position.X -= (float)(Projectile.width / 2); - Projectile.position.Y -= (float)(Projectile.height / 2); - Projectile.knockBack = 10f; + NPC chosenTarget = Projectile.Center.ClosestNPCAt(600); + CalamityUtils.HomeInOnSelectedNPC(Projectile, chosenTarget, true, 1.4f + moveSpeed, 25, 0.985f); + if (chosenTarget != null) + Projectile.timeLeft++; // Don't die if you have a target to home in on } - else + else // Swarm around the player until ready to be fired { - if (Math.Abs(Projectile.velocity.X) >= 8f || Math.Abs(Projectile.velocity.Y) >= 8f) + Vector2 circle = Owner.Center + new Vector2(0, -195 + moveSpeed * 25).RotatedBy(time * 0.05f); + Vector2 moveToEnemy = (circle - Projectile.Center).SafeNormalize(Vector2.UnitX); + if (Projectile.velocity.Length() < 12) + Projectile.velocity = Projectile.velocity * 0.97f + moveToEnemy * moveSpeed; + else + Projectile.velocity *= 0.9f; + if (time % 2 == 0) + Projectile.netUpdate = true; + } + if (Main.rand.NextBool(10)) + { + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5) - Projectile.velocity, 66); + trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f); + trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.5f); + trailDust.color = Main.rand.NextBool() ? Color.AliceBlue : Color.SkyBlue; + trailDust.noGravity = true; + if (attacking) { - for (int j = 0; j < 2; j++) - { - float halfX = 0f; - float halfY = 0f; - if (j == 1) - { - halfX = Projectile.velocity.X * 0.5f; - halfY = Projectile.velocity.Y * 0.5f; - } - int explosion = Dust.NewDust(new Vector2(Projectile.position.X + 3f + halfX, Projectile.position.Y + 3f + halfY) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, DustID.Torch, 0f, 0f, 100, default, 1f); - Main.dust[explosion].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; - Main.dust[explosion].velocity *= 0.2f; - Main.dust[explosion].noGravity = true; - explosion = Dust.NewDust(new Vector2(Projectile.position.X + 3f + halfX, Projectile.position.Y + 3f + halfY) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, DustID.Water, 0f, 0f, 100, default, 0.5f); - Main.dust[explosion].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[explosion].velocity *= 0.05f; - } + Particle trail = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(10, 10), -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, 15, Main.rand.NextFloat(0.6f, 0.8f), Main.rand.NextBool(3) ? Color.SeaGreen : Color.SkyBlue); + GeneralParticleHandler.SpawnParticle(trail); } } - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + if (Main.rand.NextBool(8) && !attacking) + { + Particle Star = new CritSpark(Projectile.Center, -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.5f), Color.SkyBlue, Main.rand.NextBool(3) ? Color.SeaGreen : Color.SkyBlue, Main.rand.NextFloat(0.4f, 0.7f), 30, 0.1f, 3f); + GeneralParticleHandler.SpawnParticle(Star); + } + + if (progress >= 0f && progress < 1f) // For spawn animation + progress += 0.04f; + + if (Projectile.scale < 1f) + Projectile.scale += 0.05f; + + time++; + + if (Owner.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && !attacking) // If no holdout exists and not attacking then die + Projectile.Kill(); + } + + public override void OnSpawn(IEntitySource source) + { + for (int i = 0; i < 15; i++) + { + Vector2 velocity = (MathHelper.TwoPi * i / 15f).ToRotationVector2() * 3f; + Dust ring = Dust.NewDustPerfect(Projectile.Center, 66, velocity); + ring.noGravity = true; + ring.scale = Main.rand.NextFloat(0.5f, 0.7f); + ring.color = Color.CornflowerBlue; + } + beginStretchAnim = true; } public override void OnKill(int timeLeft) { - Projectile.ExpandHitboxBy(192); - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Item110, Projectile.position); - for (int i = 0; i < 15; i++) + // Explode on kill if attacking, else just poof out + if (attacking) { - int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Water, 0f, 0f, 100, default, 2f); - Main.dust[smoke].velocity *= 3f; - if (Main.rand.NextBool()) + SoundEngine.PlaySound(SoundID.NPCDeath19, Projectile.position); + SoundStyle hitSound2 = new("CalamityMod/Sounds/NPCHit/AnahitaHit", 3); + SoundEngine.PlaySound(hitSound2 with { Volume = 1.1f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode.WithPitchOffset(0.8f) with { Volume = 1.1f , MaxInstances = 2}, Projectile.position); + for (int i = 0; i < 3; i++) { - Main.dust[smoke].scale = 0.5f; - Main.dust[smoke].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Particle Star = new CritSpark(Projectile.Center, Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(4, 5), Color.SkyBlue, Main.rand.NextBool() ? Color.HotPink : Color.SeaGreen, Main.rand.NextFloat(0.6f, 0.9f), 30, 0.4f, 3f); + GeneralParticleHandler.SpawnParticle(Star); + } + int points = 4; + float radians = MathHelper.TwoPi / points; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)).RotatedByRandom(100); + Color useColor = Main.rand.NextBool() ? Color.SkyBlue : Color.HotPink; + for (int k = 0; k < points; k++) + { + Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f); + Particle spark = new GlowSparkParticle((Projectile.Center + velocity * 7.5f), velocity * 0.5f, false, 11, 0.03f, useColor, new Vector2(1f, 0.4f), true, false); + GeneralParticleHandler.SpawnParticle(spark); } } - for (int j = 0; j < 25; j++) + else { - int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, default, 3f); - Main.dust[fire].noGravity = true; - Main.dust[fire].velocity *= 5f; - fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, default, 2f); - Main.dust[fire].velocity *= 2f; - } - int projAmt = Main.rand.Next(2, 4); - if (Projectile.owner == Main.myPlayer) - { - for (int k = 0; k < projAmt; k++) + for (int i = 0; i < 7; i++) { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.33), 0f, Projectile.owner); + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(4, 6)); + dust.noGravity = false; + dust.scale = 0.8f; + dust.color = Color.AliceBlue; + dust.noLightEmittence = true; } } } + public override bool? CanDamage() => (attacking ? null : false); // Can't hit if not attacking + + + public override bool PreDraw(ref Color lightColor) + { + if (beginStretchAnim) + { + progress = 0f; + beginStretchAnim = false; + } + + if (progress >= 0f) // Squash n' stretch on spawn + { + float stretchFactorX, stretchFactorY; + + if (progress < 0.5f) // Stretch + { + float completion = progress / 0.5f; + stretchFactorX = MathHelper.Lerp(1.6f, 0.7f, completion); + stretchFactorY = MathHelper.Lerp(0.7f, 1.6f, completion); + } + else // Squash + { + float completion = (progress - 0.5f) / 0.5f; + stretchFactorX = MathHelper.Lerp(0.7f, 1f, completion); + stretchFactorY = MathHelper.Lerp(1.6f, 1f, completion); + } + + if (progress >= 1f) + { + stretchFactorX = 1f; + stretchFactorY = 1f; + progress = -1f; + } + + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + Vector2 finalScale = new Vector2(stretchFactorX, stretchFactorY) * Projectile.scale; + Vector2 finalPos = Projectile.Center - Main.screenPosition; + + Main.spriteBatch.Draw(texture, finalPos, null, lightColor, Projectile.rotation, origin, finalScale, SpriteEffects.None, 0f); + + return false; + } + + Texture2D mainTexture = ModContent.Request(Texture).Value; + SpriteEffects spriteEffects = SpriteEffects.None; + Vector2 drawOrigin = mainTexture.Size() / 2f; + float drawScale = Projectile.scale; + float drawRotation = Projectile.rotation; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + + Main.spriteBatch.Draw(mainTexture, drawPosition, null, lightColor * (1f - Projectile.alpha / 255f), drawRotation, drawOrigin, drawScale, spriteEffects, 0f); + + return false; + } + + } } diff --git a/Projectiles/Ranged/SeadragonHoldout.cs b/Projectiles/Ranged/SeadragonHoldout.cs new file mode 100644 index 0000000000..a0df628fb3 --- /dev/null +++ b/Projectiles/Ranged/SeadragonHoldout.cs @@ -0,0 +1,190 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using static Terraria.ModLoader.ModContent; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SeadragonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 24f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -1f; + public override float OffsetYDownwards => 5f; + + public int Time = 0; + public int shotCounter = 0; + public int framesBetweenShots = 0; + public bool swapType = false; + public bool transEffects = false; + + public override Vector2 GunTipPosition => Projectile.Center - Vector2.UnitY + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.5f; + + + public override void KillHoldoutLogic() + { + //If the player is dead, kill the holdout. + if (Owner.CantUseHoldout() || HeldItem.type != AssociatedItemID) + Projectile.Kill(); + } + + public override void HoldoutAI() + { + //Pause to give the effect of reloading + if (Time == 30) + { + Player Owner = Main.player[Projectile.owner]; + SoundEngine.PlaySound(SoundID.Item149, Projectile.Center); + if (Main.netMode != NetmodeID.Server) + { + string goreType = "SeadragonMag"; + Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity.RotatedBy(2f * -Owner.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); + } + //Set the scaling to 0 whenever it reloads + Owner.Calamity().sharkGunDamageScaling = 0; + //Has a 1 in 100 chance to set transEffects to true, changing the shot colors to be replaced by the transgender pride flag colors + transEffects = Main.rand.NextBool(100); + } + if (Time >= 90) + { + if (framesBetweenShots == 0 && shotCounter <= 51) + { + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 30; + #region Debug Text Display + //Main.NewText(shotCounter); + //Main.NewText(Owner.Calamity().sharkGunDamageScaling); + #endregion + #region Visuals and Sounds + SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotTiny"); + SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = 0.25f , PitchVariance = 0.1f, MaxInstances = -1 }, Projectile.Center); + Particle sparker = new CustomPulse(GunTipPosition, Vector2.Zero, Color.HotPink, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.02f, 0.5f, 5, true, 0.8f); + GeneralParticleHandler.SpawnParticle(sparker); + GenericSparkle sparker2 = new GenericSparkle(GunTipPosition, Vector2.Zero, Main.rand.NextBool() ? Color.SeaShell : Color.Silver * 0.9f, Color.HotPink, Main.rand.NextFloat(0.8f, 1.2f), 2, 0, 2.68f); + GeneralParticleHandler.SpawnParticle(sparker2); + for (int i = 0; i <= 4; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(3) ? 303 : 244, (shootVelocity * Main.rand.NextFloat(0.2f, 1.1f)).RotatedByRandom(0.4f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 1.4f); + } + #endregion + + //How many frames between firing projectiles, and how far the gun moves backward to give the effect of recoil. Change this number to edit fire rate + framesBetweenShots = 3; + OffsetLengthFromArm -= 2f; + //Here we detect which ammo the bullets will use + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _); + //Alternate between shooting bullets and water streams. Despite not having damage scaling, the fish gain movement speed based on the scaling, so we still need a Global Projectile + if (Main.myPlayer == Projectile.owner) + { + if (!swapType) + { + Projectile scalingShot = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); + CalamityGlobalProjectile cgp = scalingShot.Calamity(); + cgp.sharkBullets = true; + //Only eject casings from the gun if bullets are fired, preventing too many at once + if (Main.netMode != NetmodeID.Server) + { + string goreType = "SeadragonCasing"; + Vector2 spawnOffset = new Vector2(0, -11f); + Vector2 spawnPosition = Projectile.Center + (-Projectile.velocity * 5) + spawnOffset; + Gore.NewGore(Projectile.GetSource_FromAI(), spawnPosition, -Projectile.velocity * 4f, Mod.Find(goreType).Type); + } + } + if (swapType) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, transEffects ? 0f : 1f); + } + swapType = !swapType; + } + shotCounter++; + //Allow a pause before unleashing the fish. This allows the final bullet a chance to hit before the fish are unleashed. Lowering this number reduces the delay, but may also cause the gun to become inconsistent + if (shotCounter == 50) + framesBetweenShots = 18; + if (Main.zenithWorld && shotCounter == 35) + { + SoundStyle joke = new("CalamityMod/Sounds/Custom/GFB/YouKnowWhatThatMeans"); + SoundEngine.PlaySound(joke with { Volume = 1f }, Projectile.Center); + } + } + if (framesBetweenShots > 0) + framesBetweenShots--; + } + if (shotCounter == 50 && framesBetweenShots == 0) + { + //Reset all variables to allow left click to be held down + Time = 2; + shotCounter = 0; + for (int x = 0; x < Main.maxProjectiles; x++) + { + //Activate all fish to rush at the cursor and home in on the nearest enemy + Projectile projectile = Main.projectile[x]; + if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[1] < 5) + { + projectile.ai[1] = 5; + projectile.velocity = Utils.DirectionTo(projectile.Center, Owner.Calamity().mouseWorld) * 12; + } + if (Main.zenithWorld) + { + SoundStyle joke = new("CalamityMod/Sounds/Custom/GFB/FISH"); + SoundEngine.PlaySound(joke with { Volume = 0.35f, MaxInstances = -1 }, projectile.Center); + } + } + } + //If any fish projectiles are present, create an eye shine effect as they rush the enemy + if (Owner.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + if (Time == 3) + { + SoundStyle hitSound = new("CalamityMod/Sounds/Item/SevensStrikerTriples"); + SoundEngine.PlaySound(hitSound with { Volume = 0.5f, Pitch = 0.8f }, Projectile.Center); + for (int b = 0; b < 12; b++) + { + int star = 4; + for (int i = 0; i < star; i++) + { + float power = Main.rand.NextFloat(0.2f, 1f); + Vector2 vel = (MathHelper.TwoPi * i / star).ToRotationVector2().RotatedBy(Projectile.rotation) * 6f; + float size = (0.6f) * Main.rand.NextFloat(0.9f, 1.1f) * (1.1f - power); + int dustStyle = DustType(); + Dust dust = Dust.NewDustPerfect(GunTipPosition + (-Projectile.velocity.RotatedBy(0.1 * Projectile.direction) * 29f), dustStyle); + dust.scale = size; + dust.velocity = vel * power * (0.7f); + dust.noGravity = true; + dust.color = Color.Lerp(Color.Goldenrod, Color.OrangeRed, 0.5f) with { A = 1 }; + + if (b == 0) + { + Particle aura = new CustomSpark(GunTipPosition + (-Projectile.velocity.RotatedBy(0.1 * Projectile.direction) * 29f), Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 13, 0.2f, Color.Lerp(Color.Goldenrod, Color.OrangeRed, 0.5f) with { A = 1 }, new Vector2(0.65f, 1f), glowCenter: true, glowOpacity: 0.8f, glowCenterScale: 0.85f, extraRotation: Projectile.rotation + (i % 2 == 0 ? MathHelper.PiOver2 : 0), shrinkSpeed: 0.1f); + GeneralParticleHandler.SpawnParticle(aura); + } + } + } + } + } + Time++; + } + public override bool PreDraw(ref Color lightColor) + { + if (Time < 2) + return false; + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + return false; + } + } +} diff --git a/Projectiles/Ranged/VoidBlast.cs b/Projectiles/Ranged/VoidBlast.cs new file mode 100644 index 0000000000..ffe4724727 --- /dev/null +++ b/Projectiles/Ranged/VoidBlast.cs @@ -0,0 +1,133 @@ +using System; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class VoidBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Melee/GalaxiaBolt"; + public int time = 0; + + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.extraUpdates = 2; + Projectile.penetrate = 1; + Projectile.timeLeft = 600; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.ignoreWater = true; + } + + public override void AI() + { + Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; + Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.1f / 255f, (255 - Projectile.alpha) * 0.7f / 255f, (255 - Projectile.alpha) * 0.15f / 255f); + + if (Projectile.timeLeft <= 597f) + { + Particle smoke = new HeavySmokeParticle(Projectile.Center, -Projectile.velocity * 0.5f, Color.Lerp(Color.MidnightBlue, Color.Indigo, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 6f)), 20, Main.rand.NextFloat(0.4f, 0.7f) * Projectile.scale, 0.8f, 0, false, 0, true); + GeneralParticleHandler.SpawnParticle(smoke); + if (Main.rand.NextBool(2)) + { + Particle smokeGlow = new HeavySmokeParticle(Projectile.Center, -Projectile.velocity * 0.5f, Color.DarkOrchid, 20, Main.rand.NextFloat(0.4f, 0.8f) * Projectile.scale, 0.3f, 0, true, 0.005f, true); + GeneralParticleHandler.SpawnParticle(smokeGlow); + } + Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark2", false, 5, 0.052f, Color.Black, new Vector2(0.6f, 1.3f), false); + GeneralParticleHandler.SpawnParticle(spark2); + SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitY) * 3.5f, Projectile.velocity * 0.01f, false, 5, 1.2f * Projectile.scale, Main.rand.NextBool() ? Color.Indigo : Color.BlueViolet); + GeneralParticleHandler.SpawnParticle(spark); + spark.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + } + time++; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 180); + if (Projectile.numHits == 0) + { + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().sharkGunDamageScaling++; + } + } + + public override void OnKill(int timeLeft) + { + float blastSize = 170; + float minMultiplier = 0.25f; + int hitsToMinMult = -1; + int debuff1 = ModContent.BuffType(); + int debuffTime = 180; + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.localAI[0] = debuff1; + blast.localAI[1] = debuffTime; + blast.timeLeft = 2; + blast.DamageType = Projectile.DamageType; + #region Visuals and Sounds + SoundStyle fire = new("CalamityMod/Sounds/Item/OmicronBeam"); + SoundEngine.PlaySound(fire with { Volume = 0.9f }, Projectile.Center); + + for (int i = 0; i < 3; i++) + { + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 1f, 1.2f, 15, false); + GeneralParticleHandler.SpawnParticle(blastRing); + } + + for (float k = 0; k < 3; k++) + { + float colorRando = Main.rand.NextFloat(0, 1); + int partLifetime = Main.rand.Next(13, 15 + 1); + float scale = Main.rand.NextFloat(0.10f, 0.16f); + Vector2 spawnPos = Projectile.Center + (Main.rand.NextVector2Circular(20, 20) * (k + 1)); + Particle blastRing = new CustomPulse(spawnPos, Vector2.Zero, Color.Lerp(Color.DarkOrchid, Color.Indigo, colorRando) * 0.6f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0.07f, scale, partLifetime); + GeneralParticleHandler.SpawnParticle(blastRing); + blastRing.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + } + + Particle innerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Indigo, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.03f, 1f, 24, true); + GeneralParticleHandler.SpawnParticle(innerGlow); + innerGlow.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + + float offset = Main.rand.NextFloat(MathHelper.TwoPi); + for (int i = 0; i < 4; i++) + { + Vector2 velocity = (MathHelper.TwoPi * i / 4f + offset).ToRotationVector2(); + Particle cross = new GlowSparkParticle(Projectile.Center, velocity, false, 12, 0.4f, Color.BlueViolet * 0.7f, new Vector2(0.07f, 0.08f), true, false); + GeneralParticleHandler.SpawnParticle(cross); + cross.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + } + for (float k = 0; k < 10; k++) + { + Particle spark = new CustomSpark(Projectile.Center, new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(2f, 4f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 27, Main.rand.NextFloat(1.1f, 1.3f), Color.Lerp(Color.MediumPurple, Color.Indigo, Main.rand.NextFloat(0.5f, 0.7f)), new Vector2(0.6f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.35f, 0.4f)); + GeneralParticleHandler.SpawnParticle(spark); + spark.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + } + + #endregion + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation; + Vector2 rotationPoint = texture.Size() * 0.5f; + + Main.EntitySpriteDraw(texture, drawPosition, null, Color.Indigo with { A = 0 }, drawRotation, rotationPoint, new Vector2(0.5f, 1.4f) * 0.025f * Projectile.scale, SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/Ranged/Voidragon.png b/Projectiles/Ranged/VoidBlast.png similarity index 100% rename from Projectiles/Ranged/Voidragon.png rename to Projectiles/Ranged/VoidBlast.png diff --git a/Projectiles/Ranged/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs deleted file mode 100644 index ada7f27283..0000000000 --- a/Projectiles/Ranged/Voidragon.cs +++ /dev/null @@ -1,117 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class Voidragon : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 10; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 10; - Projectile.alpha = 150; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.ignoreWater = true; - } - - public override void AI() - { - if (Projectile.soundDelay == 0) - { - Projectile.soundDelay = 150 + Main.rand.Next(40); - SoundEngine.PlaySound(SoundID.Item92, Projectile.position); - } - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] == 12f) - { - Projectile.localAI[0] = 0f; - for (int l = 0; l < 12; l++) - { - Vector2 dustVel = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - dustVel += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); - dustVel = dustVel.RotatedBy((double)(Projectile.rotation - 1.57079637f), default); - int shadowDust = Dust.NewDust(Projectile.Center, 0, 0, DustID.ShadowbeamStaff, 0f, 0f, 160, default, 1f); - Main.dust[shadowDust].scale = 1.1f; - Main.dust[shadowDust].noGravity = true; - Main.dust[shadowDust].position = Projectile.Center + dustVel; - Main.dust[shadowDust].velocity = Projectile.velocity * 0.1f; - Main.dust[shadowDust].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[shadowDust].position) * 1.25f; - } - } - Projectile.alpha -= 15; - int alphaControl = 150; - if (Projectile.Center.Y >= Projectile.ai[1]) - { - alphaControl = 0; - } - if (Projectile.alpha < alphaControl) - { - Projectile.alpha = alphaControl; - } - Projectile.rotation = Projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.NextBool(16)) - { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int extraDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); - Main.dust[extraDust].velocity = value3 * 0.66f; - Main.dust[extraDust].position = Projectile.Center + value3 * 12f; - } - if (Main.rand.NextBool(48) && !Main.dedServ) - { - int voidGore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); - Main.gore[voidGore].velocity *= 0.66f; - Main.gore[voidGore].velocity += Projectile.velocity * 0.3f; - } - if (Projectile.ai[1] == 1f) - { - Projectile.light = 0.9f; - if (Main.rand.NextBool(10)) - { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); - } - if (Main.rand.NextBool(20) && !Main.dedServ) - { - Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); - } - } - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.1f / 255f, (255 - Projectile.alpha) * 0.7f / 255f, (255 - Projectile.alpha) * 0.15f / 255f); - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - public override void OnKill(int timeLeft) - { - if (Projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 1f); - } - SoundEngine.PlaySound(SoundID.Item10, Projectile.position); - for (int k = 0; k < 5; k++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } - } - } -} diff --git a/Projectiles/Ranged/VoidragonHoldout.cs b/Projectiles/Ranged/VoidragonHoldout.cs new file mode 100644 index 0000000000..2d9c76aa10 --- /dev/null +++ b/Projectiles/Ranged/VoidragonHoldout.cs @@ -0,0 +1,289 @@ +using System; +using System.Runtime.InteropServices; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class VoidragonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 40f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -1f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + (Projectile.velocity * 55).RotatedBy(-0.09f * Projectile.direction); + public const float LaserAimLag = 0.92f; // Last Prism-esque aim lag. Higher = Slower. Last Prism is 0.92f. + + public int Time = 0; + public int beamTimer = 500; + public int shotCounter = 0; + public int framesBetweenShots = 0; + public bool swapType = false; + public bool firingBeam = false; + public float chargeVisTimer = 0; + public float maxChargeSpeed = 2; + public float chargePulseTimer = 0; + public bool playChargeSound = true; + + public SlotId soundSlot; + + public override void KillHoldoutLogic() + { + //If the player is dead, kill the holdout. + if (Owner.CantUseHoldout() || HeldItem.type != AssociatedItemID) + Projectile.Kill(); + } + public override void OnKill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(soundSlot, out var ChargeSound)) + ChargeSound?.Stop(); + } + public override void HoldoutAI() + { + if (SoundEngine.TryGetActiveSound(soundSlot, out var ChargeSound) && ChargeSound.IsPlaying) + ChargeSound.Position = Projectile.Center; + + //Spawn dust on the holdout's eyes based on the amount of damage scaling. + for (int i = 0; i < 2; i++) + { + int dustType = ModContent.DustType(); + float rotMulti = Main.rand.NextFloat(0.3f, 1f); + Dust dust = Dust.NewDustPerfect(GunTipPosition + (-Projectile.velocity.RotatedBy(0.15 * Projectile.direction) * 50), dustType); + dust.scale = Main.rand.NextFloat(1.2f, 1.8f) * (Owner.Calamity().sharkGunDamageScaling * 0.02f) - rotMulti * 0.1f; + dust.noGravity = true; + dust.velocity = new Vector2(-1.2f, -2).RotatedBy(Projectile.rotation + (Projectile.direction == -1 ? MathHelper.TwoPi * 0.75f : 0)).RotatedByRandom(rotMulti * 0.8f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (Owner.Calamity().sharkGunDamageScaling * 0.015f); + dust.alpha = Main.rand.Next(90, 150); + dust.color = Main.rand.NextBool() ? Color.Indigo : Color.DarkBlue; + } + //Smoothly scale down the gun visuals before reloading + if (Time < 30) + { + if (Owner.Calamity().sharkGunDamageScaling > 0) + Owner.Calamity().sharkGunDamageScaling--; + } + //Pause to give the effect of reloading + if (Time == 30) + { + Player Owner = Main.player[Projectile.owner]; + SoundEngine.PlaySound(SoundID.Item149, Projectile.Center); + if (Main.netMode != NetmodeID.Server) + { + string goreType = "VoidragonMag"; + Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center + (-Projectile.velocity * 18), Projectile.velocity.RotatedBy(2f * -Owner.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); + } + //Set the scaling to 0 whenever it reloads + Owner.Calamity().sharkGunDamageScaling = 0; + } + if (Time >= 90) + { + if (framesBetweenShots == 0 && shotCounter <= 50) + { + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 28; + #region Debug Text Display + //Main.NewText(shotCounter); + //Main.NewText(Owner.Calamity().sharkGunDamageScaling); + #endregion + //Do not look in here if you value your sanity + #region Visuals and Sounds + SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotTiny"); + SoundEngine.PlaySound(fire with { Volume = 0.4f, Pitch = 0.1f, PitchVariance = 0.1f, MaxInstances = -1 }, Projectile.Center); + for (int i = 0; i <= 4; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(3) ? 303 : 244, (shootVelocity * Main.rand.NextFloat(0.2f, 1.1f)).RotatedByRandom(0.4f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 1.4f); + Particle smoke = new HeavySmokeParticle(GunTipPosition, Vector2.Zero, Main.rand.NextBool() ? Color.Black : Color.Indigo * 0.6f, 10, 0.85f, 1.1f, 5f, false, 0, true); + GeneralParticleHandler.SpawnParticle(smoke); + } + for (int i = 0; i <= 2; i++) + { + Particle spark = new VoidSparkParticle(GunTipPosition, shootVelocity.RotatedByRandom(0.8f) * Main.rand.NextFloat(1.2f, 1.5f), false, 25, 0.1f, Main.rand.NextBool() ? Color.Indigo : Color.BlueViolet); + GeneralParticleHandler.SpawnParticle(spark); + } + Particle sparker = new CustomPulse(GunTipPosition, Vector2.Zero, Color.Purple, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.02f, 0.5f, 2, true, 0.8f); + GeneralParticleHandler.SpawnParticle(sparker); + sparker.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + GenericSparkle sparker2 = new GenericSparkle(GunTipPosition, Vector2.Zero, Main.rand.NextBool() ? Color.Indigo : Color.BlueViolet * 0.9f, Color.Indigo, Main.rand.NextFloat(1.4f, 1.6f), 2, 0, 2.22f); + GeneralParticleHandler.SpawnParticle(sparker2); + sparker2.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + GenericSparkle sparker3 = new GenericSparkle(GunTipPosition, Vector2.Zero, Main.rand.NextBool() ? Color.Indigo : Color.BlueViolet * 0.9f, Color.Indigo, Main.rand.NextFloat(2.5f, 2.6f), 2, 0, 2.68f); + GeneralParticleHandler.SpawnParticle(sparker3); + Particle center = new SnowflakeSparkle(GunTipPosition, Vector2.Zero, Color.GhostWhite, Color.Indigo, 0.8f, 2, Main.rand.NextFloat(-10, 10), 0.5f, 7); + GeneralParticleHandler.SpawnParticle(center); + center.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + sparker3.DrawLayer = Enums.GeneralDrawLayer.AfterEverything; + #endregion + + //How many frames between firing projectiles, and how far the gun moves backward to give the effect of recoil. Change this number to edit fire rate + framesBetweenShots = 3; + OffsetLengthFromArm -= 2.5f; + //Here we detect which ammo the bullets will use + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _); + //Alternate between shooting bullets and void blasts. We seperate it into two different projectiles due to the bullets needing to use a Global Projectile to track the damage multiplier + if (Main.myPlayer == Projectile.owner) + { + if (!swapType) + { + Projectile scalingShot = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); + CalamityGlobalProjectile cgp = scalingShot.Calamity(); + cgp.sharkBullets = true; + //Only eject casings from the gun if bullets are fired, preventing too many at once + if (Main.netMode != NetmodeID.Server) + { + string goreType = "VoidragonCasing"; + Vector2 spawnOffset = new Vector2(0, -13f); + Vector2 spawnPosition = Projectile.Center + (-Projectile.velocity * 18) + spawnOffset; + Gore.NewGore(Projectile.GetSource_FromAI(), spawnPosition, -Projectile.velocity * 4f, Mod.Find(goreType).Type); + } + } + if (swapType) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + swapType = !swapType; + } + shotCounter++; + //Allow a pause before firing the laser. The long delay lets the laser's charge sound play in full + if (shotCounter == 50) + { + framesBetweenShots = 150; + shotCounter++; + } + } + if (framesBetweenShots > 0) + framesBetweenShots--; + } + if (shotCounter == 51 && !firingBeam) //Charging + { + SoundStyle charge = new("CalamityMod/Sounds/Item/VoidragonCharge"); + if (playChargeSound) + soundSlot = SoundEngine.PlaySound(charge with { Volume = 0.7f, IsLooped = true, pitch = -0.5f }, Projectile.Center); + playChargeSound = false; + float chargeCompletion = Utils.GetLerpValue(150, 0, framesBetweenShots, true); + chargeVisTimer = MathHelper.Lerp(0, maxChargeSpeed, chargeCompletion); + chargePulseTimer += 0.6f + MathHelper.Lerp(0, maxChargeSpeed, MathF.Pow(chargeCompletion, 2.5f)); + + if (SoundEngine.TryGetActiveSound(soundSlot, out var sSound) && sSound.IsPlaying) + sSound.Pitch = -0.85f + 1.5f * chargeCompletion; + } + else + { + chargePulseTimer = 0; + chargeVisTimer = MathHelper.Lerp(chargeVisTimer, 0, 0.12f); + } + if (shotCounter == 51 && framesBetweenShots == 0) + { + //Main.NewText(beamTimer); + float beamCompletion = Utils.GetLerpValue(500, 0, beamTimer, true); + if (!firingBeam) + { + Owner.Calamity().GeneralScreenShakePower = 10f; + if (SoundEngine.TryGetActiveSound(soundSlot, out var cSound)) + cSound?.Stop(); + SoundStyle start = new("CalamityMod/Sounds/Item/VoidragonStrongStart"); + SoundStyle start2 = new("CalamityMod/Sounds/Item/MagnaCannonShot"); + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound((i > 0 ? start2 : start) with { Volume = 1f, pitch = 0f - 0.5f * i, MaxInstances = 3 }, Projectile.Center); + SoundStyle fire = new("CalamityMod/Sounds/Item/VoidragonLaser"); + soundSlot = SoundEngine.PlaySound(fire with { Volume = 1f, IsLooped = true, pitch = 0f }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(soundSlot, out var sSound) && sSound.IsPlaying) + { + sSound.Pitch = 1f - 1.5f * MathF.Pow(beamCompletion, 10f) + 0.6f * beamCompletion; + sSound.Volume = 1f - 1 * MathF.Pow(beamCompletion, 10f); + } + firingBeam = true; + if (firingBeam && beamTimer > 0) + { + //If the player hasn't hit any shots, increase the multiplier from 0 to 1 to avoid the laser doing 0 damage + if (Owner.Calamity().sharkGunDamageScaling == 0) + { + Owner.Calamity().sharkGunDamageScaling++; + } + //Spawn the laser only once at the start of the timer. Change beamTimer to edit its lifetime + //I fucking hate this laser by the way + if (Main.myPlayer == Projectile.owner && beamTimer == 500) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5, ModContent.ProjectileType(), (int)(Projectile.damage * 0.05f) * Owner.Calamity().sharkGunDamageScaling, Projectile.knockBack, Projectile.owner, Projectile.whoAmI); + beamTimer--; + } + else + { + firingBeam = false; + Projectile.Kill(); + } + } + Time++; + } + public override void ManageHoldout() + { + Vector2 storedVelocity = Projectile.velocity; + base.ManageHoldout(); + + if (firingBeam) + { + Vector2 aimVector = (Main.MouseWorld - Owner.RotatedRelativePoint(Owner.MountedCenter, true)).SafeNormalize(Vector2.UnitY); + aimVector = Vector2.Normalize(Vector2.Lerp(aimVector, Vector2.Normalize(storedVelocity), LaserAimLag)); + + if (aimVector != storedVelocity) + Projectile.netUpdate = true; + Projectile.velocity = aimVector; + + Projectile.rotation = Projectile.velocity.ToRotation(); + } + } + public override bool PreDraw(ref Color lightColor) + { + if (Time < 2) + return false; + Texture2D texture = TextureAssets.Projectile[Type].Value; + Texture2D texture2 = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D texture3 = ModContent.Request("CalamityMod/Particles/RoarPulse").Value; + Texture2D texture4 = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + Texture2D sparkle = ModContent.Request("CalamityMod/Particles/HalfStar").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 shake = Main.rand.NextVector2Circular(6, 6); + + float chargeVisual = MathF.Pow(Utils.GetLerpValue(0, maxChargeSpeed / 1.5f, chargeVisTimer, true), 1.5f); + float finalChargeVisual = MathF.Pow(Utils.GetLerpValue(maxChargeSpeed / 1.5f, maxChargeSpeed, chargeVisTimer, true), 3f); + + int max = 30; + float ringScaling = MathF.Pow(1 - Utils.GetLerpValue(0, max, chargePulseTimer % max, true), 1.15f); + float ringOpacity = 1 - MathF.Abs(Utils.GetLerpValue(0.5f, 1, ringScaling, false)); + + for (int i = 0; i < 22; i++) + { + Color auraColor = Color.Lerp(Color.Indigo, Color.BlueViolet, i * 0.01f) with { A = 0 } * 0.6f; + Vector2 drawOffset = ((MathHelper.TwoPi * i / 22f).ToRotationVector2() * 5) + Main.rand.NextVector2Circular(7, 7); + Main.EntitySpriteDraw(texture, drawPosition + drawOffset, null, auraColor, drawRotation, rotationPoint, Projectile.scale * Main.rand.NextFloat(0.02f, 0.025f) * Owner.Calamity().sharkGunDamageScaling, flipSprite); + } + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + + //Black aura + for (int i = 0; i < 15; i++) + Main.EntitySpriteDraw(texture4, GunTipPosition - Main.screenPosition, null, Color.Lerp(Color.Black, Color.Indigo with { A = 0 }, finalChargeVisual) * (0.35f + ringOpacity * 0.65f), drawRotation + Main.rand.NextFloat(-4f, 4f), texture4.Size() / 2, new Vector2(0.85f + i * 0.065f, 0.85f - i * 0.065f) * (Projectile.scale + finalChargeVisual * 1.8f) * Owner.gravDir * chargeVisual * (4.25f - ringScaling * 2.5f), flipSprite); + + for (int i = 0; i < 3; i ++) //Glow aura + Main.EntitySpriteDraw(texture2, GunTipPosition - Main.screenPosition, null, Color.Lerp(Color.BlueViolet, Color.White, (i == 0 ? 0.8f : 0)) with { A = 0 }, drawRotation + Main.rand.NextFloat(-4f, 4f), texture2.Size() / 2, (Projectile.scale + finalChargeVisual * 1.8f) * Owner.gravDir * chargeVisual * 0.5f * (i == 0 ? 0.75f : 1), flipSprite); + + //Pulse Rings + Main.EntitySpriteDraw(texture3, GunTipPosition - Main.screenPosition, null, Color.BlueViolet with { A = 0 } * ringOpacity * 0.5f, drawRotation + Main.rand.NextFloat(-4f, 4f), texture3.Size() / 2, Projectile.scale * Owner.gravDir * chargeVisual * ringScaling * 0.5f, flipSprite); + + return false; + } + } +} diff --git a/Projectiles/Ranged/VoidragonTentacle.cs b/Projectiles/Ranged/VoidragonTentacle.cs deleted file mode 100644 index d0978a16c4..0000000000 --- a/Projectiles/Ranged/VoidragonTentacle.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class VoidragonTentacle : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 40; - Projectile.ignoreWater = true; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 5; - Projectile.MaxUpdates = 3; - Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; - } - - public override void AI() - { - Projectile.localAI[1]++; - if (Projectile.velocity.X != Projectile.velocity.X) - { - if (Math.Abs(Projectile.velocity.X) < 1f) - { - Projectile.velocity.X = -Projectile.velocity.X; - } - else - { - Projectile.Kill(); - } - } - if (Projectile.velocity.Y != Projectile.velocity.Y) - { - if (Math.Abs(Projectile.velocity.Y) < 1f) - { - Projectile.velocity.Y = -Projectile.velocity.Y; - } - else - { - Projectile.Kill(); - } - } - Vector2 center10 = Projectile.Center; - Projectile.scale = 1f - Projectile.localAI[0]; - Projectile.width = (int)(20f * Projectile.scale); - Projectile.height = Projectile.width; - Projectile.position.X = center10.X - (float)(Projectile.width / 2); - Projectile.position.Y = center10.Y - (float)(Projectile.height / 2); - if (Projectile.localAI[0] < 0.1f) - { - Projectile.localAI[0] += 0.01f; - } - else - { - Projectile.localAI[0] += 0.025f; - } - if (Projectile.localAI[0] >= 0.95f) - { - Projectile.Kill(); - } - Projectile.velocity.X = Projectile.velocity.X + Projectile.ai[0] * 1.5f; - Projectile.velocity.Y = Projectile.velocity.Y + Projectile.ai[1] * 1.5f; - if (Projectile.velocity.Length() > 16f) - { - Projectile.velocity.Normalize(); - Projectile.velocity *= 16f; - } - Projectile.ai[0] *= 1.05f; - Projectile.ai[1] *= 1.05f; - if (Projectile.scale < 1f && Projectile.localAI[1] > 5f) - { - int dustAmount = 0; - while ((float)dustAmount < Projectile.scale * 10f) - { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurpleTorch, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.3f); - Main.dust[dust].position = (Main.dust[dust].position + Projectile.Center) / 2f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.1f; - Main.dust[dust].velocity -= Projectile.velocity * (1.1f - Projectile.scale); - Main.dust[dust].fadeIn = (float)(125 + Projectile.owner); - Main.dust[dust].scale += Projectile.scale * 0.75f; - dustAmount++; - } - } - } - } -} diff --git a/Projectiles/Rogue/BlazingStarProj.cs b/Projectiles/Rogue/BlazingStarProj.cs index fbf4344802..45e56915f2 100644 --- a/Projectiles/Rogue/BlazingStarProj.cs +++ b/Projectiles/Rogue/BlazingStarProj.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Projectile.damage = (int)(Projectile.damage * 0.9f); + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.Calamity().stealthStrike) { if (!hasHit) @@ -123,6 +123,7 @@ namespace CalamityMod.Projectiles.Rogue } Projectile.ResetLocalNPCHitImmunity(); Ricochet(); + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.penetrate > 0) Projectile.penetrate--; return false; diff --git a/Projectiles/Rogue/ElephantKillerThrown.cs b/Projectiles/Rogue/ElephantKillerThrown.cs index 9fd937049e..e2dcbb4116 100644 --- a/Projectiles/Rogue/ElephantKillerThrown.cs +++ b/Projectiles/Rogue/ElephantKillerThrown.cs @@ -496,7 +496,7 @@ namespace CalamityMod.Projectiles.Rogue for (int index = 0; index < Main.npc.Length; index++) { NPC target = Main.npc[index]; - if (!target.dontTakeDamage && target.active && target.life > 0) + if (!target.dontTakeDamage && target.active && target.life > 0 && !target.townNPC) { float _ = float.NaN; bool collides = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), startPoint, endPoint, 10 * Projectile.scale, ref _); @@ -522,7 +522,7 @@ namespace CalamityMod.Projectiles.Rogue { resetHits = true; Projectile.numHits = 0; } float minMult = 0.1f; - int hitsToMinMult = 4; + int hitsToMinMult = 5; float damageFalloff = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); float adjustedDamageMult = damageMult * damageFalloff; diff --git a/Projectiles/Rogue/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs index c30a3b9955..85c92357cc 100644 --- a/Projectiles/Rogue/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < 8; i++) { Vector2 velocity = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 4f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8), Projectile.knockBack, Projectile.owner); } } } diff --git a/Projectiles/Rogue/LeviathanToothStealth.cs b/Projectiles/Rogue/LeviathanToothStealth.cs index 90da6945bf..e4527c2ca3 100644 --- a/Projectiles/Rogue/LeviathanToothStealth.cs +++ b/Projectiles/Rogue/LeviathanToothStealth.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Rogue if (hitTimer != 0) damageMult = 0.2f; bool jawsJustSlammed = (time >= jawSlamTime && time <= jawSlamTime + 8); - modifiers.SourceDamage *= (jawsJustSlammed ? 12 : 1) * damageMult; + modifiers.SourceDamage *= (jawsJustSlammed ? 4 : 1) * damageMult; if (hitTimer == 0) hitTimer = Projectile.localNPCHitCooldown; diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 7d5cb2ecae..9c7f1acc8b 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -59,9 +59,9 @@ namespace CalamityMod.Projectiles.Rogue Vector2 velocity = Projectile.DirectionFrom(Main.player[Projectile.owner].Center); velocity *= Main.rand.NextFloat(4.5f, 6.5f); velocity = velocity.RotatedBy((Main.rand.NextDouble() - 0.5) * Math.PI * 0.5, default); - int spike = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner); - if (spike.WithinBounds(Main.maxProjectiles)) - Main.projectile[spike].DamageType = RogueDamageClass.Instance; + Projectile spike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner); + spike.DamageType = RogueDamageClass.Instance; + spike.penetrate = 1; } } } diff --git a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs index dab49da486..4c0c259b7b 100644 --- a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs +++ b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 12; Projectile.friendly = true; Projectile.aiStyle = ProjAIStyleID.ThrownProjectile; - Projectile.penetrate = 4; + Projectile.penetrate = 3; Projectile.timeLeft = 360; AIType = ProjectileID.ThrowingKnife; Projectile.DamageType = RogueDamageClass.Instance; diff --git a/Projectiles/Rogue/PalladiumJavelinProjectile.cs b/Projectiles/Rogue/PalladiumJavelinProjectile.cs index ff48cd70d1..55b2aa78cd 100644 --- a/Projectiles/Rogue/PalladiumJavelinProjectile.cs +++ b/Projectiles/Rogue/PalladiumJavelinProjectile.cs @@ -30,10 +30,10 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; //Stealth strike behavior - if (!Projectile.Calamity().stealthStrike || Projectile.owner != Main.myPlayer || Projectile.ai[2] >= 2) + if (!Projectile.Calamity().stealthStrike || Projectile.owner != Main.myPlayer || Projectile.ai[2] > 0) return; Projectile.localAI[0]++; - if (Projectile.localAI[0] >= 12f) + if (Projectile.localAI[0] == 12f) { Vector2 vector2 = new Vector2(20f, 20f); for (int index1 = 0; index1 < 10; ++index1) @@ -47,14 +47,12 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Palladium, 0f, 0f, 0, default, 1f); } - int javelin = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, ai2: Projectile.ai[2] + 1); - int javelin2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(-3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, ai2: Projectile.ai[2] + 1); + int javelin = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, ai2: 1); + int javelin2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(-3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, ai2: 1); if (javelin.WithinBounds(Main.maxProjectiles)) Main.projectile[javelin].Calamity().stealthStrike = true; if (javelin2.WithinBounds(Main.maxProjectiles)) Main.projectile[javelin2].Calamity().stealthStrike = true; - - Projectile.Kill(); } } diff --git a/Projectiles/Rogue/PumpkaboomBig.cs b/Projectiles/Rogue/PumpkaboomBig.cs index 2506069200..dad826b9be 100644 --- a/Projectiles/Rogue/PumpkaboomBig.cs +++ b/Projectiles/Rogue/PumpkaboomBig.cs @@ -254,8 +254,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.localAI[1] = 5; // Reset firing state if (flungState != -1f) { - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/PumpkinExplode1") with { Pitch = 0f, Volume = 0.75f }, Projectile.Center); - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") with { Pitch = 0f, Volume = 0.6f }, Projectile.Center); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/PumpkinExplode1") with { Pitch = 0f, Volume = 0.6f }, Projectile.Center); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") with { Pitch = 0f, Volume = 0.5f }, Projectile.Center); if (Main.myPlayer == Projectile.owner) { diff --git a/Projectiles/Rogue/PumpkaboomSmall.cs b/Projectiles/Rogue/PumpkaboomSmall.cs index 0186223c96..8ad1266778 100644 --- a/Projectiles/Rogue/PumpkaboomSmall.cs +++ b/Projectiles/Rogue/PumpkaboomSmall.cs @@ -224,7 +224,7 @@ namespace CalamityMod.Projectiles.Rogue if (flungState != -1f) { - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/PumpkinExplode1") with { Pitch = 0f, Volume = 0.75f }, Projectile.Center); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/PumpkinExplode1") with { Pitch = 0f, Volume = 0.6f }, Projectile.Center); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") with { Pitch = 0f, Volume = 0.4f }, Projectile.Center); if (Main.myPlayer == Projectile.owner) diff --git a/Projectiles/Rogue/SealedSingularityProjectile.cs b/Projectiles/Rogue/SealedSingularityProjectile.cs index a3d2e00f8f..ea68e347b6 100644 --- a/Projectiles/Rogue/SealedSingularityProjectile.cs +++ b/Projectiles/Rogue/SealedSingularityProjectile.cs @@ -1,5 +1,7 @@ using System; using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.Particles; using CalamityMod.Systems.Graphic.PixelationSystem; @@ -15,6 +17,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { + [PierceResistException] public class SealedSingularityProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; @@ -98,6 +101,11 @@ namespace CalamityMod.Projectiles.Rogue } if (AIState == 1) { + if (Timer % 30 == 0) //reset hit immunity every 30 frames & reset the pierce falloff too + { + Projectile.ResetLocalNPCHitImmunity(); + Projectile.numHits = 0; + } Projectile.timeLeft++; Projectile.rotation += 0.175f * Projectile.direction; Projectile.velocity = new Vector2( @@ -136,8 +144,6 @@ namespace CalamityMod.Projectiles.Rogue if (Timer > TimerMax && AIState == 0) { var sizee = Stealth ? 900 : 600; - Projectile.localNPCHitCooldown = 30; - Projectile.ResetLocalNPCHitImmunity(); Projectile.tileCollide = false; Timer = 0; TimerMax = Stealth ? 600 : 300; @@ -150,6 +156,7 @@ namespace CalamityMod.Projectiles.Rogue Timer = 0; TimerMax = 300; Projectile.ResetLocalNPCHitImmunity(); + Projectile.numHits = 0; if (Main.myPlayer == Projectile.owner) for (int index = 0; index < 3; ++index) { @@ -164,6 +171,7 @@ namespace CalamityMod.Projectiles.Rogue if (Timer >= TimerMax && AIState == 2) { Projectile.Resize(300, 300); + Projectile.numHits = 0; Projectile.ResetLocalNPCHitImmunity(); Projectile.Damage(); @@ -334,10 +342,12 @@ namespace CalamityMod.Projectiles.Rogue switch (AIState) { case 1: - modifiers.SourceDamage /= 20; + modifiers.SourceDamage /= Stealth ? 15 : 25; + modifiers.SourceDamage *= MathF.Pow(1 - SealedSingularity.FalloffPerTargetHitByAura, Projectile.numHits); return; case 2: - modifiers.SourceDamage *= 2; + modifiers.SourceDamage *= Stealth ? 5 : 2; + modifiers.SourceDamage *= MathF.Pow(1 - SealedSingularity.FallofPerTargetHitByBomb, Projectile.numHits); return; } } diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index bc9ba0db92..b931e2f6fe 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.alpha = 125; Projectile.DamageType = DamageClass.Summon; + Projectile.MaxUpdates = 4; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index 3abb483622..5e2d56923e 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -134,9 +134,9 @@ namespace CalamityMod.Projectiles.Summon { if (target != null && Main.myPlayer == Projectile.owner) { - if (TimerForShooting == 80f) + if (TimerForShooting == 60f) { - Vector2 velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, target, 35f); + Vector2 velocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(Projectile.Center, target, 25f, 4); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; } - if (TimerForShooting < 80f) + if (TimerForShooting < 60f) TimerForShooting++; } } diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index 93d42c501c..ccddc0d234 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -258,7 +258,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[1]++; } //Set the minion to be ready for attack - if (Projectile.ai[1] > 85f) + if (Projectile.ai[1] > 60f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; diff --git a/Projectiles/Summon/CausticStaffProjectile.cs b/Projectiles/Summon/CausticStaffProjectile.cs index 7e7c5355f6..2b6874179d 100644 --- a/Projectiles/Summon/CausticStaffProjectile.cs +++ b/Projectiles/Summon/CausticStaffProjectile.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Summon public class CausticStaffProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public ref float MinionCount => ref Projectile.ai[0]; public override void SetStaticDefaults() { ProjectileID.Sets.MinionShot[Type] = true; @@ -18,68 +19,55 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = Projectile.height = 10; Projectile.friendly = true; Projectile.ignoreWater = true; + Projectile.MaxUpdates = 3; Projectile.penetrate = 3; - Projectile.timeLeft = 360; + Projectile.timeLeft = 45 * Projectile.MaxUpdates; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.extraUpdates = 1; + Projectile.localNPCHitCooldown = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Summon; } public override void AI() { - int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 0, default, 0.5f); - Dust dust = Main.dust[fire]; + Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, GetDust(MinionCount), 0f, 0f, 0, default, 0.5f); dust.velocity *= 0.1f; dust.scale = 1.3f; dust.noGravity = true; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - Projectile.velocity.X *= 0.99f; - if (Projectile.velocity.Y < 9f) - Projectile.velocity.Y += 0.085f; } public override void OnKill(int timeLeft) { for (int i = 0; i < 5; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Torch); + Dust dust = Dust.NewDustPerfect(Projectile.Center, GetDust(MinionCount)); dust.noGravity = true; dust.velocity = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(2f); } } + + public static int GetDust(float type) + { + if (type >= 4f && Main.rand.NextBool(5)) + return DustID.IchorTorch; + if (type >= 3f && Main.rand.NextBool(4)) + return DustID.VenomStaff; + if (type >= 2f && Main.rand.NextBool(3)) + return DustID.CursedTorch; + return DustID.Torch; + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Player player = Main.player[Projectile.owner]; - Item heldItem = player.HeldItem; - if (!CalamityUtils.ShouldTriggerSummonPenalty(player, heldItem)) + target.AddBuff(BuffID.OnFire3, 30); + + if (MinionCount >= 2f) + target.AddBuff(BuffID.CursedInferno, 30); + if (MinionCount >= 3f) + target.AddBuff(BuffID.Venom, 30); + if (MinionCount >= 4f) { - int duration = Main.rand.Next(60, 181); // Anywhere between 1 and 3 seconds - switch ((int)Projectile.ai[0]) - { - case 0: - if (target.Calamity().markedForDeath) - target.AddBuff(ModContent.BuffType(), duration); - break; - case 1: - if (!target.ichor) - target.AddBuff(BuffID.Ichor, duration); - break; - case 2: - if (!target.venom) - target.AddBuff(BuffID.Venom, duration); - break; - case 3: - if (!target.onFire2) - target.AddBuff(BuffID.CursedInferno, duration); - break; - case 4: - if (!target.onFire3) - target.AddBuff(BuffID.OnFire3, duration); - break; - default: - break; - } + target.AddBuff(BuffID.Ichor, 30); + target.AddBuff(ModContent.BuffType(), 30); } } } diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index 501472f410..300d9a1f3c 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -10,7 +10,6 @@ namespace CalamityMod.Projectiles.Summon { public new string LocalizationCategory => "Projectiles.Summon"; public bool initialized = false; - private float debuffToInflict = 0f; public override void SetStaticDefaults() { @@ -227,7 +226,8 @@ namespace CalamityMod.Projectiles.Summon } //Occasionally spawn fiery dust - if (Main.rand.NextBool(6)) + int minionCount = player.ownedProjectileCounts[Type]; + if (Main.rand.NextBool(15)) { int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, new Color(), 2f); Main.dust[fire].velocity *= 0.3f; @@ -245,11 +245,23 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] > 0f) { Projectile.ai[1] += Main.rand.Next(1, 4); - if (Main.rand.NextBool(3)) - ++Projectile.ai[1]; + + // Faster depending on minion count + // Calculated average firing rate: + // 1.23 attacks per second at 1 minion + // 1.67 attacks per second at 2 minions + // 1.9 attacks per second at 3 minions + // 2 attacks per second at 4+ minions + if (minionCount - Main.rand.Next(2) > 0) + Projectile.ai[1]++; + if (minionCount - Main.rand.Next(3) > 0) + Projectile.ai[1]++; + if (minionCount - Main.rand.Next(4) > 0) + Projectile.ai[1]++; } + //Determine if it should shoot - if (Projectile.ai[1] > 90f) + if (Projectile.ai[1] > 150f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; @@ -277,10 +289,7 @@ namespace CalamityMod.Projectiles.Summon float speedMult = 16f; targetVec.Normalize(); targetVec *= speedMult; - int spike = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetVec, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, debuffToInflict, 0f); - debuffToInflict++; - if (debuffToInflict >= 5f) - debuffToInflict = 0f; + int spike = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, targetVec, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, minionCount); Main.projectile[spike].netUpdate = true; Projectile.netUpdate = true; } diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index 408e4982e2..aa69a548bf 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.rareSandElemental && !modPlayer.allElementals && !modPlayer.rareSandElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.oasisElemental && !modPlayer.allElementals && !modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Summon { if (player.dead) { - modPlayer.rareSandEleBuff = false; + modPlayer.oasisEleBuff = false; } - if (modPlayer.rareSandEleBuff) + if (modPlayer.oasisEleBuff) { Projectile.timeLeft = 2; } @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.spriteDirection = -Projectile.direction; } - if (!modPlayer.rareSandElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) { float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; lightScalar *= Main.essScale; @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.localAI[0] += 1f; } - if (Projectile.ai[0] == 0f && !modPlayer.rareSandElementalVanity && !modPlayer.allElementalsVanity) + if (Projectile.ai[0] == 0f && !modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) { int healProj = ModContent.ProjectileType(); if (Projectile.ai[1] == 0f && Projectile.localAI[0] >= 120f) @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.rareSandElementalVanity || modPlayer.allElementalsVanity) + if (modPlayer.oasisElementalVanity || modPlayer.allElementalsVanity) { return false; } diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs index 8ab5c80f30..7412cefad9 100644 --- a/Projectiles/Typeless/DebuffSpreadEffect.cs +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Typeless for (int index = 0; index < npc.buffType.Length; index++) { int type = npc.buffType[index]; - var debuffData = BuffDatasets.DebuffDataset[type]; + var debuffData = CalamityBuffSets.DebuffDataset[type]; // Calculate the Bane damage to see if the debuffs can be transfered int bDamage = Math.Max((int)(Bane.debuffData.EnemyLostRegen * bestDamage), (int)Bane.debuffData.EnemyLostRegen); diff --git a/Projectiles/Typeless/VictideBobber.cs b/Projectiles/Typeless/VictideBobber.cs index 71c2dedb7d..c8584dae10 100644 --- a/Projectiles/Typeless/VictideBobber.cs +++ b/Projectiles/Typeless/VictideBobber.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/Summon/CnidarianJellyfishOnTheString"; + public static int ReelChancePerFrame = 100; + public Player Owner => Main.player[Projectile.owner]; public ref float ParentProjectile => ref Projectile.ai[2]; public Projectile Parent => Main.projectile[(int)ParentProjectile]; @@ -40,7 +42,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { // Automatic reeling - if (Projectile.ai[0] == 0f && Projectile.ai[1] < 0f && Main.rand.NextBool(40)) + if (Projectile.ai[0] == 0f && Projectile.ai[1] < 0f && Main.rand.NextBool(ReelChancePerFrame)) { Projectile.ai[0] = 1f; Projectile.localAI[0] = 1f; diff --git a/Projectiles/Typeless/VictideSpirit.cs b/Projectiles/Typeless/VictideSpirit.cs index 6b64564581..ee52eb2487 100644 --- a/Projectiles/Typeless/VictideSpirit.cs +++ b/Projectiles/Typeless/VictideSpirit.cs @@ -158,6 +158,34 @@ namespace CalamityMod.Projectiles.Typeless else Projectile.velocity.Y *= 0.92f; + // Interrupt movement if burrowing into a solid tile unable to be broken by the player by any means + int LeftRange = Utils.Clamp((int)(Projectile.position.X + Projectile.velocity.X) / 16, 2, Main.maxTilesX - 2); + int RightRange = Utils.Clamp((int)(Projectile.position.X + Projectile.velocity.X) / 16 + 1, 2, Main.maxTilesX - 2); + int TopRange = Utils.Clamp((int)(Projectile.position.Y + Projectile.velocity.Y) / 16, 2, Main.maxTilesY - 2); + int BottomRange = Utils.Clamp((int)(Projectile.position.Y + Projectile.velocity.Y) / 16 + 2, 2, Main.maxTilesY - 2); + bool stop = false; + for (int i = LeftRange; i <= RightRange; i++) + { + if (stop) + break; + + for (int j = TopRange; j <= BottomRange; j++) + { + Tile tile = Main.tile[i, j]; + if (!tile.HasTile || !Main.tileSolid[tile.TileType]) + continue; + + bool breakable = WorldGen.CanKillTile(i, j) && tile.ShouldBeMined(); + if (breakable && Owner.GetBestPickPower() >= tile.GetRequiredPickPower(i, j)) + continue; + + stop = true; + break; + } + } + if (stop) + Projectile.velocity *= 0.1f; + // Rotation is less sudden so that the visuals are smoother -- velocity is not affected so that it also plays natural float idealRotation = (Projectile.velocity.Length() == 0f ? MathHelper.PiOver2 : Projectile.velocity.ToRotation()); if (MathF.Abs(idealRotation - Projectile.rotation) < MathHelper.ToRadians(1f) || MathF.Abs(idealRotation - Projectile.rotation) > MathHelper.ToRadians(90f)) diff --git a/Projectiles/VanillaProjectileOverrides/CounterweightEffects.cs b/Projectiles/VanillaProjectileOverrides/CounterweightEffects.cs new file mode 100644 index 0000000000..0d26e280e9 --- /dev/null +++ b/Projectiles/VanillaProjectileOverrides/CounterweightEffects.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.ILEditing; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Melee.Yoyos; +using MonoMod; +using MonoMod.Cil; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.VanillaProjectileOverrides +{ + public class CounterweightEffects : GlobalProjectile + { + public override bool InstancePerEntity => true; + bool runInitialization = false; + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + //All counterweights fall within this range. + if (entity.type >= ProjectileID.BlackCounterweight && entity.type <= ProjectileID.YellowCounterweight) + return true; + return false; + } + + public override bool PreAI(Projectile projectile) + { + var player = Main.player[projectile.owner]; + int id = player.HeldItem.type; + + if (!runInitialization) + { + if (id == ModContent.ItemType()) + projectile.MaxUpdates++; + runInitialization = true; + } + return true; + } + + public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) + { + var player = Main.player[projectile.owner]; + int id = player.HeldItem.type; + if ( id == ModContent.ItemType()) + target.AddBuff(ModContent.BuffType(), 300); + if (id == ModContent.ItemType()) + { + foreach (var item in Main.ActiveProjectiles) + { + if (item.owner == player.whoAmI && item.ModProjectile is ObliteratorYoyo o) + { + o.DashQueue++; + item.netUpdate = true; + } + } + } + } + } +} diff --git a/Sounds/Custom/GFB/FISH.ogg b/Sounds/Custom/GFB/FISH.ogg new file mode 100644 index 0000000000..448f3e3924 Binary files /dev/null and b/Sounds/Custom/GFB/FISH.ogg differ diff --git a/Sounds/Custom/GFB/YouKnowWhatThatMeans.ogg b/Sounds/Custom/GFB/YouKnowWhatThatMeans.ogg new file mode 100644 index 0000000000..a56c7d5305 Binary files /dev/null and b/Sounds/Custom/GFB/YouKnowWhatThatMeans.ogg differ diff --git a/Sounds/Item/GunShotTiny.ogg b/Sounds/Item/GunShotTiny.ogg new file mode 100644 index 0000000000..f7fc4b89c1 Binary files /dev/null and b/Sounds/Item/GunShotTiny.ogg differ diff --git a/Sounds/Item/MegalodonMissileMax.ogg b/Sounds/Item/MegalodonMissileMax.ogg new file mode 100644 index 0000000000..f9c5f95d43 Binary files /dev/null and b/Sounds/Item/MegalodonMissileMax.ogg differ diff --git a/Sounds/Item/VoidragonCharge.ogg b/Sounds/Item/VoidragonCharge.ogg new file mode 100644 index 0000000000..2482c3cbbe Binary files /dev/null and b/Sounds/Item/VoidragonCharge.ogg differ diff --git a/Sounds/Item/VoidragonLaser.ogg b/Sounds/Item/VoidragonLaser.ogg new file mode 100644 index 0000000000..32fbabd3fd Binary files /dev/null and b/Sounds/Item/VoidragonLaser.ogg differ diff --git a/Sounds/Item/VoidragonStrongStart.ogg b/Sounds/Item/VoidragonStrongStart.ogg new file mode 100644 index 0000000000..e4acc4fbca Binary files /dev/null and b/Sounds/Item/VoidragonStrongStart.ogg differ diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index c2ecc10552..6537b0421c 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using CalamityMod.Buffs; +using CalamityMod.Buffs; using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; @@ -8,6 +7,9 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.DataStructures; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Summon; using ReLogic.Reflection; using Terraria.ID; using Terraria.ModLoader; @@ -18,24 +20,26 @@ namespace CalamityMod.Systems.Collections [ReinitializeDuringResizeArrays] public static class CalamityBuffSets { - public static SetFactory Factory = new SetFactory(BuffLoader.BuffCount, "CalamityMod/BuffID", Search); - public static IdDictionary Search = IdDictionary.Create(); + private static SetFactory Factory = new SetFactory(BuffLoader.BuffCount, "CalamityMod/BuffID", Search); + private static IdDictionary Search = IdDictionary.Create(); /// /// If for a buff type, then that buff will have its duration extended with The Amalgam equipped.
/// Also used to remove buffs when contacting the Whispering Maelstrom in the Get fixed boi seed.
/// Defaults to . ///
- public static bool[] BuffedByAmalgam = Factory.CreateBoolSet(BuffID.ObsidianSkin, BuffID.Regeneration, BuffID.Swiftness, BuffID.Gills, BuffID.Ironskin, BuffID.ManaRegeneration, - BuffID.MagicPower, BuffID.Featherfall, BuffID.Spelunker, BuffID.Invisibility, BuffID.Shine, BuffID.NightOwl, BuffID.Battle, BuffID.Thorns, BuffID.WaterWalking, - BuffID.Archery, BuffID.Hunter, BuffID.Gravitation, BuffID.Tipsy, BuffID.WellFed, BuffID.WellFed2, BuffID.WellFed3, BuffID.Honey, BuffID.WeaponImbueVenom, - BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire, BuffID.WeaponImbueGold, BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, BuffID.WeaponImbueConfetti, - BuffID.WeaponImbuePoison, BuffID.Lucky, BuffID.Mining, BuffID.Heartreach, BuffID.Calm, BuffID.Builder, BuffID.Titan, BuffID.Flipper, BuffID.Summoning, BuffID.Dangersense, - BuffID.AmmoReservation, BuffID.Lifeforce, BuffID.Endurance, BuffID.Rage, BuffID.Inferno, BuffID.Wrath, BuffID.Lovestruck, BuffID.Stinky, BuffID.Fishing, BuffID.Sonar, - BuffID.Crate, BuffID.Warmth, BuffID.SugarRush, BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + public static bool[] BuffedByAmalgam = Factory.CreateNamedSet("BuffedByAmalgam") + .Description("Allows this buff to have its duration extended with The Amalgam equipped. Also used to remove buffs when contacting the Whispering Maelstrom in Get fixed boi.") + .RegisterBoolSet(BuffID.ObsidianSkin, BuffID.Regeneration, BuffID.Swiftness, BuffID.Gills, BuffID.Ironskin, BuffID.ManaRegeneration, BuffID.MagicPower, BuffID.Featherfall, + BuffID.Spelunker, BuffID.Invisibility, BuffID.Shine, BuffID.NightOwl, BuffID.Battle, BuffID.Thorns, BuffID.WaterWalking, BuffID.Archery, BuffID.Hunter, BuffID.Gravitation, + BuffID.Tipsy, BuffID.WellFed, BuffID.WellFed2, BuffID.WellFed3, BuffID.Honey, BuffID.WeaponImbueVenom, BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire, + BuffID.WeaponImbueGold, BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffID.Lucky, BuffID.Mining, + BuffID.Heartreach, BuffID.Calm, BuffID.Builder, BuffID.Titan, BuffID.Flipper, BuffID.Summoning, BuffID.Dangersense, BuffID.AmmoReservation, BuffID.Lifeforce, BuffID.Endurance, + BuffID.Rage, BuffID.Inferno, BuffID.Wrath, BuffID.Lovestruck, BuffID.Stinky, BuffID.Fishing, BuffID.Sonar, BuffID.Crate, BuffID.Warmth, BuffID.SugarRush, + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); @@ -45,53 +49,142 @@ namespace CalamityMod.Systems.Collections /// Used by The Amalgam to prevent removing their persistence when the accessory is unequipped.
/// Defaults to . /// - public static bool[] IsPersistentBuff = Factory.CreateBoolSet(BuffID.WeaponImbueVenom, BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire, BuffID.WeaponImbueGold, - BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); + public static bool[] IsPersistentBuff = Factory.CreateNamedSet("IsPersistentBuff") + .Description("Prevents persistent buffs from having their persistence removed by The Amalgam when it is unequipped.") + .RegisterBoolSet(BuffID.WeaponImbueVenom, BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire, BuffID.WeaponImbueGold, BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, + BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); /// /// If for a buff type, then that buff is considered to be a debuff.
- /// This general-purpose set has several different uses, including reducing buff duration with Radiance, Crown Jewel and its upgrades' debuff effects, and removing debuffs with Cleansing Jelly and its upgrades' auras.
+ /// This general-purpose set has several different uses, including Crown Jewel and its upgrades' debuff effects, and removing debuffs with Cleansing Jelly and its upgrades' auras.
/// Defaults to . ///
- public static bool[] IsDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak, - BuffID.Silenced, BuffID.BrokenArmor, BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor, - BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, BuffID.ShadowFlame, - BuffID.OgreSpit, BuffID.BetsysCurse, BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType()); + public static bool[] IsDebuff = Factory.CreateNamedSet("IsDebuff") + .Description("General-purpose set with several different uses, including Crown Jewel line regen, removal via Cleansing Jelly line aura, etc.") + .RegisterBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak, BuffID.Silenced, BuffID.BrokenArmor, + BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor, BuffID.Venom, BuffID.Blackout, BuffID.Electrified, + BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, BuffID.ShadowFlame, BuffID.OgreSpit, BuffID.BetsysCurse, + BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); /// /// If for a buff type, then that buff is a whip tag buff on the player.
/// Used to prevent "whip stacking", the ability to grant the player multiple whip buff effects at once.
/// Defaults to . ///
- public static bool[] IsSummonTagBuff = Factory.CreateBoolSet(BuffID.CoolWhipPlayerBuff, BuffID.ScytheWhipPlayerBuff, BuffID.SwordWhipPlayerBuff, BuffID.ThornWhipPlayerBuff, BuffType()); + public static bool[] IsSummonTagBuff = Factory.CreateNamedSet("IsSummonTagBuff") + .Description("Whip tag buffs for the player, used to prevent whip stacking.") + .RegisterBoolSet(BuffID.CoolWhipPlayerBuff, BuffID.ScytheWhipPlayerBuff, BuffID.SwordWhipPlayerBuff, BuffID.ThornWhipPlayerBuff, BuffType()); /// /// Associates a buff type with its structure. If a buff type is not a key in this dictionary, then it has no associated .
/// Used for several different effects, such as applying tag effects to NPCs, preventing "whip stacking" on NPCs, and drawing the tag effect icon below the NPC. ///
- public static Dictionary SummonTagDebuff = new Dictionary + public static SummonTag[] SummonTagDebuff = Factory.CreateNamedSet("SummonTagDebuff") + .Description("Associates a buff type with its SummonTag structure. Used for several different effects, such as applying tag effects to NPCs, preventing whip stacking on NPCs, and drawing the tag effect icon below the NPC.") + .RegisterCustomSet(null, + BuffID.BlandWhipEnemyDebuff, SummonTag.LeatherWhip, + BuffID.BoneWhipNPCDebuff, SummonTag.SpinalTap, + BuffID.CoolWhipNPCDebuff, SummonTag.CoolWhip, + BuffID.FlameWhipEnemyDebuff, SummonTag.Firecracker, + BuffID.MaceWhipNPCDebuff, SummonTag.MorningStar, + BuffID.RainbowWhipNPCDebuff, SummonTag.Kaleidoscope, + BuffID.ScytheWhipEnemyDebuff, SummonTag.DarkHarvest, + BuffID.SwordWhipNPCDebuff, SummonTag.Durendal , + BuffID.ThornWhipNPCDebuff, SummonTag.Snapthorn, + BuffType(), Cnidarian.summonTag, + BuffType(), ForbiddenCirclet.summonTag, + BuffType(), ProfanedSoulCrystal.SummonTag, + BuffType(), VoidConcentrationStaff.summonTag + ); + + private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level }; + public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData") + .Description("Stores DebuffData for a particular debuff") + .RegisterCustomSet(null, + BuffID.OnFire, DebuffData.OnFire, + BuffID.OnFire3, DebuffData.Hellfire, + BuffID.CursedInferno, DebuffData.CursedInferno, + BuffID.ShadowFlame, DebuffData.Shadowflame, + BuffID.Daybreak, DebuffData.Daybroken, + BuffID.Burning, DebuffData.Burning, + BuffID.Frostburn, DebuffData.Frostburn, + BuffID.Frostburn2, DebuffData.Frostbite, + BuffID.Poisoned, DebuffData.Poisoned, + BuffID.Venom, DebuffData.AcidVenom, + BuffID.Electrified, DebuffData.Electrified, + BuffID.Oiled, DebuffData.Oiled, + + BuffID.Tipsy, Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + BuffType(), Alch(1), + + BuffType(), Alch(2), + BuffType(), Alch(3) + ); + public static int GetBuffIDFromAlcoholType(AlcoholType type) { - { BuffID.BlandWhipEnemyDebuff, SummonTag.LeatherWhip }, - { BuffID.BoneWhipNPCDebuff, SummonTag.SpinalTap }, - { BuffID.CoolWhipNPCDebuff, SummonTag.CoolWhip }, - { BuffID.FlameWhipEnemyDebuff, SummonTag.Firecracker }, - { BuffID.MaceWhipNPCDebuff, SummonTag.MorningStar }, - { BuffID.RainbowWhipNPCDebuff, SummonTag.Kaleidoscope }, - { BuffID.ScytheWhipEnemyDebuff, SummonTag.DarkHarvest }, - { BuffID.SwordWhipNPCDebuff, SummonTag.Durendal }, - { BuffID.ThornWhipNPCDebuff, SummonTag.Snapthorn }, - { BuffType(), ProfanedSoulCrystal.SummonTag } - }; + return type switch + { + AlcoholType.BaconOil => BuffType(), + AlcoholType.BloodyMary => BuffType(), + AlcoholType.CaribbeanRum => BuffType(), + AlcoholType.CinnamonRoll => BuffType(), + AlcoholType.Everclear => BuffType(), + AlcoholType.EvergreenGin => BuffType(), + AlcoholType.Fireball => BuffType(), + AlcoholType.GrapeBeer => BuffType(), + AlcoholType.Manhattan => BuffType(), + AlcoholType.Margarita => BuffType(), + AlcoholType.Moonshine => BuffType(), + AlcoholType.MoscowMule => BuffType(), + AlcoholType.OldFashioned => BuffType(), + AlcoholType.PurpleHaze => BuffType(), + AlcoholType.RedWine => BuffType(), + AlcoholType.Rum => BuffType(), + AlcoholType.Screwdriver => BuffType(), + AlcoholType.StarBeamRye => BuffType(), + AlcoholType.Tequila => BuffType(), + AlcoholType.TequilaSunrise => BuffType(), + AlcoholType.Vodka => BuffType(), + AlcoholType.Whiskey => BuffType(), + AlcoholType.WhiteWine => BuffType(), + + // Vanilla treats both Ale and Sake as the "Tipsy" buff + AlcoholType.Ale => BuffID.Tipsy, + AlcoholType.Sake => BuffID.Tipsy, + + _ => -1 + }; + } } } diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 9c4ee5d57d..5ed9321848 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -2,22 +2,12 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Fishing.FishingRods; -using CalamityMod.Items.LoreItems; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; -using CalamityMod.Items.Placeables.Furniture.BossRelics; -using CalamityMod.Items.Placeables.Furniture.Monoliths; -using CalamityMod.Items.Placeables.Furniture.Paintings; -using CalamityMod.Items.Placeables.Furniture.Trophies; -using CalamityMod.Items.Potions; using CalamityMod.Items.Tools; -using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.DraedonsArsenal; 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 ReLogic.Reflection; using Terraria; using Terraria.ID; @@ -29,72 +19,77 @@ namespace CalamityMod.Systems.Collections [ReinitializeDuringResizeArrays] public static class CalamityItemSets { - public static SetFactory Factory = new SetFactory(ItemLoader.ItemCount, "CalamityMod/ItemID", Search); - public static IdDictionary Search = IdDictionary.Create(); + private static SetFactory Factory = new SetFactory(ItemLoader.ItemCount, "CalamityMod/ItemID", Search); + private static IdDictionary Search = IdDictionary.Create(); /// /// If for an item type, prevents an item from removing Calamity's summon damage penalty mechanic despite having tool power.
/// Defaults to . ///
- public static bool[] WeaponWithToolPowerAffectedBySummonPenalty = Factory.CreateBoolSet(ItemID.ButchersChainsaw, ItemID.LucyTheAxe, ItemID.Rockfish, - ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + public static bool[] WeaponWithToolPowerAffectedBySummonPenalty = Factory.CreateNamedSet("WeaponWithToolPowerAffectedBySummonPenalty") + .Description("Makes items with tool power still trigger the summon damage penalty.") + .RegisterBoolSet(ItemID.ButchersChainsaw, ItemID.LucyTheAxe, ItemID.Rockfish, ItemType(), ItemType(), ItemType(), + ItemType(), ItemType()); /// /// If for an item type, manually disables Calamity's summon damage penalty mechanic while that item type is held.
/// Unused by Calamity itself, and is only used for external mods to add to through mod calls.
/// Defaults to . ///
- public static bool[] ItemWhichDisablesSummonerNerf = Factory.CreateBoolSet(); + public static bool[] ItemWhichDisablesSummonerNerf = Factory.CreateNamedSet("ItemWhichDisablesSummonerNerf") + .Description("Makes holding this item manually disable the summon damage penalty.") + .RegisterBoolSet(); /// /// If for an item type, holding the item sets to true, preventing fishing lines from breaking.
/// Should only be set on fishing poles.
/// Defaults to . ///
- public static bool[] FishingPoleThatNeverBreaks = Factory.CreateBoolSet(ItemID.GoldenFishingRod, ItemType(), ItemType()); - - /// - /// If for an item type, forces a dropped item of this type to remain within the bounds of the world if it is spawned outside of it.
- /// Set this for items which are dropped by enemies or bosses which spawn on the edges of the world.
- /// Defaults to . - ///
- public static bool[] ItemForcedInsideWorld = Factory.CreateBoolSet(ItemID.FishronWings, ItemID.Flairon, ItemID.Tsunami, ItemID.BubbleGun, ItemID.RazorbladeTyphoon, - ItemID.TempestStaff, ItemID.FishronBossBag, ItemID.GreaterHealingPotion, ItemID.SoulofFlight, ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + public static bool[] FishingPoleThatNeverBreaks = Factory.CreateNamedSet("FishingPoleThatNeverBreaks") + .Description("Makes holding this item set Player.accFishingLine, preventing fishing lines from breaking.") + .RegisterBoolSet(ItemID.GoldenFishingRod, ItemType(), ItemType()); /// /// If for an item type, prevents this rogue weapon from triggering Venerated Locket's clone projectile effect when used.
/// Primarily used for weapons which shoot short-distance projectiles.
/// Defaults to . ///
- public static bool[] DisablesVeneratedLocketEffect = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType()); + public static bool[] DisablesVeneratedLocketEffect = Factory.CreateNamedSet("DisablesVeneratedLocketEffect") + .Description("Prevents this item from triggering Venerated Locket's clone projectiles.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType()); /// /// If for an item type, this item is considered to be a magic gun.
/// Used for applying Calamity's reworked Meteor armor set bonus.
/// Defaults to . ///
- public static bool[] MagicGun = Factory.CreateBoolSet(ItemID.BeeGun, ItemID.BubbleGun, ItemID.ChargedBlasterCannon, ItemID.HeatRay, ItemID.LaserMachinegun, ItemID.LaserRifle, - ItemID.LeafBlower, ItemID.RainbowGun, ItemID.SpaceGun, ItemID.WaspGun, ItemID.ZapinatorGray, ItemID.ZapinatorOrange, ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + public static bool[] MagicGun = Factory.CreateNamedSet("MagicGun") + .Description("Labels this item as a magic gun, for Meteor armor's set bonus.") + .RegisterBoolSet(ItemID.BeeGun, ItemID.BubbleGun, ItemID.ChargedBlasterCannon, ItemID.HeatRay, ItemID.LaserMachinegun, ItemID.LaserRifle, ItemID.LeafBlower, ItemID.RainbowGun, + ItemID.SpaceGun, ItemID.WaspGun, ItemID.ZapinatorGray, ItemID.ZapinatorOrange, ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + + /// + /// If for an item type, this item is guaranteed to critically strike and converts critical strike chance boosts into extra damage.
+ /// Used to replace the item's critical strike chance tooltip line with one about critical damage.
+ /// Defaults to . + ///
+ public static bool[] ShowScalingCritDamageTooltip = Factory.CreateNamedSet("ShowScalingCritDamageTooltip") + .Description("Replaces the item's critical strike chance tooltip line with a line about critical damage.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType()); /// /// If for an item type, this item is considered to be a rogue bomb.
/// Currently unused, and exists as an objective classification for the sake of the Wiki.
/// Defaults to . ///
- public static bool[] RogueBomb = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + public static bool[] RogueBomb = Factory.CreateNamedSet("RogueBomb") + .Description("Labels this item as a rogue bomb, only exists for objective classification.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); /// @@ -102,9 +97,11 @@ namespace CalamityMod.Systems.Collections /// Currently unused, and exists as an objective classification for the sake of the Wiki.
/// Defaults to . ///
- public static bool[] RogueBoomerang = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + public static bool[] RogueBoomerang = Factory.CreateNamedSet("RogueBoomerang") + .Description("Labels this item as a rogue boomerang, only exists for objective classification.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); /// @@ -112,9 +109,11 @@ namespace CalamityMod.Systems.Collections /// Currently unused, and exists as an objective classification for the sake of the Wiki.
/// Defaults to . ///
- public static bool[] RogueDagger = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + public static bool[] RogueDagger = Factory.CreateNamedSet("RogueDagger") + .Description("Labels this item as a rogue dagger, only exists for objective classification.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); @@ -124,10 +123,11 @@ namespace CalamityMod.Systems.Collections /// Currently unused, and exists as an objective classification for the sake of the Wiki.
/// Defaults to . /// - public static bool[] RogueJavelin = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), - ItemType()); + public static bool[] RogueJavelin = Factory.CreateNamedSet("RogueJavelin") + .Description("Labels this item as a rogue javelin, only exists for objective classification.") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); /// /// If for an item type, this item is considered to be a rogue spiky ball.
diff --git a/Systems/Collections/CalamityNPCSets.cs b/Systems/Collections/CalamityNPCSets.cs index 43746c5ce6..502d723b75 100644 --- a/Systems/Collections/CalamityNPCSets.cs +++ b/Systems/Collections/CalamityNPCSets.cs @@ -48,64 +48,79 @@ namespace CalamityMod.Systems.Collections [ReinitializeDuringResizeArrays] public static class CalamityNPCSets { - public static SetFactory Factory = new SetFactory(NPCLoader.NPCCount, "CalamityMod/NPCID", Search); - public static IdDictionary Search = IdDictionary.Create(); + private static SetFactory Factory = new SetFactory(NPCLoader.NPCCount, "CalamityMod/NPCID", Search); + private static IdDictionary Search = IdDictionary.Create(); /// /// If for an NPC type, makes this NPC be susceptible to .
/// Defaults to . ///
- public static bool[] CalamityNPCNotImmuneToConfused = Factory.CreateBoolSet(NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType()); + public static bool[] CalamityNPCNotImmuneToConfused = Factory.CreateNamedSet("CalamityNPCNotImmuneToConfused") + .Description("Makes this NPC be susceptible to Confused.") + .RegisterBoolSet(NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType()); /// /// If for an NPC type, forces this NPC to draw Calamity's debuff display, even if it is not a boss.
/// Defaults to . ///
- public static bool[] ForceDrawDebuffDisplay = Factory.CreateBoolSet(NPCID.TargetDummy, NPCID.WallofFleshEye, NPCType()); + public static bool[] ForceDrawDebuffDisplay = Factory.CreateNamedSet("ForceDrawDebuffDisplay") + .Description("Allows drawing Calamity's debuff display, even if not a boss.") + .RegisterBoolSet(NPCID.TargetDummy, NPCID.WallofFleshEye, NPCType()); + + /// + /// If for an NPC type, then that NPC is a bound Town NPC.
+ /// Used to make them immune to enemy damage.
+ /// Defaults to . + ///
+ public static bool[] BoundTownNPC = Factory.CreateNamedSet("BoundTownNPC") + .Description("Labels this NPC as a bound town NPC, to prevent them from taking hostile damage.") + .RegisterBoolSet(NPCID.BoundGoblin, NPCID.BoundWizard, NPCID.BoundMechanic, NPCID.SleepingAngler, NPCID.BartenderUnconscious, NPCID.WebbedStylist, NPCID.GolferRescue); /// /// If for an NPC type, then that NPC will not provide increased Rage generation despite being considered a boss.
/// Primarily used by worm boss body and tail segments to prevent Rage being extraordinarily easy to get.
/// Defaults to . ///
- public static bool[] BossSegmentThatDoesNotGenerateRageFaster = Factory.CreateBoolSet(NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType()); + public static bool[] BossSegmentThatDoesNotGenerateRageFaster = Factory.CreateNamedSet("BossSegmentThatDoesNotGenerateRageFaster") + .Description("Prevent this boss NPC from generating Rage faster.") + .RegisterBoolSet(NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType()); /// /// If for an NPC type, allows the NPC to scale its health based on the Boss Health Boost Percentage config option, even if it is not a boss.
/// Also allows the NPC to receive health scaling from having multiple players in Expert+.
/// Defaults to . ///
- public static bool[] ScalesHealthLikeBoss = Factory.CreateBoolSet(NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.SkeletronHand, - NPCID.WallofFleshEye, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.PrimeCannon, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.PrimeSaw, NPCID.GolemHead, - NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.Sharkron, NPCID.Sharkron2, NPCID.MoonLordHead, NPCID.MoonLordHand, NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType()); + public static bool[] ScalesHealthLikeBoss = Factory.CreateNamedSet("ScalesHealthLikeBoss") + .Description("Allows scaling health from vanilla Expert+ multiplayer scaling and Boss Health Boost Percentage config, even if not a boss.") + .RegisterBoolSet(NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.SkeletronHand, NPCID.WallofFleshEye, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, + NPCID.PrimeCannon, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.PrimeSaw, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.Sharkron, + NPCID.Sharkron2, NPCID.MoonLordHead, NPCID.MoonLordHand, NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType()); /// /// If for an NPC type, then that NPC will have its contact damage set to 0.
/// Defaults to . ///
- public static bool[] DealsZeroContactDamage = Factory.CreateBoolSet(NPCID.AngryNimbus, NPCID.DarkCaster, NPCID.FireImp, NPCID.Tim, NPCID.DesertDjinn, NPCID.DiabolistRed, NPCID.DiabolistWhite, + public static bool[] DealsZeroContactDamage = Factory.CreateNamedSet("DealsZeroContactDamage") + .Description("Makes this NPC deal 0 contact damage.") + .RegisterBoolSet(NPCID.AngryNimbus, NPCID.DarkCaster, NPCID.FireImp, NPCID.Tim, NPCID.DesertDjinn, NPCID.DiabolistRed, NPCID.DiabolistWhite, NPCID.Necromancer, NPCID.NecromancerArmored, NPCID.RaggedCaster, NPCID.RaggedCasterOpenCoat, NPCID.RuneWizard, NPCID.GoblinSorcerer, NPCID.GoblinSummoner, NPCID.NebulaBrain, NPCID.PirateShipCannon, NPCID.MartianSaucer, NPCID.MartianSaucerCannon, NPCID.MartianSaucerCore, NPCID.MartianSaucerTurret, NPCID.Probe, NPCID.CultistBoss, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.MoonLordFreeEye, NPCID.BloodSquid, NPCID.PlanterasHook, NPCID.MourningWood, NPCID.Pumpking, NPCID.Everscream, NPCID.IceQueen, NPCID.SantaNK1, NPCID.AncientDoom); @@ -114,20 +129,22 @@ namespace CalamityMod.Systems.Collections /// If for an NPC type, then that NPC will have its damage reduced by 25% if the world is in Hardmode.
/// Defaults to . ///
- public static bool[] NerfDamageInHardmode = Factory.CreateBoolSet(NPCID.AnglerFish, NPCID.AngryTrapper, NPCID.Arapaima, NPCID.BlackRecluse, NPCID.BlackRecluseWall, - NPCID.BloodJelly, NPCID.FungoFish, NPCID.GreenJellyfish, NPCID.Clinger, NPCID.ArmoredSkeleton, NPCID.ArmoredViking, NPCID.Mummy, NPCID.DarkMummy, NPCID.LightMummy, - NPCID.BloodFeeder, NPCID.DesertBeast, NPCID.ChaosElemental, NPCID.BloodMummy, NPCID.CorruptSlime, NPCID.Corruptor, NPCID.Crimslime, NPCID.CrimsonAxe, NPCID.CursedHammer, - NPCID.Derpling, NPCID.Herpling, NPCID.DiggerHead, NPCID.DesertGhoul, NPCID.DesertGhoulCorruption, NPCID.DesertGhoulCrimson, NPCID.DesertGhoulHallow, NPCID.DuneSplicerHead, - NPCID.EnchantedSword, NPCID.FloatyGross, NPCID.GiantBat, NPCID.GiantFlyingFox, NPCID.FungiSpore, NPCID.GiantTortoise, NPCID.IceTortoise, NPCID.HoppinJack, NPCID.Mimic, - NPCID.IlluminantBat, NPCID.IlluminantSlime, NPCID.JungleCreeper, NPCID.JungleCreeperWall, NPCID.DesertLamiaDark, NPCID.DesertLamiaLight, NPCID.MossHornet, NPCID.Moth, - NPCID.PigronCorruption, NPCID.PigronCrimson, NPCID.PigronHallow, NPCID.Pixie, NPCID.PossessedArmor, NPCID.RockGolem, NPCID.DesertScorpionWalk, NPCID.DesertScorpionWall, - NPCID.Slimer, NPCID.ToxicSludge, NPCID.Unicorn, NPCID.WanderingEye, NPCID.Werewolf, NPCID.Wolf, NPCID.SeekerHead, NPCID.Wraith, NPCID.ChatteringTeethBomb, NPCID.IceGolem, - NPCID.RainbowSlime, NPCID.SandShark, NPCID.SandsharkCorrupt, NPCID.SandsharkCrimson, NPCID.SandsharkHallow, NPCID.ShadowFlameApparition, NPCID.Parrot, NPCID.PirateCorsair, - NPCID.PirateDeckhand, NPCID.PirateGhost, NPCID.BlueArmoredBonesMace, NPCID.BlueArmoredBonesSword, NPCID.BoneLee, NPCID.DungeonSpirit, NPCID.FlyingSnake, NPCID.HellArmoredBones, - NPCID.HellArmoredBonesSpikeShield, NPCID.HellArmoredBonesSword, NPCID.MisterStabby, NPCID.Butcher, NPCID.CreatureFromTheDeep, NPCID.DeadlySphere, NPCID.Frankenstein, - NPCID.Fritz, NPCID.Psycho, NPCID.Reaper, NPCID.SwampThing, NPCID.ThePossessed, NPCID.Vampire, NPCID.VampireBat, NPCID.HeadlessHorseman, NPCID.Hellhound, NPCID.Poltergeist, - NPCID.Scarecrow1, NPCID.Scarecrow2, NPCID.Scarecrow3, NPCID.Scarecrow4, NPCID.Scarecrow5, NPCID.Scarecrow6, NPCID.Scarecrow7, NPCID.Scarecrow8, NPCID.Scarecrow9, NPCID.Scarecrow10, - NPCID.Splinterling, NPCID.Flocko, NPCID.GingerbreadMan, NPCID.Krampus, NPCID.Nutcracker, NPCID.NutcrackerSpinning, NPCID.PresentMimic, NPCID.Yeti, NPCID.ZombieElf, NPCID.ZombieElfBeard, + public static bool[] NerfDamageInHardmode = Factory.CreateNamedSet("NerfDamageInHardmode") + .Description("Makes this NPC have its contact damage reduced by 25% if the world is in Hardmode.") + .RegisterBoolSet(NPCID.AnglerFish, NPCID.AngryTrapper, NPCID.Arapaima, NPCID.BlackRecluse, NPCID.BlackRecluseWall, NPCID.BloodJelly, NPCID.FungoFish, NPCID.GreenJellyfish, + NPCID.Clinger, NPCID.ArmoredSkeleton, NPCID.ArmoredViking, NPCID.Mummy, NPCID.DarkMummy, NPCID.LightMummy, NPCID.BloodFeeder, NPCID.DesertBeast, NPCID.ChaosElemental, + NPCID.BloodMummy, NPCID.CorruptSlime, NPCID.Corruptor, NPCID.Crimslime, NPCID.CrimsonAxe, NPCID.CursedHammer, NPCID.Derpling, NPCID.Herpling, NPCID.DiggerHead, + NPCID.DesertGhoul, NPCID.DesertGhoulCorruption, NPCID.DesertGhoulCrimson, NPCID.DesertGhoulHallow, NPCID.DuneSplicerHead, NPCID.EnchantedSword, NPCID.FloatyGross, + NPCID.GiantBat, NPCID.GiantFlyingFox, NPCID.FungiSpore, NPCID.GiantTortoise, NPCID.IceTortoise, NPCID.HoppinJack, NPCID.Mimic, NPCID.IlluminantBat, NPCID.IlluminantSlime, + NPCID.JungleCreeper, NPCID.JungleCreeperWall, NPCID.DesertLamiaDark, NPCID.DesertLamiaLight, NPCID.MossHornet, NPCID.Moth, NPCID.PigronCorruption, NPCID.PigronCrimson, + NPCID.PigronHallow, NPCID.Pixie, NPCID.PossessedArmor, NPCID.RockGolem, NPCID.DesertScorpionWalk, NPCID.DesertScorpionWall, NPCID.Slimer, NPCID.ToxicSludge, NPCID.Unicorn, + NPCID.WanderingEye, NPCID.Werewolf, NPCID.Wolf, NPCID.SeekerHead, NPCID.Wraith, NPCID.ChatteringTeethBomb, NPCID.IceGolem, NPCID.RainbowSlime, NPCID.SandShark, + NPCID.SandsharkCorrupt, NPCID.SandsharkCrimson, NPCID.SandsharkHallow, NPCID.ShadowFlameApparition, NPCID.Parrot, NPCID.PirateCorsair, NPCID.PirateDeckhand, NPCID.PirateGhost, + NPCID.BlueArmoredBonesMace, NPCID.BlueArmoredBonesSword, NPCID.BoneLee, NPCID.DungeonSpirit, NPCID.FlyingSnake, NPCID.HellArmoredBones, NPCID.HellArmoredBonesSpikeShield, + NPCID.HellArmoredBonesSword, NPCID.MisterStabby, NPCID.Butcher, NPCID.CreatureFromTheDeep, NPCID.DeadlySphere, NPCID.Frankenstein, NPCID.Fritz, NPCID.Psycho, NPCID.Reaper, + NPCID.SwampThing, NPCID.ThePossessed, NPCID.Vampire, NPCID.VampireBat, NPCID.HeadlessHorseman, NPCID.Hellhound, NPCID.Poltergeist, NPCID.Scarecrow1, NPCID.Scarecrow2, + NPCID.Scarecrow3, NPCID.Scarecrow4, NPCID.Scarecrow5, NPCID.Scarecrow6, NPCID.Scarecrow7, NPCID.Scarecrow8, NPCID.Scarecrow9, NPCID.Scarecrow10, NPCID.Splinterling, + NPCID.Flocko, NPCID.GingerbreadMan, NPCID.Krampus, NPCID.Nutcracker, NPCID.NutcrackerSpinning, NPCID.PresentMimic, NPCID.Yeti, NPCID.ZombieElf, NPCID.ZombieElfBeard, NPCID.ZombieElfGirl, NPCID.BloodEelHead, NPCID.GoblinShark, NPCID.EyeballFlyingFish, NPCID.ZombieMerman); /// @@ -136,52 +153,59 @@ namespace CalamityMod.Systems.Collections /// Second, it multiplies their max health by 2.5x and increases their damage by a flat 30 if Moon Lord has been defeated.
/// Defaults to . ///
- public static bool[] IsBuffedDungeonEnemy = Factory.CreateBoolSet(NPCID.SkeletonSniper, NPCID.TacticalSkeleton, NPCID.SkeletonCommando, NPCID.Paladin, NPCID.GiantCursedSkull, - NPCID.BoneLee, NPCID.DiabolistWhite, NPCID.DiabolistRed, NPCID.NecromancerArmored, NPCID.Necromancer, NPCID.RaggedCasterOpenCoat, NPCID.RaggedCaster, - NPCID.HellArmoredBonesSword, NPCID.HellArmoredBonesMace, NPCID.HellArmoredBonesSpikeShield, NPCID.HellArmoredBones, NPCID.BlueArmoredBonesSword, NPCID.BlueArmoredBonesNoPants, - NPCID.BlueArmoredBonesMace, NPCID.BlueArmoredBones, NPCID.RustyArmoredBonesSwordNoArmor, NPCID.RustyArmoredBonesSword, NPCID.RustyArmoredBonesFlail, NPCID.RustyArmoredBonesAxe); + public static bool[] IsBuffedDungeonEnemy = Factory.CreateNamedSet("IsBuffedDungeonEnemy") + .Description("Makes this NPC directly drop Ectoplasm on death, and buffs its health and damage after defeating Moon Lord.") + .RegisterBoolSet(NPCID.SkeletonSniper, NPCID.TacticalSkeleton, NPCID.SkeletonCommando, NPCID.Paladin, NPCID.GiantCursedSkull, NPCID.BoneLee, NPCID.DiabolistWhite, + NPCID.DiabolistRed, NPCID.NecromancerArmored, NPCID.Necromancer, NPCID.RaggedCasterOpenCoat, NPCID.RaggedCaster, NPCID.HellArmoredBonesSword, NPCID.HellArmoredBonesMace, + NPCID.HellArmoredBonesSpikeShield, NPCID.HellArmoredBones, NPCID.BlueArmoredBonesSword, NPCID.BlueArmoredBonesNoPants, NPCID.BlueArmoredBonesMace, NPCID.BlueArmoredBones, + NPCID.RustyArmoredBonesSwordNoArmor, NPCID.RustyArmoredBonesSword, NPCID.RustyArmoredBonesFlail, NPCID.RustyArmoredBonesAxe); /// /// If for an NPC type, then that NPC is spawned in the Pumpkin Moon.
/// This will multiply their max health by 3.5x and increase their damage by a flat 30 if Devourer of Gods has been defeated.
/// Defaults to . ///
- public static bool[] IsBuffedPumpkinMoonEnemy = Factory.CreateBoolSet(NPCID.Scarecrow1, NPCID.Scarecrow2, NPCID.Scarecrow3, NPCID.Scarecrow4, NPCID.Scarecrow5, NPCID.Scarecrow6, - NPCID.Scarecrow7, NPCID.Scarecrow8, NPCID.Scarecrow9, NPCID.Scarecrow10, NPCID.HeadlessHorseman, NPCID.MourningWood, NPCID.Splinterling, NPCID.Pumpking, - NPCID.PumpkingBlade, NPCID.Hellhound, NPCID.Poltergeist); + public static bool[] IsBuffedPumpkinMoonEnemy = Factory.CreateNamedSet("IsBuffedPumpkinMoonEnemy") + .Description("Makes this Pumpkin Moon enemy have buffed health and damage after defeating Devourer of Gods.") + .RegisterBoolSet(NPCID.Scarecrow1, NPCID.Scarecrow2, NPCID.Scarecrow3, NPCID.Scarecrow4, NPCID.Scarecrow5, NPCID.Scarecrow6, NPCID.Scarecrow7, NPCID.Scarecrow8, NPCID.Scarecrow9, + NPCID.Scarecrow10, NPCID.HeadlessHorseman, NPCID.MourningWood, NPCID.Splinterling, NPCID.Pumpking, NPCID.PumpkingBlade, NPCID.Hellhound, NPCID.Poltergeist); /// /// If for an NPC type, then that NPC is spawned in the Frost Moon.
/// This will multiply their max health by 2.5x and increase their damage by a flat 30 if Devourer of Gods has been defeated.
/// Defaults to . ///
- public static bool[] IsBuffedFrostMoonEnemy = Factory.CreateBoolSet(NPCID.ZombieElf, NPCID.ZombieElfBeard, NPCID.ZombieElfGirl, NPCID.PresentMimic, NPCID.GingerbreadMan, - NPCID.Yeti, NPCID.Everscream, NPCID.IceQueen, NPCID.SantaNK1, NPCID.ElfCopter, NPCID.Nutcracker, NPCID.NutcrackerSpinning, NPCID.ElfArcher, NPCID.Krampus, NPCID.Flocko); + public static bool[] IsBuffedFrostMoonEnemy = Factory.CreateNamedSet("IsBuffedFrostMoonEnemy") + .Description("Makes this Frost Moon enemy have buffed health and damage after defeating Devourer of Gods.") + .RegisterBoolSet(NPCID.ZombieElf, NPCID.ZombieElfBeard, NPCID.ZombieElfGirl, NPCID.PresentMimic, NPCID.GingerbreadMan, NPCID.Yeti, NPCID.Everscream, NPCID.IceQueen, + NPCID.SantaNK1, NPCID.ElfCopter, NPCID.Nutcracker, NPCID.NutcrackerSpinning, NPCID.ElfArcher, NPCID.Krampus, NPCID.Flocko); /// /// If for an NPC type, then that NPC is spawned in the Solar Eclipse.
/// This will multiply their max health by 5x and increase their damage by a flat 30 if Devourer of Gods has been defeated.
/// Defaults to . ///
- public static bool[] IsBuffedSolarEclipseEnemy = Factory.CreateBoolSet(NPCID.Eyezor, NPCID.Reaper, NPCID.Frankenstein, NPCID.SwampThing, NPCID.Vampire, NPCID.VampireBat, - NPCID.Butcher, NPCID.CreatureFromTheDeep, NPCID.Fritz, NPCID.Nailhead, NPCID.Psycho, NPCID.DeadlySphere, NPCID.DrManFly, NPCID.ThePossessed, NPCID.Mothron, - NPCID.MothronEgg, NPCID.MothronSpawn); + public static bool[] IsBuffedSolarEclipseEnemy = Factory.CreateNamedSet("IsBuffedSolarEclipseEnemy") + .Description("Makes this Solar Eclipse enemy have buffed health and damage after defeating Devourer of Gods.") + .RegisterBoolSet(NPCID.Eyezor, NPCID.Reaper, NPCID.Frankenstein, NPCID.SwampThing, NPCID.Vampire, NPCID.VampireBat, NPCID.Butcher, NPCID.CreatureFromTheDeep, NPCID.Fritz, + NPCID.Nailhead, NPCID.Psycho, NPCID.DeadlySphere, NPCID.DrManFly, NPCID.ThePossessed, NPCID.Mothron, NPCID.MothronEgg, NPCID.MothronSpawn); /// /// If for an NPC type, then the NPC will not be affected by slowing debuffs.
/// Also used to prevent weapon pulling effects and Anarchy Blade's ability to instantly kill enemies that are below 50% health.
/// Defaults to . ///
- public static bool[] ImmuneToSlowsAndOtherSpecialEffects = Factory.CreateBoolSet(NPCID.KingSlime, NPCType(), - NPCID.EyeofCthulhu, NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.BrainofCthulhu, NPCID.Creeper, - NPCID.QueenBee, NPCID.Deerclops, NPCID.SkeletronHead, NPCID.SkeletronHand, NPCID.WallofFlesh, NPCID.WallofFleshEye, NPCID.PirateShipCannon, NPCID.QueenSlimeBoss, - NPCID.Probe, NPCID.Retinazer, NPCID.Spazmatism, NPCID.SkeletronPrime, NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.Plantera, - NPCID.PlanterasTentacle, NPCType(), NPCID.Everscream, NPCID.SantaNK1, NPCID.IceQueen, NPCID.MourningWood, NPCID.Pumpking, NPCID.Mothron, - NPCID.Golem, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.MartianSaucerCore, NPCID.MartianSaucerCannon, NPCID.MartianSaucerTurret, - NPCID.DukeFishron, NPCID.Sharkron, NPCID.Sharkron2, NPCID.HallowBoss, NPCID.CultistBoss, NPCID.CultistDragonHead, NPCID.CultistDragonBody1, NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, NPCID.CultistDragonBody4, NPCID.CultistDragonTail, NPCID.AncientCultistSquidhead, NPCID.MoonLordHead, NPCID.MoonLordHand, NPCID.MoonLordCore, - NPCID.MoonLordFreeEye, NPCID.DD2WyvernT1, NPCID.DD2WyvernT2, NPCID.DD2WyvernT3, NPCID.DD2DarkMageT1, NPCID.DD2DarkMageT3, NPCID.DD2SkeletonT1, NPCID.DD2SkeletonT3, - NPCID.DD2WitherBeastT2, NPCID.DD2WitherBeastT3, NPCID.DD2DrakinT2, NPCID.DD2DrakinT3, NPCID.DD2KoboldWalkerT2, NPCID.DD2KoboldWalkerT3, NPCID.DD2KoboldFlyerT2, + public static bool[] ImmuneToSlowsAndOtherSpecialEffects = Factory.CreateNamedSet("ImmuneToSlowsAndOtherSpecialEffects") + .Description("Makes this NPC immune to slowing debuffs and specific weapon effects.") + .RegisterBoolSet(NPCID.KingSlime, NPCType(), NPCID.EyeofCthulhu, NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, + NPCID.BrainofCthulhu, NPCID.Creeper, NPCID.QueenBee, NPCID.Deerclops, NPCID.SkeletronHead, NPCID.SkeletronHand, NPCID.WallofFlesh, NPCID.WallofFleshEye, + NPCID.PirateShipCannon, NPCID.QueenSlimeBoss, NPCID.Probe, NPCID.Retinazer, NPCID.Spazmatism, NPCID.SkeletronPrime, NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, + NPCID.PrimeVice, NPCID.Plantera, NPCID.PlanterasTentacle, NPCType(), NPCID.Everscream, NPCID.SantaNK1, NPCID.IceQueen, NPCID.MourningWood, + NPCID.Pumpking, NPCID.Mothron, NPCID.Golem, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.MartianSaucerCore, NPCID.MartianSaucerCannon, + NPCID.MartianSaucerTurret, NPCID.DukeFishron, NPCID.Sharkron, NPCID.Sharkron2, NPCID.HallowBoss, NPCID.CultistBoss, NPCID.CultistDragonHead, NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, NPCID.CultistDragonBody3, NPCID.CultistDragonBody4, NPCID.CultistDragonTail, NPCID.AncientCultistSquidhead, NPCID.MoonLordHead, NPCID.MoonLordHand, + NPCID.MoonLordCore, NPCID.MoonLordFreeEye, NPCID.DD2WyvernT1, NPCID.DD2WyvernT2, NPCID.DD2WyvernT3, NPCID.DD2DarkMageT1, NPCID.DD2DarkMageT3, NPCID.DD2SkeletonT1, + NPCID.DD2SkeletonT3, NPCID.DD2WitherBeastT2, NPCID.DD2WitherBeastT3, NPCID.DD2DrakinT2, NPCID.DD2DrakinT3, NPCID.DD2KoboldWalkerT2, NPCID.DD2KoboldWalkerT3, NPCID.DD2KoboldFlyerT2, NPCID.DD2KoboldFlyerT3, NPCID.DD2OgreT2, NPCID.DD2OgreT3, NPCID.DD2Betsy, NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), @@ -197,13 +221,17 @@ namespace CalamityMod.Systems.Collections /// /// If for an NPC type, or will be called on this NPC even if is set. /// - public static bool[] DoCheckDeadRegardlessRealLife = Factory.CreateBoolSet(NPCType(), NPCType()); + public static bool[] DoCheckDeadRegardlessRealLife = Factory.CreateNamedSet("DoCheckDeadRegardlessRealLife") + .Description("Makes this NPC always call CheckDead, even if it sets realLife.") + .RegisterBoolSet(NPCType(), NPCType()); /// /// If for an NPC type, will not count this NPC as an enemy.
/// Defaults to . ///
- public static bool[] DontCountAsEnemy = Factory.CreateBoolSet(NPCID.TargetDummy, NPCType()); + public static bool[] DontCountAsEnemy = Factory.CreateNamedSet("DontCountAsEnemy") + .Description("Prevents Calamity's IsAnEnemy method from considering this NPC an enemy.") + .RegisterBoolSet(NPCID.TargetDummy, NPCType()); /// /// Associates an NPC type with the base value of their max health in Boss Rush.
diff --git a/Systems/Collections/CalamityNPCTypeSets.cs b/Systems/Collections/CalamityNPCTypeSets.cs index 3985e71ee1..5d8e4a555b 100644 --- a/Systems/Collections/CalamityNPCTypeSets.cs +++ b/Systems/Collections/CalamityNPCTypeSets.cs @@ -20,23 +20,20 @@ namespace CalamityMod.Systems.Collections [ReinitializeDuringResizeArrays] public static class CalamityNPCTypeSets { - public static SetFactory Factory = new SetFactory(NPCLoader.NPCCount, "CalamityMod/NPCType", Search); - public static IdDictionary Search = IdDictionary.Create(); - - public static bool[] AngryBones = Factory.CreateBoolSet(NPCID.AngryBones, NPCID.AngryBonesBig, NPCID.AngryBonesBigMuscle, NPCID.AngryBonesBigHelmet); - - public static bool[] BoundTownNPC = Factory.CreateBoolSet(NPCID.BoundGoblin, NPCID.BoundWizard, NPCID.BoundMechanic, NPCID.SleepingAngler, NPCID.BartenderUnconscious, - NPCID.WebbedStylist, NPCID.GolferRescue); - - public static bool[] Hornet = Factory.CreateBoolSet(NPCID.Hornet, NPCID.HornetFatty, NPCID.HornetHoney, NPCID.HornetLeafy, NPCID.HornetSpikey, NPCID.HornetStingy); + private static SetFactory Factory = new SetFactory(NPCLoader.NPCCount, "CalamityMod/NPCType", Search); + private static IdDictionary Search = IdDictionary.Create(); // Used for dropping Ancient Bone Dust, vanilla has a Skeleton NPCID set which has more unwanted enemies in it - public static bool[] Skeleton = Factory.CreateBoolSet(NPCID.Skeleton, NPCID.HeadacheSkeleton, NPCID.MisassembledSkeleton, NPCID.PantlessSkeleton, NPCID.BoneThrowingSkeleton, - NPCID.BoneThrowingSkeleton2, NPCID.BoneThrowingSkeleton3, NPCID.BoneThrowingSkeleton4, NPCID.SkeletonTopHat, NPCID.SkeletonAstonaut, NPCID.SkeletonAlien, - NPCID.ArmoredSkeleton, NPCID.SkeletonArcher, NPCID.GreekSkeleton, NPCID.SporeSkeleton); + public static bool[] Skeleton = Factory.CreateNamedSet("Skeleton") + .Description("Contains different IDs from vanilla's Skeleton set. Used for dropping Ancient Bone Dust.") + .RegisterBoolSet(NPCID.Skeleton, NPCID.HeadacheSkeleton, NPCID.MisassembledSkeleton, NPCID.PantlessSkeleton, NPCID.BoneThrowingSkeleton, NPCID.BoneThrowingSkeleton2, + NPCID.BoneThrowingSkeleton3, NPCID.BoneThrowingSkeleton4, NPCID.SkeletonTopHat, NPCID.SkeletonAstonaut, NPCID.SkeletonAlien, NPCID.ArmoredSkeleton, NPCID.SkeletonArcher, + NPCID.GreekSkeleton, NPCID.SporeSkeleton); // Unused, though is more restrictive than the vanilla Zombie NPCID set - public static bool[] Zombie = Factory.CreateBoolSet(NPCID.Zombie, NPCID.ArmedZombie, NPCID.BaldZombie, NPCID.PincushionZombie, NPCID.ArmedZombiePincussion, NPCID.SlimedZombie, + public static bool[] Zombie = Factory.CreateNamedSet("Zombie") + .Description("Contains different IDs from vanilla's Zombie set. Unused.") + .RegisterBoolSet(NPCID.Zombie, NPCID.ArmedZombie, NPCID.BaldZombie, NPCID.PincushionZombie, NPCID.ArmedZombiePincussion, NPCID.SlimedZombie, NPCID.ArmedZombieSlimed, NPCID.SwampZombie, NPCID.ArmedZombieSwamp, NPCID.TwiggyZombie, NPCID.ArmedZombieTwiggy, NPCID.FemaleZombie, NPCID.ArmedZombieCenx, NPCID.ZombieRaincoat, NPCID.ZombieEskimo, NPCID.ArmedZombieEskimo, NPCID.MaggotZombie, NPCType()); diff --git a/Systems/Collections/CalamityProjectileSets.cs b/Systems/Collections/CalamityProjectileSets.cs index 4ced4a300a..761ef5f3bb 100644 --- a/Systems/Collections/CalamityProjectileSets.cs +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -14,40 +14,47 @@ namespace CalamityMod.Systems.Collections [ReinitializeDuringResizeArrays] public static class CalamityProjectileSets { - public static SetFactory Factory = new SetFactory(ProjectileLoader.ProjectileCount, "CalamityMod/ProjectileID", Search); - public static IdDictionary Search = IdDictionary.Create(); + private static SetFactory Factory = new SetFactory(ProjectileLoader.ProjectileCount, "CalamityMod/ProjectileID", Search); + private static IdDictionary Search = IdDictionary.Create(); /// /// If for a projectile type, then that minion will completely ignore Calamity's summon damage penalty mechanic with no exceptions.
/// Unused by Calamity itself, and is only used for external mods to add to through mod calls.
/// Defaults to . ///
- public static bool[] MinionWhichIgnoresSummonerNerf = Factory.CreateBoolSet(); + public static bool[] MinionWhichIgnoresSummonerNerf = Factory.CreateNamedSet("MinionWhichIgnoresSummonerNerf") + .Description("Makes this minion ignore the summon damage penalty.") + .RegisterBoolSet(); /// /// If for a projectile type, then that projectile is spawned by a post-Plantera Dungeon enemy.
/// This increases the projectile's damage by a flat 30 if Moon Lord has been defeated.
/// Defaults to . ///
- public static bool[] IsBuffedDungeonProjectile = Factory.CreateBoolSet(ProjectileID.PaladinsHammerHostile, ProjectileID.ShadowBeamHostile, ProjectileID.InfernoHostileBolt, - ProjectileID.InfernoHostileBlast, ProjectileID.LostSoulHostile, ProjectileID.SniperBullet, ProjectileID.RocketSkeleton, ProjectileID.BulletDeadeye, ProjectileID.Shadowflames); + public static bool[] IsBuffedDungeonProjectile = Factory.CreateNamedSet("IsBuffedDungeonProjectile") + .Description("Makes this Dungeon projectile get a damage buff after defeating Moon Lord.") + .RegisterBoolSet(ProjectileID.PaladinsHammerHostile, ProjectileID.ShadowBeamHostile, ProjectileID.InfernoHostileBolt, ProjectileID.InfernoHostileBlast, + ProjectileID.LostSoulHostile, ProjectileID.SniperBullet, ProjectileID.RocketSkeleton, ProjectileID.BulletDeadeye, ProjectileID.Shadowflames); /// /// If for a projectile type, then that projectile is spawned by a Solar Eclipse, Pumpkin Moon, or Frost Moon enemy.
/// This increases the projectile's damage by a flat 15 during those events if Devourer of Gods has been defeated.
/// Defaults to . ///
- public static bool[] IsBuffedEventProjectile = Factory.CreateBoolSet(ProjectileID.FlamingWood, ProjectileID.GreekFire1, ProjectileID.GreekFire2, ProjectileID.GreekFire3, - ProjectileID.FlamingScythe, ProjectileID.FlamingArrow, ProjectileID.PineNeedleHostile, ProjectileID.OrnamentHostile, ProjectileID.OrnamentHostileShrapnel, - ProjectileID.FrostWave, ProjectileID.FrostShard, ProjectileID.Missile, ProjectileID.Present, ProjectileID.Spike, ProjectileID.BulletDeadeye, ProjectileID.EyeLaser, - ProjectileID.Nail, ProjectileID.DrManFlyFlask); + public static bool[] IsBuffedEventProjectile = Factory.CreateNamedSet("IsBuffedEventProjectile") + .Description("Makes this Pumpkin Moon, Frost Moon, or Solar Eclipse projectile get a damage buff after defeating Devourer of Gods.") + .RegisterBoolSet(ProjectileID.FlamingWood, ProjectileID.GreekFire1, ProjectileID.GreekFire2, ProjectileID.GreekFire3, ProjectileID.FlamingScythe, ProjectileID.FlamingArrow, + ProjectileID.PineNeedleHostile, ProjectileID.OrnamentHostile, ProjectileID.OrnamentHostileShrapnel, ProjectileID.FrostWave, ProjectileID.FrostShard, ProjectileID.Missile, + ProjectileID.Present, ProjectileID.Spike, ProjectileID.BulletDeadeye, ProjectileID.EyeLaser, ProjectileID.Nail, ProjectileID.DrManFlyFlask); /// /// If for a projectile type, then that projectile is considered a friendly bee.
/// Used to allow the projectile to inflict Plague while wearing the Plaguebringer armor.
/// Defaults to . ///
- public static bool[] IsFriendlyBeeProjectile = Factory.CreateBoolSet(ProjectileID.GiantBee, ProjectileID.Bee, ProjectileID.Wasp, ProjectileID.Hornet,ProjectileID.HornetStinger, ProjectileType(), + public static bool[] IsFriendlyBeeProjectile = Factory.CreateNamedSet("IsFriendlyBeeProjectile") + .Description("Labels this projectile as a friendly bee, used to make it inflict Plague with Plaguebringer armor.") + .RegisterBoolSet(ProjectileID.GiantBee, ProjectileID.Bee, ProjectileID.Wasp, ProjectileID.Hornet,ProjectileID.HornetStinger, ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType()); /// @@ -55,9 +62,11 @@ namespace CalamityMod.Systems.Collections /// Used to provide early-game worm bosses a resistance to their explosive damage.
/// Defaults to . ///
- public static bool[] ResistedExplosiveProjectile = Factory.CreateBoolSet(ProjectileID.Grenade, ProjectileID.StickyGrenade, ProjectileID.BouncyGrenade, ProjectileID.Bomb, - ProjectileID.StickyBomb, ProjectileID.BouncyBomb, ProjectileID.Dynamite, ProjectileID.StickyDynamite, ProjectileID.BouncyDynamite, ProjectileID.Explosives, - ProjectileID.ExplosiveBunny, ProjectileID.PartyGirlGrenade, ProjectileID.BombFish, ProjectileID.ScarabBomb, ProjectileID.TNTBarrel, ProjectileType()); + public static bool[] ResistedExplosiveProjectile = Factory.CreateNamedSet("ResistedExplosiveProjectile") + .Description("Makes this grenade/bomb/dynamite projectile be resisted by earlygame worm bosses.") + .RegisterBoolSet(ProjectileID.Grenade, ProjectileID.StickyGrenade, ProjectileID.BouncyGrenade, ProjectileID.Bomb, ProjectileID.StickyBomb, ProjectileID.BouncyBomb, + ProjectileID.Dynamite, ProjectileID.StickyDynamite, ProjectileID.BouncyDynamite, ProjectileID.Explosives, ProjectileID.ExplosiveBunny, ProjectileID.PartyGirlGrenade, + ProjectileID.BombFish, ProjectileID.ScarabBomb, ProjectileID.TNTBarrel, ProjectileType()); /// /// If for a projectile type, then that projectile will never be reflected by armor or accessory effects.
@@ -65,28 +74,38 @@ namespace CalamityMod.Systems.Collections /// Only needs to be set for hostile projectiles, as these effects already have a check to ensure they never trigger in PvP.
/// Defaults to . ///
- public static bool[] ShouldNotBeReflected = Factory.CreateBoolSet(ProjectileID.SaucerDeathray, ProjectileID.PhantasmalDeathray, ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType()); + public static bool[] ShouldNotBeReflected = Factory.CreateNamedSet("ShouldNotBeReflected") + .Description("Prevents this projectile from being reflected by armor or accessory effects.") + .RegisterBoolSet(ProjectileID.SaucerDeathray, ProjectileID.PhantasmalDeathray, ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType()); /// /// If for a projectile type, then that projectile will be blacklisted from receiving the homing effect of Grape Beer.
/// Defaults to . ///
- public static bool[] DoesNotGetHomingWithGrapeBeer = Factory.CreateBoolSet(ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType()); - + public static bool[] DoesNotGetHomingWithGrapeBeer = Factory.CreateNamedSet("DoesNotGetHomingWithGrapeBeer") + .Description("Prevents this projectile from receiving homing from Grape Beer.") + .RegisterBoolSet(ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType()); + /// + /// If for a projectile type, then that projectile will be unable to trigger Daawnlight Spirit Origin's bullseyes.
+ /// Defaults to . + ///
public static bool[] DaawnlightBlacklist = Factory.CreateNamedSet("DaawnlightBlacklist") - .Description("Disables a projectile from increasing Daawnlight Spirit Origin's extra crit") + .Description("Prevents this projectile from triggering Daawnlight Spirit Origin's bullseyes.") .RegisterBoolSet(ProjectileType(), ProjectileType(), ProjectileType()); /// /// Determines what other projectiles this projectile will share ID-static immunity frames with. Defaults to -1, which means that it does not share immunity frames.
/// Each "set" of projectile which shares immunity frames is registered to point to the same ID reference, usually the first projectile in the set. If a projectile with this reference hits an NPC, all other projectiles with that reference also have their ID-static immunity cooldown set for that NPC. ///
- public static int[] SharedIDStaticIFrames = Factory.CreateIntSet(-1, + public static int[] SharedIDStaticIFrames = Factory.CreateNamedSet("SharedIDStaticIFrames") + .Description("Determines what other projectiles this projectile will share ID-static immunity frames with. Defaults to -1, which means that it does not share immunity frames.") + .RegisterIntSet(-1, // Vanilla bees ProjectileID.Bee, ProjectileID.Bee, ProjectileID.GiantBee, ProjectileID.Bee, diff --git a/Systems/Collections/CalamityTileSets.cs b/Systems/Collections/CalamityTileSets.cs index 2000210565..45d1e37afc 100644 --- a/Systems/Collections/CalamityTileSets.cs +++ b/Systems/Collections/CalamityTileSets.cs @@ -11,26 +11,34 @@ namespace CalamityMod.Systems.Collections [ReinitializeDuringResizeArrays] public static class CalamityTileSets { - public static SetFactory Factory = new SetFactory(TileLoader.TileCount, "CalamityMod/TileID", Search); - public static IdDictionary Search = IdDictionary.Create(); + private static SetFactory Factory = new SetFactory(TileLoader.TileCount, "CalamityMod/TileID", Search); + private static IdDictionary Search = IdDictionary.Create(); /// /// Should only contain modded tiles. If for a tile type, then that tile can be replaced by the Abyss during world generation.
- /// Unused by Calamity itself, and is only used for external mods to add to through reflection.
+ /// Unused by Calamity itself, and is only used for external mods.
/// Defaults to . ///
- public static bool[] CanBeReplacedByAbyssGeneration = Factory.CreateBoolSet(); + internal static bool[] CanBeReplacedByAbyssGeneration = Factory.CreateNamedSet("CanBeReplacedByAbyssGeneration") + .Description("Allows the tile to be replaced by the Abyss during world generation.") + .RegisterBoolSet(); /// /// If for a tile type, it will not perform its BlendMerge in the PostDraw hook, and instead will be drawn after every solid tile has been drawn to the screen.
/// Defaults to . ///
- public static bool[] DrawBlendMergeAfterSolidTile = Factory.CreateBoolSet(TileType()); + internal static bool[] DrawBlendMergeAfterSolidTile = Factory.CreateNamedSet("DrawBlendMergeAfterSolidTile") + .Description("Causes this tile to have blending be drawn after all solid tiles.") + .RegisterBoolSet(TileType()); /// - /// If for a tile type, it will be considered an Abyss background wall for various effects. - /// Defaults to + /// If for a tile type, it will be considered an Abyss background wall.
+ /// Used for spawning water when breaking Abyss tiles, discouraging Teleportation Potion teleporting, and spawning Primordial Wyrm when using Potion of Return.
+ /// Defaults to . ///
- public static bool[] IsAbyssWall = Factory.CreateBoolSet(WallType(), WallType(), WallType(), WallType(), WallType(), WallType()); + internal static bool[] IsAbyssWall = Factory.CreateNamedSet("IsAbyssWall") + .Description("Labels this wall as an Abyss wall.") + .RegisterBoolSet(WallType(), WallType(), WallType(), WallType(), + WallType(), WallType()); } } diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 78c5a9789f..27f2b46595 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -739,6 +739,7 @@ namespace CalamityMod.Systems { { Vanilla(ItemID.MiniNukeI), Disable }, { Vanilla(ItemID.MiniNukeII), Disable }, + { Vanilla(ItemID.ReconScope), Disable }, // Make various things cheaper (sorted by progression) { Vanilla(ItemID.Leather), ChangeIngredientStack(ItemID.RottenChunk, 2) }, @@ -1725,6 +1726,13 @@ namespace CalamityMod.Systems r.Register(); r.DisableDecraft(); + // Tiershift Recon Scope to post Plantera. + r = Recipe.Create(ItemID.ReconScope); + r.AddIngredient(ItemID.RifleScope); + r.AddIngredient(ItemID.PutridScent); + r.AddTile(TileID.TinkerersWorkbench); + r.Register(); + // Tiershift Mini Nuke 1s to post Moon Lord. r = Recipe.Create(ItemID.MiniNukeI, 333); r.AddIngredient(ItemID.RocketIII, 333); diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index 0ccd7c76dc..75bebd255b 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -418,6 +418,12 @@ namespace CalamityMod.Systems SulphurousSea.SulphurSeaGenerationAfterAbyss(); })); + tasks.Insert(++currentFinalIndex, new PassLegacy("Iron Ball", (progress, config) => + { + progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.IronBall").Value; + MiscWorldgenRoutines.GenerateIronBall(); + })); + // No Traps/GFB Auric Land Mines if (Main.noTrapsWorld) { diff --git a/TileEntities/TEHostileFireTurret.cs b/TileEntities/TEHostileFireTurret.cs index 33ae21e7c2..18813caf5c 100644 --- a/TileEntities/TEHostileFireTurret.cs +++ b/TileEntities/TEHostileFireTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileIceTurret.cs b/TileEntities/TEHostileIceTurret.cs index d1ebcd8a6d..64fbd80707 100644 --- a/TileEntities/TEHostileIceTurret.cs +++ b/TileEntities/TEHostileIceTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileLabTurret.cs b/TileEntities/TEHostileLabTurret.cs index d74b9474a4..b1e8dbd9f4 100644 --- a/TileEntities/TEHostileLabTurret.cs +++ b/TileEntities/TEHostileLabTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileLaserTurret.cs b/TileEntities/TEHostileLaserTurret.cs index f34b471781..732524ac75 100644 --- a/TileEntities/TEHostileLaserTurret.cs +++ b/TileEntities/TEHostileLaserTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileOnyxTurret.cs b/TileEntities/TEHostileOnyxTurret.cs index 78a7fd87e9..a3467c083d 100644 --- a/TileEntities/TEHostileOnyxTurret.cs +++ b/TileEntities/TEHostileOnyxTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostilePlagueTurret.cs b/TileEntities/TEHostilePlagueTurret.cs index 05cca39c47..0a74b7f4df 100644 --- a/TileEntities/TEHostilePlagueTurret.cs +++ b/TileEntities/TEHostilePlagueTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEHostileWaterTurret.cs b/TileEntities/TEHostileWaterTurret.cs index 2b2f0a8923..ba768e59ff 100644 --- a/TileEntities/TEHostileWaterTurret.cs +++ b/TileEntities/TEHostileWaterTurret.cs @@ -66,8 +66,8 @@ namespace CalamityMod.TileEntities { Player p = Main.player[PlayerTargetIndex]; - // If they don't exist, or are dead, then unmark them as a target and search for a new one. - if (!p.active || p.dead) + // If they don't exist, are dead, or are using an invis pot then unmark them as a target and search for a new one. + if (!p.active || p.dead || p.invis) indexToSet = -1; else { @@ -87,7 +87,7 @@ namespace CalamityMod.TileEntities foreach (Player p in Main.ActivePlayers) { - if (p.dead) + if (p.dead || p.invis) continue; float distSQ = p.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerFireTurret.cs b/TileEntities/TEPlayerFireTurret.cs index 10feeedd45..e87a6910ff 100644 --- a/TileEntities/TEPlayerFireTurret.cs +++ b/TileEntities/TEPlayerFireTurret.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -90,7 +91,7 @@ namespace CalamityMod.TileEntities foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerIceTurret.cs b/TileEntities/TEPlayerIceTurret.cs index 2678aa9196..9d943ab40e 100644 --- a/TileEntities/TEPlayerIceTurret.cs +++ b/TileEntities/TEPlayerIceTurret.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -90,7 +91,7 @@ namespace CalamityMod.TileEntities foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerLabTurret.cs b/TileEntities/TEPlayerLabTurret.cs index 4e0bb773f1..310497ba0f 100644 --- a/TileEntities/TEPlayerLabTurret.cs +++ b/TileEntities/TEPlayerLabTurret.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -90,7 +91,7 @@ namespace CalamityMod.TileEntities foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerLaserTurret .cs b/TileEntities/TEPlayerLaserTurret .cs index e7f7655804..6b95c1ae71 100644 --- a/TileEntities/TEPlayerLaserTurret .cs +++ b/TileEntities/TEPlayerLaserTurret .cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -90,7 +91,7 @@ namespace CalamityMod.TileEntities foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerOnyxTurret.cs b/TileEntities/TEPlayerOnyxTurret.cs index 7cbcd7ae3a..fb0a2707e5 100644 --- a/TileEntities/TEPlayerOnyxTurret.cs +++ b/TileEntities/TEPlayerOnyxTurret.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -90,7 +91,7 @@ namespace CalamityMod.TileEntities foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerPlagueTurret.cs b/TileEntities/TEPlayerPlagueTurret.cs index 7836915e60..37da61016a 100644 --- a/TileEntities/TEPlayerPlagueTurret.cs +++ b/TileEntities/TEPlayerPlagueTurret.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -71,7 +72,7 @@ namespace CalamityMod.TileEntities //This turret can switch targets at any time foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/TileEntities/TEPlayerWaterTurret.cs b/TileEntities/TEPlayerWaterTurret.cs index 3e389b070b..44c232290f 100644 --- a/TileEntities/TEPlayerWaterTurret.cs +++ b/TileEntities/TEPlayerWaterTurret.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Turret; using CalamityMod.Tiles.PlayerTurrets; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.TileEntities @@ -90,7 +91,7 @@ namespace CalamityMod.TileEntities foreach (NPC npc in Main.ActiveNPCs) { - if (npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter || NPCID.Sets.CountsAsCritter[npc.type]) continue; float distSQ = npc.DistanceSQ(targetingCenter); diff --git a/Tiles/Furniture/BlueCandle.cs b/Tiles/Furniture/BlueCandle.cs index 9475eadbcd..416eb1ea39 100644 --- a/Tiles/Furniture/BlueCandle.cs +++ b/Tiles/Furniture/BlueCandle.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Tiles.Furniture frameCounter++; if (frameCounter >= 6) { - frame = (frame + 1) % 5; + frame = (frame + 1) % 10; frameCounter = 0; } } diff --git a/Tiles/Furniture/BlueCandle.png b/Tiles/Furniture/BlueCandle.png index 5fe20f8f8b..0e1b6c7678 100644 Binary files a/Tiles/Furniture/BlueCandle.png and b/Tiles/Furniture/BlueCandle.png differ diff --git a/Tiles/Furniture/BlueCandle_Highlight.png b/Tiles/Furniture/BlueCandle_Highlight.png index 02427f1b60..9d1cc638ea 100644 Binary files a/Tiles/Furniture/BlueCandle_Highlight.png and b/Tiles/Furniture/BlueCandle_Highlight.png differ diff --git a/Tiles/Furniture/CorruptionEffigy.png b/Tiles/Furniture/CorruptionEffigy.png index 4389f81731..665d755fd0 100644 Binary files a/Tiles/Furniture/CorruptionEffigy.png and b/Tiles/Furniture/CorruptionEffigy.png differ diff --git a/Tiles/Furniture/CorruptionEffigy_Highlight.png b/Tiles/Furniture/CorruptionEffigy_Highlight.png index 00449db10a..bd91211397 100644 Binary files a/Tiles/Furniture/CorruptionEffigy_Highlight.png and b/Tiles/Furniture/CorruptionEffigy_Highlight.png differ diff --git a/Tiles/Furniture/GluttonyBlender.cs b/Tiles/Furniture/GluttonyBlender.cs index d3b7f5c828..286f731e27 100644 --- a/Tiles/Furniture/GluttonyBlender.cs +++ b/Tiles/Furniture/GluttonyBlender.cs @@ -44,8 +44,8 @@ namespace CalamityMod.Tiles.Furniture public override void MouseOver(int i, int j) { Player p = Main.LocalPlayer; - // You shouldn't be able to put the slop back into the blender - if (BuffID.Sets.IsWellFed[p.HeldItem.buffType] && p.HeldItem.type != ModContent.ItemType()) + // You shouldn't be able to put the slop or something better than it back into the blender + if (BuffID.Sets.IsWellFed[p.HeldItem.buffType] && !(p.HeldItem.buffType == BuffID.WellFed3 && p.HeldItem.buffTime >= CalamityUtils.MinutesToFrames(30))) { p.noThrow = 2; p.cursorItemIconEnabled = true; @@ -134,12 +134,12 @@ namespace CalamityMod.Tiles.Furniture { // Exit early if anyone of the following are true: // * Running on client that is not the local player - // * The item is not a food, is not consumable, or is Quality Slop (you cannot feed the slop back into the blender) + // * The item is not a food, is not consumable, or is Quality Slop/better than Quality Slop (you cannot feed the slop back into the blender) // * The Gluttony Blender tile entity doesn't exist for some reason // * The player isn't within the tile's interaction range if (Main.LocalPlayer.whoAmI != player.whoAmI) return true; - if (!BuffID.Sets.IsWellFed[item.buffType] || !item.consumable || item.type == ModContent.ItemType()) + if (!BuffID.Sets.IsWellFed[item.buffType] || !item.consumable || (item.buffType == BuffID.WellFed3 && item.buffTime >= CalamityUtils.MinutesToFrames(30))) return true; Point mouseTile = Main.MouseWorld.ToTileCoordinates(); @@ -232,7 +232,11 @@ namespace CalamityMod.Tiles.Furniture if (Projectile.timeLeft == 1) { - int itemDrop = Main.rand.NextBool(GluttonyBlender.OneInXChanceForGoodSlop) ? ModContent.ItemType() : ModContent.ItemType(); + Item dummy = new Item(); + dummy.SetDefaults(ItemType); + int goodPercent = (int)(dummy.buffTime * (dummy.buffType == BuffID.WellFed3 ? 2f : dummy.buffType == BuffID.WellFed2 ? 1.5f : 1f) / 3600); + + int itemDrop = Main.rand.Next(100) < goodPercent ? ModContent.ItemType() : ModContent.ItemType(); int i = Item.NewItem(Projectile.GetItemSource_DropAsItem(), Projectile.Center, itemDrop); Main.item[i].GetGlobalItem().FromGluttonyBlender = true; } diff --git a/Tiles/Furniture/PinkCandle.cs b/Tiles/Furniture/PinkCandle.cs index f2b8f483c8..5c356fc82e 100644 --- a/Tiles/Furniture/PinkCandle.cs +++ b/Tiles/Furniture/PinkCandle.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Tiles.Furniture frameCounter++; if (frameCounter >= 6) { - frame = (frame + 1) % 5; + frame = (frame + 1) % 10; frameCounter = 0; } } diff --git a/Tiles/Furniture/PinkCandle.png b/Tiles/Furniture/PinkCandle.png index e22cef9737..7a3873cfc3 100644 Binary files a/Tiles/Furniture/PinkCandle.png and b/Tiles/Furniture/PinkCandle.png differ diff --git a/Tiles/Furniture/PinkCandle_Highlight.png b/Tiles/Furniture/PinkCandle_Highlight.png index 02427f1b60..9d1cc638ea 100644 Binary files a/Tiles/Furniture/PinkCandle_Highlight.png and b/Tiles/Furniture/PinkCandle_Highlight.png differ diff --git a/Tiles/Furniture/PurpleCandle.cs b/Tiles/Furniture/PurpleCandle.cs index dd2a5e9886..d9dba7ab79 100644 --- a/Tiles/Furniture/PurpleCandle.cs +++ b/Tiles/Furniture/PurpleCandle.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Tiles.Furniture frameCounter++; if (frameCounter >= 6) { - frame = (frame + 1) % 5; + frame = (frame + 1) % 10; frameCounter = 0; } } diff --git a/Tiles/Furniture/PurpleCandle.png b/Tiles/Furniture/PurpleCandle.png index 41e2f749a3..0b4b460a3b 100644 Binary files a/Tiles/Furniture/PurpleCandle.png and b/Tiles/Furniture/PurpleCandle.png differ diff --git a/Tiles/Furniture/PurpleCandle_Highlight.png b/Tiles/Furniture/PurpleCandle_Highlight.png index 02427f1b60..9d1cc638ea 100644 Binary files a/Tiles/Furniture/PurpleCandle_Highlight.png and b/Tiles/Furniture/PurpleCandle_Highlight.png differ diff --git a/Tiles/Furniture/YellowCandle.cs b/Tiles/Furniture/YellowCandle.cs index d9780550bc..e43f389700 100644 --- a/Tiles/Furniture/YellowCandle.cs +++ b/Tiles/Furniture/YellowCandle.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Tiles.Furniture frameCounter++; if (frameCounter >= 6) { - frame = (frame + 1) % 5; + frame = (frame + 1) % 10; frameCounter = 0; } } diff --git a/Tiles/Furniture/YellowCandle.png b/Tiles/Furniture/YellowCandle.png index 74f2a263aa..1ccebda4e8 100644 Binary files a/Tiles/Furniture/YellowCandle.png and b/Tiles/Furniture/YellowCandle.png differ diff --git a/Tiles/Furniture/YellowCandle_Highlight.png b/Tiles/Furniture/YellowCandle_Highlight.png index 02427f1b60..9d1cc638ea 100644 Binary files a/Tiles/Furniture/YellowCandle_Highlight.png and b/Tiles/Furniture/YellowCandle_Highlight.png differ diff --git a/Tiles/FurnitureAuric/AuricToiletTile.cs b/Tiles/FurnitureAuric/AuricToiletTile.cs index ab4dd204e9..194b950492 100644 --- a/Tiles/FurnitureAuric/AuricToiletTile.cs +++ b/Tiles/FurnitureAuric/AuricToiletTile.cs @@ -1,7 +1,11 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.FurnitureAuric; +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -11,6 +15,7 @@ namespace CalamityMod.Tiles.FurnitureAuric { public class AuricToiletTile : ModTile { + public const int NextStyleHeight = 40; public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; @@ -36,11 +41,38 @@ namespace CalamityMod.Tiles.FurnitureAuric // Toilets count as chairs AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); - + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; TileID.Sets.DisableSmartCursor[Type] = true; AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); AdjTiles = new int[] { TileID.Chairs }; } + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => FurnitureCommon.ChairSitInfo(i, j, ref info, NextStyleHeight, true, shitter: true); + + public override bool RightClick(int i, int j) => FurnitureCommon.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => FurnitureCommon.ChairMouseOver(i, j, ModContent.ItemType(), true); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - (tile.TileFrameY % NextStyleHeight) / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/GreedPotTile.cs b/Tiles/GreedPotTile.cs index 59e4550dea..8a58ad248d 100644 --- a/Tiles/GreedPotTile.cs +++ b/Tiles/GreedPotTile.cs @@ -2,9 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; -using System.Text; -using System.Threading.Tasks; using CalamityMod.DataStructures; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Particles; @@ -75,10 +72,16 @@ namespace CalamityMod.Tiles { Tile tile = Main.tile[x, y]; + if (!tile.HasTile || tile.TileType != ModContent.TileType()) + return false; + int style = 0, alt = 0; TileObjectData.GetTileInfo(tile, ref style, ref alt); TileObjectData data = TileObjectData.GetTileData(tile.TileType, style, alt); + if (data == null) + return false; + int sheetSquare = 16 + data.CoordinatePadding; int FrameX = tile.TileFrameX / sheetSquare % data.Width; int FrameY = tile.TileFrameY / sheetSquare % data.Height; diff --git a/Tiles/IronBallPlaced.cs b/Tiles/IronBallPlaced.cs new file mode 100644 index 0000000000..be04d56908 --- /dev/null +++ b/Tiles/IronBallPlaced.cs @@ -0,0 +1,53 @@ +using System; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class IronBallPlaced : ModTile + { + public static Asset GlowTexture = null; + + public override void Load() + { + GlowTexture = ModContent.Request("CalamityMod/Tiles/IronBallPlaced_Glow"); + } + + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLighted[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + + DustType = DustID.Silver; + + AddMapEntry(new Color(108, 118, 134)); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementSmall.AddVariations(ModContent.ItemType(), Type, 0); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + // Dim flickering red light + r = MathF.Sin(Main.GlobalTimeWrappedHourly * 20) * 0.05f + 0.3f; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + spriteBatch.Draw(GlowTexture.Value, new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + CalamityUtils.TileDrawOffset, new Rectangle(Main.tile[i, j].TileFrameX, Main.tile[i, j].TileFrameY, 16, 16), Color.White); + } + } +} diff --git a/Tiles/IronBallPlaced.png b/Tiles/IronBallPlaced.png new file mode 100644 index 0000000000..232ca8d88f Binary files /dev/null and b/Tiles/IronBallPlaced.png differ diff --git a/Tiles/IronBallPlaced_Glow.png b/Tiles/IronBallPlaced_Glow.png new file mode 100644 index 0000000000..ae2214656d Binary files /dev/null and b/Tiles/IronBallPlaced_Glow.png differ diff --git a/Tiles/Ores/HallowedOre.cs b/Tiles/Ores/HallowedOre.cs index 435b3b19fd..b5413ddaa0 100644 --- a/Tiles/Ores/HallowedOre.cs +++ b/Tiles/Ores/HallowedOre.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Tiles.Ores { Main.tileLighted[Type] = true; Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; Main.tileOreFinderPriority[Type] = 690; diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index a26a343c5f..8e6a090e63 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -16,7 +16,6 @@ namespace CalamityMod.Tiles.Ores { Main.tileLighted[Type] = true; Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; Main.tileOreFinderPriority[Type] = 710; Main.tileShine[Type] = 2500; @@ -38,10 +37,6 @@ namespace CalamityMod.Tiles.Ores this.RegisterBlendMergeWith(TileID.Mud); } - - - - public override bool CanExplode(int i, int j) { return false; diff --git a/Tiles/Pylons/CragsPylonTile.cs b/Tiles/Pylons/CragsPylonTile.cs index 834768a28d..496e5368dc 100644 --- a/Tiles/Pylons/CragsPylonTile.cs +++ b/Tiles/Pylons/CragsPylonTile.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Tiles.Pylons public override NPCShop.Entry GetNPCShopEntry() { - return new NPCShop.Entry(AssociatedItem, CalamityConditions.InCrag); + return null; } //Doesnt require npcs to function diff --git a/UI/FishStocks/FishStocksUI.cs b/UI/FishStocks/FishStocksUI.cs index 65e0bd87d2..0bad391d92 100644 --- a/UI/FishStocks/FishStocksUI.cs +++ b/UI/FishStocks/FishStocksUI.cs @@ -90,7 +90,7 @@ namespace CalamityMod.UI float fishStocksUIScale = baseScale * Main.UIScale; Vector2 screenPos = new Vector2(Main.screenWidth / 1920, Main.screenHeight / 1080) * fishStocksUIScale; - Vector2 baseUIPosition = (screenPos + new Vector2(overlayBorderTex.Width() * 0.342f - (1000 * fishStocksSlideValue), overlayBorderTex.Height() * 0.566f + 54 * MathF.Ceiling(player.CountBuffs() / 11f))); + Vector2 baseUIPosition = (screenPos + new Vector2(overlayBorderTex.Width() * 0.342f * Main.UIScale - (1000 * fishStocksSlideValue), overlayBorderTex.Height() * 0.566f * MathHelper.Lerp(Main.UIScale, 1, 0.5f) + 54 * MathF.Ceiling(player.CountBuffs() / 11f))); Vector2 fishyDrawPos = baseUIPosition + new Vector2(112, 40) * fishStocksUIScale; Vector2 leftEdgePos = baseUIPosition - Vector2.UnitX * overlayTex.Width(); Vector2 rightEdgePos = baseUIPosition - Vector2.UnitX * overlayTex.Width() / 2.7f; @@ -123,7 +123,7 @@ namespace CalamityMod.UI spriteBatch.End(); using (PixelationLease.Scope(clearColor: Color.Transparent)) { - Matrix pixelationMatrix = Main.UIScaleMatrix * Matrix.CreateScale(0.5f, 0.5f, 1f); + Matrix pixelationMatrix = Matrix.CreateScale(0.5f, 0.5f, 1f); spriteBatch.Begin(SpriteSortMode.Deferred, default, SamplerState.PointClamp, default, default, default, pixelationMatrix); int lines = 5; @@ -150,10 +150,10 @@ namespace CalamityMod.UI spriteBatch.Draw(PixelationLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0f); string fishStocksPower = (player.Calamity().fishStockPower > -0 ? "+" : "") + Math.Round(player.Calamity().fishStockPower, 2).ToString() + "x"; - Vector2 textPos = baseUIPosition + new Vector2(-148 - (3.5f * fishStocksPower.Length), -118.5f) * baseScale; + Vector2 textPos = baseUIPosition + new Vector2(-148 - (3.5f * fishStocksPower.Length), -118.5f) * fishStocksUIScale; // Text - CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, fishStocksPower, textPos, Color.Lerp(shiftColor, Color.White, 0.35f), Color.Black, 1.4f * baseScale); + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, fishStocksPower, textPos, Color.Lerp(shiftColor, Color.White, 0.35f), Color.Black, 1.4f * fishStocksUIScale); // Screen overlay if (!CalamityClientConfig.Instance.Photosensitivity) diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 7ad793f3ad..848c00118a 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -11,6 +11,7 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod { @@ -160,17 +161,17 @@ namespace CalamityMod // Color debuffs based on their element type in the vulnerability and resistance system // If a debuff has multiple types, the colors are mixed // If a debuff is typeless, is gets the typeless color - else if (BuffDatasets.DebuffDataset[debuffId] is not null) + else if (CalamityBuffSets.DebuffDataset[debuffId] is not null) { if (!debuffColorWeightsCache.TryGetValue(debuffId, out var weights)) { weights = [ - (SicknessDebuffColor, BuffDatasets.DebuffDataset[debuffId].SicknessDebuffScaling), - (FireDebuffColor, BuffDatasets.DebuffDataset[debuffId].HeatDebuffScaling), - (WaterDebuffColor, BuffDatasets.DebuffDataset[debuffId].WaterDebuffScaling), - (ElectricDebuffColor, BuffDatasets.DebuffDataset[debuffId].ElectricDebuffScaling), - (ColdDebuffColor, BuffDatasets.DebuffDataset[debuffId].ColdDebuffScaling), + (SicknessDebuffColor, CalamityBuffSets.DebuffDataset[debuffId].SicknessDebuffScaling), + (FireDebuffColor, CalamityBuffSets.DebuffDataset[debuffId].HeatDebuffScaling), + (WaterDebuffColor, CalamityBuffSets.DebuffDataset[debuffId].WaterDebuffScaling), + (ElectricDebuffColor, CalamityBuffSets.DebuffDataset[debuffId].ElectricDebuffScaling), + (ColdDebuffColor, CalamityBuffSets.DebuffDataset[debuffId].ColdDebuffScaling), ]; } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index aacef829b0..e18faa6de9 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -279,7 +279,7 @@ namespace CalamityMod { ModContent.NPCType(), immuneToEverything }, { ModContent.NPCType(), immuneToEverything }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.OnFire, ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }) }, { ModContent.NPCType(), immuneToEverything }, { ModContent.NPCType(), immuneToEverything }, diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index b4441f1453..cd940120f8 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -307,7 +307,7 @@ namespace CalamityMod.World #region Sunken Sea Lab - public static void FillSunkenSeaLaboratoryChest(Chest chest, int type, bool hasPlacedLogAndSchematic) + public static void FillSunkenSeaLaboratoryChest(Chest chest, int type, bool notFirstChest) { int potionType = Utils.SelectRandom(WorldGen.genRand, ItemID.EndurancePotion, ItemID.GravitationPotion, ItemID.HeartreachPotion, ItemID.LifeforcePotion); List contents = new List() @@ -324,7 +324,7 @@ namespace CalamityMod.World //Adds the Planetoid Seeking Mechanism contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - if (!hasPlacedLogAndSchematic) + if (notFirstChest) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); @@ -396,7 +396,7 @@ namespace CalamityMod.World #endregion #region Ice Lab - public static void FillIceLaboratoryChest(Chest chest, int type, bool hasPlacedLogAndSchematic) + public static void FillIceLaboratoryChest(Chest chest, int type, bool notFirstChest) { int potionType = Utils.SelectRandom(WorldGen.genRand, ItemID.EndurancePotion, ItemID.GravitationPotion, ItemID.HeartreachPotion, ItemID.LifeforcePotion); List contents = new List() @@ -413,7 +413,7 @@ namespace CalamityMod.World //Adds the Base Seeking Mechanism contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - if (!hasPlacedLogAndSchematic) + if (notFirstChest) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index a1e3b2c1b4..0850262d29 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Food; +using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.FurnitureAuric; @@ -537,7 +538,7 @@ namespace CalamityMod.World public static void GenerateAuricLandMines() { int landMineID = ModContent.TileType(); - int landMineChance = Main.zenithWorld ? 150 : 300; + int landMineChance = Main.zenithWorld ? 125 : 300; float maxDepth = Main.maxTilesY * (Main.zenithWorld ? 0.75f : 0.5f); // depth increased in gfb due to the evil columns that extend further downward for (int x = 0; x < Main.maxTilesX; x++) { @@ -564,5 +565,29 @@ namespace CalamityMod.World } } #endregion + + #region Iron Ball + public static void GenerateIronBall() + { + int ballID = ModContent.TileType(); + int attempts = 0; + int ballsPlaced = 0; + int maxBalls = 8; + while (attempts < 10000) + { + Point location = new Point(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)Main.rockLayer, Main.UnderworldLayer)); + Tile t = CalamityUtils.ParanoidTileRetrieval(location.X, location.Y); + Tile above = CalamityUtils.ParanoidTileRetrieval(location.X, location.Y - 1); + if (t.TileType == TileID.Stone && t.HasTile && !above.HasTile) + { + WorldGen.SlopeTile(location.X, location.Y); + WorldGen.PlaceTile(location.X, location.Y - 1, ballID); + ballsPlaced++; + } + if (ballsPlaced >= maxBalls) + break; + } + } + #endregion } } diff --git a/World/Planets/LuminitePlanet.cs b/World/Planets/LuminitePlanet.cs index fccaf54011..d735d0c0b2 100644 --- a/World/Planets/LuminitePlanet.cs +++ b/World/Planets/LuminitePlanet.cs @@ -70,7 +70,7 @@ namespace CalamityMod.World.Planets // Create walls. WorldUtils.Gen(offsetedOrigin, new Shapes.Circle(radius - 4), Actions.Chain(new GenAction[] { - new Actions.PlaceWall(WallID.Stone) + new Actions.PlaceWall(WallID.RocksUnsafe1) })); // Place an inner luminite core. diff --git a/World/Planets/LuminitePlanet2.cs b/World/Planets/LuminitePlanet2.cs index e9cd5f9204..6a6323c1cb 100644 --- a/World/Planets/LuminitePlanet2.cs +++ b/World/Planets/LuminitePlanet2.cs @@ -38,7 +38,7 @@ namespace CalamityMod.World.Planets // Create walls. WorldUtils.Gen(offsetedOrigin, new Shapes.Circle(radius - 4), Actions.Chain(new GenAction[] { - new Actions.PlaceWall(WallID.Stone) + new Actions.PlaceWall(WallID.RocksUnsafe1) })); // Place an inner luminite core. diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index 510e655dc5..9d02088c97 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -430,7 +430,6 @@ namespace CalamityMod.World #region Ice Shrine public static void FillIceShrineChest(Chest chest) { - int foodType = Utils.SelectRandom(WorldGen.genRand, ItemID.ChristmasPudding, ItemID.SugarCookie, ItemID.GingerbreadCookie); List contents = new List() { new ChestItem(ItemType(), 1), @@ -439,7 +438,7 @@ namespace CalamityMod.World new ChestItem(ItemID.IceTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(8, 10 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), - new ChestItem(foodType, WorldGen.genRand.Next(10, 12 + 1)), + new ChestItem(ItemID.IceCream, WorldGen.genRand.Next(10, 12 + 1)), }; if (Main.zenithWorld)